修改设备任务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.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
@Configuration //@Configuration
@RequiredArgsConstructor //@RequiredArgsConstructor
public class MinioConfig { public class MinioConfig {
@Data @Data

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

@ -680,6 +680,9 @@ public class IoOrderController extends BaseController {
public BaseResponse updateOrder(@RequestBody IoOrderEntity ioOrderEntity) { public BaseResponse updateOrder(@RequestBody IoOrderEntity ioOrderEntity) {
ioOrderEntity.setUpdateTime(new Date()); ioOrderEntity.setUpdateTime(new Date());
orderService.updateByBillNo(ioOrderEntity); 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); webSocketServer.sendMessage(SocketMsgEntity.builder().type(SocketMsgType.TASK_INVOICE_CONFIRM).content(ioOrderEntity.getBillNo()).remark("发票确认").build(), null);
return ResultVOUtils.success(); return ResultVOUtils.success();
} }

@ -53,17 +53,18 @@ 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);
if(!falg){ if (!falg) {
return ResultVOUtils.error(999,"更新失败"); return ResultVOUtils.error(999, "更新失败");
} }
return ResultVOUtils.success(); return ResultVOUtils.success();
} }
@ -71,15 +72,14 @@ 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(!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"));
@ -102,7 +102,7 @@ public class DeviceInspectTakeController {
public BaseResponse getDeviceInspecTake(@RequestBody SpsSyncDeviceTakeResponse spsSyncDeviceTakeResponse) { public BaseResponse getDeviceInspecTake(@RequestBody SpsSyncDeviceTakeResponse spsSyncDeviceTakeResponse) {
//新增 //新增
if(spsSyncDeviceTakeResponse.getType() == 1){ if (spsSyncDeviceTakeResponse.getType() == 1) {
DeviceInspectTaskEntity deviceInspectTaskEntity = spsSyncDeviceTakeResponse.getDeviceInspectTaskEntity(); DeviceInspectTaskEntity deviceInspectTaskEntity = spsSyncDeviceTakeResponse.getDeviceInspectTaskEntity();
deviceInspectTaskEntity.setId(null); deviceInspectTaskEntity.setId(null);
deviceInspectTaskService.save(deviceInspectTaskEntity); deviceInspectTaskService.save(deviceInspectTaskEntity);
@ -111,16 +111,16 @@ public class DeviceInspectTakeController {
deviceInspectTaskDetailEntity.setId(null); deviceInspectTaskDetailEntity.setId(null);
deviceInspectTaskDetailService.save(deviceInspectTaskDetailEntity); deviceInspectTaskDetailService.save(deviceInspectTaskDetailEntity);
} }
}else if(spsSyncDeviceTakeResponse.getType() == 2){ } else if (spsSyncDeviceTakeResponse.getType() == 2) {
//编辑 //编辑
DeviceInspectTaskEntity deviceInspectTaskEntity = spsSyncDeviceTakeResponse.getDeviceInspectTaskEntity(); DeviceInspectTaskEntity deviceInspectTaskEntity = spsSyncDeviceTakeResponse.getDeviceInspectTaskEntity();
deviceInspectTaskService.updateById(deviceInspectTaskEntity); deviceInspectTaskService.updateById(deviceInspectTaskEntity);
deviceInspectTaskDetailService.remove(new QueryWrapper<DeviceInspectTaskDetailEntity>().eq("taskOrderIdFk",deviceInspectTaskEntity.getOrderId())); deviceInspectTaskDetailService.remove(new QueryWrapper<DeviceInspectTaskDetailEntity>().eq("taskOrderIdFk", deviceInspectTaskEntity.getOrderId()));
List<DeviceInspectTaskDetailEntity> deviceInspectTaskDetailEntityList = spsSyncDeviceTakeResponse.getDeviceInspectTaskDetailEntityList(); List<DeviceInspectTaskDetailEntity> deviceInspectTaskDetailEntityList = spsSyncDeviceTakeResponse.getDeviceInspectTaskDetailEntityList();
for (DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity : deviceInspectTaskDetailEntityList) { for (DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity : deviceInspectTaskDetailEntityList) {
deviceInspectTaskDetailService.save(deviceInspectTaskDetailEntity); deviceInspectTaskDetailService.save(deviceInspectTaskDetailEntity);
} }
}else if(spsSyncDeviceTakeResponse.getType() == 3){ } else if (spsSyncDeviceTakeResponse.getType() == 3) {
//删除 //删除
DeviceInspectTaskEntity deviceInspectTaskEntity = spsSyncDeviceTakeResponse.getDeviceInspectTaskEntity(); DeviceInspectTaskEntity deviceInspectTaskEntity = spsSyncDeviceTakeResponse.getDeviceInspectTaskEntity();
deviceInspectTaskService.removeById(deviceInspectTaskEntity); deviceInspectTaskService.removeById(deviceInspectTaskEntity);
@ -133,9 +133,6 @@ public class DeviceInspectTakeController {
} }
//------------------------------------------ 详情方法--------------------------------------------------------------// //------------------------------------------ 详情方法--------------------------------------------------------------//
@GetMapping("/udiwms/inv/device/inspect/take/detail/selectDeviceInspecTakeDetail") @GetMapping("/udiwms/inv/device/inspect/take/detail/selectDeviceInspecTakeDetail")
public BaseResponse selectDeviceInspecTakeDetail(DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity) { public BaseResponse selectDeviceInspecTakeDetail(DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity) {
@ -146,9 +143,9 @@ 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();
} }
@ -156,9 +153,9 @@ public class DeviceInspectTakeController {
@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();
} }
@ -166,13 +163,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();
} }
} }

@ -13,7 +13,7 @@ import java.util.Date;
@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;
/** /**
* *

@ -12,7 +12,7 @@ import java.util.Date;
@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;
/** /**
* *

@ -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.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.glxp.api.dao.inv.DeviceInspectTaskDetailMapper; import com.glxp.api.dao.inv.DeviceInspectTaskDetailMapper;
@ -16,13 +17,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;
} }
@ -31,27 +35,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,6 +1,7 @@
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;
@ -20,19 +21,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());
if (deviceInspectTaskEntity.getId() == null) {
deviceInspectTaskEntity.setId(IdUtil.getSnowflakeNextId());
}
deviceInspectTaskMapper.insert(deviceInspectTaskEntity); deviceInspectTaskMapper.insert(deviceInspectTaskEntity);
return true; 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();

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

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

@ -132,3 +132,7 @@ CREATE TABLE IF NOT EXISTS `device_project_set`
CHARACTER SET = utf8mb4 CHARACTER SET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci COLLATE = utf8mb4_0900_ai_ci
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);

Loading…
Cancel
Save