feat: 手工关联、拼箱关联数据同步

dev_ksck_axxyy
chenhc 6 months ago
parent 483988bf34
commit 81313299ae

@ -73,6 +73,11 @@ public enum BasicExportTypeEnum {
PRODUCE_BUSINESS_DATA("thr_manufacturer", "生产企业数据"), PRODUCE_BUSINESS_DATA("thr_manufacturer", "生产企业数据"),
/**
*
*/
DRUG_DATA_TASK("drug_data_task", "药品关联信息任"),
; ;
@EnumValue @EnumValue
private String key; private String key;

@ -17,6 +17,8 @@ import com.glxp.api.constant.*;
import com.glxp.api.constant.Constant; import com.glxp.api.constant.Constant;
import com.glxp.api.dao.auth.*; import com.glxp.api.dao.auth.*;
import com.glxp.api.dao.basic.*; 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.dev.*;
import com.glxp.api.dao.inout.*; import com.glxp.api.dao.inout.*;
import com.glxp.api.dao.inv.*; 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.dao.thrsys.*;
import com.glxp.api.entity.auth.*; import com.glxp.api.entity.auth.*;
import com.glxp.api.entity.basic.*; 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.dev.*;
import com.glxp.api.entity.inout.*; import com.glxp.api.entity.inout.*;
import com.glxp.api.entity.inv.DeviceInspectTaskEntity; 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.res.sync.*;
import com.glxp.api.service.auth.InvWarehouseService; import com.glxp.api.service.auth.InvWarehouseService;
import com.glxp.api.service.basic.IBasicBussinessTypeService; 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.dev.DeviceUpkeepService;
import com.glxp.api.service.inout.IoAddInoutService; import com.glxp.api.service.inout.IoAddInoutService;
import com.glxp.api.service.inout.IoCheckInoutService; import com.glxp.api.service.inout.IoCheckInoutService;
@ -401,6 +407,9 @@ public class SpsSyncDownloadController {
case PRODUCE_BUSINESS_DATA: case PRODUCE_BUSINESS_DATA:
saveUploadProBusinessData(JSONUtil.toBean(obj, SpsSyncProBusinessDataResponse.class)); saveUploadProBusinessData(JSONUtil.toBean(obj, SpsSyncProBusinessDataResponse.class));
break; break;
case DRUG_DATA_TASK:
saveUploadDrugData(JSONUtil.toBean(obj, SpsSyncDrugDataTaskResponse.class));
break;
} }
String taskId = obj.getStr("taskId"); String taskId = obj.getStr("taskId");
BasicDownloadStatusEntity downloadStatus = BasicDownloadStatusEntity.builder() 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 { private String writeFile(String filePath, String fileDesc, String content) throws IOException {
filePath = String.format("%s/%s", filePath, DateUtil.getDate()); filePath = String.format("%s/%s", filePath, DateUtil.getDate());

@ -1,7 +1,9 @@
package com.glxp.api.dao.collect; package com.glxp.api.dao.collect;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.collect.RelCodeBatch; import com.glxp.api.entity.collect.RelCodeBatch;
import com.glxp.api.entity.collect.RelCodeDetail;
import com.glxp.api.req.collect.RelCodeBatchRequest; import com.glxp.api.req.collect.RelCodeBatchRequest;
import com.glxp.api.res.collect.RelCodeBatchResponse; import com.glxp.api.res.collect.RelCodeBatchResponse;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -9,7 +11,7 @@ import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
@Mapper @Mapper
public interface RelCodeBatchMapper extends BaseMapper<RelCodeBatch> { public interface RelCodeBatchMapper extends BaseMapperPlus<RelCodeBatchMapper, RelCodeBatch,RelCodeBatch> {
List<RelCodeBatchResponse> filterList(RelCodeBatchRequest relCodeBatchRequest); List<RelCodeBatchResponse> filterList(RelCodeBatchRequest relCodeBatchRequest);
} }

@ -1,7 +1,10 @@
package com.glxp.api.dao.collect; package com.glxp.api.dao.collect;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.dao.thrsys.ThrManufacturerMapper;
import com.glxp.api.entity.collect.RelCodeDetail; import com.glxp.api.entity.collect.RelCodeDetail;
import com.glxp.api.entity.thrsys.ThrManufacturerEntity;
import com.glxp.api.req.collect.RelCodeDetailRequest; import com.glxp.api.req.collect.RelCodeDetailRequest;
import com.glxp.api.res.collect.RelCodeDetailResponse; import com.glxp.api.res.collect.RelCodeDetailResponse;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -9,7 +12,7 @@ import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
@Mapper @Mapper
public interface RelCodeDetailMapper extends BaseMapper<RelCodeDetail> { public interface RelCodeDetailMapper extends BaseMapperPlus<RelCodeDetailMapper,RelCodeDetail,RelCodeDetail> {
List<RelCodeDetailResponse> filterList(RelCodeDetailRequest relCodeDetailRequest); List<RelCodeDetailResponse> filterList(RelCodeDetailRequest relCodeDetailRequest);
} }

@ -0,0 +1,16 @@
package com.glxp.api.res.sync;
import com.glxp.api.entity.collect.RelCodeBatch;
import com.glxp.api.entity.collect.RelCodeDetail;
import lombok.Data;
import java.util.List;
@Data
public class SpsSyncDrugDataTaskResponse extends BaseSyncResponse {
public List<RelCodeBatch> relCodeBatches;
public List<RelCodeDetail> relCodeDetails;
}
Loading…
Cancel
Save