Compare commits
4 Commits
02ce990a09
...
319b471937
Author | SHA1 | Date | |
---|---|---|---|
![]() |
319b471937 | ||
![]() |
5cfb867b1d | ||
![]() |
039f8aee92 | ||
![]() |
c9caeb4469 |
@ -252,19 +252,19 @@ public class SalesOrderSubmitValidator extends AbstractValidator {
|
||||
BigDecimal debcuseamt = dynamicObject.getBigDecimal("yem_debcuseamt");
|
||||
DynamicObject yemBdProducts = dataEntity.getDynamicObject("yem_bd_products");
|
||||
Long along = 0L;
|
||||
if (yemBdProducts!=null){
|
||||
if (yemBdProducts != null) {
|
||||
String number = yemBdProducts.getString("number");
|
||||
if ("CC".equals(number)||"CCPJ".equals(number)){
|
||||
if ("CC".equals(number) || "CCPJ".equals(number)) {
|
||||
DynamicObject loadSingle = BusinessDataServiceHelper.loadSingle("yem_bd_productsgroup", "id,number"
|
||||
, new QFilter[]{new QFilter("number", QCP.equals, "CC")});
|
||||
along = loadSingle.getLong("id");
|
||||
}
|
||||
if ("TLJ".equals(number)||"TLJPJ".equals(number)){
|
||||
if ("TLJ".equals(number) || "TLJPJ".equals(number)) {
|
||||
DynamicObject loadSingle = BusinessDataServiceHelper.loadSingle("yem_bd_productsgroup", "id,number"
|
||||
, new QFilter[]{new QFilter("number", QCP.equals, "TLJ")});
|
||||
along = loadSingle.getLong("id");
|
||||
}
|
||||
if ("ZZJ".equals(number)||"ZZJPJ".equals(number)){
|
||||
if ("ZZJ".equals(number) || "ZZJPJ".equals(number)) {
|
||||
DynamicObject loadSingle = BusinessDataServiceHelper.loadSingle("yem_bd_productsgroup", "id,number"
|
||||
, new QFilter[]{new QFilter("number", QCP.equals, "ZZJ")});
|
||||
along = loadSingle.getLong("id");
|
||||
@ -275,7 +275,7 @@ public class SalesOrderSubmitValidator extends AbstractValidator {
|
||||
.and("yem_spcapitalpool_a.yem_debcredtype", QCP.equals, debcred)
|
||||
.and("yem_spcapitalpool_a.yem_creditype.id", QCP.equals, debcredtype)
|
||||
.and("yem_customer.id", QCP.equals, groupcustomers)
|
||||
.and("yem_bd_products.id",QCP.equals,along);
|
||||
.and("yem_bd_products.id", QCP.equals, along);
|
||||
DynamicObject single = BusinessDataServiceHelper.loadSingle("yem_spcapitalpool", qFilter.toArray());
|
||||
if (single == null) return;
|
||||
DynamicObjectCollection singleCollection = single.getDynamicObjectCollection("yem_spcapitalpool_a");
|
||||
@ -438,7 +438,12 @@ public class SalesOrderSubmitValidator extends AbstractValidator {
|
||||
int row = j + 1;
|
||||
DynamicObject object = yem_accfunddetail.get(j);
|
||||
DynamicObject yem_debcredtype = object.getDynamicObject("yem_debcredtype");//贷记单类型
|
||||
long debcredtypeid = yem_debcredtype.getLong("id");
|
||||
long debcredtypeid = 0L;
|
||||
if (yem_debcredtype != null) {
|
||||
debcredtypeid = yem_debcredtype.getLong("id");
|
||||
}else {
|
||||
this.addMessage(dataEntitie,"当前单配件资金使用明细页签中,‘借贷业务类型’存在空值");
|
||||
}
|
||||
DynamicObject yem_debcrednotecurr = object.getDynamicObject("yem_debcrednotecurr");//贷记单使用币别
|
||||
BigDecimal yem_creditrmbamt = object.getBigDecimal("yem_creditrmbamt");//贷记单人民币金额
|
||||
BigDecimal yem_creditusdamt = object.getBigDecimal("yem_creditusdamt");//贷记单美元金额
|
||||
@ -831,7 +836,7 @@ public class SalesOrderSubmitValidator extends AbstractValidator {
|
||||
}
|
||||
|
||||
|
||||
public static DynamicObject [] getCsrCreditLine(DynamicObject customer, DynamicObject method, DynamicObject company, String swiftCode) {
|
||||
public static DynamicObject[] getCsrCreditLine(DynamicObject customer, DynamicObject method, DynamicObject company, String swiftCode) {
|
||||
if (YEM.isNotEmpty(customer) && YEM.isNotEmpty(method) && YEM.isNotEmpty(company)) {
|
||||
String selectfields = DynamicObjectUtil.getSelectfields("yem_im_csrcreditline", false);
|
||||
selectfields = DynamicObjectUtil.getEntrySelectfields(selectfields, "yem_im_csrcreditline", "yem_im_info", false);
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.yem.wm.im.csrCreditLine.task;
|
||||
|
||||
import com.yem.wm.utils.DynamicObjectUtil;
|
||||
import com.yem.wm.utils.YEM;
|
||||
import kd.bos.context.RequestContext;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
@ -11,7 +10,6 @@ import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.ZoneId;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
@ -37,9 +35,9 @@ public class CsrCreditLineTask extends AbstractTask {
|
||||
Date unused = dynamicObject.getDate("yem_unused");
|
||||
// if (YEM.isNotEmpty(unused)) {
|
||||
// data(dynamicObject, unused, "yem_countdown");
|
||||
BigDecimal yemInactivityperiod = dynamicObject.getBigDecimal("yem_inactivityperiod");
|
||||
Date date = dynamicObject.getDate("yem_recentlapse");
|
||||
recentl(dynamicObject, yemInactivityperiod, date);
|
||||
BigDecimal yemInactivityperiod = dynamicObject.getBigDecimal("yem_inactivityperiod");
|
||||
Date date = dynamicObject.getDate("yem_recentlapse");
|
||||
recentl(dynamicObject, yemInactivityperiod, date);
|
||||
// }
|
||||
DynamicObjectCollection collection = dynamicObject.getDynamicObjectCollection("yem_im_info");
|
||||
for (DynamicObject object : collection) {
|
||||
@ -65,16 +63,19 @@ public class CsrCreditLineTask extends AbstractTask {
|
||||
public static void recentl(DynamicObject dynamicObject, BigDecimal yemInactivityperiod, Date date) {
|
||||
if (date != null) {
|
||||
if (yemInactivityperiod.compareTo(BigDecimal.ZERO) != 0) {
|
||||
long daysInMilliseconds = yemInactivityperiod.longValue() * TimeUnit.DAYS.toMillis(1);
|
||||
Date yemRecentlapse = new Date(date.getTime() + daysInMilliseconds);
|
||||
dynamicObject.set("yem_unused", yemRecentlapse);
|
||||
Date newdate = new Date();
|
||||
long millisDifference = yemRecentlapse.getTime() - newdate.getTime();
|
||||
long daysDifference = TimeUnit.MILLISECONDS.toDays(millisDifference);
|
||||
BigDecimal bigDecimalDaysDifference = BigDecimal.valueOf(daysDifference);
|
||||
dynamicObject.set("yem_countdown", bigDecimalDaysDifference.add(BigDecimal.ONE));
|
||||
BigDecimal yemSumamountowed = dynamicObject.getBigDecimal("yem_sumamountowed");
|
||||
if (yemSumamountowed.compareTo(BigDecimal.ZERO) != 0) {
|
||||
long daysInMilliseconds = yemInactivityperiod.longValue() * TimeUnit.DAYS.toMillis(1);
|
||||
Date yemRecentlapse = new Date(date.getTime() + daysInMilliseconds);
|
||||
dynamicObject.set("yem_unused", yemRecentlapse);
|
||||
Date newdate = new Date();
|
||||
long millisDifference = yemRecentlapse.getTime() - newdate.getTime();
|
||||
long daysDifference = TimeUnit.MILLISECONDS.toDays(millisDifference);
|
||||
BigDecimal bigDecimalDaysDifference = BigDecimal.valueOf(daysDifference);
|
||||
dynamicObject.set("yem_countdown", bigDecimalDaysDifference.add(BigDecimal.ONE));
|
||||
// } else {
|
||||
// csrcreditline.set("yem_unused", yemRecentlapse);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -900,6 +900,7 @@ public class tracktaskconsoleFormPlugIn extends AbstractBillPlugIn implements Be
|
||||
}
|
||||
|
||||
date.set("yem_materielg", dynamicObject.getDynamicObject("yem_materiel"));
|
||||
date.set("yem_qtyq", dynamicObject.getDynamicObject("yem_qtyq1"));
|
||||
date.set("yem_stockqty", dynamicObject.getBigDecimal("yem_nqty"));//备料数量
|
||||
date.set("yem_stockunit", dynamicObject.getDynamicObject("yem_unit"));//计量单位
|
||||
date.set("yem_stockbaseunit", dynamicObject.getDynamicObject("yem_baseunit"));//基本计量单位
|
||||
|
@ -1,15 +1,10 @@
|
||||
package com.yem.wm.im.tracktaskconsole.op;
|
||||
|
||||
import com.yem.wm.im.priceLibrary.validator.PriceLibraryAuditValidator;
|
||||
import com.yem.wm.im.tracktaskconsole.validator.TracktaskconsoleSubmitvalidator;
|
||||
import com.yem.wm.im.yearlybudget.validator.YearlyBudgetValidator;
|
||||
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
||||
import kd.bos.entity.plugin.AddValidatorsEventArgs;
|
||||
import kd.bos.entity.plugin.PreparePropertysEventArgs;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhouc
|
||||
* @date 2023/8/12 19:26
|
||||
|
@ -5,6 +5,10 @@ import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.entity.ExtendedDataEntity;
|
||||
import kd.bos.entity.validate.AbstractValidator;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author zhouc
|
||||
* @date 2023/8/12 19:29
|
||||
@ -48,6 +52,31 @@ public class TracktaskconsoleSubmitvalidator extends AbstractValidator {
|
||||
}
|
||||
}
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
DynamicObjectCollection c = dataEntity.getDynamicObjectCollection("yem_es_materialinfo");
|
||||
Map<Long, Integer> cancelQty = new LinkedHashMap<>();
|
||||
for (DynamicObject d : c) {
|
||||
long id = d.getLong("id");
|
||||
BigDecimal cancel_num = d.getBigDecimal("yem_cancel_num");
|
||||
if (cancel_num.compareTo(BigDecimal.ZERO) > 0) {
|
||||
cancelQty.put(id, c.indexOf(d));
|
||||
}
|
||||
}
|
||||
|
||||
DynamicObjectCollection backC = dataEntity.getDynamicObjectCollection("yem_es_salesorder_r");
|
||||
for (DynamicObject d : backC) {
|
||||
long entrtyid = d.getLong("yem_entrtyid");
|
||||
if (cancelQty.containsKey(entrtyid)) {
|
||||
Integer idx = cancelQty.get(entrtyid);
|
||||
DynamicObjectCollection subC = d.getDynamicObjectCollection("yem_es_salesorder_z");
|
||||
if (!subC.isEmpty()) {
|
||||
sb.append(String.format("商品明细第 %s 行已维护取消数量,不允许维护整机生产信息!", idx + 1)).append("\r\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (sb.length() > 0) {
|
||||
this.addErrorMessage(dataEntitie, sb.toString());
|
||||
}
|
||||
|
||||
// DynamicObject billType = dataEntity.getDynamicObject("yem_billtype");//单据类型
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user