Преглед изворни кода

Merge branch 'master' of http://47.100.3.209:3000/gdc/yiliangyiyun

gongdecai пре 2 година
родитељ
комит
9332a386be
23 измењених фајлова са 330 додато и 28 уклоњено
  1. 1 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/GeneratorCodeByTables.java
  2. 10 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/CustomerInfoController.java
  3. 21 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/HistoricalInventoryInfoController.java
  4. 9 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/IdentityAuthenticationInfoController.java
  5. 5 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/CustomerInfo.java
  6. 58 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/HistoricalInventoryInfo.java
  7. 16 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/HistoricalInventoryInfoMapper.java
  8. 5 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/ICustomerInfoService.java
  9. 16 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IHistoricalInventoryInfoService.java
  10. 6 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IIdentityAuthenticationInfoService.java
  11. 1 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/ContractManagementInfoServiceImpl.java
  12. 29 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/CustomerInfoServiceImpl.java
  13. 5 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/ExpenseInfoServiceImpl.java
  14. 20 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/HistoricalInventoryInfoServiceImpl.java
  15. 14 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/IdentityAuthenticationInfoServiceImpl.java
  16. 4 4
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/PaymentManagementServiceImpl.java
  17. 2 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehouseInOutInfoServiceImpl.java
  18. 52 3
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehousingOrderServiceImpl.java
  19. 13 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WeighingManagementServiceImpl.java
  20. 33 17
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/ContractManagementInfoMapper.xml
  21. 4 2
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/ExpenseInfoMapper.xml
  22. 5 0
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/HistoricalInventoryInfoMapper.xml
  23. 1 0
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehousingOrderMapper.xml

+ 1 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/GeneratorCodeByTables.java

@@ -53,7 +53,7 @@ public class GeneratorCodeByTables {
     }
 
     public static void main(String[] args) throws IOException {
-        generateByTables("Gdc", "com.yh.saas.plugin.yiliangyiyun","batch_review_info");
+        generateByTables("Gdc", "com.yh.saas.plugin.yiliangyiyun","historical_inventory_info");
     }
 
     /**

+ 10 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/CustomerInfoController.java

@@ -96,5 +96,15 @@ public class CustomerInfoController {
     public List<CustomerInfo> customerList(@RequestParam String compId) {
         return customerInfoService.customerList(compId);
     }
+    /**
+     * 查看客户账户信息
+     * @param customerInfo
+     * @return
+     */
+    @GetMapping("/getPayeeInfo")
+    public CustomerInfo getPayeeInfo(CustomerInfo customerInfo) {
+        return customerInfoService.getPayeeInfo(customerInfo);
+    }
+
 }
 

+ 21 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/HistoricalInventoryInfoController.java

@@ -0,0 +1,21 @@
+package com.yh.saas.plugin.yiliangyiyun.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 记录历史库存信息 前端控制器
+ * </p>
+ *
+ * @author Gdc
+ * @since 2022-09-13
+ */
+@RestController
+@RequestMapping("/historicalInventoryInfo")
+public class HistoricalInventoryInfoController {
+
+}
+

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

@@ -7,7 +7,6 @@ import com.winsea.svc.base.base.entity.CommonCompany;
 import com.winsea.svc.base.base.service.ICommonCompanyService;
 import com.winsea.svc.base.security.util.AuthSecurityUtils;
 import com.yh.saas.plugin.yiliangyiyun.entity.IdentityAuthenticationInfo;
-import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseInOutInfo;
 import com.yh.saas.plugin.yiliangyiyun.exception.AppServiceException;
 import com.yh.saas.plugin.yiliangyiyun.exception.ServiceException;
 import com.yh.saas.plugin.yiliangyiyun.service.IIdentityAuthenticationInfoService;
@@ -214,5 +213,14 @@ public class IdentityAuthenticationInfoController {
     public List<IdentityAuthenticationInfo> identityAuthenticationInfoUser(IdentityAuthenticationInfo identityAuthenticationInfo) throws AppServiceException {
         return iIdentityAuthenticationInfoService.identityAuthenticationInfoUser(identityAuthenticationInfo);
     }
+    /**
+     * 查看客户账户信息
+     * @param identityAuthenticationInfo
+     * @return
+     */
+    @GetMapping("/getPayeeInfo")
+    public IdentityAuthenticationInfo getPayeeInfo(IdentityAuthenticationInfo identityAuthenticationInfo) {
+        return iIdentityAuthenticationInfoService.getPayeeInfo(identityAuthenticationInfo);
+    }
 }
 

+ 5 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/CustomerInfo.java

@@ -139,6 +139,11 @@ public class CustomerInfo extends BaseModel<CustomerInfo> {
      */
     @TableField(exist = false)
     private Float money;
+    /**
+     * 合同号
+     */
+    @TableField(exist = false)
+    private String contractNo;
 
     @Override
     protected Serializable pkVal() {

+ 58 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/HistoricalInventoryInfo.java

@@ -0,0 +1,58 @@
+package com.yh.saas.plugin.yiliangyiyun.entity;
+
+import java.io.Serializable;
+
+
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.annotations.TableName;
+import com.baomidou.mybatisplus.enums.IdType;
+import com.yh.saas.common.support.entity.BaseModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 记录历史库存信息
+ * </p>
+ *
+ * @author Gdc
+ * @since 2022-09-13
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@TableName("historical_inventory_info")
+public class HistoricalInventoryInfo extends BaseModel<HistoricalInventoryInfo> {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键id
+     */
+    @TableId(type = IdType.UUID)
+    private String id;
+    /**
+     * 仓库id
+     */
+    private String baseId;
+    /**
+     * 仓库名称
+     */
+    private String warehouseName;
+    /**
+     * 仓位编号id
+     */
+    private String positionId;
+    /**
+     * 累计储存量(吨)
+     */
+    private Double accumulatedStorage;
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

+ 16 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/HistoricalInventoryInfoMapper.java

@@ -0,0 +1,16 @@
+package com.yh.saas.plugin.yiliangyiyun.mapper;
+
+import com.yh.saas.plugin.yiliangyiyun.entity.HistoricalInventoryInfo;
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 记录历史库存信息 Mapper 接口
+ * </p>
+ *
+ * @author Gdc
+ * @since 2022-09-13
+ */
+public interface HistoricalInventoryInfoMapper extends BaseMapper<HistoricalInventoryInfo> {
+
+}

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

@@ -59,4 +59,9 @@ public interface ICustomerInfoService extends IService<CustomerInfo> {
      * @return
      */
     List<CustomerInfo> customerList(String compId);
+    /**
+     * 查看客户账户信息
+     * @param customerInfo
+     */
+    CustomerInfo getPayeeInfo(CustomerInfo customerInfo);
 }

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

@@ -0,0 +1,16 @@
+package com.yh.saas.plugin.yiliangyiyun.service;
+
+import com.yh.saas.plugin.yiliangyiyun.entity.HistoricalInventoryInfo;
+import com.baomidou.mybatisplus.service.IService;
+
+/**
+ * <p>
+ * 记录历史库存信息 服务类
+ * </p>
+ *
+ * @author Gdc
+ * @since 2022-09-13
+ */
+public interface IHistoricalInventoryInfoService extends IService<HistoricalInventoryInfo> {
+
+}

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

@@ -1,6 +1,7 @@
 package com.yh.saas.plugin.yiliangyiyun.service;
 
 import com.baomidou.mybatisplus.plugins.Page;
+import com.yh.saas.plugin.yiliangyiyun.entity.CustomerInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.IdentityAuthenticationInfo;
 import com.baomidou.mybatisplus.service.IService;
 import com.yh.saas.plugin.yiliangyiyun.exception.AppServiceException;
@@ -115,5 +116,10 @@ public interface IIdentityAuthenticationInfoService extends IService<IdentityAut
      * @param identityAuthenticationInfo
      */
     List<IdentityAuthenticationInfo> identityAuthenticationInfoUser(IdentityAuthenticationInfo identityAuthenticationInfo) throws AppServiceException;
+    /**
+     * 查看客户账户信息
+     * @param identityAuthenticationInfo
+     */
+    IdentityAuthenticationInfo getPayeeInfo(IdentityAuthenticationInfo identityAuthenticationInfo);
 
 }

+ 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";
     }
 

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

@@ -8,6 +8,7 @@ import com.yh.saas.plugin.yiliangyiyun.constant.NumberConstant;
 import com.yh.saas.common.support.util.IdGenerator;
 import com.yh.saas.plugin.yiliangyiyun.entity.*;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CustomerInfoMapper;
+import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.ICustomerInfoService;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseOrderService;
@@ -38,6 +39,8 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
     private IPurchaseOrderService purchaseOrderService;
     @Autowired
     private ISaleOrderService saleOrderService;
+    @Autowired
+    private IContractManagementInfoService contractManagementInfoService;
 
     /**
      * 客户管理列表
@@ -224,4 +227,30 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
         return customerInfoList;
     }
 
+    /**
+     * 查看账户信息
+     * @param customerInfo
+     * @return
+     */
+    @Override
+    public CustomerInfo getPayeeInfo(CustomerInfo customerInfo) {
+        ContractManagementInfo contractManagementInfo=contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
+                .eq("contract_no",customerInfo.getContractNo())
+                .eq("comp_id",customerInfo.getCompId()));
+        //查询客户信息
+        Wrapper<CustomerInfo> customerInfoWrapper = new EntityWrapper<>();
+        customerInfoWrapper.eq("comp_id", customerInfo.getCompId());
+        //销售合同
+        if ("1".equals(contractManagementInfo.getContractType())){
+            customerInfoWrapper.andNew().eq("comp_name", contractManagementInfo.getBuyer()).or()
+                    .eq("customer_name", contractManagementInfo.getBuyer());
+        }
+        else {
+            customerInfoWrapper.andNew().eq("comp_name", contractManagementInfo.getSeller()).or()
+                    .eq("customer_name", contractManagementInfo.getSeller());
+        }
+        CustomerInfo customerInfo1 = this.selectOne(customerInfoWrapper);
+        return customerInfo1;
+    }
+
 }

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

@@ -156,6 +156,11 @@ public class ExpenseInfoServiceImpl extends ServiceImpl<ExpenseInfoMapper, Expen
     @Override
     public ExpenseInfo getInfo(String id) {
         ExpenseInfo expenseInfo=this.selectById(id);
+        if (StringUtils.isNotBlank(expenseInfo.getWorkflowId())) {
+            JSONObject jsonObject = workflowService.getActiveTask(Lists.newArrayList(expenseInfo.getWorkflowId()), expenseInfo.getId());
+            String taskId = jsonObject.getString("taskId");
+            expenseInfo.setTaskId(taskId);
+        }
         //费用分配列表
         List<ExpenseAllocationInfo> expenseAllocationInfos = expenseAllocationInfoService.selectList(new EntityWrapper<ExpenseAllocationInfo>()
                 .eq("info_id", id));

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

@@ -0,0 +1,20 @@
+package com.yh.saas.plugin.yiliangyiyun.service.impl;
+
+import com.yh.saas.plugin.yiliangyiyun.entity.HistoricalInventoryInfo;
+import com.yh.saas.plugin.yiliangyiyun.mapper.HistoricalInventoryInfoMapper;
+import com.yh.saas.plugin.yiliangyiyun.service.IHistoricalInventoryInfoService;
+import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 记录历史库存信息 服务实现类
+ * </p>
+ *
+ * @author Gdc
+ * @since 2022-09-13
+ */
+@Service
+public class HistoricalInventoryInfoServiceImpl extends ServiceImpl<HistoricalInventoryInfoMapper, HistoricalInventoryInfo> implements IHistoricalInventoryInfoService {
+
+}

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

@@ -637,5 +637,19 @@ public class IdentityAuthenticationInfoServiceImpl extends ServiceImpl<IdentityA
         }
         return identityAuthenticationInfoList;
     }
+
+    /**
+     * 查看客户账户信息
+     * @param identityAuthenticationInfo
+     * @return
+     */
+    @Override
+    public IdentityAuthenticationInfo getPayeeInfo(IdentityAuthenticationInfo identityAuthenticationInfo) {
+        IdentityAuthenticationInfo identityAuthenticationInfo1=this.selectOne(new EntityWrapper<IdentityAuthenticationInfo>()
+                .eq("customer_name",identityAuthenticationInfo.getCustomerName())
+                .eq("authentication_status_key","7")
+                .eq("comp_id",identityAuthenticationInfo.getCompId()));
+        return identityAuthenticationInfo1;
+    }
 }
 

+ 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";
     }
 }

+ 33 - 17
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/ContractManagementInfoMapper.xml

@@ -316,20 +316,14 @@
         m.signing_date as signingDate,
         m.status,
         SUM(war.surplus_weight) as surplus,
-        IFNULL(SUM( IFNULL( sri.proportion, 1 ) * IFNULL( ssrr.amount_ing_receivable, 0 ) ) + SUM( exi.amount_money )- SUM( exi2.amount_money ),0) AS profit,
-        m.approve_status as approveStatus,
-        m.agreement_type as agreementType
-        FROM contract_management_info m
-        LEFT JOIN expense_info exi ON exi.contract_id = m.id
-        AND exi.expenses_type = '1'
-        AND exi.expenses_purpose = '1'
-        AND exi.delete_flag = '0'
-        LEFT JOIN expense_info exi2 ON exi2.contract_id = m.id
-        AND exi2.expenses_type = '2'
-        AND exi2.expenses_purpose = '1'
-        AND exi2.delete_flag = '0'
-        LEFT JOIN warehousing_order war ON war.contract_no = m.contract_no
-        AND war.comp_id = m.comp_id
+        (
+        SELECT
+        SUM(
+        IFNULL( sri.proportion, 1 ) * IFNULL( ssrr.amount_ing_receivable, 0 ))
+        FROM
+        contract_management_info cmi
+        LEFT JOIN warehousing_order war ON war.contract_no = cmi.contract_no
+        AND war.comp_id = cmi.comp_id
         AND war.delete_flag = '0'
         LEFT JOIN source_relation_info sri ON sri.source_id = war.id
         AND sri.delete_flag = '0'
@@ -338,12 +332,34 @@
         AND iowt.in_out_type_key = 1
         AND iowt.delete_flag = '0'
         LEFT JOIN warehouse_in_out_info wioi ON wioi.in_out_task_no = iowt.in_out_task_no
-        and wioi.car_no = sri.car_no
         AND wioi.delete_flag = 0
         AND wioi.status_flag = 3
         LEFT JOIN stock_sale_receipt_report ssrr ON ssrr.contract_no = iowt.contract_no
         AND ssrr.warehouse_record_id = wioi.id
-        and ssrr.delete_flag = 0
+        AND ssrr.delete_flag = 0
+        WHERE
+        cmi.id = m.id
+        ) + (
+        SELECT
+        SUM( exi.amount_money )
+        FROM
+        expense_info exi
+        WHERE
+        exi.contract_id = m.id
+        AND exi.expenses_type = '1'
+        AND exi.expenses_purpose = '1'
+        AND exi.delete_flag = '0'
+        )- SUM( exi2.amount_money ) AS profit,
+        m.approve_status as approveStatus,
+        m.agreement_type as agreementType
+        FROM contract_management_info m
+        LEFT JOIN expense_info exi2 ON exi2.contract_id = m.id
+        AND exi2.expenses_type = '2'
+        AND exi2.expenses_purpose = '1'
+        AND exi2.delete_flag = '0'
+        LEFT JOIN warehousing_order war ON war.contract_no = m.contract_no
+        AND war.comp_id = m.comp_id
+        AND war.delete_flag = '0'
         WHERE
         m.comp_id = #{compId}
         AND m.delete_flag = '0'
@@ -599,7 +615,7 @@
         AND iowt.in_out_type_key = 1
         AND iowt.delete_flag = '0'
         LEFT JOIN warehouse_in_out_info wioi ON wioi.in_out_task_no = iowt.in_out_task_no
-        and wioi.car_no = sri.car_no
+--         and wioi.car_no = sri.car_no
         AND wioi.delete_flag = 0
         AND wioi.status_flag = 3
         LEFT JOIN stock_sale_receipt_report ssrr ON ssrr.contract_no = iowt.contract_no

+ 4 - 2
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/ExpenseInfoMapper.xml

@@ -32,7 +32,8 @@
             DATE_FORMAT(#{endDate},"%Y%m%d"))
         </if>
         <if test="searchKeyWord != null and searchKeyWord != ''">
-            AND (lower(expense_name) like lower(CONCAT('%',#{searchKeyWord},'%')))
+            AND (lower(expense_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
+            OR lower(agent) like lower(CONCAT('%',#{searchKeyWord},'%')))
         </if>
     </select>
     <!-- 费用管理列表查询 -->
@@ -76,7 +77,8 @@
             )
         </if>
         <if test="searchKeyWord != null and searchKeyWord != ''">
-            AND (lower(expense_name) like lower(CONCAT('%',#{searchKeyWord},'%')))
+            AND (lower(expense_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
+            OR lower(agent) like lower(CONCAT('%',#{searchKeyWord},'%')))
         </if>
         <if test="startDate != null">
             AND (DATE_FORMAT(create_date,"%Y%m%d") &gt;=

+ 5 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/HistoricalInventoryInfoMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.yh.saas.plugin.yiliangyiyun.mapper.HistoricalInventoryInfoMapper">
+
+</mapper>

+ 1 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehousingOrderMapper.xml

@@ -66,6 +66,7 @@
         w.request_funds as requestFunds,
         w.request_person as requestPerson,
         w.request_date as requestDate,
+        w.in_type as inType,
         w.in_warehouse_weight as inWarehouseWeight,
         w.out_warehouse_weight as outWarehouseWeight,
         w.profit_and_loss as profitAndLoss,