Browse Source

采购验收验退反审更新状态,限制待上传的验收验退不允许审核

chenw 7 years ago
parent
commit
c14fcee533

+ 1 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java

@@ -94,6 +94,7 @@ public enum BizExceptionCode implements BaseExceptionCode {
     PURCHASE_ORDER_HASUNAUDIT(70003, "存在未审核单据,单据编号:%s"),
     PURCHASE_ORDER_HASUPLOAD(70004, "已上传优软商务平台的采购订单不允许反审核,如交易信息发生变更请关闭该订单重新新增订单"),
     PURCHASE_INOUTORDER_HASCHECK(70005, "反审核失败!该单存在已对账明细,不允许反审核"),
+    PURCHASE_INOUTORDER_AUDIT_PREUPLOAD(70006, "审核失败!待上传的验收单/验退单不允许此操作!"),
 
 
     //销售

+ 4 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/ProdInOutServiceImpl.java

@@ -337,6 +337,9 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
      * @param prodInOutDTO
      */
     private void uploadToB2B(ProdInOutDTO prodInOutDTO) {
+        if ("待上传".equals(prodInOutDTO.getB2bStatus())) {
+            throw new BizException(BizExceptionCode.PURCHASE_INOUTORDER_AUDIT_PREUPLOAD);
+        }
         if (ConfigsCache.current().enableB2B()){
             MessageInfo messageInfo = null;
             if ("采购验收单".equals(prodInOutDTO.getPi_class())){
@@ -417,6 +420,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
      */
     private void uploadResToB2B(ProdInOutDTO prodInOutDTO) {
         if (ConfigsCache.current().enableB2B()){
+            updateB2BStatus(prodInOutDTO.getId(), "待上传");
             MessageInfo messageInfo = null;
             if ("采购验收单".equals(prodInOutDTO.getPi_class())){
                 messageInfo = new MessageInfo(BaseContextHolder.getUserId(), BillCodeSeq.PURCHASEINRES.name(), String.valueOf(prodInOutDTO.getId()), BaseContextHolder.getCompanyId());