排产控制逻辑增加组织机构过滤
This commit is contained in:
		
							parent
							
								
									3a39c9d9c7
								
							
						
					
					
						commit
						52a92baf40
					
				|  | @ -11,15 +11,22 @@ import nc.bs.arap.util.BillAccountCalendarUtils; | |||
| import nc.bs.arap.util.BillDateUtils; | ||||
| import nc.bs.arap.validator.CrossRuleCheckValidator; | ||||
| import nc.bs.dao.BaseDAO; | ||||
| import nc.bs.dao.DAOException; | ||||
| import nc.bs.trade.business.HYSuperDMO; | ||||
| import nc.jdbc.framework.processor.MapProcessor; | ||||
| import nc.vo.arap.basebill.BaseBillVO; | ||||
| import nc.vo.arap.gathering.GatheringBillItemVO; | ||||
| import nc.vo.arap.utils.StringUtil; | ||||
| import nc.vo.bd.defdoc.DefdocVO; | ||||
| import nc.vo.pub.AggregatedValueObject; | ||||
| import nc.vo.pub.BusinessException; | ||||
| import nc.vo.pub.CircularlyAccessibleValueObject; | ||||
| import nc.vo.pub.lang.UFDouble; | ||||
| 
 | ||||
| import java.time.LocalDateTime; | ||||
| import java.time.format.DateTimeFormatter; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| public class GatheringbillEditSaveBatchBSAction extends BillUpdateBatchBSAction { | ||||
|  | @ -71,10 +78,21 @@ public class GatheringbillEditSaveBatchBSAction extends BillUpdateBatchBSAction | |||
| 			UFDouble changeMoney = money.sub(oriMoney); | ||||
| 			// 몽앴饋簡땐데id혼꿴璂饋簡땐데 | ||||
| 			BaseDAO dao = new BaseDAO(); | ||||
| 			String sql = "select vbillcode,nreceivedmny,ntotalorigmny from so_saleorder where dr = 0 and csaleorderid = '" + def3 | ||||
| 					+ "'"; | ||||
| 			List<String> defMap = checkOrgCtrl(); | ||||
| 			if (defMap.isEmpty() ) { | ||||
| 				return ; | ||||
| 			} | ||||
| 			String sql1="SELECT org_salesorg.CODE ,so_saleorder.dbilldate, so_saleorder.pk_org, so_saleorder.vbillcode,so_saleorder.nreceivedmny,so_saleorder.ntotalorigmny FROM  so_saleorder LEFT JOIN org_salesorg ON org_salesorg.PK_SALESORG = so_saleorder.PK_ORG  where so_saleorder.dr = 0 and so_saleorder.csaleorderid = '" +def3+"'"; | ||||
| 			Map saleMap = (Map)dao.executeQuery(sql1, new MapProcessor()); | ||||
| 			String code = saleMap.get("code").toString(); | ||||
| 			LocalDateTime dbilldate = LocalDateTime.parse(saleMap.get("dbilldate").toString(), | ||||
| 					DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); | ||||
| 			LocalDateTime targetDate = LocalDateTime.parse("2025-06-27 00:00:00", | ||||
| 					DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); | ||||
| 
 | ||||
| 			Map saleMap = (Map) dao.executeQuery(sql, new MapProcessor()); | ||||
| 			if (defMap.contains(code) && dbilldate.isBefore(targetDate)) { | ||||
| 				return; | ||||
| 			} | ||||
| 			// 饋簡땐데송江북셕 | ||||
| 			UFDouble ntotalorigmny = UFDouble.ZERO_DBL; | ||||
| 			// 饋簡땐데茄셥澗운쏜띨 | ||||
|  | @ -119,4 +137,19 @@ public class GatheringbillEditSaveBatchBSAction extends BillUpdateBatchBSAction | |||
| 		this.checkOtherSystemBill(bills, orginBills); | ||||
| 		(new CrossRuleCheckValidator()).validate(bills); | ||||
| 	} | ||||
| 	private List<String> checkOrgCtrl() { | ||||
| 		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; | ||||
| 	} | ||||
| } | ||||
|  |  | |||
|  | @ -12,14 +12,22 @@ import nc.bs.arap.util.BillDateUtils; | |||
| import nc.bs.arap.util.BillMoneyVUtils; | ||||
| import nc.bs.arap.validator.CrossRuleCheckValidator; | ||||
| import nc.bs.dao.BaseDAO; | ||||
| import nc.bs.dao.DAOException; | ||||
| import nc.bs.trade.business.HYSuperDMO; | ||||
| import nc.jdbc.framework.processor.MapProcessor; | ||||
| import nc.vo.arap.basebill.BaseBillVO; | ||||
| import nc.vo.arap.gathering.GatheringBillItemVO; | ||||
| import nc.vo.arap.utils.StringUtil; | ||||
| import nc.vo.bd.defdoc.DefdocVO; | ||||
| import nc.vo.pub.AggregatedValueObject; | ||||
| import nc.vo.pub.BusinessException; | ||||
| import nc.vo.pub.lang.UFDouble; | ||||
| 
 | ||||
| import java.time.LocalDateTime; | ||||
| import java.time.format.DateTimeFormatter; | ||||
| import java.util.ArrayList; | ||||
| import java.util.HashMap; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| public class GatheringbillSaveBatchBSAction extends BillInsertBatchBSAction { | ||||
|  | @ -84,7 +92,24 @@ public class GatheringbillSaveBatchBSAction extends BillInsertBatchBSAction { | |||
|             BaseDAO dao = new BaseDAO(); | ||||
|             String sql = "select vbillcode,nreceivedmny,ntotalorigmny from so_saleorder where dr = 0 and csaleorderid = '" +def3+"'"; | ||||
| 
 | ||||
|             Map saleMap = (Map)dao.executeQuery(sql, new MapProcessor()); | ||||
| 
 | ||||
| 
 | ||||
|             List<String> defMap = checkOrgCtrl(); | ||||
|             if (defMap.isEmpty() ) { | ||||
|                 return ; | ||||
|             } | ||||
|             String sql1="SELECT org_salesorg.CODE ,so_saleorder.dbilldate, so_saleorder.pk_org, so_saleorder.vbillcode,so_saleorder.nreceivedmny,so_saleorder.ntotalorigmny FROM  so_saleorder LEFT JOIN org_salesorg ON org_salesorg.PK_SALESORG = so_saleorder.PK_ORG  where so_saleorder.dr = 0 and so_saleorder.csaleorderid = '" +def3+"'"; | ||||
|             Map saleMap = (Map)dao.executeQuery(sql1, new MapProcessor()); | ||||
|             String code = saleMap.get("code").toString(); | ||||
|             LocalDateTime dbilldate = LocalDateTime.parse(saleMap.get("dbilldate").toString(), | ||||
|                     DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); | ||||
|             LocalDateTime targetDate = LocalDateTime.parse("2025-06-27 00:00:00", | ||||
|                     DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); | ||||
| 
 | ||||
|             if (defMap.contains(code) && dbilldate.isBefore(targetDate)) { | ||||
|                 return; | ||||
|             } | ||||
| //            Map saleMap = (Map)dao.executeQuery(sql, new MapProcessor()); | ||||
|             //销售订单价税合计 | ||||
|             UFDouble ntotalorigmny = UFDouble.ZERO_DBL; | ||||
|             //销售订单实际收款金额 | ||||
|  | @ -101,4 +126,19 @@ public class GatheringbillSaveBatchBSAction extends BillInsertBatchBSAction { | |||
|             } | ||||
|         } | ||||
|     } | ||||
|     private List<String> checkOrgCtrl() { | ||||
|         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