Jelajahi Sumber

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

koushanshan 2 tahun lalu
induk
melakukan
2eab08b4c7

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

@@ -452,6 +452,18 @@ public class CommonController extends BaseController<Map<String, Object>> {
     }
     }
 
 
     /**
     /**
+     * @desc :  商品种类查询
+     * @author : 于继渤
+     * @date : 2024/2/26 10:36
+     */
+    @ApiOperation(value = "分页、关联、条件查询", notes = "分页、关联、条件查询")
+    @PostMapping({"get_goods_category_no_page"})
+    public ResponseResultVO<List<Map<String, Object>>> getGoodsCategoryNoPage(@RequestBody Map<String, Object> param) {
+        return commonService.getGoodsCategoryNoPage(param);
+    }
+
+
+    /**
      * @desc :  计量单位查询
      * @desc :  计量单位查询
      * @author : 王英杰
      * @author : 王英杰
      * @date : 2024/2/26 10:36
      * @date : 2024/2/26 10:36

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

@@ -10,12 +10,15 @@ import com.dk.mdm.model.response.ivt.InboundResponse;
 import com.dk.mdm.model.response.pur.PurchaseResponse;
 import com.dk.mdm.model.response.pur.PurchaseResponse;
 import com.dk.mdm.model.vo.ivt.InboundVO;
 import com.dk.mdm.model.vo.ivt.InboundVO;
 import com.dk.mdm.model.vo.ivt.OutboundVO;
 import com.dk.mdm.model.vo.ivt.OutboundVO;
+import com.dk.mdm.service.ivt.InboundPurchaseService;
 import com.dk.mdm.service.ivt.InboundService;
 import com.dk.mdm.service.ivt.InboundService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
+import javax.validation.Valid;
+
 
 
 @Api(tags = "入库单API接口")
 @Api(tags = "入库单API接口")
 @RestController
 @RestController
@@ -30,6 +33,8 @@ public class InboundController{
     private InboundService inboundService;
     private InboundService inboundService;
 
 
 
 
+    @Autowired
+    private InboundPurchaseService inheritedPurchaseService;
 
 
     /**
     /**
      * @desc   : 条件查询
      * @desc   : 条件查询
@@ -41,7 +46,7 @@ public class InboundController{
             notes = "分页、关联、条件查询"
             notes = "分页、关联、条件查询"
     )
     )
     @PostMapping({"list_by"})
     @PostMapping({"list_by"})
-    public ResponseResultVO<PageList<PurchaseResponse>> selectByCond(@RequestBody InboundQuery inboundQuery) {
+    public ResponseResultVO<PageList<InboundResponse>> selectByCond(@RequestBody InboundQuery inboundQuery) {
         return inboundService.selectByCond(inboundQuery);
         return inboundService.selectByCond(inboundQuery);
     }
     }
 
 
@@ -77,5 +82,18 @@ public class InboundController{
         return inboundService.insert(inboundVO);
         return inboundService.insert(inboundVO);
     }
     }
 
 
+    /**
+     * @desc   : 采购入库新建
+     * @date   : 2024/3/7 14:00
+     * @author : 王英杰
+     */
+    @ApiOperation(
+            value = "采购入库新建",
+            notes = "采购入库新建"
+    )
+    @PostMapping({"purchase_inbound_insert"})
+    public ResponseResultVO<?> purchaseInboundInsert(@Valid @RequestBody InboundVO inboundVO) {
+        return inheritedPurchaseService.purchaseInboundInsert(inboundVO);
+    }
 
 
 }
 }

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

@@ -115,7 +115,7 @@ public class StaffController {
     @ApiOperation(value = "新建员工", notes = "新建员工")
     @ApiOperation(value = "新建员工", notes = "新建员工")
     @PostMapping({"insert_feign_staff"})
     @PostMapping({"insert_feign_staff"})
     public ResponseResultVO<?> insertFeignStaff(@RequestBody StaffVO staffVO) {
     public ResponseResultVO<?> insertFeignStaff(@RequestBody StaffVO staffVO) {
-        return staffService.insert(staffVO);
+        return staffService.insertFeignStaff(staffVO);
     }
     }
 
 
     /**
     /**

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

@@ -95,7 +95,7 @@ public class PurchaseController{
         return purchaseService.update(Purchasevo);
         return purchaseService.update(Purchasevo);
     }
     }
     /**
     /**
-     * @desc   : 采购订单 转 采购入库
+     * @desc   : 采购订单 转 采购入库   (目前废弃)
      * @author : 王英杰
      * @author : 王英杰
      * @date   : 2024年3月11日
      * @date   : 2024年3月11日
      */
      */

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

@@ -54,7 +54,7 @@ public interface InboundMapper extends BaseMapper<Inbound>{
      * @author : 王英杰
      * @author : 王英杰
      * @date   : 2024/3/8 10:58
      * @date   : 2024/3/8 10:58
      */
      */
-    List<PurchaseResponse> selectByCond(InboundQuery inboundQuery);
+    List<InboundResponse> selectByCond(InboundQuery inboundQuery);
 
 
     /**
     /**
      * @desc   : 条件查询个数 (采购入库用)
      * @desc   : 条件查询个数 (采购入库用)

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

@@ -168,7 +168,7 @@
             <if test="followStatus != null and followStatus != ''">
             <if test="followStatus != null and followStatus != ''">
                 AND tccf.follow_status = #{followStatus}
                 AND tccf.follow_status = #{followStatus}
             </if>
             </if>
-      
+
             <if test="followOrg != null and followOrg != ''">
             <if test="followOrg != null and followOrg != ''">
                 AND tccf.follow_org = #{followOrg}
                 AND tccf.follow_org = #{followOrg}
             </if>
             </if>

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

@@ -81,7 +81,7 @@
                 AND tmgs.brand_id = #{brandId}
                 AND tmgs.brand_id = #{brandId}
             </if>
             </if>
             <if test="categoryId != null and categoryId != ''">
             <if test="categoryId != null and categoryId != ''">
-                AND tmgs.category_id = #{categoryId}
+                AND tmgs.category_id = #{categoryId}::uuid
             </if>
             </if>
             <if test="unitId != null and unitId != ''">
             <if test="unitId != null and unitId != ''">
                 AND tmgs.unit_id = #{unitId}
                 AND tmgs.unit_id = #{unitId}

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

@@ -142,6 +142,7 @@
     <resultMap id="purchaseItemListMap" type="java.util.Map">
     <resultMap id="purchaseItemListMap" type="java.util.Map">
         <id column="item_id" property="itemId"/>
         <id column="item_id" property="itemId"/>
         <result column="pur_id" property="purId" typeHandler="UuidTypeHandler"/>
         <result column="pur_id" property="purId" typeHandler="UuidTypeHandler"/>
+        <result column="pur_no" property="purNo"/>
         <result column="item_index" property="itemIndex"/>
         <result column="item_index" property="itemIndex"/>
         <result column="sku_id" property="skuId" typeHandler="UuidTypeHandler"/>
         <result column="sku_id" property="skuId" typeHandler="UuidTypeHandler"/>
         <result column="item_qty" property="itemQty"/>
         <result column="item_qty" property="itemQty"/>
@@ -456,6 +457,7 @@
     <sql id="Base_Column_List_Item_Response_Join">
     <sql id="Base_Column_List_Item_Response_Join">
         ,tppi.item_id  as "List_item_id",
         ,tppi.item_id  as "List_item_id",
         tppi.pur_id  as "List_pur_id",
         tppi.pur_id  as "List_pur_id",
+        tpp.pur_no as "List_pur_no",
         tppi.item_index as "List_item_index",
         tppi.item_index as "List_item_index",
         tppi.sku_id as "List_sku_id",
         tppi.sku_id as "List_sku_id",
         tppi.item_qty as "List_item_qty",
         tppi.item_qty as "List_item_qty",

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

@@ -66,6 +66,27 @@ public class CommonService extends BaseService<Map<String, Object>> {
     }
     }
 
 
     /**
     /**
+     * @desc : 获取编码/单号
+     * @author : 周兴
+     * @date : 2024/3/1 11:41
+     */
+    public Map<String, Object> getUniqueNoteCode(String docName, Integer cpId, Boolean codeFlag) {
+        Map<String, Object> param = new HashMap<>();
+        param.put("docName", docName);
+        // 公司Id
+//        StaffEntity staff = authUtils.getStaff();
+        param.put("cpId", cpId);
+        Map<String, Object> map = null;
+        // 获取系统基础数据
+        if (codeFlag) {
+            map = commonMapper.getUniqueCode(param);
+        } else {
+            map = commonMapper.getUniqueNote(param);
+        }
+        return map;
+    }
+
+    /**
      * @desc : 登录后获取信息
      * @desc : 登录后获取信息
      * @author : 周兴
      * @author : 周兴
      * @date : 2024/3/4 11:41
      * @date : 2024/3/4 11:41
@@ -648,8 +669,15 @@ public class CommonService extends BaseService<Map<String, Object>> {
                 commonMapper.getInventoryCountByPage(param));
                 commonMapper.getInventoryCountByPage(param));
     }
     }
 
 
-
-
+    /**
+     * @desc :  商品种类查询
+     * @author : 于继渤
+     * @date : 2024/2/26 10:36
+     */
+    public ResponseResultVO<List<Map<String, Object>>> getGoodsCategoryNoPage(Map<String, Object> param) {
+        List<Map<String, Object>> list = commonMapper.getGoodsCategory(param);
+        return ResponseResultUtil.success(list);
+    }
     /**
     /**
      * @desc : 获取页面数据源集合 (小程序用)
      * @desc : 获取页面数据源集合 (小程序用)
      * @author : 于继渤
      * @author : 于继渤

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

@@ -59,7 +59,7 @@ public class InboundService extends BaseService<Inbound> {
 	 * @date   : 2024/3/8 10:58
 	 * @date   : 2024/3/8 10:58
 	 */
 	 */
 	@Pagination
 	@Pagination
-	public ResponseResultVO<PageList<PurchaseResponse>> selectByCond(InboundQuery inboundQuery) {
+	public ResponseResultVO<PageList<InboundResponse>> selectByCond(InboundQuery inboundQuery) {
 		return super.mergeListWithCount(inboundQuery, inboundMapper.selectByCond(inboundQuery), inboundMapper.countByCond(inboundQuery));
 		return super.mergeListWithCount(inboundQuery, inboundMapper.selectByCond(inboundQuery), inboundMapper.countByCond(inboundQuery));
 	}
 	}
 
 

+ 6 - 19
src/main/java/com/dk/mdm/service/mst/OrgService.java

@@ -72,7 +72,7 @@ public class OrgService extends BaseService<Org> {
         // 获取编码和主键UuId
         // 获取编码和主键UuId
         organization.setDisplayNo(displayNo);
         organization.setDisplayNo(displayNo);
         organization.setOrgId(codeMap.get("outId").toString());
         organization.setOrgId(codeMap.get("outId").toString());
-//        organization.setOrgCode(codeMap.get("outNote").toString());
+        organization.setOrgCode(codeMap.get("outNote").toString());
 
 
         //查询 本次要加的 部门的 父级下 最大的DisplayNo  然后加1  就是现在要加的DisplayNo
         //查询 本次要加的 部门的 父级下 最大的DisplayNo  然后加1  就是现在要加的DisplayNo
         Map<String, Object> param = new HashMap<>();
         Map<String, Object> param = new HashMap<>();
@@ -105,29 +105,16 @@ public class OrgService extends BaseService<Org> {
         // 转化实体
         // 转化实体
         Org organization = orgConvert.convertToPo(orgVO);
         Org organization = orgConvert.convertToPo(orgVO);
         // 获取显示顺序
         // 获取显示顺序
-//        Integer displayNo = commonService.getMaxDisplayNo(Constant.DisplayNoTable.ORG);
-        Map<String, Object> codeMap = commonService.getUniqueNoteCode(Constant.docNameConstant.ORG.getName(), true);
+        Map<String, Object> codeMap = commonService.getUniqueNoteCode(
+                Constant.docNameConstant.ORG.getName(),orgVO.getCpId(), true);
         // 获取编码和主键UuId
         // 获取编码和主键UuId
         organization.setDisplayNo(0);
         organization.setDisplayNo(0);
         organization.setOrgId(codeMap.get("outId").toString());
         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());
-        }
-
-
+        organization.setOrgCode(codeMap.get("outNote").toString());
         // 插入组织部门数据
         // 插入组织部门数据
         super.insert(organization);
         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);
+        // orgMapper.resetLevelOrg(new Org().setTopId(organization.getParentId()).setCpId(organization.getCpId()));
+        return ResponseResultUtil.success(organization);
     }
     }
 }
 }

+ 36 - 6
src/main/java/com/dk/mdm/service/mst/StaffService.java

@@ -100,14 +100,43 @@ public class StaffService extends BaseService<Staff> {
         staffQuery.setCpId(staff.getCpId());
         staffQuery.setCpId(staff.getCpId());
         staffQuery.setStaffPhone(staff.getStaffPhone());
         staffQuery.setStaffPhone(staff.getStaffPhone());
         List<StaffResponse> staffResponses = staffMapper.selectByCond(staffQuery);
         List<StaffResponse> staffResponses = staffMapper.selectByCond(staffQuery);
-        if (staffResponses!=null && staffResponses.size() > 0){
+        if (staffResponses != null && staffResponses.size() > 0) {
             return ResponseResultUtil.error(ResponseCodeEnum.ERROR_STAFF_PHONE_EXIST);
             return ResponseResultUtil.error(ResponseCodeEnum.ERROR_STAFF_PHONE_EXIST);
         }
         }
         // 获取编码和主键UuId
         // 获取编码和主键UuId
         Map<String, Object> codeMap = commonService.getUniqueNoteCode(Constant.docNameConstant.STAFF.getName(), true);
         Map<String, Object> codeMap = commonService.getUniqueNoteCode(Constant.docNameConstant.STAFF.getName(), true);
         staff.setStaffId(codeMap.get("outId").toString());
         staff.setStaffId(codeMap.get("outId").toString());
         staff.setStaffCode(codeMap.get("outNote").toString());
         staff.setStaffCode(codeMap.get("outNote").toString());
-        return super.insert(staff);
+        super.insert(staff);
+        return ResponseResultUtil.success(staff);
+    }
+
+    /**
+     * @desc : 保存方法
+     * @author : 姜永辉
+     * @date : 2023/1/9 10:49
+     */
+    @Transactional(
+            rollbackFor = {Exception.class}
+    )
+    public ResponseResultVO<?> insertFeignStaff(StaffVO staffVO) {
+        // 转化实体
+        Staff staff = staffConvert.convertToPo(staffVO);
+        // 校验同一个公司的电话不能重复
+        StaffQuery staffQuery = new StaffQuery();
+        staffQuery.setCpId(staff.getCpId());
+        staffQuery.setStaffPhone(staff.getStaffPhone());
+        List<StaffResponse> staffResponses = staffMapper.selectByCond(staffQuery);
+        if (staffResponses != null && staffResponses.size() > 0) {
+            return ResponseResultUtil.error(ResponseCodeEnum.ERROR_STAFF_PHONE_EXIST);
+        }
+        // 获取编码和主键UuId
+        Map<String, Object> codeMap = commonService.getUniqueNoteCode(
+                Constant.docNameConstant.STAFF.getName(), staff.getCpId(), true);
+        staff.setStaffId(codeMap.get("outId").toString());
+        staff.setStaffCode(codeMap.get("outNote").toString());
+        super.insert(staff);
+        return ResponseResultUtil.success(staff);
     }
     }
 
 
     /**
     /**
@@ -115,7 +144,7 @@ public class StaffService extends BaseService<Staff> {
      * @author : 姜永辉
      * @author : 姜永辉
      * @date : 2023/1/9 10:49
      * @date : 2023/1/9 10:49
      */
      */
-    @Transactional( rollbackFor = {Exception.class} )
+    @Transactional(rollbackFor = {Exception.class})
     public ResponseResultVO<?> insertRequestStaff(StaffVO staffVO) {
     public ResponseResultVO<?> insertRequestStaff(StaffVO staffVO) {
         // 转化实体
         // 转化实体
         Staff staff = staffConvert.convertToPo(staffVO);
         Staff staff = staffConvert.convertToPo(staffVO);
@@ -124,7 +153,7 @@ public class StaffService extends BaseService<Staff> {
         staffQuery.setCpId(staff.getCpId());
         staffQuery.setCpId(staff.getCpId());
         staffQuery.setStaffPhone(staff.getStaffPhone());
         staffQuery.setStaffPhone(staff.getStaffPhone());
         List<StaffResponse> staffResponses = staffMapper.selectByCond(staffQuery);
         List<StaffResponse> staffResponses = staffMapper.selectByCond(staffQuery);
-        if (staffResponses!=null && staffResponses.size() > 0){
+        if (staffResponses != null && staffResponses.size() > 0) {
             return ResponseResultUtil.error(ResponseCodeEnum.ERROR_STAFF_PHONE_EXIST);
             return ResponseResultUtil.error(ResponseCodeEnum.ERROR_STAFF_PHONE_EXIST);
         }
         }
         // 获取编码和主键UuId
         // 获取编码和主键UuId
@@ -132,7 +161,7 @@ public class StaffService extends BaseService<Staff> {
         staff.setStaffId(codeMap.get("outId").toString());
         staff.setStaffId(codeMap.get("outId").toString());
         staff.setStaffCode(codeMap.get("outNote").toString());
         staff.setStaffCode(codeMap.get("outNote").toString());
         // 更新 被邀人员的cpid
         // 更新 被邀人员的cpid
-        if (staff.getWxUserId()!=null){
+        if (staff.getWxUserId() != null) {
             // 更新 被邀请人员的微信用户的cpid 加入公司
             // 更新 被邀请人员的微信用户的cpid 加入公司
             Map<String, Object> collectQuery = new HashMap<>();
             Map<String, Object> collectQuery = new HashMap<>();
             collectQuery.put("cpId", staff.getCpId());
             collectQuery.put("cpId", staff.getCpId());
@@ -140,7 +169,8 @@ public class StaffService extends BaseService<Staff> {
             companyFeign.updateWxUserCompany(collectQuery);
             companyFeign.updateWxUserCompany(collectQuery);
         }
         }
         // 插入员工
         // 插入员工
-        return super.insert(staff);
+        super.insert(staff);
+        return ResponseResultUtil.success(staff);
     }
     }
 
 
     /**
     /**

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

@@ -230,7 +230,7 @@ public class PurchaseService extends BaseService<Purchase> {
     }
     }
 
 
     /**
     /**
-     * @desc : 采购订单 转 采购入库
+     * @desc : 采购订单 转 采购入库   (目前废弃)
      * @author : 王英杰
      * @author : 王英杰
      * @date : 2024年3月11日
      * @date : 2024年3月11日
      */
      */
@@ -265,7 +265,7 @@ public class PurchaseService extends BaseService<Purchase> {
     }
     }
 
 
     /**
     /**
-     * @desc :  采购订单实体数据 转 入库单数据
+     * @desc :  采购订单实体数据 转 入库单数据 (目前废弃)
      * @author : 王英杰
      * @author : 王英杰
      * @date : 2024年3月11日
      * @date : 2024年3月11日
      */
      */
@@ -294,7 +294,7 @@ public class PurchaseService extends BaseService<Purchase> {
         return inboundVO;
         return inboundVO;
     }
     }
     /**
     /**
-     * @desc :  采购订单明细实体数据 转 入库单明细数据
+     * @desc :  采购订单明细实体数据 转 入库单明细数据 (目前废弃)
      * @author : 王英杰
      * @author : 王英杰
      * @date : 2024年3月11日
      * @date : 2024年3月11日
      */
      */