|
|
@@ -3,8 +3,9 @@ package com.mokamrp;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.mokamrp.privates.PrivateServerStart;
|
|
|
-import com.mokamrp.privates.mapper.pojo.Corp;
|
|
|
+import com.mokamrp.privates.mapper.pangu.pojo.FosterwxMobilePool;
|
|
|
import com.mokamrp.privates.service.CorpService;
|
|
|
+import com.mokamrp.privates.service.pangu.FosterwxMobilePoolService;
|
|
|
import com.mokamrp.privates.service.pangu.FosterwxMobileService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.junit.Test;
|
|
|
@@ -23,19 +24,29 @@ public class WebTest {
|
|
|
@Autowired
|
|
|
private CorpService corpService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private FosterwxMobilePoolService fosterwxMobilePoolService;
|
|
|
+
|
|
|
@Test
|
|
|
public void test1() {
|
|
|
// 清洗数据
|
|
|
fosterwxMobileService.list().forEach(fosterwxMobile -> {
|
|
|
- if (corpService.count(new LambdaQueryWrapper<Corp>().eq(Corp::getName, fosterwxMobile.getWorkWxCorp())) > 1) {
|
|
|
- log.warn("{}名字有两个主体", fosterwxMobile.getWorkWxCorp());
|
|
|
- }
|
|
|
- Corp corp = corpService.getOne(new LambdaQueryWrapper<Corp>().eq(Corp::getName, fosterwxMobile.getWorkWxCorp()).last("Limit 1"));
|
|
|
- if (null != corp) {
|
|
|
- fosterwxMobile.setWorkWxCorpId(corp.getId());
|
|
|
- fosterwxMobile.setWxAppid(corp.getWxCorpid());
|
|
|
- fosterwxMobileService.updateById(fosterwxMobile);
|
|
|
- }
|
|
|
+ // if (corpService.count(new LambdaQueryWrapper<Corp>().eq(Corp::getName, fosterwxMobile.getWorkWxCorp())) > 1) {
|
|
|
+ // log.warn("{}名字有两个主体", fosterwxMobile.getWorkWxCorp());
|
|
|
+ // }
|
|
|
+ // Corp corp = corpService.getOne(new LambdaQueryWrapper<Corp>().eq(Corp::getName, fosterwxMobile.getWorkWxCorp()).last("Limit 1"));
|
|
|
+ // if (null != corp) {
|
|
|
+ // fosterwxMobile.setWorkWxCorpId(corp.getId());
|
|
|
+ // fosterwxMobile.setWxAppid(corp.getWxCorpid());
|
|
|
+ // fosterwxMobileService.updateById(fosterwxMobile);
|
|
|
+ // } else {
|
|
|
+ // fosterwxMobile.setWorkWxCorpId(0);
|
|
|
+ // fosterwxMobile.setWxAppid(null);
|
|
|
+ // fosterwxMobileService.updateById(fosterwxMobile);
|
|
|
+ // }
|
|
|
+ fosterwxMobilePoolService.update(new FosterwxMobilePool() {{
|
|
|
+ setWxAppid(fosterwxMobile.getWxAppid());
|
|
|
+ }}, new LambdaQueryWrapper<FosterwxMobilePool>().eq(FosterwxMobilePool::getPoolIndex, fosterwxMobile.getMobileUnioCode()));
|
|
|
});
|
|
|
}
|
|
|
}
|