|
|
@ -1,5 +1,6 @@
|
|
|
|
package com.glxp.api.service.thrsys;
|
|
|
|
package com.glxp.api.service.thrsys;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
import cn.hutool.core.io.file.FileWriter;
|
|
|
|
import cn.hutool.core.io.file.FileWriter;
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
@ -66,7 +67,7 @@ public class ThrProductsDlService {
|
|
|
|
// thrProductsImportDetailEntities = thrProductsEntities.stream().map(
|
|
|
|
// thrProductsImportDetailEntities = thrProductsEntities.stream().map(
|
|
|
|
// item -> {
|
|
|
|
// item -> {
|
|
|
|
// ThrProductsImportDetailEntity thrProductsImportDetailEntity = new ThrProductsImportDetailEntity();
|
|
|
|
// ThrProductsImportDetailEntity thrProductsImportDetailEntity = new ThrProductsImportDetailEntity();
|
|
|
|
// BeanUtils.copyProperties(item, thrProductsImportDetailEntity);
|
|
|
|
// BeanUtil.copyProperties(item, thrProductsImportDetailEntity);
|
|
|
|
// thrProductsImportDetailEntity.setSpec(item.getStandard());
|
|
|
|
// thrProductsImportDetailEntity.setSpec(item.getStandard());
|
|
|
|
// thrProductsImportDetailEntity.setThirdSysFk(thirdSys);
|
|
|
|
// thrProductsImportDetailEntity.setThirdSysFk(thirdSys);
|
|
|
|
// thrProductsImportDetailEntity.setGenKeyFk(thrProductsImportLogEntity.getGenKey());
|
|
|
|
// thrProductsImportDetailEntity.setGenKeyFk(thrProductsImportLogEntity.getGenKey());
|
|
|
@ -81,7 +82,7 @@ public class ThrProductsDlService {
|
|
|
|
// List<ThrProductsEntity> thrProductsEntities1 = thrProductsImportDetailEntities1.stream().map(
|
|
|
|
// List<ThrProductsEntity> thrProductsEntities1 = thrProductsImportDetailEntities1.stream().map(
|
|
|
|
// item -> {
|
|
|
|
// item -> {
|
|
|
|
// ThrProductsEntity thrProductsEntity = new ThrProductsEntity();
|
|
|
|
// ThrProductsEntity thrProductsEntity = new ThrProductsEntity();
|
|
|
|
// BeanUtils.copyProperties(item, thrProductsEntity);
|
|
|
|
// BeanUtil.copyProperties(item, thrProductsEntity);
|
|
|
|
// thrProductsEntity.setUpdateTime(new Date());
|
|
|
|
// thrProductsEntity.setUpdateTime(new Date());
|
|
|
|
//// thrProductsService.insertOrUpdateSelective(thrProductsEntity);
|
|
|
|
//// thrProductsService.insertOrUpdateSelective(thrProductsEntity);
|
|
|
|
// return thrProductsEntity;
|
|
|
|
// return thrProductsEntity;
|
|
|
@ -113,7 +114,7 @@ public class ThrProductsDlService {
|
|
|
|
// int limit = 50;
|
|
|
|
// int limit = 50;
|
|
|
|
// while (page != -1) {
|
|
|
|
// while (page != -1) {
|
|
|
|
// FilterErpGoodsRequest filterErpGoodsRequest = new FilterErpGoodsRequest();
|
|
|
|
// FilterErpGoodsRequest filterErpGoodsRequest = new FilterErpGoodsRequest();
|
|
|
|
// BeanUtils.copyProperties(filterThrProductsRequest, filterErpGoodsRequest);
|
|
|
|
// BeanUtil.copyProperties(filterThrProductsRequest, filterErpGoodsRequest);
|
|
|
|
// page = getInvmandoc(thrProductsImportLogEntity, page, limit, piDetailEntity.getValue(), filterErpGoodsRequest.getThirdSys(), filterErpGoodsRequest);
|
|
|
|
// page = getInvmandoc(thrProductsImportLogEntity, page, limit, piDetailEntity.getValue(), filterErpGoodsRequest.getThirdSys(), filterErpGoodsRequest);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// FilterUdiIpLogRequest filterUdiIpLogRequest = new FilterUdiIpLogRequest();
|
|
|
|
// FilterUdiIpLogRequest filterUdiIpLogRequest = new FilterUdiIpLogRequest();
|
|
|
@ -123,7 +124,7 @@ public class ThrProductsDlService {
|
|
|
|
// List<ThrProductsEntity> thrProductsEntities = thrProductsImportDetailEntities.stream().map(
|
|
|
|
// List<ThrProductsEntity> thrProductsEntities = thrProductsImportDetailEntities.stream().map(
|
|
|
|
// item -> {
|
|
|
|
// item -> {
|
|
|
|
// ThrProductsEntity thrProductsEntity = new ThrProductsEntity();
|
|
|
|
// ThrProductsEntity thrProductsEntity = new ThrProductsEntity();
|
|
|
|
// BeanUtils.copyProperties(item, thrProductsEntity);
|
|
|
|
// BeanUtil.copyProperties(item, thrProductsEntity);
|
|
|
|
// thrProductsEntity.setUpdateTime(new Date());
|
|
|
|
// thrProductsEntity.setUpdateTime(new Date());
|
|
|
|
// return thrProductsEntity;
|
|
|
|
// return thrProductsEntity;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
@ -188,13 +189,13 @@ public class ThrProductsDlService {
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// if (basicThirdSysDetailEntity.getFromType() == 0) {
|
|
|
|
// if (basicThirdSysDetailEntity.getFromType() == 0) {
|
|
|
|
// FilterThrProductsRequest filterThrProductsRequest = new FilterThrProductsRequest();
|
|
|
|
// FilterThrProductsRequest filterThrProductsRequest = new FilterThrProductsRequest();
|
|
|
|
// BeanUtils.copyProperties(thrProductsExportRequest, filterThrProductsRequest);
|
|
|
|
// BeanUtil.copyProperties(thrProductsExportRequest, filterThrProductsRequest);
|
|
|
|
// List<ThrProductsEntity> thrProductsEntities = exportThrProducts(filterThrProductsRequest);
|
|
|
|
// List<ThrProductsEntity> thrProductsEntities = exportThrProducts(filterThrProductsRequest);
|
|
|
|
// excelData.addAll(getRows(thrProductsEntities));
|
|
|
|
// excelData.addAll(getRows(thrProductsEntities));
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// } else {
|
|
|
|
// } else {
|
|
|
|
// FilterThrProductsRequest filterThrInvProductsRequest = new FilterThrProductsRequest();
|
|
|
|
// FilterThrProductsRequest filterThrInvProductsRequest = new FilterThrProductsRequest();
|
|
|
|
// BeanUtils.copyProperties(thrProductsExportRequest, filterThrInvProductsRequest);
|
|
|
|
// BeanUtil.copyProperties(thrProductsExportRequest, filterThrInvProductsRequest);
|
|
|
|
// List<List<String>> genDatas = genExcelData(null, filterThrInvProductsRequest);
|
|
|
|
// List<List<String>> genDatas = genExcelData(null, filterThrInvProductsRequest);
|
|
|
|
// if (genDatas != null && genDatas.size() > 0) {
|
|
|
|
// if (genDatas != null && genDatas.size() > 0) {
|
|
|
|
// excelData.addAll(genDatas);
|
|
|
|
// excelData.addAll(genDatas);
|
|
|
@ -222,7 +223,7 @@ public class ThrProductsDlService {
|
|
|
|
// List<ErpProductsResponse> lists = thrProductsEntities.stream().map(
|
|
|
|
// List<ErpProductsResponse> lists = thrProductsEntities.stream().map(
|
|
|
|
// item -> {
|
|
|
|
// item -> {
|
|
|
|
// ErpProductsResponse thrProductsEntity = new ErpProductsResponse();
|
|
|
|
// ErpProductsResponse thrProductsEntity = new ErpProductsResponse();
|
|
|
|
// BeanUtils.copyProperties(item, thrProductsEntity);
|
|
|
|
// BeanUtil.copyProperties(item, thrProductsEntity);
|
|
|
|
// return thrProductsEntity;
|
|
|
|
// return thrProductsEntity;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// ).collect(Collectors.toList());
|
|
|
|
// ).collect(Collectors.toList());
|
|
|
@ -252,7 +253,7 @@ public class ThrProductsDlService {
|
|
|
|
// List<ThrProductsEntity> thrProductsEntities;
|
|
|
|
// List<ThrProductsEntity> thrProductsEntities;
|
|
|
|
// if (basicThirdSysDetailEntity.getFromType() == 0) {
|
|
|
|
// if (basicThirdSysDetailEntity.getFromType() == 0) {
|
|
|
|
// FilterThrProductsRequest filterThrProductsRequest = new FilterThrProductsRequest();
|
|
|
|
// FilterThrProductsRequest filterThrProductsRequest = new FilterThrProductsRequest();
|
|
|
|
// BeanUtils.copyProperties(thrProductsExportRequest, filterThrProductsRequest);
|
|
|
|
// BeanUtil.copyProperties(thrProductsExportRequest, filterThrProductsRequest);
|
|
|
|
// thrProductsEntities = exportThrProducts(filterThrProductsRequest);
|
|
|
|
// thrProductsEntities = exportThrProducts(filterThrProductsRequest);
|
|
|
|
// } else {
|
|
|
|
// } else {
|
|
|
|
// FilterThrProductsRequest filterThrInvProductsRequest = new FilterThrProductsRequest();
|
|
|
|
// FilterThrProductsRequest filterThrInvProductsRequest = new FilterThrProductsRequest();
|
|
|
@ -262,7 +263,7 @@ public class ThrProductsDlService {
|
|
|
|
// List<ErpProductsResponse> lists = thrProductsEntities.stream().map(
|
|
|
|
// List<ErpProductsResponse> lists = thrProductsEntities.stream().map(
|
|
|
|
// item -> {
|
|
|
|
// item -> {
|
|
|
|
// ErpProductsResponse thrProductsEntity = new ErpProductsResponse();
|
|
|
|
// ErpProductsResponse thrProductsEntity = new ErpProductsResponse();
|
|
|
|
// BeanUtils.copyProperties(item, thrProductsEntity);
|
|
|
|
// BeanUtil.copyProperties(item, thrProductsEntity);
|
|
|
|
// return thrProductsEntity;
|
|
|
|
// return thrProductsEntity;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// ).collect(Collectors.toList());
|
|
|
|
// ).collect(Collectors.toList());
|
|
|
@ -302,7 +303,7 @@ public class ThrProductsDlService {
|
|
|
|
List<ThrProductsResponse> lists = thrProductsEntities.stream().map(
|
|
|
|
List<ThrProductsResponse> lists = thrProductsEntities.stream().map(
|
|
|
|
item -> {
|
|
|
|
item -> {
|
|
|
|
ThrProductsResponse thrProductsEntity = new ThrProductsResponse();
|
|
|
|
ThrProductsResponse thrProductsEntity = new ThrProductsResponse();
|
|
|
|
BeanUtils.copyProperties(item, thrProductsEntity);
|
|
|
|
BeanUtil.copyProperties(item, thrProductsEntity);
|
|
|
|
return thrProductsEntity;
|
|
|
|
return thrProductsEntity;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
).collect(Collectors.toList());
|
|
|
|
).collect(Collectors.toList());
|
|
|
@ -332,13 +333,13 @@ public class ThrProductsDlService {
|
|
|
|
List<ThrProductsResponse> thrProductsResponses = new ArrayList<>();
|
|
|
|
List<ThrProductsResponse> thrProductsResponses = new ArrayList<>();
|
|
|
|
if (thrSystemDetailEntity.getFromType() == 0) {
|
|
|
|
if (thrSystemDetailEntity.getFromType() == 0) {
|
|
|
|
FilterThrProductsRequest filterThrProductsRequest = new FilterThrProductsRequest();
|
|
|
|
FilterThrProductsRequest filterThrProductsRequest = new FilterThrProductsRequest();
|
|
|
|
BeanUtils.copyProperties(thrProductsExportRequest, filterThrProductsRequest);
|
|
|
|
BeanUtil.copyProperties(thrProductsExportRequest, filterThrProductsRequest);
|
|
|
|
List<ThrProductsEntity> thrProductsEntities = exportThrProducts(filterThrProductsRequest);
|
|
|
|
List<ThrProductsEntity> thrProductsEntities = exportThrProducts(filterThrProductsRequest);
|
|
|
|
if (thrProductsEntities.size() > 0) {
|
|
|
|
if (thrProductsEntities.size() > 0) {
|
|
|
|
thrProductsResponses = thrProductsEntities.stream().map(
|
|
|
|
thrProductsResponses = thrProductsEntities.stream().map(
|
|
|
|
item -> {
|
|
|
|
item -> {
|
|
|
|
ThrProductsResponse thrProductsResponse = new ThrProductsResponse();
|
|
|
|
ThrProductsResponse thrProductsResponse = new ThrProductsResponse();
|
|
|
|
BeanUtils.copyProperties(item, thrProductsResponse);
|
|
|
|
BeanUtil.copyProperties(item, thrProductsResponse);
|
|
|
|
return thrProductsResponse;
|
|
|
|
return thrProductsResponse;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
).collect(Collectors.toList());
|
|
|
|
).collect(Collectors.toList());
|
|
|
@ -351,7 +352,7 @@ public class ThrProductsDlService {
|
|
|
|
List<ThrProductsResponse> lists = thrProductsResponses.stream().map(
|
|
|
|
List<ThrProductsResponse> lists = thrProductsResponses.stream().map(
|
|
|
|
item -> {
|
|
|
|
item -> {
|
|
|
|
ThrProductsResponse thrProductsEntity = new ThrProductsResponse();
|
|
|
|
ThrProductsResponse thrProductsEntity = new ThrProductsResponse();
|
|
|
|
BeanUtils.copyProperties(item, thrProductsEntity);
|
|
|
|
BeanUtil.copyProperties(item, thrProductsEntity);
|
|
|
|
return thrProductsEntity;
|
|
|
|
return thrProductsEntity;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
).collect(Collectors.toList());
|
|
|
|
).collect(Collectors.toList());
|
|
|
@ -391,7 +392,7 @@ public class ThrProductsDlService {
|
|
|
|
// thrProductsImportDetailEntities = erpProductsResponses.stream().map(
|
|
|
|
// thrProductsImportDetailEntities = erpProductsResponses.stream().map(
|
|
|
|
// item -> {
|
|
|
|
// item -> {
|
|
|
|
// ThrProductsImportDetailEntity thrProductsImportDetailEntity = new ThrProductsImportDetailEntity();
|
|
|
|
// ThrProductsImportDetailEntity thrProductsImportDetailEntity = new ThrProductsImportDetailEntity();
|
|
|
|
// BeanUtils.copyProperties(item, thrProductsImportDetailEntity);
|
|
|
|
// BeanUtil.copyProperties(item, thrProductsImportDetailEntity);
|
|
|
|
// thrProductsImportDetailEntity.setThirdSysFk(thirdSys);
|
|
|
|
// thrProductsImportDetailEntity.setThirdSysFk(thirdSys);
|
|
|
|
// thrProductsImportDetailEntity.setGenKeyFk(genKey);
|
|
|
|
// thrProductsImportDetailEntity.setGenKeyFk(genKey);
|
|
|
|
// return thrProductsImportDetailEntity;
|
|
|
|
// return thrProductsImportDetailEntity;
|
|
|
@ -406,7 +407,7 @@ public class ThrProductsDlService {
|
|
|
|
// thrProductsEntities = thrProductsImportDetailEntities.stream().map(
|
|
|
|
// thrProductsEntities = thrProductsImportDetailEntities.stream().map(
|
|
|
|
// item -> {
|
|
|
|
// item -> {
|
|
|
|
// ThrProductsEntity thrProductsEntity = new ThrProductsEntity();
|
|
|
|
// ThrProductsEntity thrProductsEntity = new ThrProductsEntity();
|
|
|
|
// BeanUtils.copyProperties(item, thrProductsEntity);
|
|
|
|
// BeanUtil.copyProperties(item, thrProductsEntity);
|
|
|
|
// thrProductsEntity.setUpdateTime(new Date());
|
|
|
|
// thrProductsEntity.setUpdateTime(new Date());
|
|
|
|
// thrProductsService.insertOrUpdateSelective(thrProductsEntity);
|
|
|
|
// thrProductsService.insertOrUpdateSelective(thrProductsEntity);
|
|
|
|
// return thrProductsEntity;
|
|
|
|
// return thrProductsEntity;
|
|
|
@ -439,7 +440,7 @@ public class ThrProductsDlService {
|
|
|
|
// thrProductsImportDetailEntities = erpProductsResponses.stream().map(
|
|
|
|
// thrProductsImportDetailEntities = erpProductsResponses.stream().map(
|
|
|
|
// item -> {
|
|
|
|
// item -> {
|
|
|
|
// ThrProductsImportDetailEntity thrProductsImportDetailEntity = new ThrProductsImportDetailEntity();
|
|
|
|
// ThrProductsImportDetailEntity thrProductsImportDetailEntity = new ThrProductsImportDetailEntity();
|
|
|
|
// BeanUtils.copyProperties(item, thrProductsImportDetailEntity);
|
|
|
|
// BeanUtil.copyProperties(item, thrProductsImportDetailEntity);
|
|
|
|
// thrProductsImportDetailEntity.setSpec(item.getStandard());
|
|
|
|
// thrProductsImportDetailEntity.setSpec(item.getStandard());
|
|
|
|
// thrProductsImportDetailEntity.setThirdSysFk(thirdSys);
|
|
|
|
// thrProductsImportDetailEntity.setThirdSysFk(thirdSys);
|
|
|
|
// thrProductsImportDetailEntity.setGenKeyFk(thrProductsImportLogEntity.getGenKey());
|
|
|
|
// thrProductsImportDetailEntity.setGenKeyFk(thrProductsImportLogEntity.getGenKey());
|
|
|
@ -497,7 +498,7 @@ public class ThrProductsDlService {
|
|
|
|
List<ThrProductsEntity> thrProductsEntities = erpProductsResponses.stream().map(
|
|
|
|
List<ThrProductsEntity> thrProductsEntities = erpProductsResponses.stream().map(
|
|
|
|
item -> {
|
|
|
|
item -> {
|
|
|
|
ThrProductsEntity thrProductsEntity = new ThrProductsEntity();
|
|
|
|
ThrProductsEntity thrProductsEntity = new ThrProductsEntity();
|
|
|
|
BeanUtils.copyProperties(item, thrProductsEntity);
|
|
|
|
BeanUtil.copyProperties(item, thrProductsEntity);
|
|
|
|
return thrProductsEntity;
|
|
|
|
return thrProductsEntity;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
).collect(Collectors.toList());
|
|
|
|
).collect(Collectors.toList());
|
|
|
@ -527,7 +528,7 @@ public class ThrProductsDlService {
|
|
|
|
if (id != null) {
|
|
|
|
if (id != null) {
|
|
|
|
ThrProductsEntity thrProductsEntity = thrProductsService.selectById(id);
|
|
|
|
ThrProductsEntity thrProductsEntity = thrProductsService.selectById(id);
|
|
|
|
ThrProductsResponse thrProductsResponse = new ThrProductsResponse();
|
|
|
|
ThrProductsResponse thrProductsResponse = new ThrProductsResponse();
|
|
|
|
BeanUtils.copyProperties(thrProductsEntity, thrProductsResponse);
|
|
|
|
BeanUtil.copyProperties(thrProductsEntity, thrProductsResponse);
|
|
|
|
jsonData.add(thrProductsResponse);
|
|
|
|
jsonData.add(thrProductsResponse);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
jsonData = thrProductsService.filterJoinThrProducts(filterThrProductsRequest);
|
|
|
|
jsonData = thrProductsService.filterJoinThrProducts(filterThrProductsRequest);
|
|
|
@ -583,14 +584,14 @@ public class ThrProductsDlService {
|
|
|
|
|
|
|
|
|
|
|
|
if (thrSystemDetailEntity.getFromType() == 0) {
|
|
|
|
if (thrSystemDetailEntity.getFromType() == 0) {
|
|
|
|
FilterThrProductsRequest filterThrProductsRequest = new FilterThrProductsRequest();
|
|
|
|
FilterThrProductsRequest filterThrProductsRequest = new FilterThrProductsRequest();
|
|
|
|
BeanUtils.copyProperties(thrProductsExportRequest, filterThrProductsRequest);
|
|
|
|
BeanUtil.copyProperties(thrProductsExportRequest, filterThrProductsRequest);
|
|
|
|
List<ThrProductsEntity> thrProductsEntities = exportThrProducts(filterThrProductsRequest);
|
|
|
|
List<ThrProductsEntity> thrProductsEntities = exportThrProducts(filterThrProductsRequest);
|
|
|
|
exportData.addAll(thrProductsEntities);
|
|
|
|
exportData.addAll(thrProductsEntities);
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
List<ThrProductsResponse> exportData1 = new ArrayList<>();
|
|
|
|
List<ThrProductsResponse> exportData1 = new ArrayList<>();
|
|
|
|
FilterThrProductsRequest filterThrInvProductsRequest = new FilterThrProductsRequest();
|
|
|
|
FilterThrProductsRequest filterThrInvProductsRequest = new FilterThrProductsRequest();
|
|
|
|
BeanUtils.copyProperties(thrProductsExportRequest, filterThrInvProductsRequest);
|
|
|
|
BeanUtil.copyProperties(thrProductsExportRequest, filterThrInvProductsRequest);
|
|
|
|
List<ThrProductsResponse> jsonData = genJsonData(null, filterThrInvProductsRequest);
|
|
|
|
List<ThrProductsResponse> jsonData = genJsonData(null, filterThrInvProductsRequest);
|
|
|
|
exportData1.addAll(jsonData);
|
|
|
|
exportData1.addAll(jsonData);
|
|
|
|
}
|
|
|
|
}
|
|
|
|