Procházet zdrojové kódy

Revert "仓单还款"

This reverts commit fc9cd3dbbfecbedd0479704499b55018a2e03dc2.
huangfuli před 3 roky
rodič
revize
cbf2e03aca
13 změnil soubory, kde provedl 39 přidání a 248 odebrání
  1. 3 4
      pom.xml
  2. 0 3
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/constant/StatusEnum.java
  3. 3 27
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/RepaymentManagementController.java
  4. 5 4
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/TradeWarehouseReceiptApplController.java
  5. 4 5
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/RepaymentManagement.java
  6. 0 24
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/TradeWarehouseReceiptAppl.java
  7. 0 19
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/RepaymentManagementMapper.java
  8. 0 14
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IRepaymentManagementService.java
  9. 0 2
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/ITradeWarehouseReceiptApplService.java
  10. 1 80
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/RepaymentManagementServiceImpl.java
  11. 20 31
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/TradeWarehouseReceiptApplServiceImpl.java
  12. 1 31
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/RepaymentManagementMapper.xml
  13. 2 4
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/TradeWarehouseReceiptApplMapper.xml

+ 3 - 4
pom.xml

@@ -184,9 +184,6 @@
             <properties>
                 <env>local</env>
             </properties>
-            <activation>
-                <activeByDefault>true</activeByDefault>
-            </activation>
         </profile>
         <profile>
             <id>dev</id>
@@ -205,7 +202,9 @@
             <properties>
                 <env>prod</env>
             </properties>
-
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
 
         </profile>
     </profiles>

+ 0 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/constant/StatusEnum.java

@@ -131,9 +131,6 @@ public enum StatusEnum {
 
     TO_BE_TRADERETURN("1", "待还款", "to_be_tradereturn"),
 
-    //贸易仓单状态
-    RETURN_TRADE_WAREHOUSE_RECEIPT("0", "已退回", "return_trade_warehouse_receipt"),
-
     ;
     @Getter
     private String flag;

+ 3 - 27
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/RepaymentManagementController.java

@@ -1,11 +1,9 @@
 package com.yh.saas.plugin.yiliangyiyun.controller;
 
 
-import com.baomidou.mybatisplus.plugins.Page;
-import com.yh.saas.plugin.yiliangyiyun.entity.RepaymentManagement;
-import com.yh.saas.plugin.yiliangyiyun.service.IRepaymentManagementService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
 
 /**
  * <p>
@@ -19,27 +17,5 @@ import org.springframework.web.bind.annotation.*;
 @RequestMapping("/repaymentManagement")
 public class RepaymentManagementController {
 
-    @Autowired
-    private IRepaymentManagementService repaymentManagementService;
-
-    /**
-     * 还款列表
-     * @param repaymentManagement
-     * @return
-     */
-    @GetMapping("/selectRepaymentManagement")
-    public Page<RepaymentManagement> selectRepaymentManagement(RepaymentManagement repaymentManagement){
-        return repaymentManagementService.selectRepaymentManagement(repaymentManagement);
-    }
-
-    /**
-     * 还款
-     * @param repaymentManagement
-     * @return
-     */
-    @PostMapping("/api/repaymentMoney")
-    public String repaymentMoney(@RequestBody RepaymentManagement repaymentManagement){
-        return repaymentManagementService.repaymentMoney(repaymentManagement);
-    }
 }
 

+ 5 - 4
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/TradeWarehouseReceiptApplController.java

@@ -2,7 +2,10 @@ package com.yh.saas.plugin.yiliangyiyun.controller;
 
 
 import com.baomidou.mybatisplus.plugins.Page;
-import com.yh.saas.plugin.yiliangyiyun.entity.*;
+import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseReceiptReport;
+import com.yh.saas.plugin.yiliangyiyun.entity.SalePlanInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.TradeWarehouseReceiptAppl;
+import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseReceiptReportService;
 import com.yh.saas.plugin.yiliangyiyun.service.ITradeWarehouseReceiptApplService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -22,7 +25,6 @@ import java.util.List;
 public class TradeWarehouseReceiptApplController {
     @Autowired
     private ITradeWarehouseReceiptApplService tradeWarehouseReceiptApplService;
-
     /**
      * 列表
      * @param tradeWarehouseReceiptAppl
@@ -80,7 +82,7 @@ public class TradeWarehouseReceiptApplController {
         return tradeWarehouseReceiptApplService.getTrageInfo(id);
     }
     /**
-     * 删除
+     * 详情
      *
      * @return
      */
@@ -89,6 +91,5 @@ public class TradeWarehouseReceiptApplController {
          tradeWarehouseReceiptApplService.deleteTrageInfo(id);
     }
 
-
 }
 

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

@@ -9,12 +9,10 @@ import com.baomidou.mybatisplus.annotations.TableName;
 import com.baomidou.mybatisplus.annotations.Version;
 
 import com.baomidou.mybatisplus.enums.IdType;
-import com.fasterxml.jackson.annotation.JsonFormat;
 import com.yh.saas.common.support.entity.BaseModel;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
-import org.springframework.format.annotation.DateTimeFormat;
 
 /**
  * <p>
@@ -57,11 +55,13 @@ public class RepaymentManagement extends BaseModel<RepaymentManagement> {
      * 还款金额(元)
      */
     private Float repaymentEdAmount;
+    /**
+     * 未还金额(元)
+     */
+    private Float repaymentNotAmount;
     /**
      * 还款日期
      */
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @DateTimeFormat(pattern = "yyyy-MM-dd")
     private Date repaymentDate;
     /**
      * 还款截图
@@ -78,5 +78,4 @@ public class RepaymentManagement extends BaseModel<RepaymentManagement> {
         return this.id;
     }
 
-
 }

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

@@ -192,22 +192,6 @@ public class TradeWarehouseReceiptAppl extends BaseModel<TradeWarehouseReceiptAp
      * 保险费显示隐藏
      */
     private String insurancePremiumFlag;
-    /**
-     * 修改费用1
-     */
-    private String modifyExpense1;
-    /**
-     * 修改费用2
-     */
-    private String modifyExpense2;
-    /**
-     * 修改费用3
-     */
-    private String modifyExpense3;
-    /**
-     * 修改费用4
-     */
-    private String modifyExpense4;
     /**
      * 附件
      */
@@ -277,12 +261,4 @@ public class TradeWarehouseReceiptAppl extends BaseModel<TradeWarehouseReceiptAp
         return this.id;
     }
 
-    public static class QueryFiles {
-
-        public static final String COMP_ID = "comp_id";
-
-        public static final String DELETE_FLAG = "delete_flag";
-
-    }
-
 }

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

@@ -2,10 +2,6 @@ package com.yh.saas.plugin.yiliangyiyun.mapper;
 
 import com.yh.saas.plugin.yiliangyiyun.entity.RepaymentManagement;
 import com.baomidou.mybatisplus.mapper.BaseMapper;
-import com.yh.saas.plugin.yiliangyiyun.entity.WeighingManagement;
-
-import java.util.List;
-import java.util.Map;
 
 /**
  * <p>
@@ -17,19 +13,4 @@ import java.util.Map;
  */
 public interface RepaymentManagementMapper extends BaseMapper<RepaymentManagement> {
 
-    /**
-     * 根据条件查询还款管理总数
-     *
-     * @param pageView
-     * @return
-     */
-    Integer getCountByCondition(Map<String, Object> pageView);
-
-    /**
-     * 根据条件查询还款管理列表
-     *
-     * @param pageView
-     * @return
-     */
-    List<RepaymentManagement> getListByCondition(Map<String, Object> pageView);
 }

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

@@ -1,6 +1,5 @@
 package com.yh.saas.plugin.yiliangyiyun.service;
 
-import com.baomidou.mybatisplus.plugins.Page;
 import com.yh.saas.plugin.yiliangyiyun.entity.RepaymentManagement;
 import com.baomidou.mybatisplus.service.IService;
 
@@ -14,17 +13,4 @@ import com.baomidou.mybatisplus.service.IService;
  */
 public interface IRepaymentManagementService extends IService<RepaymentManagement> {
 
-    /**
-     * 还款列表
-     * @param repaymentManagement
-     * @return
-     */
-    Page<RepaymentManagement> selectRepaymentManagement(RepaymentManagement repaymentManagement);
-
-    /**
-     * 还款
-     * @param repaymentManagement
-     * @return
-     */
-    String repaymentMoney(RepaymentManagement repaymentManagement);
 }

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

@@ -68,6 +68,4 @@ public interface ITradeWarehouseReceiptApplService extends IService<TradeWarehou
      * @return
      */
     void deleteTrageInfo(String id);
-
-
 }

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

@@ -1,29 +1,11 @@
 package com.yh.saas.plugin.yiliangyiyun.service.impl;
 
-import com.alipay.sofa.runtime.api.annotation.SofaReference;
-import com.baomidou.mybatisplus.mapper.EntityWrapper;
-import com.baomidou.mybatisplus.plugins.Page;
-import com.google.common.collect.Lists;
-import com.winsea.svc.base.base.entity.CommonRoleResource;
-import com.winsea.svc.base.base.entity.CommonStaff;
-import com.winsea.svc.base.base.service.ICommonRoleResourceService;
-import com.winsea.svc.base.base.service.ICommonStaffService;
-import com.winsea.svc.base.security.entity.User;
-import com.winsea.svc.base.security.util.AuthSecurityUtils;
-import com.yh.saas.common.support.util.IdGenerator;
-import com.yh.saas.plugin.yiliangyiyun.entity.*;
+import com.yh.saas.plugin.yiliangyiyun.entity.RepaymentManagement;
 import com.yh.saas.plugin.yiliangyiyun.mapper.RepaymentManagementMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IRepaymentManagementService;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
-import com.yh.saas.plugin.yiliangyiyun.service.ITradeWarehouseReceiptApplService;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
 /**
  * <p>
  * 贸易仓单还款管理 服务实现类
@@ -35,65 +17,4 @@ import java.util.stream.Collectors;
 @Service
 public class RepaymentManagementServiceImpl extends ServiceImpl<RepaymentManagementMapper, RepaymentManagement> implements IRepaymentManagementService {
 
-    @Autowired
-    private ITradeWarehouseReceiptApplService tradeWarehouseReceiptApplService;
-    @SofaReference
-    private ICommonRoleResourceService roleResourceService;
-
-    /**
-     * 还款列表
-     * @param repaymentManagement
-     * @return
-     */
-    @Override
-    public Page<RepaymentManagement> selectRepaymentManagement(RepaymentManagement repaymentManagement){
-        Map<String, Object> pageView = new HashMap<>();
-        pageView.put("startRecord", (repaymentManagement.getCurrentPage() - 1)
-                * repaymentManagement.getPageSize());
-        //公司id
-        pageView.put("compId", repaymentManagement.getCompId());
-        pageView.put("tradeWarehouseReceiptId", repaymentManagement.getTradeWarehouseReceiptId());
-        pageView.put("pageSize", repaymentManagement.getPageSize());
-        pageView.put("currentPage", repaymentManagement.getCurrentPage());
-        // 查询还款总数
-        Integer dataCount = baseMapper.getCountByCondition(pageView);
-        List<RepaymentManagement> dataList = baseMapper.getListByCondition(pageView);
-        Page<RepaymentManagement> page = new Page<>();
-        page.setRecords(dataList == null ? Lists.newArrayList() : dataList);
-        page.setTotal(dataCount == null ? 0 : dataCount);
-        page.setCurrent(repaymentManagement.getCurrentPage());
-        page.setSize(repaymentManagement.getPageSize());
-        return page;
-    }
-
-    /**
-     * 还款
-     * @param repaymentManagement
-     * @return
-     */
-    @Override
-    public String repaymentMoney(RepaymentManagement repaymentManagement){
-        //新增主键id
-        repaymentManagement.setId(IdGenerator.generateUUID());
-        //查询贸易仓单信息
-        TradeWarehouseReceiptAppl tradeWarehouseReceiptAppl = tradeWarehouseReceiptApplService.selectOne(new EntityWrapper<TradeWarehouseReceiptAppl>()
-                .eq("id",repaymentManagement.getTradeWarehouseReceiptId()));
-        tradeWarehouseReceiptAppl.setAmountToRepaid(tradeWarehouseReceiptAppl.getAmountToRepaid() - repaymentManagement.getRepaymentEdAmount());
-        repaymentManagement.setRepaymentIngAmount(tradeWarehouseReceiptAppl.getAmountToRepaid());
-        tradeWarehouseReceiptAppl.setAmountRepaid(tradeWarehouseReceiptAppl.getAmountDue() - tradeWarehouseReceiptAppl.getAmountToRepaid());
-        // 操作主表数据
-        this.insert(repaymentManagement);
-        tradeWarehouseReceiptApplService.updateById(tradeWarehouseReceiptAppl);
-        return "OK";
-    }
-
-
-
-    private List<String> getResourceIdList() {
-        User currentUser = AuthSecurityUtils.getCurrentUserInfo();
-        // 当前登录人主要角色
-        return roleResourceService.getBindResourcesByUserId(currentUser.getUserId()).stream()
-                .map(CommonRoleResource::getResourceId).collect(Collectors.toList());
-    }
-
 }

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

@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.plugins.Page;
 import com.google.common.collect.Lists;
 import com.winsea.svc.base.base.entity.CommonRoleResource;
 import com.winsea.svc.base.base.service.ICommonRoleResourceService;
+import com.winsea.svc.base.base.util.DateUtils;
 import com.winsea.svc.base.security.entity.User;
 import com.winsea.svc.base.security.util.AuthSecurityUtils;
 import com.winsea.svc.base.workflow.entity.Workflow;
@@ -26,9 +27,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-
 
 import java.text.SimpleDateFormat;
 import java.util.*;
@@ -205,31 +203,30 @@ public class TradeWarehouseReceiptApplServiceImpl extends ServiceImpl<TradeWareh
             this.updateById(tradeWarehouseReceiptAppl);
         } else {
             this.updateById(tradeWarehouseReceiptAppl);
-            if("0".equals(tradeWarehouseReceiptAppl.getStatusFlag())){
-                boolean isStartWorkflow = StringUtils.isBlank(tradeWarehouseReceiptAppl.getWorkflowId());
-                // 不是退回的单子
-                if (isStartWorkflow) {
-                    Workflow workflow = workflowService
-                            .findLatestWorkflowByBusinessCodeByApp(tradeWarehouseReceiptAppl.getCompId(), "TRADE-WAREHOUSE-REPORT");
-                    // 没配置审核流程,直接结束并处理信息
-                    if (workflow == null) {
-                        throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
-                    }
-                    // 开启审核流
-                    else {
-                        // 设置状态 已提交审核
-                        tradeWarehouseReceiptAppl.setWorkflowId(workflow.getId());
-                        this.updateById(tradeWarehouseReceiptAppl);
-                        workflowService.startInstance(workflow.getId(), tradeWarehouseReceiptAppl.getId());
-                    }
+            boolean isStartWorkflow = StringUtils.isBlank(tradeWarehouseReceiptAppl.getWorkflowId());
+            // 不是退回的单子
+            if (isStartWorkflow) {
+                Workflow workflow = workflowService
+                        .findLatestWorkflowByBusinessCodeByApp(tradeWarehouseReceiptAppl.getCompId(), "TRADE-WAREHOUSE-REPORT");
+                // 没配置审核流程,直接结束并处理信息
+                if (workflow == null) {
+                    throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
                 }
-                // 退回的单子 再启用
+                // 开启审核流
                 else {
 
+                    // 设置状态 已提交审核
+                    tradeWarehouseReceiptAppl.setWorkflowId(workflow.getId());
                     this.updateById(tradeWarehouseReceiptAppl);
-                    workflowService.activateInstance(tradeWarehouseReceiptAppl.getWorkflowId(), tradeWarehouseReceiptAppl.getId());
+                    workflowService.startInstance(workflow.getId(), tradeWarehouseReceiptAppl.getId());
                 }
             }
+            // 退回的单子 再启用
+            else {
+
+                this.updateById(tradeWarehouseReceiptAppl);
+                workflowService.activateInstance(tradeWarehouseReceiptAppl.getWorkflowId(), tradeWarehouseReceiptAppl.getId());
+            }
         }
         return tradeWarehouseReceiptAppl.getId();
     }
@@ -243,18 +240,11 @@ public class TradeWarehouseReceiptApplServiceImpl extends ServiceImpl<TradeWareh
     @Override
     public TradeWarehouseReceiptAppl getTrageInfo(String id){
         TradeWarehouseReceiptAppl tradeWarehouseReceiptAppl = this.selectById(id);
-        String taskId = "";
-        // 只有待审核状态才有taskId
-        if (StringUtils.isNotBlank(tradeWarehouseReceiptAppl.getWorkflowId())) {
-            JSONObject jsonObject = workflowService.getActiveTask(Lists.newArrayList(tradeWarehouseReceiptAppl.getWorkflowId()), tradeWarehouseReceiptAppl.getId());
-            taskId = jsonObject.getString("taskId");
-            tradeWarehouseReceiptAppl.setTaskId(taskId);
-        }
         return tradeWarehouseReceiptAppl;
     }
 
     /**
-     * 删除
+     * 查看
      *
      * @return
      */
@@ -264,7 +254,6 @@ public class TradeWarehouseReceiptApplServiceImpl extends ServiceImpl<TradeWareh
     }
 
 
-
     /**
      * 可用库存
      *

+ 1 - 31
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/RepaymentManagementMapper.xml

@@ -1,35 +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.RepaymentManagementMapper">
-    <!-- 获得还款列表总数 -->
-    <select id="getCountByCondition" parameterType="Map" resultType="java.lang.Integer">
-        SELECT
-        COUNT(id)
-        FROM repayment_management
-        WHERE
-        comp_id = #{compId}
-        and delete_flag = '0'
-    </select>
-    <!-- 获得还款管理列表 -->
-    <select id="getListByCondition" parameterType="Map"
-            resultType="com.yh.saas.plugin.yiliangyiyun.entity.RepaymentManagement">
-        SELECT
-        id,
-        comp_id as compId,
-        contract_no as contractNo,
-        repayment_ing_amount as repaymentIngAmount,
-        repayment_ed_amount as repaymentEdAmount,
-        repayment_date as repaymentDate,
-        repayment_screenshot as repaymentScreenshot,
-        operator,
-        create_date as createDate
-        FROM repayment_management
-        WHERE
-        comp_id = #{compId}
-        and delete_flag = '0'
-        ORDER BY create_date DESC
-        <if test="currentPage != null and currentPage != ''">
-            LIMIT ${startRecord}, ${pageSize}
-        </if>
-    </select>
+
 </mapper>

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

@@ -3,7 +3,7 @@
 <mapper namespace="com.yh.saas.plugin.yiliangyiyun.mapper.TradeWarehouseReceiptApplMapper">
 
 
-    <!-- 获得贸易仓单总数 -->
+    <!-- 获得采购入库统计总数 -->
     <select id="getCountByCondition" parameterType="Map" resultType="java.lang.Integer">
         SELECT
         COUNT(id)
@@ -48,7 +48,7 @@
             )
         </if>
     </select>
-    <!-- 获得贸易仓单列表 -->
+    <!-- 获得采购入库统计列表 -->
     <select id="getListByCondition" parameterType="Map"
             resultType="com.yh.saas.plugin.yiliangyiyun.entity.TradeWarehouseReceiptAppl">
         SELECT
@@ -59,8 +59,6 @@
         bill_no as billNo,
         warehouse_no as warehouseNo,
         weight,
-        bank,
-        bank_id as bankId,
         unit_price as unitPrice,
         total_value as totalValue,
         payment_amount as paymentAmount,