zhangyuewww 3 年之前
父节点
当前提交
aad74f86df

+ 9 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/PaymentManagementController.java

@@ -120,6 +120,14 @@ public class PaymentManagementController {
     public  String openAuditFlow(@RequestBody PaymentManagement paymentManagement){
         return paymentManagementService.openAuditFlow(paymentManagement);
     }
-
+    /**
+     * 查taskId
+     * @param paymentManagement
+     * @return
+     */
+    @GetMapping("/selectTaskId")
+    public String selectTaskId(PaymentManagement paymentManagement) {
+        return paymentManagementService.selectTaskId(paymentManagement);
+    }
 }
 

+ 6 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IPaymentManagementService.java

@@ -78,4 +78,10 @@ public interface IPaymentManagementService extends IService<PaymentManagement> {
      * @return
      */
     String openAuditFlow(PaymentManagement paymentManagement);
+    /**
+     * 查数据有没有taskId
+     * @param paymentManagement
+     * @return
+     */
+    String selectTaskId(PaymentManagement paymentManagement);
 }

+ 34 - 7
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/PaymentManagementServiceImpl.java

@@ -273,10 +273,10 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
         warehouseInOutInfo1.setGrade(qualityInspectionManagement.getGrade());
         //潮粮取纯重,干粮取净重
         if("潮粮".equals(paymentManagement1.getType())){
-            warehouseInOutInfo1.setPureWeight(paymentManagement.getPureWeight());
-            warehouseInOutInfo1.setNetWeight(paymentManagement.getPureWeight());
+            warehouseInOutInfo1.setPureWeight(paymentManagement.getPureWeight()/1000);
+            warehouseInOutInfo1.setNetWeight(paymentManagement.getPureWeight()/1000);
         }else{
-            warehouseInOutInfo1.setNetWeight(paymentManagement.getNetWeight());
+            warehouseInOutInfo1.setNetWeight(paymentManagement.getNetWeight()/1000);
         }
         warehouseInOutInfo1.setStatusFlag("3");
         warehouseInOutInfoService.insert(warehouseInOutInfo1);
@@ -290,7 +290,7 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
         if (warehousePositionStorageInfo != null) {
             original = warehousePositionStorageInfo.getStorage();
             // 更新库存量
-            warehousePositionStorageInfo.setStorage(warehousePositionStorageInfo.getStorage() + warehouseInOutInfo1.getNetWeight());
+            warehousePositionStorageInfo.setStorage(warehousePositionStorageInfo.getStorage() + warehouseInOutInfo1.getNetWeight()/1000);
             warehousePositionStorageInfoService.updateById(warehousePositionStorageInfo);
         }
         // 没有货
@@ -301,7 +301,7 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
             warehousePositionStorageInfo1.setPositionId(warehouseInOutInfo1.getPositionId());
             warehousePositionStorageInfo1.setBinNumber(warehouseInOutInfo1.getBinNumber());
             warehousePositionStorageInfo1.setGoodsName(warehouseInOutInfo1.getGoodsName());
-            warehousePositionStorageInfo1.setStorage(warehouseInOutInfo1.getNetWeight());
+            warehousePositionStorageInfo1.setStorage(warehouseInOutInfo1.getNetWeight()/1000);
             warehousePositionStorageInfoService.insert(warehousePositionStorageInfo1);
         }
         WarehouseInOutDetail warehouseInOutDetail = new WarehouseInOutDetail();
@@ -325,7 +325,7 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
         weightedDetails.setGrainType(warehouseInOutInfo1.getType());
         weightedDetails.setInTypeKey(warehouseInOutInfo1.getInOutTypeKey());
         weightedDetails.setInType(warehouseInOutInfo1.getInOutType());
-        weightedDetails.setNetWeight(warehouseInOutInfo1.getNetWeight());
+        weightedDetails.setNetWeight(warehouseInOutInfo1.getNetWeight()/1000);
         weightedDetails.setPureWeight(warehouseInOutInfo1.getPureWeight());
         weightedDetails.setUnitPrice(warehouseInOutInfo1.getCost());
         weightedDetails.setDeductionAmount(warehouseInOutInfo1.getDeductionAmount());
@@ -340,7 +340,7 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
             weightedDetails.setCostBefore(weightedDetailsList.get(0).getCostBefore());
         }
         // 计算新加权成本
-        Float newCost = (paymentManagement.getActualPayment()  + original * weightedDetails.getCostBefore()) / (warehouseInOutInfo1.getNetWeight() + original);
+        Float newCost = (paymentManagement.getActualPayment()  + original * weightedDetails.getCostBefore()) / (warehouseInOutInfo1.getNetWeight()/1000 + original);
 
         weightedDetails.setCostAfter(newCost);
 
@@ -631,6 +631,33 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
         return "OK";
     }
 
+    @Override
+    public String selectTaskId(PaymentManagement paymentManagement) {
+        String taskIdNull="";
+        List<PaymentManagement> paymentManagementList=this.selectList(new EntityWrapper<PaymentManagement>()
+        .eq("management_type",paymentManagement.getManagementType())
+        .eq("comp_id",paymentManagement.getCompId())
+        .eq("warehouse_name",paymentManagement.getWarehouseName()));
+        if (!CollectionUtils.isEmpty(paymentManagementList)){
+            for (PaymentManagement paymentManagement1:paymentManagementList) {
+                String taskId = "";
+                // 只有待审核状态才有taskId
+                if (StringUtils.isNotBlank(paymentManagement1.getWorkflowId())) {
+                    JSONObject jsonObject = workflowService.getActiveTask(Lists.newArrayList(paymentManagement1.getWorkflowId()), paymentManagement1.getId());
+                    taskId = jsonObject.getString("taskId");
+                    paymentManagement1.setTaskId(taskId);
+                }
+                if (paymentManagement1.getTaskId()!=null){
+                    taskIdNull="true";
+                }
+                else {
+                    taskIdNull="false";
+                }
+            }
+        }
+        return taskIdNull;
+    }
+
 
     private List<String> getResourceIdList() {
         User currentUser = AuthSecurityUtils.getCurrentUserInfo();

+ 2 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/QualityInspectionManagementMapper.xml

@@ -33,11 +33,13 @@
         q.relation_id as relationId,
         q.quality_inspector as qualityInspector,
         q.re_buckle_miscellaneous as reBuckleMiscellaneous,
+        q.buckle_miscellaneous as buckleMiscellaneous,
         q.re_inspector as reInspector,
         q.car_number as carNumber,
         q.management_type as managementType,
         q.goods_name as goodsName,
         q.confirm,
+        q.param_type as paramType,
         q.grade,
         q.imperfect_grain as imperfectGrain,
         q.jiaorenli,