bug修改

master
anthonywj 2 years ago
parent e58c9f6fdf
commit 0ed7565f58

@ -15,7 +15,7 @@ public enum BasicExportTypeEnum {
/**
* DI
*/
COUNTRY_DI_DATA("country_di_data", "国家库DI数据"),
// COUNTRY_DI_DATA("country_di_data", "国家库DI数据"),
/**
*

@ -33,7 +33,7 @@ public class BasicProcessStatus {
public static final String NEW_ALL_DATA = "7";
public static final String NEW_ALL_BUS = "8";
public static final String NEW_ALL_ORDER = "出入库扫码单据";
public static final String NEW_ALL_UDIS = "10";
public static final String NEW_ALL_UDIS = "国家库数据";
public static final String ALL_BUS_ORDER = "业务单据";

@ -8,7 +8,7 @@ import java.util.List;
public class BaseSyncResponse {
private String taskId;
private List<String> files;
private List<String> syncFiles;
private List<String> uploadFiles;
private String updateTime;
private String type;

@ -31,12 +31,16 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.awt.*;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import static com.glxp.sale.admin.constant.BasicProcessStatus.NEW_ALL_UDIS;
@Slf4j
@Service
public class DlAllDataService {
@ -168,7 +172,6 @@ public class DlAllDataService {
if (systemParamConfigEntity.getParamValue().equals("1")) {
SystemParamConfigEntity downstream = systemParamConfigService.selectByParamKey("sync_downstream_enable");
for (BasicExportStatusEntity basicExportStatusEntity : basicExportStatusEntities) {
BaseResponse<String> baseResponse = null;
SpsSyncDataRequest spsSyncDataRequest = new SpsSyncDataRequest();
if (basicExportStatusEntity.getFromType() == 0) {
@ -257,6 +260,12 @@ public class DlAllDataService {
String dataStr = obj.getStr("data");
if (StrUtil.isNotBlank(dataStr)) {
RelaySyncDto bean = JSONUtil.toBean(dataStr, RelaySyncDto.class);
JSONObject jsonObject = JSONObject.parseObject(bean.getFileContent());
JSONArray jsonArray = jsonObject.getJSONArray("syncFiles");
if (jsonArray != null) {
List<String> list = JSONArray.parseArray(jsonArray.toJSONString(), String.class);
idcService.batchDownloadFile(spGetHttp.getSpmsUrl(), list.toArray(new String[list.size()]));
}
if (StrUtil.isNotBlank(bean.getTaskId())) {
// 将数据写入文件
try {
@ -335,7 +344,7 @@ public class DlAllDataService {
BasicExportStatusRequest basicExportStatusRequest = new BasicExportStatusRequest();
basicExportStatusRequest.setIdDatas(ConstantStatus.SYNC_DI_PRODUCTS);
basicExportStatusRequest.setStatus(BasicExportStatusEnum.WAIT_BUILT.getCode());
basicExportStatusRequest.setType(BasicExportTypeEnum.COUNTRY_DI_DATA.getRemark());
basicExportStatusRequest.setType(NEW_ALL_UDIS);
basicExportStatusRequest.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL);
BaseResponse<List<BasicExportStatusEntity>> basicStatuss = spGetHttp.getBasicStatus(basicExportStatusRequest);
if (CollUtil.isNotEmpty(basicStatuss.getData())) {
@ -365,14 +374,14 @@ public class DlAllDataService {
myEntity.setStatus(0);
myEntity.setIdDatas(ConstantStatus.SYNC_DI_PRODUCTS);
myEntity.setUpdateTime(new Date());
myEntity.setType(BasicExportTypeEnum.COUNTRY_DI_DATA.getRemark());
myEntity.setType(NEW_ALL_UDIS);
myEntity.setStartTime(DateUtil.getDateTime());
myEntity.setRemark("国家库DI信息" + spSyncUdiResponse.getProductInfoEntityList().size() + " 条");
basicExportService.insertExportStatus(myEntity);
if (downstream.getParamValue().equals("1")) {
// String datas = JSON.toJSON(spSyncUdiResponse).toString();
// redisUtil.set(key, datas);
String fileName = filePath + "upload/" + BasicExportTypeEnum.COUNTRY_DI_DATA.getRemark() + "-" + key + ".udi";
String fileName = filePath + "upload/" + NEW_ALL_UDIS + "-" + key + ".udi";
String datas = JSON.toJSON(spSyncUdiResponse).toString();
FileUtils.SaveFileAs(datas, fileName);
@ -422,7 +431,7 @@ public class DlAllDataService {
myEntity.setTaskId(basicExportStatusEntity.getId());
myEntity.setStatus(0);
myEntity.setUpdateTime(new Date());
myEntity.setType(BasicProcessStatus.NEW_ALL_UDIS);
myEntity.setType(NEW_ALL_UDIS);
myEntity.setStartTime(DateUtil.getDateTime());
myEntity.setUpdateTime(new Date());
myEntity.setIdDatas(ConstantStatus.SYNC_DI_PRODUCTS);
@ -431,7 +440,7 @@ public class DlAllDataService {
if (downstream.getParamValue().equals("1")) {
// String datas = JSON.toJSON(spSyncUdiResponse).toString();
// redisUtil.set(key, datas);
String fileName = filePath + "upload/" + BasicProcessStatus.NEW_ALL_UDIS + "-" + key + ".udi";
String fileName = filePath + "upload/" + NEW_ALL_UDIS + "-" + key + ".udi";
String datas = JSON.toJSON(spSyncUdiResponse).toString();
FileUtils.SaveFileAs(datas, fileName);
myEntity.setStatus(Constant.SYNC_STATUS_WAIT_DL);
@ -479,7 +488,7 @@ public class DlAllDataService {
myEntity.setStartTime(DateUtil.getDateTime());
myEntity.setIdDatas(ConstantStatus.SYNC_DI_PRODUCTS);
myEntity.setTransportType(BasicProcessStatus.INTERFACE_TYPE);
myEntity.setType(BasicProcessStatus.NEW_ALL_UDIS);
myEntity.setType(NEW_ALL_UDIS);
myEntity.setRemark("国家库DI信息" + spSyncUdiResponse.getUdiCompanyEntities().size() + " 条\n"
+ "医疗器械注册人信息:" + spSyncUdiResponse.getUdiCompanyEntities().size() + "条\n");
basicExportService.insertExportStatus(myEntity);

Loading…
Cancel
Save