zhangyuewww 2 år sedan
förälder
incheckning
96a6882846

+ 1 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/ContractManagementInfoServiceImpl.java

@@ -910,6 +910,7 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
                     contractManagementInfo.getStatus(), null, "");
             return "OK";
         }
+        cacheComponent.delPrefixKey(Const.ADMIN_CONTRACTINFO);
         return "NG";
     }
 

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

@@ -401,12 +401,12 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
             List<WeightedDetails> weightedDetailsList = weightedDetailsService.selectList(new EntityWrapper<WeightedDetails>().eq("warehouse_id", warehouseInOutInfo.getBaseId())
                     .eq("goods_name", warehouseInOutInfo.getGoodsName()).orderBy("update_date", false));
             if (CollectionUtils.isEmpty(weightedDetailsList)) {
-                Double newCost = (paymentManagement.getAmountIngPayable() - paymentManagement.getAmountIngPayable() * 0.09) / (Double.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())) + original);
+                Double newCost = paymentManagement.getAmountIngPayable() / (Double.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())) + original);
                 weightedDetails.setCostBefore(Float.valueOf(String.valueOf(newCost)));
                 weightedDetails.setCostAfter(newCost);
             } else {
                 weightedDetails.setCostBefore(weightedDetailsList.get(0).getCostBefore());
-                Double newCost = ((paymentManagement.getAmountIngPayable() - paymentManagement.getAmountIngPayable() * 0.09) + original * weightedDetails.getCostBefore()) / (Double.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())) + original);
+                Double newCost = (paymentManagement.getAmountIngPayable() + original * weightedDetails.getCostBefore()) / (Double.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())) + original);
                 weightedDetails.setCostAfter(newCost);
             }
             // 计算新加权成本
@@ -556,12 +556,12 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
             List<WeightedDetails> weightedDetailsList = weightedDetailsService.selectList(new EntityWrapper<WeightedDetails>().eq("warehouse_id", warehouseInOutInfo1.getBaseId())
                     .eq("goods_name", warehouseInOutInfo1.getGoodsName()).orderBy("update_date", false));
             if (CollectionUtils.isEmpty(weightedDetailsList)) {
-                Double newCost = (paymentManagement.getAmountIngPayable() - paymentManagement.getAmountIngPayable() * 0.09) / (Double.valueOf(String.valueOf(warehouseInOutInfo1.getNetWeight())) + original);
+                Double newCost = paymentManagement.getAmountIngPayable()  / (Double.valueOf(String.valueOf(warehouseInOutInfo1.getNetWeight())) + original);
                 weightedDetails.setCostBefore(Float.valueOf(String.valueOf(newCost)));
                 weightedDetails.setCostAfter(newCost);
             } else {
                 weightedDetails.setCostBefore(weightedDetailsList.get(0).getCostBefore());
-                Double newCost = ((paymentManagement.getAmountIngPayable() - paymentManagement.getAmountIngPayable() * 0.09) + original * weightedDetails.getCostBefore()) / (Double.valueOf(String.valueOf(warehouseInOutInfo1.getNetWeight())) + original);
+                Double newCost = (paymentManagement.getAmountIngPayable() + original * weightedDetails.getCostBefore()) / (Double.valueOf(String.valueOf(warehouseInOutInfo1.getNetWeight())) + original);
                 weightedDetails.setCostAfter(newCost);
             }
             // 计算新加权成本

+ 2 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehouseInOutInfoServiceImpl.java

@@ -4303,6 +4303,8 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                 }
             }
         }
+        cacheComponent.delPrefixKey(Const.ADMIN_WEIGHINGINFO);
+        cacheComponent.delPrefixKey(Const.ADMIN_WEIGHINGINFO_NUM);
         return warehouseInOutInfo.getWeighingManagement().getId();
     }
 

+ 52 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehousingOrderServiceImpl.java

@@ -6,13 +6,18 @@ import com.aliyun.oss.model.ObjectMetadata;
 import com.aliyun.oss.model.PutObjectRequest;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.winsea.svc.base.base.entity.CommonStaff;
+import com.winsea.svc.base.base.service.ICommonStaffService;
 import com.winsea.svc.base.base.util.DateUtils;
 import com.winsea.svc.base.workflow.entity.Workflow;
+import com.winsea.svc.notice.entity.NoticeTaskInfo;
+import com.winsea.svc.notice.entity.base.BaseNotice;
+import com.winsea.svc.notice.service.INoticeService;
+import com.winsea.svc.notice.service.INoticeTaskService;
 import com.yh.saas.plugin.yiliangyiyun.entity.InOutWarehouseTask;
 import com.yh.saas.plugin.yiliangyiyun.entity.PaymentManagement;
 import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseInOutInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.WarehousingOrder;
-import com.yh.saas.plugin.yiliangyiyun.entity.view.PaymentView;
 import com.yh.saas.plugin.yiliangyiyun.exception.YException;
 import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
 import com.yh.saas.plugin.yiliangyiyun.mapper.WarehousingOrderMapper;
@@ -47,7 +52,6 @@ import org.apache.poi.ss.util.CellRangeAddress;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.mock.web.MockMultipartFile;
-import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
@@ -105,7 +109,12 @@ public class WarehousingOrderServiceImpl extends ServiceImpl<WarehousingOrderMap
     private ISourceRelationInfoService sourceRelationInfoService;
     @Autowired
     private IContractManagementInfoService contractManagementInfoService;
-
+    @Autowired
+    private INoticeService noticeService;
+    @Autowired
+    private INoticeTaskService noticeTaskService;
+    @Autowired
+    private ICommonStaffService staffService;
     /**
      * 退库货源列表
      * @param warehouseInOutInfo
@@ -600,6 +609,26 @@ public class WarehousingOrderServiceImpl extends ServiceImpl<WarehousingOrderMap
                         .eq("cost_type","1"));
                 expenseAllocationInfo.setDistributionMoney(expenseAllocationInfo.getDistributionMoney()+warehousingOrder.getMoney());
                 expenseAllocationInfoService.updateById(expenseAllocationInfo);
+                // 先删除任务
+                noticeService.removeNotice(BaseNotice.NoticeStatus.TASK, "WAREHOUSING-ORDER-APPROVE",
+                        warehousingOrder1.getId(), null);
+                CommonStaff commitUserInfo = staffService.getInfo(AuthSecurityUtils.getCurrentUserId());
+                String taskContent = "合同" + warehousingOrder1.getContractNo() + "由" +
+                        commitUserInfo.getStaffName() + "发起的预付款分配,分配金额为"+warehousingOrder.getMoney();
+                NoticeTaskInfo taskInfo = new NoticeTaskInfo();
+                taskInfo.setCompId(commitUserInfo.getCompId());
+                taskInfo.setAcceptType(BaseNotice.AcceptStatus.STAFF);
+                taskInfo.setBusinessId(warehousingOrder1.getId());
+                taskInfo.setBusinessType("WAREHOUSE");
+                taskInfo.setMessageContent(taskContent);
+                taskInfo.setBusinessCode("WAREHOUSING-ORDER-APPROVE");
+                //查询单证中心成员
+                List<CommonStaff> commonStaffList = staffService.selectList(new EntityWrapper<CommonStaff>()
+                        .eq("dept_id", "17197ee578454b2c9f9d18b69cc1bc73")
+                        .eq("delete_flag","0"));
+                List<String> staffIds = commonStaffList.stream().map(CommonStaff::getStaffId).collect(Collectors.toList());
+                noticeTaskService.createNoticeTask(staffIds,
+                        null, taskInfo);
             }
             //保证金分配
             else if ("3".equals(warehousingOrder.getFlag())) {
@@ -612,6 +641,26 @@ public class WarehousingOrderServiceImpl extends ServiceImpl<WarehousingOrderMap
                         .eq("cost_type","5"));
                 expenseAllocationInfo.setDistributionMoney(expenseAllocationInfo.getDistributionMoney()+warehousingOrder.getMoney());
                 expenseAllocationInfoService.updateById(expenseAllocationInfo);
+                // 先删除任务
+                noticeService.removeNotice(BaseNotice.NoticeStatus.TASK, "WAREHOUSING-ORDER-APPROVE",
+                        warehousingOrder1.getId(), null);
+                CommonStaff commitUserInfo = staffService.getInfo(AuthSecurityUtils.getCurrentUserId());
+                String taskContent = "合同" + warehousingOrder1.getContractNo() + "由" +
+                        commitUserInfo.getStaffName() + "发起的保证金分配,分配金额为"+warehousingOrder.getMoney();
+                NoticeTaskInfo taskInfo = new NoticeTaskInfo();
+                taskInfo.setCompId(commitUserInfo.getCompId());
+                taskInfo.setAcceptType(BaseNotice.AcceptStatus.STAFF);
+                taskInfo.setBusinessId(warehousingOrder1.getId());
+                taskInfo.setBusinessType("WAREHOUSE");
+                taskInfo.setMessageContent(taskContent);
+                taskInfo.setBusinessCode("WAREHOUSING-ORDER-APPROVE");
+                //查询单证中心成员
+                List<CommonStaff> commonStaffList = staffService.selectList(new EntityWrapper<CommonStaff>()
+                        .eq("dept_id", "17197ee578454b2c9f9d18b69cc1bc73")
+                        .eq("delete_flag","0"));
+                List<String> staffIds = commonStaffList.stream().map(CommonStaff::getStaffId).collect(Collectors.toList());
+                noticeTaskService.createNoticeTask(staffIds,
+                        null, taskInfo);
             }
             //请款1
             else {

+ 13 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WeighingManagementServiceImpl.java

@@ -409,6 +409,8 @@ public class WeighingManagementServiceImpl extends ServiceImpl<WeighingManagemen
                 throw new YException(YExceptionEnum.PAYMENT_NOT_DELETED_ERROR);
             }
         }
+        cacheComponent.delPrefixKey(Const.ADMIN_WEIGHINGINFO);
+        cacheComponent.delPrefixKey(Const.ADMIN_WEIGHINGINFO_NUM);
     }
 
     /**
@@ -587,12 +589,15 @@ public class WeighingManagementServiceImpl extends ServiceImpl<WeighingManagemen
         boolean one = this.updateById(weighingManagement);
         //更新质检信息
         boolean two = qualityInspectionManagementService.updateById(weighingManagement.getQualityInspectionManagement());
+        cacheComponent.delPrefixKey(Const.ADMIN_WEIGHINGINFO);
+        cacheComponent.delPrefixKey(Const.ADMIN_WEIGHINGINFO_NUM);
         //成功返回ok
         if (one &&two ) {
             return weighingManagement.getId();
         } else {
             return "NG";
         }
+
     }
 
     /**
@@ -852,6 +857,8 @@ public class WeighingManagementServiceImpl extends ServiceImpl<WeighingManagemen
             warehouseInOutInfo.setPositionId(weighingManagement.getChangePositionId());
             warehouseInOutInfoService.updateById(warehouseInOutInfo);
         }
+        cacheComponent.delPrefixKey(Const.ADMIN_WEIGHINGINFO);
+        cacheComponent.delPrefixKey(Const.ADMIN_WEIGHINGINFO_NUM);
         return "ok";
     }
 
@@ -1104,6 +1111,8 @@ public class WeighingManagementServiceImpl extends ServiceImpl<WeighingManagemen
                 }
             }
         }
+        cacheComponent.delPrefixKey(Const.ADMIN_WEIGHINGINFO);
+        cacheComponent.delPrefixKey(Const.ADMIN_WEIGHINGINFO_NUM);
         return "ok";
     }
 
@@ -1580,6 +1589,8 @@ public class WeighingManagementServiceImpl extends ServiceImpl<WeighingManagemen
                 }
             }
         }
+        cacheComponent.delPrefixKey(Const.ADMIN_WEIGHINGINFO);
+        cacheComponent.delPrefixKey(Const.ADMIN_WEIGHINGINFO_NUM);
         return "ok";
     }
 
@@ -1913,6 +1924,8 @@ public class WeighingManagementServiceImpl extends ServiceImpl<WeighingManagemen
                 }
             }
         }
+        cacheComponent.delPrefixKey(Const.ADMIN_WEIGHINGINFO);
+        cacheComponent.delPrefixKey(Const.ADMIN_WEIGHINGINFO_NUM);
         return "ok";
     }
 }