Procházet zdrojové kódy

出库单新增成功推送给采购系统

guarantee-lsq před 2 měsíci
rodič
revize
6c1889842b

+ 13 - 10
platform-service/src/main/java/com/platform/service/business/impl/OutStoreFormActivitiServiceImpl.java

@@ -231,18 +231,21 @@ public class OutStoreFormActivitiServiceImpl extends BaseFormCheckServiceAbstrac
         outStoreForm.setUpdateUserName(SecurityUtils.getUserInfo().getRealName());
         outStoreFormMapper.updateByPrimaryKeySelective(outStoreForm);
         try {
-            if (OutStoreStatusEnum.PUSH_OK.getValue() == outStoreForm.getStatus()) {
-                //推送用友成功,将出库单推送到采购系统
+            if (OutStoreStatusEnum.PUSH_OK.getValue() == outStoreForm.getStatus().intValue()) {
+                // 推送用友成功,将出库单推送到采购系统
                 OutStoreFormVO vo = BeanConverterUtil.copyObjectProperties(outStoreFormMapper.selectByPrimaryKey(actAuditRequest.getId()), OutStoreFormVO.class);
-                OutStoreDetail detail = new OutStoreDetail();
-                detail.setOutId(vo.getId());
-                List<OutStoreDetail> outStoreDetails = outStoreDetailMapper.select(detail);
-                List<OutStoreDetailVO> outStoreDetailVOS = null;
-                if (outStoreDetails != null && outStoreDetails.size() > 0) {
-                    outStoreDetailVOS = BeanConverterUtil.copyListProperties(outStoreDetails, OutStoreDetailVO.class);
+                if(vo.getOutFlag().equals(YesNoEnum.YES.getValue())){
+                    // 出库单发送,退库入库单不推送
+                    OutStoreDetail detail = new OutStoreDetail();
+                    detail.setOutId(vo.getId());
+                    List<OutStoreDetail> outStoreDetails = outStoreDetailMapper.select(detail);
+                    List<OutStoreDetailVO> outStoreDetailVOS = null;
+                    if (outStoreDetails != null && outStoreDetails.size() > 0) {
+                        outStoreDetailVOS = BeanConverterUtil.copyListProperties(outStoreDetails, OutStoreDetailVO.class);
+                    }
+                    vo.setDetailList(outStoreDetailVOS);
+                    yongyouService.pushOutStoreFormToPurchase(vo);
                 }
-                vo.setDetailList(outStoreDetailVOS);
-                yongyouService.pushOutStoreFormToPurchase(vo);
             }
         }catch (Exception e){
 

+ 0 - 2
platform-service/src/main/java/com/platform/service/store/impl/OutStoreFormServiceImpl.java

@@ -1049,8 +1049,6 @@ public class OutStoreFormServiceImpl extends BaseServiceImpl<OutStoreFormMapper,
         outStoreForm.setStatus(OutStoreStatusEnum.PUSH_OK.getValue());
         outStoreForm.setYyMessage("");
         outStoreForm.setUpdateTime(LocalDateTime.now());
-        // outStoreForm.setUpdateUserId(SecurityUtils.getUserInfo().getUserId());
-        // outStoreForm.setUpdateUserName(SecurityUtils.getUserInfo().getRealName());
         mapper.updateByPrimaryKeySelective(outStoreForm);
     }
 }

+ 14 - 0
platform-service/src/main/java/com/platform/service/yongyou/impl/YongyouServiceImpl.java

@@ -1972,6 +1972,20 @@ public class YongyouServiceImpl implements YongyouService {
             String data = response.getData();
             // 保存用友出库单数据
             outStoreFormService.updateModelByIdYongyou(outStoreFormVO.getId(), data);
+            // 推送用友成功,将出库单推送到采购系统
+            OutStoreFormVO vo = BeanConverterUtil.copyObjectProperties(outStoreFormService.getModelById(outStoreFormVO.getId()), OutStoreFormVO.class);
+            if(vo.getOutFlag().equals(YesNoEnum.YES.getValue())){
+                // 出库单发送,退库入库单不推送
+                OutStoreDetail detail = new OutStoreDetail();
+                detail.setOutId(vo.getId());
+                List<OutStoreDetail> outStoreDetails = outStoreDetailService.getModelListByModel(detail);
+                List<OutStoreDetailVO> outStoreDetailVOS = null;
+                if (outStoreDetails != null && outStoreDetails.size() > 0) {
+                    outStoreDetailVOS = BeanConverterUtil.copyListProperties(outStoreDetails, OutStoreDetailVO.class);
+                }
+                vo.setDetailList(outStoreDetailVOS);
+                pushOutStoreFormToPurchase(vo);
+            }
             return response;
         }
     }