1.采购申请单调整
This commit is contained in:
parent
ee738e38ce
commit
75a0ebc55a
|
|
@ -8,6 +8,7 @@ import kd.bos.dataentity.entity.DynamicObject;
|
|||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.dataentity.utils.StringUtils;
|
||||
import kd.bos.entity.datamodel.IDataModel;
|
||||
import kd.bos.entity.datamodel.events.AfterDeleteRowEventArgs;
|
||||
import kd.bos.entity.datamodel.events.ChangeData;
|
||||
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
|
||||
import kd.bos.form.FormShowParameter;
|
||||
|
|
@ -60,6 +61,31 @@ public class PurApplyBillPlugin extends AbstractBillPlugIn implements Plugin {
|
|||
|
||||
private final static String GZ_ORGNUMBER = "GZLC";
|
||||
|
||||
@Override
|
||||
public void afterDeleteRow(AfterDeleteRowEventArgs e) {
|
||||
super.afterDeleteRow(e);
|
||||
//折扣前价税合计:分录优惠金额,现返,货返金额分摊
|
||||
IDataModel model = this.getModel();
|
||||
EntryFieldRefresher entryFieldRefresher = new EntryFieldRefresher();
|
||||
BigDecimal tqq9_discountamt_sh = (BigDecimal) model.getValue("tqq9_discountamt_sh");
|
||||
entryFieldRefresher.updateAmountByOrg(SH_ORGNUMBER, "tqq9_disamount", tqq9_discountamt_sh, model);
|
||||
BigDecimal tqq9_hshfsyje_sh = (BigDecimal) model.getValue("tqq9_hshfsyje_sh");
|
||||
entryFieldRefresher.updateAmountByOrg(SH_ORGNUMBER, "tqq9_hfamount", tqq9_hshfsyje_sh, model);
|
||||
BigDecimal tqq9_hsxfsyje_sh = (BigDecimal) model.getValue("tqq9_hsxfsyje_sh");
|
||||
entryFieldRefresher.updateAmountByOrg(SH_ORGNUMBER, "tqq9_xfamount", tqq9_hsxfsyje_sh, model);
|
||||
BigDecimal tqq9_discountamt_bj = (BigDecimal) model.getValue("tqq9_discountamt_bj");
|
||||
entryFieldRefresher.updateAmountByOrg(BJ_ORGNUMBER, "tqq9_disamount", tqq9_discountamt_bj, model);
|
||||
BigDecimal tqq9_hshfsyje_bj = (BigDecimal) model.getValue("tqq9_hshfsyje_bj");
|
||||
entryFieldRefresher.updateAmountByOrg(BJ_ORGNUMBER, "tqq9_hfamount", tqq9_hshfsyje_bj, model);
|
||||
BigDecimal tqq9_hsxfsyje_bj = (BigDecimal) model.getValue("tqq9_hsxfsyje_bj");
|
||||
entryFieldRefresher.updateAmountByOrg(BJ_ORGNUMBER, "tqq9_xfamount", tqq9_hsxfsyje_bj, model);
|
||||
BigDecimal tqq9_discountamt_gz = (BigDecimal) model.getValue("tqq9_discountamt_gz");
|
||||
entryFieldRefresher.updateAmountByOrg(GZ_ORGNUMBER, "tqq9_disamount", tqq9_discountamt_gz, model);
|
||||
BigDecimal tqq9_hshfsyje_gz = (BigDecimal) model.getValue("tqq9_hshfsyje_gz");
|
||||
entryFieldRefresher.updateAmountByOrg(GZ_ORGNUMBER, "tqq9_hfamount", tqq9_hshfsyje_gz, model);
|
||||
BigDecimal tqq9_hsxfsyje_gz = (BigDecimal) model.getValue("tqq9_hsxfsyje_gz");
|
||||
entryFieldRefresher.updateAmountByOrg(GZ_ORGNUMBER, "tqq9_xfamount", tqq9_hsxfsyje_gz, model);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void propertyChanged(PropertyChangedArgs e) {
|
||||
|
|
@ -109,11 +135,11 @@ public class PurApplyBillPlugin extends AbstractBillPlugIn implements Plugin {
|
|||
model.setValue("tqq9_hsxfkyje_sh", totalMoneyAvailable);//含税现返可用金额
|
||||
}
|
||||
}
|
||||
lcLogService.savelog("查询返利金额",URL,false,true, queryMap.toString(), bodyString);
|
||||
lcLogService.savelog("查询返利金额", URL, false, true, queryMap.toString(), bodyString);
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
lcLogService.savelog("创建返利规则",URL,false,false, queryMap.toString(), "接口调用报错,无返回值");
|
||||
throw new RuntimeException(ex+",请求返利系统失败");
|
||||
lcLogService.savelog("创建返利规则", URL, false, false, queryMap.toString(), "接口调用报错,无返回值");
|
||||
throw new RuntimeException(ex + ",请求返利系统失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -129,35 +155,30 @@ public class PurApplyBillPlugin extends AbstractBillPlugIn implements Plugin {
|
|||
BigDecimal applyqty = (BigDecimal) model.getValue("applyqty");
|
||||
EntryFieldRefresher entryFieldRefresher = new EntryFieldRefresher();
|
||||
entryFieldRefresher.sumEntrByOrg(SH_ORGNUMBER, "applyqty", "tqq9_purqty_sh", model);
|
||||
// view.updateView();
|
||||
}
|
||||
//应付金额
|
||||
if (StringUtils.equals("tqq9_yfje", name)) {
|
||||
BigDecimal tqq9_yfje = (BigDecimal) model.getValue("tqq9_yfje");
|
||||
EntryFieldRefresher entryFieldRefresher = new EntryFieldRefresher();
|
||||
entryFieldRefresher.sumEntrByOrg(SH_ORGNUMBER, "tqq9_yfje", "tqq9_payamount_sh", model);
|
||||
// view.updateView();
|
||||
}
|
||||
//优惠金额_单头
|
||||
if (StringUtils.equals("tqq9_discountamt_sh", name)) {
|
||||
BigDecimal tqq9_discountamt_sh = (BigDecimal) model.getValue("tqq9_discountamt_sh");
|
||||
EntryFieldRefresher entryFieldRefresher = new EntryFieldRefresher();
|
||||
entryFieldRefresher.updateAmountByOrg(SH_ORGNUMBER, "tqq9_disamount", tqq9_discountamt_sh, model);
|
||||
// view.updateView();
|
||||
}
|
||||
//货返_单头
|
||||
if (StringUtils.equals("tqq9_hshfsyje_sh", name)) {
|
||||
BigDecimal tqq9_hshfsyje_sh = (BigDecimal) model.getValue("tqq9_hshfsyje_sh");
|
||||
EntryFieldRefresher entryFieldRefresher = new EntryFieldRefresher();
|
||||
entryFieldRefresher.updateAmountByOrg(SH_ORGNUMBER, "tqq9_hfamount", tqq9_hshfsyje_sh, model);
|
||||
// view.updateView();
|
||||
}
|
||||
//现返_单头
|
||||
if (StringUtils.equals("tqq9_hsxfsyje_sh", name)) {
|
||||
BigDecimal tqq9_hsxfsyje_sh = (BigDecimal) model.getValue("tqq9_hsxfsyje_sh");
|
||||
EntryFieldRefresher entryFieldRefresher = new EntryFieldRefresher();
|
||||
entryFieldRefresher.updateAmountByOrg(SH_ORGNUMBER, "tqq9_xfamount", tqq9_hsxfsyje_sh, model);
|
||||
// view.updateView();
|
||||
}
|
||||
//--------------北京------------------
|
||||
//集采供应商
|
||||
|
|
@ -197,13 +218,12 @@ public class PurApplyBillPlugin extends AbstractBillPlugIn implements Plugin {
|
|||
model.setValue("tqq9_hsxfkyje_bj", totalMoneyAvailable);//含税现返可用金额
|
||||
}
|
||||
}
|
||||
lcLogService.savelog("查询返利金额",URL,false,true, queryMap.toString(), bodyString);
|
||||
lcLogService.savelog("查询返利金额", URL, false, true, queryMap.toString(), bodyString);
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
lcLogService.savelog("创建返利规则",URL,false,false, queryMap.toString(), "接口调用报错,无返回值");
|
||||
throw new RuntimeException(ex+",请求返利系统失败");
|
||||
lcLogService.savelog("创建返利规则", URL, false, false, queryMap.toString(), "接口调用报错,无返回值");
|
||||
throw new RuntimeException(ex + ",请求返利系统失败");
|
||||
}
|
||||
// view.updateView();
|
||||
}
|
||||
}
|
||||
//收货仓库
|
||||
|
|
@ -211,42 +231,36 @@ public class PurApplyBillPlugin extends AbstractBillPlugIn implements Plugin {
|
|||
DynamicObject tqq9_rewares_bj = (DynamicObject) model.getValue("tqq9_rewares_bj");
|
||||
EntryFieldRefresher entryFieldRefresher = new EntryFieldRefresher();
|
||||
entryFieldRefresher.updateDynamicObjectByOrg(BJ_ORGNUMBER, "warehouse", tqq9_rewares_bj, model);
|
||||
// view.updateView();
|
||||
}
|
||||
//采购数量
|
||||
if (StringUtils.equals("applyqty", name)) {
|
||||
BigDecimal applyqty = (BigDecimal) model.getValue("applyqty");
|
||||
EntryFieldRefresher entryFieldRefresher = new EntryFieldRefresher();
|
||||
entryFieldRefresher.sumEntrByOrg(BJ_ORGNUMBER, "applyqty", "tqq9_purqty_bj", model);
|
||||
// view.updateView();
|
||||
}
|
||||
//应付金额
|
||||
if (StringUtils.equals("tqq9_yfje", name)) {
|
||||
BigDecimal tqq9_yfje = (BigDecimal) model.getValue("tqq9_yfje");
|
||||
EntryFieldRefresher entryFieldRefresher = new EntryFieldRefresher();
|
||||
entryFieldRefresher.sumEntrByOrg(BJ_ORGNUMBER, "tqq9_yfje", "tqq9_payamount_bj", model);
|
||||
// view.updateView();
|
||||
}
|
||||
//优惠金额_单头
|
||||
if (StringUtils.equals("tqq9_discountamt_bj", name)) {
|
||||
BigDecimal tqq9_discountamt_bj = (BigDecimal) model.getValue("tqq9_discountamt_bj");
|
||||
EntryFieldRefresher entryFieldRefresher = new EntryFieldRefresher();
|
||||
entryFieldRefresher.updateAmountByOrg(BJ_ORGNUMBER, "tqq9_disamount", tqq9_discountamt_bj, model);
|
||||
// view.updateView();
|
||||
}
|
||||
//货返_单头
|
||||
if (StringUtils.equals("tqq9_hshfsyje_bj", name)) {
|
||||
BigDecimal tqq9_hshfsyje_bj = (BigDecimal) model.getValue("tqq9_hshfsyje_bj");
|
||||
EntryFieldRefresher entryFieldRefresher = new EntryFieldRefresher();
|
||||
entryFieldRefresher.updateAmountByOrg(BJ_ORGNUMBER, "tqq9_hfamount", tqq9_hshfsyje_bj, model);
|
||||
// view.updateView();
|
||||
}
|
||||
//现返_单头
|
||||
if (StringUtils.equals("tqq9_hsxfsyje_bj", name)) {
|
||||
BigDecimal tqq9_hsxfsyje_bj = (BigDecimal) model.getValue("tqq9_hsxfsyje_bj");
|
||||
EntryFieldRefresher entryFieldRefresher = new EntryFieldRefresher();
|
||||
entryFieldRefresher.updateAmountByOrg(BJ_ORGNUMBER, "tqq9_xfamount", tqq9_hsxfsyje_bj, model);
|
||||
// view.updateView();
|
||||
}
|
||||
//--------------广州------------------
|
||||
//集采供应商
|
||||
|
|
@ -287,11 +301,11 @@ public class PurApplyBillPlugin extends AbstractBillPlugIn implements Plugin {
|
|||
model.setValue("tqq9_hsxfkyje_gz", totalMoneyAvailable);//含税现返可用金额
|
||||
}
|
||||
}
|
||||
lcLogService.savelog("查询返利金额",URL,false,true, queryMap.toString(), bodyString);
|
||||
lcLogService.savelog("查询返利金额", URL, false, true, queryMap.toString(), bodyString);
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
lcLogService.savelog("创建返利规则",URL,false,false, queryMap.toString(), "接口调用报错,无返回值");
|
||||
throw new RuntimeException(ex+",请求返利系统失败");
|
||||
lcLogService.savelog("创建返利规则", URL, false, false, queryMap.toString(), "接口调用报错,无返回值");
|
||||
throw new RuntimeException(ex + ",请求返利系统失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -300,44 +314,38 @@ public class PurApplyBillPlugin extends AbstractBillPlugIn implements Plugin {
|
|||
DynamicObject tqq9_rewares_gz = (DynamicObject) model.getValue("tqq9_rewares_gz");
|
||||
EntryFieldRefresher entryFieldRefresher = new EntryFieldRefresher();
|
||||
entryFieldRefresher.updateDynamicObjectByOrg(GZ_ORGNUMBER, "warehouse", tqq9_rewares_gz, model);
|
||||
// view.updateView();
|
||||
}
|
||||
//采购数量
|
||||
if (StringUtils.equals("applyqty", name)) {
|
||||
BigDecimal applyqty = (BigDecimal) model.getValue("applyqty");
|
||||
EntryFieldRefresher entryFieldRefresher = new EntryFieldRefresher();
|
||||
entryFieldRefresher.sumEntrByOrg(GZ_ORGNUMBER, "applyqty", "tqq9_purqty_gz", model);
|
||||
// view.updateView();
|
||||
}
|
||||
//应付金额
|
||||
if (StringUtils.equals("tqq9_yfje", name)) {
|
||||
BigDecimal tqq9_yfje = (BigDecimal) model.getValue("tqq9_yfje");
|
||||
EntryFieldRefresher entryFieldRefresher = new EntryFieldRefresher();
|
||||
entryFieldRefresher.sumEntrByOrg(GZ_ORGNUMBER, "tqq9_yfje", "tqq9_payamount_gz", model);
|
||||
// view.updateView();
|
||||
}
|
||||
//优惠金额_单头
|
||||
if (StringUtils.equals("tqq9_discountamt_gz", name)) {
|
||||
BigDecimal tqq9_discountamt_gz = (BigDecimal) model.getValue("tqq9_discountamt_gz");
|
||||
EntryFieldRefresher entryFieldRefresher = new EntryFieldRefresher();
|
||||
entryFieldRefresher.updateAmountByOrg(GZ_ORGNUMBER, "tqq9_disamount", tqq9_discountamt_gz, model);
|
||||
// view.updateView();
|
||||
}
|
||||
//货返_单头
|
||||
if (StringUtils.equals("tqq9_hshfsyje_gz", name)) {
|
||||
BigDecimal tqq9_hshfsyje_gz = (BigDecimal) model.getValue("tqq9_hshfsyje_gz");
|
||||
EntryFieldRefresher entryFieldRefresher = new EntryFieldRefresher();
|
||||
entryFieldRefresher.updateAmountByOrg(GZ_ORGNUMBER, "tqq9_hfamount", tqq9_hshfsyje_gz, model);
|
||||
// view.updateView();
|
||||
}
|
||||
//现返_单头
|
||||
if (StringUtils.equals("tqq9_hsxfsyje_gz", name)) {
|
||||
BigDecimal tqq9_hsxfsyje_gz = (BigDecimal) model.getValue("tqq9_hsxfsyje_gz");
|
||||
EntryFieldRefresher entryFieldRefresher = new EntryFieldRefresher();
|
||||
entryFieldRefresher.updateAmountByOrg(GZ_ORGNUMBER, "tqq9_xfamount", tqq9_hsxfsyje_gz, model);
|
||||
// view.updateView();
|
||||
}
|
||||
//分录优惠金额,现返,货返金额分摊
|
||||
//折扣前价税合计:分录优惠金额,现返,货返金额分摊
|
||||
if (StringUtils.equals("tqq9_amount", name)) {
|
||||
EntryFieldRefresher entryFieldRefresher = new EntryFieldRefresher();
|
||||
BigDecimal tqq9_discountamt_sh = (BigDecimal) model.getValue("tqq9_discountamt_sh");
|
||||
|
|
@ -359,6 +367,28 @@ public class PurApplyBillPlugin extends AbstractBillPlugIn implements Plugin {
|
|||
BigDecimal tqq9_hsxfsyje_gz = (BigDecimal) model.getValue("tqq9_hsxfsyje_gz");
|
||||
entryFieldRefresher.updateAmountByOrg(GZ_ORGNUMBER, "tqq9_xfamount", tqq9_hsxfsyje_gz, model);
|
||||
}
|
||||
//收获组织:分录优惠金额,现返,货返金额分摊
|
||||
if (StringUtils.equals("entryrecorg", name)) {
|
||||
EntryFieldRefresher entryFieldRefresher = new EntryFieldRefresher();
|
||||
BigDecimal tqq9_discountamt_sh = (BigDecimal) model.getValue("tqq9_discountamt_sh");
|
||||
entryFieldRefresher.updateAmountByOrg(SH_ORGNUMBER, "tqq9_disamount", tqq9_discountamt_sh, model);
|
||||
BigDecimal tqq9_hshfsyje_sh = (BigDecimal) model.getValue("tqq9_hshfsyje_sh");
|
||||
entryFieldRefresher.updateAmountByOrg(SH_ORGNUMBER, "tqq9_hfamount", tqq9_hshfsyje_sh, model);
|
||||
BigDecimal tqq9_hsxfsyje_sh = (BigDecimal) model.getValue("tqq9_hsxfsyje_sh");
|
||||
entryFieldRefresher.updateAmountByOrg(SH_ORGNUMBER, "tqq9_xfamount", tqq9_hsxfsyje_sh, model);
|
||||
BigDecimal tqq9_discountamt_bj = (BigDecimal) model.getValue("tqq9_discountamt_bj");
|
||||
entryFieldRefresher.updateAmountByOrg(BJ_ORGNUMBER, "tqq9_disamount", tqq9_discountamt_bj, model);
|
||||
BigDecimal tqq9_hshfsyje_bj = (BigDecimal) model.getValue("tqq9_hshfsyje_bj");
|
||||
entryFieldRefresher.updateAmountByOrg(BJ_ORGNUMBER, "tqq9_hfamount", tqq9_hshfsyje_bj, model);
|
||||
BigDecimal tqq9_hsxfsyje_bj = (BigDecimal) model.getValue("tqq9_hsxfsyje_bj");
|
||||
entryFieldRefresher.updateAmountByOrg(BJ_ORGNUMBER, "tqq9_xfamount", tqq9_hsxfsyje_bj, model);
|
||||
BigDecimal tqq9_discountamt_gz = (BigDecimal) model.getValue("tqq9_discountamt_gz");
|
||||
entryFieldRefresher.updateAmountByOrg(GZ_ORGNUMBER, "tqq9_disamount", tqq9_discountamt_gz, model);
|
||||
BigDecimal tqq9_hshfsyje_gz = (BigDecimal) model.getValue("tqq9_hshfsyje_gz");
|
||||
entryFieldRefresher.updateAmountByOrg(GZ_ORGNUMBER, "tqq9_hfamount", tqq9_hshfsyje_gz, model);
|
||||
BigDecimal tqq9_hsxfsyje_gz = (BigDecimal) model.getValue("tqq9_hsxfsyje_gz");
|
||||
entryFieldRefresher.updateAmountByOrg(GZ_ORGNUMBER, "tqq9_xfamount", tqq9_hsxfsyje_gz, model);
|
||||
}
|
||||
//物料带出最高限价
|
||||
if (StringUtils.equals("material", name)) {
|
||||
ChangeData changeData = e.getChangeSet()[0];
|
||||
|
|
@ -499,10 +529,10 @@ public class PurApplyBillPlugin extends AbstractBillPlugIn implements Plugin {
|
|||
String number = org.getString("number");
|
||||
DynamicObject tqq9_org = BusinessDataServiceHelper.loadSingle(org.getLong("id"), "bos_org");//组织
|
||||
JSONObject material = entry.getJSONObject("tqq9_material");//物料
|
||||
DynamicObject tqq9_material = BusinessDataServiceHelper.loadSingle(material.getLong("id"),"bd_material","id,taxrate,number,name,baseunit,tqq9_xsyj1,tqq9_amountfield1,tqq9_amountfield4,tqq9_maxprice_sh,tqq9_maxprice_bj,tqq9_maxprice_gz");//物料
|
||||
DynamicObject tqq9_material = BusinessDataServiceHelper.loadSingle(material.getLong("id"), "bd_material", "id,taxrate,number,name,baseunit,tqq9_xsyj1,tqq9_amountfield1,tqq9_amountfield4,tqq9_maxprice_sh,tqq9_maxprice_bj,tqq9_maxprice_gz");//物料
|
||||
DynamicObject taxrate1 = tqq9_material.getDynamicObject("taxrate");
|
||||
BigDecimal taxrate2 = BigDecimal.ZERO;
|
||||
if(taxrate1!=null){
|
||||
if (taxrate1 != null) {
|
||||
taxrate1 = BusinessDataServiceHelper.loadSingle(taxrate1.getPkValue(), taxrate1.getDynamicObjectType().getName());
|
||||
taxrate2 = taxrate1.getBigDecimal("taxrate");
|
||||
}
|
||||
|
|
@ -517,6 +547,7 @@ public class PurApplyBillPlugin extends AbstractBillPlugIn implements Plugin {
|
|||
model.setValue("materialname", tqq9_material.getString("name"), i);//物料名称
|
||||
model.setValue("unit", tqq9_material.getDynamicObject("baseunit"), i);//计量单位
|
||||
model.setValue("baseunit", tqq9_material.getDynamicObject("baseunit"), i);//基本单位
|
||||
model.setValue("auxunit", tqq9_material.getDynamicObject("baseunit"), i);//基本单位
|
||||
model.setValue("rowclosestatus", "A", i);//行关闭状态
|
||||
model.setValue("rowterminatestatus", "A", i);//行终止状态
|
||||
model.setValue("entrypurog", LCJT, i);//分录采购组织(封存)
|
||||
|
|
@ -538,15 +569,15 @@ public class PurApplyBillPlugin extends AbstractBillPlugIn implements Plugin {
|
|||
model.setValue("tqq9_expectsaletime", tqq9_saledates, i);//预计销售时间(月)
|
||||
model.setValue("taxrateid", taxrate1, i);//税率
|
||||
model.setValue("taxrate", taxrate2, i);//税率(%)
|
||||
if(StringUtils.equals("SHLC",number)){
|
||||
if (StringUtils.equals("SHLC", number)) {
|
||||
BigDecimal tqq9_xsyj1 = tqq9_material.getBigDecimal("tqq9_xsyj1");
|
||||
BigDecimal multiply = tqq9_xsyj1.multiply(new BigDecimal(0.83));
|
||||
model.setValue("tqq9_dis83price", multiply, i);//商城83折销售价
|
||||
}else if(StringUtils.equals("BJLC",number)){
|
||||
} else if (StringUtils.equals("BJLC", number)) {
|
||||
BigDecimal tqq9_amountfield1 = tqq9_material.getBigDecimal("tqq9_amountfield1");
|
||||
BigDecimal multiply = tqq9_amountfield1.multiply(new BigDecimal(0.83));
|
||||
model.setValue("tqq9_dis83price", multiply, i);//商城83折销售价
|
||||
}else if(StringUtils.equals("GZLC",number)){
|
||||
} else if (StringUtils.equals("GZLC", number)) {
|
||||
BigDecimal tqq9_amountfield4 = tqq9_material.getBigDecimal("tqq9_amountfield4");
|
||||
BigDecimal multiply = tqq9_amountfield4.multiply(new BigDecimal(0.83));
|
||||
model.setValue("tqq9_dis83price", multiply, i);//商城83折销售价
|
||||
|
|
|
|||
Loading…
Reference in New Issue