parent
d79a171b47
commit
00477730e4
|
|
@ -22,9 +22,7 @@ import kd.bos.servicehelper.BusinessDataServiceHelper;
|
|||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import java.util.EventObject;
|
||||
import java.util.HashMap;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 返利规则表单插件
|
||||
|
|
@ -37,25 +35,72 @@ public class RebateRulesBillPlugin extends AbstractBillPlugIn implements BeforeF
|
|||
public void registerListener(EventObject e) {
|
||||
super.registerListener(e);
|
||||
this.addItemClickListeners("tbmain");
|
||||
MulBasedataEdit control = this.getControl("tqq9_exclunopur");
|
||||
control.addBeforeF7SelectListener(this);
|
||||
MulBasedataEdit tqq9_exclunopur = this.getControl("tqq9_exclunopur");//排除时间段不排除订单
|
||||
MulBasedataEdit tqq9_exclupur = this.getControl("tqq9_exclupur");//排除采购订单
|
||||
MulBasedataEdit tqq9_purchaseorder = this.getControl("tqq9_purchaseorder");//指定采购订单
|
||||
tqq9_exclunopur.addBeforeF7SelectListener(this);
|
||||
tqq9_exclupur.addBeforeF7SelectListener(this);
|
||||
tqq9_purchaseorder.addBeforeF7SelectListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeF7Select(BeforeF7SelectEvent beforeF7SelectEvent) {
|
||||
String name = beforeF7SelectEvent.getProperty().getName();
|
||||
IDataModel model = this.getModel();
|
||||
String tqq9_excludnum = model.getDataEntity().getString("tqq9_excludnum");
|
||||
Date tqq9_startexcludate = model.getDataEntity().getDate("tqq9_startexcludate");
|
||||
Date tqq9_endexcludate = model.getDataEntity().getDate("tqq9_endexcludate");
|
||||
if (tqq9_startexcludate == null || tqq9_endexcludate == null) {
|
||||
beforeF7SelectEvent.setCancel(true);
|
||||
this.getView().showMessage("请先填写排除时间段");
|
||||
String tqq9_excludnum = model.getDataEntity().getString("tqq9_excludnum");//排除后基数
|
||||
DynamicObjectCollection tqq9_supplier = model.getDataEntity(true).getDynamicObjectCollection("tqq9_supplier");//供应商
|
||||
Set<String> numbers =new HashSet<String>();
|
||||
for (DynamicObject dynamicObject : tqq9_supplier) {
|
||||
DynamicObject fbasedataid = dynamicObject.getDynamicObject("fbasedataid");
|
||||
String number = fbasedataid.getString("number");
|
||||
numbers.add(number);
|
||||
}
|
||||
if (StringUtils.equals("1", tqq9_excludnum)) {
|
||||
ListShowParameter param = (ListShowParameter) beforeF7SelectEvent.getFormShowParameter();
|
||||
QFilter qF1 = new QFilter("biztime", QCP.large_equals, tqq9_startexcludate);
|
||||
QFilter qF2 = new QFilter("biztime", QCP.less_equals, tqq9_endexcludate);
|
||||
param.getListFilterParameter().getQFilters().add(qF1.and(qF2));
|
||||
|
||||
//排除时间段不排除订单
|
||||
if(StringUtils.equals(name,"tqq9_exclunopur")&&StringUtils.equals("1", tqq9_excludnum)){
|
||||
Date tqq9_startexcludate = model.getDataEntity().getDate("tqq9_startexcludate");//排除开始时间段
|
||||
Date tqq9_endexcludate = model.getDataEntity().getDate("tqq9_endexcludate");//排除结束时间段
|
||||
if (tqq9_startexcludate == null || tqq9_endexcludate == null) {
|
||||
beforeF7SelectEvent.setCancel(true);
|
||||
this.getView().showMessage("请先填写排除时间段");
|
||||
}else{
|
||||
ListShowParameter param = (ListShowParameter) beforeF7SelectEvent.getFormShowParameter();
|
||||
QFilter qF1 = new QFilter("biztime", QCP.large_equals, tqq9_startexcludate);
|
||||
QFilter qF2 = new QFilter("biztime", QCP.less_equals, tqq9_endexcludate);
|
||||
QFilter qF3 = new QFilter("supplier.number", QCP.in, numbers);
|
||||
param.getListFilterParameter().getQFilters().add(qF1.and(qF2).and(qF3));
|
||||
}
|
||||
}
|
||||
//排除采购订单
|
||||
if(StringUtils.equals(name,"tqq9_exclupur")&&StringUtils.equals("1", tqq9_excludnum)){
|
||||
Date tqq9_startdate = model.getDataEntity().getDate("tqq9_startdate");//返利开始时间段
|
||||
Date tqq9_enddate = model.getDataEntity().getDate("tqq9_enddate");//返利结束时间段
|
||||
if (tqq9_startdate == null || tqq9_enddate == null) {
|
||||
beforeF7SelectEvent.setCancel(true);
|
||||
this.getView().showMessage("请先填写排除时间段");
|
||||
}else{
|
||||
ListShowParameter param = (ListShowParameter) beforeF7SelectEvent.getFormShowParameter();
|
||||
QFilter qF1 = new QFilter("biztime", QCP.large_equals, tqq9_startdate);
|
||||
QFilter qF2 = new QFilter("biztime", QCP.less_equals, tqq9_enddate);
|
||||
QFilter qF3 = new QFilter("supplier.number", QCP.in, numbers);
|
||||
param.getListFilterParameter().getQFilters().add((qF1.or(qF2)).and(qF3));
|
||||
}
|
||||
|
||||
}
|
||||
//指定采购订单
|
||||
if(StringUtils.equals(name,"tqq9_purchaseorder")){
|
||||
Date tqq9_startdate = model.getDataEntity().getDate("tqq9_startdate");//返利开始时间段
|
||||
Date tqq9_enddate = model.getDataEntity().getDate("tqq9_enddate");//返利结束时间段
|
||||
if (tqq9_startdate == null || tqq9_enddate == null) {
|
||||
beforeF7SelectEvent.setCancel(true);
|
||||
this.getView().showMessage("请先填写返利时间段");
|
||||
}else{
|
||||
ListShowParameter param = (ListShowParameter) beforeF7SelectEvent.getFormShowParameter();
|
||||
QFilter qF1 = new QFilter("biztime", QCP.large_equals, tqq9_startdate);
|
||||
QFilter qF2 = new QFilter("biztime", QCP.less_equals, tqq9_enddate);
|
||||
QFilter qF3 = new QFilter("supplier.number", QCP.in, numbers);
|
||||
param.getListFilterParameter().getQFilters().add(qF1.or(qF2).and(qF3));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -80,13 +125,17 @@ public class RebateRulesBillPlugin extends AbstractBillPlugIn implements BeforeF
|
|||
if (tqq9_guangzhoulici) {
|
||||
companyBulider.append("GZ").append(",");
|
||||
}
|
||||
companyBulider.deleteCharAt(companyBulider.length() - 1);
|
||||
if(companyBulider!=null&&companyBulider.length()>0){
|
||||
companyBulider.deleteCharAt(companyBulider.length() - 1);
|
||||
}
|
||||
String ruleName = getModel().getValue("name").toString();
|
||||
String[] split = ruleName.split("-");
|
||||
StringBuilder newName = new StringBuilder();
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
if (i == 1) {
|
||||
newName.append(companyBulider).append("-");
|
||||
if(StringUtils.isNotBlank(companyBulider)){
|
||||
newName.append(companyBulider).append("-");
|
||||
}
|
||||
if (!split[i].contains("SH") && !split[i].contains("BJ") && !split[i].contains("GZ")) {
|
||||
newName.append(split[i]).append("-");
|
||||
}
|
||||
|
|
@ -110,13 +159,17 @@ public class RebateRulesBillPlugin extends AbstractBillPlugIn implements BeforeF
|
|||
if (tqq9_guangzhoulici) {
|
||||
companyBulider.append("GZ").append(",");
|
||||
}
|
||||
companyBulider.deleteCharAt(companyBulider.length() - 1);
|
||||
if(companyBulider!=null&&companyBulider.length()>0){
|
||||
companyBulider.deleteCharAt(companyBulider.length() - 1);
|
||||
}
|
||||
String ruleName = getModel().getValue("name").toString();
|
||||
String[] split = ruleName.split("-");
|
||||
StringBuilder newName = new StringBuilder();
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
if (i == 1) {
|
||||
newName.append(companyBulider).append("-");
|
||||
if(StringUtils.isNotBlank(companyBulider)){
|
||||
newName.append(companyBulider).append("-");
|
||||
}
|
||||
if (!split[i].contains("SH") && !split[i].contains("BJ") && !split[i].contains("GZ")) {
|
||||
newName.append(split[i]).append("-");
|
||||
}
|
||||
|
|
@ -141,13 +194,17 @@ public class RebateRulesBillPlugin extends AbstractBillPlugIn implements BeforeF
|
|||
if (tqq9_guangzhoulici) {
|
||||
companyBulider.append("GZ").append(",");
|
||||
}
|
||||
if(companyBulider!=null&&companyBulider.length()>0){
|
||||
companyBulider.deleteCharAt(companyBulider.length() - 1);
|
||||
}
|
||||
String ruleName = getModel().getValue("name").toString();
|
||||
String[] split = ruleName.split("-");
|
||||
StringBuilder newName = new StringBuilder();
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
if (i == 1) {
|
||||
newName.append(companyBulider).append("-");
|
||||
if(StringUtils.isNotBlank(companyBulider)){
|
||||
newName.append(companyBulider).append("-");
|
||||
}
|
||||
if (!split[i].contains("SH") && !split[i].contains("BJ") && !split[i].contains("GZ")) {
|
||||
newName.append(split[i]).append("-");
|
||||
}
|
||||
|
|
@ -173,13 +230,17 @@ public class RebateRulesBillPlugin extends AbstractBillPlugIn implements BeforeF
|
|||
if (tqq9_gzlcbl.compareTo(BigDecimal.ZERO) > 0) {
|
||||
companyBulider.append("GZ").append(",");
|
||||
}
|
||||
companyBulider.deleteCharAt(companyBulider.length() - 1);
|
||||
if(companyBulider!=null&&companyBulider.length()>0){
|
||||
companyBulider.deleteCharAt(companyBulider.length() - 1);
|
||||
}
|
||||
String ruleName = getModel().getValue("name").toString();
|
||||
String[] split = ruleName.split("-");
|
||||
StringBuilder newName = new StringBuilder();
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
if (i == 1) {
|
||||
newName.append(companyBulider).append("-");
|
||||
if(StringUtils.isNotBlank(companyBulider)){
|
||||
newName.append(companyBulider).append("-");
|
||||
}
|
||||
if (!split[i].contains("SH") && !split[i].contains("BJ") && !split[i].contains("GZ")) {
|
||||
newName.append(split[i]).append("-");
|
||||
}
|
||||
|
|
@ -203,13 +264,17 @@ public class RebateRulesBillPlugin extends AbstractBillPlugIn implements BeforeF
|
|||
if (tqq9_gzlcbl.compareTo(BigDecimal.ZERO) > 0) {
|
||||
companyBulider.append("GZ").append(",");
|
||||
}
|
||||
companyBulider.deleteCharAt(companyBulider.length() - 1);
|
||||
if(companyBulider!=null&&companyBulider.length()>0){
|
||||
companyBulider.deleteCharAt(companyBulider.length() - 1);
|
||||
}
|
||||
String ruleName = getModel().getValue("name").toString();
|
||||
String[] split = ruleName.split("-");
|
||||
StringBuilder newName = new StringBuilder();
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
if (i == 1) {
|
||||
newName.append(companyBulider).append("-");
|
||||
if(StringUtils.isNotBlank(companyBulider)){
|
||||
newName.append(companyBulider).append("-");
|
||||
}
|
||||
if (!split[i].contains("SH") && !split[i].contains("BJ") && !split[i].contains("GZ")) {
|
||||
newName.append(split[i]).append("-");
|
||||
}
|
||||
|
|
@ -233,13 +298,17 @@ public class RebateRulesBillPlugin extends AbstractBillPlugIn implements BeforeF
|
|||
if (tqq9_gzlcbl.compareTo(BigDecimal.ZERO) > 0) {
|
||||
companyBulider.append("GZ").append(",");
|
||||
}
|
||||
companyBulider.deleteCharAt(companyBulider.length() - 1);
|
||||
if(companyBulider!=null&&companyBulider.length()>0){
|
||||
companyBulider.deleteCharAt(companyBulider.length() - 1);
|
||||
}
|
||||
String ruleName = getModel().getValue("name").toString();
|
||||
String[] split = ruleName.split("-");
|
||||
StringBuilder newName = new StringBuilder();
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
if (i == 1) {
|
||||
newName.append(companyBulider).append("-");
|
||||
if(StringUtils.isNotBlank(companyBulider)){
|
||||
newName.append(companyBulider).append("-");
|
||||
}
|
||||
if (!split[i].contains("SH") && !split[i].contains("BJ") && !split[i].contains("GZ")) {
|
||||
newName.append(split[i]).append("-");
|
||||
}
|
||||
|
|
@ -251,7 +320,6 @@ public class RebateRulesBillPlugin extends AbstractBillPlugIn implements BeforeF
|
|||
getModel().setValue("name", newName.toString());
|
||||
}
|
||||
}
|
||||
|
||||
if (StringUtils.equals("tqq9_rebatesub", name)) {
|
||||
String ruleName = getModel().getValue("name").toString();
|
||||
String[] split = ruleName.split("-");
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ import kd.bos.orm.query.QFilter;
|
|||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import kd.bos.servicehelper.user.UserServiceHelper;
|
||||
import kd.sdk.plugin.Plugin;
|
||||
import tqq9.lc123.cloud.app.eip.iscb.LCLogService;
|
||||
import tqq9.lc123.cloud.app.eip.iscb.impl.LCLogServiceImpl;
|
||||
import tqq9.lc123.cloud.app.plugin.utils.EntryFieldRefresher;
|
||||
import tqq9.lc123.cloud.app.plugin.utils.HttpRequestUtils;
|
||||
|
||||
|
|
@ -68,10 +70,10 @@ public class PurApplyBillPlugin extends AbstractBillPlugIn implements Plugin {
|
|||
IFormView view = this.getView();
|
||||
HashMap<String, String> tokenMap = new HashMap<String, String>();
|
||||
tokenMap.put("Authorization", FLXT_TOKEN);
|
||||
LCLogService lcLogService = new LCLogServiceImpl();
|
||||
//--------------上海------------------
|
||||
//集采供应商
|
||||
if (StringUtils.equals("tqq9_sup_sh", name)) {
|
||||
|
||||
DynamicObject tqq9_sup_sh = (DynamicObject) model.getValue("tqq9_sup_sh");//供应商
|
||||
if (tqq9_sup_sh != null) {
|
||||
DynamicObject org = BusinessDataServiceHelper.loadSingle("bos_org", new QFilter[]{new QFilter("number", QCP.equals, SH_ORGNUMBER)});
|
||||
|
|
@ -107,11 +109,12 @@ public class PurApplyBillPlugin extends AbstractBillPlugIn implements Plugin {
|
|||
model.setValue("tqq9_hsxfkyje_sh", totalMoneyAvailable);//含税现返可用金额
|
||||
}
|
||||
}
|
||||
lcLogService.savelog("查询返利金额",URL,false,true, queryMap.toString(), bodyString);
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
throw new RuntimeException(ex);
|
||||
lcLogService.savelog("创建返利规则",URL,false,false, queryMap.toString(), "接口调用报错,无返回值");
|
||||
throw new RuntimeException(ex+",请求返利系统失败");
|
||||
}
|
||||
// view.updateView();
|
||||
}
|
||||
}
|
||||
//收货仓库
|
||||
|
|
@ -194,9 +197,11 @@ public class PurApplyBillPlugin extends AbstractBillPlugIn implements Plugin {
|
|||
model.setValue("tqq9_hsxfkyje_bj", totalMoneyAvailable);//含税现返可用金额
|
||||
}
|
||||
}
|
||||
lcLogService.savelog("查询返利金额",URL,false,true, queryMap.toString(), bodyString);
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
throw new RuntimeException(ex);
|
||||
lcLogService.savelog("创建返利规则",URL,false,false, queryMap.toString(), "接口调用报错,无返回值");
|
||||
throw new RuntimeException(ex+",请求返利系统失败");
|
||||
}
|
||||
// view.updateView();
|
||||
}
|
||||
|
|
@ -282,11 +287,12 @@ public class PurApplyBillPlugin extends AbstractBillPlugIn implements Plugin {
|
|||
model.setValue("tqq9_hsxfkyje_gz", totalMoneyAvailable);//含税现返可用金额
|
||||
}
|
||||
}
|
||||
lcLogService.savelog("查询返利金额",URL,false,true, queryMap.toString(), bodyString);
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
throw new RuntimeException(ex);
|
||||
lcLogService.savelog("创建返利规则",URL,false,false, queryMap.toString(), "接口调用报错,无返回值");
|
||||
throw new RuntimeException(ex+",请求返利系统失败");
|
||||
}
|
||||
// view.updateView();
|
||||
}
|
||||
}
|
||||
//收货仓库
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ import kd.bos.logging.LogFactory;
|
|||
import kd.bos.orm.query.QCP;
|
||||
import kd.bos.orm.query.QFilter;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import tqq9.lc123.cloud.app.eip.iscb.LCLogService;
|
||||
import tqq9.lc123.cloud.app.eip.iscb.impl.LCLogServiceImpl;
|
||||
import tqq9.lc123.cloud.app.plugin.utils.HttpRequestUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
@ -328,6 +330,7 @@ public class PuroderBillShareRefundPlugin extends AbstractBillPlugIn {
|
|||
}
|
||||
}
|
||||
if (StringUtils.equals("supplier", name)) {
|
||||
LCLogService lcLogService = new LCLogServiceImpl();
|
||||
HashMap<String, String> tokenMap = new HashMap<String, String>();
|
||||
tokenMap.put("Authorization", FLXT_TOKEN);
|
||||
IDataModel model = this.getModel();
|
||||
|
|
@ -370,9 +373,11 @@ public class PuroderBillShareRefundPlugin extends AbstractBillPlugIn {
|
|||
model.setValue("tqq9_hsxfkyje", totalMoneyAvailable);//含税现返可用金额
|
||||
}
|
||||
}
|
||||
lcLogService.savelog("查询返利金额",URL,false,true, queryMap.toString(), bodyString);
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
throw new RuntimeException(ex);
|
||||
lcLogService.savelog("查询返利金额",URL,false,false, queryMap.toString(), "接口调用报错,无返回值");
|
||||
throw new RuntimeException(ex+",请求返利系统失败");
|
||||
}
|
||||
getView().updateView();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,8 +54,10 @@ public class SupplierAreaFormPlugin extends AbstractListPlugin implements Plugin
|
|||
FormShowParameter formShowParameter = this.getView().getFormShowParameter();
|
||||
// 获取自定义参数
|
||||
String ids = formShowParameter.getCustomParam("ids");
|
||||
String qyzz = formShowParameter.getCustomParam("qyzz");
|
||||
if (ids != null) {
|
||||
this.getModel().setValue("tqq9_ids", ids);
|
||||
this.getModel().setValue("tqq9_ids", qyzz);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,9 +45,11 @@ public class SupplierFormPlugin extends AbstractListPlugin implements Plugin {
|
|||
ids.add(primaryKeyValue);
|
||||
}
|
||||
DynamicObject[] bd_suppliers = BusinessDataServiceHelper.load("bd_supplier", "id,number,status,enable,tqq9_mulcombofield1,createorg", new QFilter[]{new QFilter("id", QCP.in, ids)});
|
||||
String qyzz = null;
|
||||
for (DynamicObject bd_supplier : bd_suppliers) {
|
||||
String number = bd_supplier.getString("number");
|
||||
String status = bd_supplier.getString("status");
|
||||
String tqq9_mulcombofield1 = bd_supplier.getString("tqq9_mulcombofield1");
|
||||
if (!StringUtils.equals("C", status)) {
|
||||
errorMsg.append(",").append("供应商编码 " + number + "未审核");
|
||||
}
|
||||
|
|
@ -55,6 +57,13 @@ public class SupplierFormPlugin extends AbstractListPlugin implements Plugin {
|
|||
if (!StringUtils.equals("1", enable)) {
|
||||
errorMsg.append(",").append("供应商编码 " + number + "未启用");
|
||||
}
|
||||
if (qyzz == null) {
|
||||
qyzz = tqq9_mulcombofield1;
|
||||
} else {
|
||||
if (!StringUtils.equals(qyzz, tqq9_mulcombofield1)) {
|
||||
errorMsg.append(",").append("供应商区域资质不一致,请重新选择");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (errorMsg.length() > 0) {
|
||||
this.getView().showErrorNotification(errorMsg.substring(1));
|
||||
|
|
@ -64,6 +73,7 @@ public class SupplierFormPlugin extends AbstractListPlugin implements Plugin {
|
|||
param.setFormId("tqq9_gysqyzz");
|
||||
param.setCloseCallBack(new CloseCallBack(this, "updateFilter"));
|
||||
param.setCustomParam("ids", ids.toString());
|
||||
param.setCustomParam("qyzz", qyzz);
|
||||
param.getOpenStyle().setShowType(ShowType.Modal);
|
||||
this.getView().showForm(param);
|
||||
}
|
||||
|
|
@ -83,6 +93,7 @@ public class SupplierFormPlugin extends AbstractListPlugin implements Plugin {
|
|||
return;
|
||||
}
|
||||
String tqq9_qyzz = data.get("tqq9_qyzz").toString();
|
||||
String tqq9_mulcombofield1 = "";
|
||||
String tqq9_ids = data.get("tqq9_ids").toString();
|
||||
String[] stringArray = tqq9_ids.substring(1, tqq9_ids.length() - 1).split(", ");
|
||||
List<Long> longList = new ArrayList<>();
|
||||
|
|
@ -91,36 +102,60 @@ public class SupplierFormPlugin extends AbstractListPlugin implements Plugin {
|
|||
}
|
||||
HashMap<Object, String> supplierMap = new HashMap<>();
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
DynamicObject[] bd_suppliers =new DynamicObject[longList.size()];
|
||||
DynamicObject[] bd_suppliers = new DynamicObject[longList.size()];
|
||||
for (int i = 0; i < longList.size(); i++) {
|
||||
bd_suppliers[i]= BusinessDataServiceHelper.loadSingle("bd_supplier", new QFilter[]{new QFilter("id", QCP.in, longList.get(i))});
|
||||
bd_suppliers[i] = BusinessDataServiceHelper.loadSingle("bd_supplier", new QFilter[]{new QFilter("id", QCP.in, longList.get(i))});
|
||||
tqq9_mulcombofield1 = bd_suppliers[i].getString("tqq9_mulcombofield1");
|
||||
String supNumber = bd_suppliers[i].getString("number");
|
||||
if (!tqq9_qyzz.contains(tqq9_mulcombofield1)) {
|
||||
stringBuilder.append(",").append("编码为 ").append(supNumber).append("新选择的供应商区域资质不包含原区域资质,请重新选择");
|
||||
this.getView().showErrorNotification(stringBuilder.substring(1));
|
||||
return;
|
||||
}
|
||||
}
|
||||
// 处理字符串,去除前后的逗号
|
||||
tqq9_qyzz = tqq9_qyzz.replaceAll("^,", "").replaceAll(",$", "");
|
||||
tqq9_mulcombofield1 = tqq9_mulcombofield1.replaceAll("^,", "").replaceAll(",$", "");
|
||||
// 将字符串按逗号分隔
|
||||
Set<String> set1 = new HashSet<>(Arrays.asList(tqq9_qyzz.split(",")));
|
||||
Set<String> set2 = new HashSet<>(Arrays.asList(tqq9_mulcombofield1.split(",")));
|
||||
// 计算 set1 中有,而 set2 中没有的元素
|
||||
set1.removeAll(set2);
|
||||
// 如果差异有值,将结果包装成逗号形式
|
||||
String changeqyzz=null;
|
||||
if (!set1.isEmpty()) {
|
||||
changeqyzz= "," + String.join(",", set1) + ",";
|
||||
}else{
|
||||
stringBuilder.append(",").append("新选择的供应商区域资质与原区域资质无差别,请重新选择");
|
||||
}
|
||||
|
||||
for (DynamicObject bd_supplier : bd_suppliers) {
|
||||
supplierMap.put(bd_supplier.get("id"),bd_supplier.getString("number"));
|
||||
supplierMap.put(bd_supplier.get("id"), bd_supplier.getString("number"));
|
||||
}
|
||||
OperateOption operateOption = OperateOption.create();
|
||||
OperationResult unauditResult = OperationServiceHelper.executeOperate(Constants.TYPE_UNAUDIT, "bd_supplier", bd_suppliers, operateOption);
|
||||
if(!unauditResult.isSuccess()){
|
||||
if (!unauditResult.isSuccess()) {
|
||||
List<IOperateInfo> allErrorOrValidateInfo = unauditResult.getAllErrorOrValidateInfo();
|
||||
for (IOperateInfo iOperateInfo : allErrorOrValidateInfo) {
|
||||
String supNumber = supplierMap.get(iOperateInfo.getPkValue());
|
||||
String message = iOperateInfo.getMessage();
|
||||
stringBuilder.append(",").append("编码为 ").append(supNumber).append(" 的供应商反审核失败,"+message);
|
||||
stringBuilder.append(",").append("编码为 ").append(supNumber).append(" 的供应商反审核失败," + message);
|
||||
}
|
||||
String message = unauditResult.getMessage();
|
||||
String simpleMessage = unauditResult.getInteractionContext().getSimpleMessage();
|
||||
if (message!=null){
|
||||
if (message != null) {
|
||||
stringBuilder.append(",").append(message);
|
||||
}
|
||||
if (message!=null){
|
||||
if (message != null) {
|
||||
stringBuilder.append(",").append(simpleMessage);
|
||||
}
|
||||
}
|
||||
List<Object> successPkIds = unauditResult.getSuccessPkIds();
|
||||
DynamicObject[] bd_suppliers1 =new DynamicObject[successPkIds.size()];
|
||||
DynamicObject[] bd_suppliers1 = new DynamicObject[successPkIds.size()];
|
||||
for (int i = 0; i < successPkIds.size(); i++) {
|
||||
bd_suppliers1[i]= BusinessDataServiceHelper.loadSingle("bd_supplier", new QFilter[]{new QFilter("id", QCP.in, successPkIds.get(i))});
|
||||
bd_suppliers1[i].set("tqq9_mulcombofield1",tqq9_qyzz);
|
||||
bd_suppliers1[i] = BusinessDataServiceHelper.loadSingle("bd_supplier", new QFilter[]{new QFilter("id", QCP.in, successPkIds.get(i))});
|
||||
bd_suppliers1[i].set("tqq9_mulcombofield1", tqq9_qyzz);
|
||||
bd_suppliers1[i].set("tqq9_gysqyzzbg", changeqyzz);
|
||||
}
|
||||
OperationResult sumbitResult = OperationServiceHelper.executeOperate(Constants.TYPE_SUBMIT, "bd_supplier", bd_suppliers1, operateOption);
|
||||
if (!sumbitResult.isSuccess()) {
|
||||
|
|
@ -128,21 +163,19 @@ public class SupplierFormPlugin extends AbstractListPlugin implements Plugin {
|
|||
for (IOperateInfo iOperateInfo : allErrorOrValidateInfo) {
|
||||
String supNumber = supplierMap.get(iOperateInfo.getPkValue());
|
||||
String message = iOperateInfo.getMessage();
|
||||
stringBuilder.append(",").append("编码为 ").append(supNumber).append(" 的供应商提交失败,"+message);
|
||||
stringBuilder.append(",").append("编码为 ").append(supNumber).append(" 的供应商提交失败," + message);
|
||||
}
|
||||
String message = sumbitResult.getMessage();
|
||||
String simpleMessage = sumbitResult.getInteractionContext().getSimpleMessage();
|
||||
if (message!=null){
|
||||
if (message != null) {
|
||||
stringBuilder.append(",").append(message);
|
||||
}
|
||||
if (message!=null){
|
||||
if (message != null) {
|
||||
stringBuilder.append(",").append(simpleMessage);
|
||||
}
|
||||
}
|
||||
if(stringBuilder.length()>0){
|
||||
if (stringBuilder.length() > 0) {
|
||||
this.getView().showErrorNotification(stringBuilder.substring(1));
|
||||
return;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ public class PurOrderBillRebatePlugin extends AbstractOperationServicePlugIn imp
|
|||
}
|
||||
} catch (IOException ex) {
|
||||
lcLogService.savelog("FL-锁定返利金额", Create_URL, true, false, bodyMap.toString(), "接口调用报错,errormessage:" + ex.getMessage());
|
||||
throw new RuntimeException(ex);
|
||||
throw new RuntimeException(ex+",请求返利系统失败");
|
||||
}
|
||||
dataEntity.set("tqq9_hshfsyje_old", tqq9_hshfsyje);//含税货返使用金额(旧)
|
||||
SaveServiceHelper.save(new DynamicObject[]{dataEntity});
|
||||
|
|
@ -185,7 +185,8 @@ public class PurOrderBillRebatePlugin extends AbstractOperationServicePlugIn imp
|
|||
}
|
||||
} catch (IOException ex) {
|
||||
lcLogService.savelog("FL-锁定返利金额", Create_URL, true, false, bodyMap.toString(), "接口调用报错,errormessage:" + ex.getMessage());
|
||||
throw new RuntimeException(ex);
|
||||
throw new RuntimeException(ex+",请求返利系统失败");
|
||||
|
||||
}
|
||||
dataEntity.set("tqq9_hsxfsyje_old", tqq9_hsxfsyje);//含税现返使用金额(旧)
|
||||
SaveServiceHelper.save(new DynamicObject[]{dataEntity});
|
||||
|
|
@ -214,7 +215,7 @@ public class PurOrderBillRebatePlugin extends AbstractOperationServicePlugIn imp
|
|||
}
|
||||
} catch (IOException ex) {
|
||||
lcLogService.savelog("FL-解锁返利金额", Cancel_URL, false, false, queryMap.toString(), "接口调用报错,errormessage:" + ex.getMessage());
|
||||
throw new RuntimeException(ex);
|
||||
throw new RuntimeException(ex+",请求返利系统失败");
|
||||
}
|
||||
|
||||
if (tqq9_hshfsyje.compareTo(BigDecimal.ZERO) > 0) {
|
||||
|
|
@ -239,7 +240,7 @@ public class PurOrderBillRebatePlugin extends AbstractOperationServicePlugIn imp
|
|||
}
|
||||
} catch (IOException ex) {
|
||||
lcLogService.savelog("FL-锁定返利金额", Create_URL, true, false, bodyMap.toString(), "接口调用报错,errormessage:" + ex.getMessage());
|
||||
throw new RuntimeException(ex);
|
||||
throw new RuntimeException(ex+",请求返利系统失败");
|
||||
}
|
||||
dataEntity.set("tqq9_hshfsyje_old", tqq9_hshfsyje);//含税货返使用金额(旧)
|
||||
SaveServiceHelper.save(new DynamicObject[]{dataEntity});
|
||||
|
|
@ -270,7 +271,7 @@ public class PurOrderBillRebatePlugin extends AbstractOperationServicePlugIn imp
|
|||
}
|
||||
} catch (IOException ex) {
|
||||
lcLogService.savelog("FL-解锁返利金额", Cancel_URL, false, false, queryMap.toString(), "接口调用报错,errormessage:" + ex.getMessage());
|
||||
throw new RuntimeException(ex);
|
||||
throw new RuntimeException(ex+",请求返利系统失败");
|
||||
}
|
||||
if (tqq9_hsxfsyje.compareTo(BigDecimal.ZERO) > 0) {
|
||||
notaxamount = tqq9_hsxfsyje.multiply(oneHundred.divide(oneHundred.add(taxrate), 10, RoundingMode.HALF_UP)).setScale(2, RoundingMode.HALF_UP);
|
||||
|
|
@ -294,7 +295,7 @@ public class PurOrderBillRebatePlugin extends AbstractOperationServicePlugIn imp
|
|||
}
|
||||
} catch (IOException ex) {
|
||||
lcLogService.savelog("FL-锁定返利金额", Create_URL, true, false, bodyMap.toString(), "接口调用报错,errormessage:" + ex.getMessage());
|
||||
throw new RuntimeException(ex);
|
||||
throw new RuntimeException(ex+",请求返利系统失败");
|
||||
}
|
||||
dataEntity.set("tqq9_hsxfsyje_old", tqq9_hsxfsyje);//含税现返使用金额(旧)
|
||||
SaveServiceHelper.save(new DynamicObject[]{dataEntity});
|
||||
|
|
@ -345,7 +346,7 @@ public class PurOrderBillRebatePlugin extends AbstractOperationServicePlugIn imp
|
|||
}
|
||||
} catch (IOException ex) {
|
||||
lcLogService.savelog("FL-解锁返利金额", Cancel_URL, false, false, queryMap.toString(), "接口调用报错,errormessage:" + ex.getMessage());
|
||||
throw new RuntimeException(ex);
|
||||
throw new RuntimeException(ex+",请求返利系统失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -373,7 +374,7 @@ public class PurOrderBillRebatePlugin extends AbstractOperationServicePlugIn imp
|
|||
}
|
||||
} catch (IOException ex) {
|
||||
lcLogService.savelog("FL-解锁返利金额", Cancel_URL, false, false, queryMap.toString(), "接口调用报错,errormessage:" + ex.getMessage());
|
||||
throw new RuntimeException(ex);
|
||||
throw new RuntimeException(ex+",请求返利系统失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -422,7 +423,7 @@ public class PurOrderBillRebatePlugin extends AbstractOperationServicePlugIn imp
|
|||
}
|
||||
} catch (IOException ex) {
|
||||
lcLogService.savelog("FL-解锁返利金额", Cancel_URL, false, false, queryMap.toString(), "接口调用报错,errormessage:" + ex.getMessage());
|
||||
throw new RuntimeException(ex);
|
||||
throw new RuntimeException(ex+",请求返利系统失败");
|
||||
}
|
||||
DynamicObject pm_purorderbill = BusinessDataServiceHelper.loadSingle("pm_purorderbill", new QFilter[]{new QFilter("billno", QCP.equals, billno1)});
|
||||
tqq9_hshfsyje = pm_purorderbill.getBigDecimal("tqq9_hshfsyje").setScale(2, RoundingMode.HALF_UP);//含税货返使用金额
|
||||
|
|
@ -452,7 +453,7 @@ public class PurOrderBillRebatePlugin extends AbstractOperationServicePlugIn imp
|
|||
}
|
||||
} catch (IOException ex) {
|
||||
lcLogService.savelog("FL-锁定返利金额", Create_URL, true, false, bodyMap.toString(), "接口调用报错,errormessage:" + ex.getMessage());
|
||||
throw new RuntimeException(ex);
|
||||
throw new RuntimeException(ex+",请求返利系统失败");
|
||||
}
|
||||
pm_purorderbill.set("tqq9_hshfsyje_old", tqq9_hshfsyje);//含税货返使用金额(旧)
|
||||
SaveServiceHelper.save(new DynamicObject[]{pm_purorderbill});
|
||||
|
|
@ -483,7 +484,7 @@ public class PurOrderBillRebatePlugin extends AbstractOperationServicePlugIn imp
|
|||
}
|
||||
} catch (IOException ex) {
|
||||
lcLogService.savelog("FL-解锁返利金额", Cancel_URL, false, false, queryMap.toString(), "接口调用报错,errormessage:" + ex.getMessage());
|
||||
throw new RuntimeException(ex);
|
||||
throw new RuntimeException(ex+",请求返利系统失败");
|
||||
}
|
||||
DynamicObject pm_purorderbill = BusinessDataServiceHelper.loadSingle("pm_purorderbill", new QFilter[]{new QFilter("billno", QCP.equals, billno1)});
|
||||
tqq9_hsxfsyje = pm_purorderbill.getBigDecimal("tqq9_hsxfsyje").setScale(2, RoundingMode.HALF_UP);//含税现返使用金额
|
||||
|
|
@ -513,7 +514,7 @@ public class PurOrderBillRebatePlugin extends AbstractOperationServicePlugIn imp
|
|||
}
|
||||
} catch (IOException ex) {
|
||||
lcLogService.savelog("FL-锁定返利金额", Create_URL, true, false, bodyMap.toString(), "接口调用报错,errormessage:" + ex.getMessage());
|
||||
throw new RuntimeException(ex);
|
||||
throw new RuntimeException(ex+",请求返利系统失败");
|
||||
}
|
||||
pm_purorderbill.set("tqq9_hsxfsyje_old", tqq9_hsxfsyje);//含税货返使用金额(旧)
|
||||
SaveServiceHelper.save(new DynamicObject[]{pm_purorderbill});
|
||||
|
|
@ -568,7 +569,7 @@ public class PurOrderBillRebatePlugin extends AbstractOperationServicePlugIn imp
|
|||
}
|
||||
} catch (IOException ex) {
|
||||
lcLogService.savelog("FL-使用返利金额", Use_URL, false, false, bodyMap.toString(), "接口调用报错,errormessage:" + ex.getMessage());
|
||||
throw new RuntimeException(ex);
|
||||
throw new RuntimeException(ex+",请求返利系统失败");
|
||||
}
|
||||
}
|
||||
//现返审核
|
||||
|
|
@ -597,7 +598,7 @@ public class PurOrderBillRebatePlugin extends AbstractOperationServicePlugIn imp
|
|||
}
|
||||
} catch (IOException ex) {
|
||||
lcLogService.savelog("FL-使用返利金额", Use_URL, false, false, bodyMap.toString(), "接口调用报错,errormessage:" + ex.getMessage());
|
||||
throw new RuntimeException(ex);
|
||||
throw new RuntimeException(ex+",请求返利系统失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -322,7 +322,7 @@ public class RebateRuleOpPlugin extends AbstractOperationServicePlugIn implement
|
|||
}
|
||||
SaveServiceHelper.save(new DynamicObject[]{tqq9_conm_purcontract});
|
||||
}
|
||||
throw new RuntimeException(ex);
|
||||
throw new RuntimeException(ex+",请求返利系统失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue