傅行帆 5 лет назад
Родитель
Сommit
86b5f8ae95

+ 12
- 0
src/main/java/com.huiju.welcome/controller/TaCustomerController.java Просмотреть файл

@@ -227,6 +227,18 @@ public class TaCustomerController extends BaseController {
227 227
                 }
228 228
                 iTaCustomerMapService.saveBatch(customerMapList);
229 229
             }
230
+            
231
+            QueryWrapper<TaCustomerMap> taCustomerMapQueryWrapper = new QueryWrapper<>();
232
+            taCustomerMapQueryWrapper.eq("customer_id",taCustomer.getCustomerId());
233
+            taCustomerMapQueryWrapper.eq("person_id",taCustomer.getPersonId());
234
+            TaCustomerMap taCustomerMap = iTaCustomerMapService.getOne(taCustomerMapQueryWrapper);
235
+            
236
+            if (null != taCustomer.getPersonId() && null == taCustomerMap){
237
+                TaCustomerMap foo = new TaCustomerMap();
238
+                foo.setCustomerId(taCustomer.getCustomerId());
239
+                foo.setPersonId(taCustomer.getPersonId());
240
+                iTaCustomerMapService.save(foo);
241
+            }
230 242
 
231 243
             if (!StringUtils.isEmpty(taCustomer.getAvatar())) {
232 244
                 iTaMainUsherRecordService.updateByCustomer(taCustomer, follows, JWTUtils.getSubject(request));

+ 7
- 0
src/main/java/com.huiju.welcome/service/impl/TaCustomerServiceImpl.java Просмотреть файл

@@ -695,6 +695,13 @@ public class TaCustomerServiceImpl extends ServiceImpl<TaCustomerMapper, TaCusto
695 695
         boolean a = taCustomerMapper.updateById(customer) > 0;
696 696
         boolean b = taMainUsherRecordMapper.updateById(taMainUsherRecord) > 0;
697 697
 
698
+        if (null != params.getInteger("fromRecId") && params.getInteger("fromRecId").equals(recId)){
699
+            TaMainUsherRecord taMainUsherRecordFrom = new TaMainUsherRecord();
700
+            taMainUsherRecordFrom.setRecId(params.getInteger("fromRecId"));
701
+            taMainUsherRecordFrom.setStatus(CommConstant.INVALID_STATUS);
702
+            taMainUsherRecordMapper.updateById(taMainUsherRecordFrom);
703
+        }
704
+        
698 705
         return a && b;
699 706
     }
700 707
 

+ 5
- 0
src/main/java/com.huiju.welcome/utils/CommConstant.java Просмотреть файл

@@ -65,4 +65,9 @@ public class CommConstant {
65 65
      * 全部
66 66
      */
67 67
 	public static final String CUSTOMER_OF_ALL = "all";
68
+	
69
+    /**
70
+     * 无效状态
71
+     */
72
+	public static final Integer INVALID_STATUS = -1;
68 73
 }