Ver código fonte

售前售后联系人

傅行帆 4 anos atrás
pai
commit
852e8c30cc

+ 5
- 0
src/main/java/com/huiju/estateagents/common/CommConstant.java Ver arquivo

@@ -892,6 +892,11 @@ public class CommConstant {
892 892
      */
893 893
     public static final String FINANCE = "finance";
894 894
 
895
+    /**
896
+     * 人员类型---销售
897
+     */
898
+    public static final String SELL = "sell";
899
+
895 900
     /**
896 901
      * 审核状态-审核中
897 902
      */

+ 10
- 1
src/main/java/com/huiju/estateagents/sample/controller/TaContactController.java Ver arquivo

@@ -273,10 +273,17 @@ public class TaContactController extends BaseController {
273 273
         try {
274 274
             TaContact taContact = new TaContact();
275 275
             taContact.setContactId(id);
276
-            taContact.setContactType(contactType);
276
+            taContact.setContactType(contact.getContactType() + "," + contactType);
277 277
             if (!StringUtils.isEmpty(contact.getOrderNo())){
278 278
                 taContact.setOrderNo(contact.getOrderNo());
279 279
             }
280
+            QueryWrapper<TaContact> queryWrapper = new QueryWrapper<>();
281
+            queryWrapper.like("contact_type", contactType);
282
+            queryWrapper.ne("status", CommConstant.STATUS_DELETE);
283
+            List<TaContact> list = iTaContactService.list(queryWrapper);
284
+            if (contactType.equals(CommConstant.SELL) && list.size() >= 9){
285
+                return ResponseBean.error("最多维护9个人", ResponseBean.ERROR_UNAVAILABLE);
286
+            }
280 287
             if (iTaContactService.updateById(taContact)) {
281 288
                 responseBean.addSuccess(taContact);
282 289
             } else {
@@ -300,6 +307,8 @@ public class TaContactController extends BaseController {
300 307
             String replaceType = CommConstant.CONCAT_TYPE_PROMOTE;
301 308
             if (contactType.equals(CommConstant.FINANCE)){
302 309
                 replaceType = CommConstant.CONCAT_TYPE_FINANCE;
310
+            }else if (contactType.equals(CommConstant.SELL)){
311
+                replaceType = CommConstant.SELL;
303 312
             }
304 313
             String finalReplaceType = replaceType;
305 314
             taContacts.forEach(e -> {