Ver Fonte

入库+组织机构,员工通用

koushanshan há 2 anos atrás
pai
commit
d31decfe2d

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

@@ -568,34 +568,6 @@ public class CommonController extends BaseController<Map<String, Object>> {
     }
     }
 
 
     /**
     /**
-     * @desc   : 查询用户,组织机构(目前用于入库负责人)
-     * @date   : 2024/3/13 16:21
-     * @author : 寇珊珊
-     */
-    @ApiOperation(
-            value = "查询用户,组织机构(目前用于入库负责人)",
-            notes = "查询用户,组织机构(目前用于入库负责人)"
-    )
-    @PostMapping("get_user")
-    public ResponseResultVO<List<Map<String, Object>>> getUser(@RequestBody Map<String, Object> param) {
-        return commonService.getUser(param);
-    }
-
-    /**
-     * @desc   : 查询用户,组织机构(目前用于入库负责人) (分页)
-     * @date   : 2024/3/13 16:22
-     * @author : 寇珊珊
-     */
-    @ApiOperation(
-            value = " 查询用户,组织机构(目前用于入库负责人)(分页)",
-            notes = " 查询用户,组织机构(目前用于入库负责人)(分页)"
-    )
-    @PostMapping("get_user_by_page")
-    public ResponseResultVO<PageList<Map<String, Object>>> getUserByPage(@RequestBody Map<String, Object> param) {
-        return commonService.getUserByPage(param);
-    }
-
-    /**
      * @desc   : 获取组织机构
      * @desc   : 获取组织机构
      * @date   : 2024/3/13 16:48
      * @date   : 2024/3/13 16:48
      * @author : 寇珊珊
      * @author : 寇珊珊

+ 1 - 1
src/main/java/com/dk/mdm/controller/ivt/InboundPurchaseController.java

@@ -75,7 +75,7 @@ public class InboundPurchaseController {
             notes = "采购入库办理"
             notes = "采购入库办理"
     )
     )
     @PostMapping({"purchase_handle_inbound"})
     @PostMapping({"purchase_handle_inbound"})
-    public ResponseResultVO<?> purchaseHandleInbound(@RequestBody InboundVO inboundVO) {
+    public ResponseResultVO<?> purchaseHandleInbound(@Valid @RequestBody InboundVO inboundVO) {
         return inheritedPurchaseService.purchaseHandleInbound(inboundVO);
         return inheritedPurchaseService.purchaseHandleInbound(inboundVO);
     }
     }
 
 

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

@@ -365,7 +365,6 @@ public interface CommonMapper extends BaseMapper<Map<String, Object>> {
     Long getInventoryCountByPage(Map param);
     Long getInventoryCountByPage(Map param);
 
 
     List<Map<String, Object>> getSaleChannel(Map param);
     List<Map<String, Object>> getSaleChannel(Map param);
-    List<Map<String, Object>> getStaff(Map param);
 
 
 
 
     /**
     /**
@@ -390,25 +389,12 @@ public interface CommonMapper extends BaseMapper<Map<String, Object>> {
     Long getSupplierAndCustomerByPageCount(Map param);
     Long getSupplierAndCustomerByPageCount(Map param);
 
 
     /**
     /**
-     * @desc   : 获取供应商和客户数据
+     * @desc   : 获取员工
      * @date   : 2024/3/13 16:24
      * @date   : 2024/3/13 16:24
      * @author : 寇珊珊
      * @author : 寇珊珊
      */
      */
-    List<Map<String, Object>> getUser(Map param);
-
-    /**
-     * @desc   : 获取供应商和客户数据(分页)
-     * @date   : 2024/3/13 16:24
-     * @author : 寇珊珊
-     */
-    List<Map<String, Object>> getUserByPage(Map param);
+    List<Map<String, Object>> getStaff(Map param);
 
 
-    /**
-     * @desc   : 获取供应商和客户数据个数
-     * @date   : 2024/3/13 16:25
-     * @author : 寇珊珊
-     */
-    Long getUserCount(Map<String, Object> param);
 
 
     /**
     /**
      * @desc   : 获取组织机构
      * @desc   : 获取组织机构

+ 18 - 76
src/main/java/com/dk/mdm/mapper/common/CommonMapper.xml

@@ -962,20 +962,6 @@
             </if>
             </if>
         </where>
         </where>
     </select>
     </select>
-    <!--获取员工-->
-    <select id="getStaff" resultType="java.util.Map">
-        SELECT
-        staff_id AS "staffId",
-        staff_id AS "id",
-        staff_code AS "staffCode",
-        staff_name AS "staffName"
-        FROM dkic_b.t_mst_staff
-        <where>
-            <if test="cpId != null">
-                AND cp_id = #{cpId}
-            </if>
-        </where>
-    </select>
     <!--获取仓库档案-->
     <!--获取仓库档案-->
 
 
 
 
@@ -1125,75 +1111,29 @@
 
 
 
 
     <!-- 获取用户 -->
     <!-- 获取用户 -->
-    <select id="getUser" resultType="java.util.Map">
-        select u.user_name as "userName"
-        , u.user_code as "userCode"
-        , u.user_id as "userId"
-        , u.org_id as "orgId"
-        , o.org_name as "orgName"
-        , c.cp_name as "cpName"
-        from core.t_dk_user u
-        left join dkic_b.t_mst_org o on o.org_id = u.org_id
-        left join dkic_a.t_a_company c on c.cp_id = o.sale2_id
-        where
-        u.cp_id = #{cpId}
-        <if test="userCode !=null and userCode !=''">
-            AND u.user_code LIKE concat('%',my_ex.likequery(#{userCode}),'%')
-        </if>
-        <if test="userName !=null and userName !=''">
-            AND u.user_name LIKE concat('%',my_ex.likequery(#{userName}),'%')
-        </if>
-        <if test="orgId !=null">
-            AND u.org_id = #{orgId}
-        </if>
-        <if test="orgName !=null and orgName !=''">
-            AND o.org_name LIKE concat('%',my_ex.likequery(#{orgName}),'%')
-        </if>
-    </select>
-
-    <!-- 获取用户分页 -->
-    <select id="getUserByPage" resultType="java.util.Map">
-        select u.user_name as "userName"
-        , u.user_code as "userCode"
-        , u.user_id as "userId"
-        , u.org_id as "orgId"
+    <select id="getStaff" resultType="java.util.Map">
+        select
+          s.staff_name as "staffName"
+        , s.staff_code as "staffCode"
+        , sys.f_code_name(s.staff_code, s.staff_name) AS "staffCodeName",
+        , s.staff_id as "staffId"
+        , s.staff_id AS "id",
+        , s.org_id as "orgId"
         , o.org_name as "orgName"
         , o.org_name as "orgName"
         , c.cp_name as "cpName"
         , c.cp_name as "cpName"
-        from core.t_dk_user u
-        left join dkic_b.t_mst_org o on o.org_id = u.org_id
-        left join dkic_a.t_a_company c on c.cp_id = o.sale2_id
-        where
-        u.cp_id = #{cpId}
-        <if test="userCode !=null and userCode !=''">
-            AND u.user_code LIKE concat('%',my_ex.likequery(#{userCode}),'%')
-        </if>
-        <if test="userName !=null and userName !=''">
-            AND u.user_name LIKE concat('%',my_ex.likequery(#{userName}),'%')
-        </if>
-        <if test="orgId !=null">
-            AND u.org_id = #{orgId}
-        </if>
-        <if test="orgName !=null and orgName !=''">
-            AND o.org_name LIKE concat('%',my_ex.likequery(#{orgName}),'%')
-        </if>
-    </select>
-
-    <!-- 获取用户分页个数-->
-    <select id="getUserCount" resultType="java.lang.Long">
-        select count(1)
-        from core.t_dk_user u
-        left join dkic_b.t_mst_org o on o.org_id = u.org_id
-        left join dkic_a.t_a_company c on c.cp_id = o.sale2_id
+        FROM dkic_b.t_mst_staff s
+        left join dkic_b.t_mst_org o on o.org_id = s.org_id
+        left join dkic_a.t_a_company c on c.cp_id = s.cp_id
         where
         where
         u.cp_id = #{cpId}
         u.cp_id = #{cpId}
-        <if test="userCode !=null and userCode !=''">
-            AND u.user_code LIKE concat('%',my_ex.likequery(#{userCode}),'%')
+        <if test="staffCode !=null and staffCode !=''">
+            AND s.staff_code LIKE concat('%',my_ex.likequery(#{staffCode}),'%')
         </if>
         </if>
-        <if test="userName !=null and userName !=''">
-            AND u.user_name LIKE concat('%',my_ex.likequery(#{userName}),'%')
+        <if test="staffName !=null and staffName !=''">
+            AND s.staff_name LIKE concat('%',my_ex.likequery(#{staffName}),'%')
         </if>
         </if>
         <if test="orgId !=null">
         <if test="orgId !=null">
-            AND u.org_id = #{orgId}
+            AND s.org_id = #{orgId}
         </if>
         </if>
         <if test="orgName !=null and orgName !=''">
         <if test="orgName !=null and orgName !=''">
             AND o.org_name LIKE concat('%',my_ex.likequery(#{orgName}),'%')
             AND o.org_name LIKE concat('%',my_ex.likequery(#{orgName}),'%')
@@ -1206,6 +1146,7 @@
         select o.org_id as "orgId"
         select o.org_id as "orgId"
         , o.org_code as "orgCode"
         , o.org_code as "orgCode"
         , o.org_name as "orgName"
         , o.org_name as "orgName"
+        , sys.f_code_name(o.org_code, o.org_name) AS "orgCodeName"
         from dkic_b.t_mst_org o
         from dkic_b.t_mst_org o
         where
         where
         o.flg_valid
         o.flg_valid
@@ -1223,6 +1164,7 @@
         select o.org_id as "orgId"
         select o.org_id as "orgId"
         , o.org_code as "orgCode"
         , o.org_code as "orgCode"
         , o.org_name as "orgName"
         , o.org_name as "orgName"
+        , sys.f_code_name(o.org_code, o.org_name) AS "orgCodeName"
         from dkic_b.t_mst_org o
         from dkic_b.t_mst_org o
         where
         where
         o.flg_valid
         o.flg_valid

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

@@ -26,7 +26,7 @@
 
 
     <!-- 通用查询映射结果 -->
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.dk.mdm.model.pojo.ivt.Inbound">
     <resultMap id="BaseResultMap" type="com.dk.mdm.model.pojo.ivt.Inbound">
-        <id column="into_id" property="intoId"/>
+        <id column="into_id" property="intoId" typeHandler="UuidTypeHandler"/>
         <result column="into_no" property="intoNo"/>
         <result column="into_no" property="intoNo"/>
         <result column="into_type" property="intoType"/>
         <result column="into_type" property="intoType"/>
         <result column="from_id" property="fromId" typeHandler="UuidTypeHandler"/>
         <result column="from_id" property="fromId" typeHandler="UuidTypeHandler"/>
@@ -62,7 +62,7 @@
 
 
     <!-- response查询映射结果 -->
     <!-- response查询映射结果 -->
     <resultMap id="BaseResultMapResponse" type="com.dk.mdm.model.response.ivt.InboundResponse">
     <resultMap id="BaseResultMapResponse" type="com.dk.mdm.model.response.ivt.InboundResponse">
-        <id column="into_id" property="intoId"/>
+        <id column="into_id" property="intoId" typeHandler="UuidTypeHandler"/>
         <result column="into_no" property="intoNo"/>
         <result column="into_no" property="intoNo"/>
         <result column="into_type" property="intoType"/>
         <result column="into_type" property="intoType"/>
         <result column="from_id" property="fromId" typeHandler="UuidTypeHandler"/>
         <result column="from_id" property="fromId" typeHandler="UuidTypeHandler"/>
@@ -100,7 +100,7 @@
     </sql>
     </sql>
     <!-- response明细关联明细映射-->
     <!-- response明细关联明细映射-->
     <resultMap id="BaseResultMapItemResponse" type="com.dk.mdm.model.response.ivt.InboundResponse">
     <resultMap id="BaseResultMapItemResponse" type="com.dk.mdm.model.response.ivt.InboundResponse">
-        <id column="into_id" property="intoId"/>
+        <id column="into_id" property="intoId" typeHandler="UuidTypeHandler"/>
         <result column="into_no" property="intoNo"/>
         <result column="into_no" property="intoNo"/>
         <result column="into_type" property="intoType"/>
         <result column="into_type" property="intoType"/>
         <result column="from_id" property="fromId" typeHandler="UuidTypeHandler"/>
         <result column="from_id" property="fromId" typeHandler="UuidTypeHandler"/>

+ 0 - 34
src/main/java/com/dk/mdm/service/common/CommonService.java

@@ -786,40 +786,6 @@ public class CommonService extends BaseService<Map<String, Object>> {
 
 
 
 
     /**
     /**
-     * @desc   : 查询用户,组织机构(目前用于入库负责人)
-     * @date   : 2024/3/13 16:24
-     * @author : 寇珊珊
-     */
-    public ResponseResultVO<List<Map<String, Object>>> getUser(Map<String, Object> param) {
-        List<Map<String, Object>> list = commonMapper.getUser(param);
-        return ResponseResultUtil.success(list);
-    }
-
-
-    /**
-     * @desc   : 查询用户,组织机构(目前用于入库负责人) (分页)
-     * @date   : 2024/3/13 16:24
-     * @author : 寇珊珊
-     */
-    public ResponseResultVO<PageList<Map<String, Object>>> getUserByPage(Map<String, Object> param) {
-        // 校验分页参数
-        if (param.get("pageSize") == null || param.get("currentPage") == null) {
-            return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
-        }
-        // 定义返回值
-        PageList<Map<String, Object>> data = new PageList<>();
-        // 分页参数赋值
-        param = this.getLimit(param);
-        // 获取用户
-        List<Map<String, Object>> list = commonMapper.getUserByPage(param);
-        // 获取总数量
-        Long total = commonMapper.getUserCount(param);
-        // 组装返回值
-        data.setPageSize((int) param.get("pageSize")).setCurrentPage((int) param.get("currentPage")).setList(list).setTotal(total);
-        return ResponseResultUtil.success(data);
-    }
-
-    /**
      * @desc   : 获取组织机构
      * @desc   : 获取组织机构
      * @date   : 2024/3/13 17:01
      * @date   : 2024/3/13 17:01
      * @author : 寇珊珊
      * @author : 寇珊珊

+ 0 - 1
src/main/java/com/dk/mdm/service/ivt/InboundPurchaseService.java

@@ -45,7 +45,6 @@ import java.util.Map;
  * @author : 寇珊珊
  * @author : 寇珊珊
  */
  */
 @Service
 @Service
-@Transactional
 public class InboundPurchaseService extends BaseService<Inbound> {
 public class InboundPurchaseService extends BaseService<Inbound> {
 
 
 	@Override
 	@Override