修改设备任务ID为雪花ID(自增同步会有问题),其他相关bug修改

dev2.0
anthonywj 2 years ago
parent 46b683698c
commit 5f0ed5705d

@ -9,8 +9,8 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
@RequiredArgsConstructor
//@Configuration
//@RequiredArgsConstructor
public class MinioConfig {
@Data

@ -10,6 +10,7 @@ public interface SocketMsgType {
*
*/
String TASK_INVOICE_CONFIRM = "TASK_INVOICE_CONFIRM"; //发票确认
String TASK_SYNC_DELETE = "TASK_SYNC_DELETE"; //同步删除
String BASIC_DATA_DELETE = "BASIC_DATA_DELETE"; //耗材字典删除

@ -680,6 +680,9 @@ public class IoOrderController extends BaseController {
public BaseResponse updateOrder(@RequestBody IoOrderEntity ioOrderEntity) {
ioOrderEntity.setUpdateTime(new Date());
orderService.updateByBillNo(ioOrderEntity);
// webSocketServer.sendMessage(SocketMsgEntity.builder().type(SocketMsgType.TASK_SYNC_DELETE).content(ioOrderEntity.getBillNo()).remark("单据删除").build(), null);
webSocketServer.sendMessage(SocketMsgEntity.builder().type(SocketMsgType.TASK_INVOICE_CONFIRM).content(ioOrderEntity.getBillNo()).remark("发票确认").build(), null);
return ResultVOUtils.success();
}

@ -53,6 +53,7 @@ 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());
@ -79,7 +80,6 @@ public class DeviceInspectTakeController {
}
@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"));
@ -133,9 +133,6 @@ public class DeviceInspectTakeController {
}
//------------------------------------------ 详情方法--------------------------------------------------------------//
@GetMapping("/udiwms/inv/device/inspect/take/detail/selectDeviceInspecTakeDetail")
public BaseResponse selectDeviceInspecTakeDetail(DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity) {
@ -174,5 +171,4 @@ public class DeviceInspectTakeController {
}
}

@ -13,7 +13,7 @@ import java.util.Date;
@TableName(value = "device_inspect_task_detail")
public class DeviceInspectTaskDetailEntity implements Serializable {
@TableId(value = "id", type = IdType.INPUT)
private Integer id;
private Long id;
/**
*

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

@ -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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.glxp.api.dao.inv.DeviceInspectTaskDetailMapper;
@ -18,6 +19,9 @@ public class DeviceInspectTaskDetailService extends ServiceImpl<DeviceInspectTas
public Boolean addDeviceInspectTaskDelect(DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity) {
deviceInspectTaskDetailEntity.setUpdateTime(new Date());
if (deviceInspectTaskDetailEntity.getId() == null) {
deviceInspectTaskDetailEntity.setId(IdUtil.getSnowflakeNextId());
}
deviceInspectTaskDetailMapper.insert(deviceInspectTaskDetailEntity);
return true;
}
@ -53,5 +57,4 @@ public class DeviceInspectTaskDetailService extends ServiceImpl<DeviceInspectTas
}
}

@ -1,6 +1,7 @@
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;
@ -22,6 +23,9 @@ public class DeviceInspectTaskService extends ServiceImpl<DeviceInspectTaskMappe
public Boolean addDeviceInspectTask(DeviceInspectTaskEntity deviceInspectTaskEntity) {
deviceInspectTaskEntity.setUpdateTime(new Date());
if (deviceInspectTaskEntity.getId() == null) {
deviceInspectTaskEntity.setId(IdUtil.getSnowflakeNextId());
}
deviceInspectTaskMapper.insert(deviceInspectTaskEntity);
return true;
}
@ -32,7 +36,6 @@ public class DeviceInspectTaskService extends ServiceImpl<DeviceInspectTaskMappe
}
public List<DeviceInspectTakeResponse> filterList(FilterDeviceInspectTakeRequest filterDeviceInspectTakeRequest) {
if (null == filterDeviceInspectTakeRequest) {
return Collections.emptyList();

@ -24,128 +24,128 @@ import java.util.UUID;
@RestController
public class uploadController {
// @Value("${file_path}")
// private String filePath;
// @Value("${file_url}")
// private String fileUrl;
// @Value("${file_lpath}")
// private String fileLpath;
// @Value("${minio_path}")
// private String minioPath;
// @Value("${minio_url}")
// private String minioUrl;
//
//
// /**
// * 上传PDF模板
// */
//
// @PostMapping("/udiwms/upload/pdf/template/jasper")
// public BaseResponse uploadPDFTemplate(@RequestParam("file") MultipartFile file) throws UnsupportedEncodingException {
// if (file.isEmpty()) {
// return ResultVOUtils.error(ResultEnum.DATA_ERROR, "上传文件不能为空");
// }
// // 保存文件 ---------------------
// String fileName = file.getOriginalFilename();
// String fileType = fileName.substring(fileName.lastIndexOf("."));
// // 文件类型判断
// if (StringUtils.isBlank(fileType) || !fileType.equals(".jasper")) {
// return ResultVOUtils.error(ResultEnum.DATA_ERROR, "上传文件只能是 jasper 格式");
// }
// String newName = UUID.randomUUID() + fileType;//生成新文件名
// String savePath = filePath + "/pdf/template";
//
// File file1 = new File(savePath);
// if (!file1.exists()) {// 判断目录是否存在
// file1.mkdirs();// 创建多层目录
// }
// file1 = new File(savePath + "/" + newName);
// try {
// file.transferTo(file1);
// Map<String, String> rMap = new HashMap<>();
// rMap.put("msg", "上传成功");
// rMap.put("path", newName);
// return ResultVOUtils.success(rMap);
// } catch (IOException e) {
// e.printStackTrace();
// }
// return ResultVOUtils.error(ResultEnum.DATA_ERROR, "上传失败");
// }
//
//
// @PostMapping("/udiwms/upload/pdf/template/jrxml")
// public BaseResponse uploadPDFJrxmlTemplate(@RequestParam("file") MultipartFile file) throws UnsupportedEncodingException {
// if (file.isEmpty()) {
// return ResultVOUtils.error(ResultEnum.DATA_ERROR, "上传文件不能为空");
// }
// // 保存文件 ---------------------
// String fileName = file.getOriginalFilename();
// String fileType = fileName.substring(fileName.lastIndexOf("."));
// // 文件类型判断
// if (StringUtils.isBlank(fileType) || !fileType.equals(".jrxml")) {
// return ResultVOUtils.error(ResultEnum.DATA_ERROR, "上传文件只能是 jrxml 格式");
// }
// String newName = UUID.randomUUID() + fileType;//生成新文件名
// String savePath = filePath + "/pdf/template";
//
// File file1 = new File(savePath);
// if (!file1.exists()) {// 判断目录是否存在
// file1.mkdirs();// 创建多层目录
// }
// file1 = new File(savePath + "/" + newName);
// try {
// file.transferTo(file1);
// Map<String, String> rMap = new HashMap<>();
// rMap.put("msg", "上传成功");
// rMap.put("path", savePath + "/" + newName);
// return ResultVOUtils.success(rMap);
// } catch (IOException e) {
// e.printStackTrace();
// }
// return ResultVOUtils.error(ResultEnum.DATA_ERROR, "上传失败");
// }
//
// /**
// * 注册页面上传文件
// */
// @PostMapping("/udiwms/upload/register/file")
// public BaseResponse uploadRegisterFile(@RequestParam("file") MultipartFile file,
// @RequestParam("type") String type) throws UnsupportedEncodingException {
// if (file.isEmpty()) {
// return ResultVOUtils.error(ResultEnum.DATA_ERROR, "上传文件不能为空");
// }
// if (StringUtils.isBlank(type)) {
// return ResultVOUtils.error(ResultEnum.DATA_ERROR, "上传文件类型不能为空");
// }
//
// // 保存文件 ---------------------
// String fileName = file.getOriginalFilename();
// String fileType = fileName.substring(fileName.lastIndexOf("."));
// // 文件类型判断
// if (StringUtils.isBlank(fileType) || (!fileType.equals(".jpg") && !fileType.equals(".png") && !fileType.equals(".doc") && !fileType.equals(".pdf"))) {
// return ResultVOUtils.error(ResultEnum.DATA_ERROR, "上传文件只能是 jpg,png,doc,pdf 格式");
// }
// String newName = UUID.randomUUID() + fileType;//生成新文件名
// String savePath = filePath + "/register/file/" + type;
// String savePath1 = fileLpath + "?type=" + type;
// String fileFullName = savePath + "/" + newName;
//
// File file1 = new File(savePath);
// if (!file1.exists()) {// 判断目录是否存在
// file1.mkdirs();// 创建多层目录
// }
// file1 = new File(savePath + "/" + newName);
// try {
// file.transferTo(file1);
//// MinioUtil.uploadFile(fileFullName, file);
// Map<String, String> rMap = new HashMap<>();
// rMap.put("msg", "上传成功");
// rMap.put("name", fileUrl + savePath1 + "&name=" + newName);
// rMap.put("type", type);
// return ResultVOUtils.success(rMap);
// } catch (Exception e) {
// e.printStackTrace();
// }
// return ResultVOUtils.error(ResultEnum.DATA_ERROR, "上传失败");
// }
@Value("${file_path}")
private String filePath;
@Value("${file_url}")
private String fileUrl;
@Value("${file_lpath}")
private String fileLpath;
@Value("${minio_path}")
private String minioPath;
@Value("${minio_url}")
private String minioUrl;
/**
* PDF
*/
@PostMapping("/udiwms/upload/pdf/template/jasper")
public BaseResponse uploadPDFTemplate(@RequestParam("file") MultipartFile file) throws UnsupportedEncodingException {
if (file.isEmpty()) {
return ResultVOUtils.error(ResultEnum.DATA_ERROR, "上传文件不能为空");
}
// 保存文件 ---------------------
String fileName = file.getOriginalFilename();
String fileType = fileName.substring(fileName.lastIndexOf("."));
// 文件类型判断
if (StringUtils.isBlank(fileType) || !fileType.equals(".jasper")) {
return ResultVOUtils.error(ResultEnum.DATA_ERROR, "上传文件只能是 jasper 格式");
}
String newName = UUID.randomUUID() + fileType;//生成新文件名
String savePath = filePath + "/pdf/template";
File file1 = new File(savePath);
if (!file1.exists()) {// 判断目录是否存在
file1.mkdirs();// 创建多层目录
}
file1 = new File(savePath + "/" + newName);
try {
file.transferTo(file1);
Map<String, String> rMap = new HashMap<>();
rMap.put("msg", "上传成功");
rMap.put("path", newName);
return ResultVOUtils.success(rMap);
} catch (IOException e) {
e.printStackTrace();
}
return ResultVOUtils.error(ResultEnum.DATA_ERROR, "上传失败");
}
@PostMapping("/udiwms/upload/pdf/template/jrxml")
public BaseResponse uploadPDFJrxmlTemplate(@RequestParam("file") MultipartFile file) throws UnsupportedEncodingException {
if (file.isEmpty()) {
return ResultVOUtils.error(ResultEnum.DATA_ERROR, "上传文件不能为空");
}
// 保存文件 ---------------------
String fileName = file.getOriginalFilename();
String fileType = fileName.substring(fileName.lastIndexOf("."));
// 文件类型判断
if (StringUtils.isBlank(fileType) || !fileType.equals(".jrxml")) {
return ResultVOUtils.error(ResultEnum.DATA_ERROR, "上传文件只能是 jrxml 格式");
}
String newName = UUID.randomUUID() + fileType;//生成新文件名
String savePath = filePath + "/pdf/template";
File file1 = new File(savePath);
if (!file1.exists()) {// 判断目录是否存在
file1.mkdirs();// 创建多层目录
}
file1 = new File(savePath + "/" + newName);
try {
file.transferTo(file1);
Map<String, String> rMap = new HashMap<>();
rMap.put("msg", "上传成功");
rMap.put("path", savePath + "/" + newName);
return ResultVOUtils.success(rMap);
} catch (IOException e) {
e.printStackTrace();
}
return ResultVOUtils.error(ResultEnum.DATA_ERROR, "上传失败");
}
/**
*
*/
@PostMapping("/udiwms/upload/register/file")
public BaseResponse uploadRegisterFile(@RequestParam("file") MultipartFile file,
@RequestParam("type") String type) throws UnsupportedEncodingException {
if (file.isEmpty()) {
return ResultVOUtils.error(ResultEnum.DATA_ERROR, "上传文件不能为空");
}
if (StringUtils.isBlank(type)) {
return ResultVOUtils.error(ResultEnum.DATA_ERROR, "上传文件类型不能为空");
}
// 保存文件 ---------------------
String fileName = file.getOriginalFilename();
String fileType = fileName.substring(fileName.lastIndexOf("."));
// 文件类型判断
if (StringUtils.isBlank(fileType) || (!fileType.equals(".jpg") && !fileType.equals(".png") && !fileType.equals(".doc") && !fileType.equals(".pdf"))) {
return ResultVOUtils.error(ResultEnum.DATA_ERROR, "上传文件只能是 jpg,png,doc,pdf 格式");
}
String newName = UUID.randomUUID() + fileType;//生成新文件名
String savePath = filePath + "/register/file/" + type;
String savePath1 = fileLpath + "?type=" + type;
String fileFullName = savePath + "/" + newName;
File file1 = new File(savePath);
if (!file1.exists()) {// 判断目录是否存在
file1.mkdirs();// 创建多层目录
}
file1 = new File(savePath + "/" + newName);
try {
file.transferTo(file1);
// MinioUtil.uploadFile(fileFullName, file);
Map<String, String> rMap = new HashMap<>();
rMap.put("msg", "上传成功");
rMap.put("name", fileUrl + savePath1 + "&name=" + newName);
rMap.put("type", type);
return ResultVOUtils.success(rMap);
} catch (Exception e) {
e.printStackTrace();
}
return ResultVOUtils.error(ResultEnum.DATA_ERROR, "上传失败");
}
}

@ -20,7 +20,7 @@ import java.security.NoSuchAlgorithmException;
* minio
*/
@Slf4j
@Component
//@Component
public class MinioUtil {
private static MinioClient minioClient;

@ -132,3 +132,7 @@ CREATE TABLE IF NOT EXISTS `device_project_set`
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci
ROW_FORMAT = Dynamic;
CALL Pro_Temp_ColumnWork('device_inspect_task', 'id', 'bigint', 2);
CALL Pro_Temp_ColumnWork('device_inspect_task_detail', 'id', 'bigint', 2);

Loading…
Cancel
Save