|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package com.glxp.api.controller.sync;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
|
import com.glxp.api.annotation.AuthRuleAnnotation;
|
|
|
|
|
import com.glxp.api.constant.Constant;
|
|
|
|
@ -65,12 +66,19 @@ public class SyncDataSetController {
|
|
|
|
|
syncDataSetEntity.setUpdateTime(new Date());
|
|
|
|
|
syncDataSetEntity.setId(1);
|
|
|
|
|
List<SyncDataBustypeEntity> busTypes = syncDataSetResponse.getBusTypes();
|
|
|
|
|
//重新生成id防止插入时单据类型被覆盖
|
|
|
|
|
for (SyncDataBustypeEntity s:busTypes) {
|
|
|
|
|
s.setId(IdUtil.getSnowflakeNextId());
|
|
|
|
|
}
|
|
|
|
|
syncDataBustypeService.deleteAll(1);
|
|
|
|
|
if (CollUtil.isNotEmpty(busTypes)) {
|
|
|
|
|
syncDataBustypeService.inserts(busTypes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<SyncDataBustypeEntity> toInBusTypes = syncDataSetResponse.getToInBusTypes();
|
|
|
|
|
for (SyncDataBustypeEntity s : toInBusTypes) {
|
|
|
|
|
s.setId(IdUtil.getSnowflakeNextId());
|
|
|
|
|
}
|
|
|
|
|
syncDataBustypeService.deleteAll(2);
|
|
|
|
|
if (CollUtil.isNotEmpty(toInBusTypes)) {
|
|
|
|
|
syncDataBustypeService.inserts(toInBusTypes);
|
|
|
|
|