检验单含不合格数量时,不允许审批
This commit is contained in:
		
							parent
							
								
									b6f1d11950
								
							
						
					
					
						commit
						316e41f21a
					
				|  | @ -9,12 +9,15 @@ import java.util.UUID; | |||
| import java.lang.String; | ||||
| import java.util.stream.Stream; | ||||
| import nc.vo.pub.lang.UFDateTime; | ||||
| import nc.vo.pub.lang.UFDouble; | ||||
| import nc.uap.utils.InSQLCreator; | ||||
| import org.apache.commons.lang3.ArrayUtils; | ||||
| import org.apache.commons.lang3.StringUtils; | ||||
| 
 | ||||
| import com.informix.util.stringUtil; | ||||
| 
 | ||||
| import cn.hutool.core.util.NumberUtil; | ||||
| 
 | ||||
| import org.apache.commons.beanutils.PropertyUtils; | ||||
| 
 | ||||
| import nc.vo.pub.BusinessException; | ||||
|  | @ -31,6 +34,7 @@ import nc.vo.pu.dhjyd.AggDhjydMasterVO; | |||
| import nc.itf.pu.dhjyd.dhjydmaster.IDhjydMasterVOService; | ||||
| import nc.jdbc.framework.processor.ColumnProcessor; | ||||
| import nc.vo.pub.pf.BillStatusEnum; | ||||
| import nc.vo.pubapp.pattern.pub.MathTool; | ||||
| import nc.bs.dao.BaseDAO; | ||||
| import nc.bs.framework.common.InvocationInfoProxy; | ||||
| import nccloud.framework.core.exception.ExceptionUtils; | ||||
|  | @ -424,6 +428,30 @@ public class DhjydMasterVOServiceImpl extends ServiceSupport implements IDhjydMa | |||
| 		throw new BusinessException(errors); | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * 提交前校验: 检验单含不合格数量时,不允许审批 | ||||
| 	 *  | ||||
| 	 * @throws BusinessException | ||||
| 	 */ | ||||
| 	private void validateCommitDhjydNum(AggDhjydMasterVO... vos) throws BusinessException { | ||||
| 		if (ArrayUtils.isEmpty(vos)) { | ||||
| 			return; | ||||
| 		} | ||||
| 		String errors = ""; | ||||
| 		for (AggDhjydMasterVO vo : vos) { | ||||
| 			DhjydMasterVO jydMasterVO = vo.getParentVO(); | ||||
| 			// 如果不合格检验数量>0,则给出提示 | ||||
| 			UFDouble brecheck = (UFDouble) jydMasterVO.getAttributeValue("brecheck"); | ||||
| 			// System.out.println("brecheck = " + brecheck); | ||||
| 			if (MathTool.compareTo(brecheck, UFDouble.ZERO_DBL) > 0) { | ||||
| 				errors += "单据号:[" + jydMasterVO.getAttributeValue("code") + "]提交失败,失败原因:含有不合格数量,请检查。\n"; | ||||
| 			} | ||||
| 		} | ||||
| 		if (!"".equals(errors)) { | ||||
| 			throw new BusinessException(errors); | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * 收回前校验: 检查单据状态 | ||||
| 	 *  | ||||
|  | @ -447,6 +475,11 @@ public class DhjydMasterVOServiceImpl extends ServiceSupport implements IDhjydMa | |||
| 		throw new BusinessException(errors); | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * 收回前校验: 检验单弃审时验证到货单是否已入库 | ||||
| 	 *  | ||||
| 	 * @throws BusinessException | ||||
| 	 */ | ||||
| 	private void validateUnCommitInOrder(AggDhjydMasterVO... vos) throws BusinessException { | ||||
| 		if (ArrayUtils.isEmpty(vos)) { | ||||
| 			return; | ||||
|  | @ -486,6 +519,7 @@ public class DhjydMasterVOServiceImpl extends ServiceSupport implements IDhjydMa | |||
| 		validateTs(tsMap, vos); | ||||
| 		// 提交前校验及业务逻辑 | ||||
| 		validateCommitAggDhjydMasterVO(vos); | ||||
| 		validateCommitDhjydNum(vos); | ||||
| 		Map<String, Object> res = this.execFlows(actionName, "DHJY", assign, vos); | ||||
| 		// 提交后业务逻辑 | ||||
| 		return res; | ||||
|  | @ -497,6 +531,7 @@ public class DhjydMasterVOServiceImpl extends ServiceSupport implements IDhjydMa | |||
| 		validateTs(tsMap, vos); | ||||
| 		// 批量提交前校验及业务逻辑 | ||||
| 		validateCommitAggDhjydMasterVO(vos); | ||||
| 		validateCommitDhjydNum(vos); | ||||
| 		Map<String, Object> res = this.execFlows(actionName, "DHJY", vos); | ||||
| 		// 批量提交后业务逻辑 | ||||
| 		return res; | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue