|
|
|
@ -7,7 +7,10 @@ import com.alibaba.fastjson.TypeReference;
|
|
|
|
|
import com.glxp.api.admin.config.WebSocketServer;
|
|
|
|
|
import com.glxp.api.admin.constant.BasicProcessStatus;
|
|
|
|
|
import com.glxp.api.admin.constant.Constant;
|
|
|
|
|
import com.glxp.api.admin.dao.basic.UdiRelevanceDao;
|
|
|
|
|
import com.glxp.api.admin.entity.basic.BasicThirdSysDetailEntity;
|
|
|
|
|
import com.glxp.api.admin.entity.basic.BasicThirdSysEntity;
|
|
|
|
|
import com.glxp.api.admin.entity.basic.UdiRelevanceEntity;
|
|
|
|
|
import com.glxp.api.admin.entity.info.SyncDataSetEntity;
|
|
|
|
|
import com.glxp.api.admin.entity.thrsys.ThrProductsEntity;
|
|
|
|
|
import com.glxp.api.admin.entity.thrsys.ThrProductsExportLogEntity;
|
|
|
|
@ -22,6 +25,9 @@ import com.glxp.api.admin.req.thrsys.ThrProductsExportRequest;
|
|
|
|
|
import com.glxp.api.admin.res.PageSimpleResponse;
|
|
|
|
|
import com.glxp.api.admin.res.basic.ErpProductsResponse;
|
|
|
|
|
import com.glxp.api.admin.service.basic.BasicThirdSysDetailService;
|
|
|
|
|
import com.glxp.api.admin.service.basic.BasicThirdSysService;
|
|
|
|
|
import com.glxp.api.admin.service.basic.UdiContrastService;
|
|
|
|
|
import com.glxp.api.admin.service.basic.UdiRelevanceService;
|
|
|
|
|
import com.glxp.api.admin.service.info.SyncDataSetService;
|
|
|
|
|
import com.glxp.api.admin.service.thrsys.ThrProductsExportLogService;
|
|
|
|
|
import com.glxp.api.admin.service.thrsys.ThrProductsImportDetailService;
|
|
|
|
@ -67,6 +73,12 @@ public class ThrProductsDlService {
|
|
|
|
|
ThrProductsExportLogService thrProductsExportLogService;
|
|
|
|
|
@Resource
|
|
|
|
|
private ErpBasicClient erpBasicClient;
|
|
|
|
|
@Resource
|
|
|
|
|
private BasicThirdSysService basicThirdSysService;
|
|
|
|
|
@Resource
|
|
|
|
|
private UdiRelevanceService udiRelevanceService;
|
|
|
|
|
@Resource
|
|
|
|
|
private UdiContrastService udiContrastService;
|
|
|
|
|
|
|
|
|
|
@Async
|
|
|
|
|
public void importSelectProducrs(String genKey, List<ThrProductsEntity> thrProductsEntities, String thirdSys) {
|
|
|
|
@ -142,6 +154,15 @@ public class ThrProductsDlService {
|
|
|
|
|
for (List<ThrProductsEntity> data : splitList) {
|
|
|
|
|
thrProductsService.insertThrProductss(data);
|
|
|
|
|
}
|
|
|
|
|
BasicThirdSysEntity basicThirdSysEntity = basicThirdSysService.selectMainThrSys();
|
|
|
|
|
if (filterThrProductsRequest.getThirdSysFk().equals(basicThirdSysEntity.getThirdId())) {
|
|
|
|
|
for (ThrProductsEntity thrProductsEntity : thrProductsEntities) {
|
|
|
|
|
UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectByMainIdLimitOne(thrProductsEntity.getCode());
|
|
|
|
|
if (udiRelevanceEntity == null) {
|
|
|
|
|
udiContrastService.createOnlyMainId(thrProductsEntity.getCode());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
redisUtil.set(Constant.dlThrProducts, "false");
|
|
|
|
|
thrProductsImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
|
|
|
|
|
thrProductsImportLogService.updateImportLog(thrProductsImportLogEntity);
|
|
|
|
|