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","自动建业务单设置"),
/**
*
*/
DEVICE_TASK("device_task", "设备任务"),
;
@EnumValue
private String key;

@ -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", "业务单据"),

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

@ -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.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+"");

@ -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("删除成功");

@ -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("删除成功");
}

@ -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("成功");

@ -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<DeviceInspectTakeResponse> 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,18 +87,17 @@ 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) {
String orderId = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.DEVICE_INSPECT_PLAN_ORDER, "yyyyMMdd"));
@ -99,29 +110,36 @@ public class DeviceInspectTakeController {
@PostMapping("/udiwms/inv/device/inspect/take/delectDeviceInspecTake")
public BaseResponse delectDeviceInspecTake(@RequestBody DeviceInspectTaskEntity deviceInspectTaskEntity) {
deviceInspectTaskService.delectDeviceInspectTask(deviceInspectTaskEntity);
deviceInspectTaskDetailService.remove(new QueryWrapper<DeviceInspectTaskDetailEntity>().eq("taskOrderIdFk",deviceInspectTaskEntity.getOrderId()));
UploadDeviceTake(deviceInspectTaskEntity.getId(),3);
deviceInspectTaskService.removeById(deviceInspectTaskEntity.getId());
deviceInspectTaskDetailService.remove(new QueryWrapper<DeviceInspectTaskDetailEntity>().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<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);
}
//------------------------------------------ 详情方法--------------------------------------------------------------//
@ -134,9 +152,9 @@ public class DeviceInspectTakeController {
@PostMapping("/udiwms/inv/device/inspect/take/detail/uploadDeviceInspecTakeDetail")
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();
}
@ -144,9 +162,9 @@ public class DeviceInspectTakeController {
@PostMapping("/udiwms/inv/device/inspect/take/detail/addDeviceInspecTakeDetail")
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();
}
}

@ -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");
}
//首营预览文件

@ -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<DeviceInspectTaskEntity> {
public interface DeviceInspectTaskMapper extends BaseMapperPlus<DeviceInspectTaskMapper, DeviceInspectTaskEntity, DeviceInspectTaskEntity> {
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.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;
/**
*

@ -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;
/**
*

@ -68,5 +68,9 @@ public class SyncDataSetEntity {
private int manufacturerCert;
private int productCert;
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.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<BaseResponse>() {
});
//插入操作日志
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<IoOrderEntity> getSimpleOrder(ReviewSpmsRequest reviewSpmsRequest, String userId) {
String json = JSONUtil.toJsonStr(reviewSpmsRequest);
List<String> header = (List<String>) Convert.toList(buildHeader());

@ -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 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;
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<DeviceInspectTas
@Resource
private DeviceInspectTaskDetailMapper deviceInspectTaskDetailMapper;
public Boolean addDeviceInspectTaskDelect(DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity){
public Boolean addDeviceInspectTaskDelect(DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity) {
deviceInspectTaskDetailEntity.setUpdateTime(new Date());
if (deviceInspectTaskDetailEntity.getId() == null) {
deviceInspectTaskDetailEntity.setId(IdUtil.getSnowflakeNextId());
}
deviceInspectTaskDetailMapper.insert(deviceInspectTaskDetailEntity);
return true;
}
public Boolean addDeviceInspectTaskDelectList(List<DeviceInspectTaskDetailEntity> deviceInspectTaskDetailEntityList){
public Boolean addDeviceInspectTaskDelectList(List<DeviceInspectTaskDetailEntity> deviceInspectTaskDetailEntityList) {
deviceInspectTaskDetailMapper.insertBatch(deviceInspectTaskDetailEntityList);
return true;
}
@ -34,27 +38,26 @@ public class DeviceInspectTaskDetailService extends ServiceImpl<DeviceInspectTas
public List<DeviceInspectTaskDetailEntity> selectDeviceInspectTakeDetail(DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity) {
QueryWrapper<DeviceInspectTaskDetailEntity> 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<DeviceInspectTaskDetailEntity> deviceInspectPlanDelectEntities=deviceInspectTaskDetailMapper.selectList(ew);
List<DeviceInspectTaskDetailEntity> deviceInspectPlanDelectEntities = deviceInspectTaskDetailMapper.selectList(ew);
return deviceInspectPlanDelectEntities;
}
public Boolean uploadDeviceInspecTakeDetail(DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntityList){
public Boolean uploadDeviceInspecTakeDetail(DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntityList) {
return deviceInspectTaskDetailMapper.updateById(deviceInspectTaskDetailEntityList) > 0 ? true : false;
}
}

@ -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<DeviceInspectTaskMappe
@Resource
private DeviceInspectTaskMapper deviceInspectTaskMapper;
public Boolean addDeviceInspectTask(DeviceInspectTaskEntity deviceInspectTaskEntity){
public Boolean addDeviceInspectTask(DeviceInspectTaskEntity deviceInspectTaskEntity) {
deviceInspectTaskEntity.setUpdateTime(new Date());
if (deviceInspectTaskEntity.getId() == null) {
deviceInspectTaskEntity.setId(IdUtil.getSnowflakeNextId());
}
deviceInspectTaskMapper.insert(deviceInspectTaskEntity);
return true;
}
public Boolean delectDeviceInspectTask(DeviceInspectTaskEntity deviceInspectTaskEntity){
public Boolean delectDeviceInspectTask(DeviceInspectTaskEntity deviceInspectTaskEntity) {
deviceInspectTaskMapper.deleteById(deviceInspectTaskEntity);
return true;
}
public List<DeviceInspectTakeResponse> filterList(FilterDeviceInspectTakeRequest filterDeviceInspectTakeRequest) {
if (null == filterDeviceInspectTakeRequest) {
return Collections.emptyList();

@ -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<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:
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<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
*/

@ -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());

@ -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()) {

@ -91,7 +91,7 @@ public class uploadController {
file.transferTo(file1);
Map<String, String> 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<String, String> 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) {

@ -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

@ -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);
#

Loading…
Cancel
Save