Просмотр исходного кода

Merge branch 'master' of http://git.dongkesoft.com:9001/iBOSS-2.0-Mini/iboss-server-mdm

# Conflicts:
#	src/main/java/com/dk/mdm/mapper/ivt/InboundMapper.xml
koushanshan 2 лет назад
Родитель
Сommit
35fc741ad0
68 измененных файлов с 1899 добавлено и 782 удалено
  1. 14 0
      src/main/java/com/dk/mdm/controller/common/CommonController.java
  2. 6 2
      src/main/java/com/dk/mdm/controller/mst/CusFollowController.java
  3. 24 0
      src/main/java/com/dk/mdm/controller/mst/FreezeController.java
  4. 24 0
      src/main/java/com/dk/mdm/controller/mst/FreezeItemController.java
  5. 30 9
      src/main/java/com/dk/mdm/controller/mst/OrgController.java
  6. 12 1
      src/main/java/com/dk/mdm/controller/mst/StaffController.java
  7. 2 3
      src/main/java/com/dk/mdm/controller/mst/StaffPurviewController.java
  8. 2 4
      src/main/java/com/dk/mdm/controller/mst/StaffRightController.java
  9. 0 4
      src/main/java/com/dk/mdm/controller/mst/SupplierController.java
  10. 13 1
      src/main/java/com/dk/mdm/controller/pur/PurchaseController.java
  11. 20 3
      src/main/java/com/dk/mdm/controller/sale/OutReturnController.java
  12. 1 1
      src/main/java/com/dk/mdm/feign/CompanyFeign.java
  13. 1 3
      src/main/java/com/dk/mdm/infrastructure/convert/mst/OrgConvert.java
  14. 1 1
      src/main/java/com/dk/mdm/infrastructure/convert/mst/StaffConvert.java
  15. 1 1
      src/main/java/com/dk/mdm/infrastructure/convert/mst/StaffRightConvert.java
  16. 0 2
      src/main/java/com/dk/mdm/infrastructure/convert/mst/SupplierConvert.java
  17. 7 0
      src/main/java/com/dk/mdm/mapper/common/CommonMapper.java
  18. 38 2
      src/main/java/com/dk/mdm/mapper/common/CommonMapper.xml
  19. 2 2
      src/main/java/com/dk/mdm/mapper/ivt/InboundMapper.xml
  20. 10 1
      src/main/java/com/dk/mdm/mapper/mst/CusFollowMapper.java
  21. 14 17
      src/main/java/com/dk/mdm/mapper/mst/CusFollowMapper.xml
  22. 18 10
      src/main/java/com/dk/mdm/mapper/mst/CustomerMapper.xml
  23. 14 0
      src/main/java/com/dk/mdm/mapper/mst/FreezeItemMapper.java
  24. 177 0
      src/main/java/com/dk/mdm/mapper/mst/FreezeItemMapper.xml
  25. 14 0
      src/main/java/com/dk/mdm/mapper/mst/FreezeMapper.java
  26. 195 0
      src/main/java/com/dk/mdm/mapper/mst/FreezeMapper.xml
  27. 0 12
      src/main/java/com/dk/mdm/mapper/mst/OrgMapper.java
  28. 22 163
      src/main/java/com/dk/mdm/mapper/mst/OrgMapper.xml
  29. 1 1
      src/main/java/com/dk/mdm/mapper/mst/StaffPurviewMapper.java
  30. 1 1
      src/main/java/com/dk/mdm/mapper/mst/StaffPurviewMapper.xml
  31. 1 1
      src/main/java/com/dk/mdm/mapper/mst/StaffRightMapper.java
  32. 1 1
      src/main/java/com/dk/mdm/mapper/mst/StaffRightMapper.xml
  33. 7 0
      src/main/java/com/dk/mdm/mapper/pur/PurchaseMapper.java
  34. 102 0
      src/main/java/com/dk/mdm/mapper/pur/PurchaseMapper.xml
  35. 1 1
      src/main/java/com/dk/mdm/mapper/sale/OrderItemMapper.xml
  36. 21 23
      src/main/java/com/dk/mdm/mapper/sale/OutReturnItemMapper.xml
  37. 58 5
      src/main/java/com/dk/mdm/mapper/sale/OutReturnMapper.xml
  38. 1 6
      src/main/java/com/dk/mdm/model/pojo/mst/CusFollow.java
  39. 77 18
      src/main/java/com/dk/mdm/model/pojo/mst/FreezeItem.java
  40. 2 2
      src/main/java/com/dk/mdm/model/pojo/mst/Org.java
  41. 2 7
      src/main/java/com/dk/mdm/model/query/mst/CusFollowQuery.java
  42. 3 0
      src/main/java/com/dk/mdm/model/query/mst/CustomerQuery.java
  43. 82 33
      src/main/java/com/dk/mdm/model/query/mst/FreezeItemQuery.java
  44. 240 0
      src/main/java/com/dk/mdm/model/query/mst/FreezeQuery.java
  45. 20 7
      src/main/java/com/dk/mdm/model/response/mst/CusFollowResponse.java
  46. 8 0
      src/main/java/com/dk/mdm/model/response/mst/CustomerResponse.java
  47. 45 77
      src/main/java/com/dk/mdm/model/response/mst/FreezeItemResponse.java
  48. 240 0
      src/main/java/com/dk/mdm/model/response/mst/FreezeResponse.java
  49. 2 0
      src/main/java/com/dk/mdm/model/response/pur/PurchaseResponse.java
  50. 3 0
      src/main/java/com/dk/mdm/model/response/sale/OrderItemResponse.java
  51. 7 0
      src/main/java/com/dk/mdm/model/response/sale/OutReturnItemResponse.java
  52. 0 7
      src/main/java/com/dk/mdm/model/vo/mst/CusFollowVO.java
  53. 0 95
      src/main/java/com/dk/mdm/model/vo/mst/OrgVO.java
  54. 0 144
      src/main/java/com/dk/mdm/model/vo/mst/StaffVO.java
  55. 11 2
      src/main/java/com/dk/mdm/service/common/CommonService.java
  56. 7 8
      src/main/java/com/dk/mdm/service/ivt/OutboundService.java
  57. 26 12
      src/main/java/com/dk/mdm/service/mst/CusFollowService.java
  58. 23 0
      src/main/java/com/dk/mdm/service/mst/FreezeItemService.java
  59. 23 0
      src/main/java/com/dk/mdm/service/mst/FreezeService.java
  60. 51 12
      src/main/java/com/dk/mdm/service/mst/OrgService.java
  61. 0 1
      src/main/java/com/dk/mdm/service/mst/RoleService.java
  62. 2 2
      src/main/java/com/dk/mdm/service/mst/StaffPurviewService.java
  63. 1 2
      src/main/java/com/dk/mdm/service/mst/StaffRightService.java
  64. 4 2
      src/main/java/com/dk/mdm/service/mst/StaffService.java
  65. 0 12
      src/main/java/com/dk/mdm/service/mst/SupplierService.java
  66. 9 9
      src/main/java/com/dk/mdm/service/pur/PurchaseService.java
  67. 12 12
      src/main/java/com/dk/mdm/service/sale/OrderService.java
  68. 143 37
      src/main/java/com/dk/mdm/service/sale/OutReturnService.java

+ 14 - 0
src/main/java/com/dk/mdm/controller/common/CommonController.java

@@ -106,6 +106,20 @@ public class CommonController extends BaseController<Map<String, Object>> {
     }
 
     /**
+     * @desc : 只获取二级部门 按照level_code 排序
+     * @author : 王英杰
+     * @date : 2023/1/9 13:49
+     */
+    @ApiOperation(
+            value = "获取组织部门",
+            notes = "获取组织部门"
+    )
+    @PostMapping("get_procur_org")
+    public ResponseResultVO<List<Map<String, Object>>> getProcureOrg(@RequestBody Map<String, Object> param) {
+        return commonService.getProcureOrg(param);
+    }
+
+    /**
      * @desc : 获取组织部门(分页)
      * @author : 姜宁
      * @date : 2023/1/29 16:52

+ 6 - 2
src/main/java/com/dk/mdm/controller/mst/CusFollowController.java

@@ -56,8 +56,12 @@ public class CusFollowController{
     public ResponseResultVO<?> insert(@RequestBody CusFollowVO cusFollowVO) {
         return cusFollowService.insert(cusFollowVO);
     }
-
-    @ApiOperation(value = "分页、关联、条件查询", notes = "分页、关联、条件查询")
+    /**
+     * @desc   : 查询跟进记录
+     * @author : 于继渤
+     * @date : 2024/2/26 10:36
+     */
+    @ApiOperation(value = "条件查询", notes = "条件查询")
     @PostMapping({"select_by_list"})
     public ResponseResultVO<List<CusFollowResponse>> selectByList(@RequestBody CusFollowQuery customerQuery) {
         return cusFollowService.selectByList(customerQuery);

+ 24 - 0
src/main/java/com/dk/mdm/controller/mst/FreezeController.java

@@ -0,0 +1,24 @@
+package com.dk.mdm.controller.mst;
+
+import com.dk.mdm.model.pojo.mst.Freeze;
+import com.dk.common.controller.BaseController;
+import com.dk.common.service.BaseService;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RestController;
+import io.swagger.annotations.Api;
+import com.dk.mdm.service.mst.FreezeService;
+
+@Api(tags = "冻结单API接口")
+@RestController
+@RequestMapping("/freeze")
+public class FreezeController{
+
+    public BaseService<Freeze> getService() {
+        return freezeService;
+    }
+
+    @Autowired
+    private FreezeService freezeService;
+
+}

+ 24 - 0
src/main/java/com/dk/mdm/controller/mst/FreezeItemController.java

@@ -0,0 +1,24 @@
+package com.dk.mdm.controller.mst;
+
+import com.dk.mdm.model.pojo.mst.FreezeItem;
+import com.dk.common.controller.BaseController;
+import com.dk.common.service.BaseService;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RestController;
+import io.swagger.annotations.Api;
+import com.dk.mdm.service.mst.FreezeItemService;
+
+@Api(tags = "冻结单明细API接口")
+@RestController
+@RequestMapping("/freezeItem")
+public class FreezeItemController{
+
+    public BaseService<FreezeItem> getService() {
+        return freezeItemService;
+    }
+
+    @Autowired
+    private FreezeItemService freezeItemService;
+
+}

+ 30 - 9
src/main/java/com/dk/mdm/controller/mst/OrgController.java

@@ -3,20 +3,13 @@ package com.dk.mdm.controller.mst;
 import com.dk.common.model.pojo.PageList;
 import com.dk.common.response.ResponseResultVO;
 import com.dk.mdm.model.pojo.mst.Org;
-import com.dk.common.controller.BaseController;
 import com.dk.common.service.BaseService;
-import com.dk.mdm.model.query.core.OrganizationQuery;
 import com.dk.mdm.model.query.mst.OrgQuery;
-import com.dk.mdm.model.response.core.OrganizationResponse;
-import com.dk.mdm.model.vo.core.OrganizationVO;
-import com.dk.mdm.model.vo.mst.OrgVO;
+import com.dk.common.model.vo.mst.OrgVO;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.*;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RestController;
 import io.swagger.annotations.Api;
 import com.dk.mdm.service.mst.OrgService;
 
@@ -53,4 +46,32 @@ public class OrgController{
     public ResponseResultVO<?> insert(@RequestBody OrgVO orgVO) {
         return orgService.insert(orgVO);
     }
+
+
+    /**
+     * @desc   : 新建组织部门--注册顶级部门
+     * @author : 姜永辉
+     * @date   : 2024/2/27 9:13
+     */
+    @ApiOperation( value = "新建组织部门", notes = "新建组织部门" )
+    @PostMapping({"insert_feign_org"})
+    @Transactional(rollbackFor = Exception.class)
+    public ResponseResultVO<?> insertFeignOrg(@RequestBody OrgVO orgVO) {
+        return orgService.insertFeignOrg(orgVO);
+    }
+
+    /**
+     * @desc   : 通过ID查询
+     * @author : 宋扬
+     * @date   : 2024/3/1 16:01
+     */
+    @PostMapping({"/{id}"})
+    public ResponseResultVO selectById(@PathVariable String id) {
+        return orgService.selectById(id);
+    }
+
+
+
+
+
 }

+ 12 - 1
src/main/java/com/dk/mdm/controller/mst/StaffController.java

@@ -8,7 +8,7 @@ import com.dk.mdm.model.pojo.mst.Staff;
 import com.dk.common.service.BaseService;
 import com.dk.mdm.model.query.mst.StaffQuery;
 import com.dk.common.model.response.mst.StaffResponse;
-import com.dk.mdm.model.vo.mst.StaffVO;
+import com.dk.common.model.vo.mst.StaffVO;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.transaction.annotation.Transactional;
@@ -108,6 +108,17 @@ public class StaffController {
     }
 
     /**
+     * @desc : 新建员工--注册商户用的
+     * @author : 姜永辉
+     * @date : 2023/1/9 10:48
+     */
+    @ApiOperation(value = "新建员工", notes = "新建员工")
+    @PostMapping({"insert_feign_staff"})
+    public ResponseResultVO<?> insertFeignStaff(@RequestBody StaffVO staffVO) {
+        return staffService.insert(staffVO);
+    }
+
+    /**
      * @desc : 编辑员工
      * @author : 姜永辉
      * @date : 2023/1/9 10:49

+ 2 - 3
src/main/java/com/dk/mdm/controller/mst/StaffPurviewController.java

@@ -1,10 +1,9 @@
 package com.dk.mdm.controller.mst;
 
 import com.dk.common.response.ResponseResultVO;
-import com.dk.mdm.model.pojo.mst.StaffPurview;
-import com.dk.common.controller.BaseController;
+import com.dk.common.model.pojo.mst.StaffPurview;
 import com.dk.common.service.BaseService;
-import com.dk.mdm.model.vo.mst.StaffVO;
+import com.dk.common.model.vo.mst.StaffVO;
 import com.dk.mdm.service.mst.StaffService;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.web.bind.annotation.PostMapping;

+ 2 - 4
src/main/java/com/dk/mdm/controller/mst/StaffRightController.java

@@ -1,11 +1,9 @@
 package com.dk.mdm.controller.mst;
 
 import com.dk.common.response.ResponseResultVO;
-import com.dk.mdm.model.pojo.mst.StaffRight;
-import com.dk.common.controller.BaseController;
+import com.dk.common.model.pojo.mst.StaffRight;
 import com.dk.common.service.BaseService;
-import com.dk.mdm.model.vo.mst.StaffRightVO;
-import com.dk.mdm.model.vo.mst.StaffVO;
+import com.dk.common.model.vo.mst.StaffVO;
 import com.dk.mdm.service.mst.StaffService;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.web.bind.annotation.PostMapping;

+ 0 - 4
src/main/java/com/dk/mdm/controller/mst/SupplierController.java

@@ -2,13 +2,9 @@ package com.dk.mdm.controller.mst;
 
 import com.dk.common.model.pojo.PageList;
 import com.dk.common.response.ResponseResultVO;
-import com.dk.mdm.model.pojo.mst.Org;
 import com.dk.mdm.model.pojo.mst.Supplier;
-import com.dk.common.controller.BaseController;
 import com.dk.common.service.BaseService;
-import com.dk.mdm.model.query.mst.OrgQuery;
 import com.dk.mdm.model.query.mst.SupplierQuery;
-import com.dk.mdm.model.vo.mst.StaffVO;
 import com.dk.mdm.model.vo.mst.SupplierVo;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.web.bind.annotation.*;

+ 13 - 1
src/main/java/com/dk/mdm/controller/pur/PurchaseController.java

@@ -41,7 +41,19 @@ public class PurchaseController{
     public ResponseResultVO<PageList<PurchaseResponse>> selectByCond(@RequestBody PurchaseQuery purchaseQuery) {
         return purchaseService.selectByCond(purchaseQuery);
     }
-
+    /**
+     * @desc   : 条件查询 带明细
+     * @author : 王英杰
+     * @date   : 2024/2/28 9:46
+     */
+    @ApiOperation(
+            value = "分页、关联、条件查询",
+            notes = "分页、关联、条件查询"
+    )
+    @PostMapping({"list_by_item"})
+    public ResponseResultVO<PageList<PurchaseResponse>> selectByCondItem(@RequestBody PurchaseQuery purchaseQuery) {
+        return purchaseService.selectByCondItem(purchaseQuery);
+    }
     /**
      * @desc   : 采购订单 待入库查询
      * @author : 王英杰

+ 20 - 3
src/main/java/com/dk/mdm/controller/sale/OutReturnController.java

@@ -18,7 +18,7 @@ import java.util.Map;
 @Api(tags = "出库退货API接口")
 @RestController
 @RequestMapping("/sale/outReturn")
-public class OutReturnController{
+public class OutReturnController {
 
     public BaseService<OutReturn> getService() {
         return outReturnService;
@@ -39,9 +39,9 @@ public class OutReturnController{
     }
 
     /**
-     * @desc   : 查询明细信息
+     * @desc : 查询明细信息
      * @author : 付斌
-     * @date   : 2024-03-07 16:36
+     * @date : 2024-03-07 16:36
      */
     @PostMapping({"select_out_return_info_by_id/{id}"})
     public ResponseResultVO<Map<String, Object>> selectOutReturnInfoById(@PathVariable String id) {
@@ -59,6 +59,12 @@ public class OutReturnController{
         return outReturnService.insert(outReturnVO);
     }
 
+    @ApiOperation(value = "编辑出库单", notes = "编辑出库单")
+    @PostMapping({"update"})
+    public ResponseResultVO<Boolean> update(@RequestBody OutReturnVO outReturnVO) {
+        return outReturnService.update(outReturnVO);
+    }
+
     /**
      * @desc : 作废
      * @author : 付斌
@@ -69,4 +75,15 @@ public class OutReturnController{
     public ResponseResultVO<?> invalid(@PathVariable String id) {
         return outReturnService.invalid(id);
     }
+
+    /**
+     * @desc : 获取退货信息(编辑用)
+     * @author : 付斌
+     * @date : 2024-03-12 13:16
+     */
+    @ApiOperation(value = "获取退货信息(编辑用)", notes = "获取退货信息(编辑用)")
+    @PostMapping({"get_out_return_for_update/{id}"})
+    public ResponseResultVO<?> getOutReturnForUpdate(@PathVariable String id) {
+        return outReturnService.getOutReturnForUpdate(id);
+    }
 }

+ 1 - 1
src/main/java/com/dk/mdm/feign/CompanyFeign.java

@@ -2,7 +2,6 @@ package com.dk.mdm.feign;
 
 
 import com.dk.common.infrastructure.constant.Constant;
-import com.dk.common.model.response.mst.StaffResponse;
 import com.dk.common.response.ResponseResultVO;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -24,4 +23,5 @@ public interface CompanyFeign {
      */
     @PostMapping({"/feign_update_wx_user_company"})
     ResponseResultVO<Boolean> updateWxUserCompany(@RequestBody Map<String, Object> collectQuery) ;
+
 }

+ 1 - 3
src/main/java/com/dk/mdm/infrastructure/convert/mst/OrgConvert.java

@@ -1,9 +1,7 @@
 package com.dk.mdm.infrastructure.convert.mst;
 
-import com.dk.mdm.model.pojo.core.Organization;
 import com.dk.mdm.model.pojo.mst.Org;
-import com.dk.mdm.model.vo.core.OrganizationVO;
-import com.dk.mdm.model.vo.mst.OrgVO;
+import com.dk.common.model.vo.mst.OrgVO;
 import org.mapstruct.Mapper;
 
  /**

+ 1 - 1
src/main/java/com/dk/mdm/infrastructure/convert/mst/StaffConvert.java

@@ -3,7 +3,7 @@ package com.dk.mdm.infrastructure.convert.mst;
 import com.dk.common.model.vo.core.StaffEntity;
 import com.dk.mdm.model.pojo.mst.Staff;
 import com.dk.common.model.response.mst.StaffResponse;
-import com.dk.mdm.model.vo.mst.StaffVO;
+import com.dk.common.model.vo.mst.StaffVO;
 import org.mapstruct.Mapper;
 
 /**

+ 1 - 1
src/main/java/com/dk/mdm/infrastructure/convert/mst/StaffRightConvert.java

@@ -1,6 +1,6 @@
 package com.dk.mdm.infrastructure.convert.mst;
 
-import com.dk.mdm.model.pojo.mst.StaffRight;
+import com.dk.common.model.pojo.mst.StaffRight;
 import com.dk.mdm.model.vo.mst.StaffRightVO;
 import org.mapstruct.Mapper;
 

+ 0 - 2
src/main/java/com/dk/mdm/infrastructure/convert/mst/SupplierConvert.java

@@ -1,8 +1,6 @@
 package com.dk.mdm.infrastructure.convert.mst;
 
-import com.dk.mdm.model.pojo.mst.Org;
 import com.dk.mdm.model.pojo.mst.Supplier;
-import com.dk.mdm.model.vo.mst.OrgVO;
 import com.dk.mdm.model.vo.mst.SupplierVo;
 import org.mapstruct.Mapper;
 

+ 7 - 0
src/main/java/com/dk/mdm/mapper/common/CommonMapper.java

@@ -64,6 +64,13 @@ public interface CommonMapper extends BaseMapper<Map<String, Object>> {
     List<Map<String, Object>> getOrg(Map param);
 
     /**
+     * @desc : 只获取二级部门 按照level_code 排序
+     * @author : 王英杰
+     * @date : 2023/1/9 13:49
+     */
+    List<Map<String, Object>> getProcureOrg(Map param);
+
+    /**
      * @desc : 获取部门(数量)
      * @author : 姜宁
      * @date : 2023/1/29 17:04

+ 38 - 2
src/main/java/com/dk/mdm/mapper/common/CommonMapper.xml

@@ -178,6 +178,34 @@
         </if>
         order by display_no
     </select>
+    <!-- 只获取二级部门 按照level_code 排序 -->
+    <select id="getProcureOrg" resultType="java.util.Map">
+        select org_Id     AS "orgId",
+        org_code   AS "orgCode",
+        org_name   AS "orgName",
+        org_Id     AS "id",
+        parent_id  AS "parentId",
+        top_Id     AS "topId",
+        display_no AS "displayNo",
+        remarks
+        from dkic_b.t_mst_org
+        where flg_valid
+        and cp_id = #{cpId}
+        and parent_id is NOT null
+        <if test="topId != null">
+            AND top_id = #{topId}
+        </if>
+        <if test="orgId != null">
+            AND org_id != #{orgId}
+        </if>
+        <if test="orgCode != null">
+            AND org_code LIKE concat('%',my_ex.likequery(#{orgCode}),'%')
+        </if>
+        <if test="orgName != null">
+            AND org_name LIKE concat('%',my_ex.likequery(#{orgName}),'%')
+        </if>
+        order by level_code
+    </select>
 
     <!-- t_mst_org,(条件查询)个数 -->
     <select id="getOrgCountByPage" resultType="Long">
@@ -219,7 +247,11 @@
         staff.staff_name                                    AS "staffName",
         sys.f_code_name(staff.staff_code, staff.staff_name) AS "staffCodeName",
         staff.remarks
+        ,tmg.org_id as "orgId"
+        ,tmg.org_code as "orgCode"
+        ,tmg.org_name as "orgName"
         from dkic_b.t_mst_staff AS staff
+        left join  dkic_b.t_mst_org tmg on tmg.org_id = staff.org_id
         where staff.flg_valid
         and staff.cp_id =#{cpId}
         <if test="staffCode != null and staffCode != ''">
@@ -566,11 +598,13 @@
         select tms.sup_code       as "supplierCode",
         tms.sup_name              as "supplierName",
         tms.sup_id                as "supplierId",
-        tms.sup_type              as "supplierType",
+        sys.f_get_name_i18n(tdk.kind_name_i18n,'zh_CN' ) AS  "supplierType",
         tms.contact_name          as "contactName",
         tms.contact_phone         as "contactPhone",
         tms.flg_valid             as "flgValid"
         from dkic_b.t_mst_supplier tms
+        LEFT JOIN sys.t_data_kind tdk
+        ON tdk.kind_code = tms.sup_type
         where tms.cp_id = #{cpId}
         <if test="supplierName!=null and supplierName!=''">
             AND tms.sup_name LIKE concat('%',my_ex.likequery(#{supplierName}),'%')
@@ -579,7 +613,7 @@
             AND tms.sup_code LIKE concat('%',my_ex.likequery(#{supplierCode}),'%')
         </if>
         <if test="supplierType!=null and supplierType!=''">
-            AND tms.sup_type LIKE concat('%',my_ex.likequery(#{supplierType}),'%')
+            AND tms.sup_type = #{supplierType}
         </if>
         order by tms.sup_code
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
@@ -594,6 +628,8 @@
     <select id="countSupplier" resultType="java.lang.Long">
         select count(1)
         from dkic_b.t_mst_supplier tms
+        LEFT JOIN sys.t_data_kind tdk
+        ON tdk.kind_code = tms.sup_type
         where tms.cp_id = #{cpId}
         <if test="supplierName!=null and supplierName!=''">
             AND tms.sup_name LIKE concat('%',my_ex.likequery(#{supplierName}),'%')

+ 2 - 2
src/main/java/com/dk/mdm/mapper/ivt/InboundMapper.xml

@@ -234,7 +234,7 @@
                 any(#{intoStatusList, typeHandler= StringListTypeHandler})
             </if>
             <if test="intoStatus != null and intoStatus != ''">
-            AND tpi.into_status LIKE concat('%',my_ex.likequery(#{intoStatus}),'%')
+                 AND tpi.into_status LIKE concat('%',my_ex.likequery(#{intoStatus}),'%')
             </if>
         </where>
     </sql>
@@ -247,7 +247,7 @@
         </foreach>
     </sql>
 
-    <!-- 查询表t_psi_inbound,(条件查询+分页)列表 -->
+    <!-- 查询表t_psi_inbound,(条件查询+分页)列表   tpi.sum_quantity, tpi.sum_amount,-->
     <select id="selectByCond" resultMap="BaseResultMapResponse">
         SELECT
         <include refid="Base_Column_List_Response"/>

+ 10 - 1
src/main/java/com/dk/mdm/mapper/mst/CusFollowMapper.java

@@ -23,7 +23,9 @@ public interface CusFollowMapper extends BaseMapper<CusFollow>{
      * @date : 2024/2/26 10:36
      */
     List<CusFollowResponse> selectByCond(CusFollowQuery cusFollowQuery);
-    List<CusFollowResponse> selectByList(CusFollowQuery cusFollowQuery);
+
+
+
 
     /**
      * @desc   : 根据条件进行查询(数量)
@@ -31,6 +33,13 @@ public interface CusFollowMapper extends BaseMapper<CusFollow>{
      * @date : 2024/2/26 10:36
      */
     Long countByCond(CusFollowQuery cusFollowQuery);
+
+    /**
+     * @desc   : 查询跟进记录
+     * @author : 于继渤
+     * @date : 2024/2/26 10:36
+     */
+    List<CusFollowResponse> selectByList(CusFollowQuery cusFollowQuery);
 	
 }
 

+ 14 - 17
src/main/java/com/dk/mdm/mapper/mst/CusFollowMapper.xml

@@ -5,10 +5,10 @@
     <!-- 通用设置 -->
     <!-- 通用查询列 -->
     <sql id="Base_Column_List">
-        follow_id, cus_id, follow_status, follow_type, follow_org, follow_staff, follow_time, follow_data, follow_time_len, stay_time_len, intention, invite_result, invite_time, design_staff, next_follow_plan, next_follow_time, annex_paths, measure_status, remarks, flg_valid, cp_id, op_create_time, op_create_user_id, op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user
+        follow_id, cus_id, follow_status, follow_org, follow_staff, follow_time, follow_data, follow_time_len, stay_time_len, intention, invite_result, invite_time, design_staff, next_follow_plan, next_follow_time, annex_paths, measure_status, remarks, flg_valid, cp_id, op_create_time, op_create_user_id, op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user
     </sql>
     <sql id="Base_Column_List_Join">
-        tccf.follow_id, tccf.cus_id, tccf.follow_status, tccf.follow_type, tccf.follow_org, tccf.follow_staff, tccf.follow_time, tccf.follow_data,
+        tccf.follow_id, tccf.cus_id, tccf.follow_status,  tccf.follow_org, tccf.follow_staff, tccf.follow_time, tccf.follow_data,
                  tccf.follow_time_len, tccf.stay_time_len, tccf.intention, tccf.invite_result, tccf.invite_time, tccf.design_staff,
                  tccf.next_follow_plan, tccf.next_follow_time,tccf.annex_paths, tccf.measure_status, tccf.remarks, tccf.flg_valid,
                  tccf.cp_id
@@ -18,7 +18,6 @@
         <id column="follow_id" property="followId"/>
                 <result column="cus_id" property="cusId" typeHandler="UuidTypeHandler"/>
                 <result column="follow_status" property="followStatus"/>
-                <result column="follow_type" property="followType"/>
                 <result column="follow_org" property="followOrg" typeHandler="UuidTypeHandler"/>
                 <result column="follow_staff" property="followStaff" typeHandler="UuidTypeHandler"/>
             <result column="follow_time" property="followTime" typeHandler="TimestampTypeHandler"/>
@@ -48,7 +47,6 @@
         <id column="follow_id" property="followId"/>
         <result column="cus_id" property="cusId" typeHandler="UuidTypeHandler"/>
         <result column="follow_status" property="followStatus"/>
-        <result column="follow_type" property="followType"/>
         <result column="follow_org" property="followOrg" typeHandler="UuidTypeHandler"/>
         <result column="follow_staff" property="followStaff" typeHandler="UuidTypeHandler"/>
         <result column="follow_time" property="followTime" typeHandler="TimestampTypeHandler"/>
@@ -74,8 +72,7 @@
         <result column="follow_count" property="followCount"/>
         <result column="follow_staff_name" property="followStaffName"/>
         <result column="create_time" property="createTime"  typeHandler="TimestampTypeHandler"/>
-
-
+        <result column="follow_status_name" property="followStatusName"/>
     </resultMap>
 
     <!-- 通用条件列 -->
@@ -87,9 +84,7 @@
             <if test="followStatus != null and followStatus != ''">
                 AND follow_status = #{followStatus}
             </if>
-            <if test="followType != null and followType != ''">
-                AND follow_type = #{followType}
-            </if>
+
             <if test="followOrg != null and followOrg != ''">
                 AND follow_org = #{followOrg}
             </if>
@@ -173,9 +168,7 @@
             <if test="followStatus != null and followStatus != ''">
                 AND tccf.follow_status = #{followStatus}
             </if>
-            <if test="followType != null and followType != ''">
-                AND tccf.follow_type = #{followType}
-            </if>
+      
             <if test="followOrg != null and followOrg != ''">
                 AND tccf.follow_org = #{followOrg}
             </if>
@@ -248,18 +241,20 @@
         tmc.address_full AS "addressFull",
         tmo.org_name  AS  "orgName",
         tms.staff_name  AS  "staffName",
-        tmc.follow_count AS follow_count
+        tmc.follow_count AS follow_count,
+        tdk1.kind_name_i18n  ->> 'zh_CN' AS "follow_status_name"
         FROM dkic_b.t_crm_cus_follow tccf
         LEFT JOIN dkic_b.t_mst_customer tmc ON tmc.cus_id = tccf.cus_id
         LEFT JOIN dkic_b.t_mst_org tmo on tmo.org_id = tccf.follow_org
         LEFT JOIN dkic_b.t_mst_staff tms on tms.staff_id = tccf.follow_staff
+        LEFT JOIN  sys.t_data_kind tdk1  on tdk1.kind_code =  tccf.follow_status
         <include refid="Condition_Join"/>
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
         </if>
     </select>
 
-
+<!--查询跟进记录-->
     <select id="selectByList" resultMap="BaseResultMapResponse">
         SELECT
         <include refid="Base_Column_List_Join"/>,
@@ -270,11 +265,15 @@
         tms.staff_name  AS  "staffName",
         tmc.follow_count AS follow_count,
         tms.staff_name AS follow_staff_name,
-        tccf.op_create_time AS create_time
+        tccf.op_create_time AS create_time,
+        tdk1.kind_name_i18n  ->> 'zh_CN' AS "follow_status_name"
         FROM dkic_b.t_crm_cus_follow tccf
         LEFT JOIN dkic_b.t_mst_customer tmc ON tmc.cus_id = tccf.cus_id
         LEFT JOIN dkic_b.t_mst_org tmo on tmo.org_id = tccf.follow_org
         LEFT JOIN dkic_b.t_mst_staff tms on tms.staff_id = tccf.follow_staff
+
+        LEFT JOIN  sys.t_data_kind tdk1  on tdk1.kind_code =  tccf.follow_status
+
         <include refid="Condition_Join"/>
 
     </select>
@@ -319,7 +318,6 @@
         <trim suffixOverrides=",">
             cus_id,
             follow_status,
-            follow_type,
             follow_org,
             follow_staff,
             follow_time,
@@ -345,7 +343,6 @@
             <trim suffixOverrides=",">
                 #{item.cusId}::uuid,
                 #{item.followStatus},
-                #{item.followType},
                 #{item.followOrg}::uuid,
                 #{item.followStaff}::uuid,
                 #{item.followTime},

+ 18 - 10
src/main/java/com/dk/mdm/mapper/mst/CustomerMapper.xml

@@ -91,6 +91,10 @@
         <result column="followStaffName" property="followStaffName"/>
         <result column="lastFollowStaffName" property="lastFollowStaffName"/>
         <result column="saleStatusName" property="saleStatusName"/>
+        <result column="next_follow_time" property="nextFollowTime" typeHandler="TimestampTypeHandler"/>
+
+        <result column="follow_staff" property="followStaff"/>
+        <result column="follow_staff_name" property="followStaffName"/>
 
     </resultMap>
 
@@ -176,13 +180,14 @@
                 AND tmc.cp_id = #{cpId}
             </if>
             <if  test="searchText != null">
-                AND (data_value  like concat('%', my_ex.likequery(#{searchText}) , '%')
-                OR  dict_code  like concat('%', my_ex.likequery(#{searchText}) , '%')
-                OR  remarks like concat('%', my_ex.likequery(#{searchText}) , '%')
+                AND (tmc.cus_code  like concat('%', my_ex.likequery(#{searchText}) , '%')
+                OR  tmc.cus_name  like concat('%', my_ex.likequery(#{searchText}) , '%')
+                OR  tmc.cus_phone like concat('%', my_ex.likequery(#{searchText}) , '%')
+                OR  tmc.address_full like concat('%', my_ex.likequery(#{searchText}) , '%')
+                OR  tmc.remarks like concat('%', my_ex.likequery(#{searchText}) , '%')
                 )
             </if>
 
-
         </where>
     </sql>
 
@@ -203,19 +208,18 @@
         tmo.org_name  AS  "orgName",
         tms.staff_name  AS  "staffName",
         tms2.staff_name  AS  "reportStaffName",
-        tdk.kind_name_i18n  ->> 'zh_CN' AS "saleStatusName"
---         tms3.staff_name  AS  "followStaffName",
---         tms4.staff_name  AS  "lastFollowStaffName"
+        tdk.kind_name_i18n  ->> 'zh_CN' AS "saleStatusName",
+        tcf.next_follow_time
         FROM dkic_b.t_mst_customer tmc
+        LEFT JOIN  ( select tccff.cus_id, max (tccff.next_follow_time)as next_follow_time from dkic_b.t_crm_cus_follow tccff group by tccff.cus_id )  tcf on tmc.cus_id = tcf.cus_id
         LEFT JOIN  dkic_b.t_mst_dictionary_data tmd  on tmd.data_id =  tmc.cus_from
         LEFT JOIN  dkic_b.t_mst_sale_channel tmsc  on tmsc.channel_id =  tmc.channel_id
         LEFT JOIN  dkic_b.t_mst_org tmo  on tmo.org_id =  tmc.org_id
         LEFT JOIN  dkic_b.t_mst_staff tms  on tms.staff_id =  tmc.staff_id
         LEFT JOIN  dkic_b.t_mst_staff tms2  on tms2.staff_id =  tmc.report_staff
         LEFT JOIN  sys.t_data_kind tdk  on tdk.kind_code =  tmc.sale_status
---         LEFT JOIN  dkic_b.t_mst_staff tms3  on tms3.staff_id =  tmc.follow_staffs
---         LEFT JOIN  dkic_b.t_mst_staff tms4  on tms4.staff_id =  tmc.last_follow_staff
         <include refid="Condition"/>
+        order by tmc.cus_id DESC
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
         </if>
@@ -249,6 +253,8 @@
         tms.staff_name  AS  "staffName",
         tms2.staff_name  AS  "reportStaffName",
         tdk.kind_name_i18n  ->> 'zh_CN' AS "saleStatusName"
+--         tccfs.follow_staff  as follow_staff,
+--         tms1.staff_name  as follow_staff_name
         FROM dkic_b.t_mst_customer tmc
         LEFT JOIN  dkic_b.t_mst_dictionary_data tmd  on tmd.data_id =  tmc.cus_from
         LEFT JOIN  dkic_b.t_mst_sale_channel tmsc  on tmsc.channel_id =  tmc.channel_id
@@ -256,7 +262,9 @@
         LEFT JOIN  dkic_b.t_mst_staff tms  on tms.staff_id =  tmc.staff_id
         LEFT JOIN  dkic_b.t_mst_staff tms2  on tms2.staff_id =  tmc.report_staff
         LEFT JOIN  sys.t_data_kind tdk  on tdk.kind_code =  tmc.sale_status
-        WHERE cus_id = #{cusId}::uuid
+--         LEFT JOIN  dkic_b.t_crm_cus_follow_staff  tccfs on tccfs.follow_staff = any(tmc.follow_staffs)
+--         LEFT JOIN  dkic_b.t_mst_staff tms1  on tms1.staff_id =  tccfs.follow_staff
+        WHERE tmc.cus_id = #{cusId}::uuid
     </select>
 
     <!-- 根据主键锁定表t_mst_customer的一行数据 -->

+ 14 - 0
src/main/java/com/dk/mdm/mapper/mst/FreezeItemMapper.java

@@ -0,0 +1,14 @@
+package com.dk.mdm.mapper.mst;
+
+import com.dk.mdm.model.pojo.mst.FreezeItem;
+import com.dk.common.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+/**
+*  冻结单明细 Mapper
+*/
+@Repository
+public interface FreezeItemMapper extends BaseMapper<FreezeItem>{
+	
+}
+

+ 177 - 0
src/main/java/com/dk/mdm/mapper/mst/FreezeItemMapper.xml

@@ -0,0 +1,177 @@
+<?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.dk.mdm.mapper.mst.FreezeItemMapper">
+
+    <!-- 通用设置 -->
+    <!-- 通用查询列 -->
+    <sql id="Base_Column_List">
+        item_id, freeze_id, item_index, sku_id, freeze_qty, unfreeze_qty, surplus_qty, remarks, inv_id, flg_valid, cp_id, op_create_time, op_create_user_id, op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user
+    </sql>
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.dk.common.model.response.mst.FreezeItemResponse">
+        <id column="item_id" property="itemId"/>
+                <result column="freeze_id" property="freezeId" typeHandler="UuidTypeHandler"/>
+                <result column="item_index" property="itemIndex"/>
+                <result column="sku_id" property="skuId" typeHandler="UuidTypeHandler"/>
+                <result column="freeze_qty" property="freezeQty"/>
+                <result column="unfreeze_qty" property="unfreezeQty"/>
+                <result column="surplus_qty" property="surplusQty"/>
+                <result column="remarks" property="remarks"/>
+                <result column="inv_id" property="invId" typeHandler="UuidTypeHandler"/>
+                <result column="flg_valid" property="flgValid"/>
+                <result column="cp_id" property="cpId"/>
+            <result column="op_create_time" property="opCreateTime" typeHandler="TimestampTypeHandler"/>
+                <result column="op_create_user_id" property="opCreateUserId" typeHandler="UuidTypeHandler"/>
+            <result column="op_update_time" property="opUpdateTime" typeHandler="TimestampTypeHandler"/>
+                <result column="op_update_user_id" property="opUpdateUserId" typeHandler="UuidTypeHandler"/>
+                <result column="op_app_code" property="opAppCode"/>
+            <result column="op_timestamp" property="opTimestamp" typeHandler="TimestampTypeHandler"/>
+                <result column="op_db_user" property="opDbUser"/>
+    </resultMap>
+
+    <!-- 通用条件列 -->
+    <sql id="Condition">
+        <where>
+            <if test="freezeId != null and freezeId != ''">
+                AND freeze_id = #{freezeId}
+            </if>
+            <if test="itemIndex != null">
+                AND item_index = #{itemIndex}
+            </if>
+            <if test="skuId != null and skuId != ''">
+                AND sku_id = #{skuId}
+            </if>
+            <if test="freezeQty != null">
+                AND freeze_qty = #{freezeQty}
+            </if>
+            <if test="unfreezeQty != null">
+                AND unfreeze_qty = #{unfreezeQty}
+            </if>
+            <if test="surplusQty != null">
+                AND surplus_qty = #{surplusQty}
+            </if>
+            <if test="remarks != null and remarks != ''">
+                AND remarks = #{remarks}
+            </if>
+            <if test="invId != null and invId != ''">
+                AND inv_id = #{invId}
+            </if>
+            <if test="flgValid != null">
+                AND flg_valid = #{flgValid}
+            </if>
+            <if test="cpId != null">
+                AND cp_id = #{cpId}
+            </if>
+            <if test="opCreateTime != null">
+                AND op_create_time = #{opCreateTime}
+            </if>
+            <if test="opCreateUserId != null and opCreateUserId != ''">
+                AND op_create_user_id = #{opCreateUserId}
+            </if>
+            <if test="opUpdateTime != null">
+                AND op_update_time = #{opUpdateTime}
+            </if>
+            <if test="opUpdateUserId != null and opUpdateUserId != ''">
+                AND op_update_user_id = #{opUpdateUserId}
+            </if>
+            <if test="opAppCode != null and opAppCode != ''">
+                AND op_app_code = #{opAppCode}
+            </if>
+            <if test="opTimestamp != null">
+                AND op_timestamp = #{opTimestamp}
+            </if>
+            <if test="opDbUser != null and opDbUser != ''">
+                AND op_db_user = #{opDbUser}
+            </if>
+        </where>
+    </sql>
+
+    <sql id="idsForeach">
+        <!-- 根据主键itemId批量操作 -->
+        WHERE item_id in
+        <foreach collection="ids" index="index" item="item" separator="," open="(" close=")">
+            #{item}
+        </foreach>
+    </sql>
+
+    <!-- 查询表t_psi_freeze_item,(条件查询+分页)列表 -->
+    <select id="selectByCond" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM t_psi_freeze_item
+        <include refid="Condition"/>
+        <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
+            limit #{end} offset #{start}
+        </if>
+    </select>
+
+    <!-- 查询表t_psi_freeze_item,(条件查询)个数 -->
+    <select id="countByCond" resultType="Long">
+        SELECT
+        count(1)
+        FROM t_psi_freeze_item
+        <include refid="Condition"/>
+    </select>
+
+    <!-- 根据主键查询表t_psi_freeze_item的一行数据 -->
+    <select id="selectById" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM t_psi_freeze_item
+        WHERE item_id = #{itemId}::uuid
+    </select>
+
+    <!-- 根据主键锁定表t_psi_freeze_item的一行数据 -->
+    <select id="selectByIdForUpdate" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM t_psi_freeze_item
+        WHERE item_id = #{itemId}
+        for update
+    </select>
+
+    <!-- 根据主键锁定表t_psi_freeze_item的多行数据 -->
+    <select id="selectByIdsForUpdate" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM t_psi_freeze_item
+        <include refid="idsForeach"/>
+        for update
+    </select>
+
+    <insert id="insertBatch">
+        insert into t_psi_freeze_item
+        (
+        <trim suffixOverrides=",">
+            freeze_id,
+            item_index,
+            sku_id,
+            freeze_qty,
+            unfreeze_qty,
+            surplus_qty,
+            remarks,
+            inv_id,
+            cp_id,
+            op_app_code,
+        </trim>
+        )
+        values
+        <foreach collection="list" index="index" item="item" separator=",">
+            (
+            <trim suffixOverrides=",">
+                #{item.freezeId}::uuid,
+                #{item.itemIndex},
+                #{item.skuId}::uuid,
+                #{item.freezeQty},
+                #{item.unfreezeQty},
+                #{item.surplusQty},
+                #{item.remarks},
+                #{item.invId}::uuid,
+                #{item.cpId},
+                #{item.opAppCode},
+            </trim>
+            )
+        </foreach>
+    </insert>
+</mapper>

+ 14 - 0
src/main/java/com/dk/mdm/mapper/mst/FreezeMapper.java

@@ -0,0 +1,14 @@
+package com.dk.mdm.mapper.mst;
+
+import com.dk.mdm.model.pojo.mst.Freeze;
+import com.dk.common.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+/**
+*  冻结单 Mapper
+*/
+@Repository
+public interface FreezeMapper extends BaseMapper<Freeze>{
+	
+}
+

+ 195 - 0
src/main/java/com/dk/mdm/mapper/mst/FreezeMapper.xml

@@ -0,0 +1,195 @@
+<?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.dk.mdm.mapper.mst.FreezeMapper">
+
+    <!-- 通用设置 -->
+    <!-- 通用查询列 -->
+    <sql id="Base_Column_List">
+        freeze_id, freeze_no, cus_id, org_id, staff_id, freeze_status, freeze_date, auto_unfreeze_date, sum_quantity, remarks, make_staff, make_time, flg_valid, cp_id, op_create_time, op_create_user_id, op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user
+    </sql>
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.dk.common.model.response.mst.FreezeResponse">
+        <id column="freeze_id" property="freezeId"/>
+                <result column="freeze_no" property="freezeNo"/>
+                <result column="cus_id" property="cusId" typeHandler="UuidTypeHandler"/>
+                <result column="org_id" property="orgId" typeHandler="UuidTypeHandler"/>
+                <result column="staff_id" property="staffId" typeHandler="UuidTypeHandler"/>
+                <result column="freeze_status" property="freezeStatus"/>
+            <result column="freeze_date" property="freezeDate" typeHandler="TimestampTypeHandler"/>
+            <result column="auto_unfreeze_date" property="autoUnfreezeDate" typeHandler="TimestampTypeHandler"/>
+                <result column="sum_quantity" property="sumQuantity"/>
+                <result column="remarks" property="remarks"/>
+                <result column="make_staff" property="makeStaff" typeHandler="UuidTypeHandler"/>
+            <result column="make_time" property="makeTime" typeHandler="TimestampTypeHandler"/>
+                <result column="flg_valid" property="flgValid"/>
+                <result column="cp_id" property="cpId"/>
+            <result column="op_create_time" property="opCreateTime" typeHandler="TimestampTypeHandler"/>
+                <result column="op_create_user_id" property="opCreateUserId" typeHandler="UuidTypeHandler"/>
+            <result column="op_update_time" property="opUpdateTime" typeHandler="TimestampTypeHandler"/>
+                <result column="op_update_user_id" property="opUpdateUserId" typeHandler="UuidTypeHandler"/>
+                <result column="op_app_code" property="opAppCode"/>
+            <result column="op_timestamp" property="opTimestamp" typeHandler="TimestampTypeHandler"/>
+                <result column="op_db_user" property="opDbUser"/>
+    </resultMap>
+
+    <!-- 通用条件列 -->
+    <sql id="Condition">
+        <where>
+            <if test="freezeNo != null and freezeNo != ''">
+                AND freeze_no = #{freezeNo}
+            </if>
+            <if test="cusId != null and cusId != ''">
+                AND cus_id = #{cusId}
+            </if>
+            <if test="orgId != null and orgId != ''">
+                AND org_id = #{orgId}
+            </if>
+            <if test="staffId != null and staffId != ''">
+                AND staff_id = #{staffId}
+            </if>
+            <if test="freezeStatus != null and freezeStatus != ''">
+                AND freeze_status = #{freezeStatus}
+            </if>
+            <if test="freezeDate != null">
+                AND freeze_date = #{freezeDate}
+            </if>
+            <if test="autoUnfreezeDate != null">
+                AND auto_unfreeze_date = #{autoUnfreezeDate}
+            </if>
+            <if test="sumQuantity != null">
+                AND sum_quantity = #{sumQuantity}
+            </if>
+            <if test="remarks != null and remarks != ''">
+                AND remarks = #{remarks}
+            </if>
+            <if test="makeStaff != null and makeStaff != ''">
+                AND make_staff = #{makeStaff}
+            </if>
+            <if test="makeTime != null">
+                AND make_time = #{makeTime}
+            </if>
+            <if test="flgValid != null">
+                AND flg_valid = #{flgValid}
+            </if>
+            <if test="cpId != null">
+                AND cp_id = #{cpId}
+            </if>
+            <if test="opCreateTime != null">
+                AND op_create_time = #{opCreateTime}
+            </if>
+            <if test="opCreateUserId != null and opCreateUserId != ''">
+                AND op_create_user_id = #{opCreateUserId}
+            </if>
+            <if test="opUpdateTime != null">
+                AND op_update_time = #{opUpdateTime}
+            </if>
+            <if test="opUpdateUserId != null and opUpdateUserId != ''">
+                AND op_update_user_id = #{opUpdateUserId}
+            </if>
+            <if test="opAppCode != null and opAppCode != ''">
+                AND op_app_code = #{opAppCode}
+            </if>
+            <if test="opTimestamp != null">
+                AND op_timestamp = #{opTimestamp}
+            </if>
+            <if test="opDbUser != null and opDbUser != ''">
+                AND op_db_user = #{opDbUser}
+            </if>
+        </where>
+    </sql>
+
+    <sql id="idsForeach">
+        <!-- 根据主键freezeId批量操作 -->
+        WHERE freeze_id in
+        <foreach collection="ids" index="index" item="item" separator="," open="(" close=")">
+            #{item}
+        </foreach>
+    </sql>
+
+    <!-- 查询表t_psi_freeze,(条件查询+分页)列表 -->
+    <select id="selectByCond" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM t_psi_freeze
+        <include refid="Condition"/>
+        <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
+            limit #{end} offset #{start}
+        </if>
+    </select>
+
+    <!-- 查询表t_psi_freeze,(条件查询)个数 -->
+    <select id="countByCond" resultType="Long">
+        SELECT
+        count(1)
+        FROM t_psi_freeze
+        <include refid="Condition"/>
+    </select>
+
+    <!-- 根据主键查询表t_psi_freeze的一行数据 -->
+    <select id="selectById" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM t_psi_freeze
+        WHERE freeze_id = #{freezeId}::uuid
+    </select>
+
+    <!-- 根据主键锁定表t_psi_freeze的一行数据 -->
+    <select id="selectByIdForUpdate" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM t_psi_freeze
+        WHERE freeze_id = #{freezeId}
+        for update
+    </select>
+
+    <!-- 根据主键锁定表t_psi_freeze的多行数据 -->
+    <select id="selectByIdsForUpdate" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM t_psi_freeze
+        <include refid="idsForeach"/>
+        for update
+    </select>
+
+    <insert id="insertBatch">
+        insert into t_psi_freeze
+        (
+        <trim suffixOverrides=",">
+            freeze_no,
+            cus_id,
+            org_id,
+            staff_id,
+            freeze_status,
+            freeze_date,
+            auto_unfreeze_date,
+            sum_quantity,
+            remarks,
+            make_staff,
+            make_time,
+            cp_id,
+            op_app_code,
+        </trim>
+        )
+        values
+        <foreach collection="list" index="index" item="item" separator=",">
+            (
+            <trim suffixOverrides=",">
+                #{item.freezeNo},
+                #{item.cusId}::uuid,
+                #{item.orgId}::uuid,
+                #{item.staffId}::uuid,
+                #{item.freezeStatus},
+                #{item.freezeDate},
+                #{item.autoUnfreezeDate},
+                #{item.sumQuantity},
+                #{item.remarks},
+                #{item.makeStaff}::uuid,
+                #{item.makeTime},
+                #{item.cpId},
+                #{item.opAppCode},
+            </trim>
+            )
+        </foreach>
+    </insert>
+</mapper>

+ 0 - 12
src/main/java/com/dk/mdm/mapper/mst/OrgMapper.java

@@ -2,11 +2,7 @@ package com.dk.mdm.mapper.mst;
 
 import com.dk.mdm.model.pojo.mst.Org;
 import com.dk.common.mapper.BaseMapper;
-import com.dk.mdm.model.query.core.OrganizationQuery;
-import com.dk.mdm.model.query.mst.GoodsCategoryQuery;
 import com.dk.mdm.model.query.mst.OrgQuery;
-import com.dk.mdm.model.response.core.OrganizationResponse;
-import com.dk.mdm.model.vo.mst.OrgVO;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
@@ -33,12 +29,6 @@ public interface OrgMapper extends BaseMapper<Org>{
     Long countByCond(OrgQuery orgQuery);
 
     /**
-     * @desc   : 保存角色权限
-     * @author : 夏常明
-     * @date   : 2023/1/28 10:23
-     */
-    int insertBatch(Org org);
-    /**
      * @desc : 调用函数生成层级
      * @author : 王英杰
      * @date : 2024/2/26 10:36
@@ -46,7 +36,5 @@ public interface OrgMapper extends BaseMapper<Org>{
     Boolean resetLevelOrg(Org org);
 
 
-    Integer maxDisplayNo(String  parentID);
-
 
 }

+ 22 - 163
src/main/java/com/dk/mdm/mapper/mst/OrgMapper.xml

@@ -5,15 +5,16 @@
     <!-- 通用设置 -->
     <!-- 通用查询列 -->
     <sql id="Base_Column_List">
-        org_id
-        , org_name, parent_id, display_no, top_id, level_upper, level_lower, level_leaf, level_no, level_code, level_name, remarks, flg_valid, cp_id, op_create_time, op_create_user_id, op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user, org_code
+        org_id, org_name, parent_id, display_no, top_id, level_upper, level_lower, level_leaf, level_no, level_code
+        , level_name, remarks, flg_valid, cp_id, op_create_time, op_create_user_id, op_update_time, op_update_user_id
+        , op_app_code, op_timestamp, op_db_user, org_code
     </sql>
     <sql id="Base_Column_List_view">
-        parent.org_id
-        , parent.org_name, parent.parent_id, parent.display_no, parent.top_id    </sql>
-
+        parent.org_id,parent.flg_valid,parent.level_leaf,parent.org_code,parent.level_name
+        , parent.org_name, parent.parent_id, parent.display_no, parent.top_id
+    </sql>
     <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.dk.mdm.model.response.mst.OrgResponse">
+    <resultMap id="BaseResultMap" type="com.dk.common.model.response.mst.OrgResponse">
         <id column="org_id" property="orgId"/>
         <result column="org_name" property="orgName"/>
         <result column="parent_id" property="parentId" typeHandler="UuidTypeHandler"/>
@@ -46,129 +47,47 @@
     <sql id="Condition">
         <where>
             <if test="orgName != null and orgName != ''">
-                AND org_name = #{orgName}
-            </if>
-            <if test="parentId != null and parentId != ''">
-                AND parent_id = #{parentId}
-            </if>
-            <if test="displayNo != null">
-                AND display_no = #{displayNo}
-            </if>
-            <if test="topId != null and topId != ''">
-                AND top_id = #{topId}
-            </if>
-            <if test="levelUpper != null and levelUpper != ''">
-                AND level_upper = #{levelUpper}
-            </if>
-            <if test="levelLower != null and levelLower != ''">
-                AND level_lower = #{levelLower}
-            </if>
-            <if test="levelLeaf != null">
-                AND level_leaf = #{levelLeaf}
-            </if>
-            <if test="levelNo != null">
-                AND level_no = #{levelNo}
+                AND parent.org_name = #{orgName}
             </if>
-            <if test="levelCode != null and levelCode != ''">
-                AND level_code = #{levelCode}
-            </if>
-            <if test="levelName != null and levelName != ''">
-                AND level_name = #{levelName}
-            </if>
-            <if test="remarks != null and remarks != ''">
-                AND remarks = #{remarks}
-            </if>
-            <if test="flgValid != null">
-                AND flg_valid = #{flgValid}
+            <if test="flgValidList != null and flgValidList.size>0">
+                AND parent.flg_valid  =any(#{flgValidList, typeHandler=BooleanListTypeHandler})
             </if>
             <if test="cpId != null">
-                AND cp_id = #{cpId}
-            </if>
-            <if test="opCreateTime != null">
-                AND op_create_time = #{opCreateTime}
-            </if>
-            <if test="opCreateUserId != null and opCreateUserId != ''">
-                AND op_create_user_id = #{opCreateUserId}
+                AND parent.cp_id = #{cpId}
             </if>
-            <if test="opUpdateTime != null">
-                AND op_update_time = #{opUpdateTime}
-            </if>
-            <if test="opUpdateUserId != null and opUpdateUserId != ''">
-                AND op_update_user_id = #{opUpdateUserId}
-            </if>
-            <if test="opAppCode != null and opAppCode != ''">
-                AND op_app_code = #{opAppCode}
-            </if>
-            <if test="opTimestamp != null">
-                AND op_timestamp = #{opTimestamp}
+            <if test="parentId != null and parentId != ''">
+                AND parent.parent_id = #{parentId}
             </if>
-            <if test="opDbUser != null and opDbUser != ''">
-                AND op_db_user = #{opDbUser}
+            <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
+                limit #{end} offset #{start}
             </if>
-            <if test="orgCode != null and orgCode != ''">
-                AND org_code = #{orgCode}
+            <if test="searchText !=null">
+                AND ( parent.org_name LIKE concat('%', #{searchText}, '%')
             </if>
         </where>
     </sql>
 
-    <sql id="idsForeach">
-        <!-- 根据主键orgId批量操作 -->
-        WHERE org_id in
-        <foreach collection="ids" index="index" item="item" separator="," open="(" close=")">
-            #{item}
-        </foreach>
-    </sql>
-
     <!-- 查询表t_mst_org,(条件查询+分页)列表 -->
     <select id="selectByCond" resultMap="BaseResultMap">
         SELECT
         <include refid="Base_Column_List_view"/>
         FROM
         dkic_b.t_mst_org AS parent
-        <where>
-        <if test="orgName != null and orgName != ''">
-            AND parent.org_name = #{orgName}
-        </if>
-        <if test="flgValidList != null and flgValidList.size>0">
-            AND parent.flg_valid  =any(#{flgValidList, typeHandler=BooleanListTypeHandler})
-        </if>
-        <if test="cpId != null">
-            AND parent.cp_id = #{cpId}
-        </if>
-        <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
-            limit #{end} offset #{start}
-        </if>
-        <if test="searchText !=null">
-            AND ( parent.org_name LIKE concat('%', #{searchText}, '%')
-        </if>
-        </where>
+        <include refid="Condition"/>
     </select>
+
     <select id="resetLevelOrg" resultType="java.lang.Boolean">
         select dkic_b.f_reset_level_org(#{cpId}, #{topId}::uuid)
     </select>
+
     <!-- 查询表t_mst_org,(条件查询)个数 -->
     <select id="countByCond" resultType="Long">
         SELECT
         count(1)
         FROM  dkic_b.t_mst_org parent
-        <where>
-        <if test="cpId != null">
-            AND parent.cp_id = #{cpId}
-        </if>
-        <if test="orgName != null and orgName != ''">
-            AND parent.org_name = #{orgName}
-        </if>
-        <if test="flgValid != null">
-            AND parent.flg_valid = #{flgValid}
-        </if>
-        </where>
-    </select>
-    <!-- 查询同父级下 最大的 显示顺序 -->
-    <select id="maxDisplayNo" resultType="Integer">
-        SELECT MAX(display_no) AS max_display_no
-        FROM dkic_b.t_mst_org org
-        WHERE org.parent_id = #{parentID} ::uuid;
+        <include refid="Condition"/>
     </select>
+
     <!-- 根据主键查询表t_mst_org的一行数据 -->
     <select id="selectById" resultMap="BaseResultMap">
         SELECT
@@ -177,64 +96,4 @@
         WHERE org_id = #{orgId}::uuid
     </select>
 
-    <!-- 根据主键锁定表t_mst_org的一行数据 -->
-    <select id="selectByIdForUpdate" resultMap="BaseResultMap">
-        SELECT
-        <include refid="Base_Column_List"/>
-        FROM t_mst_org
-        WHERE org_id = #{orgId}
-        for update
-    </select>
-
-    <!-- 根据主键锁定表t_mst_org的多行数据 -->
-    <select id="selectByIdsForUpdate" resultMap="BaseResultMap">
-        SELECT
-        <include refid="Base_Column_List"/>
-        FROM t_mst_org
-        <include refid="idsForeach"/>
-        for update
-    </select>
-
-    <insert id="insertBatch">
-        insert into t_mst_org
-        (
-        <trim suffixOverrides=",">
-            org_name,
-            parent_id,
-            display_no,
-            top_id,
-            level_upper,
-            level_lower,
-            level_leaf,
-            level_no,
-            level_code,
-            level_name,
-            remarks,
-            cp_id,
-            op_app_code,
-            org_code,
-        </trim>
-        )
-        values
-        <foreach collection="list" index="index" item="item" separator=",">
-            (
-            <trim suffixOverrides=",">
-                #{item.orgName},
-                #{item.parentId}::uuid,
-                #{item.displayNo},
-                #{item.topId}::uuid,
-                #{item.levelUpper},
-                #{item.levelLower},
-                #{item.levelLeaf},
-                #{item.levelNo},
-                #{item.levelCode},
-                #{item.levelName},
-                #{item.remarks},
-                #{item.cpId},
-                #{item.opAppCode},
-                #{item.orgCode},
-            </trim>
-            )
-        </foreach>
-    </insert>
 </mapper>

+ 1 - 1
src/main/java/com/dk/mdm/mapper/mst/StaffPurviewMapper.java

@@ -1,6 +1,6 @@
 package com.dk.mdm.mapper.mst;
 
-import com.dk.mdm.model.pojo.mst.StaffPurview;
+import com.dk.common.model.pojo.mst.StaffPurview;
 import com.dk.common.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;

+ 1 - 1
src/main/java/com/dk/mdm/mapper/mst/StaffPurviewMapper.xml

@@ -10,7 +10,7 @@
     </sql>
 
     <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.dk.mdm.model.pojo.mst.StaffPurview">
+    <resultMap id="BaseResultMap" type="com.dk.common.model.pojo.mst.StaffPurview">
         <id column="staff_id" property="staffId"/>
         <result column="purview_code" property="purviewCode"/>
         <result column="flg_nolimit" property="flgNolimit"/>

+ 1 - 1
src/main/java/com/dk/mdm/mapper/mst/StaffRightMapper.java

@@ -1,6 +1,6 @@
 package com.dk.mdm.mapper.mst;
 
-import com.dk.mdm.model.pojo.mst.StaffRight;
+import com.dk.common.model.pojo.mst.StaffRight;
 import com.dk.common.mapper.BaseMapper;
 import org.springframework.stereotype.Repository;
 

+ 1 - 1
src/main/java/com/dk/mdm/mapper/mst/StaffRightMapper.xml

@@ -10,7 +10,7 @@
     </sql>
 
     <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.dk.mdm.model.pojo.mst.StaffRight">
+    <resultMap id="BaseResultMap" type="com.dk.common.model.pojo.mst.StaffRight">
         <id column="staff_id" property="staffId"/>
         <result column="fun_uuid" property="funUuid" typeHandler="UuidTypeHandler"/>
         <result column="right_type" property="rightType"/>

+ 7 - 0
src/main/java/com/dk/mdm/mapper/pur/PurchaseMapper.java

@@ -25,6 +25,13 @@ public interface PurchaseMapper extends BaseMapper<Purchase>{
     List<PurchaseResponse> selectByCond(PurchaseQuery purchaseQuery);
 
     /**
+     * @desc   : 查询采购订单 带明细
+     * @author : 王英杰
+     * @date   : 2024/2/28 9:48
+     */
+    List<PurchaseResponse> selectByCondItem(PurchaseQuery purchaseQuery);
+
+    /**
      * @desc   : 查询采购订单个数
      * @author : 常皓宁
      * @date   : 2024/2/28 9:48

+ 102 - 0
src/main/java/com/dk/mdm/mapper/pur/PurchaseMapper.xml

@@ -136,6 +136,43 @@
         <result column="op_timestamp" property="opTimestamp" typeHandler="TimestampTypeHandler"/>
         <result column="op_db_user" property="opDbUser"/>
         <result column="wh_id" property="whId"/>
+        <collection property="purchaseItemResponseList" resultMap="purchaseItemListMap" columnPrefix="list_"/>
+    </resultMap>
+    <!--    关联映射-->
+    <resultMap id="purchaseItemListMap" type="java.util.Map">
+        <id column="item_id" property="itemId"/>
+        <result column="pur_id" property="purId" typeHandler="UuidTypeHandler"/>
+        <result column="item_index" property="itemIndex"/>
+        <result column="sku_id" property="skuId" typeHandler="UuidTypeHandler"/>
+        <result column="item_qty" property="itemQty"/>
+        <result column="price_std" property="priceStd"/>
+        <result column="amt_std" property="amtStd"/>
+        <result column="price_pur" property="pricePur"/>
+        <result column="item_amt" property="itemAmt"/>
+        <result column="price_discount" property="priceDiscount"/>
+        <result column="non_std_code" property="nonStdCode"/>
+        <result column="into_status" property="intoStatus"/>
+        <result column="intoing_qty" property="intoingQty"/>
+        <result column="intoing_amt" property="intoingAmt"/>
+        <result column="into_qty" property="intoQty"/>
+        <result column="into_amt" property="intoAmt"/>
+        <result column="return_qty" property="returnQty"/>
+        <result column="return_amt" property="returnAmt"/>
+        <result column="remarks" property="remarks"/>
+        <result column="flg_valid" property="flgValid"/>
+        <result column="cp_id" property="cpId"/>
+        <result column="sku_code" property="skuCode"/>
+        <result column="sku_name" property="skuName"/>
+        <result column="sku_model" property="skuModel"/>
+        <result column="short_name" property="shortName"/>
+        <result column="op_create_time" property="opCreateTime" typeHandler="TimestampTypeHandler"/>
+        <result column="op_create_user_id" property="opCreateUserId" typeHandler="UuidTypeHandler"/>
+        <result column="op_update_time" property="opUpdateTime" typeHandler="TimestampTypeHandler"/>
+        <result column="op_update_user_id" property="opUpdateUserId" typeHandler="UuidTypeHandler"/>
+        <result column="op_app_code" property="opAppCode"/>
+        <result column="op_timestamp" property="opTimestamp" typeHandler="TimestampTypeHandler"/>
+        <result column="op_db_user" property="opDbUser"/>
+
     </resultMap>
 
     <!-- 通用条件列 -->
@@ -416,6 +453,71 @@
             limit #{end} offset #{start}
         </if>
     </select>
+    <sql id="Base_Column_List_Item_Response_Join">
+        ,tppi.item_id  as "List_item_id",
+        tppi.pur_id  as "List_pur_id",
+        tppi.item_index as "List_item_index",
+        tppi.sku_id as "List_sku_id",
+        tppi.item_qty as "List_item_qty",
+        tppi.price_std as "pricePurchase",
+        tppi.amt_std as "List_amt_std",
+        tppi.price_pur as "List_price_pur",
+        tppi.item_amt as "List_item_amt",
+        tppi.price_discount as "List_price_discount",
+        tppi.non_std_code as "List_non_std_code",
+        tppi.into_status as "List_into_status",
+        tppi.intoing_qty as "List_intoing_qty",
+        tppi.intoing_amt as "List_intoing_amt",
+        tppi.into_qty as "List_into_qty",
+        tppi.into_amt as "List_into_amt",
+        tppi.return_qty as "List_return_qty",
+        tppi.return_amt as "List_return_amt",
+        tppi.remarks as "List_remarks",
+        tppi.flg_valid as "List_flg_valid",
+        tppi.cp_id as "List_cp_id",
+        tppi.op_create_time as "List_op_create_time",
+        tppi.op_create_user_id as "List_op_create_user_id",
+        tppi.op_update_time as "List_op_update_time",
+        tppi.op_update_user_id as "List_op_update_user_id",
+        tppi.op_app_code as "List_op_app_code",
+        tppi.op_timestamp as "List_op_timestamp",
+        tppi.op_db_user as "List_op_db_user",
+        tmgs.sku_code AS  list_sku_code,
+        tmgs.sku_name AS  list_sku_name,
+        tmgb.short_name AS  list_short_name,
+        tmgs.sku_model AS  list_sku_model,
+        tmgs.price_purchase AS  list_price_purchase,
+        tmgs.sku_images AS  list_sku_images,
+        tpit.usable_qty AS list_usable_qty,
+        tpit.inv_qty AS list_inv_qty,
+        tpit.outing_qty AS list_outing_qty
+    </sql>
+
+    <!-- 查询表dkic_b.t_psi_purchase,(条件查询+分页)列表 -->
+    <select id="selectByCondItem" resultMap="BaseResultMapResponse">
+        SELECT
+        <include refid="Base_Column_List_Left_join"/>
+        <include refid="Base_Column_List_Item_Response_Join"/>
+        ,tmo.org_name as "orgName"
+        ,tms.staff_name as "staffName"
+        ,tms1.staff_name as "makeStaffName"
+        ,tmp.sup_name as "supplierName"
+        ,tmw.wh_name as "whName"
+        FROM dkic_b.t_psi_purchase tpp
+        left join dkic_b.t_psi_purchase_item tppi  on tppi.pur_id = tpp.pur_id
+        left join  dkic_b.t_mst_goods_sku  tmgs on tmgs.sku_id = tppi.sku_id
+        left join  dkic_b.t_mst_goods_brand  tmgb on tmgb.brand_id = tmgs.brand_id
+        left join  dkic_b.t_psi_inventory  tpit on tpit.sku_id = tppi.sku_id
+        Left join dkic_b.t_mst_org tmo on tpp.org_id = tmo.org_id
+        Left join dkic_b.t_mst_supplier tmp on tpp.sup_id = tmp.sup_id
+        Left join dkic_b.t_mst_staff tms on tpp.staff_id = tms.staff_id
+        Left join dkic_b.t_mst_staff tms1 on tpp.make_staff = tms1.staff_id
+        Left join dkic_b.t_mst_warehouse tmw on tpp.wh_id = tmw.wh_id
+        <include refid="Condition_1"/>
+        <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
+            limit #{end} offset #{start}
+        </if>
+    </select>
 
 
     <!-- 根据主键查询表dkic_b.t_psi_purchase的一行数据 -->

+ 1 - 1
src/main/java/com/dk/mdm/mapper/sale/OrderItemMapper.xml

@@ -338,7 +338,7 @@
                tmgs.sku_code                                        as "skuCode",
                tmgs.sku_model                                       as "skuModel",
                tmgs.sku_name                                        as "skuName",
-               tpobi.out_qty                                        as out_qty,
+               tpobi.out_qty                                        as "outboundOutQty",
                tpobi.out_qty - tpobi.return_qty                     as "canReturnQty",
                tpobi.out_qty - tpobi.return_qty                     as item_qty,
                t.price_std,

+ 21 - 23
src/main/java/com/dk/mdm/mapper/sale/OutReturnItemMapper.xml

@@ -291,35 +291,33 @@
     <!-- 根据条件进行查询(退货编辑用) -->
     <select id="selectByCondForReturnEdit" resultMap="BaseResultMapResponse">
         SELECT t.item_id,
+               t.return_id,
                t.out_id,
-               t.from_item_id,
-               t.from_id,
+               t.out_item_id,
+               t.order_id,
+               t.order_item_id,
                t.item_index,
                t.sku_id,
-               tmgs.sku_code                                  as "skuCode",
-               tmgs.sku_model                                 as "skuModel",
-               tmgs.sku_name                                  as "skuName",
-               tpoi.item_qty                                  as "orderQty",
-               tpoi.item_qty - tpoi.outing_qty + t.outing_qty as "canOutingQty",
-               t.outing_qty,
-               t.price_out,
-               t.outing_amt,
-               t.out_qty,
-               t.out_amt,
+               tmgs.sku_code                                 as "skuCode",
+               tmgs.sku_model                                as "skuModel",
+               tmgs.sku_name                                 as "skuName",
+               tpobi.out_qty                                 as "outboundOutQty",
+               tpobi.out_qty - tpobi.return_qty + t.item_qty as "canReturnQty",
+               t.item_qty,
+               t.price_std,
+               t.amt_std,
+               t.price_return,
+               t.item_amt,
                t.non_std_code,
-               t.remarks,
-               t.inv_id,
-               tpi.wh_id                                      as "whId",
-               tpi.inv_qty                                    as "invQty",
-               tpi.usable_qty                                 as "usableQty",
-               tmw.wh_name                                    as "whName"
-        FROM t_psi_outbound_item as t
-                 left join dkic_b.t_psi_order_item as tpoi on tpoi.item_id = t.from_item_id
-                 left join dkic_b.t_mst_goods_sku tmgs on tpoi.sku_id = tmgs.sku_id
-                 left join dkic_b.t_psi_inventory as tpi on tpi.inv_id = t.inv_id
+               t.remarks
+        FROM t_psi_out_return_item as t
+                 left join t_psi_outbound_item as tpobi on tpobi.item_id = t.out_item_id
+                 left join dkic_b.t_psi_order_item as tpoi on tpoi.item_id = tpobi.from_item_id
+                 left join dkic_b.t_mst_goods_sku tmgs on tpobi.sku_id = tmgs.sku_id
+                 left join dkic_b.t_psi_inventory as tpi on tpi.inv_id = tpobi.inv_id
                  left join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = tpi.wh_id
         where t.flg_valid
-          and t.out_id = #{id}::uuid
+          and t.return_id = #{id}::uuid
         order by t.item_index
     </select>
 </mapper>

+ 58 - 5
src/main/java/com/dk/mdm/mapper/sale/OutReturnMapper.xml

@@ -309,11 +309,64 @@
     </select>
 
     <!-- 根据主键查询表t_psi_out_return的一行数据 -->
-    <select id="selectById" resultMap="BaseResultMap">
-        SELECT
-        <include refid="Base_Column_List"/>
-        FROM t_psi_out_return
-        WHERE return_id = #{returnId}::uuid
+    <select id="selectById" resultMap="BaseResultMapResponse">
+        SELECT t.return_id,
+               t.return_no,
+               t.return_type,
+               t.order_id,
+               t.order_no,
+               t.org_id,
+               tmo.org_name                                      as "orgName",
+               t.staff_id,
+               tms.staff_name                                    as "staffName",
+               t.cus_id,
+               tmc.cus_code                                      as "cusCode",
+               tmc.cus_name                                      as "cusName",
+               tmc.cus_phone                                     as "cusPhone",
+               tmc.cus_from                                      as "cusFrom",
+               tmdd.data_value                                   as "cusFromName",
+               t.address_area,
+               t.address_name,
+               t.address_no,
+               t.address_gcj02,
+               t.address_full,
+               t.contact_name,
+               t.contact_phone,
+               t.sales_channel,
+               tmsc.channel_name                                 as "channelName",
+               t.pickup_date,
+               t.sum_quantity,
+               t.sum_standard,
+               t.sum_amount,
+               t.sale_discount,
+               t.return_status,
+               sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "returnStatusName",
+               t.into_status,
+               sys.f_get_name_i18n(tdk2.kind_name_i18n, #{i18n}) as "intoStatusName",
+               t.intoing_qty,
+               t.intoing_amt,
+               t.into_qty,
+               t.into_amt,
+               t.amt_receivable,
+               t.amt_handle,
+               t.amt_residue,
+               t.remarks,
+               t.annex_paths,
+               t.make_staff,
+               makestaff.staff_name                              as "makeStaffName",
+               t.make_time,
+               t.cp_id,
+               t.flg_valid
+        FROM t_psi_out_return as t
+                 left join dkic_b.t_mst_sale_channel tmsc on t.sales_channel = tmsc.channel_id
+                 left join dkic_b.t_mst_org tmo on t.org_id = tmo.org_id
+                 left join dkic_b.t_mst_staff tms on t.staff_id = tms.staff_id
+                 left join dkic_b.t_mst_staff as makestaff on t.make_staff = makestaff.staff_id
+                 left join dkic_b.t_mst_customer tmc on t.cus_id = tmc.cus_id
+                 left join dkic_b.t_mst_dictionary_data tmdd on tmc.cus_from = tmdd.data_id
+                 left join sys.t_data_kind as tdk1 on t.return_status = tdk1.kind_code
+                 left join sys.t_data_kind as tdk2 on t.into_status = tdk2.kind_code
+        WHERE t.return_id = #{id}::uuid
     </select>
 
     <!-- 根据主键锁定表t_psi_out_return的一行数据 -->

+ 1 - 6
src/main/java/com/dk/mdm/model/pojo/mst/CusFollow.java

@@ -61,12 +61,7 @@ public class CusFollow   implements Serializable {
     private String followStatus;
 
 
-    /**
-     * 跟进方式 (【系统字典】电话、微信、上门、进店)
-     */
-    @Excel(name = "跟进方式 (【系统字典】电话、微信、上门、进店)")
-    @ApiModelProperty(value = "跟进方式 (【系统字典】电话、微信、上门、进店)")
-    private String followType;
+
 
 
     /**

+ 77 - 18
src/main/java/com/dk/mdm/model/pojo/mst/StaffRight.java → src/main/java/com/dk/mdm/model/pojo/mst/FreezeItem.java

@@ -17,58 +17,117 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import com.alibaba.fastjson.JSONObject;
 
+import java.math.BigDecimal;
 import java.util.List;
 import java.time.LocalDateTime;
 
 /**
- *  员工权限
+ *  冻结单明细
  */
 @Data
 @AllArgsConstructor
 @NoArgsConstructor
 @EqualsAndHashCode(callSuper = true)
 @Accessors(chain = true)
-@ExportTitle("员工权限")
-@TableName(value = "t_mst_staff_right", autoResultMap = true,schema = "dkic_b")
-@ApiModel(value="实体类:员工权限", description="表名:t_mst_staff_right")
-public class StaffRight extends PageInfo<StaffRight> implements Serializable {
+@ExportTitle("冻结单明细")
+@TableName(value = "t_psi_freeze_item", autoResultMap = true)
+@ApiModel(value="实体类:冻结单明细", description="表名:t_psi_freeze_item")
+public class FreezeItem extends PageInfo<FreezeItem> implements Serializable {
 
     /*
      * 数据库字段
      */
 
     /**
-     * 员工ID
+     * 明细ID
      */
-    @TableId(value = "staff_id", type = IdType.AUTO)
-    @ApiModelProperty(value = "员工ID")
+    @TableId(value = "item_id", type = IdType.AUTO)
+    @ApiModelProperty(value = "明细ID")
     @TableField(typeHandler = UuidTypeHandler.class)
-    private String staffId;
+    private String itemId;
 
 
     /**
-     * 功能权限
+     * 冻结ID
      */
-    @Excel(name = "功能权限")
-    @ApiModelProperty(value = "功能权限")
+    @Excel(name = "冻结ID")
+    @ApiModelProperty(value = "冻结ID")
     @TableField(typeHandler = UuidTypeHandler.class)
-    private String funUuid;
+    private String freezeId;
 
 
     /**
-     * 权限类型 (1:授予 -1:拒绝)
+     * 商品顺序
      */
-    @Excel(name = "权限类型 (1:授予 -1:拒绝)")
-    @ApiModelProperty(value = "权限类型 (1:授予 -1:拒绝)")
-    private Integer rightType;
+    @Excel(name = "商品顺序")
+    @ApiModelProperty(value = "商品顺序")
+    private Integer itemIndex;
+
+
+    /**
+     * 商品ID
+     */
+    @Excel(name = "商品ID")
+    @ApiModelProperty(value = "商品ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String skuId;
+
+
+    /**
+     * 冻结数量
+     */
+    @Excel(name = "冻结数量")
+    @ApiModelProperty(value = "冻结数量")
+    private BigDecimal freezeQty;
+
+
+    /**
+     * 解冻数量
+     */
+    @Excel(name = "解冻数量")
+    @ApiModelProperty(value = "解冻数量")
+    private BigDecimal unfreezeQty;
+
+
+    /**
+     * 剩余冻结量
+     */
+    @Excel(name = "剩余冻结量")
+    @ApiModelProperty(value = "剩余冻结量")
+    private BigDecimal surplusQty;
+
+
+    /**
+     * 备注
+     */
+    @Excel(name = "备注")
+    @ApiModelProperty(value = "备注")
+    private String remarks;
+
+
+    /**
+     * 库存ID
+     */
+    @Excel(name = "库存ID")
+    @ApiModelProperty(value = "库存ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String invId;
+
+
+    /**
+     * 有效标识 (1:正常 0:停用)
+     */
+    @Excel(name = "有效标识 (1:正常 0:停用)")
+    @ApiModelProperty(value = "有效标识 (1:正常 0:停用)")
+    private Boolean flgValid;
 
 
     /**
      * 企业ID
      */
+    @TableField(fill = FieldFill.INSERT)
     @Excel(name = "企业ID")
     @ApiModelProperty(value = "企业ID")
-    @TableField(fill = FieldFill.INSERT)
     private Integer cpId;
 
 

+ 2 - 2
src/main/java/com/dk/mdm/model/pojo/mst/Org.java

@@ -86,7 +86,7 @@ public class Org extends PageInfo<Org> implements Serializable {
     @Excel(name = "上层ID")
     @ApiModelProperty(value = "上层ID")
     @TableField(typeHandler = UuidListTypeHandler.class)
-    private String levelUpper;
+    private List<String> levelUpper;
 
 
     /**
@@ -95,7 +95,7 @@ public class Org extends PageInfo<Org> implements Serializable {
     @Excel(name = "下层ID")
     @ApiModelProperty(value = "下层ID")
     @TableField(typeHandler = UuidListTypeHandler.class)
-    private String levelLower;
+    private List<String> levelLower;
 
 
     /**

+ 2 - 7
src/main/java/com/dk/mdm/model/query/mst/CusFollowQuery.java

@@ -64,12 +64,6 @@ public class CusFollowQuery extends PageInfo<CusFollowQuery> implements Serializ
     private String followStatus;
 
 
-    /**
-     * 跟进方式 (【系统字典】电话、微信、上门、进店)
-     */
-    @Excel(name = "跟进方式 (【系统字典】电话、微信、上门、进店)")
-    @ApiModelProperty(value = "跟进方式 (【系统字典】电话、微信、上门、进店)")
-    private String followType;
 
 
     /**
@@ -282,7 +276,8 @@ public class CusFollowQuery extends PageInfo<CusFollowQuery> implements Serializ
     @ApiModelProperty(value = "数据操作数据库用户 (触发器自动处理)")
     private String opDbUser;
 
-
+    @ApiModelProperty(value = "模糊查询")
+    private String searchText;
     /*
      * 相关属性
      * @TableField(exist = false)

+ 3 - 0
src/main/java/com/dk/mdm/model/query/mst/CustomerQuery.java

@@ -336,6 +336,9 @@ public class CustomerQuery extends PageInfo<CustomerQuery> implements Serializab
     @ApiModelProperty(value = "数据操作数据库用户 (触发器自动处理)")
     private String opDbUser;
 
+    @ApiModelProperty(value = "模糊查询")
+    private String searchText;
+
 
     /*
      * 相关属性

+ 82 - 33
src/main/java/com/dk/mdm/model/pojo/mst/StaffPurview.java → src/main/java/com/dk/mdm/model/query/mst/FreezeItemQuery.java

@@ -1,82 +1,131 @@
-package com.dk.mdm.model.pojo.mst;
+package com.dk.mdm.model.query.mst;
 
 import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.baomidou.mybatisplus.annotation.*;
-import java.io.Serializable;
-
 import com.dk.common.infrastructure.annotaiton.ExportTitle;
-import com.dk.common.infrastructure.handler.*;
+import com.dk.common.infrastructure.handler.TimestampTypeHandler;
+import com.dk.common.infrastructure.handler.UuidTypeHandler;
 import com.dk.common.model.pojo.PageInfo;
 import com.fasterxml.jackson.annotation.JsonFormat;
-import lombok.Data;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;
-import lombok.NoArgsConstructor;
+import lombok.Data;
 import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
 import lombok.experimental.Accessors;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import com.alibaba.fastjson.JSONObject;
 
-import java.util.List;
+import java.io.Serializable;
+import java.math.BigDecimal;
 import java.time.LocalDateTime;
 
 /**
- *  员工数据范围
+ *  冻结单明细
  */
 @Data
 @AllArgsConstructor
 @NoArgsConstructor
 @EqualsAndHashCode(callSuper = true)
 @Accessors(chain = true)
-@ExportTitle("员工数据范围")
-@TableName(value = "t_mst_staff_purview", schema =  "dkic_b",autoResultMap = true)
-@ApiModel(value="实体类:员工数据范围", description="表名:t_mst_staff_purview")
-public class StaffPurview extends PageInfo<StaffPurview> implements Serializable {
+@ExportTitle("冻结单明细")
+@TableName(value = "t_psi_freeze_item", autoResultMap = true)
+@ApiModel(value="实体类:冻结单明细", description="表名:t_psi_freeze_item")
+public class FreezeItemQuery extends PageInfo<FreezeItemQuery> implements Serializable {
 
     /*
      * 数据库字段
      */
 
     /**
-     * 员工ID
+     * 明细ID
+     */
+    @TableId(value = "item_id", type = IdType.AUTO)
+    @ApiModelProperty(value = "明细ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String itemId;
+
+
+    /**
+     * 冻结ID
+     */
+    @Excel(name = "冻结ID")
+    @ApiModelProperty(value = "冻结ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String freezeId;
+
+
+    /**
+     * 商品顺序
+     */
+    @Excel(name = "商品顺序")
+    @ApiModelProperty(value = "商品顺序")
+    private Integer itemIndex;
+
+
+    /**
+     * 商品ID
      */
-    @TableId(value = "staff_id", type = IdType.AUTO)
-    @ApiModelProperty(value = "员工ID")
+    @Excel(name = "商品ID")
+    @ApiModelProperty(value = "商品ID")
     @TableField(typeHandler = UuidTypeHandler.class)
-    private String staffId;
+    private String skuId;
+
+
+    /**
+     * 冻结数量
+     */
+    @Excel(name = "冻结数量")
+    @ApiModelProperty(value = "冻结数量")
+    private BigDecimal freezeQty;
+
+
+    /**
+     * 解冻数量
+     */
+    @Excel(name = "解冻数量")
+    @ApiModelProperty(value = "解冻数量")
+    private BigDecimal unfreezeQty;
+
+
+    /**
+     * 剩余冻结量
+     */
+    @Excel(name = "剩余冻结量")
+    @ApiModelProperty(value = "剩余冻结量")
+    private BigDecimal surplusQty;
 
 
     /**
-     * 范围权限编码
+     * 备注
      */
-    @Excel(name = "范围权限编码")
-    @ApiModelProperty(value = "范围权限编码")
-    private String purviewCode;
+    @Excel(name = "备注")
+    @ApiModelProperty(value = "备注")
+    private String remarks;
 
 
     /**
-     * 范围权限标识 (true:不限制)
+     * 库存ID
      */
-    @Excel(name = "范围权限标识 (true:不限制)")
-    @ApiModelProperty(value = "范围权限标识 (true:不限制)")
-    private Boolean flgNolimit;
+    @Excel(name = "库存ID")
+    @ApiModelProperty(value = "库存ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String invId;
 
 
     /**
-     * 数据ID
+     * 有效标识 (1:正常 0:停用)
      */
-    @Excel(name = "数据ID")
-    @ApiModelProperty(value = "数据ID")
-    @TableField(typeHandler = UuidListTypeHandler.class)
-    private List<String> dataIds;
+    @Excel(name = "有效标识 (1:正常 0:停用)")
+    @ApiModelProperty(value = "有效标识 (1:正常 0:停用)")
+    private Boolean flgValid;
 
 
     /**
      * 企业ID
      */
+    @TableField(fill = FieldFill.INSERT)
     @Excel(name = "企业ID")
     @ApiModelProperty(value = "企业ID")
-    @TableField(fill = FieldFill.INSERT)
     private Integer cpId;
 
 

+ 240 - 0
src/main/java/com/dk/mdm/model/query/mst/FreezeQuery.java

@@ -0,0 +1,240 @@
+package com.dk.mdm.model.query.mst;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.*;
+import com.dk.common.infrastructure.annotaiton.ExportTitle;
+import com.dk.common.infrastructure.handler.TimestampTypeHandler;
+import com.dk.common.infrastructure.handler.UuidTypeHandler;
+import com.dk.common.model.pojo.PageInfo;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+/**
+ *  冻结单
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@ExportTitle("冻结单")
+@TableName(value = "t_psi_freeze", autoResultMap = true)
+@ApiModel(value="实体类:冻结单", description="表名:t_psi_freeze")
+public class FreezeQuery extends PageInfo<FreezeQuery> implements Serializable {
+
+    /*
+     * 数据库字段
+     */
+
+    /**
+     * 冻结ID
+     */
+    @TableId(value = "freeze_id", type = IdType.AUTO)
+    @ApiModelProperty(value = "冻结ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String freezeId;
+
+
+    /**
+     * 冻结单号
+     */
+    @Excel(name = "冻结单号")
+    @ApiModelProperty(value = "冻结单号")
+    private String freezeNo;
+
+
+    /**
+     * 客户ID
+     */
+    @Excel(name = "客户ID")
+    @ApiModelProperty(value = "客户ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String cusId;
+
+
+    /**
+     * 部门
+     */
+    @Excel(name = "部门")
+    @ApiModelProperty(value = "部门")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String orgId;
+
+
+    /**
+     * 员工
+     */
+    @Excel(name = "员工")
+    @ApiModelProperty(value = "员工")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String staffId;
+
+
+    /**
+     * 冻结状态 (【系统字典】(全部冻结,部分解冻,全部解冻))
+     */
+    @Excel(name = "冻结状态 (【系统字典】(全部冻结,部分解冻,全部解冻))")
+    @ApiModelProperty(value = "冻结状态 (【系统字典】(全部冻结,部分解冻,全部解冻))")
+    private String freezeStatus;
+
+
+    /**
+     * 冻结日期
+     */
+    @Excel(name = "冻结日期")
+    @ApiModelProperty(value = "冻结日期")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime freezeDate;
+
+
+    /**
+     * 自动解冻日期
+     */
+    @Excel(name = "自动解冻日期")
+    @ApiModelProperty(value = "自动解冻日期")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime autoUnfreezeDate;
+
+
+    /**
+     * 商品总数量
+     */
+    @Excel(name = "商品总数量")
+    @ApiModelProperty(value = "商品总数量")
+    private BigDecimal sumQuantity;
+
+
+    /**
+     * 备注
+     */
+    @Excel(name = "备注")
+    @ApiModelProperty(value = "备注")
+    private String remarks;
+
+
+    /**
+     * 制单员
+     */
+    @Excel(name = "制单员")
+    @ApiModelProperty(value = "制单员")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String makeStaff;
+
+
+    /**
+     * 制单时间
+     */
+    @Excel(name = "制单时间")
+    @ApiModelProperty(value = "制单时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime makeTime;
+
+
+    /**
+     * 有效标识 (1:正常 0:停用)
+     */
+    @Excel(name = "有效标识 (1:正常 0:停用)")
+    @ApiModelProperty(value = "有效标识 (1:正常 0:停用)")
+    private Boolean flgValid;
+
+
+    /**
+     * 企业ID
+     */
+    @TableField(fill = FieldFill.INSERT)
+    @Excel(name = "企业ID")
+    @ApiModelProperty(value = "企业ID")
+    private Integer cpId;
+
+
+    /**
+     * 创建时间 (触发器自动处理)
+     */
+    @Excel(name = "创建时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
+    @ApiModelProperty(value = "创建时间 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opCreateTime;
+
+
+    /**
+     * 创建用户 (触发器自动处理)
+     */
+    @Excel(name = "创建用户 (触发器自动处理)")
+    @ApiModelProperty(value = "创建用户 (触发器自动处理)")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String opCreateUserId;
+
+
+    /**
+     * 修改时间 (触发器自动处理)
+     */
+    @Excel(name = "修改时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
+    @ApiModelProperty(value = "修改时间 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opUpdateTime;
+
+
+    /**
+     * 修改用户 (触发器自动处理)
+     */
+    @Excel(name = "修改用户 (触发器自动处理)")
+    @ApiModelProperty(value = "修改用户 (触发器自动处理)")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String opUpdateUserId;
+
+
+    /**
+     * 数据操作应用 (触发器自动处理)
+     */
+    @Excel(name = "数据操作应用 (触发器自动处理)")
+    @ApiModelProperty(value = "数据操作应用 (触发器自动处理)")
+    private String opAppCode;
+
+
+    /**
+     * 数据时间戳 (触发器自动处理)
+     */
+    @Excel(name = "数据时间戳 (触发器自动处理)")
+    @ApiModelProperty(value = "数据时间戳 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opTimestamp;
+
+
+    /**
+     * 数据操作数据库用户 (触发器自动处理)
+     */
+    @Excel(name = "数据操作数据库用户 (触发器自动处理)")
+    @ApiModelProperty(value = "数据操作数据库用户 (触发器自动处理)")
+    private String opDbUser;
+
+
+    /*
+     * 相关属性
+     * @TableField(exist = false)
+     */
+
+    /*
+     * 关联属性 + 查询条件
+     * @TableField(exist = false)
+     */
+
+
+    private static final long serialVersionUID = 1L;
+
+}

+ 20 - 7
src/main/java/com/dk/mdm/model/response/mst/CusFollowResponse.java

@@ -62,12 +62,7 @@ public class CusFollowResponse implements Serializable {
     private String followStatus;
 
 
-    /**
-     * 跟进方式 (【系统字典】电话、微信、上门、进店)
-     */
-    @Excel(name = "跟进方式 (【系统字典】电话、微信、上门、进店)")
-    @ApiModelProperty(value = "跟进方式 (【系统字典】电话、微信、上门、进店)")
-    private String followType;
+
 
 
     /**
@@ -216,13 +211,25 @@ public class CusFollowResponse implements Serializable {
     @ApiModelProperty(value = "企业ID")
     private Integer cpId;
 
-
+    @ApiModelProperty(value = "客户名称")
     private String cusName;
+
+    @ApiModelProperty(value = "客户电话")
     private String cusPhone;
+
+    @ApiModelProperty(value = "销售部门")
     private String orgName;
+
+    @ApiModelProperty(value = "销售人员")
     private String staffName;
+
+    @ApiModelProperty(value = "跟进员工")
     private String followStaffName;
+
+    @ApiModelProperty(value = "详细地址")
     private String addressFull;
+
+    @ApiModelProperty(value = "跟进次数")
     private Integer followCount;
 
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@@ -230,6 +237,12 @@ public class CusFollowResponse implements Serializable {
     private LocalDateTime createTime;
 
 
+    @ApiModelProperty(value = "跟进状态 (【系统字典】陌生接待、留资接待(报备)、跟进、邀约、约尺)")
+    private String followStatusName;
+
+
+
+
     private static final long serialVersionUID = 1L;
 
 }

+ 8 - 0
src/main/java/com/dk/mdm/model/response/mst/CustomerResponse.java

@@ -289,6 +289,8 @@ public class CustomerResponse extends PageInfo<CustomerResponse> implements Seri
 
     @ApiModelProperty(value = "报备人")
     private String reportStaffName;
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String followStaff;
 
     @ApiModelProperty(value = "跟进人")
     private String followStaffName;
@@ -298,6 +300,12 @@ public class CustomerResponse extends PageInfo<CustomerResponse> implements Seri
 
     private String saleStatusName;
 
+    @ApiModelProperty(value = "提醒日期")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime nextFollowTime;
+
+
     private static final long serialVersionUID = 1L;
 
 }

+ 45 - 77
src/main/java/com/dk/mdm/model/response/mst/OrgResponse.java → src/main/java/com/dk/mdm/model/response/mst/FreezeItemResponse.java

@@ -1,11 +1,9 @@
 package com.dk.mdm.model.response.mst;
 
 import cn.afterturn.easypoi.excel.annotation.Excel;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.*;
 import com.dk.common.infrastructure.annotaiton.ExportTitle;
 import com.dk.common.infrastructure.handler.TimestampTypeHandler;
-import com.dk.common.infrastructure.handler.UuidListTypeHandler;
 import com.dk.common.infrastructure.handler.UuidTypeHandler;
 import com.dk.common.model.pojo.PageInfo;
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -18,117 +16,83 @@ import lombok.NoArgsConstructor;
 import lombok.experimental.Accessors;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.time.LocalDateTime;
-import java.util.List;
 
 /**
- *  组织机构
+ *  冻结单明细
  */
 @Data
 @AllArgsConstructor
 @NoArgsConstructor
 @EqualsAndHashCode(callSuper = true)
 @Accessors(chain = true)
-@ExportTitle("组织机构")
-@TableName(value = "t_mst_org", autoResultMap = true, schema =  "dkic_b")
-@ApiModel(value="实体类:组织机构", description="表名:t_mst_org")
-public class OrgResponse extends PageInfo<OrgResponse> implements Serializable {
+@ExportTitle("冻结单明细")
+@TableName(value = "t_psi_freeze_item", autoResultMap = true)
+@ApiModel(value="实体类:冻结单明细", description="表名:t_psi_freeze_item")
+public class FreezeItemResponse extends PageInfo<FreezeItemResponse> implements Serializable {
 
     /*
      * 数据库字段
      */
 
     /**
-     * 组织ID
+     * 明细ID
      */
-//    @TableId(value = "org_id", type = IdType.AUTO)
-    @ApiModelProperty(value = "组织ID")
+    @TableId(value = "item_id", type = IdType.AUTO)
+    @ApiModelProperty(value = "明细ID")
     @TableField(typeHandler = UuidTypeHandler.class)
-    private String orgId;
+    private String itemId;
 
 
     /**
-     * 组织名称
+     * 冻结ID
      */
-    @Excel(name = "组织名称")
-    @ApiModelProperty(value = "组织名称")
-    private String orgName;
-
-
-    /**
-     * 父级ID
-     */
-    @Excel(name = "父级ID")
-    @ApiModelProperty(value = "父级ID")
+    @Excel(name = "冻结ID")
+    @ApiModelProperty(value = "冻结ID")
     @TableField(typeHandler = UuidTypeHandler.class)
-    private String parentId;
+    private String freezeId;
 
 
     /**
-     * 显示顺序 (【1 ~ 46655】)
+     * 商品顺序
      */
-    @Excel(name = "显示顺序 (【1 ~ 46655】)")
-    @ApiModelProperty(value = "显示顺序 (【1 ~ 46655】)")
-    private Integer displayNo;
+    @Excel(name = "商品顺序")
+    @ApiModelProperty(value = "商品顺序")
+    private Integer itemIndex;
 
 
     /**
-     * 顶层ID
+     * 商品ID
      */
-    @Excel(name = "顶层ID")
-    @ApiModelProperty(value = "顶层ID")
+    @Excel(name = "商品ID")
+    @ApiModelProperty(value = "商品ID")
     @TableField(typeHandler = UuidTypeHandler.class)
-    private String topId;
-
-
-    /**
-     * 上层ID
-     */
-    @Excel(name = "上层ID")
-    @ApiModelProperty(value = "上层ID")
-    @TableField(typeHandler = UuidListTypeHandler.class)
-    private String levelUpper;
-
-
-    /**
-     * 下层ID
-     */
-    @Excel(name = "下层ID")
-    @ApiModelProperty(value = "下层ID")
-    @TableField(typeHandler = UuidListTypeHandler.class)
-    private String levelLower;
+    private String skuId;
 
 
     /**
-     * 末级标识
+     * 冻结数量
      */
-    @Excel(name = "末级标识")
-    @ApiModelProperty(value = "末级标识")
-    private Boolean levelLeaf;
+    @Excel(name = "冻结数量")
+    @ApiModelProperty(value = "冻结数量")
+    private BigDecimal freezeQty;
 
 
     /**
-     * 层级序号
+     * 解冻数量
      */
-    @Excel(name = "层级序号")
-    @ApiModelProperty(value = "层级序号")
-    private Integer levelNo;
+    @Excel(name = "解冻数量")
+    @ApiModelProperty(value = "解冻数量")
+    private BigDecimal unfreezeQty;
 
 
     /**
-     * 层级代码
+     * 剩余冻结量
      */
-    @Excel(name = "层级代码")
-    @ApiModelProperty(value = "层级代码")
-    private String levelCode;
-
-
-    /**
-     * 层级全称 (【 / 】)
-     */
-    @Excel(name = "层级全称 (【 / 】)")
-    @ApiModelProperty(value = "层级全称 (【 / 】)")
-    private String levelName;
+    @Excel(name = "剩余冻结量")
+    @ApiModelProperty(value = "剩余冻结量")
+    private BigDecimal surplusQty;
 
 
     /**
@@ -140,6 +104,15 @@ public class OrgResponse extends PageInfo<OrgResponse> implements Serializable {
 
 
     /**
+     * 库存ID
+     */
+    @Excel(name = "库存ID")
+    @ApiModelProperty(value = "库存ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String invId;
+
+
+    /**
      * 有效标识 (1:正常 0:停用)
      */
     @Excel(name = "有效标识 (1:正常 0:停用)")
@@ -150,6 +123,7 @@ public class OrgResponse extends PageInfo<OrgResponse> implements Serializable {
     /**
      * 企业ID
      */
+    @TableField(fill = FieldFill.INSERT)
     @Excel(name = "企业ID")
     @ApiModelProperty(value = "企业ID")
     private Integer cpId;
@@ -219,12 +193,6 @@ public class OrgResponse extends PageInfo<OrgResponse> implements Serializable {
     private String opDbUser;
 
 
-    @ApiModelProperty(value = "")
-    private String orgCode;
-
-    @TableField(exist = false)
-    private List<OrgResponse> itemData;
-
     /*
      * 相关属性
      * @TableField(exist = false)

+ 240 - 0
src/main/java/com/dk/mdm/model/response/mst/FreezeResponse.java

@@ -0,0 +1,240 @@
+package com.dk.mdm.model.response.mst;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.*;
+import com.dk.common.infrastructure.annotaiton.ExportTitle;
+import com.dk.common.infrastructure.handler.TimestampTypeHandler;
+import com.dk.common.infrastructure.handler.UuidTypeHandler;
+import com.dk.common.model.pojo.PageInfo;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+/**
+ *  冻结单
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@ExportTitle("冻结单")
+@TableName(value = "t_psi_freeze", autoResultMap = true)
+@ApiModel(value="实体类:冻结单", description="表名:t_psi_freeze")
+public class FreezeResponse extends PageInfo<FreezeResponse> implements Serializable {
+
+    /*
+     * 数据库字段
+     */
+
+    /**
+     * 冻结ID
+     */
+    @TableId(value = "freeze_id", type = IdType.AUTO)
+    @ApiModelProperty(value = "冻结ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String freezeId;
+
+
+    /**
+     * 冻结单号
+     */
+    @Excel(name = "冻结单号")
+    @ApiModelProperty(value = "冻结单号")
+    private String freezeNo;
+
+
+    /**
+     * 客户ID
+     */
+    @Excel(name = "客户ID")
+    @ApiModelProperty(value = "客户ID")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String cusId;
+
+
+    /**
+     * 部门
+     */
+    @Excel(name = "部门")
+    @ApiModelProperty(value = "部门")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String orgId;
+
+
+    /**
+     * 员工
+     */
+    @Excel(name = "员工")
+    @ApiModelProperty(value = "员工")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String staffId;
+
+
+    /**
+     * 冻结状态 (【系统字典】(全部冻结,部分解冻,全部解冻))
+     */
+    @Excel(name = "冻结状态 (【系统字典】(全部冻结,部分解冻,全部解冻))")
+    @ApiModelProperty(value = "冻结状态 (【系统字典】(全部冻结,部分解冻,全部解冻))")
+    private String freezeStatus;
+
+
+    /**
+     * 冻结日期
+     */
+    @Excel(name = "冻结日期")
+    @ApiModelProperty(value = "冻结日期")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime freezeDate;
+
+
+    /**
+     * 自动解冻日期
+     */
+    @Excel(name = "自动解冻日期")
+    @ApiModelProperty(value = "自动解冻日期")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime autoUnfreezeDate;
+
+
+    /**
+     * 商品总数量
+     */
+    @Excel(name = "商品总数量")
+    @ApiModelProperty(value = "商品总数量")
+    private BigDecimal sumQuantity;
+
+
+    /**
+     * 备注
+     */
+    @Excel(name = "备注")
+    @ApiModelProperty(value = "备注")
+    private String remarks;
+
+
+    /**
+     * 制单员
+     */
+    @Excel(name = "制单员")
+    @ApiModelProperty(value = "制单员")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String makeStaff;
+
+
+    /**
+     * 制单时间
+     */
+    @Excel(name = "制单时间")
+    @ApiModelProperty(value = "制单时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime makeTime;
+
+
+    /**
+     * 有效标识 (1:正常 0:停用)
+     */
+    @Excel(name = "有效标识 (1:正常 0:停用)")
+    @ApiModelProperty(value = "有效标识 (1:正常 0:停用)")
+    private Boolean flgValid;
+
+
+    /**
+     * 企业ID
+     */
+    @TableField(fill = FieldFill.INSERT)
+    @Excel(name = "企业ID")
+    @ApiModelProperty(value = "企业ID")
+    private Integer cpId;
+
+
+    /**
+     * 创建时间 (触发器自动处理)
+     */
+    @Excel(name = "创建时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
+    @ApiModelProperty(value = "创建时间 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opCreateTime;
+
+
+    /**
+     * 创建用户 (触发器自动处理)
+     */
+    @Excel(name = "创建用户 (触发器自动处理)")
+    @ApiModelProperty(value = "创建用户 (触发器自动处理)")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String opCreateUserId;
+
+
+    /**
+     * 修改时间 (触发器自动处理)
+     */
+    @Excel(name = "修改时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
+    @ApiModelProperty(value = "修改时间 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opUpdateTime;
+
+
+    /**
+     * 修改用户 (触发器自动处理)
+     */
+    @Excel(name = "修改用户 (触发器自动处理)")
+    @ApiModelProperty(value = "修改用户 (触发器自动处理)")
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String opUpdateUserId;
+
+
+    /**
+     * 数据操作应用 (触发器自动处理)
+     */
+    @Excel(name = "数据操作应用 (触发器自动处理)")
+    @ApiModelProperty(value = "数据操作应用 (触发器自动处理)")
+    private String opAppCode;
+
+
+    /**
+     * 数据时间戳 (触发器自动处理)
+     */
+    @Excel(name = "数据时间戳 (触发器自动处理)")
+    @ApiModelProperty(value = "数据时间戳 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opTimestamp;
+
+
+    /**
+     * 数据操作数据库用户 (触发器自动处理)
+     */
+    @Excel(name = "数据操作数据库用户 (触发器自动处理)")
+    @ApiModelProperty(value = "数据操作数据库用户 (触发器自动处理)")
+    private String opDbUser;
+
+
+    /*
+     * 相关属性
+     * @TableField(exist = false)
+     */
+
+    /*
+     * 关联属性 + 查询条件
+     * @TableField(exist = false)
+     */
+
+
+    private static final long serialVersionUID = 1L;
+
+}

+ 2 - 0
src/main/java/com/dk/mdm/model/response/pur/PurchaseResponse.java

@@ -11,6 +11,7 @@ import com.dk.common.infrastructure.handler.JsonTypeHandler;
 import com.dk.common.infrastructure.handler.TimestampTypeHandler;
 import com.dk.common.infrastructure.handler.UuidTypeHandler;
 import com.dk.common.model.pojo.PageInfo;
+import com.dk.mdm.model.response.ivt.InboundItemResponse;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -409,6 +410,7 @@ public class PurchaseResponse extends PageInfo<PurchaseResponse> implements Seri
     @ApiModelProperty(value = "采购订单明细")
     private List<PurchaseItemResponse> purchaseItemResponseList;
 
+
     /*
      * 相关属性
      * @TableField(exist = false)

+ 3 - 0
src/main/java/com/dk/mdm/model/response/sale/OrderItemResponse.java

@@ -321,6 +321,9 @@ public class OrderItemResponse extends PageInfo<OrderItemResponse> implements Se
     @ApiModelProperty(value = "订单明细ID")
     private String orderItemId;
 
+    @ApiModelProperty(value = "已出库数量")
+    private BigDecimal outboundOutQty;
+
     @ApiModelProperty(value = "可退货数量")
     private BigDecimal canReturnQty;
 

+ 7 - 0
src/main/java/com/dk/mdm/model/response/sale/OutReturnItemResponse.java

@@ -295,6 +295,13 @@ public class OutReturnItemResponse extends PageInfo<OutReturnItemResponse> imple
     @ApiModelProperty(value = "出库单号")
     private String outNo;
 
+    @ApiModelProperty(value = "已出库数量")
+    private BigDecimal outboundOutQty;
+
+    @ApiModelProperty(value = "可退货数量")
+    private BigDecimal canReturnQty;
+
+
     /*
      * 相关属性
      * @TableField(exist = false)

+ 0 - 7
src/main/java/com/dk/mdm/model/vo/mst/CusFollowVO.java

@@ -61,13 +61,6 @@ public class CusFollowVO implements Serializable {
     private String followStatus;
 
 
-    /**
-     * 跟进方式 (【系统字典】电话、微信、上门、进店)
-     */
-    @Excel(name = "跟进方式 (【系统字典】电话、微信、上门、进店)")
-    @ApiModelProperty(value = "跟进方式 (【系统字典】电话、微信、上门、进店)")
-    private String followType;
-
 
     /**
      * 跟进部门

+ 0 - 95
src/main/java/com/dk/mdm/model/vo/mst/OrgVO.java

@@ -1,95 +0,0 @@
-package com.dk.mdm.model.vo.mst;
-
-import cn.afterturn.easypoi.excel.annotation.Excel;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.dk.common.infrastructure.annotaiton.ExportTitle;
-import com.dk.common.infrastructure.handler.UuidTypeHandler;
-import com.dk.common.model.pojo.PageInfo;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.NoArgsConstructor;
-import lombok.experimental.Accessors;
-
-import java.io.Serializable;
-
-
-/**
- *  组织部门
- */
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-@EqualsAndHashCode(callSuper = true)
-@Accessors(chain = true)
-@ExportTitle("组织部门")
-@TableName(value = "t_mst_org",schema ="dkic_b", autoResultMap = true)
-@ApiModel(value="实体类:组织机构", description="表名:t_mst_org")
-public class OrgVO extends PageInfo<OrgVO> implements Serializable {
-
-    /*
-     * 数据库字段
-     */
-
-    /**
-     * 组织ID
-     */
-    @TableId(value = "org_id", type = IdType.AUTO)
-    @ApiModelProperty(value = "组织ID")
-    @TableField(typeHandler = UuidTypeHandler.class)
-    private String orgId;
-
-
-    /**
-     * 组织代码
-     */
-    @Excel(name = "组织代码")
-    @ApiModelProperty(value = "组织代码")
-    private String orgCode;
-
-
-    /**
-     * 组织名称
-     */
-    @Excel(name = "组织名称")
-    @ApiModelProperty(value = "组织名称")
-    private String orgName;
-
-
-    /**
-     * 父级ID
-     */
-    @Excel(name = "父级ID")
-    @ApiModelProperty(value = "父级ID")
-    @TableField(typeHandler = UuidTypeHandler.class)
-    private String parentId;
-
-    /**
-     * 工厂ID
-     */
-    @ApiModelProperty(value = "工厂ID")
-    private Integer cpId;
-
-    /**
-     * 显示顺序
-     */
-    @Excel(name = "显示顺序")
-    @ApiModelProperty(value = "显示顺序")
-    private Integer displayNo;
-
-    /**
-     * 顶层ID
-     */
-    @Excel(name = "顶层ID")
-    @ApiModelProperty(value = "顶层ID")
-    @TableField(typeHandler = UuidTypeHandler.class)
-    private String topId;
-
-    private static final long serialVersionUID = 1L;
-
-}

+ 0 - 144
src/main/java/com/dk/mdm/model/vo/mst/StaffVO.java

@@ -1,144 +0,0 @@
-package com.dk.mdm.model.vo.mst;
-
-import cn.afterturn.easypoi.excel.annotation.Excel;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.dk.common.infrastructure.annotaiton.ExportTitle;
-import com.dk.common.infrastructure.handler.UuidListTypeHandler;
-import com.dk.common.infrastructure.handler.UuidTypeHandler;
-import com.dk.common.model.pojo.PageInfo;
-import com.dk.mdm.model.pojo.mst.RoleFun;
-import com.dk.mdm.model.pojo.mst.StaffPurview;
-import com.dk.mdm.model.pojo.mst.StaffRight;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.NoArgsConstructor;
-import lombok.experimental.Accessors;
-
-import java.io.Serializable;
-import java.util.List;
-
-/**
- *  员工
- */
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-@EqualsAndHashCode(callSuper = true)
-@Accessors(chain = true)
-@ExportTitle("员工")
-@TableName(value = "t_mst_staff", autoResultMap = true)
-@ApiModel(value="实体类:员工", description="表名:t_mst_staff")
-public class StaffVO extends PageInfo<StaffVO> implements Serializable {
-
-    /*
-     * 数据库字段
-     */
-    /**
-     * 员工ID
-     */
-    @TableId(value = "staff_id", type = IdType.AUTO)
-    @ApiModelProperty(value = "员工ID")
-    @TableField(typeHandler = UuidTypeHandler.class)
-    private String staffId;
-
-
-    /**
-     * 员工编码
-     */
-    @Excel(name = "员工编码", width = 20, type = 10)
-    @ApiModelProperty(value = "员工编码")
-    private String staffCode;
-
-
-    /**
-     * 员工名称
-     */
-    @Excel(name = "员工名称", width = 20, type = 10)
-    @ApiModelProperty(value = "员工名称")
-    private String staffName;
-
-    /**
-     * 员工电话
-     */
-    @Excel(name = "员工电话")
-    @ApiModelProperty(value = "员工电话")
-    private String staffPhone;
-
-    /**
-     * 微信用户
-     */
-    @Excel(name = "微信用户")
-    @ApiModelProperty(value = "微信用户")
-    @TableField(typeHandler = UuidTypeHandler.class)
-    private String wxUserId;
-
-    /**
-     * 组织部门
-     */
-    @ApiModelProperty(value = "组织部门")
-    @TableField(typeHandler = UuidTypeHandler.class)
-    private String orgId;
-
-
-
-    /**
-     * 备注
-     */
-    @Excel(name = "备注", width = 30, orderNum = "99")
-    @ApiModelProperty(value = "备注")
-    private String remarks;
-
-
-    /**
-     * 有效标识 (1:正常 0:停用)
-     */
-    @ApiModelProperty(value = "有效标识 (1:正常 0:停用)")
-    private Boolean flgValid;
-
-    /**
-     * 登录标识
-     */
-    @ApiModelProperty(value = "登录标识")
-    private Boolean flgCanLogin;
-    /**
-     * @desc   : 角色list
-     */
-    @ApiModelProperty(value = "员工状态list")
-    @TableField(typeHandler = UuidListTypeHandler.class)
-    private List<String>  roleIds;
-
-    /**
-     * 工厂ID
-     */
-    @ApiModelProperty(value = "工厂ID")
-    private Integer cpId;
-    /**
-     * 登录标识1能登录 0不能登录
-     */
-    @Excel(name = "登录标识")
-    @ApiModelProperty(value = "登录标识")
-    private Integer hrStatus;
-
-
-    /**
-     * 部门
-     */
-    @Excel(name = "部门", width = 20)
-    @ApiModelProperty(value = "部门")
-    private String orgName;
-
-    private List<StaffRight> staffRightList;
-
-    private List<StaffPurview> staffPurviewList;
-
-
-
-    private static final long serialVersionUID = 1L;
-
-}

+ 11 - 2
src/main/java/com/dk/mdm/service/common/CommonService.java

@@ -176,7 +176,16 @@ public class CommonService extends BaseService<Map<String, Object>> {
         List<Map<String, Object>> list = commonMapper.getOrg(param);
         return ResponseResultUtil.success(list);
     }
-
+    /**
+     * @desc : 只获取二级部门 按照level_code 排序
+     * @author : 王英杰
+     * @date : 2023/1/9 13:49
+     */
+    public ResponseResultVO<List<Map<String, Object>>> getProcureOrg(Map<String, Object> param) {
+        // 获取系统基础数据
+        List<Map<String, Object>> list = commonMapper.getProcureOrg(param);
+        return ResponseResultUtil.success(list);
+    }
     /**
      * @desc : 获取部门
      * @author : 姜宁
@@ -690,7 +699,7 @@ public class CommonService extends BaseService<Map<String, Object>> {
             list = commonMapper.getDataKind(map);
         }
         //邀约结果
-        if (dataSourceCode.equals("invitationResults")) {
+        if (dataSourceCode.equals("inviteResult")) {
             map.put("kindType","邀约结果");
             list = commonMapper.getDataKind(map);
         }

+ 7 - 8
src/main/java/com/dk/mdm/service/ivt/OutboundService.java

@@ -187,18 +187,17 @@ public class OutboundService extends BaseService<Outbound> {
     public ResponseResultVO<Boolean> update(OutboundVO outboundVO) {
         // 订单明细实体
         OrderItem orderItemForUpdate;
-        // 订单明细实体
+        // 出库明细实体
         OutboundItem outboundItemForUpdate;
 
         // 编辑出库明细
         List<OutboundItemVO> editOutboundItemVOList = outboundVO.getItemList();
         for (OutboundItemVO outboundItemVO : editOutboundItemVOList) {
+            outboundItemForUpdate = outboundItemMapper.selectByIdForUpdate(outboundItemVO.getItemId());
             // 出库中数量不能小于出库数量
-            if (outboundItemVO.getOutingQty().compareTo(outboundItemVO.getOutQty()) == -1) {
+            if (outboundItemForUpdate.getOutingQty().compareTo(outboundItemVO.getOutQty()) == -1) {
                 throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.OUTINGQTY_NO_LESS_OUTQTY.getMessage());
             }
-
-            outboundItemForUpdate = outboundItemMapper.selectByIdForUpdate(outboundItemVO.getItemId());
             orderItemForUpdate = orderItemMapper.selectByIdForUpdate(outboundItemVO.getFromItemId());
 
             // 订单的商品数量不能小于(订单之前的出库中数量 - 出库明细之前的出库中数量 + 出库明细现在的出库中数量)
@@ -298,14 +297,14 @@ public class OutboundService extends BaseService<Outbound> {
      * @date : 2024-03-02 17:27
      */
     public ResponseResultVO<?> getOutboundForUpdate(String id) {
-        Map<String, Object> outboundInfo = new HashMap<>();
+        Map<String, Object> dataInfo = new HashMap<>();
         OutboundResponse outboundResponse = outboundMapper.selectById(id);
-        outboundInfo.put("outbound", outboundResponse);
+        dataInfo.put("data", outboundResponse);
 
         // 商品明细
         List<OutboundItemResponse> outboundItemResponseList = outboundItemMapper.selectByCondForOutEdit(id);
-        outboundInfo.put("outboundItem", outboundItemResponseList);
-        return ResponseResultUtil.success(outboundInfo);
+        dataInfo.put("dataItem", outboundItemResponseList);
+        return ResponseResultUtil.success(dataInfo);
     }
 
     /**

+ 26 - 12
src/main/java/com/dk/mdm/service/mst/CusFollowService.java

@@ -101,7 +101,16 @@ public class CusFollowService extends BaseService<CusFollow> {
             rollbackFor = {Exception.class}
     )
     public ResponseResultVO<?> insert(CusFollowVO cusFollowVO) {
-
+        CusFollow cusFollow = cusFollowConvert.convertToPo(cusFollowVO);
+        //设置ID
+        Map<String, Object> uniqueNoteCode = commonService.getUniqueNoteCode(Constant.docNameConstant.CUSTOMERFOLLOW.getName(), true);
+        cusFollow.setFollowId(uniqueNoteCode.get("outId").toString());
+        //跟进时间
+        cusFollow.setFollowTime(LocalDateTime.now());
+        //跟进人
+        cusFollow.setFollowStaff(authUtils.getStaff().getStaffId());
+        //跟进部门
+        cusFollow.setFollowOrg(authUtils.getStaff().getOrgId());
         if (cusFollowVO.getCusId() != null) {
             //查询客户
             Customer customer = customerMapper.selectById(cusFollowVO.getCusId());
@@ -176,12 +185,21 @@ public class CusFollowService extends BaseService<CusFollow> {
                 throw new BaseBusinessException(ErrorCodeEnum.CUSTOMER_SAME_COMPANY_TELEPHONE.getCode(),
                         ErrorCodeEnum.CUSTOMER_SAME_COMPANY_TELEPHONE.getMessage());
             }
+            customer.setLastFollowId(cusFollow.getFollowId());
+            customer.setLastFollowTime(cusFollow.getFollowTime());
+            customer.setLastFollowStaff(cusFollow.getFollowStaff());
             //修改跟进次数
             customer.setFollowCount(customer.getFollowCount() + 1);
             customerService.updateByUuid(customer);
         } else if (cusFollowVO.getCusPhone() != null && cusFollowVO.getCusName() != null) {
             //留资接待 新建客户
             Customer customer = new Customer();
+            //设置编码
+            Map<String, Object> customerNoteCode = commonService.getUniqueNoteCode(Constant.docNameConstant.CUSTOMER.getName(), true);
+            customer.setCusId(customerNoteCode.get("outId").toString());
+            customer.setCusCode(customerNoteCode.get("outNote").toString());
+            //TODO  渠道 取当前登录人员工的渠道
+            customer.setChannelId("10112024-0302-0000-0000-00000759d8a4");
             customer.setCusName(cusFollowVO.getCusName());
             customer.setCusPhone(cusFollowVO.getCusPhone());
             customer.setAddressName(cusFollowVO.getAddressName());
@@ -192,9 +210,13 @@ public class CusFollowService extends BaseService<CusFollow> {
             customer.setReportStaff(authUtils.getStaff().getStaffId());
             customer.setReportTime(LocalDateTime.now());
             customer.setCpId(authUtils.getStaff().getCpId());
+            customer.setStaffId(authUtils.getStaff().getStaffId());
             customer.setOrgId(authUtils.getStaff().getOrgId());
             customer.setFollowCount(1);
-//            customer.setCustomerFrom(-1L);
+            customer.setLastFollowId(cusFollow.getFollowId());
+            customer.setLastFollowTime(cusFollow.getFollowTime());
+            customer.setLastFollowStaff(cusFollow.getFollowStaff());
+
 
             // 同商户 电话不同
             Long count = customerMapper.countByCond(
@@ -225,16 +247,8 @@ public class CusFollowService extends BaseService<CusFollow> {
         }
 
 
-        CusFollow cusFollow = cusFollowConvert.convertToPo(cusFollowVO);
-        //设置ID
-        Map<String, Object> uniqueNoteCode = commonService.getUniqueNoteCode(Constant.docNameConstant.CUSTOMERFOLLOW.getName(), true);
-        cusFollow.setFollowId(uniqueNoteCode.get("outId").toString());
-        //跟进时间
-        cusFollow.setFollowTime(LocalDateTime.now());
-        //跟进人
-        cusFollow.setFollowStaff(authUtils.getStaff().getStaffId());
-        //跟进部门
-        cusFollow.setFollowOrg(authUtils.getStaff().getOrgId());
+
+
 
         // 约量尺
         if (Constant.BasicDataConstant.FOLLOW_STATUS_3.getValue().equals(cusFollow.getFollowStatus())) {

+ 23 - 0
src/main/java/com/dk/mdm/service/mst/FreezeItemService.java

@@ -0,0 +1,23 @@
+package com.dk.mdm.service.mst;
+
+import com.dk.mdm.model.pojo.mst.FreezeItem;
+import com.dk.mdm.mapper.mst.FreezeItemMapper;
+import com.dk.common.service.BaseService;
+import com.dk.common.mapper.BaseMapper;
+import org.springframework.stereotype.Service;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+@Service
+@Transactional
+public class FreezeItemService extends BaseService<FreezeItem> {
+
+	@Override
+	public BaseMapper<FreezeItem> getRepository() {
+		return freezeItemMapper;
+	}
+
+	@Autowired
+	private FreezeItemMapper freezeItemMapper;
+
+}

+ 23 - 0
src/main/java/com/dk/mdm/service/mst/FreezeService.java

@@ -0,0 +1,23 @@
+package com.dk.mdm.service.mst;
+
+import com.dk.mdm.model.pojo.mst.Freeze;
+import com.dk.mdm.mapper.mst.FreezeMapper;
+import com.dk.common.service.BaseService;
+import com.dk.common.mapper.BaseMapper;
+import org.springframework.stereotype.Service;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+@Service
+@Transactional
+public class FreezeService extends BaseService<Freeze> {
+
+	@Override
+	public BaseMapper<Freeze> getRepository() {
+		return freezeMapper;
+	}
+
+	@Autowired
+	private FreezeMapper freezeMapper;
+
+}

+ 51 - 12
src/main/java/com/dk/mdm/service/mst/OrgService.java

@@ -3,27 +3,21 @@ package com.dk.mdm.service.mst;
 import com.dk.common.infrastructure.annotaiton.Pagination;
 import com.dk.common.infrastructure.constant.Constant;
 import com.dk.common.model.pojo.PageList;
-import com.dk.common.response.ResponseCodeEnum;
 import com.dk.common.response.ResponseResultUtil;
 import com.dk.common.response.ResponseResultVO;
-import com.dk.mdm.infrastructure.convert.core.OrganizationConvert;
 import com.dk.mdm.infrastructure.convert.mst.OrgConvert;
-import com.dk.mdm.model.pojo.core.Organization;
 import com.dk.mdm.model.pojo.mst.Org;
 import com.dk.mdm.mapper.mst.OrgMapper;
 import com.dk.common.service.BaseService;
 import com.dk.common.mapper.BaseMapper;
-import com.dk.mdm.model.query.core.OrganizationQuery;
-import com.dk.mdm.model.query.mst.GoodsCategoryQuery;
 import com.dk.mdm.model.query.mst.OrgQuery;
-import com.dk.mdm.model.response.core.OrganizationResponse;
-import com.dk.mdm.model.vo.core.OrganizationVO;
-import com.dk.mdm.model.vo.mst.OrgVO;
+import com.dk.common.model.vo.mst.OrgVO;
 import com.dk.mdm.service.common.CommonService;
 import org.springframework.stereotype.Service;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.util.HashMap;
 import java.util.Map;
 
 @Service
@@ -72,17 +66,62 @@ public class OrgService extends BaseService<Org> {
     public ResponseResultVO<?> insert(OrgVO orgVO) {
         // 转化实体
         Org organization = orgConvert.convertToPo(orgVO);
-        Map<String, Object> codeMap = commonService.getUniqueNoteCode(Constant.docNameConstant.ORG.getName(), false);
+        // 获取显示顺序
+        Integer displayNo = commonService.getMaxDisplayNo(Constant.DisplayNoTable.ORG);
+        Map<String, Object> codeMap = commonService.getUniqueNoteCode(Constant.docNameConstant.ORG.getName(), true);
+        // 获取编码和主键UuId
+        organization.setDisplayNo(displayNo);
+        organization.setOrgId(codeMap.get("outId").toString());
+//        organization.setOrgCode(codeMap.get("outNote").toString());
+
+        //查询 本次要加的 部门的 父级下 最大的DisplayNo  然后加1  就是现在要加的DisplayNo
+        Map<String, Object> param = new HashMap<>();
+        param.put("otherCond", "parent_id = #{parentID} ::uuid");
+        organization.setDisplayNo(commonService.getMaxDisplayNo(Constant.DisplayNoTable.ORG ,param));
+        if (organization.getParentId() != null) {
+            //插入TOPid
+            organization.setTopId(organization.getParentId());
+        }
+
+
+        // 插入组织部门数据
+        super.insert(organization);
+        //执行函数
+        orgMapper.resetLevelOrg(new Org().setTopId(organization.getParentId()).setCpId(organization.getCpId()));
+        return ResponseResultUtil.success();
+        //        return result == 1 ? ResponseResultUtil.success(organization) :
+//                ResponseResultUtil.error(ResponseCodeEnum.INSERT_FAIL);
+    }
 
+    /**
+     * @desc : 新建组织机构
+     * @author : 王英杰
+     * @date : 2024/2/27 9:17
+     */
+    @Transactional(
+            rollbackFor = {Exception.class}
+    )
+    public ResponseResultVO<?> insertFeignOrg(OrgVO orgVO) {
+        // 转化实体
+        Org organization = orgConvert.convertToPo(orgVO);
+        // 获取显示顺序
+//        Integer displayNo = commonService.getMaxDisplayNo(Constant.DisplayNoTable.ORG);
+        Map<String, Object> codeMap = commonService.getUniqueNoteCode(Constant.docNameConstant.ORG.getName(), true);
+        // 获取编码和主键UuId
+        organization.setDisplayNo(0);
         organization.setOrgId(codeMap.get("outId").toString());
 //        organization.setOrgCode(codeMap.get("outNote").toString());
 
         //查询 本次要加的 部门的 父级下 最大的DisplayNo  然后加1  就是现在要加的DisplayNo
-        String parentId = organization.getParentId();
-        int maxDisplayNo = orgMapper.maxDisplayNo(parentId) != null ? orgMapper.maxDisplayNo(parentId) + 1 : 0;
+        Map<String, Object> param = new HashMap<>();
+        param.put("otherCond", "parent_id = #{parentID} ::uuid");
+        organization.setDisplayNo(commonService.getMaxDisplayNo(Constant.DisplayNoTable.ORG ,param));
+        if (organization.getParentId() != null) {
+            //插入TOPid
+            organization.setTopId(organization.getParentId());
+        }
 
 
-        organization.setDisplayNo(maxDisplayNo);
         // 插入组织部门数据
         super.insert(organization);
         //执行函数

+ 0 - 1
src/main/java/com/dk/mdm/service/mst/RoleService.java

@@ -16,7 +16,6 @@ import com.dk.mdm.model.pojo.mst.RoleSensitive;
 import com.dk.mdm.model.query.mst.RoleQuery;
 import com.dk.mdm.model.response.mst.RoleResponse;
 import com.dk.mdm.model.vo.mst.RoleVo;
-import com.dk.mdm.model.vo.mst.StaffVO;
 import com.dk.mdm.service.common.CommonService;
 import org.springframework.stereotype.Service;
 import org.springframework.beans.factory.annotation.Autowired;

+ 2 - 2
src/main/java/com/dk/mdm/service/mst/StaffPurviewService.java

@@ -2,11 +2,11 @@ package com.dk.mdm.service.mst;
 
 import com.dk.common.response.ResponseResultUtil;
 import com.dk.common.response.ResponseResultVO;
-import com.dk.mdm.model.pojo.mst.StaffPurview;
+import com.dk.common.model.pojo.mst.StaffPurview;
 import com.dk.mdm.mapper.mst.StaffPurviewMapper;
 import com.dk.common.service.BaseService;
 import com.dk.common.mapper.BaseMapper;
-import com.dk.mdm.model.pojo.mst.StaffRight;
+import com.dk.common.model.pojo.mst.StaffRight;
 import org.springframework.stereotype.Service;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;

+ 1 - 2
src/main/java/com/dk/mdm/service/mst/StaffRightService.java

@@ -2,8 +2,7 @@ package com.dk.mdm.service.mst;
 
 import com.dk.common.response.ResponseResultUtil;
 import com.dk.common.response.ResponseResultVO;
-import com.dk.mdm.model.pojo.mst.RoleFun;
-import com.dk.mdm.model.pojo.mst.StaffRight;
+import com.dk.common.model.pojo.mst.StaffRight;
 import com.dk.mdm.mapper.mst.StaffRightMapper;
 import com.dk.common.service.BaseService;
 import com.dk.common.mapper.BaseMapper;

+ 4 - 2
src/main/java/com/dk/mdm/service/mst/StaffService.java

@@ -3,6 +3,8 @@ package com.dk.mdm.service.mst;
 import com.dk.common.infrastructure.annotaiton.Pagination;
 import com.dk.common.infrastructure.constant.Constant;
 import com.dk.common.model.pojo.PageList;
+import com.dk.common.model.pojo.mst.StaffPurview;
+import com.dk.common.model.pojo.mst.StaffRight;
 import com.dk.common.response.ResponseCodeEnum;
 import com.dk.common.response.ResponseResultUtil;
 import com.dk.common.response.ResponseResultVO;
@@ -15,7 +17,7 @@ import com.dk.common.service.BaseService;
 import com.dk.common.mapper.BaseMapper;
 import com.dk.mdm.model.query.mst.StaffQuery;
 import com.dk.common.model.response.mst.StaffResponse;
-import com.dk.mdm.model.vo.mst.StaffVO;
+import com.dk.common.model.vo.mst.StaffVO;
 import com.dk.mdm.service.common.CommonService;
 import org.springframework.stereotype.Service;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -131,7 +133,7 @@ public class StaffService extends BaseService<Staff> {
         staff.setStaffCode(codeMap.get("outNote").toString());
         // 更新 被邀人员的cpid
         if (staff.getWxUserId()!=null){
-            // 更新邀请人员的微信用户的cpid 加入公司
+            // 更新邀请人员的微信用户的cpid 加入公司
             Map<String, Object> collectQuery = new HashMap<>();
             collectQuery.put("cpId", staff.getCpId());
             collectQuery.put("userId", staff.getWxUserId());

+ 0 - 12
src/main/java/com/dk/mdm/service/mst/SupplierService.java

@@ -1,23 +1,16 @@
 package com.dk.mdm.service.mst;
 
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.dk.common.infrastructure.annotaiton.Pagination;
 import com.dk.common.infrastructure.constant.Constant;
 import com.dk.common.model.pojo.PageList;
 import com.dk.common.response.ResponseResultUtil;
 import com.dk.common.response.ResponseResultVO;
-import com.dk.mdm.infrastructure.convert.mst.OrgConvert;
 import com.dk.mdm.infrastructure.convert.mst.SupplierConvert;
-import com.dk.mdm.model.pojo.mst.Org;
-import com.dk.mdm.model.pojo.mst.Staff;
 import com.dk.mdm.model.pojo.mst.Supplier;
 import com.dk.mdm.mapper.mst.SupplierMapper;
 import com.dk.common.service.BaseService;
 import com.dk.common.mapper.BaseMapper;
-import com.dk.mdm.model.query.mst.OrgQuery;
 import com.dk.mdm.model.query.mst.SupplierQuery;
-import com.dk.mdm.model.vo.mst.OrgVO;
-import com.dk.mdm.model.vo.mst.StaffVO;
 import com.dk.mdm.model.vo.mst.SupplierVo;
 import com.dk.mdm.service.common.CommonService;
 import org.springframework.stereotype.Service;
@@ -25,14 +18,9 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
 
-import java.sql.CallableStatement;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
-import java.util.UUID;
 
 @Service
 @Transactional

+ 9 - 9
src/main/java/com/dk/mdm/service/pur/PurchaseService.java

@@ -9,12 +9,10 @@ import com.dk.common.model.pojo.PageList;
 import com.dk.common.response.ResponseCodeEnum;
 import com.dk.common.response.ResponseResultUtil;
 import com.dk.common.response.ResponseResultVO;
-import com.dk.mdm.controller.ivt.InboundController;
 import com.dk.mdm.infrastructure.convert.pur.PurChaseConvert;
 import com.dk.mdm.infrastructure.convert.pur.PurChaseItemConvert;
 import com.dk.mdm.mapper.common.CommonMapper;
 import com.dk.mdm.mapper.pur.PurchaseItemMapper;
-import com.dk.mdm.model.pojo.mst.Staff;
 import com.dk.mdm.model.pojo.pur.Purchase;
 import com.dk.mdm.mapper.pur.PurchaseMapper;
 import com.dk.common.service.BaseService;
@@ -26,21 +24,15 @@ import com.dk.mdm.model.response.pur.PurchaseItemResponse;
 import com.dk.mdm.model.response.pur.PurchaseResponse;
 import com.dk.mdm.model.vo.ivt.InboundItemVO;
 import com.dk.mdm.model.vo.ivt.InboundVO;
-import com.dk.mdm.model.vo.mst.StaffVO;
 import com.dk.mdm.model.vo.pur.PurchaseItemVO;
 import com.dk.mdm.model.vo.pur.PurchaseVO;
 import com.dk.mdm.service.common.CommonService;
 import com.dk.mdm.service.ivt.InboundItemService;
 import com.dk.mdm.service.ivt.InboundService;
-import com.sun.xml.internal.bind.v2.TODO;
-import io.micrometer.shaded.org.pcollections.PSet;
 import org.springframework.stereotype.Service;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
 
-import java.math.BigDecimal;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.util.ArrayList;
@@ -94,7 +86,15 @@ public class PurchaseService extends BaseService<Purchase> {
     public ResponseResultVO<PageList<PurchaseResponse>> selectByCond(PurchaseQuery purchaseQuery) {
         return super.mergeListWithCount(purchaseQuery, purchaseMapper.selectByCond(purchaseQuery), purchaseMapper.countByCond(purchaseQuery));
     }
-
+    /**
+     * @desc : 条件查询 带明细
+     * @author : 王英杰
+     * @date : 2024/2/28 9:47
+     */
+    @Pagination
+    public ResponseResultVO<PageList<PurchaseResponse>> selectByCondItem(PurchaseQuery purchaseQuery) {
+        return super.mergeListWithCount(purchaseQuery, purchaseMapper.selectByCondItem(purchaseQuery), purchaseMapper.countByCond(purchaseQuery));
+    }
     /**
      * @desc : 采购订单 待入库查询
      * @author : 王英杰

+ 12 - 12
src/main/java/com/dk/mdm/service/sale/OrderService.java

@@ -227,14 +227,14 @@ public class OrderService extends BaseService<Order> {
      * @date : 2024-03-02 17:27
      */
     public ResponseResultVO<?> getOrderForUpdate(String id) {
-        Map<String, Object> orderInfo = new HashMap<>();
+        Map<String, Object> dataInfo = new HashMap<>();
         OrderResponse orderResponse = orderMapper.selectById(id);
-        orderInfo.put("order", orderResponse);
+        dataInfo.put("data", orderResponse);
 
         // 商品明细
         List<OrderItemResponse> orderItem = orderItemMapper.selectByCond(new OrderItemQuery().setOrderId(id));
-        orderInfo.put("orderItem", orderItem);
-        return ResponseResultUtil.success(orderInfo);
+        dataInfo.put("dataItem", orderItem);
+        return ResponseResultUtil.success(dataInfo);
     }
 
     /**
@@ -243,14 +243,14 @@ public class OrderService extends BaseService<Order> {
      * @date : 2024-03-02 17:27
      */
     public ResponseResultVO<?> getOrderForOut(String id) {
-        Map<String, Object> orderInfo = new HashMap<>();
+        Map<String, Object> dataInfo = new HashMap<>();
         OrderResponse orderResponse = orderMapper.selectById(id);
-        orderInfo.put("order", orderResponse);
+        dataInfo.put("data", orderResponse);
 
         // 商品明细
         List<OrderItemResponse> orderItem = orderItemMapper.selectByCondForOut(new OrderItemQuery().setOrderId(id));
-        orderInfo.put("orderItem", orderItem);
-        return ResponseResultUtil.success(orderInfo);
+        dataInfo.put("dataItem", orderItem);
+        return ResponseResultUtil.success(dataInfo);
     }
 
     /**
@@ -259,13 +259,13 @@ public class OrderService extends BaseService<Order> {
      * @date : 2024-03-02 17:27
      */
     public ResponseResultVO<?> getOrderForReturn(String id) {
-        Map<String, Object> orderInfo = new HashMap<>();
+        Map<String, Object> dataInfo = new HashMap<>();
         OrderResponse orderResponse = orderMapper.selectById(id);
-        orderInfo.put("order", orderResponse);
+        dataInfo.put("data", orderResponse);
 
         // 商品明细
         List<OrderItemResponse> orderItem = orderItemMapper.selectByCondForReturn(new OrderItemQuery().setOrderId(id));
-        orderInfo.put("orderItem", orderItem);
-        return ResponseResultUtil.success(orderInfo);
+        dataInfo.put("dataItem", orderItem);
+        return ResponseResultUtil.success(dataInfo);
     }
 }

+ 143 - 37
src/main/java/com/dk/mdm/service/sale/OutReturnService.java

@@ -27,8 +27,6 @@ import com.dk.common.service.BaseService;
 import com.dk.common.mapper.BaseMapper;
 import com.dk.mdm.model.query.sale.OutReturnItemQuery;
 import com.dk.mdm.model.query.sale.OutReturnQuery;
-import com.dk.mdm.model.response.ivt.OutboundItemResponse;
-import com.dk.mdm.model.response.ivt.OutboundResponse;
 import com.dk.mdm.model.response.sale.OutReturnItemResponse;
 import com.dk.mdm.model.response.sale.OutReturnResponse;
 import com.dk.mdm.model.vo.sale.OutReturnItemVO;
@@ -151,9 +149,13 @@ public class OutReturnService extends BaseService<OutReturn> {
         if (outReturnVO.getItemList() != null && outReturnVO.getItemList().size() > 0) {
             OrderItem orderItemForUpdate;
             OutboundItem outboundItemForUpdate;
-            String outId = "";
+            // 出库IdList,一个退货单可能有多个出库单
+            List<String> outIdList = new ArrayList<>();
             for (OutReturnItemVO outReturnItemVO : outReturnVO.getItemList()) {
-                outId = outReturnItemVO.getOutId();
+                // 把出库Id存起来
+                if (!outIdList.contains(outReturnItemVO.getOutId())) {
+                    outIdList.add(outReturnItemVO.getOutId());
+                }
                 OutReturnItem outReturnItem = outReturnItemConvert.convertToPo(outReturnItemVO);
                 outReturnItem.setReturnId(outReturn.getReturnId()).setCpId(outReturn.getCpId()).setIntoStatus(Constant.IntoStatus.DAIRUKU.getName());
                 outReturnItemMapper.insert(outReturnItem);
@@ -186,18 +188,21 @@ public class OutReturnService extends BaseService<OutReturn> {
                 /*********************  反写订单明细退货数量、金额 end **********************/
             }
 
-            // 计算出库明细的退货数量,金额合计
-            List<OutboundItem> outboundItemList = outboundItemMapper.selectByZIdForUpdate(outId);
-            OutboundItem outboundItem = outboundItemList.stream().reduce((x, y) -> {
-                OutboundItem item = new OutboundItem();
-                item.setReturnQty(x.getReturnQty().add(y.getReturnQty()));
-                item.setReturnAmt(x.getReturnAmt().add(y.getReturnAmt()));
-                return item;
-            }).get();
-            // 更新出库单上的退货数量,金额
-            Outbound outboundUpdate = new Outbound();
-            outboundUpdate.setReturnQty(outboundItem.getReturnQty()).setReturnAmt(outboundItem.getReturnAmt()).setOutId(outId);
-            outboundService.updateByUuid(outboundUpdate);
+            // 可能有多个出库单,所以要循环更新总单
+            for (String outId : outIdList) {
+                // 计算出库明细的退货数量,金额合计
+                List<OutboundItem> outboundItemList = outboundItemMapper.selectByZIdForUpdate(outId);
+                OutboundItem outboundItem = outboundItemList.stream().reduce((x, y) -> {
+                    OutboundItem item = new OutboundItem();
+                    item.setReturnQty(x.getReturnQty().add(y.getReturnQty()));
+                    item.setReturnAmt(x.getReturnAmt().add(y.getReturnAmt()));
+                    return item;
+                }).get();
+                // 更新出库单上的退货数量,金额
+                Outbound outboundUpdate = new Outbound();
+                outboundUpdate.setReturnQty(outboundItem.getReturnQty()).setReturnAmt(outboundItem.getReturnAmt()).setOutId(outId);
+                outboundService.updateByUuid(outboundUpdate);
+            }
 
             // 计算订单明细的退货数量,金额合计
             List<OrderItem> orderItemList = orderItemMapper.selectByZIdForUpdate(outReturnVO.getOrderId());
@@ -216,6 +221,98 @@ public class OutReturnService extends BaseService<OutReturn> {
     }
 
     /**
+     * @desc : 编辑方法
+     * @author : 付斌
+     * @date : 2023/1/9 10:49
+     */
+    @Transactional(
+            rollbackFor = {Exception.class}
+    )
+    public ResponseResultVO<Boolean> update(OutReturnVO outReturnVO) {
+        // 订单明细实体
+        OrderItem orderItemForUpdate;
+        // 出库明细实体
+        OutboundItem outboundItemForUpdate;
+        // 退货明细实体
+        OutReturnItem outReturnItemForUpdate;
+        // 出库IdList,一个退货单可能有多个出库单
+        List<String> outIdList = new ArrayList<>();
+
+        // 编辑退货明细
+        List<OutReturnItemVO> editOutReturnItemVOList = outReturnVO.getItemList();
+        for (OutReturnItemVO outReturnItemVO : editOutReturnItemVOList) {
+            // 把出库Id存起来
+            if (!outIdList.contains(outReturnItemVO.getOutId())) {
+                outIdList.add(outReturnItemVO.getOutId());
+            }
+
+            outReturnItemForUpdate = outReturnItemMapper.selectByIdForUpdate(outReturnItemVO.getItemId());
+            // 退货数量不能小于入库中数量
+            if (outReturnItemVO.getItemQty().compareTo(outReturnItemForUpdate.getIntoingQty()) == -1) {
+                throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.RETURNQTY_NO_LESS_INTOINGQTY.getMessage());
+            }
+
+            outboundItemForUpdate = outboundItemMapper.selectByIdForUpdate(outReturnItemVO.getOutItemId());
+            // 出库数量不能小于(出库明细的退货数量 - 退货明细之前的退货数量 + 退货明细现在的退货数量)
+            if (outboundItemForUpdate.getOutQty().compareTo(outboundItemForUpdate.getReturnQty().subtract(outReturnItemForUpdate.getItemQty()).add(outReturnItemVO.getItemQty())) == -1) {
+                throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.OUTQTY_NO_LESS_RETURNQTY.getMessage());
+            }
+            // 更新出库明细退货数量
+            OutboundItem outboundItemUpdate = new OutboundItem();
+            outboundItemUpdate.setReturnQty(outboundItemForUpdate.getReturnQty().subtract(outReturnItemForUpdate.getItemQty()).add(outReturnItemVO.getItemQty()))
+                    .setReturnAmt(outboundItemForUpdate.getReturnAmt().subtract(outReturnItemForUpdate.getItemAmt()).add(outReturnItemVO.getItemAmt()))
+                    .setItemId(outboundItemForUpdate.getItemId());
+            outboundItemService.updateByUuid(outboundItemUpdate);
+
+            // 更新订单明细退货数量
+            orderItemForUpdate = orderItemMapper.selectByIdForUpdate(outReturnItemVO.getOrderItemId());
+            OrderItem orderItemUpdate = new OrderItem();
+            orderItemUpdate.setReturnQty(orderItemForUpdate.getReturnQty().subtract(outReturnItemForUpdate.getItemQty()).add(outReturnItemVO.getItemQty()))
+                    .setReturnAmt(orderItemForUpdate.getReturnAmt().subtract(outReturnItemForUpdate.getItemAmt()).add(outReturnItemVO.getItemAmt()))
+                    .setItemId(orderItemForUpdate.getItemId());
+            orderItemService.updateByUuid(orderItemUpdate);
+
+            // 更新退货明细
+            OutReturnItem outReturnItem = outReturnItemConvert.convertToPo(outReturnItemVO);
+            outReturnItemService.updateByUuid(outReturnItem);
+        }
+
+        // 可能有多个出库单,所以要循环更新总单
+        for (String outId : outIdList) {
+            // 计算出库明细的退货数量,金额合计
+            List<OutboundItem> outboundItemList = outboundItemMapper.selectByZIdForUpdate(outId);
+            OutboundItem outboundItem = outboundItemList.stream().reduce((x, y) -> {
+                OutboundItem item = new OutboundItem();
+                item.setReturnQty(x.getReturnQty().add(y.getReturnQty()));
+                item.setReturnAmt(x.getReturnAmt().add(y.getReturnAmt()));
+                return item;
+            }).get();
+            // 更新订单上的出库中数量,金额
+            Outbound outboundUpdate = new Outbound();
+            outboundUpdate.setReturnQty(outboundItem.getReturnQty()).setReturnAmt(outboundItem.getReturnAmt()).setOutId(outId);
+            outboundService.updateByUuid(outboundUpdate);
+        }
+
+        // 计算订单明细的退货数量,金额合计
+        List<OrderItem> orderItemList = orderItemMapper.selectByZIdForUpdate(outReturnVO.getOrderId());
+        OrderItem orderItem = orderItemList.stream().reduce((x, y) -> {
+            OrderItem item = new OrderItem();
+            item.setReturnQty(x.getReturnQty().add(y.getReturnQty()));
+            item.setReturnAmt(x.getReturnAmt().add(y.getReturnAmt()));
+            return item;
+        }).get();
+        // 更新订单上的出库中数量,金额
+        Order orderUpdate = new Order();
+        orderUpdate.setReturnQty(orderItem.getReturnQty()).setReturnAmt(orderItem.getReturnAmt()).setOrderId(outReturnVO.getOrderId());
+        orderService.updateByUuid(orderUpdate);
+
+        // 转化实体、更新退货单总表
+        OutReturn outReturn = outReturnConvert.convertToPo(outReturnVO);
+        return ResponseResultUtil.success(super.update(outReturn, new UpdateWrapper<OutReturn>().lambda().eq(OutReturn::getReturnId,
+                UUID.fromString(outReturn.getReturnId()))));
+    }
+
+    /**
      * @desc : 作废
      * @author : 付斌
      * @date : 2024-03-08 16:38
@@ -223,7 +320,7 @@ public class OutReturnService extends BaseService<OutReturn> {
     public ResponseResultVO<?> invalid(String id) {
         OutReturn outReturnForUpdate = outReturnMapper.selectByIdForUpdate(id);
         // 并发校验
-        if(!outReturnForUpdate.getFlgValid()){
+        if (!outReturnForUpdate.getFlgValid()) {
             throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.ISFLGVALID_FALSE.getMessage());
         }
 
@@ -236,21 +333,27 @@ public class OutReturnService extends BaseService<OutReturn> {
         List<OutReturnItem> outReturnItemList = outReturnItemMapper.selectByZIdForUpdate(id);
         OutboundItem outboundItemForUpdate;
         OrderItem orderItemForUpdate;
-        String outId = "";
         String orderId = "";
+
+        // 出库IdList,一个退货单可能有多个出库单
+        List<String> outIdList = new ArrayList<>();
         for (OutReturnItem outReturnItemForUpdate : outReturnItemList) {
-            outId = outReturnItemForUpdate.getOutId();
+            // 把出库Id存起来
+            if (!outIdList.contains(outReturnItemForUpdate.getOutId())) {
+                outIdList.add(outReturnItemForUpdate.getOutId());
+            }
             orderId = outReturnItemForUpdate.getOrderId();
-            outboundItemForUpdate = outboundItemMapper.selectByIdForUpdate(outReturnItemForUpdate.getOutItemId());
+
             // 更新出库明细退货数量
+            outboundItemForUpdate = outboundItemMapper.selectByIdForUpdate(outReturnItemForUpdate.getOutItemId());
             OutboundItem outboundItemUpdate = new OutboundItem();
             outboundItemUpdate.setReturnQty(outboundItemForUpdate.getReturnQty().subtract(outReturnItemForUpdate.getItemQty()))
                     .setReturnAmt(outboundItemForUpdate.getReturnAmt().subtract(outReturnItemForUpdate.getItemAmt()))
                     .setItemId(outboundItemForUpdate.getItemId());
             outboundItemService.updateByUuid(outboundItemUpdate);
 
-            orderItemForUpdate = orderItemMapper.selectByIdForUpdate(outReturnItemForUpdate.getOrderItemId());
             // 更新订单明细退货数量
+            orderItemForUpdate = orderItemMapper.selectByIdForUpdate(outReturnItemForUpdate.getOrderItemId());
             OrderItem orderItemUpdate = new OrderItem();
             orderItemUpdate.setReturnQty(orderItemForUpdate.getReturnQty().subtract(outReturnItemForUpdate.getItemQty()))
                     .setReturnAmt(orderItemForUpdate.getReturnAmt().subtract(outReturnItemForUpdate.getItemAmt()))
@@ -258,18 +361,21 @@ public class OutReturnService extends BaseService<OutReturn> {
             orderItemService.updateByUuid(orderItemUpdate);
         }
 
-        // 计算出库明细的退货数量,金额合计
-        List<OutboundItem> outboundItemList = outboundItemMapper.selectByZIdForUpdate(outId);
-        OutboundItem outboundItem = outboundItemList.stream().reduce((x, y) -> {
-            OutboundItem item = new OutboundItem();
-            item.setReturnQty(x.getReturnQty().add(y.getReturnQty()));
-            item.setReturnAmt(x.getReturnAmt().add(y.getReturnAmt()));
-            return item;
-        }).get();
-        // 更新出库单上的退货数量,金额
-        Outbound outboundUpdate = new Outbound();
-        outboundUpdate.setReturnQty(outboundItem.getReturnQty()).setReturnAmt(outboundItem.getReturnAmt()).setOutId(outId);
-        outboundService.updateByUuid(outboundUpdate);
+        // 可能有多个出库单,所以要循环更新总单
+        for (String outId : outIdList) {
+            // 计算出库明细的退货数量,金额合计
+            List<OutboundItem> outboundItemList = outboundItemMapper.selectByZIdForUpdate(outId);
+            OutboundItem outboundItem = outboundItemList.stream().reduce((x, y) -> {
+                OutboundItem item = new OutboundItem();
+                item.setReturnQty(x.getReturnQty().add(y.getReturnQty()));
+                item.setReturnAmt(x.getReturnAmt().add(y.getReturnAmt()));
+                return item;
+            }).get();
+            // 更新出库单上的退货数量,金额
+            Outbound outboundUpdate = new Outbound();
+            outboundUpdate.setReturnQty(outboundItem.getReturnQty()).setReturnAmt(outboundItem.getReturnAmt()).setOutId(outId);
+            outboundService.updateByUuid(outboundUpdate);
+        }
 
         // 计算订单明细的退货数量,金额合计
         List<OrderItem> orderItemList = orderItemMapper.selectByZIdForUpdate(orderId);
@@ -298,13 +404,13 @@ public class OutReturnService extends BaseService<OutReturn> {
      * @date : 2024-03-02 17:27
      */
     public ResponseResultVO<?> getOutReturnForUpdate(String id) {
-        Map<String, Object> outReturnInfo = new HashMap<>();
+        Map<String, Object> dataInfo = new HashMap<>();
         OutReturnResponse outReturnResponse = outReturnMapper.selectById(id);
-        outReturnInfo.put("outReturn", outReturnResponse);
+        dataInfo.put("data", outReturnResponse);
 
         // 商品明细
         List<OutReturnItemResponse> outReturnItemResponseList = outReturnItemMapper.selectByCondForReturnEdit(id);
-        outReturnInfo.put("outReturnItem", outReturnItemResponseList);
-        return ResponseResultUtil.success(outReturnInfo);
+        dataInfo.put("dataItem", outReturnItemResponseList);
+        return ResponseResultUtil.success(dataInfo);
     }
 }