|  |  |  | @ -145,6 +145,74 @@ public class PurOrderController { | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @RepeatSubmit() | 
			
		
	
		
			
				
					|  |  |  |  |     @PostMapping("/purchase/order/dealOrder") | 
			
		
	
		
			
				
					|  |  |  |  |     public BaseResponse dealOrder(@RequestBody PostPurOrderRequest postPurOrderRequest) { | 
			
		
	
		
			
				
					|  |  |  |  |         PurOrderEntity purOrderEntity = postPurOrderRequest.getPurOrderEntity(); | 
			
		
	
		
			
				
					|  |  |  |  |         purOrderEntity.setUpdateTime(new Date()); | 
			
		
	
		
			
				
					|  |  |  |  |         purOrderService.update(purOrderEntity); | 
			
		
	
		
			
				
					|  |  |  |  | //        String billNo = "";
 | 
			
		
	
		
			
				
					|  |  |  |  | //        List<PurOrderDetailEntity> purOrderDetailEntities = purOrderDetailService.findByOrderId(purOrderEntity.getId() + "");
 | 
			
		
	
		
			
				
					|  |  |  |  | //
 | 
			
		
	
		
			
				
					|  |  |  |  | //        //对计划单里面的供应商进行分组
 | 
			
		
	
		
			
				
					|  |  |  |  | //        Map<String, List<PurOrderDetailEntity>> map = purOrderDetailEntities.stream().collect(Collectors.groupingBy(PurOrderDetailEntity::getSupId));
 | 
			
		
	
		
			
				
					|  |  |  |  | //
 | 
			
		
	
		
			
				
					|  |  |  |  | //        if (postPurOrderRequest.getEditStatus() == ConstantStatus.APPLY_AUDIT_ED) {
 | 
			
		
	
		
			
				
					|  |  |  |  | //
 | 
			
		
	
		
			
				
					|  |  |  |  | //            if (CollUtil.isNotEmpty(purOrderDetailEntities) && postPurOrderRequest.isAutoPurchase() == true
 | 
			
		
	
		
			
				
					|  |  |  |  | //                    && StrUtil.isNotEmpty(postPurOrderRequest.getTargetSubInv()) && StrUtil.isNotEmpty(postPurOrderRequest.getTargetBillAction())) {
 | 
			
		
	
		
			
				
					|  |  |  |  | //
 | 
			
		
	
		
			
				
					|  |  |  |  | //                for (Map.Entry<String, List<PurOrderDetailEntity>> m : map.entrySet()) {
 | 
			
		
	
		
			
				
					|  |  |  |  | //                    //生产单据表信息
 | 
			
		
	
		
			
				
					|  |  |  |  | //                    IoOrderEntity ioOrderEntity = new IoOrderEntity();
 | 
			
		
	
		
			
				
					|  |  |  |  | //                    ioOrderEntity.setBillNo(gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER, "yyyyMMdd")));
 | 
			
		
	
		
			
				
					|  |  |  |  | //                    ioOrderEntity.setCorpOrderId(CustomUtil.getDate());
 | 
			
		
	
		
			
				
					|  |  |  |  | //                    ioOrderEntity.setMainAction(ConstantType.TYPE_PUT);
 | 
			
		
	
		
			
				
					|  |  |  |  | //                    ioOrderEntity.setAction(postPurOrderRequest.getTargetBillAction());
 | 
			
		
	
		
			
				
					|  |  |  |  | //                    ioOrderEntity.setFromCorp(m.getKey());
 | 
			
		
	
		
			
				
					|  |  |  |  | //                    ioOrderEntity.setFromType(ConstantStatus.FROM_Order);
 | 
			
		
	
		
			
				
					|  |  |  |  | //                    ioOrderEntity.setStatus(1);
 | 
			
		
	
		
			
				
					|  |  |  |  | //                    ioOrderEntity.setDealStatus(1);
 | 
			
		
	
		
			
				
					|  |  |  |  | //                    ioOrderEntity.setOrderType(1);
 | 
			
		
	
		
			
				
					|  |  |  |  | //                    ioOrderEntity.setCreateTime(new Date());
 | 
			
		
	
		
			
				
					|  |  |  |  | //                    ioOrderEntity.setCreateUser(postPurOrderRequest.getPurOrderEntity().getAuditUser());
 | 
			
		
	
		
			
				
					|  |  |  |  | //                    ioOrderEntity.setUpdateTime(new Date());
 | 
			
		
	
		
			
				
					|  |  |  |  | //                    ioOrderEntity.setUpdateUser(postPurOrderRequest.getPurOrderEntity().getAuditUser());
 | 
			
		
	
		
			
				
					|  |  |  |  | //                    ioOrderEntity.setCustomerId("110");
 | 
			
		
	
		
			
				
					|  |  |  |  | //                    ioOrderEntity.setDeptCode(purOrderEntity.getDeptCode());
 | 
			
		
	
		
			
				
					|  |  |  |  | //                    ioOrderEntity.setInvCode(purOrderEntity.getInvCode());
 | 
			
		
	
		
			
				
					|  |  |  |  | //                    ioOrderService.insertOrder(ioOrderEntity);
 | 
			
		
	
		
			
				
					|  |  |  |  | //                    billNo += ioOrderEntity.getBillNo() + ",";
 | 
			
		
	
		
			
				
					|  |  |  |  | //                    //插入业务单表
 | 
			
		
	
		
			
				
					|  |  |  |  | //                    for (PurOrderDetailEntity obj : m.getValue()) {
 | 
			
		
	
		
			
				
					|  |  |  |  | //                        BasicProductsEntity basicProductsEntity = purOrderDetailService.selectIoOrderDetailBiz(obj.getId());
 | 
			
		
	
		
			
				
					|  |  |  |  | //                        IoOrderDetailBizEntity ioOrderDetailBizEntity = new IoOrderDetailBizEntity();
 | 
			
		
	
		
			
				
					|  |  |  |  | //                        ioOrderDetailBizEntity.setOrderIdFk(ioOrderEntity.getBillNo());
 | 
			
		
	
		
			
				
					|  |  |  |  | //                        ioOrderDetailBizEntity.setBindRlFk(Long.valueOf(obj.getProductId()));
 | 
			
		
	
		
			
				
					|  |  |  |  | //                        ioOrderDetailBizEntity.setCount(obj.getCount());
 | 
			
		
	
		
			
				
					|  |  |  |  | //                        ioOrderDetailBizEntity.setUuidFk(basicProductsEntity.getUuid());
 | 
			
		
	
		
			
				
					|  |  |  |  | //                        ioOrderDetailBizEntity.setNameCode(basicProductsEntity.getNameCode());
 | 
			
		
	
		
			
				
					|  |  |  |  | //                        ioOrderDetailBizEntity.setCoName(basicProductsEntity.getCpmctymc());
 | 
			
		
	
		
			
				
					|  |  |  |  | //                        ioOrderDetailBizEntity.setCertCode(basicProductsEntity.getZczbhhzbapzbh());
 | 
			
		
	
		
			
				
					|  |  |  |  | //                        ioOrderDetailBizEntity.setYlqxzcrbarmc(basicProductsEntity.getYlqxzcrbarmc());
 | 
			
		
	
		
			
				
					|  |  |  |  | //                        ioOrderDetailBizEntity.setManufacturer(basicProductsEntity.getManufactory());
 | 
			
		
	
		
			
				
					|  |  |  |  | //                        ioOrderDetailBizEntity.setMeasname(basicProductsEntity.getMeasname());
 | 
			
		
	
		
			
				
					|  |  |  |  | //                        ioOrderDetailBizEntity.setSpec(basicProductsEntity.getGgxh());
 | 
			
		
	
		
			
				
					|  |  |  |  | //                        if (basicProductsEntity.getPrice() != null) {
 | 
			
		
	
		
			
				
					|  |  |  |  | //                            ioOrderDetailBizEntity.setPrice(BigDecimal.valueOf(basicProductsEntity.getPrice()));
 | 
			
		
	
		
			
				
					|  |  |  |  | //                        }
 | 
			
		
	
		
			
				
					|  |  |  |  | //                        ioOrderDetailBizEntity.setSupId(obj.getSupId());
 | 
			
		
	
		
			
				
					|  |  |  |  | //                        ioOrderDetailBizService.insert(ioOrderDetailBizEntity);
 | 
			
		
	
		
			
				
					|  |  |  |  | //                    }
 | 
			
		
	
		
			
				
					|  |  |  |  | //                }
 | 
			
		
	
		
			
				
					|  |  |  |  | //                purOrderEntity.setStockOrderNo(billNo.substring(0, billNo.length() - 1));
 | 
			
		
	
		
			
				
					|  |  |  |  | //                purOrderService.update(purOrderEntity);
 | 
			
		
	
		
			
				
					|  |  |  |  | //            }
 | 
			
		
	
		
			
				
					|  |  |  |  | //        }
 | 
			
		
	
		
			
				
					|  |  |  |  |         return ResultVOUtils.success("更新成功!"); | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     /** | 
			
		
	
		
			
				
					|  |  |  |  |      * 审核采购订单 | 
			
		
	
		
			
				
					|  |  |  |  |      */ | 
			
		
	
	
		
			
				
					|  |  |  | 
 |