|
|
|
@ -3,15 +3,19 @@ package com.glxp.api.admin.thread;
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.hutool.core.io.file.FileWriter;
|
|
|
|
|
import cn.hutool.core.util.ReflectUtil;
|
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
|
import com.glxp.api.admin.constant.BasicProcessStatus;
|
|
|
|
|
import com.glxp.api.admin.dao.basic.UdiInfoDao;
|
|
|
|
|
import com.glxp.api.admin.dao.basic.UdiRelevanceDao;
|
|
|
|
|
import com.glxp.api.admin.dao.thrsys.ThrProductsDao;
|
|
|
|
|
import com.glxp.api.admin.entity.basic.*;
|
|
|
|
|
import com.glxp.api.admin.entity.thrsys.ThrProductsEntity;
|
|
|
|
|
import com.glxp.api.admin.req.basic.BasicUnitMaintainFilterRequest;
|
|
|
|
|
import com.glxp.api.admin.req.basic.CorpsExportRequest;
|
|
|
|
|
import com.glxp.api.admin.req.basic.FilterUdiInfoRequest;
|
|
|
|
|
import com.glxp.api.admin.req.basic.UdiInfoExportRequest;
|
|
|
|
|
import com.glxp.api.admin.req.thrsys.FilterThrProductsRequest;
|
|
|
|
|
import com.glxp.api.admin.res.basic.UdiRelevanceExportJsonResponse;
|
|
|
|
|
import com.glxp.api.admin.res.basic.UdiRelevanceResponse;
|
|
|
|
|
import com.glxp.api.admin.service.basic.BasicUnitMaintainService;
|
|
|
|
@ -25,6 +29,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.lang.reflect.Field;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
@ -44,6 +49,8 @@ public class BasicGenJsonService {
|
|
|
|
|
UdiRelevanceDao udiRelevanceDao;
|
|
|
|
|
@Resource
|
|
|
|
|
UdiInfoDao udiInfoDao;
|
|
|
|
|
@Resource
|
|
|
|
|
ThrProductsDao thrProductsDao;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void exportCorp(String genKey, CorpsExportRequest corpsExportRequest) {
|
|
|
|
@ -135,6 +142,29 @@ public class BasicGenJsonService {
|
|
|
|
|
});
|
|
|
|
|
List<UdiInfoEntity> udiInfoEntities = udiInfoDao.batchSelectByUuid(uuids);
|
|
|
|
|
List<UdiRelevanceEntity> udiRelevanceEntities = udiRelevanceDao.batchSelectByUuid(uuids);
|
|
|
|
|
if (CollUtil.isNotEmpty(udiRelevanceEntities)) {
|
|
|
|
|
List<ThrProductsEntity> thrProductsEntities = new ArrayList<>(udiRelevanceEntities.size());
|
|
|
|
|
Field[] fields = ReflectUtil.getFields(UdiRelevanceEntity.class);
|
|
|
|
|
udiRelevanceEntities.forEach(udiRelevanceEntity -> {
|
|
|
|
|
for (Field field : fields) {
|
|
|
|
|
if (field.getName().contains("thirdId")) {
|
|
|
|
|
Object fieldValue = ReflectUtil.getFieldValue(udiRelevanceEntity, field);
|
|
|
|
|
if (null != fieldValue) {
|
|
|
|
|
FilterThrProductsRequest filter = new FilterThrProductsRequest();
|
|
|
|
|
filter.setCode(String.valueOf(fieldValue));
|
|
|
|
|
filter.setThirdSysFk("thirdId");
|
|
|
|
|
List<ThrProductsEntity> result = thrProductsDao.filterThrProductsRequest(filter);
|
|
|
|
|
if (CollUtil.isNotEmpty(result)) {
|
|
|
|
|
thrProductsEntities.addAll(result);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
if (CollUtil.isNotEmpty(thrProductsEntities)) {
|
|
|
|
|
exportData.setThrProductsEntities(thrProductsEntities);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
List<UdiInfoEntity> udiInfo = exportData.getUdiInfoEntities();
|
|
|
|
|
List<UdiRelevanceEntity> udiRelevance = exportData.getUdiRelevanceEntities();
|
|
|
|
|
udiInfo.addAll(udiInfoEntities);
|
|
|
|
|