diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/sync/BasicDownloadController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/sync/BasicDownloadController.java index 5d0f460..6f0f077 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/sync/BasicDownloadController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/sync/BasicDownloadController.java @@ -1,20 +1,24 @@ package com.glxp.sale.admin.controller.sync; +import cn.hutool.core.collection.CollUtil; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; import com.glxp.sale.admin.constant.BasicProcessStatus; import com.glxp.sale.admin.entity.sync.BasicExportStatusEntity; +import com.glxp.sale.admin.req.info.DeleteRequest; import com.glxp.sale.admin.req.sync.BasicExportStatusRequest; import com.glxp.sale.admin.res.sync.*; import com.glxp.sale.admin.service.sync.BasicExportService; import com.glxp.sale.admin.util.RedisUtil; import com.glxp.sale.common.res.BaseResponse; import com.glxp.sale.common.util.ResultVOUtils; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import java.util.List; @RestController public class BasicDownloadController { @@ -25,6 +29,28 @@ public class BasicDownloadController { @Resource RedisUtil redisUtil; + + @GetMapping("/spssync/basic/udiinfo/getStatus") + public BaseResponse getStatus(BasicExportStatusRequest basicExportStatusRequest) { + List basicExportStatusEntities = basicExportService.filterExportStatus(basicExportStatusRequest); + + if (CollUtil.isNotEmpty(basicExportStatusEntities)) { + for (BasicExportStatusEntity basicExportStatusEntity : basicExportStatusEntities) { + basicExportStatusEntity.setFromType(1); + } + } + return ResultVOUtils.success(basicExportStatusEntities); + } + + @PostMapping("/spssync/basic/udiinfo/deleteByStatus") + public BaseResponse deleteByStatus(@RequestBody DeleteRequest deleteRequest) { + +// boolean b = basicExportService.deleteById(deleteRequest.getId()); + redisUtil.del(deleteRequest.getId()); + return ResultVOUtils.success("删除成功!"); + } + + @PostMapping("/spssync/basic/udiinfo/downloadByStatus") public BaseResponse downloadByStatus(@RequestBody BasicExportStatusRequest basicExportStatusRequest) { @@ -59,9 +85,13 @@ public class BasicDownloadController { basicExportService.finished(basicExportStatusRequest.getId()); return ResultVOUtils.success(spsSyncDataResponse); } else if (basicExportStatusRequest.getType() == BasicProcessStatus.NEW_ALL_UDIS) {//单据 + + BasicExportStatusEntity basicExportStatusEntity = basicExportService.findById(basicExportStatusRequest.getId()); + String data = (String) redisUtil.get(basicExportStatusRequest.getId() + ""); SpSyncUdiResponse spSyncUdiResponse = JSONObject.parseObject(data, new TypeReference() { }); + spSyncUdiResponse.setTaskId(basicExportStatusEntity.getTaskId()); basicExportService.finished(basicExportStatusRequest.getId()); return ResultVOUtils.success(spSyncUdiResponse); } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/entity/sync/BasicExportStatusEntity.java b/api-admin/src/main/java/com/glxp/sale/admin/entity/sync/BasicExportStatusEntity.java index 9df5803..a87f61c 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/entity/sync/BasicExportStatusEntity.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/entity/sync/BasicExportStatusEntity.java @@ -17,7 +17,7 @@ public class BasicExportStatusEntity { private Integer transportType; private Date updateTime; private Integer scheduleType; - private int fromType; + private int fromType; //来源类型:0:默认,自助平台,1:中继服务 private String startTime; private String endTime; private String remark; diff --git a/api-admin/src/main/java/com/glxp/sale/admin/entity/sync/OrderEntity.java b/api-admin/src/main/java/com/glxp/sale/admin/entity/sync/OrderEntity.java index a3f19b3..ef33952 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/entity/sync/OrderEntity.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/entity/sync/OrderEntity.java @@ -49,6 +49,6 @@ public class OrderEntity { private boolean preCheck; //审核时间 private Date auditTime; + private boolean syncOutChange; - } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/sync/OrderFilterRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/sync/OrderFilterRequest.java index 1048ff1..d66d30b 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/req/sync/OrderFilterRequest.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/sync/OrderFilterRequest.java @@ -28,4 +28,10 @@ public class OrderFilterRequest extends ListPageRequest { private String userId; private String wmsUserId; private String wmsUserName; + + private Integer checkStatus; + private String stockOrderId; + private Integer entrustId; + private boolean entrust; + } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/res/sync/SpsSyncOrderResponse.java b/api-admin/src/main/java/com/glxp/sale/admin/res/sync/SpsSyncOrderResponse.java index daa826d..22c49cc 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/res/sync/SpsSyncOrderResponse.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/res/sync/SpsSyncOrderResponse.java @@ -27,7 +27,7 @@ public class SpsSyncOrderResponse { remark.append("单据详情:").append(orderDetailEntityList.size()).append(" 条\n"); } if (CollUtil.isNotEmpty(warehouseEntityList)) { - remark.append("库存信息:").append(warehouseEntityList.size()).append(" 条\n"); + remark.append("UDI码信息:").append(warehouseEntityList.size()).append(" 条\n"); } return remark.toString(); } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/sync/BasicExportService.java b/api-admin/src/main/java/com/glxp/sale/admin/service/sync/BasicExportService.java index ad02ba6..4bf7977 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/sync/BasicExportService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/sync/BasicExportService.java @@ -9,6 +9,8 @@ import java.util.List; public interface BasicExportService { + BasicExportStatusEntity findById(String id); + List filterExportStatus(BasicExportStatusRequest basicExportStatusRequest); boolean insertExportStatus(BasicExportStatusEntity ioOrderStatusEntity); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/sync/impl/BasicExportServiceImpl.java b/api-admin/src/main/java/com/glxp/sale/admin/service/sync/impl/BasicExportServiceImpl.java index 10064ff..2416805 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/sync/impl/BasicExportServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/sync/impl/BasicExportServiceImpl.java @@ -1,5 +1,6 @@ package com.glxp.sale.admin.service.sync.impl; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; import com.github.pagehelper.PageHelper; import com.glxp.sale.admin.dao.sync.BasicExportDao; @@ -20,6 +21,17 @@ public class BasicExportServiceImpl implements BasicExportService { @Resource BasicExportDao basicExportDao; + @Override + public BasicExportStatusEntity findById(String id) { + BasicExportStatusRequest basicExportStatusRequest = new BasicExportStatusRequest(); + basicExportStatusRequest.setId(id); + List basicExportStatusEntities = basicExportDao.filterExportStatus(basicExportStatusRequest); + if (CollUtil.isNotEmpty(basicExportStatusEntities)) { + basicExportStatusEntities.get(0); + } + return null; + } + @Override public List filterExportStatus(BasicExportStatusRequest basicExportStatusRequest) { if (basicExportStatusRequest == null) { diff --git a/api-admin/src/main/java/com/glxp/sale/admin/thread/DlAllDataService.java b/api-admin/src/main/java/com/glxp/sale/admin/thread/DlAllDataService.java index 2fbf1c1..5023390 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/thread/DlAllDataService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/thread/DlAllDataService.java @@ -164,6 +164,7 @@ public class DlAllDataService { myEntity.setTaskId(syncOrderResponse.getTaskId()); myEntity.setStatus(0); myEntity.setUpdateTime(new Date()); + basicExportStatusEntity.setTransportType(BasicProcessStatus.INTERFACE_TYPE); myEntity.setStartTime(DateUtil.getDateTime()); myEntity.setIdDatas(ConstantStatus.SYNC_SCAN_ORDER); myEntity.setType(BasicProcessStatus.NEW_ALL_ORDER); @@ -334,14 +335,14 @@ public class DlAllDataService { //记录下载日志 BasicExportStatusEntity myEntity = new BasicExportStatusEntity(); myEntity.setId(key); - myEntity.setTaskId(spSyncUdiResponse.getTaskId()); + myEntity.setTaskId(basicExportStatusEntity.getId()); myEntity.setStatus(0); myEntity.setIdDatas(ConstantStatus.SYNC_DI_PRODUCTS); myEntity.setUpdateTime(new Date()); myEntity.setType(BasicProcessStatus.NEW_ALL_UDIS); myEntity.setTransportType(BasicProcessStatus.INTERFACE_TYPE); myEntity.setStartTime(DateUtil.getDateTime()); - myEntity.setRemark("国家库DI信息:" + spSyncUdiResponse.getUdiCompanyEntities().size() + " 条"); + myEntity.setRemark("国家库DI信息:" + spSyncUdiResponse.getProductInfoEntityList().size() + " 条"); basicExportService.insertExportStatus(myEntity); } else { String path = getPath(); @@ -377,7 +378,7 @@ public class DlAllDataService { redisUtil.set(key, datas); BasicExportStatusEntity myEntity = new BasicExportStatusEntity(); myEntity.setId(key); - myEntity.setTaskId(spSyncUdiResponse.getTaskId()); + myEntity.setTaskId(basicExportStatusEntity.getId()); myEntity.setStatus(0); myEntity.setUpdateTime(new Date()); myEntity.setType(BasicProcessStatus.NEW_ALL_UDIS); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/thread/ScanDownloadService.java b/api-admin/src/main/java/com/glxp/sale/admin/thread/ScanDownloadService.java index d3da4b1..fadb5e3 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/thread/ScanDownloadService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/thread/ScanDownloadService.java @@ -100,6 +100,7 @@ public class ScanDownloadService { basicExportStatusEntity.setStatus(1); basicExportStatusEntity.setIdDatas(file.getPath()); basicExportStatusEntity.setType(BasicProcessStatus.NEW_ALL_BUS); + basicExportStatusEntity.setTransportType(BasicProcessStatus.FILE_TYPE); basicExportStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL); basicExportService.insertExportStatus(basicExportStatusEntity); SpsSyncBusResponse baseResponse = @@ -130,6 +131,7 @@ public class ScanDownloadService { basicExportStatusEntity.setUpdateTime(new Date()); basicExportStatusEntity.setStatus(1); basicExportStatusEntity.setIdDatas(file.getPath()); + basicExportStatusEntity.setTransportType(BasicProcessStatus.FILE_TYPE); basicExportStatusEntity.setType(BasicProcessStatus.NEW_ALL_ORDER); basicExportStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL); basicExportService.insertExportStatus(basicExportStatusEntity);