fix:
1.订舱通知单信保回填更新客户信保额度申请
This commit is contained in:
parent
a98ad5ae17
commit
5c8660bba1
@ -39,6 +39,7 @@ import kd.bos.util.StringUtils;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import static com.yem.wm.es.contactbook.op.ContactBookSaveOp.uploadAttachmentPanel;
|
import static com.yem.wm.es.contactbook.op.ContactBookSaveOp.uploadAttachmentPanel;
|
||||||
import static com.yem.wm.es.salesorder.from.SalesOrderEdit.carryReportCategoryAndHsCode;
|
import static com.yem.wm.es.salesorder.from.SalesOrderEdit.carryReportCategoryAndHsCode;
|
||||||
@ -88,8 +89,7 @@ public class StorageTransEdit extends AbstractBillPlugIn implements BeforeF7Sele
|
|||||||
if ("yem_es_materialinfo".equals(entryProp.toString())) {
|
if ("yem_es_materialinfo".equals(entryProp.toString())) {
|
||||||
for (int row : rowIndexs) {
|
for (int row : rowIndexs) {
|
||||||
boolean flag = true;
|
boolean flag = true;
|
||||||
DynamicObject[] encasement = BusinessDataServiceHelper.load("yem_im_encasement", "" +
|
DynamicObject[] encasement = BusinessDataServiceHelper.load("yem_im_encasement", "yem_im_materialinfo_mi.yem_sourceentryid,yem_im_materialinfo_mi.yem_packingqty", new QFilter[]{
|
||||||
"yem_im_materialinfo_mi.yem_sourceentryid,yem_im_materialinfo_mi.yem_packingqty", new QFilter[]{
|
|
||||||
new QFilter("yem_sourcebillid", QCP.equals, dataEntity.getPkValue())
|
new QFilter("yem_sourcebillid", QCP.equals, dataEntity.getPkValue())
|
||||||
});
|
});
|
||||||
if (materialinfo != null && materialinfo.size() > row) {
|
if (materialinfo != null && materialinfo.size() > row) {
|
||||||
@ -220,6 +220,39 @@ public class StorageTransEdit extends AbstractBillPlugIn implements BeforeF7Sele
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算台数
|
||||||
|
*/
|
||||||
|
private void qty() {
|
||||||
|
DynamicObjectCollection yemEsMaterialinfo = this.getModel().getEntryEntity("yem_es_materialinfo");
|
||||||
|
if (!yemEsMaterialinfo.isEmpty()) {
|
||||||
|
Map<String, BigDecimal> map = new HashMap<>();
|
||||||
|
for (DynamicObject loadSingle : yemEsMaterialinfo) {
|
||||||
|
String aLong = loadSingle.getString("yem_productmodel.yem_products.number");
|
||||||
|
BigDecimal yemQty = loadSingle.getBigDecimal("yem_qty");
|
||||||
|
if (map.get(aLong) != null) {
|
||||||
|
BigDecimal bigDecimal = map.get(aLong);
|
||||||
|
map.put(aLong, bigDecimal.add(yemQty));
|
||||||
|
} else {
|
||||||
|
map.put(aLong, yemQty);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DynamicObjectCollection yemEsSalesorderL = this.getModel().getEntryEntity("yem_es_salesorder_l");
|
||||||
|
if (yemEsSalesorderL != null) {
|
||||||
|
for (int i = 0; i < yemEsSalesorderL.size(); i++) {
|
||||||
|
DynamicObject loadSingle = yemEsSalesorderL.get(i);
|
||||||
|
DynamicObject yemGiftproactype = loadSingle.getDynamicObject("yem_giftproactype");
|
||||||
|
if (yemGiftproactype != null) {
|
||||||
|
String aLong = yemGiftproactype.getString("number");
|
||||||
|
if (map.get(aLong) != null) {
|
||||||
|
this.getModel().setValue("yem_tsagerqty", map.get(aLong), i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void customclass(ChangeData changeData) {
|
private void customclass(ChangeData changeData) {
|
||||||
Object newValue = changeData.getNewValue();
|
Object newValue = changeData.getNewValue();
|
||||||
int rowIndex = changeData.getRowIndex();
|
int rowIndex = changeData.getRowIndex();
|
||||||
@ -229,7 +262,6 @@ public class StorageTransEdit extends AbstractBillPlugIn implements BeforeF7Sele
|
|||||||
String yemUnit = yem_customclass.getString("yem_unit");
|
String yemUnit = yem_customclass.getString("yem_unit");
|
||||||
DynamicObject bdMeasureunits = BusinessDataServiceHelper.loadSingle("bd_measureunits", "id,number,name"
|
DynamicObject bdMeasureunits = BusinessDataServiceHelper.loadSingle("bd_measureunits", "id,number,name"
|
||||||
, new QFilter[]{new QFilter("name", QCP.equals, yemUnit)});
|
, new QFilter[]{new QFilter("name", QCP.equals, yemUnit)});
|
||||||
if (bdMeasureunits != null) {
|
|
||||||
// long aLong = bdMeasureunits.getLong("id");
|
// long aLong = bdMeasureunits.getLong("id");
|
||||||
this.getModel().setValue("yem_declareunit", bdMeasureunits, rowIndex);
|
this.getModel().setValue("yem_declareunit", bdMeasureunits, rowIndex);
|
||||||
} else {
|
} else {
|
||||||
@ -238,9 +270,6 @@ public class StorageTransEdit extends AbstractBillPlugIn implements BeforeF7Sele
|
|||||||
} else {
|
} else {
|
||||||
this.getModel().setValue("yem_declareunit", null, rowIndex);
|
this.getModel().setValue("yem_declareunit", null, rowIndex);
|
||||||
}
|
}
|
||||||
}else {
|
|
||||||
this.getModel().setValue("yem_declareunit",null,rowIndex);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Businesssort() {
|
private void Businesssort() {
|
||||||
@ -530,7 +559,7 @@ public class StorageTransEdit extends AbstractBillPlugIn implements BeforeF7Sele
|
|||||||
model.setValue("yem_giftproactype", productType, entryRow);//产品机型
|
model.setValue("yem_giftproactype", productType, entryRow);//产品机型
|
||||||
|
|
||||||
model.setValue("yem_bd_products", productss, entryRow);//产品分类
|
model.setValue("yem_bd_products", productss, entryRow);//产品分类
|
||||||
model.setValue("yem_tsagerqty", tsagerQty, entryRow);//台数
|
// model.setValue("yem_tsagerqty", tsagerQty, entryRow);//台数
|
||||||
model.setValue("yem_singlegiftamt", giveAmo, entryRow);//单台礼品金额
|
model.setValue("yem_singlegiftamt", giveAmo, entryRow);//单台礼品金额
|
||||||
model.setValue("yem_singlegiftamtloc", giveAmoBase, entryRow);//单台礼品金额本位币
|
model.setValue("yem_singlegiftamtloc", giveAmoBase, entryRow);//单台礼品金额本位币
|
||||||
model.setValue("yem_giftamt", tsagerQty.multiply(giveAmo), entryRow);//礼品金额
|
model.setValue("yem_giftamt", tsagerQty.multiply(giveAmo), entryRow);//礼品金额
|
||||||
@ -576,7 +605,7 @@ public class StorageTransEdit extends AbstractBillPlugIn implements BeforeF7Sele
|
|||||||
model.setValue("yem_giftproactype", productType, entryRow);//产品机型
|
model.setValue("yem_giftproactype", productType, entryRow);//产品机型
|
||||||
|
|
||||||
model.setValue("yem_bd_products", productss, entryRow);//产品分类
|
model.setValue("yem_bd_products", productss, entryRow);//产品分类
|
||||||
model.setValue("yem_tsagerqty", tsagerQty, entryRow);//台数
|
// model.setValue("yem_tsagerqty", tsagerQty, entryRow);//台数
|
||||||
model.setValue("yem_singlegiftamt", giveAmo, entryRow);//单台礼品金额
|
model.setValue("yem_singlegiftamt", giveAmo, entryRow);//单台礼品金额
|
||||||
model.setValue("yem_singlegiftamtloc", giveAmoBase, entryRow);//单台礼品金额本位币
|
model.setValue("yem_singlegiftamtloc", giveAmoBase, entryRow);//单台礼品金额本位币
|
||||||
model.setValue("yem_giftamt", tsagerQty.multiply(giveAmo), entryRow);//礼品金额
|
model.setValue("yem_giftamt", tsagerQty.multiply(giveAmo), entryRow);//礼品金额
|
||||||
@ -588,6 +617,7 @@ public class StorageTransEdit extends AbstractBillPlugIn implements BeforeF7Sele
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
qty();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void visGiftGive() {
|
public void visGiftGive() {
|
||||||
@ -602,11 +632,7 @@ public class StorageTransEdit extends AbstractBillPlugIn implements BeforeF7Sele
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (flag) {
|
view.setVisible(flag, "yem_tabpageap6");
|
||||||
view.setVisible(true, "yem_tabpageap6");
|
|
||||||
} else {
|
|
||||||
view.setVisible(false, "yem_tabpageap6");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -781,6 +807,7 @@ public class StorageTransEdit extends AbstractBillPlugIn implements BeforeF7Sele
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 订舱通知单和订舱通知单信保回填之间同步附件
|
* 订舱通知单和订舱通知单信保回填之间同步附件
|
||||||
|
*
|
||||||
* @param dataEntity
|
* @param dataEntity
|
||||||
* @see ContactBookSaveOp#uploadAttachmentPanel(DynamicObject, DynamicObject)
|
* @see ContactBookSaveOp#uploadAttachmentPanel(DynamicObject, DynamicObject)
|
||||||
*/
|
*/
|
||||||
@ -812,6 +839,7 @@ public class StorageTransEdit extends AbstractBillPlugIn implements BeforeF7Sele
|
|||||||
if ("bldatebackfilled".equals(actionId) && returnData != null) {
|
if ("bldatebackfilled".equals(actionId) && returnData != null) {
|
||||||
Map<String, Object> map = (Map) returnData;
|
Map<String, Object> map = (Map) returnData;
|
||||||
Date yem_tddate = (Date) map.get("yem_tddate");
|
Date yem_tddate = (Date) map.get("yem_tddate");
|
||||||
|
dataEntity.set("yem_tddate", yem_tddate);
|
||||||
if (isLastShip(dataEntity)) {
|
if (isLastShip(dataEntity)) {
|
||||||
// 同步下单平台状态
|
// 同步下单平台状态
|
||||||
syncOrderStatus();
|
syncOrderStatus();
|
||||||
@ -820,7 +848,6 @@ public class StorageTransEdit extends AbstractBillPlugIn implements BeforeF7Sele
|
|||||||
updateCsrCredit(yem_tddate);
|
updateCsrCredit(yem_tddate);
|
||||||
// 更新订舱通知单
|
// 更新订舱通知单
|
||||||
updateStoragetrans(yem_tddate);
|
updateStoragetrans(yem_tddate);
|
||||||
dataEntity.set("yem_tddate", yem_tddate);
|
|
||||||
SaveServiceHelper.save(new DynamicObject[]{dataEntity});
|
SaveServiceHelper.save(new DynamicObject[]{dataEntity});
|
||||||
IFormView view = this.getView();
|
IFormView view = this.getView();
|
||||||
view.updateView("yem_tddate");
|
view.updateView("yem_tddate");
|
||||||
@ -835,6 +862,7 @@ public class StorageTransEdit extends AbstractBillPlugIn implements BeforeF7Sele
|
|||||||
/**
|
/**
|
||||||
* 是否是最后一次发运(订舱)
|
* 是否是最后一次发运(订舱)
|
||||||
* 是否是最后一批发货
|
* 是否是最后一批发货
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static boolean isLastShip(DynamicObject dataEntity) {
|
public static boolean isLastShip(DynamicObject dataEntity) {
|
||||||
@ -895,21 +923,17 @@ public class StorageTransEdit extends AbstractBillPlugIn implements BeforeF7Sele
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void putAttachmentData(Map < String, Object > attachInfor, IDataModel modal, IFormView view)
|
public void putAttachmentData(Map<String, Object> attachInfor, IDataModel modal, IFormView view) {
|
||||||
{
|
|
||||||
String entityId = view.getEntityId();
|
String entityId = view.getEntityId();
|
||||||
view.invokeOperation("refresh");
|
view.invokeOperation("refresh");
|
||||||
if(attachInfor != null)
|
if (attachInfor != null) {
|
||||||
{
|
|
||||||
List<Map<String, Object>> retData = (List<Map<String, Object>>) attachInfor.get("attach");
|
List<Map<String, Object>> retData = (List<Map<String, Object>>) attachInfor.get("attach");
|
||||||
Long userId = (Long) attachInfor.get("user");
|
Long userId = (Long) attachInfor.get("user");
|
||||||
Date date = (Date) attachInfor.get("date");
|
Date date = (Date) attachInfor.get("date");
|
||||||
DynamicObject dataEntity = modal.getDataEntity(true);
|
DynamicObject dataEntity = modal.getDataEntity(true);
|
||||||
// ...
|
// ...
|
||||||
if(retData != null && !retData.isEmpty())
|
if (retData != null && !retData.isEmpty()) {
|
||||||
{
|
for (Map<String, Object> map : retData) {
|
||||||
for(Map < String, Object > map: retData)
|
|
||||||
{
|
|
||||||
String url = (String) map.get("url");
|
String url = (String) map.get("url");
|
||||||
String name = (String) map.get("name");
|
String name = (String) map.get("name");
|
||||||
// 持久化附件到服务器
|
// 持久化附件到服务器
|
||||||
@ -1000,6 +1024,22 @@ public class StorageTransEdit extends AbstractBillPlugIn implements BeforeF7Sele
|
|||||||
// long id = csrcreditline.getLong("id");
|
// long id = csrcreditline.getLong("id");
|
||||||
// DynamicObject yem_im_csrcreditline = BusinessDataServiceHelper.loadSingle(id, "yem_im_csrcreditline");
|
// DynamicObject yem_im_csrcreditline = BusinessDataServiceHelper.loadSingle(id, "yem_im_csrcreditline");
|
||||||
// if (yem_im_csrcreditline != null) {
|
// if (yem_im_csrcreditline != null) {
|
||||||
|
Date yemRecentlapse = csrcreditline.getDate("yem_recentlapse");
|
||||||
|
BigDecimal yemInactivityperiod = csrcreditline.getBigDecimal("yem_inactivityperiod");
|
||||||
|
if (yemRecentlapse != null) {
|
||||||
|
if (yemInactivityperiod.compareTo(BigDecimal.ZERO) != 0) {
|
||||||
|
long daysInMilliseconds = yemInactivityperiod.longValue() * TimeUnit.DAYS.toMillis(1);
|
||||||
|
Date date = new Date(yemRecentlapse.getTime() + daysInMilliseconds);
|
||||||
|
csrcreditline.set("yem_unused", date);
|
||||||
|
Date newdate = new Date();
|
||||||
|
long millisDifference = date.getTime() - newdate.getTime();
|
||||||
|
long daysDifference = TimeUnit.MILLISECONDS.toDays(millisDifference);
|
||||||
|
BigDecimal bigDecimalDaysDifference = BigDecimal.valueOf(daysDifference);
|
||||||
|
csrcreditline.set("yem_countdown",bigDecimalDaysDifference);
|
||||||
|
// } else {
|
||||||
|
// csrcreditline.set("yem_unused", yemRecentlapse);
|
||||||
|
}
|
||||||
|
}
|
||||||
DynamicObjectCollection yem_creditdetail = csrcreditline.getDynamicObjectCollection("yem_im_info");
|
DynamicObjectCollection yem_creditdetail = csrcreditline.getDynamicObjectCollection("yem_im_info");
|
||||||
for (int i = 0; i < yem_creditdetail.size(); i++) {
|
for (int i = 0; i < yem_creditdetail.size(); i++) {
|
||||||
DynamicObject dynamicObject = yem_creditdetail.get(i);
|
DynamicObject dynamicObject = yem_creditdetail.get(i);
|
||||||
@ -1100,6 +1140,7 @@ public class StorageTransEdit extends AbstractBillPlugIn implements BeforeF7Sele
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private QFilter filterCustomClass(int index) {
|
private QFilter filterCustomClass(int index) {
|
||||||
IDataModel model = this.getModel();
|
IDataModel model = this.getModel();
|
||||||
DynamicObject[] loads = getDeclarationElementsUseF7Select(model, index, "yem_customclass");
|
DynamicObject[] loads = getDeclarationElementsUseF7Select(model, index, "yem_customclass");
|
||||||
@ -1166,6 +1207,7 @@ public class StorageTransEdit extends AbstractBillPlugIn implements BeforeF7Sele
|
|||||||
/**
|
/**
|
||||||
* 订舱通知单计算 出库报关金额值
|
* 订舱通知单计算 出库报关金额值
|
||||||
* 出库报关金额差值 = 出库金额 - 订舱通知单明细的销售金额(价格条款)
|
* 出库报关金额差值 = 出库金额 - 订舱通知单明细的销售金额(价格条款)
|
||||||
|
*
|
||||||
* @param dataEntity
|
* @param dataEntity
|
||||||
*/
|
*/
|
||||||
public static void calculateExportAmount(DynamicObject dataEntity) {
|
public static void calculateExportAmount(DynamicObject dataEntity) {
|
||||||
|
Loading…
Reference in New Issue
Block a user