Browse Source

样品单、交接单变更逻辑更改.增加流程回退、驳回

caozj 1 year ago
parent
commit
6b26c5eb26

+ 2 - 2
hx-sale/src/main/java/com/fjhx/sale/flow/ContractUpdateFlow.java

@@ -282,10 +282,10 @@ public class ContractUpdateFlow extends FlowDelegate {
         }
 
         // 交接单附件列表
-        ObsFileUtil.saveFile(contract.getFileList(), contract.getId(), 1);
+        ObsFileUtil.saveAllFile(contract.getFileList(), contract.getId(), 1);
 
         // 包装指示附件列表
-        ObsFileUtil.saveFile(contract.getPackageFileList(), contract.getId(), 2);
+        ObsFileUtil.saveAllFile(contract.getPackageFileList(), contract.getId(), 2);
 
         return contract.getId();
     }

+ 1 - 1
hx-sale/src/main/java/com/fjhx/sale/flow/EhsdPurchaseFlow.java

@@ -160,7 +160,7 @@ public class EhsdPurchaseFlow extends FlowDelegate {
                     purchaseProductMountingsList.forEach(obj -> obj.setPurchaseProductId(id));
                     addMountingsList.addAll(purchaseProductMountingsList);
                 }
-                ObsFileUtil.saveFile(s.getFileList(), s.getId());
+                ObsFileUtil.saveAllFile(s.getFileList(), s.getId(),0);
 
                 if ("0".equals(purchase.getDataResource())) {
                     //计算采购数量是否大于申购数量

+ 2 - 2
hx-sale/src/main/java/com/fjhx/sale/flow/SampleUpdateFlow.java

@@ -258,9 +258,9 @@ public class SampleUpdateFlow extends FlowDelegate {
             sampleShipmentService.saveBatch(sampleShipmentList);
         }
         //交接单附件
-        ObsFileUtil.saveFile(sample.getFileList(),sample.getId(),1);
+        ObsFileUtil.saveAllFile(sample.getFileList(),sample.getId(),1);
         //包装附件
-        ObsFileUtil.saveFile(sample.getPackageFileList(),sample.getId(),2);
+        ObsFileUtil.saveAllFile(sample.getPackageFileList(),sample.getId(),2);
         return sample.getId();
     }
 }

+ 23 - 12
hx-sale/src/main/java/com/fjhx/sale/service/contract/impl/ContractServiceImpl.java

@@ -1746,18 +1746,29 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
      * @param v
      */
     private void handleRefundTax(ContractBudgetVo v) {
-        // 税额/100
-        double d = 0.13;
-        //付货款 * 税额
-        double d1 = v.getEhsdSumAmount().doubleValue() * d;
-        //1 + 税额
-        d1 = d1 / (1 + d);
-
-        BigDecimal rt = new BigDecimal(String.valueOf(d1));
-        //四舍五入,保留2为
-        d1 = rt.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
-        String s1 = new BigDecimal(String.valueOf(d1)).toPlainString();
-        v.setRefundableAmount(new BigDecimal(s1));
+        if(ObjectUtil.isNotEmpty(v.getEhsdSumAmount())){
+            // 税额/100
+            double d = 0.13;
+            //付货款 * 税额
+            double d1 = v.getEhsdSumAmount().doubleValue() * d;
+            //1 + 税额
+            d1 = d1 / (1 + d);
+
+            BigDecimal rt = new BigDecimal(String.valueOf(d1));
+            //四舍五入,保留2为
+            d1 = rt.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+            String s1 = new BigDecimal(String.valueOf(d1)).toPlainString();
+            v.setRefundableAmount(new BigDecimal(s1));
+        }else{
+            v.setRefundableAmount(BigDecimal.ZERO);
+        }
+
+    }
+
+    public static void main(String[] args) {
+        BigDecimal a = null;
+        double d1 = a.doubleValue() * 0.13;
+        System.out.println(d1);
     }
 
 }