diff --git a/src/main/java/com/glxp/api/constant/BasicExportStatusTimeEnum.java b/src/main/java/com/glxp/api/constant/BasicExportStatusTimeEnum.java index 6e5b2ac0..8e9089e5 100644 --- a/src/main/java/com/glxp/api/constant/BasicExportStatusTimeEnum.java +++ b/src/main/java/com/glxp/api/constant/BasicExportStatusTimeEnum.java @@ -112,6 +112,13 @@ public enum BasicExportStatusTimeEnum { * 自动建业务单设置 */ BUS_TYPE_CHANGE("bus_type_change","自动建业务单设置"), + + /** + * 设备任务同步 + */ + DEVICE_TASK("device_task", "设备任务"), + + ; @EnumValue private String key; diff --git a/src/main/java/com/glxp/api/constant/BasicExportTypeEnum.java b/src/main/java/com/glxp/api/constant/BasicExportTypeEnum.java index 34258cd7..b1b50976 100644 --- a/src/main/java/com/glxp/api/constant/BasicExportTypeEnum.java +++ b/src/main/java/com/glxp/api/constant/BasicExportTypeEnum.java @@ -54,6 +54,12 @@ public enum BasicExportTypeEnum { ORDER_INVOICE("io_order_invoice", "扫码单据发票信息"), + /** + * 设备任务同步 + */ + DEVICE_TASK("device_task", "设备任务"), + + // // NEW_ALL_ORDER("all_order", "出入库扫码单据"), // ALL_BUS_ORDER("all_bus_order", "业务单据"), diff --git a/src/main/java/com/glxp/api/constant/SocketMsgType.java b/src/main/java/com/glxp/api/constant/SocketMsgType.java index 59939dde..4a5a706c 100644 --- a/src/main/java/com/glxp/api/constant/SocketMsgType.java +++ b/src/main/java/com/glxp/api/constant/SocketMsgType.java @@ -1,21 +1,41 @@ package com.glxp.api.constant; +/** + * // 任务类型 + */ public interface SocketMsgType { String DL_ALL_DATA = "DL_ALL_DATA"; //基础数据同步 String DL_NOTICE = "DL_NOTICE"; //通知类消息 + + /** + * 发票确认 + */ + String TASK_INVOICE_CONFIRM = "TASK_INVOICE_CONFIRM"; // /** - * 任务类型 + * 耗材字典删除 */ - String TASK_INVOICE_CONFIRM = "TASK_INVOICE_CONFIRM"; //发票确认 + String BASIC_DATA_DELETE = "BASIC_DATA_DELETE"; // - String BASIC_DATA_DELETE = "BASIC_DATA_DELETE"; //耗材字典删除 + /** + * 入院物资维护 + */ + String BASIC_MANAGE_DELETE = "BASIC_MANAGE_DELETE"; // - String BASIC_MANAGE_DELETE = "BASIC_MANAGE_DELETE"; //入援物资维护 + /** + * 供应商字典 + */ + String BASIC_CORP_MAINTAIN_DELETE = "BASIC_CORP_MAINTAIN_DELETE"; // - String BASIC_CORP_MAINTAIN_DELETE = "BASIC_CORP_MAINTAIN_DELETE"; //供应商字典 + /** + * 单据类型 + */ + String BASIC_BUSINESS_TYPE_DELETE = "BASIC_BUSINESS_TYPE_DELETE"; // - String BASIC_BUSINESS_TYPE_DELETE = "BASIC_BUSINESS_TYPE_DELETE"; //单据类型 + /** + * 设备任务删除 + */ + String DEV_TASK_DEL = "DEV_TASK_DEL"; } diff --git a/src/main/java/com/glxp/api/constant/SyncDelType.java b/src/main/java/com/glxp/api/constant/SyncDelType.java new file mode 100644 index 00000000..1f927afa --- /dev/null +++ b/src/main/java/com/glxp/api/constant/SyncDelType.java @@ -0,0 +1,21 @@ +package com.glxp.api.constant; + +public interface SyncDelType { + + /** + * 耗材字典 + */ + String BASIC_MAINTAIN = "BASIC_MAINTAIN"; //耗材字典 + + String BASIC_MANAGE = "BASIC_MANAGE"; //供应商器械信息 + + String BASIC_CORP_MAINTAIN = "BASIC_CORP_MAINTAIN"; //往来信息维护 + + String BASIC_BUSINESS_TYPE = "BASIC_BUSINESS_TYPE"; //单据类型设置 + + /** + * 设备任务 + */ + String DEV_TASK = "DEV_TASK"; + +} diff --git a/src/main/java/com/glxp/api/controller/basic/BasicBussinessTypeController.java b/src/main/java/com/glxp/api/controller/basic/BasicBussinessTypeController.java index 2b49671d..e79288e8 100644 --- a/src/main/java/com/glxp/api/controller/basic/BasicBussinessTypeController.java +++ b/src/main/java/com/glxp/api/controller/basic/BasicBussinessTypeController.java @@ -14,6 +14,7 @@ import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.constant.BusinessType; import com.glxp.api.constant.ConstantType; +import com.glxp.api.constant.SyncDelType; import com.glxp.api.controller.BaseController; import com.glxp.api.entity.basic.BasicBussinessTypeEntity; import com.glxp.api.http.sync.SpGetHttpClient; @@ -268,7 +269,7 @@ public class BasicBussinessTypeController extends BaseController { //调用同步删除方法 BasicDataRequest basicDataRequest = new BasicDataRequest(); basicDataRequest.setDeleteRequest(deleteRequest); - basicDataRequest.setKey("BASIC_BUSINESS_TYPE"); + basicDataRequest.setKey(SyncDelType.BASIC_BUSINESS_TYPE); Long userId = getUserId(); spGetHttpClient.deleteBasicData(basicDataRequest,userId+""); diff --git a/src/main/java/com/glxp/api/controller/basic/BasicCorpController.java b/src/main/java/com/glxp/api/controller/basic/BasicCorpController.java index 57467885..56932e4d 100644 --- a/src/main/java/com/glxp/api/controller/basic/BasicCorpController.java +++ b/src/main/java/com/glxp/api/controller/basic/BasicCorpController.java @@ -7,6 +7,7 @@ import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.constant.ConstantStatus; +import com.glxp.api.constant.SyncDelType; import com.glxp.api.controller.BaseController; import com.glxp.api.entity.basic.BasicCorpEntity; import com.glxp.api.entity.system.SystemParamConfigEntity; @@ -351,7 +352,7 @@ public class BasicCorpController extends BaseController { //调用同步删除的方法 BasicDataRequest basicDataRequest = new BasicDataRequest(); basicDataRequest.setDeleteRequest(deleteRequest); - basicDataRequest.setKey("BASIC_CORP_MAINTAIN"); + basicDataRequest.setKey(SyncDelType.BASIC_CORP_MAINTAIN); Long userId = getUserId(); spGetHttpClient.deleteBasicData(basicDataRequest,userId+""); return ResultVOUtils.success("删除成功"); diff --git a/src/main/java/com/glxp/api/controller/basic/UdiRelevanceController.java b/src/main/java/com/glxp/api/controller/basic/UdiRelevanceController.java index 44d15a82..f76df538 100644 --- a/src/main/java/com/glxp/api/controller/basic/UdiRelevanceController.java +++ b/src/main/java/com/glxp/api/controller/basic/UdiRelevanceController.java @@ -10,6 +10,7 @@ import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.constant.BusinessType; import com.glxp.api.constant.ConstantStatus; +import com.glxp.api.constant.SyncDelType; import com.glxp.api.controller.BaseController; import com.glxp.api.entity.basic.*; import com.glxp.api.entity.system.SystemParamConfigEntity; @@ -289,10 +290,9 @@ public class UdiRelevanceController extends BaseController { //调用同步删除的方法 BasicDataRequest basicDataRequest = new BasicDataRequest(); basicDataRequest.setDeleteRequest(deleteRequest); - basicDataRequest.setKey("BASIC_MAINTAIN"); + basicDataRequest.setKey(SyncDelType.BASIC_MAINTAIN); Long userId = getUserId(); - spGetHttpClient.deleteBasicData(basicDataRequest,userId+""); - + spGetHttpClient.deleteBasicData(basicDataRequest, userId + ""); return ResultVOUtils.success("删除成功"); } diff --git a/src/main/java/com/glxp/api/controller/basic/UdiRlSupController.java b/src/main/java/com/glxp/api/controller/basic/UdiRlSupController.java index 2ae704cf..a55ec204 100644 --- a/src/main/java/com/glxp/api/controller/basic/UdiRlSupController.java +++ b/src/main/java/com/glxp/api/controller/basic/UdiRlSupController.java @@ -9,6 +9,7 @@ import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.constant.BusinessType; +import com.glxp.api.constant.SyncDelType; import com.glxp.api.controller.BaseController; import com.glxp.api.entity.auth.AuthAdmin; import com.glxp.api.entity.basic.BasicCorpEntity; @@ -316,7 +317,7 @@ public class UdiRlSupController extends BaseController { //调用同步删除的方法 BasicDataRequest basicDataRequest = new BasicDataRequest(); basicDataRequest.setDeleteCompanyFileRequest(deleteCompanyFileRequest); - basicDataRequest.setKey("BASIC_MANAGE"); + basicDataRequest.setKey(SyncDelType.BASIC_MANAGE); Long userId = getUserId(); spGetHttpClient.deleteBasicData(basicDataRequest,userId+""); return ResultVOUtils.success("成功"); diff --git a/src/main/java/com/glxp/api/controller/inv/DeviceInspectTakeController.java b/src/main/java/com/glxp/api/controller/inv/DeviceInspectTakeController.java index 3ad14903..3a68e896 100644 --- a/src/main/java/com/glxp/api/controller/inv/DeviceInspectTakeController.java +++ b/src/main/java/com/glxp/api/controller/inv/DeviceInspectTakeController.java @@ -1,23 +1,34 @@ package com.glxp.api.controller.inv; +import cn.hutool.core.exceptions.ExceptionUtil; +import cn.hutool.core.thread.ThreadUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.github.pagehelper.PageInfo; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; +import com.glxp.api.constant.BasicExportTypeEnum; import com.glxp.api.constant.Constant; import com.glxp.api.constant.DeviceStatus; +import com.glxp.api.constant.SyncDelType; +import com.glxp.api.controller.BaseController; import com.glxp.api.entity.inv.DeviceInspectTaskDetailEntity; import com.glxp.api.entity.inv.DeviceInspectTaskEntity; +import com.glxp.api.entity.system.SyncDataSetEntity; import com.glxp.api.http.sync.SpGetHttpClient; +import com.glxp.api.req.basic.BasicDataRequest; import com.glxp.api.req.inv.FilterDeviceInspectTakeRequest; import com.glxp.api.res.inv.DeviceInspectTakeResponse; import com.glxp.api.res.sync.SpsSyncDeviceTakeResponse; import com.glxp.api.service.inv.DeviceInspectTaskDetailService; import com.glxp.api.service.inv.DeviceInspectTaskService; +import com.glxp.api.service.sync.HeartService; +import com.glxp.api.service.sync.SyncDataSetService; +import com.glxp.api.task.SyncHeartService; import com.glxp.api.util.GennerOrderUtils; import com.glxp.api.util.OkHttpCli; import com.glxp.api.util.OrderNoTypeBean; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.exception.ExceptionUtils; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -32,7 +43,7 @@ import java.util.List; */ @Slf4j @RestController -public class DeviceInspectTakeController { +public class DeviceInspectTakeController extends BaseController { @Resource DeviceInspectTaskService deviceInspectTaskService; @@ -56,18 +67,19 @@ public class DeviceInspectTakeController { PageInfo pageInfo = new PageInfo<>(list); return ResultVOUtils.page(pageInfo); } + @PostMapping("/udiwms/inv/device/inspect/take/uploadDeviceInspecTake") public BaseResponse uploadDeviceInspecTake(@RequestBody DeviceInspectTaskEntity deviceInspectTaskEntity) { deviceInspectTaskEntity.setUpdateTime(new Date()); - if(deviceInspectTaskEntity.getStatus() == DeviceStatus.DEVICE_STATUS_TEMP_DURINGINSPECTTION){ + if (deviceInspectTaskEntity.getStatus() == DeviceStatus.DEVICE_STATUS_TEMP_DURINGINSPECTTION) { deviceInspectTaskEntity.setStrartTime(new Date()); - }else if (deviceInspectTaskEntity.getStatus() == DeviceStatus.DEVICE_STATUS_TEMP_INSPECTED){ + } else if (deviceInspectTaskEntity.getStatus() == DeviceStatus.DEVICE_STATUS_TEMP_INSPECTED) { deviceInspectTaskEntity.setEndTime(new Date()); } - boolean falg=deviceInspectTaskService.updateById(deviceInspectTaskEntity); - UploadDeviceTake(deviceInspectTaskEntity.getId(),2); - if(!falg){ - return ResultVOUtils.error(999,"更新失败"); + boolean falg = deviceInspectTaskService.updateById(deviceInspectTaskEntity); + UploadDeviceTake(deviceInspectTaskEntity.getId(), 2); + if (!falg) { + return ResultVOUtils.error(999, "更新失败"); } return ResultVOUtils.success(); } @@ -75,53 +87,59 @@ public class DeviceInspectTakeController { @PostMapping("/udiwms/inv/device/inspect/take/uploadDeviceTake") public BaseResponse uploadDeviceTake(@RequestBody DeviceInspectTaskEntity deviceInspectTaskEntity) { deviceInspectTaskEntity.setUpdateTime(new Date()); - boolean falg=deviceInspectTaskService.updateById(deviceInspectTaskEntity); - if(deviceInspectTaskEntity.getStatus() == 2){ - UploadDeviceTake(deviceInspectTaskEntity.getId(),1); + boolean falg = deviceInspectTaskService.updateById(deviceInspectTaskEntity); + if (deviceInspectTaskEntity.getStatus() == 2) { + UploadDeviceTake(deviceInspectTaskEntity.getId(), 1); } - if(!falg){ - return ResultVOUtils.error(999,"更新失败"); + if (!falg) { + return ResultVOUtils.error(999, "更新失败"); } return ResultVOUtils.success(); } - @PostMapping("/udiwms/inv/device/inspect/take/addDeviceInspecTake") - public BaseResponse addDeviceInspecTake(@RequestBody DeviceInspectTaskEntity deviceInspectTaskEntity) { + public BaseResponse addDeviceInspecTake(@RequestBody DeviceInspectTaskEntity deviceInspectTaskEntity) { String orderId = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.DEVICE_INSPECT_PLAN_ORDER, "yyyyMMdd")); deviceInspectTaskEntity.setOrderId(orderId); deviceInspectTaskEntity.setCreateTime(new Date()); - deviceInspectTaskService.addDeviceInspectTask(deviceInspectTaskEntity); - return ResultVOUtils.success(deviceInspectTaskEntity); + deviceInspectTaskService.addDeviceInspectTask(deviceInspectTaskEntity); + return ResultVOUtils.success(deviceInspectTaskEntity); } @PostMapping("/udiwms/inv/device/inspect/take/delectDeviceInspecTake") - public BaseResponse delectDeviceInspecTake(@RequestBody DeviceInspectTaskEntity deviceInspectTaskEntity) { - - deviceInspectTaskService.delectDeviceInspectTask(deviceInspectTaskEntity); - deviceInspectTaskDetailService.remove(new QueryWrapper().eq("taskOrderIdFk",deviceInspectTaskEntity.getOrderId())); - UploadDeviceTake(deviceInspectTaskEntity.getId(),3); + public BaseResponse delectDeviceInspecTake(@RequestBody DeviceInspectTaskEntity deviceInspectTaskEntity) { + + deviceInspectTaskService.removeById(deviceInspectTaskEntity.getId()); + deviceInspectTaskDetailService.remove(new QueryWrapper().eq("taskOrderIdFk", deviceInspectTaskEntity.getOrderId())); + UploadDeviceTake(deviceInspectTaskEntity.getId(), 3); + BasicDataRequest basicDataRequest = new BasicDataRequest(); + basicDataRequest.setDeviceInspectTaskEntity(deviceInspectTaskEntity); + basicDataRequest.setKey(SyncDelType.DEV_TASK); + Long userId = getUserId(); + spGetHttpClient.deleteBasicData(basicDataRequest, userId + ""); return ResultVOUtils.success(deviceInspectTaskEntity); } - void UploadDeviceTake(Integer id,Integer type){ - //提交上传到自助 - //查询任务表 - DeviceInspectTaskEntity deviceInspectTaskEntity=deviceInspectTaskService.getById(id); - List deviceInspectTaskDetailEntityList = deviceInspectTaskDetailService - .list(new QueryWrapper().eq("taskOrderIdFk",deviceInspectTaskEntity.getOrderId())); - SpsSyncDeviceTakeResponse spsSyncDeviceTakeResponse=new SpsSyncDeviceTakeResponse(); - spsSyncDeviceTakeResponse.setDeviceInspectTaskEntity(deviceInspectTaskEntity); - spsSyncDeviceTakeResponse.setDeviceInspectTaskDetailEntityList(deviceInspectTaskDetailEntityList); - spsSyncDeviceTakeResponse.setType(type); - spGetHttpClient.postAllDeviceTake(spsSyncDeviceTakeResponse); - } - + @Resource + SyncHeartService syncHeartService; + void UploadDeviceTake(Long id, Integer type) { + //提交上传到自助 + //查询任务表 +// DeviceInspectTaskEntity deviceInspectTaskEntity = deviceInspectTaskService.getById(id); +// List deviceInspectTaskDetailEntityList = deviceInspectTaskDetailService +// .list(new QueryWrapper().eq("taskOrderIdFk", deviceInspectTaskEntity.getOrderId())); +// SpsSyncDeviceTakeResponse spsSyncDeviceTakeResponse = new SpsSyncDeviceTakeResponse(); +// spsSyncDeviceTakeResponse.setDeviceInspectTaskEntity(deviceInspectTaskEntity); +// spsSyncDeviceTakeResponse.setDeviceInspectTaskDetailEntityList(deviceInspectTaskDetailEntityList); +// spsSyncDeviceTakeResponse.setType(type); +// spGetHttpClient.postAllDeviceTake(spsSyncDeviceTakeResponse); + syncHeartService.customPushData(BasicExportTypeEnum.DEVICE_TASK); + } //------------------------------------------ 详情方法--------------------------------------------------------------// @@ -132,21 +150,21 @@ public class DeviceInspectTakeController { } @PostMapping("/udiwms/inv/device/inspect/take/detail/uploadDeviceInspecTakeDetail") - public BaseResponse uploadDeviceInspecTakeDetail(@RequestBody DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity) { + public BaseResponse uploadDeviceInspecTakeDetail(@RequestBody DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity) { deviceInspectTaskDetailEntity.setUpdateTime(new Date()); - boolean falg=deviceInspectTaskDetailService.uploadDeviceInspecTakeDetail(deviceInspectTaskDetailEntity); - if(!falg){ - return ResultVOUtils.error(999,"更新失败"); - } + boolean falg = deviceInspectTaskDetailService.uploadDeviceInspecTakeDetail(deviceInspectTaskDetailEntity); + if (!falg) { + return ResultVOUtils.error(999, "更新失败"); + } return ResultVOUtils.success(); } @PostMapping("/udiwms/inv/device/inspect/take/detail/addDeviceInspecTakeDetail") - public BaseResponse addDeviceInspecTakeDetail(@RequestBody DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity) { + public BaseResponse addDeviceInspecTakeDetail(@RequestBody DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity) { - boolean falg=deviceInspectTaskDetailService.addDeviceInspectTaskDelect(deviceInspectTaskDetailEntity); - if(!falg){ - return ResultVOUtils.error(999,"更新失败"); + boolean falg = deviceInspectTaskDetailService.addDeviceInspectTaskDelect(deviceInspectTaskDetailEntity); + if (!falg) { + return ResultVOUtils.error(999, "更新失败"); } return ResultVOUtils.success(); } @@ -154,13 +172,12 @@ public class DeviceInspectTakeController { @GetMapping("/udiwms/inv/device/inspect/take/detail/delectDeviceInspecTakeDetail") public BaseResponse delecttDeviceInspecTakeDetail(String id) { - boolean falg=deviceInspectTaskDetailService.removeById(id); - if(!falg){ - return ResultVOUtils.error(999,"删除失败"); + boolean falg = deviceInspectTaskDetailService.removeById(id); + if (!falg) { + return ResultVOUtils.error(999, "删除失败"); } return ResultVOUtils.success(); } - } diff --git a/src/main/java/com/glxp/api/controller/purchase/SupCertController.java b/src/main/java/com/glxp/api/controller/purchase/SupCertController.java index 8d9b21af..4ee2c9f9 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupCertController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupCertController.java @@ -406,7 +406,7 @@ public class SupCertController { } String param = JSON.toJSONString(list); - JasperUtils.jasperReport(request, response, param, filePath+"pdf/template/"+systemPDFTemplateEntity.getPath(), "pdf"); + JasperUtils.jasperReport(request, response, param, filePath + "pdf/template/" + systemPDFTemplateEntity.getPath(), "pdf"); } /** @@ -521,7 +521,7 @@ public class SupCertController { } String param = JSON.toJSONString(list); - JasperUtils.jasperReport(request, response, param, filePath+"pdf/template/"+systemPDFTemplateEntity.getPath(), "pdf"); + JasperUtils.jasperReport(request, response, param, filePath + "pdf/template/" + systemPDFTemplateEntity.getPath(), "pdf"); } /** @@ -587,7 +587,7 @@ public class SupCertController { } String param = JSON.toJSONString(list); - JasperUtils.jasperReport(request, response, param, filePath+"pdf/template/"+systemPDFTemplateEntity.getPath(), "pdf"); + JasperUtils.jasperReport(request, response, param, filePath + "pdf/template/" + systemPDFTemplateEntity.getPath(), "pdf"); } //首营预览文件 diff --git a/src/main/java/com/glxp/api/dao/inv/DeviceInspectTaskMapper.java b/src/main/java/com/glxp/api/dao/inv/DeviceInspectTaskMapper.java index acbf6c70..9a796cc6 100644 --- a/src/main/java/com/glxp/api/dao/inv/DeviceInspectTaskMapper.java +++ b/src/main/java/com/glxp/api/dao/inv/DeviceInspectTaskMapper.java @@ -1,6 +1,8 @@ package com.glxp.api.dao.inv; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.glxp.api.dao.BaseMapperPlus; +import com.glxp.api.entity.inv.DeviceInspectTaskDetailEntity; import com.glxp.api.entity.inv.DeviceInspectTaskEntity; import com.glxp.api.req.inv.FilterDeviceInspectPlanRequest; import com.glxp.api.req.inv.FilterDeviceInspectTakeRequest; @@ -11,7 +13,6 @@ import org.apache.ibatis.annotations.Mapper; import java.util.List; @Mapper -public interface DeviceInspectTaskMapper extends BaseMapper { - +public interface DeviceInspectTaskMapper extends BaseMapperPlus { List filterList(FilterDeviceInspectTakeRequest filterDeviceInspectTakeRequest); -} \ No newline at end of file +} diff --git a/src/main/java/com/glxp/api/entity/inv/DeviceInspectTaskDetailEntity.java b/src/main/java/com/glxp/api/entity/inv/DeviceInspectTaskDetailEntity.java index 96ff6cfd..5bd0808e 100644 --- a/src/main/java/com/glxp/api/entity/inv/DeviceInspectTaskDetailEntity.java +++ b/src/main/java/com/glxp/api/entity/inv/DeviceInspectTaskDetailEntity.java @@ -4,15 +4,17 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; + import java.io.Serializable; import java.util.Date; + import lombok.Data; @Data @TableName(value = "device_inspect_task_detail") public class DeviceInspectTaskDetailEntity implements Serializable { @TableId(value = "id", type = IdType.INPUT) - private Integer id; + private Long id; /** * 巡检项目编码 @@ -66,4 +68,4 @@ public class DeviceInspectTaskDetailEntity implements Serializable { private String inspectName; private static final long serialVersionUID = 1L; -} \ No newline at end of file +} diff --git a/src/main/java/com/glxp/api/entity/inv/DeviceInspectTaskEntity.java b/src/main/java/com/glxp/api/entity/inv/DeviceInspectTaskEntity.java index 0dec45fe..0998c0b9 100644 --- a/src/main/java/com/glxp/api/entity/inv/DeviceInspectTaskEntity.java +++ b/src/main/java/com/glxp/api/entity/inv/DeviceInspectTaskEntity.java @@ -11,9 +11,9 @@ import java.util.Date; @Data @TableName(value = "device_inspect_task") -public class DeviceInspectTaskEntity{ +public class DeviceInspectTaskEntity { @TableId(value = "id", type = IdType.AUTO) - private Integer id; + private Long id; /** * 任务单号 diff --git a/src/main/java/com/glxp/api/entity/system/SyncDataSetEntity.java b/src/main/java/com/glxp/api/entity/system/SyncDataSetEntity.java index f69eb4dd..788288bd 100644 --- a/src/main/java/com/glxp/api/entity/system/SyncDataSetEntity.java +++ b/src/main/java/com/glxp/api/entity/system/SyncDataSetEntity.java @@ -68,5 +68,9 @@ public class SyncDataSetEntity { private int manufacturerCert; private int productCert; private int orderInvoice; //发票信息 + /** + * 设备任务 + */ + private int deviceTask; } diff --git a/src/main/java/com/glxp/api/http/sync/SpGetHttpClient.java b/src/main/java/com/glxp/api/http/sync/SpGetHttpClient.java index 03282d76..fce8d05e 100644 --- a/src/main/java/com/glxp/api/http/sync/SpGetHttpClient.java +++ b/src/main/java/com/glxp/api/http/sync/SpGetHttpClient.java @@ -8,6 +8,7 @@ import com.alibaba.fastjson2.JSON; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.constant.BasicExportTypeEnum; +import com.glxp.api.constant.SyncDelType; import com.glxp.api.entity.basic.ProductInfoEntity; import com.glxp.api.entity.inout.IoOrderEntity; import com.glxp.api.entity.sync.BasicExportStatusEntity; @@ -141,18 +142,18 @@ public class SpGetHttpClient { //日志参数类 DeleteBasicDataRequest deleteBasicDataRequest = new DeleteBasicDataRequest(); - deleteBasicDataRequest.setRecordCode("DL"+new SimpleDateFormat("yyyyMMddHHmmssSSSS").format(System.currentTimeMillis())); + deleteBasicDataRequest.setRecordCode("DL" + new SimpleDateFormat("yyyyMMddHHmmssSSSS").format(System.currentTimeMillis())); deleteBasicDataRequest.setUserId(userId); - String json =""; - switch (basicDataRequest.getKey()){ - case "BASIC_MAINTAIN": + String json = ""; + switch (basicDataRequest.getKey()) { + case SyncDelType.BASIC_MAINTAIN: deleteBasicDataRequest.setDataType(basicDataRequest.getKey()); deleteBasicDataRequest.setParam(JSONUtil.toJsonStr(basicDataRequest.getDeleteRequest()) + basicDataRequest.getKey()); deleteBasicDataRequest.setName("耗材字典维护"); basicDataRequest.setDeleteBasicDataRequest(deleteBasicDataRequest); json = JSONUtil.toJsonStr(basicDataRequest); break; - case "BASIC_MANAGE": + case SyncDelType.BASIC_MANAGE: deleteBasicDataRequest.setDataType(basicDataRequest.getKey()); deleteBasicDataRequest.setParam(JSONUtil.toJsonStr(basicDataRequest.getDeleteCompanyFileRequest()) + basicDataRequest.getKey()); deleteBasicDataRequest.setName("供应商器械信息"); @@ -160,14 +161,14 @@ public class SpGetHttpClient { json = JSONUtil.toJsonStr(basicDataRequest); break; - case "BASIC_CORP_MAINTAIN": + case SyncDelType.BASIC_CORP_MAINTAIN: deleteBasicDataRequest.setDataType(basicDataRequest.getKey()); deleteBasicDataRequest.setParam(JSONUtil.toJsonStr(basicDataRequest.getDeleteRequest()) + basicDataRequest.getKey()); deleteBasicDataRequest.setName("往来信息维护"); basicDataRequest.setDeleteBasicDataRequest(deleteBasicDataRequest); json = JSONUtil.toJsonStr(basicDataRequest); break; - case "BASIC_BUSINESS_TYPE": + case SyncDelType.BASIC_BUSINESS_TYPE: deleteBasicDataRequest.setDataType(basicDataRequest.getKey()); deleteBasicDataRequest.setParam(JSONUtil.toJsonStr(basicDataRequest.getDeleteRequest()) + basicDataRequest.getKey()); deleteBasicDataRequest.setName("单据类型设置"); @@ -175,6 +176,14 @@ public class SpGetHttpClient { json = JSONUtil.toJsonStr(basicDataRequest); break; + case SyncDelType.DEV_TASK: + deleteBasicDataRequest.setDataType(basicDataRequest.getKey()); + deleteBasicDataRequest.setParam(JSONUtil.toJsonStr(basicDataRequest.getDeviceInspectTaskEntity()) + basicDataRequest.getKey()); + deleteBasicDataRequest.setName("设备任务删除"); + basicDataRequest.setDeleteBasicDataRequest(deleteBasicDataRequest); + json = JSONUtil.toJsonStr(basicDataRequest); + break; + default: break; } @@ -189,13 +198,13 @@ public class SpGetHttpClient { JSONObject.parseObject(result, new TypeReference() { }); //插入操作日志 - insertLog(deleteBasicDataRequest,response,userId); + insertLog(deleteBasicDataRequest, response, userId); //插入操作数据类型记录表 insertType(deleteBasicDataRequest); return response; } - public void insertLog( DeleteBasicDataRequest deleteBasicDataRequest,BaseResponse response,String userId){ + public void insertLog(DeleteBasicDataRequest deleteBasicDataRequest, BaseResponse response, String userId) { SyncEditLogEntity syncEditLogEntity = new SyncEditLogEntity(); syncEditLogEntity.setRecordCode(deleteBasicDataRequest.getRecordCode()); syncEditLogEntity.setOperType(2); @@ -209,7 +218,7 @@ public class SpGetHttpClient { syncEditLogService.insertLog(syncEditLogEntity); } - public void insertType(DeleteBasicDataRequest deleteBasicDataRequest){ + public void insertType(DeleteBasicDataRequest deleteBasicDataRequest) { SyncEditTypeEntity syncEditTypeEntity = new SyncEditTypeEntity(); syncEditTypeEntity.setCode(deleteBasicDataRequest.getDataType()); syncEditTypeEntity.setName(deleteBasicDataRequest.getName()); @@ -217,7 +226,6 @@ public class SpGetHttpClient { } - public BaseResponse getSimpleOrder(ReviewSpmsRequest reviewSpmsRequest, String userId) { String json = JSONUtil.toJsonStr(reviewSpmsRequest); List header = (List) Convert.toList(buildHeader()); @@ -600,7 +608,7 @@ public class SpGetHttpClient { //上传设备任务 public BaseResponse postAllDeviceTake(SpsSyncDeviceTakeResponse spsSyncDeviceTakeResponse) { String json = JSONUtil.toJsonStr(spsSyncDeviceTakeResponse); - String result = okHttpCli.doPostJson(getIpUrl() + "/directToSpms" + "/deviceTakeApi/sps/sync/deviceTake/upload", json, buildHeader()); + String result = okHttpCli.doPostJson(getIpUrl() + "/directToSpms" + "/deviceTakeApi/sps/sync/deviceTake/upload", json, buildHeader()); BaseResponse response = JSONObject.parseObject(result, new TypeReference>() { }); diff --git a/src/main/java/com/glxp/api/req/basic/BasicDataRequest.java b/src/main/java/com/glxp/api/req/basic/BasicDataRequest.java index 024f09cf..410a5902 100644 --- a/src/main/java/com/glxp/api/req/basic/BasicDataRequest.java +++ b/src/main/java/com/glxp/api/req/basic/BasicDataRequest.java @@ -1,17 +1,29 @@ package com.glxp.api.req.basic; +import com.glxp.api.entity.inv.DeviceInspectTaskEntity; import com.glxp.api.req.system.DeleteCompanyFileRequest; import com.glxp.api.req.system.DeleteRequest; import lombok.Data; @Data public class BasicDataRequest { - //耗材字典 - private DeleteRequest deleteRequest; - //供应商器械信息 - private DeleteCompanyFileRequest deleteCompanyFileRequest; - //日志参数类 - private DeleteBasicDataRequest deleteBasicDataRequest; - private String key; + /** + * 耗材字典 + */ + private DeleteRequest deleteRequest; + /** + * 供应商器械信息 + */ + private DeleteCompanyFileRequest deleteCompanyFileRequest; + /** + * 日志参数类 + */ + private DeleteBasicDataRequest deleteBasicDataRequest; + /** + * 删除设备任务参数 + */ + private DeviceInspectTaskEntity deviceInspectTaskEntity; + + private String key; } diff --git a/src/main/java/com/glxp/api/res/sync/SpsSyncDeviceTaskResponse.java b/src/main/java/com/glxp/api/res/sync/SpsSyncDeviceTaskResponse.java new file mode 100644 index 00000000..b87fa16e --- /dev/null +++ b/src/main/java/com/glxp/api/res/sync/SpsSyncDeviceTaskResponse.java @@ -0,0 +1,16 @@ +package com.glxp.api.res.sync; + +import com.glxp.api.entity.inv.DeviceInspectTaskDetailEntity; +import com.glxp.api.entity.inv.DeviceInspectTaskEntity; +import lombok.Data; + +import java.util.List; + +@Data +public class SpsSyncDeviceTaskResponse extends BaseSyncResponse { + + List deviceInspectTaskEntities; + + List deviceInspectTaskDetailEntities; + +} diff --git a/src/main/java/com/glxp/api/service/inv/DeviceInspectTaskDetailService.java b/src/main/java/com/glxp/api/service/inv/DeviceInspectTaskDetailService.java index ccf059ff..98e1ae6d 100644 --- a/src/main/java/com/glxp/api/service/inv/DeviceInspectTaskDetailService.java +++ b/src/main/java/com/glxp/api/service/inv/DeviceInspectTaskDetailService.java @@ -1,5 +1,6 @@ package com.glxp.api.service.inv; +import cn.hutool.core.util.IdUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.glxp.api.dao.inv.DeviceInspectTaskMapper; import com.glxp.api.entity.inv.DeviceInspectPlanDelectEntity; @@ -19,13 +20,16 @@ public class DeviceInspectTaskDetailService extends ServiceImpl deviceInspectTaskDetailEntityList){ + public Boolean addDeviceInspectTaskDelectList(List deviceInspectTaskDetailEntityList) { deviceInspectTaskDetailMapper.insertBatch(deviceInspectTaskDetailEntityList); return true; } @@ -34,27 +38,26 @@ public class DeviceInspectTaskDetailService extends ServiceImpl selectDeviceInspectTakeDetail(DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity) { QueryWrapper ew = new QueryWrapper<>(); - if(deviceInspectTaskDetailEntity.getProjectCode() != null){ - ew.eq("projectCode",deviceInspectTaskDetailEntity.getProjectCode()); + if (deviceInspectTaskDetailEntity.getProjectCode() != null) { + ew.eq("projectCode", deviceInspectTaskDetailEntity.getProjectCode()); } - if(deviceInspectTaskDetailEntity.getId() != null){ - ew.eq("id",deviceInspectTaskDetailEntity.getId()); + if (deviceInspectTaskDetailEntity.getId() != null) { + ew.eq("id", deviceInspectTaskDetailEntity.getId()); } - if(deviceInspectTaskDetailEntity.getTaskOrderIdFk() != null){ - ew.eq("taskOrderIdFk",deviceInspectTaskDetailEntity.getTaskOrderIdFk()); + if (deviceInspectTaskDetailEntity.getTaskOrderIdFk() != null) { + ew.eq("taskOrderIdFk", deviceInspectTaskDetailEntity.getTaskOrderIdFk()); } - if(deviceInspectTaskDetailEntity.getStatus() != null){ - ew.like("status",deviceInspectTaskDetailEntity.getStatus()); + if (deviceInspectTaskDetailEntity.getStatus() != null) { + ew.like("status", deviceInspectTaskDetailEntity.getStatus()); } ew.select("*, ( SELECT `employeeName` FROM auth_user WHERE id = device_inspect_task_detail.inspectUser ) inspectName"); - List deviceInspectPlanDelectEntities=deviceInspectTaskDetailMapper.selectList(ew); + List deviceInspectPlanDelectEntities = deviceInspectTaskDetailMapper.selectList(ew); return deviceInspectPlanDelectEntities; } - public Boolean uploadDeviceInspecTakeDetail(DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntityList){ - return deviceInspectTaskDetailMapper.updateById(deviceInspectTaskDetailEntityList) > 0 ? true : false; + public Boolean uploadDeviceInspecTakeDetail(DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntityList) { + return deviceInspectTaskDetailMapper.updateById(deviceInspectTaskDetailEntityList) > 0 ? true : false; } - } diff --git a/src/main/java/com/glxp/api/service/inv/DeviceInspectTaskService.java b/src/main/java/com/glxp/api/service/inv/DeviceInspectTaskService.java index 529eb532..87201b7a 100644 --- a/src/main/java/com/glxp/api/service/inv/DeviceInspectTaskService.java +++ b/src/main/java/com/glxp/api/service/inv/DeviceInspectTaskService.java @@ -1,5 +1,6 @@ package com.glxp.api.service.inv; +import cn.hutool.core.util.IdUtil; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.github.pagehelper.PageHelper; import com.glxp.api.dao.inv.DeviceInspectTaskMapper; @@ -19,19 +20,21 @@ public class DeviceInspectTaskService extends ServiceImpl filterList(FilterDeviceInspectTakeRequest filterDeviceInspectTakeRequest) { if (null == filterDeviceInspectTakeRequest) { return Collections.emptyList(); diff --git a/src/main/java/com/glxp/api/service/sync/HeartService.java b/src/main/java/com/glxp/api/service/sync/HeartService.java index 2981aad4..278b782b 100644 --- a/src/main/java/com/glxp/api/service/sync/HeartService.java +++ b/src/main/java/com/glxp/api/service/sync/HeartService.java @@ -10,18 +10,23 @@ import cn.hutool.json.JSONArray; import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.constant.*; import com.glxp.api.dao.basic.*; import com.glxp.api.dao.inout.*; +import com.glxp.api.dao.inv.DeviceInspectTaskDetailMapper; +import com.glxp.api.dao.inv.DeviceInspectTaskMapper; import com.glxp.api.dao.purchase.*; import com.glxp.api.dao.thrsys.ThrBusTypeOriginDao; import com.glxp.api.dto.RelaySyncDto; import com.glxp.api.entity.auth.*; import com.glxp.api.entity.basic.*; import com.glxp.api.entity.inout.*; +import com.glxp.api.entity.inv.DeviceInspectTaskDetailEntity; +import com.glxp.api.entity.inv.DeviceInspectTaskEntity; import com.glxp.api.entity.purchase.*; import com.glxp.api.entity.sync.BasicDownloadStatusEntity; import com.glxp.api.entity.sync.BasicExportStatusEntity; @@ -37,6 +42,8 @@ import com.glxp.api.service.auth.*; import com.glxp.api.service.basic.*; import com.glxp.api.service.inout.*; import com.glxp.api.service.inout.impl.IoOrderInvoiceService; +import com.glxp.api.service.inv.DeviceInspectTaskDetailService; +import com.glxp.api.service.inv.DeviceInspectTaskService; import com.glxp.api.service.system.*; import com.glxp.api.service.thrsys.*; import com.glxp.api.util.CustomUtil; @@ -233,7 +240,6 @@ public class HeartService { @Transactional(rollbackFor = Exception.class) public void pushData(SyncDataSetEntity info, Date syncTime, BasicExportTypeEnum exportType) { - Date now = new Date(); String taskId = CustomUtil.getId(); switch (exportType) { @@ -270,6 +276,12 @@ public class HeartService { case IO_ORDER: if (needExec()) break; + break; + case DEVICE_TASK: + if (needExec(info.getDeviceTask())) { + uploadData(exportType, taskId, x -> x.getDeviceTaskData(info, taskId, now, syncTime)); + } + break; } } @@ -1066,6 +1078,68 @@ public class HeartService { return dataResponse; } + + @Resource + DeviceInspectTaskService deviceInspectTaskService; + @Resource + DeviceInspectTaskDetailService deviceInspectTaskDetailService; + @Value("${file_path}") + private String filePath; + @Resource + FileService fileService; + + /** + * @param info + * @param taskId + * @param now + * @param syncTime + * @return + */ + private SpsSyncDeviceTaskResponse getDeviceTaskData(SyncDataSetEntity info, String taskId, Date now, Date syncTime) { + SpsSyncDeviceTaskResponse dataResponse = null; + Map syncTimeMap = new WeakHashMap<>(3); + syncTimeMap.put("isNew", true); + boolean ge = false; + if (syncTime != null) { + ge = true; + } + StringBuffer remark = new StringBuffer(); + if (needExec(info.getDeviceTask())) { + Map map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.DEVICE_TASK); + List deviceInspectTaskEntities = deviceInspectTaskService.list(Wrappers.lambdaQuery(DeviceInspectTaskEntity.class) + .le(!ge && (boolean) map.get("isNew"), DeviceInspectTaskEntity::getUpdateTime, now) + .between(ge, DeviceInspectTaskEntity::getUpdateTime, syncTime, now) + .between(!ge && !(boolean) map.get("isNew"), DeviceInspectTaskEntity::getUpdateTime + , map.get("oldDate"), now) + ); + if (CollectionUtil.isNotEmpty(deviceInspectTaskEntities)) { + dataResponse = new SpsSyncDeviceTaskResponse(); + dataResponse.setDeviceInspectTaskEntities(deviceInspectTaskEntities); + + remark.append("设备任务:").append(deviceInspectTaskEntities.size()).append("条\n"); + List datas = new ArrayList<>(); + List files = new ArrayList<>(); + for (DeviceInspectTaskEntity deviceInspectTaskEntity : deviceInspectTaskEntities) { + List deviceInspectTaskDetailEntities = deviceInspectTaskDetailService.list(new QueryWrapper().eq("taskOrderIdFk", deviceInspectTaskEntity.getOrderId())); + datas.addAll(deviceInspectTaskDetailEntities); + for (DeviceInspectTaskDetailEntity detailEntity : deviceInspectTaskDetailEntities) { + if (StrUtil.isNotEmpty(detailEntity.getInspectImage())) { + files.add(filePath + detailEntity.getInspectImage().replace(",", "")); + } + } + } + fileService.upload(files); + } + } + if (dataResponse != null) { + dataResponse.setTaskId(taskId); + dataResponse.setType(BasicExportTypeEnum.THIRD_DATA.getRemark()); + dataResponse.setSyncRemark(remark.toString()); + } + return dataResponse; + } + + /** * 判断是否需要执行 由内向外 * @@ -1623,6 +1697,10 @@ public class HeartService { case DOCUMENT_TYPE_DATA: this.insertDocumentTypeData(bean.getFileContent()); break; + + case DEVICE_TASK: + this.insertDevTaskData(bean.getFileContent()); + break; } String taskId = bean.getTaskId(); if (StrUtil.isNotBlank(taskId)) { @@ -1716,8 +1794,6 @@ public class HeartService { } } - @Resource - FileService fileService; private final IdcService idcService; private final IoCodeLostMapper ioCodeLostMapper; @@ -1778,6 +1854,35 @@ public class HeartService { } } + @Resource + DeviceInspectTaskMapper deviceInspectTaskMapper; + @Resource + DeviceInspectTaskDetailMapper deviceInspectTaskDetailMapper; + + /** + * 插入设备任务更新数据 + */ + @Transactional(propagation = Propagation.NESTED) + public void insertDevTaskData(String content) { + cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(content); + List deviceInspectTaskEntities = JSONUtil.toList(jsonObject.getJSONArray(DeviceInspectTaskEntity.class.getSimpleName()), DeviceInspectTaskEntity.class); + List deviceInspectTaskDetailEntities = JSONUtil.toList(jsonObject.getJSONArray(DeviceInspectTaskDetailEntity.class.getSimpleName()), DeviceInspectTaskDetailEntity.class); + if (CollectionUtil.isNotEmpty(deviceInspectTaskEntities)) { + for (DeviceInspectTaskEntity deviceInspectTaskEntity : deviceInspectTaskEntities) { + deviceInspectTaskEntity.setUpdateTime(null); + } + deviceInspectTaskMapper.replaceBatchs(deviceInspectTaskEntities); + } + if (CollectionUtil.isNotEmpty(deviceInspectTaskDetailEntities)) { + deviceInspectTaskDetailMapper.replaceBatchs(deviceInspectTaskDetailEntities); + } + + List syncFiles = JSONUtil.toList(jsonObject.getJSONArray("syncFiles"), String.class); + if (CollUtil.isNotEmpty(syncFiles)) { + fileService.download(syncFiles); + } + } + /** * 从UDI自助平台拉取基础数据 */ diff --git a/src/main/java/com/glxp/api/service/sync/SocketMsgService.java b/src/main/java/com/glxp/api/service/sync/SocketMsgService.java index b150d64f..fb4c5065 100644 --- a/src/main/java/com/glxp/api/service/sync/SocketMsgService.java +++ b/src/main/java/com/glxp/api/service/sync/SocketMsgService.java @@ -72,7 +72,7 @@ public class SocketMsgService { //插入日志 insertLog(basicDataRequest.getDeleteBasicDataRequest(), baseResponse); insertType(basicDataRequest.getDeleteBasicDataRequest()); - break; + break; case SocketMsgType.BASIC_BUSINESS_TYPE_DELETE: object = JSON.parseObject(String.valueOf(socketMsgEntity.getContent()), Map.class); basicDataRequest = JSON.parseObject(String.valueOf(socketMsgEntity.getContent()), BasicDataRequest.class); @@ -81,6 +81,14 @@ public class SocketMsgService { insertLog(basicDataRequest.getDeleteBasicDataRequest(), baseResponse); insertType(basicDataRequest.getDeleteBasicDataRequest()); break; + + + case SocketMsgType.DEV_TASK_DEL: +// basicDataRequest = JSON.parseObject(String.valueOf(socketMsgEntity.getContent()), BasicDataRequest.class); +// baseResponse = deleteBussinessType(basicDataRequest.getDeleteRequest()); +// insertLog(basicDataRequest.getDeleteBasicDataRequest(), baseResponse); +// insertType(basicDataRequest.getDeleteBasicDataRequest()); + break; default: break; } @@ -147,7 +155,7 @@ public class SocketMsgService { return ResultVOUtils.success("成功"); } - public BaseResponse deleteBasicUnitMaintain( DeleteRequest deleteRequest) { + public BaseResponse deleteBasicUnitMaintain(DeleteRequest deleteRequest) { String id = deleteRequest.getId(); @@ -159,7 +167,7 @@ public class SocketMsgService { return ResultVOUtils.success("删除成功"); } - public BaseResponse deleteBussinessType( DeleteRequest deleteRequest) { + public BaseResponse deleteBussinessType(DeleteRequest deleteRequest) { // if (bindingResult.hasErrors()) { // return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); diff --git a/src/main/java/com/glxp/api/task/SyncHeartService.java b/src/main/java/com/glxp/api/task/SyncHeartService.java index 829dc455..1bb046e6 100644 --- a/src/main/java/com/glxp/api/task/SyncHeartService.java +++ b/src/main/java/com/glxp/api/task/SyncHeartService.java @@ -1,5 +1,6 @@ package com.glxp.api.task; +import cn.hutool.core.thread.ThreadUtil; import com.glxp.api.constant.BasicExportTypeEnum; import com.glxp.api.dao.system.SyncDataSetDao; import com.glxp.api.entity.system.SyncDataSetEntity; @@ -57,6 +58,17 @@ public class SyncHeartService { } } + public void customPushData(BasicExportTypeEnum basicExportTypeEnum) { + SyncDataSetEntity syncDataSetEntity = syncDataSetDao.selectSet(); + ThreadUtil.execAsync(() -> { + try { + heartService.pushData(syncDataSetEntity, null, basicExportTypeEnum); + } catch (Exception e) { + log.error(ExceptionUtils.getStackTrace(e)); + } + }); + } + public void pushOrder() { SyncDataSetEntity syncDataSetEntity = syncDataSetDao.selectSet(); if (!syncDataSetEntity.isDownstreamEnable()) { diff --git a/src/main/java/com/glxp/api/upload/uploadController.java b/src/main/java/com/glxp/api/upload/uploadController.java index a4dce48c..dcde54dd 100644 --- a/src/main/java/com/glxp/api/upload/uploadController.java +++ b/src/main/java/com/glxp/api/upload/uploadController.java @@ -91,7 +91,7 @@ public class uploadController { file.transferTo(file1); Map rMap = new HashMap<>(); rMap.put("msg", "上传成功"); - rMap.put("path",newName); + rMap.put("path", newName); return ResultVOUtils.success(rMap); } catch (IOException e) { e.printStackTrace(); @@ -132,7 +132,7 @@ public class uploadController { file.transferTo(file1); Map rMap = new HashMap<>(); rMap.put("msg", "上传成功"); - rMap.put("name", fileUrl + savePath1 + "&name=" + newName); + rMap.put("name", newName); rMap.put("type", type); return ResultVOUtils.success(rMap); } catch (IOException e) { diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 55bc9cd7..390b02b7 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -8,7 +8,7 @@ spring: enabled: true max-file-size: 200MB max-request-size: 200MB - location: E:/tmp + location: D:/tmp mybatis-plus: mapper-locations: classpath:mybatis/mapper/*/*.xml diff --git a/src/main/resources/schemas/schema_v2.2.sql b/src/main/resources/schemas/schema_v2.2.sql index d4a8eb41..5b58b97c 100644 --- a/src/main/resources/schemas/schema_v2.2.sql +++ b/src/main/resources/schemas/schema_v2.2.sql @@ -153,7 +153,7 @@ CREATE TABLE IF NOT EXISTS `device_repair_order_detail` ROW_FORMAT = Dynamic; -CREATE TABLE IF NOT EXISTS `device_inspect_plan_delect` +CREATE TABLE IF NOT EXISTS `device_inspect_plan_delect` ( `id` bigint(0) NOT NULL, `orderIdFk` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, @@ -170,6 +170,10 @@ CREATE TABLE IF NOT EXISTS `device_inspect_plan_delect` ROW_FORMAT = Dynamic; + +CALL Pro_Temp_ColumnWork('device_inspect_task', 'id', 'bigint', 2); +CALL Pro_Temp_ColumnWork('device_inspect_task_detail', 'id', 'bigint', 2); + # INSERT ignore INTO `auth_menu`(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2000, '我的申购单 ', 1674, 2, 'purchase/purApply/pureApplyMySearch', 'purchase/purApply/pureApplyMySearch', NULL, 1, 0, 'C', '0', '0', NULL, NULL, '超级用户', '2023-07-20 17:08:38', NULL, NULL, NULL); # INSERT ignore INTO `udi_wms_wmd`.`auth_menu`(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2001, '我的领用单', 1685, 1, 'inout/receive/receiveMySearch', 'inout/receive/receiveMySearch', NULL, 1, 0, 'C', '0', '0', NULL, NULL, '超级用户', '2023-08-14 10:35:30', NULL, NULL, NULL); #