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

Merge remote-tracking branch 'origin/master'

dongke 1 год назад
Родитель
Сommit
e91881ecad

+ 11 - 1
src/main/java/com/dk/mdm/mapper/common/CommonMapper.xml

@@ -513,6 +513,11 @@
         <if test="categoryId != null">
             AND tmgs.category_id = #{categoryId}::uuid
         </if>
+        <if  test="searchText != null">
+            AND (tmgs.sku_model  like concat('%', my_ex.likequery(#{searchText}) , '%')
+            OR  tmgs.sku_name like concat('%', my_ex.likequery(#{searchText}) , '%')
+            )
+        </if>
     </select>
 
     <!-- 获取商品个数 -->
@@ -528,6 +533,11 @@
         <if test="skuName != null">
             AND tmgs.sku_name LIKE concat('%',my_ex.likequery(#{skuName}),'%')
         </if>
+        <if  test="searchText != null">
+            AND (tmgs.sku_model  like concat('%', my_ex.likequery(#{searchText}) , '%')
+            OR  tmgs.sku_name like concat('%', my_ex.likequery(#{searchText}) , '%')
+            )
+        </if>
     </select>
 
     <!-- 获取商品(采购) -->
@@ -1073,7 +1083,7 @@
             AND tmgs.sku_name LIKE concat('%',my_ex.likequery(#{skuName}),'%')
         </if>
         <if test="whName != null">
-            AND tmgs.wh_name LIKE concat('%',my_ex.likequery(#{whName}),'%')
+            AND tmw.wh_name LIKE concat('%',my_ex.likequery(#{whName}),'%')
         </if>
         <if test="whId != null">
             AND tpi.wh_id = #{whId} ::uuid

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

@@ -271,7 +271,7 @@
     <update id="updateAmtAndQty" parameterType="com.dk.mdm.model.pojo.ivt.InventoryBatch">
         update dkic_b.t_psi_inventory_batch
         set cost_amt = #{costAmt,jdbcType=NUMERIC},
-            inv_qty  = #{invQty,jdbcType=NUMERIC},
+            inv_qty  = #{invQty,jdbcType=NUMERIC}
             where batch_id = #{batchId,typeHandler=UuidTypeHandler}
     </update>
 

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

@@ -124,7 +124,7 @@
                 AND tmgs.brand_id = #{brandId}::UUID
             </if>
             <if  test="searchText != null">
-                AND (tmgs.sku_code  like concat('%', my_ex.likequery(#{searchText}) , '%')
+                AND (tmgs.sku_model  like concat('%', my_ex.likequery(#{searchText}) , '%')
                 OR  tmgs.sku_name like concat('%', my_ex.likequery(#{searchText}) , '%')
                 OR  tpi.non_std_code like concat('%', my_ex.likequery(#{searchText}) , '%')
                 )

+ 6 - 0
src/main/java/com/dk/mdm/mapper/ivt/OutboundMapper.xml

@@ -226,6 +226,12 @@
             <if test="addressFull != null and addressFull != ''">
                 AND  tmc.address_full  LIKE concat('%',my_ex.likequery(#{addressFull}),'%')
             </if>
+            <if test="staffIds != null and staffIds.size()>0">
+                AND t.staff_id = any(#{staffIds, typeHandler=uuidListTypeHandler})
+            </if>
+            <if test="orgIds != null and orgIds.size()>0">
+                AND t.org_id = any(#{orgIds, typeHandler=uuidListTypeHandler})
+            </if>
             <if test="supName != null and supName != ''">
                 AND tmp.sup_name LIKE concat('%',my_ex.likequery(#{supName}),'%')
             </if>

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

@@ -8,7 +8,7 @@
         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_org, tccf.follow_staff, tccf.follow_time, tccf.follow_data,
+        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_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
@@ -47,6 +47,7 @@
         <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"/>

+ 35 - 0
src/main/java/com/dk/mdm/mapper/mst/MoneyAccountMapper.xml

@@ -234,4 +234,39 @@
         WHERE mac_id = #{id}::uuid
         for update
     </select>
+
+    <insert id="insertBatch">
+        insert into dkic_b.t_mst_money_account
+        (
+        <trim suffixOverrides=",">
+            mac_code,
+            mac_name,
+            mac_type,
+            balance,
+            display_no,
+            flg_default,
+            acc_date,
+            flg_negative,
+            remarks,
+            cp_id,
+        </trim>
+        )
+        values
+        <foreach collection="list" index="index" item="item" separator=",">
+            (
+            <trim suffixOverrides=",">
+                #{item.macCode},
+                #{item.macName},
+                #{item.macType} ::uuid,
+                #{item.balance},
+                #{item.displayNo},
+                #{item.flgDefault},
+                #{item.accDate},
+                #{item.flgNegative},
+                #{item.remarks},
+                #{item.cpId},
+            </trim>
+            )
+        </foreach>
+    </insert>
 </mapper>

+ 2 - 0
src/main/java/com/dk/mdm/mapper/sale/OrderMapper.xml

@@ -450,6 +450,8 @@
             <if test="searchText !=null">
                 AND (  t.order_no LIKE concat('%', my_ex.likequery(#{searchText}), '%')
                 OR   t.contact_phone 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   t.address_full LIKE concat('%', my_ex.likequery(#{searchText}), '%')
                 OR   t.remarks LIKE concat('%', my_ex.likequery(#{searchText}), '%')
                 )

+ 2 - 1
src/main/java/com/dk/mdm/model/pojo/ivt/Inbound.java

@@ -178,7 +178,8 @@ public class Inbound extends PageInfo<Inbound> implements Serializable {
     @Excel(name = "入库日期")
     @ApiModelProperty(value = "入库日期")
     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    @TableField(typeHandler = TimestampTypeHandler.class, updateStrategy = FieldStrategy.IGNORED)
+//    @TableField(typeHandler = TimestampTypeHandler.class, updateStrategy = FieldStrategy.IGNORED)
+    @TableField(typeHandler = TimestampTypeHandler.class)
     private LocalDate intoDate;
 
 

+ 2 - 2
src/main/java/com/dk/mdm/model/query/ivt/OutboundQuery.java

@@ -246,10 +246,10 @@ public class OutboundQuery extends PageInfo<OutboundQuery> {
     private String staffName;
 
     @ApiModelProperty(value = "部门List")
-    private List<String> orgIdList;
+    private List<String> orgIds;
 
     @ApiModelProperty(value = "业务员List")
-    private List<String> staffIdList;
+    private List<String> staffIds;
 
     @ApiModelProperty(value = "出库状态List")
     private List<String> outStatusList;

+ 3 - 0
src/main/java/com/dk/mdm/model/vo/ivt/InOutRecordVO.java

@@ -219,6 +219,9 @@ public class InOutRecordVO  {
     private Integer itemIndex;
 
 
+    @ApiModelProperty(value = "存货批次明细ID")
+    private String batchId;
+
 
 
 

+ 30 - 20
src/main/java/com/dk/mdm/service/ivt/inventory/InventoryService.java

@@ -411,7 +411,7 @@ public class InventoryService extends BaseService<Inventory> {
             if (delOutDetail.size() > 0) {
                 delOutList = delOutDetail.toJavaList(InOutRecordVO.class);
                 //赋值并校验库存流水数据
-                delOutList = this.setInOutRecordMessageByInto(delOutList);
+                delOutList = this.setInOutRecordMessageByOut(delOutList);
                 //是负库存逻辑
                 if (delOutList.get(0).getCanNegativeFlag()) {
                     //操作负库存--删除(作废)
@@ -574,11 +574,11 @@ public class InventoryService extends BaseService<Inventory> {
                     this.insertInboundRecord(inOutRecordVO);
                     //endregion
 
-                    //region 采购退货 出库成本 正数
-                    if (Constant.InventoryDocCode.PURCHASE_RETURN.getValue().equals(inOutRecordVO.getInventoryDocCode())) {
-                        this.insertOutboundItemCost(inOutRecordVO);
-                    }
-                    //endregion
+//                    //region 采购退货 出库成本 正数
+//                    if (Constant.InventoryDocCode.PURCHASE_RETURN.getValue().equals(inOutRecordVO.getInventoryDocCode())) {
+//                        this.insertOutboundItemCost(inOutRecordVO);
+//                    }
+//                    //endregion
                 }
                 //endregion
             }
@@ -630,11 +630,10 @@ public class InventoryService extends BaseService<Inventory> {
                     if (inOutRecordVO.getSOutItemId() != null) {
                         List<OutboundItemCostResponse> outboundItemCostResponses = outboundItemCostMapper.selectByCond(new OutboundItemCostQuery().setOutItemId(inOutRecordVO.getSOutItemId()));
                         if (outboundItemCostResponses.size() > 0) {
-                            //出库单价
+                            //出库单价  反写出库单成本单价、成本金额
                             inOutRecordVO.setPriceInto(outboundItemCostResponses.get(0).getCostPrice());
                             //金额
                             inOutRecordVO.setIntoAmt(outboundItemCostResponses.get(0).getCostPrice().multiply(inOutRecordVO.getIntoQty()).abs());
-                            //反写出库单成本单价、成本金额
 
                         } else {
                             //当前销售退货单无法获取源出库单数据
@@ -664,12 +663,12 @@ public class InventoryService extends BaseService<Inventory> {
                     this.insertInboundRecord(inOutRecordVO);
                     //endregion
 
-                    //region  出库成本
-                    //除了销售退货出库  其他类型出库要新建出库成本
-                    if (!Constant.InventoryDocCode.SALE_RETURN.getValue().equals(inOutRecordVO.getInventoryDocCode())) {
-                        this.insertOutboundItemCost(inOutRecordVO);
-                    }
-                    //endregion
+//                    //region 销售退货 其他类型出库
+//                    if (!Constant.InventoryDocCode.SALE_RETURN.getValue().equals(inOutRecordVO.getInventoryDocCode())) {
+//                        this.insertOutboundItemCost(inOutRecordVO);
+//                    }
+//                    //endregion
+
                 }
                 //endregion
 
@@ -983,8 +982,9 @@ public class InventoryService extends BaseService<Inventory> {
                 outboundItemCost.setCostAmt(inOutRecordVO.getIntoAmt());
             }
         }
-        Map<String, Object> codeMap = commonService.getUniqueNoteCode(Constant.docNameConstant.OUTBOUNDCOST.getName(), false);
-        outboundItemCost.setBatchId(codeMap.get("outId").toString());
+        /*Map<String, Object> codeMap = commonService.getUniqueNoteCode(Constant.docNameConstant.OUTBOUNDCOST.getName(), false);
+        outboundItemCost.setBatchId(codeMap.get("outId").toString());*/
+        outboundItemCost.setBatchId(inOutRecordVO.getBatchId());
         //新建
         outboundItemCostMapper.insert(outboundItemCost);
     }
@@ -1032,7 +1032,7 @@ public class InventoryService extends BaseService<Inventory> {
                         //主键赋值
                         inventoryBatchVO.setBatchId(inventoryBatchResponse.getBatchId());
                         //库存数量
-                        inventoryBatchVO.setInvQty(inOutRecordVO.getIntoQty());
+                        inventoryBatchVO.setInvQty(qty.abs());
                         //存货资产
                         inventoryBatchVO.setCostAmt(inventoryBatchVO.getInvQty().multiply(inventoryBatchResponse.getCostPrice()));
                         //清零标识
@@ -1044,10 +1044,9 @@ public class InventoryService extends BaseService<Inventory> {
                         inOutRecordVO.setPriceInto(inventoryBatchResponse.getCostPrice());
                         //金额
                         inOutRecordVO.setIntoAmt(inOutRecordVO.getIntoQty().multiply(inventoryBatchResponse.getCostPrice()));
-                        break;
                     }
                     //当前条库存批次明细不够出库
-                    if (qty.abs().compareTo(inventoryBatchResponse.getInvQty()) > 0) {
+                    else {
                         //主键赋值
                         inventoryBatchVO.setBatchId(inventoryBatchResponse.getBatchId());
                         //库存数量
@@ -1068,6 +1067,16 @@ public class InventoryService extends BaseService<Inventory> {
                         inOutRecordVO.setIntoAmt(inOutRecordVO.getIntoQty().multiply(inventoryBatchResponse.getCostPrice()));
                     }
                 }
+                //todo  2024年5月20日15:46:01  库存批次有几条出库成本就有几条
+                //region  出库成本
+                //除了销售退货出库  其他类型出库要新建出库成本  采购退货 出库成本 正数
+                if (!Constant.InventoryDocCode.SALE_RETURN.getValue().equals(inOutRecordVO.getInventoryDocCode()) ||
+                        Constant.InventoryDocCode.PURCHASE_RETURN.getValue().equals(inOutRecordVO.getInventoryDocCode())) {
+                    //存货批次明细ID
+                    inOutRecordVO.setBatchId(inventoryBatchResponse.getBatchId());
+                    this.insertOutboundItemCost(inOutRecordVO);
+                }
+                //endregion
             }
         } else {
             throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.CAN_OUTBOUND_QUANTITY_INSUFFICIENT.getMessage());
@@ -1139,7 +1148,7 @@ public class InventoryService extends BaseService<Inventory> {
                     InventoryBatch inventoryBatch = new InventoryBatch();
                     inventoryBatch.setBatchId(outboundItemCostResponse.getBatchId());
                     inventoryBatch.setInvQty(inventoryBatchResponse.getInvQty().add(outboundItemCostResponse.getOutQty()));
-                    inventoryBatch.setCostAmt(inventoryBatch.getInvQty().multiply(inventoryBatch.getCostPrice()));
+                    inventoryBatch.setCostAmt(inventoryBatchResponse.getInvQty().multiply(outboundItemCostResponse.getCostPrice()));
                     inventoryBatchMapper.updateAmtAndQty(inventoryBatch);
                 }
             }
@@ -1420,6 +1429,7 @@ public class InventoryService extends BaseService<Inventory> {
 
                 //新建存货流水 一正一负
                 this.insertInboundRecord(inOutRecordVO);
+
                 //新建出库成本
                 this.insertOutboundItemCost(inOutRecordVO);
             }

+ 90 - 40
src/main/java/com/dk/mdm/service/mst/StaffService.java

@@ -1,5 +1,6 @@
 package com.dk.mdm.service.mst;
 
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.dk.common.exception.BaseBusinessException;
 import com.dk.common.infrastructure.annotaiton.Pagination;
@@ -12,6 +13,7 @@ import com.dk.common.model.vo.core.StaffEntity;
 import com.dk.common.response.ResponseCodeEnum;
 import com.dk.common.response.ResponseResultUtil;
 import com.dk.common.response.ResponseResultVO;
+import com.dk.common.util.AESUtil;
 import com.dk.mdm.feign.CompanyFeign;
 import com.dk.mdm.feign.UserFeign;
 import com.dk.mdm.infrastructure.convert.mst.StaffConvert;
@@ -35,7 +37,9 @@ import org.springframework.util.CollectionUtils;
 
 import javax.annotation.Resource;
 import java.math.BigDecimal;
+import java.time.LocalDate;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * @author : 姜永辉
@@ -126,6 +130,16 @@ public class StaffService extends BaseService<Staff> {
             Integer cpId = authUtils.getStaff().getCpId();
             staffQuery.setCpId(cpId);
         }
+//        Map<String,Object> map = new HashMap<>();
+//        map.put("grade_code","STD");
+//        map.put("end_date","2099-09-01");
+//        map.put("web_max_num",1);
+//        map.put("wx_max_num",1);
+//        String s1 = JSON.toJSONString(map);
+//        // 加密
+//        String s = AESUtil.aesEncrypt(s1);
+//        // 解密
+//        Map<String,Object> ss = JSON.parseObject(AESUtil.desEncrypt(s),Map.class) ;
         return super.mergeListWithCount(staffQuery, staffMapper.selectByCond(staffQuery),
                 staffMapper.countByCond(staffQuery));
     }
@@ -168,15 +182,27 @@ public class StaffService extends BaseService<Staff> {
                         ErrorCodeEnum.USER_REGISTER_ERROR.getMessage());
             } else {
                 Map<String, Object> mp = (Map<String, Object>) resultMaxnum.getData();
-                int intMaxnum = Integer.parseInt(mp.get("maxStaffNum") + "");
+                int intWebMaxnum = Integer.parseInt(mp.get("web_max_num") + "");
+                int intWxMaxnum = Integer.parseInt(mp.get("wx_max_num") + "");
                 staffQuery = new StaffQuery();
                 staffQuery.setFlgCanLogin(true);
                 staffQuery.setCpId(cpId);
                 List<StaffResponse> staffResponsesFlgCanLogin = staffMapper.selectByCond(staffQuery);
-                if (staffResponsesFlgCanLogin != null && staffResponsesFlgCanLogin.size() > 0 && intMaxnum < staffResponsesFlgCanLogin.size() + 1) {
-                    // 无用户
-                    throw new BaseBusinessException(ErrorCodeEnum.USER_MAX_STAFF_ERROR.getCode(),
-                            ErrorCodeEnum.USER_MAX_STAFF_ERROR.getMessage());
+                if (staffResponsesFlgCanLogin != null && staffResponsesFlgCanLogin.size() > 0 ) {
+                    List<StaffResponse> collectPc = staffResponsesFlgCanLogin.stream().filter(it -> it.getLoginType() == 1 || it.getLoginType() == 3).collect(Collectors.toList());
+                    List<StaffResponse> collectWx = staffResponsesFlgCanLogin.stream().filter(it -> it.getLoginType() == 2 || it.getLoginType() == 3).collect(Collectors.toList());
+                    if ((staffVO.getLoginType() == 1 || staffVO.getLoginType() == 3 ) &&
+                        collectPc != null && collectPc.size() > 0 && intWebMaxnum < collectPc.size() + 1) {
+                        // 无用户
+                        throw new BaseBusinessException(ErrorCodeEnum.USER_MAX_PC_STAFF_ERROR.getCode(),
+                                ErrorCodeEnum.USER_MAX_PC_STAFF_ERROR.getMessage());
+                    }
+                    if ((staffVO.getLoginType() == 2 || staffVO.getLoginType() == 3 ) &&
+                            collectWx != null && collectWx.size() > 0 && intWxMaxnum < collectWx.size() + 1) {
+                        // 无用户
+                        throw new BaseBusinessException(ErrorCodeEnum.USER_MAX_WX_STAFF_ERROR.getCode(),
+                                ErrorCodeEnum.USER_MAX_WX_STAFF_ERROR.getMessage());
+                    }
                 }
             }
         }
@@ -372,8 +398,11 @@ public class StaffService extends BaseService<Staff> {
                 moneyAccount.setMacCode(m.get("macCode").toString());
                 moneyAccount.setMacName(m.get("macName").toString());
                 moneyAccount.setMacType(m.get("macType").toString());
-                moneyAccount.setBalance((BigDecimal) m.get("balance"));
+                moneyAccount.setAccDate(LocalDate.parse(m.get("accDate").toString()) );
+//                moneyAccount.setBalance((BigDecimal) m.get("balance"));
+                moneyAccount.setBalance(new BigDecimal(m.get("balance").toString()) );
                 moneyAccount.setFlgDefault((Boolean) m.get("flgDefault"));
+                moneyAccount.setFlgNegative((Boolean) m.get("flgNegative"));
                 moneyAccount.setDisplayNo((Integer) m.get("displayNo"));
                 moneyAccount.setCpId(cpId);
                 listMa.add(moneyAccount);
@@ -511,43 +540,64 @@ public class StaffService extends BaseService<Staff> {
                 throw new BaseBusinessException(ErrorCodeEnum.USER_REGISTER_ERROR.getCode(),
                         ErrorCodeEnum.USER_REGISTER_ERROR.getMessage());
             } else {
-                Map<String, Object> mp = (Map<String, Object>) resultMaxnum.getData();
-                int intMaxnum = Integer.parseInt(mp.get("maxStaffNum") + "");
-                StaffQuery staffQuery = new StaffQuery();
-                staffQuery.setFlgCanLogin(true);
-                staffQuery.setCpId(cpId);
-                List<StaffResponse> staffResponsesFlgCanLogin = staffMapper.selectByCond(staffQuery);
-                if (staffResponsesFlgCanLogin != null && staffResponsesFlgCanLogin.size() > 0 && intMaxnum < staffResponsesFlgCanLogin.size()) {
-                    // 无用户
-                    throw new BaseBusinessException(ErrorCodeEnum.USER_MAX_STAFF_ERROR.getCode(),
-                            ErrorCodeEnum.USER_MAX_STAFF_ERROR.getMessage());
-                }
-            }
-            if (staffResponseOld.getFlgCanLogin() != staffVO.getFlgCanLogin()) {
-                // 增加一个可以cur_staff_num
-                Map<String, Object> m = new HashMap<>();
-                m.put("curStaffNum", 1);
-                m.put("cpId", cpId);
-                ResponseResultVO<Boolean> booleanResponseResultVO = companyFeign.updateCompanyCurStaffNum(m);
-                if (booleanResponseResultVO.getCode() != ResponseCodeEnum.SUCCESS.getCode()) {
-                    // 无用户
-                    throw new BaseBusinessException(ErrorCodeEnum.USER_REGISTER_ERROR.getCode(),
-                            ErrorCodeEnum.USER_REGISTER_ERROR.getMessage());
+                if (staffResponseOld.getFlgCanLogin() != staffVO.getFlgCanLogin()) {
+                    Map<String, Object> mp = (Map<String, Object>) resultMaxnum.getData();
+                    int intWebMaxnum = Integer.parseInt(mp.get("web_max_num") + "");
+                    int intWxMaxnum = Integer.parseInt(mp.get("wx_max_num") + "");
+                    StaffQuery staffQuery = new StaffQuery();
+                    staffQuery.setFlgCanLogin(true);
+                    staffQuery.setCpId(cpId);
+                    List<StaffResponse> staffResponsesFlgCanLogin = staffMapper.selectByCond(staffQuery);
+                    if (staffResponsesFlgCanLogin != null && staffResponsesFlgCanLogin.size() > 0 ) {
+                        List<StaffResponse> collectPc = staffResponsesFlgCanLogin.stream().filter(it -> it.getLoginType() == 1 || it.getLoginType() == 3).collect(Collectors.toList());
+                        List<StaffResponse> collectWx = staffResponsesFlgCanLogin.stream().filter(it -> it.getLoginType() == 2 || it.getLoginType() == 3).collect(Collectors.toList());
+                        if (collectPc != null && collectPc.size() > 0 && intWebMaxnum < collectPc.size()) {
+                            // 无用户
+                            throw new BaseBusinessException(ErrorCodeEnum.USER_MAX_PC_STAFF_ERROR.getCode(),
+                                    ErrorCodeEnum.USER_MAX_PC_STAFF_ERROR.getMessage());
+                        }
+                        if (collectWx != null && collectWx.size() > 0 && intWxMaxnum < collectWx.size()) {
+                            // 无用户
+                            throw new BaseBusinessException(ErrorCodeEnum.USER_MAX_WX_STAFF_ERROR.getCode(),
+                                    ErrorCodeEnum.USER_MAX_WX_STAFF_ERROR.getMessage());
+                        }
+                    }
+
                 }
+
+//                if (staffResponsesFlgCanLogin != null && staffResponsesFlgCanLogin.size() > 0 && intMaxnum < staffResponsesFlgCanLogin.size()) {
+//                    // 无用户
+//                    throw new BaseBusinessException(ErrorCodeEnum.USER_MAX_STAFF_ERROR.getCode(),
+//                            ErrorCodeEnum.USER_MAX_STAFF_ERROR.getMessage());
+//                }
+
             }
+//            if (staffResponseOld.getFlgCanLogin() != staffVO.getFlgCanLogin()) {
+//                // 增加一个可以cur_staff_num
+//                Map<String, Object> m = new HashMap<>();
+//                m.put("curStaffNum", 1);
+//                m.put("cpId", cpId);
+//                ResponseResultVO<Boolean> booleanResponseResultVO = companyFeign.updateCompanyCurStaffNum(m);
+//                if (booleanResponseResultVO.getCode() != ResponseCodeEnum.SUCCESS.getCode()) {
+//                    // 无用户
+//                    throw new BaseBusinessException(ErrorCodeEnum.USER_REGISTER_ERROR.getCode(),
+//                            ErrorCodeEnum.USER_REGISTER_ERROR.getMessage());
+//                }
+//            }
         } else {
-            if (staffResponseOld.getFlgCanLogin() != staffVO.getFlgCanLogin()) {
-                // 减少一个可以cur_staff_num
-                Map<String, Object> m = new HashMap<>();
-                m.put("curStaffNum", -1);
-                m.put("cpId", cpId);
-                ResponseResultVO<Boolean> booleanResponseResultVO = companyFeign.updateCompanyCurStaffNum(m);
-                if (booleanResponseResultVO.getCode() != ResponseCodeEnum.SUCCESS.getCode()) {
-                    // 无用户
-                    throw new BaseBusinessException(ErrorCodeEnum.USER_REGISTER_ERROR.getCode(),
-                            ErrorCodeEnum.USER_REGISTER_ERROR.getMessage());
-                }
-            }
+//            2024-05-20 edit
+//            if (staffResponseOld.getFlgCanLogin() != staffVO.getFlgCanLogin()) {
+//                // 减少一个可以cur_staff_num
+//                Map<String, Object> m = new HashMap<>();
+//                m.put("curStaffNum", -1);
+//                m.put("cpId", cpId);
+//                ResponseResultVO<Boolean> booleanResponseResultVO = companyFeign.updateCompanyCurStaffNum(m);
+//                if (booleanResponseResultVO.getCode() != ResponseCodeEnum.SUCCESS.getCode()) {
+//                    // 无用户
+//                    throw new BaseBusinessException(ErrorCodeEnum.USER_REGISTER_ERROR.getCode(),
+//                            ErrorCodeEnum.USER_REGISTER_ERROR.getMessage());
+//                }
+//            }
         }
         return ResponseResultUtil.success();
     }