rev:1. 保养/点检/润滑:添加保养/点检/润滑设备与人员对应关系2. 保养/点检/润滑/维修:新增单据页面,添加人员一行3.创建设备报修单时:添加故障分类标签选择4.设备报修允许点击报修单单号,查看详情信息5. 创建设备报修单时添加图片上传功能;查看跟修改时显示图片:只支持图片格式
This commit is contained in:
@@ -104,6 +104,13 @@
|
||||
<version>1.6</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 图片缩略图 -->
|
||||
<dependency>
|
||||
<groupId>net.coobird</groupId>
|
||||
<artifactId>thumbnailator</artifactId>
|
||||
<version>0.4.8</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://onew.me/logback/2018/09/17/logback_win.html-->
|
||||
<dependency>
|
||||
<groupId>org.fusesource.jansi</groupId>
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package org.nl.common.utils;
|
||||
|
||||
|
||||
import net.coobird.thumbnailator.Thumbnails;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2022/11/18 4:17 下午
|
||||
*/
|
||||
public class ImageCompress {
|
||||
|
||||
|
||||
public static Long imgCompress(File file,Long desFileSize,Double accuracy,int threshold){
|
||||
if (threshold>5){
|
||||
return file.length();
|
||||
}
|
||||
long length = file.length();
|
||||
//小于目标压缩文件大小的2倍就不压缩了
|
||||
if (length>desFileSize*1024*2){
|
||||
try {
|
||||
BufferedImage bim = ImageIO.read(file);
|
||||
int imgWidth = bim.getWidth();
|
||||
int imgHeight = bim.getHeight();
|
||||
int desWidth = new BigDecimal(imgWidth).multiply(
|
||||
new BigDecimal(accuracy)).intValue();
|
||||
int desHeight = new BigDecimal(imgHeight).multiply(
|
||||
new BigDecimal(accuracy)).intValue();
|
||||
Thumbnails.of(file.getPath()).size(desWidth, desHeight).outputQuality(accuracy).toFile(file.getPath());
|
||||
//如果不满足要求,递归直至满足要求
|
||||
imgCompress(file, desFileSize, accuracy,threshold);
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
return file.length();
|
||||
};
|
||||
public static Long imgCompress(String path,Long desFileSize,Double accuracy){
|
||||
File file;
|
||||
try {
|
||||
file = new File(path);
|
||||
String suffix = FileUtil.getExtensionName(file.getName());
|
||||
if (!"图片".equals(FileUtil.getFileType(suffix))) {
|
||||
return file.length();
|
||||
}
|
||||
}catch (Exception ex){
|
||||
throw new BadRequestException("文件不存在");
|
||||
}
|
||||
int i = 0;
|
||||
//小于目标压缩文件大小的2倍就不压缩了
|
||||
return imgCompress(file, desFileSize==null?100L:desFileSize, accuracy==null?0.8:accuracy,i);
|
||||
};
|
||||
}
|
||||
@@ -7,14 +7,22 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.masterdata_manage.service.em.EmBiLubriDeviceService;
|
||||
import org.nl.wms.masterdata_manage.service.em.dao.EmBiLubriDevice;
|
||||
import org.nl.wms.system_manage.service.user.ISysUserService;
|
||||
import org.nl.wms.system_manage.service.user.dao.SysUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 自动创建润滑单
|
||||
@@ -25,6 +33,13 @@ import java.util.Date;
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AutoCreateLubricate {
|
||||
|
||||
@Autowired
|
||||
private EmBiLubriDeviceService emBiLubriDeviceService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService iSysUserService;
|
||||
|
||||
public void run() {
|
||||
WQLObject fileTab = WQLObject.getWQLObject("EM_BI_EquipmentFile"); // 档案表
|
||||
WQLObject planMstTab = WQLObject.getWQLObject("em_bi_devicelubricateplanmst"); // 设备润滑计划主表
|
||||
@@ -171,6 +186,19 @@ public class AutoCreateLubricate {
|
||||
jsonMainMst.put("input_time", DateUtil.now());
|
||||
jsonMainMst.put("sysdeptid", deptId);
|
||||
jsonMainMst.put("syscompanyid", deptId);
|
||||
|
||||
// 判断此设备是否有对应的润滑人
|
||||
JSONObject jsonFile = WQLObject.getWQLObject("EM_BI_EquipmentFile").query("devicerecord_id = '" + json.get("devicerecord_id") + "' and is_delete = '0'").uniqueResult(0);
|
||||
|
||||
List<EmBiLubriDevice> repairDeviceDaoList = emBiLubriDeviceService.list(
|
||||
new QueryWrapper<EmBiLubriDevice>().lambda()
|
||||
.eq(EmBiLubriDevice::getDevice_code, jsonFile.getString("device_code"))
|
||||
);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(repairDeviceDaoList)) {
|
||||
SysUser userDao = iSysUserService.getById(repairDeviceDaoList.get(0).getUser_id());
|
||||
jsonMainMst.put("update_optname", userDao.getPerson_name());
|
||||
}
|
||||
mainMstTab.insert(jsonMainMst);
|
||||
|
||||
// 保养单明细表
|
||||
|
||||
@@ -7,14 +7,22 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.masterdata_manage.service.em.EmBiRepairDeviceService;
|
||||
import org.nl.wms.masterdata_manage.service.em.dao.EmBiRepairDevice;
|
||||
import org.nl.wms.system_manage.service.user.ISysUserService;
|
||||
import org.nl.wms.system_manage.service.user.dao.SysUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 自动创建维修单
|
||||
@@ -25,6 +33,13 @@ import java.util.Date;
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AutoCreateRepair {
|
||||
|
||||
@Autowired
|
||||
private EmBiRepairDeviceService emBiRepairDeviceService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService iSysUserService;
|
||||
|
||||
public void run() {
|
||||
WQLObject fileTab = WQLObject.getWQLObject("EM_BI_EquipmentFile"); // 档案表
|
||||
WQLObject planMstTab = WQLObject.getWQLObject("EM_BI_DeviceRepairPlanMst"); // 设备维修计划主表
|
||||
@@ -179,6 +194,20 @@ public class AutoCreateRepair {
|
||||
jsonRepaiMst.put("input_time", DateUtil.now());
|
||||
jsonRepaiMst.put("sysdeptid", deptId);
|
||||
jsonRepaiMst.put("syscompanyid", deptId);
|
||||
|
||||
// 判断此设备是否有对应的维修人
|
||||
JSONObject jsonFile = WQLObject.getWQLObject("EM_BI_EquipmentFile").query("devicerecord_id = '" + json.get("devicerecord_id") + "' and is_delete = '0'").uniqueResult(0);
|
||||
|
||||
List<EmBiRepairDevice> repairDeviceDaoList = emBiRepairDeviceService.list(
|
||||
new QueryWrapper<EmBiRepairDevice>().lambda()
|
||||
.eq(EmBiRepairDevice::getDevice_code, jsonFile.getString("device_code"))
|
||||
);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(repairDeviceDaoList)) {
|
||||
SysUser userDao = iSysUserService.getById(repairDeviceDaoList.get(0).getUser_id());
|
||||
jsonRepaiMst.put("update_optname", userDao.getPerson_name());
|
||||
}
|
||||
|
||||
repaiMstTab.insert(jsonRepaiMst);
|
||||
|
||||
// 维修单明细表
|
||||
|
||||
@@ -7,14 +7,22 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.masterdata_manage.service.em.EmBiSportDeviceService;
|
||||
import org.nl.wms.masterdata_manage.service.em.dao.EmBiSportDevice;
|
||||
import org.nl.wms.system_manage.service.user.ISysUserService;
|
||||
import org.nl.wms.system_manage.service.user.dao.SysUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 自动创建点检单
|
||||
@@ -25,6 +33,13 @@ import java.util.Date;
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AutoCreateSportCheck {
|
||||
|
||||
@Autowired
|
||||
private EmBiSportDeviceService emBiSportDeviceService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService iSysUserService;
|
||||
|
||||
public void run() {
|
||||
WQLObject fileTab = WQLObject.getWQLObject("EM_BI_EquipmentFile"); // 档案表
|
||||
WQLObject planMstTab = WQLObject.getWQLObject("em_bi_devicesportcheckplanmst"); // 设备点检计划主表
|
||||
@@ -169,6 +184,19 @@ public class AutoCreateSportCheck {
|
||||
jsonMainMst.put("input_time", DateUtil.now());
|
||||
jsonMainMst.put("sysdeptid", deptId);
|
||||
jsonMainMst.put("syscompanyid", deptId);
|
||||
|
||||
// 判断此设备是否有对应的点检人
|
||||
JSONObject jsonFile = WQLObject.getWQLObject("EM_BI_EquipmentFile").query("devicerecord_id = '" + json.get("devicerecord_id") + "' and is_delete = '0'").uniqueResult(0);
|
||||
|
||||
List<EmBiSportDevice> repairDeviceDaoList = emBiSportDeviceService.list(
|
||||
new QueryWrapper<EmBiSportDevice>().lambda()
|
||||
.eq(EmBiSportDevice::getDevice_code, jsonFile.getString("device_code"))
|
||||
);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(repairDeviceDaoList)) {
|
||||
SysUser userDao = iSysUserService.getById(repairDeviceDaoList.get(0).getUser_id());
|
||||
jsonMainMst.put("update_optname", userDao.getPerson_name());
|
||||
}
|
||||
mainMstTab.insert(jsonMainMst);
|
||||
|
||||
// 保养单明细表
|
||||
|
||||
@@ -7,14 +7,22 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.masterdata_manage.service.em.EmBiUpkeepDeviceService;
|
||||
import org.nl.wms.masterdata_manage.service.em.dao.EmBiUpkeepDevice;
|
||||
import org.nl.wms.system_manage.service.user.ISysUserService;
|
||||
import org.nl.wms.system_manage.service.user.dao.SysUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 自动创建保养单
|
||||
@@ -25,6 +33,13 @@ import java.util.Date;
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AutoCreateUpkeep {
|
||||
|
||||
@Autowired
|
||||
private EmBiUpkeepDeviceService emBiUpkeepDeviceService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService iSysUserService;
|
||||
|
||||
public void run() {
|
||||
WQLObject fileTab = WQLObject.getWQLObject("EM_BI_EquipmentFile"); // 档案表
|
||||
WQLObject planMstTab = WQLObject.getWQLObject("EM_BI_DeviceMaintenancePlanMst"); // 设备保养计划主表
|
||||
@@ -169,6 +184,19 @@ public class AutoCreateUpkeep {
|
||||
jsonMainMst.put("input_time", DateUtil.now());
|
||||
jsonMainMst.put("sysdeptid", deptId);
|
||||
jsonMainMst.put("syscompanyid", deptId);
|
||||
|
||||
// 判断此设备是否有对应的保养人
|
||||
JSONObject jsonFile = WQLObject.getWQLObject("EM_BI_EquipmentFile").query("devicerecord_id = '" + json.get("devicerecord_id") + "' and is_delete = '0'").uniqueResult(0);
|
||||
|
||||
List<EmBiUpkeepDevice> repairDeviceDaoList = emBiUpkeepDeviceService.list(
|
||||
new QueryWrapper<EmBiUpkeepDevice>().lambda()
|
||||
.eq(EmBiUpkeepDevice::getDevice_code, jsonFile.getString("device_code"))
|
||||
);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(repairDeviceDaoList)) {
|
||||
SysUser userDao = iSysUserService.getById(repairDeviceDaoList.get(0).getUser_id());
|
||||
jsonMainMst.put("update_optname", userDao.getPerson_name());
|
||||
}
|
||||
mainMstTab.insert(jsonMainMst);
|
||||
|
||||
// 保养单明细表
|
||||
|
||||
@@ -9,6 +9,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
@@ -20,7 +21,13 @@ import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.device_manage.lubricate.service.DevicelubricatemstService;
|
||||
import org.nl.wms.device_manage.lubricate.service.dto.DevicelubricatemstDto;
|
||||
import org.nl.wms.masterdata_manage.bfmaster.service.ClassstandardService;
|
||||
import org.nl.wms.masterdata_manage.service.em.EmBiLubriDeviceService;
|
||||
import org.nl.wms.masterdata_manage.service.em.EmBiSportDeviceService;
|
||||
import org.nl.wms.masterdata_manage.service.em.dao.EmBiLubriDevice;
|
||||
import org.nl.wms.masterdata_manage.service.em.dao.EmBiSportDevice;
|
||||
import org.nl.wms.system_manage.service.dept.ISysDeptService;
|
||||
import org.nl.wms.system_manage.service.user.ISysUserService;
|
||||
import org.nl.wms.system_manage.service.user.dao.SysUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -44,6 +51,12 @@ public class DevicelubricatemstServiceImpl implements DevicelubricatemstService
|
||||
@Autowired
|
||||
private ISysDeptService deptService;
|
||||
|
||||
@Autowired
|
||||
private EmBiLubriDeviceService emBiLubriDeviceService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService iSysUserService;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
String material_type_id = MapUtil.getStr(whereJson, "material_type_id");
|
||||
@@ -161,6 +174,24 @@ public class DevicelubricatemstServiceImpl implements DevicelubricatemstService
|
||||
jsonMst.put("input_time", now);
|
||||
jsonMst.put("sysdeptid", 1);
|
||||
jsonMst.put("syscompanyid", 1);
|
||||
jsonMst.put("update_optname", whereJson.getString("update_optname"));
|
||||
|
||||
// 判断此设备是否有对应的润滑人
|
||||
if (ObjectUtil.isEmpty(whereJson.getString("update_optname"))) {
|
||||
JSONObject jsonFile = WQLObject.getWQLObject("EM_BI_EquipmentFile").query("devicerecord_id = '" + whereJson.get("devicerecord_id") + "' and is_delete = '0'").uniqueResult(0);
|
||||
|
||||
List<EmBiLubriDevice> repairDeviceDaoList = emBiLubriDeviceService.list(
|
||||
new QueryWrapper<EmBiLubriDevice>().lambda()
|
||||
.eq(EmBiLubriDevice::getDevice_code, jsonFile.getString("device_code"))
|
||||
);
|
||||
|
||||
if (repairDeviceDaoList.size() > 1) throw new BadRequestException("此设备对应润滑人员超过2人,请检查!");
|
||||
|
||||
if (ObjectUtil.isNotEmpty(repairDeviceDaoList)){
|
||||
SysUser userDao = iSysUserService.getById(repairDeviceDaoList.get(0).getUser_id());
|
||||
jsonMst.put("update_optname", userDao.getPerson_name());
|
||||
}
|
||||
}
|
||||
mstTab.insert(jsonMst);
|
||||
|
||||
// 插入明细表
|
||||
@@ -190,6 +221,24 @@ public class DevicelubricatemstServiceImpl implements DevicelubricatemstService
|
||||
jsonMst.put("maintenancecycle", whereJson.getString("maintenancecycle"));
|
||||
jsonMst.put("plan_start_date", whereJson.getString("plan_start_date"));
|
||||
jsonMst.put("detail_count", tableData.size());
|
||||
jsonMst.put("update_optname", whereJson.getString("update_optname"));
|
||||
|
||||
// 判断此设备是否有对应的润滑人
|
||||
if (ObjectUtil.isEmpty(whereJson.getString("update_optname"))) {
|
||||
JSONObject jsonFile = WQLObject.getWQLObject("EM_BI_EquipmentFile").query("devicerecord_id = '" + whereJson.get("devicerecord_id") + "' and is_delete = '0'").uniqueResult(0);
|
||||
|
||||
List<EmBiLubriDevice> repairDeviceDaoList = emBiLubriDeviceService.list(
|
||||
new QueryWrapper<EmBiLubriDevice>().lambda()
|
||||
.eq(EmBiLubriDevice::getDevice_code, jsonFile.getString("device_code"))
|
||||
);
|
||||
|
||||
if (repairDeviceDaoList.size() > 1) throw new BadRequestException("此设备对应润滑人员超过2人,请检查!");
|
||||
|
||||
if (ObjectUtil.isNotEmpty(repairDeviceDaoList)){
|
||||
SysUser userDao = iSysUserService.getById(repairDeviceDaoList.get(0).getUser_id());
|
||||
jsonMst.put("update_optname", userDao.getPerson_name());
|
||||
}
|
||||
}
|
||||
mstTab.update(jsonMst);
|
||||
|
||||
// 插入明细表
|
||||
|
||||
@@ -197,4 +197,10 @@ public class DevicerepairmstController {
|
||||
devicerepairmstService.createExcel(whereJson,response);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ApiOperation("获取人员")
|
||||
@PostMapping("/getUser")
|
||||
public ResponseEntity<Object> getUser(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(devicerepairmstService.getUser(whereJson),HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,19 @@
|
||||
package org.nl.wms.device_manage.repair.rest;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.utils.ImageCompress;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.FileUtil;
|
||||
import org.nl.modules.tools.domain.LocalStorage;
|
||||
import org.nl.modules.tools.service.LocalStorageService;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.device_manage.repair.service.DevicerepairrequestService;
|
||||
import org.nl.wms.device_manage.repair.service.dto.DevicerepairrequestDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
@@ -14,6 +22,7 @@ import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@@ -30,6 +39,8 @@ public class DevicerepairrequestController {
|
||||
|
||||
private final DevicerepairrequestService devicerepairrequestService;
|
||||
|
||||
private final LocalStorageService localStorageService;
|
||||
|
||||
@GetMapping
|
||||
@ApiOperation("查询设备报修")
|
||||
//@PreAuthorize("@el.check('devicerepairrequest:list')")
|
||||
@@ -86,4 +97,31 @@ public class DevicerepairrequestController {
|
||||
public ResponseEntity<Object> localStorage(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(devicerepairrequestService.localStorage(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping({"/pictures/{request_id}"})
|
||||
@ApiOperation("故障图上传")
|
||||
public ResponseEntity<Object> upload(@RequestParam MultipartFile file, @PathVariable String request_id) {
|
||||
LocalStorage localStorage = this.localStorageService.create((String) null, file);
|
||||
Long compressSize = ImageCompress.imgCompress(localStorage.getPath(), 100L, 0.8);
|
||||
localStorage.setSize(FileUtil.getSize(compressSize));
|
||||
this.localStorageService.update(localStorage);
|
||||
|
||||
JSONObject mstObj = WQLObject.getWQLObject("EM_BI_DeviceRepairRequest").query("request_id = '" + request_id + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(mstObj)) throw new BadRequestException("未找到报修单!");
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
//更新存储表的来源标识
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("source_bill_id", request_id);
|
||||
param.put("source_bill_code", mstObj.getString("request_code"));
|
||||
param.put("source_bill_table", "EM_BI_DeviceRepairRequest");
|
||||
param.put("source_bill_table_pk", "request_id");
|
||||
param.put("is_delete", "0");
|
||||
param.put("create_id", currentUserId);
|
||||
param.put("create_name", SecurityUtils.getCurrentNickName());
|
||||
//本地存储【tool_local_storage】
|
||||
WQLObject storateTab = WQLObject.getWQLObject("tool_local_storage");
|
||||
//storateTab.delete("source_bill_id = '"+inspection_id+"'");
|
||||
storateTab.update(param, "storage_id = '" + localStorage.getId() + "'");
|
||||
return new ResponseEntity(localStorage, HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,4 +212,10 @@ public interface DevicerepairmstService {
|
||||
*/
|
||||
Map<String, Object> query5(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 获取人员
|
||||
* @param whereJson 、
|
||||
* @return 、
|
||||
*/
|
||||
Object getUser(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import cn.hutool.poi.excel.ExcelReader;
|
||||
import cn.hutool.poi.excel.ExcelUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
@@ -26,11 +27,15 @@ import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.EmBiIostorinvOutService;
|
||||
import org.nl.wms.device_manage.repair.service.DevicerepairmstService;
|
||||
import org.nl.wms.device_manage.repair.service.dto.DevicerepairmstDto;
|
||||
import org.nl.wms.masterdata_manage.service.em.EmBiRepairDeviceService;
|
||||
import org.nl.wms.masterdata_manage.service.em.dao.EmBiRepairDevice;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtBsrealstorattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtBsrealstorattr;
|
||||
import org.nl.wms.masterdata_manage.bfmaster.service.ClassstandardService;
|
||||
import org.nl.wms.system_manage.service.dept.ISysDeptService;
|
||||
import org.nl.wms.system_manage.service.tableData.ColumnInfoService;
|
||||
import org.nl.wms.system_manage.service.user.ISysUserService;
|
||||
import org.nl.wms.system_manage.service.user.dao.SysUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -67,6 +72,12 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
|
||||
@Autowired
|
||||
private IStIvtBsrealstorattrService storattrService; // 仓库服务
|
||||
|
||||
@Autowired
|
||||
private EmBiRepairDeviceService emBiRepairDeviceService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService iSysUserService;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
String device_code = MapUtil.getStr(whereJson, "device_code");
|
||||
@@ -187,6 +198,23 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
|
||||
jsonMst.put("input_time", DateUtil.now());
|
||||
jsonMst.put("sysdeptid", 1);
|
||||
jsonMst.put("syscompanyid", 1);
|
||||
|
||||
// 判断此设备是否有对应的维修人
|
||||
if (ObjectUtil.isEmpty(whereJson.getString("update_optname"))) {
|
||||
JSONObject jsonFile = WQLObject.getWQLObject("EM_BI_EquipmentFile").query("devicerecord_id = '" + whereJson.get("devicerecord_id") + "' and is_delete = '0'").uniqueResult(0);
|
||||
|
||||
List<EmBiRepairDevice> repairDeviceDaoList = emBiRepairDeviceService.list(
|
||||
new QueryWrapper<EmBiRepairDevice>().lambda()
|
||||
.eq(EmBiRepairDevice::getDevice_code, jsonFile.getString("device_code"))
|
||||
);
|
||||
|
||||
if (repairDeviceDaoList.size() > 1) throw new BadRequestException("此设备对应维修人员超过2人,请检查!");
|
||||
|
||||
if (ObjectUtil.isNotEmpty(repairDeviceDaoList)){
|
||||
SysUser userDao = iSysUserService.getById(repairDeviceDaoList.get(0).getUser_id());
|
||||
jsonMst.put("update_optname", userDao.getPerson_name());
|
||||
}
|
||||
}
|
||||
mstTab.insert(jsonMst);
|
||||
|
||||
// 插入明细表
|
||||
@@ -223,6 +251,23 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
|
||||
jsonMst.put("estimaterepair_times", whereJson.getString("estimaterepair_times"));
|
||||
jsonMst.put("update_optname", whereJson.getString("update_optname"));
|
||||
jsonMst.put("detail_count", tableData.size());
|
||||
|
||||
// 判断此设备是否有对应的维修人
|
||||
if (ObjectUtil.isEmpty(whereJson.getString("update_optname"))) {
|
||||
JSONObject jsonFile = WQLObject.getWQLObject("EM_BI_EquipmentFile").query("devicerecord_id = '" + whereJson.get("devicerecord_id") + "' and is_delete = '0'").uniqueResult(0);
|
||||
|
||||
List<EmBiRepairDevice> repairDeviceDaoList = emBiRepairDeviceService.list(
|
||||
new QueryWrapper<EmBiRepairDevice>().lambda()
|
||||
.eq(EmBiRepairDevice::getDevice_code, jsonFile.getString("device_code"))
|
||||
);
|
||||
|
||||
if (repairDeviceDaoList.size() > 1) throw new BadRequestException("此设备对应维修人员超过2人,请检查!");
|
||||
|
||||
if (ObjectUtil.isNotEmpty(repairDeviceDaoList)){
|
||||
SysUser userDao = iSysUserService.getById(repairDeviceDaoList.get(0).getUser_id());
|
||||
jsonMst.put("update_optname", userDao.getPerson_name());
|
||||
}
|
||||
}
|
||||
mstTab.update(jsonMst);
|
||||
|
||||
// 插入明细表
|
||||
@@ -1187,4 +1232,13 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
|
||||
JSONObject json = WQL.getWO("EM_BI_DEVICEREPAIR_01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "mst.input_time DESC");
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getUser(JSONObject whereJson) {
|
||||
List<SysUser> list = iSysUserService.list(
|
||||
new QueryWrapper<SysUser>().lambda()
|
||||
.eq(SysUser::getIs_used, "1")
|
||||
);
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
@@ -20,7 +21,11 @@ import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.device_manage.sportcheck.service.DevicesportcheckmstService;
|
||||
import org.nl.wms.device_manage.sportcheck.service.dto.DevicesportcheckmstDto;
|
||||
import org.nl.wms.masterdata_manage.bfmaster.service.ClassstandardService;
|
||||
import org.nl.wms.masterdata_manage.service.em.EmBiSportDeviceService;
|
||||
import org.nl.wms.masterdata_manage.service.em.dao.EmBiSportDevice;
|
||||
import org.nl.wms.system_manage.service.dept.ISysDeptService;
|
||||
import org.nl.wms.system_manage.service.user.ISysUserService;
|
||||
import org.nl.wms.system_manage.service.user.dao.SysUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -44,6 +49,12 @@ public class DevicesportcheckmstServiceImpl implements DevicesportcheckmstServic
|
||||
@Autowired
|
||||
private ISysDeptService deptService;
|
||||
|
||||
@Autowired
|
||||
private EmBiSportDeviceService emBiSportDeviceService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService iSysUserService;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
String material_type_id = MapUtil.getStr(whereJson, "material_type_id");
|
||||
@@ -161,6 +172,24 @@ public class DevicesportcheckmstServiceImpl implements DevicesportcheckmstServic
|
||||
jsonMst.put("input_time", now);
|
||||
jsonMst.put("sysdeptid", 1);
|
||||
jsonMst.put("syscompanyid", 1);
|
||||
jsonMst.put("update_optname", whereJson.getString("update_optname"));
|
||||
|
||||
// 判断此设备是否有对应的点检人
|
||||
if (ObjectUtil.isEmpty(whereJson.getString("update_optname"))) {
|
||||
JSONObject jsonFile = WQLObject.getWQLObject("EM_BI_EquipmentFile").query("devicerecord_id = '" + whereJson.get("devicerecord_id") + "' and is_delete = '0'").uniqueResult(0);
|
||||
|
||||
List<EmBiSportDevice> repairDeviceDaoList = emBiSportDeviceService.list(
|
||||
new QueryWrapper<EmBiSportDevice>().lambda()
|
||||
.eq(EmBiSportDevice::getDevice_code, jsonFile.getString("device_code"))
|
||||
);
|
||||
|
||||
if (repairDeviceDaoList.size() > 1) throw new BadRequestException("此设备对应点检人员超过2人,请检查!");
|
||||
|
||||
if (ObjectUtil.isNotEmpty(repairDeviceDaoList)){
|
||||
SysUser userDao = iSysUserService.getById(repairDeviceDaoList.get(0).getUser_id());
|
||||
jsonMst.put("update_optname", userDao.getPerson_name());
|
||||
}
|
||||
}
|
||||
mstTab.insert(jsonMst);
|
||||
|
||||
// 插入明细表
|
||||
@@ -190,6 +219,24 @@ public class DevicesportcheckmstServiceImpl implements DevicesportcheckmstServic
|
||||
jsonMst.put("maintenancecycle", whereJson.getString("maintenancecycle"));
|
||||
jsonMst.put("plan_start_date", whereJson.getString("plan_start_date"));
|
||||
jsonMst.put("detail_count", tableData.size());
|
||||
jsonMst.put("update_optname", whereJson.getString("update_optname"));
|
||||
|
||||
// 判断此设备是否有对应的点检人
|
||||
if (ObjectUtil.isEmpty(whereJson.getString("update_optname"))) {
|
||||
JSONObject jsonFile = WQLObject.getWQLObject("EM_BI_EquipmentFile").query("devicerecord_id = '" + whereJson.get("devicerecord_id") + "' and is_delete = '0'").uniqueResult(0);
|
||||
|
||||
List<EmBiSportDevice> repairDeviceDaoList = emBiSportDeviceService.list(
|
||||
new QueryWrapper<EmBiSportDevice>().lambda()
|
||||
.eq(EmBiSportDevice::getDevice_code, jsonFile.getString("device_code"))
|
||||
);
|
||||
|
||||
if (repairDeviceDaoList.size() > 1) throw new BadRequestException("此设备对应点检人员超过2人,请检查!");
|
||||
|
||||
if (ObjectUtil.isNotEmpty(repairDeviceDaoList)){
|
||||
SysUser userDao = iSysUserService.getById(repairDeviceDaoList.get(0).getUser_id());
|
||||
jsonMst.put("update_optname", userDao.getPerson_name());
|
||||
}
|
||||
}
|
||||
mstTab.update(jsonMst);
|
||||
|
||||
// 插入明细表
|
||||
|
||||
@@ -9,6 +9,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
@@ -20,13 +21,16 @@ import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.device_manage.upkeep.service.DevicemaintenancemstService;
|
||||
import org.nl.wms.device_manage.upkeep.service.dto.DevicemaintenancemstDto;
|
||||
import org.nl.wms.masterdata_manage.bfmaster.service.ClassstandardService;
|
||||
import org.nl.wms.masterdata_manage.service.em.EmBiUpkeepDeviceService;
|
||||
import org.nl.wms.masterdata_manage.service.em.dao.EmBiUpkeepDevice;
|
||||
import org.nl.wms.system_manage.service.dept.ISysDeptService;
|
||||
import org.nl.wms.system_manage.service.user.ISysUserService;
|
||||
import org.nl.wms.system_manage.service.user.dao.SysUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -45,6 +49,12 @@ public class DevicemaintenancemstServiceImpl implements DevicemaintenancemstServ
|
||||
@Autowired
|
||||
private ISysDeptService deptService;
|
||||
|
||||
@Autowired
|
||||
private EmBiUpkeepDeviceService emBiUpkeepDeviceService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService iSysUserService;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
String material_type_id = MapUtil.getStr(whereJson, "material_type_id");
|
||||
@@ -162,6 +172,24 @@ public class DevicemaintenancemstServiceImpl implements DevicemaintenancemstServ
|
||||
jsonMst.put("input_time", now);
|
||||
jsonMst.put("sysdeptid", 1);
|
||||
jsonMst.put("syscompanyid", 1);
|
||||
jsonMst.put("update_optname", whereJson.getString("update_optname"));
|
||||
|
||||
// 判断此设备是否有对应的保养人
|
||||
if (ObjectUtil.isEmpty(whereJson.getString("update_optname"))) {
|
||||
JSONObject jsonFile = WQLObject.getWQLObject("EM_BI_EquipmentFile").query("devicerecord_id = '" + whereJson.get("devicerecord_id") + "' and is_delete = '0'").uniqueResult(0);
|
||||
|
||||
List<EmBiUpkeepDevice> repairDeviceDaoList = emBiUpkeepDeviceService.list(
|
||||
new QueryWrapper<EmBiUpkeepDevice>().lambda()
|
||||
.eq(EmBiUpkeepDevice::getDevice_code, jsonFile.getString("device_code"))
|
||||
);
|
||||
|
||||
if (repairDeviceDaoList.size() > 1) throw new BadRequestException("此设备对应保养人员超过2人,请检查!");
|
||||
|
||||
if (ObjectUtil.isNotEmpty(repairDeviceDaoList)){
|
||||
SysUser userDao = iSysUserService.getById(repairDeviceDaoList.get(0).getUser_id());
|
||||
jsonMst.put("update_optname", userDao.getPerson_name());
|
||||
}
|
||||
}
|
||||
mstTab.insert(jsonMst);
|
||||
|
||||
// 插入明细表
|
||||
@@ -191,6 +219,24 @@ public class DevicemaintenancemstServiceImpl implements DevicemaintenancemstServ
|
||||
jsonMst.put("maintenancecycle", whereJson.getString("maintenancecycle"));
|
||||
jsonMst.put("plan_start_date", whereJson.getString("plan_start_date"));
|
||||
jsonMst.put("detail_count", tableData.size());
|
||||
jsonMst.put("update_optname", whereJson.getString("update_optname"));
|
||||
|
||||
// 判断此设备是否有对应的保养人
|
||||
if (ObjectUtil.isEmpty(whereJson.getString("update_optname"))) {
|
||||
JSONObject jsonFile = WQLObject.getWQLObject("EM_BI_EquipmentFile").query("devicerecord_id = '" + whereJson.get("devicerecord_id") + "' and is_delete = '0'").uniqueResult(0);
|
||||
|
||||
List<EmBiUpkeepDevice> repairDeviceDaoList = emBiUpkeepDeviceService.list(
|
||||
new QueryWrapper<EmBiUpkeepDevice>().lambda()
|
||||
.eq(EmBiUpkeepDevice::getDevice_code, jsonFile.getString("device_code"))
|
||||
);
|
||||
|
||||
if (repairDeviceDaoList.size() > 1) throw new BadRequestException("此设备对应保养人员超过2人,请检查!");
|
||||
|
||||
if (ObjectUtil.isNotEmpty(repairDeviceDaoList)){
|
||||
SysUser userDao = iSysUserService.getById(repairDeviceDaoList.get(0).getUser_id());
|
||||
jsonMst.put("update_optname", userDao.getPerson_name());
|
||||
}
|
||||
}
|
||||
mstTab.update(jsonMst);
|
||||
|
||||
// 插入明细表
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
|
||||
package org.nl.wms.masterdata_manage.controller.em;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import io.jsonwebtoken.lang.Assert;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.wms.device_manage.service.userdevice.dto.DeviceUserQuery;
|
||||
import org.nl.wms.masterdata_manage.service.em.EmBiLubriDeviceService;
|
||||
import org.nl.wms.masterdata_manage.service.em.dao.EmBiLubriDevice;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Liu xy
|
||||
* @date 2022-05-26
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "润滑人与设备档案维护")
|
||||
@RequestMapping("/api/embilubridevice")
|
||||
@Slf4j
|
||||
public class EmBiLubriDeviceController {
|
||||
|
||||
@Autowired
|
||||
private EmBiLubriDeviceService emBiLubriDeviceService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询人员设备维护")
|
||||
public ResponseEntity<Object> query(DeviceUserQuery query, PageQuery page){
|
||||
Page<Object> result = PageHelper.startPage(page.getPage() + 1, page.getSize());
|
||||
List<Map> list = emBiLubriDeviceService.queryAll(query);
|
||||
TableDataInfo build = TableDataInfo.build(list);
|
||||
build.setTotalElements(result.getTotal());
|
||||
return new ResponseEntity<>(build,HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/device")
|
||||
@Log("查询设备")
|
||||
//("查询设备")
|
||||
public ResponseEntity<Object> device(DeviceUserQuery query, PageQuery page){
|
||||
Page<Object> result = PageHelper.startPage(page.getPage() + 1, page.getSize());
|
||||
List<Map> list = emBiLubriDeviceService.queryAllDevice(query);
|
||||
TableDataInfo build = TableDataInfo.build(list);
|
||||
build.setTotalElements(result.getTotal());
|
||||
return new ResponseEntity<>(build,HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增人员设备维护")
|
||||
public ResponseEntity<Object> create(@RequestBody JSONObject entity){
|
||||
Assert.notNull(entity,"请求参数不能为空");
|
||||
|
||||
EmBiLubriDevice one = emBiLubriDeviceService.getOne(
|
||||
new QueryWrapper<EmBiLubriDevice>().lambda()
|
||||
.eq(EmBiLubriDevice::getUser_id, entity.getString("user_id"))
|
||||
.eq(EmBiLubriDevice::getDevice_code, entity.getString("device_code"))
|
||||
);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(one)) throw new BadRequestException("设备重复");
|
||||
|
||||
EmBiLubriDevice emBiRepairDevice = entity.toJavaObject(EmBiLubriDevice.class);
|
||||
emBiRepairDevice.setPerson_id(IdUtil.getStringId());
|
||||
emBiLubriDeviceService.save(emBiRepairDevice);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改人员设备维护")
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject entity){
|
||||
|
||||
EmBiLubriDevice one = emBiLubriDeviceService.getOne(
|
||||
new QueryWrapper<EmBiLubriDevice>().lambda()
|
||||
.eq(EmBiLubriDevice::getUser_id, entity.getString("user_id"))
|
||||
.eq(EmBiLubriDevice::getDevice_code, entity.getString("device_code"))
|
||||
);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(one)) throw new BadRequestException("设备重复");
|
||||
|
||||
EmBiLubriDevice emBiRepairDevice = emBiLubriDeviceService.getById(entity.getString("person_id"));
|
||||
emBiRepairDevice.setDevice_code(entity.getString("device_code"));
|
||||
emBiLubriDeviceService.updateById(emBiRepairDevice);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
|
||||
@Log("删除人员设备维护")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
|
||||
if (ids != null && ids.length>0){
|
||||
emBiLubriDeviceService.removeByIds(Arrays.asList(ids));
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
|
||||
package org.nl.wms.masterdata_manage.controller.em;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import io.jsonwebtoken.lang.Assert;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.wms.device_manage.service.userdevice.dto.DeviceUserQuery;
|
||||
import org.nl.wms.masterdata_manage.service.em.EmBiSportDeviceService;
|
||||
import org.nl.wms.masterdata_manage.service.em.dao.EmBiSportDevice;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Liu xy
|
||||
* @date 2022-05-26
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "点检人与设备档案维护")
|
||||
@RequestMapping("/api/embisportdevice")
|
||||
@Slf4j
|
||||
public class EmBiSportDeviceController {
|
||||
|
||||
@Autowired
|
||||
private EmBiSportDeviceService emBiSportDeviceService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询人员设备维护")
|
||||
public ResponseEntity<Object> query(DeviceUserQuery query, PageQuery page){
|
||||
Page<Object> result = PageHelper.startPage(page.getPage() + 1, page.getSize());
|
||||
List<Map> list = emBiSportDeviceService.queryAll(query);
|
||||
TableDataInfo build = TableDataInfo.build(list);
|
||||
build.setTotalElements(result.getTotal());
|
||||
return new ResponseEntity<>(build,HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/device")
|
||||
@Log("查询设备")
|
||||
//("查询设备")
|
||||
public ResponseEntity<Object> device(DeviceUserQuery query, PageQuery page){
|
||||
Page<Object> result = PageHelper.startPage(page.getPage() + 1, page.getSize());
|
||||
List<Map> list = emBiSportDeviceService.queryAllDevice(query);
|
||||
TableDataInfo build = TableDataInfo.build(list);
|
||||
build.setTotalElements(result.getTotal());
|
||||
return new ResponseEntity<>(build,HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增人员设备维护")
|
||||
public ResponseEntity<Object> create(@RequestBody JSONObject entity){
|
||||
Assert.notNull(entity,"请求参数不能为空");
|
||||
|
||||
EmBiSportDevice one = emBiSportDeviceService.getOne(
|
||||
new QueryWrapper<EmBiSportDevice>().lambda()
|
||||
.eq(EmBiSportDevice::getUser_id, entity.getString("user_id"))
|
||||
.eq(EmBiSportDevice::getDevice_code, entity.getString("device_code"))
|
||||
);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(one)) throw new BadRequestException("设备重复");
|
||||
|
||||
EmBiSportDevice emBiRepairDevice = entity.toJavaObject(EmBiSportDevice.class);
|
||||
emBiRepairDevice.setPerson_id(IdUtil.getStringId());
|
||||
emBiSportDeviceService.save(emBiRepairDevice);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改人员设备维护")
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject entity){
|
||||
|
||||
EmBiSportDevice one = emBiSportDeviceService.getOne(
|
||||
new QueryWrapper<EmBiSportDevice>().lambda()
|
||||
.eq(EmBiSportDevice::getUser_id, entity.getString("user_id"))
|
||||
.eq(EmBiSportDevice::getDevice_code, entity.getString("device_code"))
|
||||
);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(one)) throw new BadRequestException("设备重复");
|
||||
|
||||
EmBiSportDevice emBiRepairDevice = emBiSportDeviceService.getById(entity.getString("person_id"));
|
||||
emBiRepairDevice.setDevice_code(entity.getString("device_code"));
|
||||
emBiSportDeviceService.updateById(emBiRepairDevice);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
|
||||
@Log("删除人员设备维护")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
|
||||
if (ids != null && ids.length>0){
|
||||
emBiSportDeviceService.removeByIds(Arrays.asList(ids));
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
|
||||
package org.nl.wms.masterdata_manage.controller.em;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import io.jsonwebtoken.lang.Assert;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.wms.device_manage.service.userdevice.dto.DeviceUserQuery;
|
||||
import org.nl.wms.masterdata_manage.service.em.EmBiUpkeepDeviceService;
|
||||
import org.nl.wms.masterdata_manage.service.em.dao.EmBiUpkeepDevice;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Liu xy
|
||||
* @date 2022-05-26
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "保养人与设备档案维护")
|
||||
@RequestMapping("/api/embiupkeepdevice")
|
||||
@Slf4j
|
||||
public class EmBiUpkeepDeviceController {
|
||||
|
||||
@Autowired
|
||||
private EmBiUpkeepDeviceService emBiUpkeepDeviceService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询人员设备维护")
|
||||
public ResponseEntity<Object> query(DeviceUserQuery query, PageQuery page){
|
||||
Page<Object> result = PageHelper.startPage(page.getPage() + 1, page.getSize());
|
||||
List<Map> list = emBiUpkeepDeviceService.queryAll(query);
|
||||
TableDataInfo build = TableDataInfo.build(list);
|
||||
build.setTotalElements(result.getTotal());
|
||||
return new ResponseEntity<>(build,HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/device")
|
||||
@Log("查询设备")
|
||||
//("查询设备")
|
||||
public ResponseEntity<Object> device(DeviceUserQuery query, PageQuery page){
|
||||
Page<Object> result = PageHelper.startPage(page.getPage() + 1, page.getSize());
|
||||
List<Map> list = emBiUpkeepDeviceService.queryAllDevice(query);
|
||||
TableDataInfo build = TableDataInfo.build(list);
|
||||
build.setTotalElements(result.getTotal());
|
||||
return new ResponseEntity<>(build,HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增人员设备维护")
|
||||
public ResponseEntity<Object> create(@RequestBody JSONObject entity){
|
||||
Assert.notNull(entity,"请求参数不能为空");
|
||||
|
||||
EmBiUpkeepDevice one = emBiUpkeepDeviceService.getOne(
|
||||
new QueryWrapper<EmBiUpkeepDevice>().lambda()
|
||||
.eq(EmBiUpkeepDevice::getUser_id, entity.getString("user_id"))
|
||||
.eq(EmBiUpkeepDevice::getDevice_code, entity.getString("device_code"))
|
||||
);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(one)) throw new BadRequestException("设备重复");
|
||||
|
||||
EmBiUpkeepDevice emBiRepairDevice = entity.toJavaObject(EmBiUpkeepDevice.class);
|
||||
emBiRepairDevice.setPerson_id(IdUtil.getStringId());
|
||||
emBiUpkeepDeviceService.save(emBiRepairDevice);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改人员设备维护")
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject entity){
|
||||
|
||||
EmBiUpkeepDevice one = emBiUpkeepDeviceService.getOne(
|
||||
new QueryWrapper<EmBiUpkeepDevice>().lambda()
|
||||
.eq(EmBiUpkeepDevice::getUser_id, entity.getString("user_id"))
|
||||
.eq(EmBiUpkeepDevice::getDevice_code, entity.getString("device_code"))
|
||||
);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(one)) throw new BadRequestException("设备重复");
|
||||
|
||||
EmBiUpkeepDevice emBiRepairDevice = emBiUpkeepDeviceService.getById(entity.getString("person_id"));
|
||||
emBiRepairDevice.setDevice_code(entity.getString("device_code"));
|
||||
emBiUpkeepDeviceService.updateById(emBiRepairDevice);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
|
||||
@Log("删除人员设备维护")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
|
||||
if (ids != null && ids.length>0){
|
||||
emBiUpkeepDeviceService.removeByIds(Arrays.asList(ids));
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -54,6 +54,7 @@ public class DevicefaultclassServiceImpl implements DevicefaultclassService {
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
String device_faultclass_code = MapUtil.getStr(whereJson, "device_faultclass_code");
|
||||
String material_type_id = MapUtil.getStr(whereJson, "material_type_id");
|
||||
String faultclass_type_id = MapUtil.getStr(whereJson, "faultclass_type_id");
|
||||
String class_idStr = (String) whereJson.get("class_idStr");
|
||||
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
@@ -68,6 +69,14 @@ public class DevicefaultclassServiceImpl implements DevicefaultclassService {
|
||||
String classIds = classstandardService.getAllChildIdStr(class_idStr);
|
||||
map.put("classIds", classIds);
|
||||
}
|
||||
if (!StrUtil.isEmpty(faultclass_type_id)) {
|
||||
map.put("faultclass_type_id", faultclass_type_id);
|
||||
String classIds = classstandardService.getChildIdStr(faultclass_type_id);
|
||||
map.put("classIds2", classIds);
|
||||
} else if (ObjectUtil.isNotEmpty(class_idStr)) {
|
||||
String classIds = classstandardService.getAllChildIdStr(class_idStr);
|
||||
map.put("classIds2", classIds);
|
||||
}
|
||||
JSONObject json = WQL.getWO("EM_BI_DEVICEFAULTCLASS").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "mst.device_faultclass_code DESC");
|
||||
return json;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.classIds TYPEAS f_string
|
||||
输入.classIds2 TYPEAS f_string
|
||||
输入.device_faultclass_code TYPEAS s_string
|
||||
|
||||
|
||||
@@ -57,6 +58,10 @@
|
||||
class.class_id in 输入.classIds
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.classIds2 <> ""
|
||||
class2.class_id in 输入.classIds2
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.device_faultclass_code <> ""
|
||||
(mst.device_faultclass_code like 输入.device_faultclass_code or
|
||||
mst.device_faultclass_name like 输入.device_faultclass_code)
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package org.nl.wms.masterdata_manage.service.em;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.device_manage.service.userdevice.dto.DeviceUserQuery;
|
||||
import org.nl.wms.masterdata_manage.service.em.dao.EmBiLubriDevice;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 人员设备关系表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-06-06
|
||||
*/
|
||||
public interface EmBiLubriDeviceService extends IService<EmBiLubriDevice> {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param whereJson 条件
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
List<Map> queryAll(DeviceUserQuery whereJson);
|
||||
|
||||
List<Map> queryAllDevice(DeviceUserQuery whereJson);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package org.nl.wms.masterdata_manage.service.em;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.device_manage.service.userdevice.dto.DeviceUserQuery;
|
||||
import org.nl.wms.masterdata_manage.service.em.dao.EmBiSportDevice;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 人员设备关系表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-06-06
|
||||
*/
|
||||
public interface EmBiSportDeviceService extends IService<EmBiSportDevice> {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param whereJson 条件
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
List<Map> queryAll(DeviceUserQuery whereJson);
|
||||
|
||||
List<Map> queryAllDevice(DeviceUserQuery whereJson);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package org.nl.wms.masterdata_manage.service.em;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.device_manage.service.userdevice.dto.DeviceUserQuery;
|
||||
import org.nl.wms.masterdata_manage.service.em.dao.EmBiUpkeepDevice;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 人员设备关系表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-06-06
|
||||
*/
|
||||
public interface EmBiUpkeepDeviceService extends IService<EmBiUpkeepDevice> {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param whereJson 条件
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
List<Map> queryAll(DeviceUserQuery whereJson);
|
||||
|
||||
List<Map> queryAllDevice(DeviceUserQuery whereJson);
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package org.nl.wms.masterdata_manage.service.em.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 人员设备关系表
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-06-06
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("em_bi_repairpersondevicelubri")
|
||||
public class EmBiLubriDevice implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId
|
||||
private String person_id;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private String user_id;
|
||||
|
||||
/**
|
||||
* 设备编码
|
||||
*/
|
||||
private String device_code;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package org.nl.wms.masterdata_manage.service.em.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 人员设备关系表
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-06-06
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("em_bi_repairpersondevicesport")
|
||||
public class EmBiSportDevice implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId
|
||||
private String person_id;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private String user_id;
|
||||
|
||||
/**
|
||||
* 设备编码
|
||||
*/
|
||||
private String device_code;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package org.nl.wms.masterdata_manage.service.em.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 人员设备关系表
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-06-06
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("em_bi_repairpersondeviceupkeep")
|
||||
public class EmBiUpkeepDevice implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId
|
||||
private String person_id;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private String user_id;
|
||||
|
||||
/**
|
||||
* 设备编码
|
||||
*/
|
||||
private String device_code;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package org.nl.wms.masterdata_manage.service.em.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.device_manage.service.userdevice.dto.DeviceUserQuery;
|
||||
import org.nl.wms.masterdata_manage.service.em.dao.EmBiLubriDevice;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 人员设备关系表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-06-06
|
||||
*/
|
||||
public interface EmBiLubriDeviceMapper extends BaseMapper<EmBiLubriDevice> {
|
||||
|
||||
List<Map> queryAll(@Param("query") DeviceUserQuery query);
|
||||
|
||||
List<Map> queryAllDevice(@Param("query") DeviceUserQuery query);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.masterdata_manage.service.em.dao.mapper.EmBiLubriDeviceMapper">
|
||||
|
||||
<select id="queryAll" resultType="java.util.Map">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
sys_user
|
||||
<where>
|
||||
is_used = '1'
|
||||
<if test="query.username != null and query.username != ''">
|
||||
and username = #{query.username}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="queryAllDevice" resultType="java.util.Map">
|
||||
SELECT
|
||||
device.device_code,
|
||||
device.device_name,
|
||||
use1.person_name,
|
||||
mps.person_id
|
||||
FROM
|
||||
em_bi_repairpersondevicelubri mps
|
||||
LEFT JOIN em_bi_equipmentfile device ON device.device_code = mps.device_code
|
||||
LEFT JOIN sys_user use1 ON use1.user_id = mps.user_id
|
||||
<where>
|
||||
mps.user_id = #{query.user_id}
|
||||
</where>
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,24 @@
|
||||
package org.nl.wms.masterdata_manage.service.em.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.device_manage.service.userdevice.dto.DeviceUserQuery;
|
||||
import org.nl.wms.masterdata_manage.service.em.dao.EmBiSportDevice;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 人员设备关系表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-06-06
|
||||
*/
|
||||
public interface EmBiSportDeviceMapper extends BaseMapper<EmBiSportDevice> {
|
||||
|
||||
List<Map> queryAll(@Param("query") DeviceUserQuery query);
|
||||
|
||||
List<Map> queryAllDevice(@Param("query") DeviceUserQuery query);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.masterdata_manage.service.em.dao.mapper.EmBiSportDeviceMapper">
|
||||
|
||||
<select id="queryAll" resultType="java.util.Map">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
sys_user
|
||||
<where>
|
||||
is_used = '1'
|
||||
<if test="query.username != null and query.username != ''">
|
||||
and username = #{query.username}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="queryAllDevice" resultType="java.util.Map">
|
||||
SELECT
|
||||
device.device_code,
|
||||
device.device_name,
|
||||
use1.person_name,
|
||||
mps.person_id
|
||||
FROM
|
||||
em_bi_repairpersondevicesport mps
|
||||
LEFT JOIN em_bi_equipmentfile device ON device.device_code = mps.device_code
|
||||
LEFT JOIN sys_user use1 ON use1.user_id = mps.user_id
|
||||
<where>
|
||||
mps.user_id = #{query.user_id}
|
||||
</where>
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,24 @@
|
||||
package org.nl.wms.masterdata_manage.service.em.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.device_manage.service.userdevice.dto.DeviceUserQuery;
|
||||
import org.nl.wms.masterdata_manage.service.em.dao.EmBiUpkeepDevice;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 人员设备关系表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-06-06
|
||||
*/
|
||||
public interface EmBiUpkeepDeviceMapper extends BaseMapper<EmBiUpkeepDevice> {
|
||||
|
||||
List<Map> queryAll(@Param("query") DeviceUserQuery query);
|
||||
|
||||
List<Map> queryAllDevice(@Param("query") DeviceUserQuery query);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.masterdata_manage.service.em.dao.mapper.EmBiUpkeepDeviceMapper">
|
||||
|
||||
<select id="queryAll" resultType="java.util.Map">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
sys_user
|
||||
<where>
|
||||
is_used = '1'
|
||||
<if test="query.username != null and query.username != ''">
|
||||
and username = #{query.username}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="queryAllDevice" resultType="java.util.Map">
|
||||
SELECT
|
||||
device.device_code,
|
||||
device.device_name,
|
||||
use1.person_name,
|
||||
mps.person_id
|
||||
FROM
|
||||
em_bi_repairpersondeviceupkeep mps
|
||||
LEFT JOIN em_bi_equipmentfile device ON device.device_code = mps.device_code
|
||||
LEFT JOIN sys_user use1 ON use1.user_id = mps.user_id
|
||||
<where>
|
||||
mps.user_id = #{query.user_id}
|
||||
</where>
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,33 @@
|
||||
package org.nl.wms.masterdata_manage.service.em.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.wms.device_manage.service.userdevice.dto.DeviceUserQuery;
|
||||
import org.nl.wms.masterdata_manage.service.em.EmBiLubriDeviceService;
|
||||
import org.nl.wms.masterdata_manage.service.em.dao.EmBiLubriDevice;
|
||||
import org.nl.wms.masterdata_manage.service.em.dao.mapper.EmBiLubriDeviceMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 人员设备关系表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-06-06
|
||||
*/
|
||||
@Service
|
||||
public class EmBiLubriDeviceServiceImpl extends ServiceImpl<EmBiLubriDeviceMapper, EmBiLubriDevice> implements EmBiLubriDeviceService {
|
||||
|
||||
@Override
|
||||
public List<Map> queryAll(DeviceUserQuery query) {
|
||||
return this.baseMapper.queryAll(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map> queryAllDevice(DeviceUserQuery query) {
|
||||
return this.baseMapper.queryAllDevice(query);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package org.nl.wms.masterdata_manage.service.em.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.wms.device_manage.service.userdevice.dto.DeviceUserQuery;
|
||||
import org.nl.wms.masterdata_manage.service.em.EmBiSportDeviceService;
|
||||
import org.nl.wms.masterdata_manage.service.em.dao.EmBiSportDevice;
|
||||
import org.nl.wms.masterdata_manage.service.em.dao.mapper.EmBiSportDeviceMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 人员设备关系表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-06-06
|
||||
*/
|
||||
@Service
|
||||
public class EmBiSportDeviceServiceImpl extends ServiceImpl<EmBiSportDeviceMapper, EmBiSportDevice> implements EmBiSportDeviceService {
|
||||
|
||||
@Override
|
||||
public List<Map> queryAll(DeviceUserQuery query) {
|
||||
return this.baseMapper.queryAll(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map> queryAllDevice(DeviceUserQuery query) {
|
||||
return this.baseMapper.queryAllDevice(query);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package org.nl.wms.masterdata_manage.service.em.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.wms.device_manage.service.userdevice.dto.DeviceUserQuery;
|
||||
import org.nl.wms.masterdata_manage.service.em.EmBiUpkeepDeviceService;
|
||||
import org.nl.wms.masterdata_manage.service.em.dao.EmBiUpkeepDevice;
|
||||
import org.nl.wms.masterdata_manage.service.em.dao.mapper.EmBiUpkeepDeviceMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 人员设备关系表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-06-06
|
||||
*/
|
||||
@Service
|
||||
public class EmBiUpKeepDeviceServiceImpl extends ServiceImpl<EmBiUpkeepDeviceMapper, EmBiUpkeepDevice> implements EmBiUpkeepDeviceService {
|
||||
|
||||
@Override
|
||||
public List<Map> queryAll(DeviceUserQuery query) {
|
||||
return this.baseMapper.queryAll(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map> queryAllDevice(DeviceUserQuery query) {
|
||||
return this.baseMapper.queryAllDevice(query);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user