Эх сурвалжийг харах

销售合同添加下单类型
合同关联用印申请

yzc 11 сар өмнө
parent
commit
36da6dd59a

+ 4 - 0
hx-sale/pom.xml

@@ -43,6 +43,10 @@
             <version>3.5.3.1</version>
             <scope>compile</scope>
         </dependency>
+        <dependency>
+            <groupId>com.fjhx</groupId>
+            <artifactId>hx-oa</artifactId>
+        </dependency>
     </dependencies>
 
 </project>

+ 5 - 5
hx-oa/src/main/java/com/fjhx/oa/controller/seal/SealUseController.java → hx-sale/src/main/java/com/fjhx/sale/controller/seal/SealUseController.java

@@ -1,10 +1,10 @@
-package com.fjhx.oa.controller.seal;
+package com.fjhx.sale.controller.seal;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.fjhx.oa.entity.seal.dto.SealUseDto;
-import com.fjhx.oa.entity.seal.dto.SealUseSelectDto;
-import com.fjhx.oa.entity.seal.vo.SealUseVo;
-import com.fjhx.oa.service.seal.SealUseService;
+import com.fjhx.sale.entity.seal.dto.SealUseDto;
+import com.fjhx.sale.entity.seal.dto.SealUseSelectDto;
+import com.fjhx.sale.entity.seal.vo.SealUseVo;
+import com.fjhx.sale.service.seal.SealUseService;
 import com.ruoyi.common.core.domain.BaseSelectDto;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;

+ 10 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/contract/po/Contract.java

@@ -539,6 +539,16 @@ public class Contract extends BasePo {
      * 品质等级
      */
     private String qualityLv;
+
+    /**
+     * 用印申请id
+     */
+    private Long sealUseId;
+
+    /**
+     * 下单类型
+     */
+    private String placeOrderType;
     //========================================================================
     /**
      * 交接单附件列表

+ 2 - 2
hx-oa/src/main/java/com/fjhx/oa/entity/seal/dto/SealUseDto.java → hx-sale/src/main/java/com/fjhx/sale/entity/seal/dto/SealUseDto.java

@@ -1,7 +1,7 @@
-package com.fjhx.oa.entity.seal.dto;
+package com.fjhx.sale.entity.seal.dto;
 
 import com.fjhx.file.entity.ObsFile;
-import com.fjhx.oa.entity.seal.po.SealUse;
+import com.fjhx.sale.entity.seal.po.SealUse;
 import lombok.Getter;
 import lombok.Setter;
 

+ 6 - 1
hx-oa/src/main/java/com/fjhx/oa/entity/seal/dto/SealUseSelectDto.java → hx-sale/src/main/java/com/fjhx/sale/entity/seal/dto/SealUseSelectDto.java

@@ -1,4 +1,4 @@
-package com.fjhx.oa.entity.seal.dto;
+package com.fjhx.sale.entity.seal.dto;
 
 import com.ruoyi.common.core.domain.BaseSelectDto;
 import lombok.Getter;
@@ -21,4 +21,9 @@ public class SealUseSelectDto extends BaseSelectDto {
      */
     private Integer isReturned;
 
+    /**
+     * 是否关联到合同
+     */
+    private Integer isLinkContract;
+
 }

+ 1 - 1
hx-oa/src/main/java/com/fjhx/oa/entity/seal/po/SealUse.java → hx-sale/src/main/java/com/fjhx/sale/entity/seal/po/SealUse.java

@@ -1,4 +1,4 @@
-package com.fjhx.oa.entity.seal.po;
+package com.fjhx.sale.entity.seal.po;
 
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;

+ 2 - 2
hx-oa/src/main/java/com/fjhx/oa/entity/seal/vo/SealUseVo.java → hx-sale/src/main/java/com/fjhx/sale/entity/seal/vo/SealUseVo.java

@@ -1,6 +1,6 @@
-package com.fjhx.oa.entity.seal.vo;
+package com.fjhx.sale.entity.seal.vo;
 
-import com.fjhx.oa.entity.seal.po.SealUse;
+import com.fjhx.sale.entity.seal.po.SealUse;
 import lombok.Getter;
 import lombok.Setter;
 

+ 7 - 3
hx-sale/src/main/java/com/fjhx/sale/flow/ContractFlow.java

@@ -4,13 +4,14 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.fjhx.common.enums.FlowStatusEnum1;
-import com.fjhx.common.service.coding.CodingRuleService;
 import com.fjhx.flow.core.FlowDelegate;
 import com.fjhx.flow.enums.FlowStatusEnum;
 import com.fjhx.sale.entity.contract.dto.ContractDto;
 import com.fjhx.sale.entity.contract.dto.ContractProductDto;
 import com.fjhx.sale.entity.contract.po.Contract;
+import com.fjhx.sale.entity.seal.po.SealUse;
 import com.fjhx.sale.service.contract.ContractService;
+import com.fjhx.sale.service.seal.SealUseService;
 import com.ruoyi.common.annotation.LogicIgnore;
 import com.ruoyi.common.core.domain.BasePo;
 import com.ruoyi.common.exception.ServiceException;
@@ -32,9 +33,9 @@ import java.util.List;
 public class ContractFlow extends FlowDelegate {
 
     @Autowired
-    private CodingRuleService codingRuleService;
-    @Autowired
     private ContractService contractService;
+    @Autowired
+    private SealUseService sealUseService;
 
     @Override
     public String getFlowKey() {
@@ -94,6 +95,9 @@ public class ContractFlow extends FlowDelegate {
         contract.setStatus(FlowStatusEnum1.PASS.getKey());
         contract.setApprovedDate(new Date());
         contractService.updateById(contract);
+
+        //更新用印申请合同id
+        sealUseService.update(q -> q.eq(SealUse::getId, contract.getSealUseId()).set(SealUse::getContractId, businessId));
     }
 
     public Long start(ContractDto contract) {

+ 14 - 4
hx-oa/src/main/java/com/fjhx/oa/flow/SealUseFlow.java → hx-sale/src/main/java/com/fjhx/sale/flow/SealUseFlow.java

@@ -1,16 +1,19 @@
-package com.fjhx.oa.flow;
+package com.fjhx.sale.flow;
 
+import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.fjhx.common.enums.CodingRuleEnum;
 import com.fjhx.common.enums.FlowStatusEnum1;
 import com.fjhx.common.service.coding.CodingRuleService;
 import com.fjhx.flow.core.FlowDelegate;
 import com.fjhx.flow.enums.FlowStatusEnum;
-import com.fjhx.oa.entity.seal.dto.SealUseDto;
 import com.fjhx.oa.entity.seal.po.SealConfig;
-import com.fjhx.oa.entity.seal.po.SealUse;
 import com.fjhx.oa.service.seal.SealConfigService;
-import com.fjhx.oa.service.seal.SealUseService;
+import com.fjhx.sale.entity.contract.po.Contract;
+import com.fjhx.sale.entity.seal.dto.SealUseDto;
+import com.fjhx.sale.entity.seal.po.SealUse;
+import com.fjhx.sale.service.contract.ContractService;
+import com.fjhx.sale.service.seal.SealUseService;
 import com.ruoyi.common.core.domain.BasePo;
 import com.ruoyi.common.utils.SecurityUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -30,6 +33,8 @@ public class SealUseFlow extends FlowDelegate {
     private CodingRuleService codingRuleService;
     @Autowired
     private SealConfigService sealConfigService;
+    @Autowired
+    private ContractService contractService;
 
     @Override
     public String getFlowKey() {
@@ -51,12 +56,17 @@ public class SealUseFlow extends FlowDelegate {
 
     @Override
     public void end(Long flowId, Long businessId, JSONObject submitData) {
+        SealUse byId = sealUseService.getById(businessId);
         sealUseService.update(q -> q
                 .eq(SealUse::getId, businessId)
                 .set(SealUse::getStatus, FlowStatusEnum1.PASS.getKey())
                 .set(BasePo::getUpdateTime, new Date())
                 .set(BasePo::getUpdateUser, SecurityUtils.getUserId())
         );
+        if (ObjectUtil.isNotEmpty(byId.getContractId())) {
+            //刷新合同用印申请id
+            contractService.update(q -> q.eq(Contract::getId, byId.getContractId()).set(Contract::getSealUseId, businessId));
+        }
     }
 
     @Override

+ 3 - 3
hx-oa/src/main/java/com/fjhx/oa/mapper/seal/SealUseMapper.java → hx-sale/src/main/java/com/fjhx/sale/mapper/seal/SealUseMapper.java

@@ -1,9 +1,9 @@
-package com.fjhx.oa.mapper.seal;
+package com.fjhx.sale.mapper.seal;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.fjhx.oa.entity.seal.po.SealUse;
-import com.fjhx.oa.entity.seal.vo.SealUseVo;
+import com.fjhx.sale.entity.seal.po.SealUse;
+import com.fjhx.sale.entity.seal.vo.SealUseVo;
 import com.ruoyi.common.utils.wrapper.IWrapper;
 import org.apache.ibatis.annotations.Param;
 

+ 5 - 5
hx-oa/src/main/java/com/fjhx/oa/service/seal/SealUseService.java → hx-sale/src/main/java/com/fjhx/sale/service/seal/SealUseService.java

@@ -1,10 +1,10 @@
-package com.fjhx.oa.service.seal;
+package com.fjhx.sale.service.seal;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.fjhx.oa.entity.seal.dto.SealUseDto;
-import com.fjhx.oa.entity.seal.dto.SealUseSelectDto;
-import com.fjhx.oa.entity.seal.po.SealUse;
-import com.fjhx.oa.entity.seal.vo.SealUseVo;
+import com.fjhx.sale.entity.seal.dto.SealUseDto;
+import com.fjhx.sale.entity.seal.dto.SealUseSelectDto;
+import com.fjhx.sale.entity.seal.po.SealUse;
+import com.fjhx.sale.entity.seal.vo.SealUseVo;
 import com.ruoyi.common.core.service.BaseService;
 
 

+ 17 - 7
hx-oa/src/main/java/com/fjhx/oa/service/seal/impl/SealUseServiceImpl.java → hx-sale/src/main/java/com/fjhx/sale/service/seal/impl/SealUseServiceImpl.java

@@ -1,4 +1,4 @@
-package com.fjhx.oa.service.seal.impl;
+package com.fjhx.sale.service.seal.impl;
 
 import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.dynamic.datasource.annotation.DSTransactional;
@@ -10,12 +10,12 @@ import com.fjhx.file.utils.ObsFileUtil;
 import com.fjhx.flow.entity.flow.po.FlowExample;
 import com.fjhx.flow.enums.FlowStatusEnum;
 import com.fjhx.flow.service.flow.FlowExampleService;
-import com.fjhx.oa.entity.seal.dto.SealUseDto;
-import com.fjhx.oa.entity.seal.dto.SealUseSelectDto;
-import com.fjhx.oa.entity.seal.po.SealUse;
-import com.fjhx.oa.entity.seal.vo.SealUseVo;
-import com.fjhx.oa.mapper.seal.SealUseMapper;
-import com.fjhx.oa.service.seal.SealUseService;
+import com.fjhx.sale.entity.seal.dto.SealUseDto;
+import com.fjhx.sale.entity.seal.dto.SealUseSelectDto;
+import com.fjhx.sale.entity.seal.po.SealUse;
+import com.fjhx.sale.entity.seal.vo.SealUseVo;
+import com.fjhx.sale.mapper.seal.SealUseMapper;
+import com.fjhx.sale.service.seal.SealUseService;
 import com.ruoyi.common.core.domain.BasePo;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.wrapper.IWrapper;
@@ -57,6 +57,16 @@ public class SealUseServiceImpl extends ServiceImpl<SealUseMapper, SealUse> impl
         wrapper.eq("su", SealUse::getStatus, dto.getStatus());
         wrapper.eq("su", SealUse::getIsReturned, dto.getIsReturned());
 
+        //是否绑定合同
+        if (ObjectUtil.isNotEmpty(dto.getIsLinkContract())) {
+            if (dto.getIsLinkContract() == 1) {
+                wrapper.isNotNull("su.contract_id");
+            } else {
+                wrapper.isNull("su.contract_id");
+            }
+        }
+
+
         wrapper.orderByDesc("su", SealUse::getId);
         Page<SealUseVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
         List<SealUseVo> records = page.getRecords();

+ 3 - 3
hx-oa/src/main/resources/mapper/seal/SealUseMapper.xml → hx-sale/src/main/resources/mapper/seal/SealUseMapper.xml

@@ -1,6 +1,6 @@
 <?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.fjhx.oa.mapper.seal.SealUseMapper">
+<mapper namespace="com.fjhx.sale.mapper.seal.SealUseMapper">
 
     <sql id="list">
         SELECT su.id,
@@ -34,11 +34,11 @@
                  LEFT JOIN contract c ON su.contract_id = c.id
     </sql>
 
-    <select id="getPage" resultType="com.fjhx.oa.entity.seal.vo.SealUseVo">
+    <select id="getPage" resultType="com.fjhx.sale.entity.seal.vo.SealUseVo">
         <include refid="list"/>
         ${ew.customSqlSegment}
     </select>
-    <select id="detail" resultType="com.fjhx.oa.entity.seal.vo.SealUseVo">
+    <select id="detail" resultType="com.fjhx.sale.entity.seal.vo.SealUseVo">
         <include refid="list"/>
         ${ew.customSqlSegment}
     </select>