|
|
|
@ -17,6 +17,8 @@ import com.glxp.api.constant.*;
|
|
|
|
|
import com.glxp.api.constant.Constant;
|
|
|
|
|
import com.glxp.api.dao.auth.*;
|
|
|
|
|
import com.glxp.api.dao.basic.*;
|
|
|
|
|
import com.glxp.api.dao.collect.RelCodeBatchMapper;
|
|
|
|
|
import com.glxp.api.dao.collect.RelCodeDetailMapper;
|
|
|
|
|
import com.glxp.api.dao.dev.*;
|
|
|
|
|
import com.glxp.api.dao.inout.*;
|
|
|
|
|
import com.glxp.api.dao.inv.*;
|
|
|
|
@ -26,6 +28,8 @@ import com.glxp.api.dao.system.*;
|
|
|
|
|
import com.glxp.api.dao.thrsys.*;
|
|
|
|
|
import com.glxp.api.entity.auth.*;
|
|
|
|
|
import com.glxp.api.entity.basic.*;
|
|
|
|
|
import com.glxp.api.entity.collect.RelCodeBatch;
|
|
|
|
|
import com.glxp.api.entity.collect.RelCodeDetail;
|
|
|
|
|
import com.glxp.api.entity.dev.*;
|
|
|
|
|
import com.glxp.api.entity.inout.*;
|
|
|
|
|
import com.glxp.api.entity.inv.DeviceInspectTaskEntity;
|
|
|
|
@ -40,6 +44,8 @@ import com.glxp.api.req.sync.SyncUpLoadRequest;
|
|
|
|
|
import com.glxp.api.res.sync.*;
|
|
|
|
|
import com.glxp.api.service.auth.InvWarehouseService;
|
|
|
|
|
import com.glxp.api.service.basic.IBasicBussinessTypeService;
|
|
|
|
|
import com.glxp.api.service.collect.RelCodeBatchService;
|
|
|
|
|
import com.glxp.api.service.collect.RelCodeDetailService;
|
|
|
|
|
import com.glxp.api.service.dev.DeviceUpkeepService;
|
|
|
|
|
import com.glxp.api.service.inout.IoAddInoutService;
|
|
|
|
|
import com.glxp.api.service.inout.IoCheckInoutService;
|
|
|
|
@ -401,6 +407,9 @@ public class SpsSyncDownloadController {
|
|
|
|
|
case PRODUCE_BUSINESS_DATA:
|
|
|
|
|
saveUploadProBusinessData(JSONUtil.toBean(obj, SpsSyncProBusinessDataResponse.class));
|
|
|
|
|
break;
|
|
|
|
|
case DRUG_DATA_TASK:
|
|
|
|
|
saveUploadDrugData(JSONUtil.toBean(obj, SpsSyncDrugDataTaskResponse.class));
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
String taskId = obj.getStr("taskId");
|
|
|
|
|
BasicDownloadStatusEntity downloadStatus = BasicDownloadStatusEntity.builder()
|
|
|
|
@ -426,6 +435,26 @@ public class SpsSyncDownloadController {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
RelCodeDetailMapper relCodeDetailMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
RelCodeBatchMapper relCodeBatchMapper;
|
|
|
|
|
|
|
|
|
|
private void saveUploadDrugData(SpsSyncDrugDataTaskResponse bean) {
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getRelCodeBatches())) {
|
|
|
|
|
for (RelCodeBatch entity : bean.getRelCodeBatches()) {
|
|
|
|
|
entity.setUpdateTime(null);
|
|
|
|
|
}
|
|
|
|
|
boolean b = relCodeBatchMapper.replaceBatchs(bean.getRelCodeBatches());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getRelCodeDetails())) {
|
|
|
|
|
// for (RelCodeDetail entity : bean.getRelCodeDetails()) {
|
|
|
|
|
// entity.setUpdateTime(null);
|
|
|
|
|
// }
|
|
|
|
|
boolean b = relCodeDetailMapper.replaceBatchs(bean.getRelCodeDetails());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private String writeFile(String filePath, String fileDesc, String content) throws IOException {
|
|
|
|
|
filePath = String.format("%s/%s", filePath, DateUtil.getDate());
|
|
|
|
|