This commit is contained in:
parent
c3b061861f
commit
9086a9d93b
|
@ -5,12 +5,16 @@ import java.time.format.DateTimeFormatter;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import nc.bs.dao.DAOException;
|
||||
import nc.bs.framework.common.NCLocator;
|
||||
import nc.bs.trade.business.HYSuperDMO;
|
||||
import nc.impl.pubapp.pattern.rule.IRule;
|
||||
import nc.itf.uap.IUAPQueryBS;
|
||||
import nc.itf.uif.pub.IUifService;
|
||||
import nc.jdbc.framework.processor.ColumnProcessor;
|
||||
import nc.jdbc.framework.processor.MapProcessor;
|
||||
import nc.vo.bd.defdoc.DefdocVO;
|
||||
import nc.vo.ic.m4c.entity.SaleOutHeadVO;
|
||||
import nc.vo.mmpac.pmo.pac0002.entity.PMOAggVO;
|
||||
import nc.vo.mmpac.pmo.pac0002.entity.PMOHeadVO;
|
||||
|
@ -58,6 +62,16 @@ public class putBeforeCheckRule implements IRule<PMOAggVO> {
|
|||
|| valMap.get("pk_billtypecode").equals("30-Cxx-16")) {
|
||||
return;
|
||||
}
|
||||
|
||||
String code = valMap.get("code").toString();
|
||||
LocalDateTime dbilldate = LocalDateTime.parse(valMap.get("dbilldate").toString(),
|
||||
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
LocalDateTime targetDate1 = LocalDateTime.parse("2025-06-27 00:00:00",
|
||||
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
List<String> defMap = checkOrgCtrl1();
|
||||
if (!valMap.isEmpty()&& defMap.contains(code) && dbilldate.isBefore(targetDate1)) {
|
||||
return;
|
||||
}
|
||||
// ÀúÊ·Êý¾Ý²»¿¼ÂÇ
|
||||
String storedDateStr = (String) valMap.get("creationtime");
|
||||
String targetDateStr = "2024-12-31 00:00:00";
|
||||
|
@ -106,4 +120,19 @@ public class putBeforeCheckRule implements IRule<PMOAggVO> {
|
|||
public IUAPQueryBS getQueryService() {
|
||||
return NCLocator.getInstance().lookup(IUAPQueryBS.class);
|
||||
}
|
||||
private List<String> checkOrgCtrl1() {
|
||||
List<String> list = new ArrayList<>();
|
||||
String strWhere = " pk_defdoclist in (select pk_defdoclist from bd_defdoclist where code='org-ctrl' and dr=0 ) and dr=0";
|
||||
try {
|
||||
DefdocVO[] defdocVOs = (DefdocVO[]) new HYSuperDMO().queryByWhereClause(DefdocVO.class, strWhere);
|
||||
if (defdocVOs != null && defdocVOs.length > 0) {
|
||||
for (DefdocVO defdocVO : defdocVOs) {
|
||||
list.add(defdocVO.getCode());
|
||||
}
|
||||
}
|
||||
} catch (DAOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,6 +51,15 @@ public class saveBeforeCheckRule implements IRule<PMOAggVO> {
|
|||
if (valMap == null || valMap.isEmpty()) {
|
||||
throw new BusinessException("无法关联到销售订单,无法保存!");
|
||||
}
|
||||
String code = valMap.get("code").toString();
|
||||
LocalDateTime dbilldate = LocalDateTime.parse(valMap.get("dbilldate").toString(),
|
||||
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
LocalDateTime targetDate1 = LocalDateTime.parse("2025-06-27 00:00:00",
|
||||
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
List<String> defMap = checkOrgCtrl1();
|
||||
if (!valMap.isEmpty()&& defMap.contains(code) && dbilldate.isBefore(targetDate1)) {
|
||||
return;
|
||||
}
|
||||
// 销售发票表头pk_billtypecode=30-Cxx-12
|
||||
if (valMap.get("pk_billtypecode").equals("30-Cxx-12")
|
||||
|| valMap.get("pk_billtypecode").equals("30-Cxx-02")
|
||||
|
@ -94,8 +103,9 @@ public class saveBeforeCheckRule implements IRule<PMOAggVO> {
|
|||
|
||||
private Map<String, Object> getVbdef6(String vsrcbidStr,String cmoid) throws BusinessException {
|
||||
IUAPQueryBS queryBS = NCLocator.getInstance().lookup(IUAPQueryBS.class);
|
||||
String sql = " SELECT bt.pk_billtypecode,s.creationtime,b.vbdef12,d.nastnum FROM so_saleorder_b b\n"
|
||||
String sql = " SELECT org_salesorg.CODE ,s.dbilldate, bt.pk_billtypecode,s.creationtime,b.vbdef12,d.nastnum FROM so_saleorder_b b\n"
|
||||
+ "INNER JOIN so_saleorder s ON s.csaleorderid = b.csaleorderid\n"
|
||||
+ " LEFT JOIN org_salesorg ON org_salesorg.PK_SALESORG = s.PK_ORG "
|
||||
+ "left join (select mm_mo.Vsrcbid,sum(nastnum) as nastnum \n" + "from mm_mo\n" + "where mm_mo.dr=0\n"+" and cmoid !='"+cmoid+ "' "
|
||||
+ "group by mm_mo.Vsrcbid) d on b.csaleorderbid=d.Vsrcbid\n"
|
||||
+ "INNER JOIN bd_billtype bt on bt.pk_billtypeid=s.ctrantypeid\n" + "where b.csaleorderbid='"
|
||||
|
@ -138,5 +148,19 @@ public class saveBeforeCheckRule implements IRule<PMOAggVO> {
|
|||
public IUAPQueryBS getQueryService() {
|
||||
return NCLocator.getInstance().lookup(IUAPQueryBS.class);
|
||||
}
|
||||
|
||||
private List<String> checkOrgCtrl1() {
|
||||
List<String> list = new ArrayList<>();
|
||||
String strWhere = " pk_defdoclist in (select pk_defdoclist from bd_defdoclist where code='org-ctrl' and dr=0 ) and dr=0";
|
||||
try {
|
||||
DefdocVO[] defdocVOs = (DefdocVO[]) new HYSuperDMO().queryByWhereClause(DefdocVO.class, strWhere);
|
||||
if (defdocVOs != null && defdocVOs.length > 0) {
|
||||
for (DefdocVO defdocVO : defdocVOs) {
|
||||
list.add(defdocVO.getCode());
|
||||
}
|
||||
}
|
||||
} catch (DAOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue