物料导入地区必录字段时,赋值给其他地区必录字段(MaterialBillImportPlugin), 修改注释(PurOrderBillImportPlugin)
This commit is contained in:
parent
91d2d4d4e3
commit
0b34e4154e
|
|
@ -15,7 +15,7 @@ import java.util.HashMap;
|
|||
|
||||
/**
|
||||
* 单据界面插件
|
||||
* 物料明细分录导入带出行关闭 和 收货仓库
|
||||
* 采购订单明细分录导入带出行关闭 和 收货仓库
|
||||
*/
|
||||
public class PurOrderBillImportPlugin extends AbstractBillPlugIn implements Plugin {
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -0,0 +1,192 @@
|
|||
package tqq9.lc123.cloud.app.plugin.form.sys;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import kd.bos.bill.AbstractBillPlugIn;
|
||||
import kd.bos.dataentity.utils.StringUtils;
|
||||
import kd.bos.entity.datamodel.events.BeforeImportDataEventArgs;
|
||||
import kd.sdk.plugin.Plugin;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 单据界面插件
|
||||
*/
|
||||
public class MaterialBillImportPlugin extends AbstractBillPlugIn implements Plugin {
|
||||
@Override
|
||||
public void beforeImportData(BeforeImportDataEventArgs e) {
|
||||
super.beforeImportData(e);
|
||||
Map<String, Object> sourceData = e.getSourceData();
|
||||
|
||||
if (sourceData != null) {
|
||||
//是否启用有效期管理
|
||||
String tqq9_sfqyxqgl1 = (String) sourceData.get("tqq9_sfqyxqgl1"); // 上海
|
||||
String tqq9_sfqyxqgl2 = (String) sourceData.get("tqq9_sfqyxqgl2"); // 北京
|
||||
String tqq9_sfqyxqgl3 = (String) sourceData.get("tqq9_sfqyxqgl3"); // 广州
|
||||
// 效期管理(日)
|
||||
String tqq9_xqglshsh = (String) sourceData.get("tqq9_xqglshsh"); // 上海
|
||||
String tqq9_xqglbj = (String) sourceData.get("tqq9_xqglbj"); // 北京
|
||||
String tqq9_xqglgz = (String) sourceData.get("tqq9_xqglgz"); // 广州
|
||||
// 业务负责人
|
||||
JSONObject tqq9_ywfzr21 = (JSONObject) sourceData.get("tqq9_ywfzr21"); // 上海
|
||||
JSONObject tqq9_ywfzr2 = (JSONObject) sourceData.get("tqq9_ywfzr2"); // 北京
|
||||
JSONObject tqq9_ywfzr3 = (JSONObject) sourceData.get("tqq9_ywfzr3"); // 广州
|
||||
// 执行采购
|
||||
JSONObject tqq9_shcg = (JSONObject) sourceData.get("tqq9_shcg");// 上海
|
||||
JSONObject tqq9_bjcg = (JSONObject) sourceData.get("tqq9_bjcg");// 北京
|
||||
JSONObject tqq9_gzcg = (JSONObject) sourceData.get("tqq9_gzcg");// 广州
|
||||
// 最高采购限价
|
||||
String tqq9_maxprice_sh = (String) sourceData.get("tqq9_maxprice_sh"); // 上海
|
||||
String tqq9_maxprice_bj = (String) sourceData.get("tqq9_maxprice_bj"); // 北京
|
||||
String tqq9_maxprice_gz = (String) sourceData.get("tqq9_maxprice_gz"); // 广州
|
||||
// 销售原价
|
||||
String tqq9_xsyj1 = (String) sourceData.get("tqq9_xsyj1"); // 上海
|
||||
String tqq9_amountfield1 = (String) sourceData.get("tqq9_amountfield1"); // 北京
|
||||
String tqq9_amountfield4 = (String) sourceData.get("tqq9_amountfield4"); // 广州
|
||||
|
||||
// 按照上海>北京>广州的优先级处理字段赋值
|
||||
// 处理是否启用有效期管理
|
||||
if (tqq9_sfqyxqgl1 != null && StringUtils.isNotBlank(tqq9_sfqyxqgl1)) {
|
||||
if (sourceData.get("tqq9_sfqyxqgl2") == null) {
|
||||
sourceData.put("tqq9_sfqyxqgl2", tqq9_sfqyxqgl1);
|
||||
}
|
||||
if (sourceData.get("tqq9_sfqyxqgl3") == null) {
|
||||
sourceData.put("tqq9_sfqyxqgl3", tqq9_sfqyxqgl1);
|
||||
}
|
||||
} else if (tqq9_sfqyxqgl2 != null && StringUtils.isNotBlank(tqq9_sfqyxqgl2)) {
|
||||
if (sourceData.get("tqq9_sfqyxqgl1") == null) {
|
||||
sourceData.put("tqq9_sfqyxqgl1", tqq9_sfqyxqgl2);
|
||||
}
|
||||
if (sourceData.get("tqq9_sfqyxqgl3") == null) {
|
||||
sourceData.put("tqq9_sfqyxqgl3", tqq9_sfqyxqgl2);
|
||||
}
|
||||
} else if (tqq9_sfqyxqgl3 != null && StringUtils.isNotBlank(tqq9_sfqyxqgl3)) {
|
||||
if (sourceData.get("tqq9_sfqyxqgl1") == null) {
|
||||
sourceData.put("tqq9_sfqyxqgl1", tqq9_sfqyxqgl3);
|
||||
}
|
||||
if (sourceData.get("tqq9_sfqyxqgl2") == null) {
|
||||
sourceData.put("tqq9_sfqyxqgl2", tqq9_sfqyxqgl3);
|
||||
}
|
||||
}
|
||||
|
||||
// 处理效期管理(日)
|
||||
if (tqq9_xqglshsh != null && StringUtils.isNotBlank(tqq9_xqglshsh)) {
|
||||
if (sourceData.get("tqq9_xqglbj") == null && StringUtils.isBlank(tqq9_xqglbj)) {
|
||||
sourceData.put("tqq9_xqglbj", tqq9_xqglshsh);
|
||||
}
|
||||
if (sourceData.get("tqq9_xqglgz") == null&& StringUtils.isBlank(tqq9_xqglgz)) {
|
||||
sourceData.put("tqq9_xqglgz", tqq9_xqglshsh);
|
||||
}
|
||||
} else if (tqq9_xqglbj != null && StringUtils.isNotBlank(tqq9_xqglbj)) {
|
||||
if (sourceData.get("tqq9_xqglshsh") == null&& StringUtils.isBlank(tqq9_xqglshsh)) {
|
||||
sourceData.put("tqq9_xqglshsh", tqq9_xqglbj);
|
||||
}
|
||||
if (sourceData.get("tqq9_xqglgz") == null&& StringUtils.isBlank(tqq9_xqglgz)) {
|
||||
sourceData.put("tqq9_xqglgz", tqq9_xqglbj);
|
||||
}
|
||||
} else if (tqq9_xqglgz != null&& StringUtils.isNotBlank(tqq9_xqglgz)) {
|
||||
if (sourceData.get("tqq9_xqglshsh") == null&& StringUtils.isBlank(tqq9_xqglshsh)) {
|
||||
sourceData.put("tqq9_xqglshsh", tqq9_xqglgz);
|
||||
}
|
||||
if (sourceData.get("tqq9_xqglbj") == null&& StringUtils.isBlank(tqq9_xqglbj)) {
|
||||
sourceData.put("tqq9_xqglbj", tqq9_xqglgz);
|
||||
}
|
||||
}
|
||||
|
||||
// 处理业务负责人
|
||||
if (tqq9_ywfzr21 != null && tqq9_ywfzr21.size() > 0) {
|
||||
if (sourceData.get("tqq9_ywfzr2") == null) {
|
||||
sourceData.put("tqq9_ywfzr2", tqq9_ywfzr21);
|
||||
}
|
||||
if (sourceData.get("tqq9_ywfzr3") == null) {
|
||||
sourceData.put("tqq9_ywfzr3", tqq9_ywfzr21);
|
||||
}
|
||||
} else if (tqq9_ywfzr2 != null && tqq9_ywfzr2.size() > 0) {
|
||||
if (sourceData.get("tqq9_ywfzr21") == null) {
|
||||
sourceData.put("tqq9_ywfzr21", tqq9_ywfzr2);
|
||||
}
|
||||
if (sourceData.get("tqq9_ywfzr3") == null) {
|
||||
sourceData.put("tqq9_ywfzr3", tqq9_ywfzr2);
|
||||
}
|
||||
} else if (tqq9_ywfzr3 != null && tqq9_ywfzr3.size() > 0) {
|
||||
if (sourceData.get("tqq9_ywfzr21") == null) {
|
||||
sourceData.put("tqq9_ywfzr21", tqq9_ywfzr3);
|
||||
}
|
||||
if (sourceData.get("tqq9_ywfzr2") == null) {
|
||||
sourceData.put("tqq9_ywfzr2", tqq9_ywfzr3);
|
||||
}
|
||||
}
|
||||
|
||||
// 处理执行采购
|
||||
if (tqq9_shcg != null && tqq9_shcg.size() > 0) {
|
||||
if (sourceData.get("tqq9_bjcg") == null) {
|
||||
sourceData.put("tqq9_bjcg", tqq9_shcg);
|
||||
}
|
||||
if (sourceData.get("tqq9_gzcg") == null) {
|
||||
sourceData.put("tqq9_gzcg", tqq9_shcg);
|
||||
}
|
||||
} else if (tqq9_bjcg != null && tqq9_bjcg.size() > 0) {
|
||||
if (sourceData.get("tqq9_shcg") == null) {
|
||||
sourceData.put("tqq9_shcg", tqq9_bjcg);
|
||||
}
|
||||
if (sourceData.get("tqq9_gzcg") == null) {
|
||||
sourceData.put("tqq9_gzcg", tqq9_bjcg);
|
||||
}
|
||||
} else if (tqq9_gzcg != null && tqq9_gzcg.size() > 0) {
|
||||
if (sourceData.get("tqq9_shcg") == null) {
|
||||
sourceData.put("tqq9_shcg", tqq9_gzcg);
|
||||
}
|
||||
if (sourceData.get("tqq9_bjcg") == null) {
|
||||
sourceData.put("tqq9_bjcg", tqq9_gzcg);
|
||||
}
|
||||
}
|
||||
|
||||
// 处理最高采购限价
|
||||
if (tqq9_maxprice_sh != null && StringUtils.isNotBlank(tqq9_maxprice_sh)) {
|
||||
if (sourceData.get("tqq9_maxprice_bj") == null && StringUtils.isBlank(tqq9_maxprice_bj)) {
|
||||
sourceData.put("tqq9_maxprice_bj", tqq9_maxprice_sh);
|
||||
}
|
||||
if (sourceData.get("tqq9_maxprice_gz") == null && StringUtils.isBlank(tqq9_maxprice_gz)) {
|
||||
sourceData.put("tqq9_maxprice_gz", tqq9_maxprice_sh);
|
||||
}
|
||||
} else if (tqq9_maxprice_bj != null && StringUtils.isNotBlank(tqq9_maxprice_bj)) {
|
||||
if (sourceData.get("tqq9_maxprice_sh") == null && StringUtils.isBlank(tqq9_maxprice_sh)) {
|
||||
sourceData.put("tqq9_maxprice_sh", tqq9_maxprice_bj);
|
||||
}
|
||||
if (sourceData.get("tqq9_maxprice_gz") == null && StringUtils.isBlank(tqq9_maxprice_bj)) {
|
||||
sourceData.put("tqq9_maxprice_gz", tqq9_maxprice_bj);
|
||||
}
|
||||
} else if (tqq9_maxprice_gz != null && StringUtils.isNotBlank(tqq9_maxprice_gz)) {
|
||||
if (sourceData.get("tqq9_maxprice_sh") == null && StringUtils.isBlank(tqq9_maxprice_sh)) {
|
||||
sourceData.put("tqq9_maxprice_sh", tqq9_maxprice_gz);
|
||||
}
|
||||
if (sourceData.get("tqq9_maxprice_bj") == null && StringUtils.isBlank(tqq9_maxprice_bj)) {
|
||||
sourceData.put("tqq9_maxprice_bj", tqq9_maxprice_gz);
|
||||
}
|
||||
}
|
||||
|
||||
// 处理销售原价
|
||||
if (tqq9_xsyj1 != null && StringUtils.isNotBlank(tqq9_xsyj1)) {
|
||||
if (sourceData.get("tqq9_amountfield1") == null && StringUtils.isBlank(tqq9_amountfield1)) {
|
||||
sourceData.put("tqq9_amountfield1", tqq9_xsyj1);
|
||||
}
|
||||
if (sourceData.get("tqq9_amountfield4") == null && StringUtils.isBlank(tqq9_amountfield4)) {
|
||||
sourceData.put("tqq9_amountfield4", tqq9_xsyj1);
|
||||
}
|
||||
} else if (tqq9_amountfield1 != null && StringUtils.isNotBlank(tqq9_amountfield1)) {
|
||||
if (sourceData.get("tqq9_xsyj1") == null && StringUtils.isBlank(tqq9_xsyj1)) {
|
||||
sourceData.put("tqq9_xsyj1", tqq9_amountfield1);
|
||||
}
|
||||
if (sourceData.get("tqq9_amountfield4") == null && StringUtils.isBlank(tqq9_amountfield4)) {
|
||||
sourceData.put("tqq9_amountfield4", tqq9_amountfield1);
|
||||
}
|
||||
} else if (tqq9_amountfield4 != null && StringUtils.isNotBlank(tqq9_amountfield4)) {
|
||||
if (sourceData.get("tqq9_xsyj1") == null && StringUtils.isBlank(tqq9_xsyj1)) {
|
||||
sourceData.put("tqq9_xsyj1", tqq9_amountfield4);
|
||||
}
|
||||
if (sourceData.get("tqq9_amountfield1") == null && StringUtils.isBlank(tqq9_amountfield1)) {
|
||||
sourceData.put("tqq9_amountfield1", tqq9_amountfield4);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue