Merge remote-tracking branch 'origin/dev2.0' into dev2.0

dev2.0
郑明梁 2 years ago
commit b853ee66a5

@ -112,6 +112,13 @@ public enum BasicExportStatusTimeEnum {
* *
*/ */
BUS_TYPE_CHANGE("bus_type_change","自动建业务单设置"), BUS_TYPE_CHANGE("bus_type_change","自动建业务单设置"),
/**
*
*/
DEVICE_TASK("device_task", "设备任务"),
; ;
@EnumValue @EnumValue
private String key; private String key;

@ -54,6 +54,12 @@ public enum BasicExportTypeEnum {
ORDER_INVOICE("io_order_invoice", "扫码单据发票信息"), ORDER_INVOICE("io_order_invoice", "扫码单据发票信息"),
/**
*
*/
DEVICE_TASK("device_task", "设备任务"),
// //
// NEW_ALL_ORDER("all_order", "出入库扫码单据"), // NEW_ALL_ORDER("all_order", "出入库扫码单据"),
// ALL_BUS_ORDER("all_bus_order", "业务单据"), // ALL_BUS_ORDER("all_bus_order", "业务单据"),

@ -1,21 +1,41 @@
package com.glxp.api.constant; package com.glxp.api.constant;
/**
* // 任务类型
*/
public interface SocketMsgType { public interface SocketMsgType {
String DL_ALL_DATA = "DL_ALL_DATA"; //基础数据同步 String DL_ALL_DATA = "DL_ALL_DATA"; //基础数据同步
String DL_NOTICE = "DL_NOTICE"; //通知类消息 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";
} }

@ -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";
}

@ -14,6 +14,7 @@ import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BusinessType; import com.glxp.api.constant.BusinessType;
import com.glxp.api.constant.ConstantType; import com.glxp.api.constant.ConstantType;
import com.glxp.api.constant.SyncDelType;
import com.glxp.api.controller.BaseController; import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.basic.BasicBussinessTypeEntity; import com.glxp.api.entity.basic.BasicBussinessTypeEntity;
import com.glxp.api.http.sync.SpGetHttpClient; import com.glxp.api.http.sync.SpGetHttpClient;
@ -268,7 +269,7 @@ public class BasicBussinessTypeController extends BaseController {
//调用同步删除方法 //调用同步删除方法
BasicDataRequest basicDataRequest = new BasicDataRequest(); BasicDataRequest basicDataRequest = new BasicDataRequest();
basicDataRequest.setDeleteRequest(deleteRequest); basicDataRequest.setDeleteRequest(deleteRequest);
basicDataRequest.setKey("BASIC_BUSINESS_TYPE"); basicDataRequest.setKey(SyncDelType.BASIC_BUSINESS_TYPE);
Long userId = getUserId(); Long userId = getUserId();
spGetHttpClient.deleteBasicData(basicDataRequest,userId+""); spGetHttpClient.deleteBasicData(basicDataRequest,userId+"");

@ -7,6 +7,7 @@ import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.ConstantStatus; import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.constant.SyncDelType;
import com.glxp.api.controller.BaseController; import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.basic.BasicCorpEntity; import com.glxp.api.entity.basic.BasicCorpEntity;
import com.glxp.api.entity.system.SystemParamConfigEntity; import com.glxp.api.entity.system.SystemParamConfigEntity;
@ -351,7 +352,7 @@ public class BasicCorpController extends BaseController {
//调用同步删除的方法 //调用同步删除的方法
BasicDataRequest basicDataRequest = new BasicDataRequest(); BasicDataRequest basicDataRequest = new BasicDataRequest();
basicDataRequest.setDeleteRequest(deleteRequest); basicDataRequest.setDeleteRequest(deleteRequest);
basicDataRequest.setKey("BASIC_CORP_MAINTAIN"); basicDataRequest.setKey(SyncDelType.BASIC_CORP_MAINTAIN);
Long userId = getUserId(); Long userId = getUserId();
spGetHttpClient.deleteBasicData(basicDataRequest,userId+""); spGetHttpClient.deleteBasicData(basicDataRequest,userId+"");
return ResultVOUtils.success("删除成功"); return ResultVOUtils.success("删除成功");

@ -10,6 +10,7 @@ import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BusinessType; import com.glxp.api.constant.BusinessType;
import com.glxp.api.constant.ConstantStatus; import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.constant.SyncDelType;
import com.glxp.api.controller.BaseController; import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.basic.*; import com.glxp.api.entity.basic.*;
import com.glxp.api.entity.system.SystemParamConfigEntity; import com.glxp.api.entity.system.SystemParamConfigEntity;
@ -289,10 +290,9 @@ public class UdiRelevanceController extends BaseController {
//调用同步删除的方法 //调用同步删除的方法
BasicDataRequest basicDataRequest = new BasicDataRequest(); BasicDataRequest basicDataRequest = new BasicDataRequest();
basicDataRequest.setDeleteRequest(deleteRequest); basicDataRequest.setDeleteRequest(deleteRequest);
basicDataRequest.setKey("BASIC_MAINTAIN"); basicDataRequest.setKey(SyncDelType.BASIC_MAINTAIN);
Long userId = getUserId(); Long userId = getUserId();
spGetHttpClient.deleteBasicData(basicDataRequest,userId+""); spGetHttpClient.deleteBasicData(basicDataRequest, userId + "");
return ResultVOUtils.success("删除成功"); return ResultVOUtils.success("删除成功");
} }

@ -9,6 +9,7 @@ import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BusinessType; import com.glxp.api.constant.BusinessType;
import com.glxp.api.constant.SyncDelType;
import com.glxp.api.controller.BaseController; import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.auth.AuthAdmin; import com.glxp.api.entity.auth.AuthAdmin;
import com.glxp.api.entity.basic.BasicCorpEntity; import com.glxp.api.entity.basic.BasicCorpEntity;
@ -316,7 +317,7 @@ public class UdiRlSupController extends BaseController {
//调用同步删除的方法 //调用同步删除的方法
BasicDataRequest basicDataRequest = new BasicDataRequest(); BasicDataRequest basicDataRequest = new BasicDataRequest();
basicDataRequest.setDeleteCompanyFileRequest(deleteCompanyFileRequest); basicDataRequest.setDeleteCompanyFileRequest(deleteCompanyFileRequest);
basicDataRequest.setKey("BASIC_MANAGE"); basicDataRequest.setKey(SyncDelType.BASIC_MANAGE);
Long userId = getUserId(); Long userId = getUserId();
spGetHttpClient.deleteBasicData(basicDataRequest,userId+""); spGetHttpClient.deleteBasicData(basicDataRequest,userId+"");
return ResultVOUtils.success("成功"); return ResultVOUtils.success("成功");

@ -1,23 +1,34 @@
package com.glxp.api.controller.inv; 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.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BasicExportTypeEnum;
import com.glxp.api.constant.Constant; import com.glxp.api.constant.Constant;
import com.glxp.api.constant.DeviceStatus; 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.DeviceInspectTaskDetailEntity;
import com.glxp.api.entity.inv.DeviceInspectTaskEntity; 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.http.sync.SpGetHttpClient;
import com.glxp.api.req.basic.BasicDataRequest;
import com.glxp.api.req.inv.FilterDeviceInspectTakeRequest; import com.glxp.api.req.inv.FilterDeviceInspectTakeRequest;
import com.glxp.api.res.inv.DeviceInspectTakeResponse; import com.glxp.api.res.inv.DeviceInspectTakeResponse;
import com.glxp.api.res.sync.SpsSyncDeviceTakeResponse; import com.glxp.api.res.sync.SpsSyncDeviceTakeResponse;
import com.glxp.api.service.inv.DeviceInspectTaskDetailService; import com.glxp.api.service.inv.DeviceInspectTaskDetailService;
import com.glxp.api.service.inv.DeviceInspectTaskService; 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.GennerOrderUtils;
import com.glxp.api.util.OkHttpCli; import com.glxp.api.util.OkHttpCli;
import com.glxp.api.util.OrderNoTypeBean; import com.glxp.api.util.OrderNoTypeBean;
import lombok.extern.slf4j.Slf4j; 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.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@ -32,7 +43,7 @@ import java.util.List;
*/ */
@Slf4j @Slf4j
@RestController @RestController
public class DeviceInspectTakeController { public class DeviceInspectTakeController extends BaseController {
@Resource @Resource
DeviceInspectTaskService deviceInspectTaskService; DeviceInspectTaskService deviceInspectTaskService;
@ -56,18 +67,19 @@ public class DeviceInspectTakeController {
PageInfo<DeviceInspectTakeResponse> pageInfo = new PageInfo<>(list); PageInfo<DeviceInspectTakeResponse> pageInfo = new PageInfo<>(list);
return ResultVOUtils.page(pageInfo); return ResultVOUtils.page(pageInfo);
} }
@PostMapping("/udiwms/inv/device/inspect/take/uploadDeviceInspecTake") @PostMapping("/udiwms/inv/device/inspect/take/uploadDeviceInspecTake")
public BaseResponse uploadDeviceInspecTake(@RequestBody DeviceInspectTaskEntity deviceInspectTaskEntity) { public BaseResponse uploadDeviceInspecTake(@RequestBody DeviceInspectTaskEntity deviceInspectTaskEntity) {
deviceInspectTaskEntity.setUpdateTime(new Date()); deviceInspectTaskEntity.setUpdateTime(new Date());
if(deviceInspectTaskEntity.getStatus() == DeviceStatus.DEVICE_STATUS_TEMP_DURINGINSPECTTION){ if (deviceInspectTaskEntity.getStatus() == DeviceStatus.DEVICE_STATUS_TEMP_DURINGINSPECTTION) {
deviceInspectTaskEntity.setStrartTime(new Date()); 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()); deviceInspectTaskEntity.setEndTime(new Date());
} }
boolean falg=deviceInspectTaskService.updateById(deviceInspectTaskEntity); boolean falg = deviceInspectTaskService.updateById(deviceInspectTaskEntity);
UploadDeviceTake(deviceInspectTaskEntity.getId(),2); UploadDeviceTake(deviceInspectTaskEntity.getId(), 2);
if(!falg){ if (!falg) {
return ResultVOUtils.error(999,"更新失败"); return ResultVOUtils.error(999, "更新失败");
} }
return ResultVOUtils.success(); return ResultVOUtils.success();
} }
@ -75,53 +87,59 @@ public class DeviceInspectTakeController {
@PostMapping("/udiwms/inv/device/inspect/take/uploadDeviceTake") @PostMapping("/udiwms/inv/device/inspect/take/uploadDeviceTake")
public BaseResponse uploadDeviceTake(@RequestBody DeviceInspectTaskEntity deviceInspectTaskEntity) { public BaseResponse uploadDeviceTake(@RequestBody DeviceInspectTaskEntity deviceInspectTaskEntity) {
deviceInspectTaskEntity.setUpdateTime(new Date()); deviceInspectTaskEntity.setUpdateTime(new Date());
boolean falg=deviceInspectTaskService.updateById(deviceInspectTaskEntity); boolean falg = deviceInspectTaskService.updateById(deviceInspectTaskEntity);
if(deviceInspectTaskEntity.getStatus() == 2){ if (deviceInspectTaskEntity.getStatus() == 2) {
UploadDeviceTake(deviceInspectTaskEntity.getId(),1); UploadDeviceTake(deviceInspectTaskEntity.getId(), 1);
} }
if(!falg){ if (!falg) {
return ResultVOUtils.error(999,"更新失败"); return ResultVOUtils.error(999, "更新失败");
} }
return ResultVOUtils.success(); return ResultVOUtils.success();
} }
@PostMapping("/udiwms/inv/device/inspect/take/addDeviceInspecTake") @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")); String orderId = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.DEVICE_INSPECT_PLAN_ORDER, "yyyyMMdd"));
deviceInspectTaskEntity.setOrderId(orderId); deviceInspectTaskEntity.setOrderId(orderId);
deviceInspectTaskEntity.setCreateTime(new Date()); deviceInspectTaskEntity.setCreateTime(new Date());
deviceInspectTaskService.addDeviceInspectTask(deviceInspectTaskEntity); deviceInspectTaskService.addDeviceInspectTask(deviceInspectTaskEntity);
return ResultVOUtils.success(deviceInspectTaskEntity); return ResultVOUtils.success(deviceInspectTaskEntity);
} }
@PostMapping("/udiwms/inv/device/inspect/take/delectDeviceInspecTake") @PostMapping("/udiwms/inv/device/inspect/take/delectDeviceInspecTake")
public BaseResponse delectDeviceInspecTake(@RequestBody DeviceInspectTaskEntity deviceInspectTaskEntity) { public BaseResponse delectDeviceInspecTake(@RequestBody DeviceInspectTaskEntity deviceInspectTaskEntity) {
deviceInspectTaskService.delectDeviceInspectTask(deviceInspectTaskEntity); deviceInspectTaskService.removeById(deviceInspectTaskEntity.getId());
deviceInspectTaskDetailService.remove(new QueryWrapper<DeviceInspectTaskDetailEntity>().eq("taskOrderIdFk",deviceInspectTaskEntity.getOrderId())); deviceInspectTaskDetailService.remove(new QueryWrapper<DeviceInspectTaskDetailEntity>().eq("taskOrderIdFk", deviceInspectTaskEntity.getOrderId()));
UploadDeviceTake(deviceInspectTaskEntity.getId(),3); 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); return ResultVOUtils.success(deviceInspectTaskEntity);
} }
void UploadDeviceTake(Integer id,Integer type){
//提交上传到自助
//查询任务表
DeviceInspectTaskEntity deviceInspectTaskEntity=deviceInspectTaskService.getById(id);
List<DeviceInspectTaskDetailEntity> deviceInspectTaskDetailEntityList = deviceInspectTaskDetailService
.list(new QueryWrapper<DeviceInspectTaskDetailEntity>().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<DeviceInspectTaskDetailEntity> deviceInspectTaskDetailEntityList = deviceInspectTaskDetailService
// .list(new QueryWrapper<DeviceInspectTaskDetailEntity>().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") @PostMapping("/udiwms/inv/device/inspect/take/detail/uploadDeviceInspecTakeDetail")
public BaseResponse uploadDeviceInspecTakeDetail(@RequestBody DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity) { public BaseResponse uploadDeviceInspecTakeDetail(@RequestBody DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity) {
deviceInspectTaskDetailEntity.setUpdateTime(new Date()); deviceInspectTaskDetailEntity.setUpdateTime(new Date());
boolean falg=deviceInspectTaskDetailService.uploadDeviceInspecTakeDetail(deviceInspectTaskDetailEntity); boolean falg = deviceInspectTaskDetailService.uploadDeviceInspecTakeDetail(deviceInspectTaskDetailEntity);
if(!falg){ if (!falg) {
return ResultVOUtils.error(999,"更新失败"); return ResultVOUtils.error(999, "更新失败");
} }
return ResultVOUtils.success(); return ResultVOUtils.success();
} }
@PostMapping("/udiwms/inv/device/inspect/take/detail/addDeviceInspecTakeDetail") @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); boolean falg = deviceInspectTaskDetailService.addDeviceInspectTaskDelect(deviceInspectTaskDetailEntity);
if(!falg){ if (!falg) {
return ResultVOUtils.error(999,"更新失败"); return ResultVOUtils.error(999, "更新失败");
} }
return ResultVOUtils.success(); return ResultVOUtils.success();
} }
@ -154,13 +172,12 @@ public class DeviceInspectTakeController {
@GetMapping("/udiwms/inv/device/inspect/take/detail/delectDeviceInspecTakeDetail") @GetMapping("/udiwms/inv/device/inspect/take/detail/delectDeviceInspecTakeDetail")
public BaseResponse delecttDeviceInspecTakeDetail(String id) { public BaseResponse delecttDeviceInspecTakeDetail(String id) {
boolean falg=deviceInspectTaskDetailService.removeById(id); boolean falg = deviceInspectTaskDetailService.removeById(id);
if(!falg){ if (!falg) {
return ResultVOUtils.error(999,"删除失败"); return ResultVOUtils.error(999, "删除失败");
} }
return ResultVOUtils.success(); return ResultVOUtils.success();
} }
} }

@ -406,7 +406,7 @@ public class SupCertController {
} }
String param = JSON.toJSONString(list); 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); 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); 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");
} }
//首营预览文件 //首营预览文件

@ -1,6 +1,8 @@
package com.glxp.api.dao.inv; package com.glxp.api.dao.inv;
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.inv.DeviceInspectTaskDetailEntity;
import com.glxp.api.entity.inv.DeviceInspectTaskEntity; import com.glxp.api.entity.inv.DeviceInspectTaskEntity;
import com.glxp.api.req.inv.FilterDeviceInspectPlanRequest; import com.glxp.api.req.inv.FilterDeviceInspectPlanRequest;
import com.glxp.api.req.inv.FilterDeviceInspectTakeRequest; import com.glxp.api.req.inv.FilterDeviceInspectTakeRequest;
@ -11,7 +13,6 @@ import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
@Mapper @Mapper
public interface DeviceInspectTaskMapper extends BaseMapper<DeviceInspectTaskEntity> { public interface DeviceInspectTaskMapper extends BaseMapperPlus<DeviceInspectTaskMapper, DeviceInspectTaskEntity, DeviceInspectTaskEntity> {
List<DeviceInspectTakeResponse> filterList(FilterDeviceInspectTakeRequest filterDeviceInspectTakeRequest); List<DeviceInspectTakeResponse> filterList(FilterDeviceInspectTakeRequest filterDeviceInspectTakeRequest);
} }

@ -4,15 +4,17 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import lombok.Data; import lombok.Data;
@Data @Data
@TableName(value = "device_inspect_task_detail") @TableName(value = "device_inspect_task_detail")
public class DeviceInspectTaskDetailEntity implements Serializable { public class DeviceInspectTaskDetailEntity implements Serializable {
@TableId(value = "id", type = IdType.INPUT) @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 String inspectName;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }

@ -11,9 +11,9 @@ import java.util.Date;
@Data @Data
@TableName(value = "device_inspect_task") @TableName(value = "device_inspect_task")
public class DeviceInspectTaskEntity{ public class DeviceInspectTaskEntity {
@TableId(value = "id", type = IdType.AUTO) @TableId(value = "id", type = IdType.AUTO)
private Integer id; private Long id;
/** /**
* *

@ -68,5 +68,9 @@ public class SyncDataSetEntity {
private int manufacturerCert; private int manufacturerCert;
private int productCert; private int productCert;
private int orderInvoice; //发票信息 private int orderInvoice; //发票信息
/**
*
*/
private int deviceTask;
} }

@ -8,6 +8,7 @@ import com.alibaba.fastjson2.JSON;
import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BasicExportTypeEnum; import com.glxp.api.constant.BasicExportTypeEnum;
import com.glxp.api.constant.SyncDelType;
import com.glxp.api.entity.basic.ProductInfoEntity; import com.glxp.api.entity.basic.ProductInfoEntity;
import com.glxp.api.entity.inout.IoOrderEntity; import com.glxp.api.entity.inout.IoOrderEntity;
import com.glxp.api.entity.sync.BasicExportStatusEntity; import com.glxp.api.entity.sync.BasicExportStatusEntity;
@ -141,18 +142,18 @@ public class SpGetHttpClient {
//日志参数类 //日志参数类
DeleteBasicDataRequest deleteBasicDataRequest = new DeleteBasicDataRequest(); 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); deleteBasicDataRequest.setUserId(userId);
String json =""; String json = "";
switch (basicDataRequest.getKey()){ switch (basicDataRequest.getKey()) {
case "BASIC_MAINTAIN": case SyncDelType.BASIC_MAINTAIN:
deleteBasicDataRequest.setDataType(basicDataRequest.getKey()); deleteBasicDataRequest.setDataType(basicDataRequest.getKey());
deleteBasicDataRequest.setParam(JSONUtil.toJsonStr(basicDataRequest.getDeleteRequest()) + basicDataRequest.getKey()); deleteBasicDataRequest.setParam(JSONUtil.toJsonStr(basicDataRequest.getDeleteRequest()) + basicDataRequest.getKey());
deleteBasicDataRequest.setName("耗材字典维护"); deleteBasicDataRequest.setName("耗材字典维护");
basicDataRequest.setDeleteBasicDataRequest(deleteBasicDataRequest); basicDataRequest.setDeleteBasicDataRequest(deleteBasicDataRequest);
json = JSONUtil.toJsonStr(basicDataRequest); json = JSONUtil.toJsonStr(basicDataRequest);
break; break;
case "BASIC_MANAGE": case SyncDelType.BASIC_MANAGE:
deleteBasicDataRequest.setDataType(basicDataRequest.getKey()); deleteBasicDataRequest.setDataType(basicDataRequest.getKey());
deleteBasicDataRequest.setParam(JSONUtil.toJsonStr(basicDataRequest.getDeleteCompanyFileRequest()) + basicDataRequest.getKey()); deleteBasicDataRequest.setParam(JSONUtil.toJsonStr(basicDataRequest.getDeleteCompanyFileRequest()) + basicDataRequest.getKey());
deleteBasicDataRequest.setName("供应商器械信息"); deleteBasicDataRequest.setName("供应商器械信息");
@ -160,14 +161,14 @@ public class SpGetHttpClient {
json = JSONUtil.toJsonStr(basicDataRequest); json = JSONUtil.toJsonStr(basicDataRequest);
break; break;
case "BASIC_CORP_MAINTAIN": case SyncDelType.BASIC_CORP_MAINTAIN:
deleteBasicDataRequest.setDataType(basicDataRequest.getKey()); deleteBasicDataRequest.setDataType(basicDataRequest.getKey());
deleteBasicDataRequest.setParam(JSONUtil.toJsonStr(basicDataRequest.getDeleteRequest()) + basicDataRequest.getKey()); deleteBasicDataRequest.setParam(JSONUtil.toJsonStr(basicDataRequest.getDeleteRequest()) + basicDataRequest.getKey());
deleteBasicDataRequest.setName("往来信息维护"); deleteBasicDataRequest.setName("往来信息维护");
basicDataRequest.setDeleteBasicDataRequest(deleteBasicDataRequest); basicDataRequest.setDeleteBasicDataRequest(deleteBasicDataRequest);
json = JSONUtil.toJsonStr(basicDataRequest); json = JSONUtil.toJsonStr(basicDataRequest);
break; break;
case "BASIC_BUSINESS_TYPE": case SyncDelType.BASIC_BUSINESS_TYPE:
deleteBasicDataRequest.setDataType(basicDataRequest.getKey()); deleteBasicDataRequest.setDataType(basicDataRequest.getKey());
deleteBasicDataRequest.setParam(JSONUtil.toJsonStr(basicDataRequest.getDeleteRequest()) + basicDataRequest.getKey()); deleteBasicDataRequest.setParam(JSONUtil.toJsonStr(basicDataRequest.getDeleteRequest()) + basicDataRequest.getKey());
deleteBasicDataRequest.setName("单据类型设置"); deleteBasicDataRequest.setName("单据类型设置");
@ -175,6 +176,14 @@ public class SpGetHttpClient {
json = JSONUtil.toJsonStr(basicDataRequest); json = JSONUtil.toJsonStr(basicDataRequest);
break; 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: default:
break; break;
} }
@ -189,13 +198,13 @@ public class SpGetHttpClient {
JSONObject.parseObject(result, new TypeReference<BaseResponse>() { JSONObject.parseObject(result, new TypeReference<BaseResponse>() {
}); });
//插入操作日志 //插入操作日志
insertLog(deleteBasicDataRequest,response,userId); insertLog(deleteBasicDataRequest, response, userId);
//插入操作数据类型记录表 //插入操作数据类型记录表
insertType(deleteBasicDataRequest); insertType(deleteBasicDataRequest);
return response; 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 syncEditLogEntity = new SyncEditLogEntity();
syncEditLogEntity.setRecordCode(deleteBasicDataRequest.getRecordCode()); syncEditLogEntity.setRecordCode(deleteBasicDataRequest.getRecordCode());
syncEditLogEntity.setOperType(2); syncEditLogEntity.setOperType(2);
@ -209,7 +218,7 @@ public class SpGetHttpClient {
syncEditLogService.insertLog(syncEditLogEntity); syncEditLogService.insertLog(syncEditLogEntity);
} }
public void insertType(DeleteBasicDataRequest deleteBasicDataRequest){ public void insertType(DeleteBasicDataRequest deleteBasicDataRequest) {
SyncEditTypeEntity syncEditTypeEntity = new SyncEditTypeEntity(); SyncEditTypeEntity syncEditTypeEntity = new SyncEditTypeEntity();
syncEditTypeEntity.setCode(deleteBasicDataRequest.getDataType()); syncEditTypeEntity.setCode(deleteBasicDataRequest.getDataType());
syncEditTypeEntity.setName(deleteBasicDataRequest.getName()); syncEditTypeEntity.setName(deleteBasicDataRequest.getName());
@ -217,7 +226,6 @@ public class SpGetHttpClient {
} }
public BaseResponse<IoOrderEntity> getSimpleOrder(ReviewSpmsRequest reviewSpmsRequest, String userId) { public BaseResponse<IoOrderEntity> getSimpleOrder(ReviewSpmsRequest reviewSpmsRequest, String userId) {
String json = JSONUtil.toJsonStr(reviewSpmsRequest); String json = JSONUtil.toJsonStr(reviewSpmsRequest);
List<String> header = (List<String>) Convert.toList(buildHeader()); List<String> header = (List<String>) Convert.toList(buildHeader());
@ -600,7 +608,7 @@ public class SpGetHttpClient {
//上传设备任务 //上传设备任务
public BaseResponse<String> postAllDeviceTake(SpsSyncDeviceTakeResponse spsSyncDeviceTakeResponse) { public BaseResponse<String> postAllDeviceTake(SpsSyncDeviceTakeResponse spsSyncDeviceTakeResponse) {
String json = JSONUtil.toJsonStr(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<String> response = BaseResponse<String> response =
JSONObject.parseObject(result, new TypeReference<BaseResponse<String>>() { JSONObject.parseObject(result, new TypeReference<BaseResponse<String>>() {
}); });

@ -1,17 +1,29 @@
package com.glxp.api.req.basic; 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.DeleteCompanyFileRequest;
import com.glxp.api.req.system.DeleteRequest; import com.glxp.api.req.system.DeleteRequest;
import lombok.Data; import lombok.Data;
@Data @Data
public class BasicDataRequest { public class BasicDataRequest {
//耗材字典 /**
private DeleteRequest deleteRequest; *
//供应商器械信息 */
private DeleteCompanyFileRequest deleteCompanyFileRequest; private DeleteRequest deleteRequest;
//日志参数类 /**
private DeleteBasicDataRequest deleteBasicDataRequest; *
private String key; */
private DeleteCompanyFileRequest deleteCompanyFileRequest;
/**
*
*/
private DeleteBasicDataRequest deleteBasicDataRequest;
/**
*
*/
private DeviceInspectTaskEntity deviceInspectTaskEntity;
private String key;
} }

@ -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<DeviceInspectTaskEntity> deviceInspectTaskEntities;
List<DeviceInspectTaskDetailEntity> deviceInspectTaskDetailEntities;
}

@ -1,5 +1,6 @@
package com.glxp.api.service.inv; package com.glxp.api.service.inv;
import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.glxp.api.dao.inv.DeviceInspectTaskMapper; import com.glxp.api.dao.inv.DeviceInspectTaskMapper;
import com.glxp.api.entity.inv.DeviceInspectPlanDelectEntity; import com.glxp.api.entity.inv.DeviceInspectPlanDelectEntity;
@ -19,13 +20,16 @@ public class DeviceInspectTaskDetailService extends ServiceImpl<DeviceInspectTas
@Resource @Resource
private DeviceInspectTaskDetailMapper deviceInspectTaskDetailMapper; private DeviceInspectTaskDetailMapper deviceInspectTaskDetailMapper;
public Boolean addDeviceInspectTaskDelect(DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity){ public Boolean addDeviceInspectTaskDelect(DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity) {
deviceInspectTaskDetailEntity.setUpdateTime(new Date()); deviceInspectTaskDetailEntity.setUpdateTime(new Date());
if (deviceInspectTaskDetailEntity.getId() == null) {
deviceInspectTaskDetailEntity.setId(IdUtil.getSnowflakeNextId());
}
deviceInspectTaskDetailMapper.insert(deviceInspectTaskDetailEntity); deviceInspectTaskDetailMapper.insert(deviceInspectTaskDetailEntity);
return true; return true;
} }
public Boolean addDeviceInspectTaskDelectList(List<DeviceInspectTaskDetailEntity> deviceInspectTaskDetailEntityList){ public Boolean addDeviceInspectTaskDelectList(List<DeviceInspectTaskDetailEntity> deviceInspectTaskDetailEntityList) {
deviceInspectTaskDetailMapper.insertBatch(deviceInspectTaskDetailEntityList); deviceInspectTaskDetailMapper.insertBatch(deviceInspectTaskDetailEntityList);
return true; return true;
} }
@ -34,27 +38,26 @@ public class DeviceInspectTaskDetailService extends ServiceImpl<DeviceInspectTas
public List<DeviceInspectTaskDetailEntity> selectDeviceInspectTakeDetail(DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity) { public List<DeviceInspectTaskDetailEntity> selectDeviceInspectTakeDetail(DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity) {
QueryWrapper<DeviceInspectTaskDetailEntity> ew = new QueryWrapper<>(); QueryWrapper<DeviceInspectTaskDetailEntity> ew = new QueryWrapper<>();
if(deviceInspectTaskDetailEntity.getProjectCode() != null){ if (deviceInspectTaskDetailEntity.getProjectCode() != null) {
ew.eq("projectCode",deviceInspectTaskDetailEntity.getProjectCode()); ew.eq("projectCode", deviceInspectTaskDetailEntity.getProjectCode());
} }
if(deviceInspectTaskDetailEntity.getId() != null){ if (deviceInspectTaskDetailEntity.getId() != null) {
ew.eq("id",deviceInspectTaskDetailEntity.getId()); ew.eq("id", deviceInspectTaskDetailEntity.getId());
} }
if(deviceInspectTaskDetailEntity.getTaskOrderIdFk() != null){ if (deviceInspectTaskDetailEntity.getTaskOrderIdFk() != null) {
ew.eq("taskOrderIdFk",deviceInspectTaskDetailEntity.getTaskOrderIdFk()); ew.eq("taskOrderIdFk", deviceInspectTaskDetailEntity.getTaskOrderIdFk());
} }
if(deviceInspectTaskDetailEntity.getStatus() != null){ if (deviceInspectTaskDetailEntity.getStatus() != null) {
ew.like("status",deviceInspectTaskDetailEntity.getStatus()); ew.like("status", deviceInspectTaskDetailEntity.getStatus());
} }
ew.select("*, ( SELECT `employeeName` FROM auth_user WHERE id = device_inspect_task_detail.inspectUser ) inspectName"); ew.select("*, ( SELECT `employeeName` FROM auth_user WHERE id = device_inspect_task_detail.inspectUser ) inspectName");
List<DeviceInspectTaskDetailEntity> deviceInspectPlanDelectEntities=deviceInspectTaskDetailMapper.selectList(ew); List<DeviceInspectTaskDetailEntity> deviceInspectPlanDelectEntities = deviceInspectTaskDetailMapper.selectList(ew);
return deviceInspectPlanDelectEntities; return deviceInspectPlanDelectEntities;
} }
public Boolean uploadDeviceInspecTakeDetail(DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntityList){ public Boolean uploadDeviceInspecTakeDetail(DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntityList) {
return deviceInspectTaskDetailMapper.updateById(deviceInspectTaskDetailEntityList) > 0 ? true : false; return deviceInspectTaskDetailMapper.updateById(deviceInspectTaskDetailEntityList) > 0 ? true : false;
} }
} }

@ -1,5 +1,6 @@
package com.glxp.api.service.inv; package com.glxp.api.service.inv;
import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.glxp.api.dao.inv.DeviceInspectTaskMapper; import com.glxp.api.dao.inv.DeviceInspectTaskMapper;
@ -19,19 +20,21 @@ public class DeviceInspectTaskService extends ServiceImpl<DeviceInspectTaskMappe
@Resource @Resource
private DeviceInspectTaskMapper deviceInspectTaskMapper; private DeviceInspectTaskMapper deviceInspectTaskMapper;
public Boolean addDeviceInspectTask(DeviceInspectTaskEntity deviceInspectTaskEntity){ public Boolean addDeviceInspectTask(DeviceInspectTaskEntity deviceInspectTaskEntity) {
deviceInspectTaskEntity.setUpdateTime(new Date()); deviceInspectTaskEntity.setUpdateTime(new Date());
deviceInspectTaskMapper.insert(deviceInspectTaskEntity); if (deviceInspectTaskEntity.getId() == null) {
return true; deviceInspectTaskEntity.setId(IdUtil.getSnowflakeNextId());
}
deviceInspectTaskMapper.insert(deviceInspectTaskEntity);
return true;
} }
public Boolean delectDeviceInspectTask(DeviceInspectTaskEntity deviceInspectTaskEntity){ public Boolean delectDeviceInspectTask(DeviceInspectTaskEntity deviceInspectTaskEntity) {
deviceInspectTaskMapper.deleteById(deviceInspectTaskEntity); deviceInspectTaskMapper.deleteById(deviceInspectTaskEntity);
return true; return true;
} }
public List<DeviceInspectTakeResponse> filterList(FilterDeviceInspectTakeRequest filterDeviceInspectTakeRequest) { public List<DeviceInspectTakeResponse> filterList(FilterDeviceInspectTakeRequest filterDeviceInspectTakeRequest) {
if (null == filterDeviceInspectTakeRequest) { if (null == filterDeviceInspectTakeRequest) {
return Collections.emptyList(); return Collections.emptyList();

@ -10,18 +10,23 @@ import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference; import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.*; import com.glxp.api.constant.*;
import com.glxp.api.dao.basic.*; import com.glxp.api.dao.basic.*;
import com.glxp.api.dao.inout.*; 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.purchase.*;
import com.glxp.api.dao.thrsys.ThrBusTypeOriginDao; import com.glxp.api.dao.thrsys.ThrBusTypeOriginDao;
import com.glxp.api.dto.RelaySyncDto; import com.glxp.api.dto.RelaySyncDto;
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.inout.*; 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.purchase.*;
import com.glxp.api.entity.sync.BasicDownloadStatusEntity; import com.glxp.api.entity.sync.BasicDownloadStatusEntity;
import com.glxp.api.entity.sync.BasicExportStatusEntity; 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.basic.*;
import com.glxp.api.service.inout.*; import com.glxp.api.service.inout.*;
import com.glxp.api.service.inout.impl.IoOrderInvoiceService; 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.system.*;
import com.glxp.api.service.thrsys.*; import com.glxp.api.service.thrsys.*;
import com.glxp.api.util.CustomUtil; import com.glxp.api.util.CustomUtil;
@ -233,7 +240,6 @@ public class HeartService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void pushData(SyncDataSetEntity info, Date syncTime, BasicExportTypeEnum exportType) { public void pushData(SyncDataSetEntity info, Date syncTime, BasicExportTypeEnum exportType) {
Date now = new Date(); Date now = new Date();
String taskId = CustomUtil.getId(); String taskId = CustomUtil.getId();
switch (exportType) { switch (exportType) {
@ -270,6 +276,12 @@ public class HeartService {
case IO_ORDER: case IO_ORDER:
if (needExec()) if (needExec())
break; 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; 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<String, Object> 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<String, Object> map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.DEVICE_TASK);
List<DeviceInspectTaskEntity> 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<DeviceInspectTaskDetailEntity> datas = new ArrayList<>();
List<String> files = new ArrayList<>();
for (DeviceInspectTaskEntity deviceInspectTaskEntity : deviceInspectTaskEntities) {
List<DeviceInspectTaskDetailEntity> deviceInspectTaskDetailEntities = deviceInspectTaskDetailService.list(new QueryWrapper<DeviceInspectTaskDetailEntity>().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: case DOCUMENT_TYPE_DATA:
this.insertDocumentTypeData(bean.getFileContent()); this.insertDocumentTypeData(bean.getFileContent());
break; break;
case DEVICE_TASK:
this.insertDevTaskData(bean.getFileContent());
break;
} }
String taskId = bean.getTaskId(); String taskId = bean.getTaskId();
if (StrUtil.isNotBlank(taskId)) { if (StrUtil.isNotBlank(taskId)) {
@ -1716,8 +1794,6 @@ public class HeartService {
} }
} }
@Resource
FileService fileService;
private final IdcService idcService; private final IdcService idcService;
private final IoCodeLostMapper ioCodeLostMapper; 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<DeviceInspectTaskEntity> deviceInspectTaskEntities = JSONUtil.toList(jsonObject.getJSONArray(DeviceInspectTaskEntity.class.getSimpleName()), DeviceInspectTaskEntity.class);
List<DeviceInspectTaskDetailEntity> 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<String> syncFiles = JSONUtil.toList(jsonObject.getJSONArray("syncFiles"), String.class);
if (CollUtil.isNotEmpty(syncFiles)) {
fileService.download(syncFiles);
}
}
/** /**
* UDI * UDI
*/ */

@ -72,7 +72,7 @@ public class SocketMsgService {
//插入日志 //插入日志
insertLog(basicDataRequest.getDeleteBasicDataRequest(), baseResponse); insertLog(basicDataRequest.getDeleteBasicDataRequest(), baseResponse);
insertType(basicDataRequest.getDeleteBasicDataRequest()); insertType(basicDataRequest.getDeleteBasicDataRequest());
break; break;
case SocketMsgType.BASIC_BUSINESS_TYPE_DELETE: case SocketMsgType.BASIC_BUSINESS_TYPE_DELETE:
object = JSON.parseObject(String.valueOf(socketMsgEntity.getContent()), Map.class); object = JSON.parseObject(String.valueOf(socketMsgEntity.getContent()), Map.class);
basicDataRequest = JSON.parseObject(String.valueOf(socketMsgEntity.getContent()), BasicDataRequest.class); basicDataRequest = JSON.parseObject(String.valueOf(socketMsgEntity.getContent()), BasicDataRequest.class);
@ -81,6 +81,14 @@ public class SocketMsgService {
insertLog(basicDataRequest.getDeleteBasicDataRequest(), baseResponse); insertLog(basicDataRequest.getDeleteBasicDataRequest(), baseResponse);
insertType(basicDataRequest.getDeleteBasicDataRequest()); insertType(basicDataRequest.getDeleteBasicDataRequest());
break; 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: default:
break; break;
} }
@ -147,7 +155,7 @@ public class SocketMsgService {
return ResultVOUtils.success("成功"); return ResultVOUtils.success("成功");
} }
public BaseResponse deleteBasicUnitMaintain( DeleteRequest deleteRequest) { public BaseResponse deleteBasicUnitMaintain(DeleteRequest deleteRequest) {
String id = deleteRequest.getId(); String id = deleteRequest.getId();
@ -159,7 +167,7 @@ public class SocketMsgService {
return ResultVOUtils.success("删除成功"); return ResultVOUtils.success("删除成功");
} }
public BaseResponse deleteBussinessType( DeleteRequest deleteRequest) { public BaseResponse deleteBussinessType(DeleteRequest deleteRequest) {
// if (bindingResult.hasErrors()) { // if (bindingResult.hasErrors()) {
// return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); // return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());

@ -1,5 +1,6 @@
package com.glxp.api.task; package com.glxp.api.task;
import cn.hutool.core.thread.ThreadUtil;
import com.glxp.api.constant.BasicExportTypeEnum; import com.glxp.api.constant.BasicExportTypeEnum;
import com.glxp.api.dao.system.SyncDataSetDao; import com.glxp.api.dao.system.SyncDataSetDao;
import com.glxp.api.entity.system.SyncDataSetEntity; 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() { public void pushOrder() {
SyncDataSetEntity syncDataSetEntity = syncDataSetDao.selectSet(); SyncDataSetEntity syncDataSetEntity = syncDataSetDao.selectSet();
if (!syncDataSetEntity.isDownstreamEnable()) { if (!syncDataSetEntity.isDownstreamEnable()) {

@ -91,7 +91,7 @@ public class uploadController {
file.transferTo(file1); file.transferTo(file1);
Map<String, String> rMap = new HashMap<>(); Map<String, String> rMap = new HashMap<>();
rMap.put("msg", "上传成功"); rMap.put("msg", "上传成功");
rMap.put("path",newName); rMap.put("path", newName);
return ResultVOUtils.success(rMap); return ResultVOUtils.success(rMap);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
@ -132,7 +132,7 @@ public class uploadController {
file.transferTo(file1); file.transferTo(file1);
Map<String, String> rMap = new HashMap<>(); Map<String, String> rMap = new HashMap<>();
rMap.put("msg", "上传成功"); rMap.put("msg", "上传成功");
rMap.put("name", fileUrl + savePath1 + "&name=" + newName); rMap.put("name", newName);
rMap.put("type", type); rMap.put("type", type);
return ResultVOUtils.success(rMap); return ResultVOUtils.success(rMap);
} catch (IOException e) { } catch (IOException e) {

@ -8,7 +8,7 @@ spring:
enabled: true enabled: true
max-file-size: 200MB max-file-size: 200MB
max-request-size: 200MB max-request-size: 200MB
location: E:/tmp location: D:/tmp
mybatis-plus: mybatis-plus:
mapper-locations: classpath:mybatis/mapper/*/*.xml mapper-locations: classpath:mybatis/mapper/*/*.xml

@ -153,7 +153,7 @@ CREATE TABLE IF NOT EXISTS `device_repair_order_detail`
ROW_FORMAT = Dynamic; 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, `id` bigint(0) NOT NULL,
`orderIdFk` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT 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; 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 `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); # 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);
# #

Loading…
Cancel
Save