1.调整科室设备明细,设备巡检设置接口

master
x_z 2 years ago
parent cf1ad41f30
commit fd9aae06ce

@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.entity.inv.DeptDeviceDetailEntity; import com.glxp.api.entity.inv.DeptDeviceDetailEntity;
import com.glxp.api.req.inv.FilterDeptDeviceRequest; import com.glxp.api.req.inv.FilterDeptDeviceRequest;
import com.glxp.api.res.inv.DeptDeviceDetailResponse; import com.glxp.api.res.inv.DeptDeviceDetailResponse;
import com.glxp.api.res.inv.DeviceInspectSetResponse;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@ -21,8 +23,17 @@ public interface DeptDeviceDetailDao extends BaseMapper<DeptDeviceDetailEntity>
/** /**
* *
*
* @param filterDeptDeviceRequest * @param filterDeptDeviceRequest
* @return * @return
*/ */
List<DeptDeviceDetailResponse> filterList(FilterDeptDeviceRequest filterDeptDeviceRequest); List<DeptDeviceDetailResponse> filterList(FilterDeptDeviceRequest filterDeptDeviceRequest);
/**
*
*
* @param code
* @return
*/
DeviceInspectSetResponse selectInspectSet(@Param("code") String code);
} }

@ -2,9 +2,153 @@ package com.glxp.api.res.inv;
import lombok.Data; import lombok.Data;
import java.util.Date;
/** /**
* VO * VO
*/ */
@Data @Data
public class DeptDeviceDetailResponse { public class DeptDeviceDetailResponse {
private Integer id;
/**
*
*/
private String deptCode;
/**
*
*/
private String invCode;
/**
*
*/
private String originCode;
/**
*
*/
private String code;
/**
*
*/
private String relId;
/**
*
*/
private String deviceName;
/**
*
*/
private String ggxh;
/**
*
*/
private String batchNo;
/**
*
*/
private String serialNo;
/**
*
*/
private String productionDate;
/**
*
*/
private String expireDate;
/**
*
*/
private String manufactory;
/**
*
*/
private String measname;
/**
* /
*/
private String zczbhhzbapzbh;
/**
* ID
*/
private String supId;
/**
*
*/
private String supName;
/**
* 12345
*/
private Integer status;
/**
* 12
*/
private Integer addType;
/**
*
*/
private String createUser;
/**
*
*/
private String manager;
/**
*
*/
private Date maTime;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
/**
*
*/
private String remark;
/**
*
*/
private String createUserName;
/**
*
*/
private String managerName;
/**
*
*/
private String deptName;
/**
*
*/
private String invName;
} }

@ -8,6 +8,8 @@ import lombok.Data;
@Data @Data
public class DeviceInspectSetResponse { public class DeviceInspectSetResponse {
private Integer id;
/** /**
* *
*/ */

@ -65,7 +65,7 @@ public class DeptDeviceDetailServiceImpl implements DeptDeviceDetailService {
if (count == 0) { if (count == 0) {
DeptDeviceDetailEntity deviceDetail = new DeptDeviceDetailEntity(); DeptDeviceDetailEntity deviceDetail = new DeptDeviceDetailEntity();
deviceDetail.setDeptCode(receiveOrderEntity.getFromDeptCode()); deviceDetail.setDeptCode(receiveOrderEntity.getFromDeptCode());
deviceDetail.setInvCode(receiveOrderEntity.getInvCode()); deviceDetail.setInvCode(receiveOrderEntity.getFromInvCode());
deviceDetail.setOriginCode(receiveOrderDetailResponse.getCode()); deviceDetail.setOriginCode(receiveOrderDetailResponse.getCode());
deviceDetail.setCode(idUtil.getDeptDeviceCode()); //生成资产编号 deviceDetail.setCode(idUtil.getDeptDeviceCode()); //生成资产编号
deviceDetail.setRelId(receiveOrderDetailResponse.getRelId()); deviceDetail.setRelId(receiveOrderDetailResponse.getRelId());
@ -116,6 +116,7 @@ public class DeptDeviceDetailServiceImpl implements DeptDeviceDetailService {
DeptDeviceDetailEntity deptDeviceDetail = new DeptDeviceDetailEntity(); DeptDeviceDetailEntity deptDeviceDetail = new DeptDeviceDetailEntity();
BeanUtil.copyProperties(addDeptDeviceRequest, deptDeviceDetail); BeanUtil.copyProperties(addDeptDeviceRequest, deptDeviceDetail);
deptDeviceDetail.setCode(idUtil.getDeptDeviceCode()); //资产编码 deptDeviceDetail.setCode(idUtil.getDeptDeviceCode()); //资产编码
deptDeviceDetail.setStatus(1);
deptDeviceDetail.setCreateUser(customerService.getUserIdStr()); deptDeviceDetail.setCreateUser(customerService.getUserIdStr());
deptDeviceDetail.setCreateTime(new Date()); deptDeviceDetail.setCreateTime(new Date());
deptDeviceDetail.setUpdateTime(new Date()); deptDeviceDetail.setUpdateTime(new Date());

@ -34,13 +34,19 @@ public class DeviceInspectSetServiceImpl implements DeviceInspectSetService {
if (StrUtil.isBlank(code)) { if (StrUtil.isBlank(code)) {
return null; return null;
} }
return deviceInspectSetDao.selectInspectSet(code);
DeviceInspectSetResponse deviceInspectSetResponse = deviceInspectSetDao.selectInspectSet(code);
if (null == deviceInspectSetResponse) {
//此设备未配置巡检设置,查询此设备的信息
deviceInspectSetResponse = deptDeviceDetailDao.selectInspectSet(code);
}
return deviceInspectSetResponse;
} }
@Override @Override
public BaseResponse updateInspectSet(DeviceInspectSetEntity deviceInspectSetEntity) { public BaseResponse updateInspectSet(DeviceInspectSetEntity deviceInspectSetEntity) {
DeviceInspectSetEntity inspectSetEntity = deviceInspectSetDao.selectById(deviceInspectSetEntity.getId()); DeviceInspectSetEntity inspectSetEntity = deviceInspectSetDao.selectById(deviceInspectSetEntity.getId());
BeanUtil.copyProperties(deviceInspectSetEntity, inspectSetEntity, "id","createUser", "createTime"); BeanUtil.copyProperties(deviceInspectSetEntity, inspectSetEntity, "id", "createUser", "createTime");
inspectSetEntity.setUpdateTime(new Date()); inspectSetEntity.setUpdateTime(new Date());
deviceInspectSetDao.updateById(inspectSetEntity); deviceInspectSetDao.updateById(inspectSetEntity);
return ResultVOUtils.success(); return ResultVOUtils.success();
@ -57,7 +63,7 @@ public class DeviceInspectSetServiceImpl implements DeviceInspectSetService {
} }
DeviceInspectSetEntity deviceInspectSetEntity = new DeviceInspectSetEntity(); DeviceInspectSetEntity deviceInspectSetEntity = new DeviceInspectSetEntity();
BeanUtil.copyProperties(addDeviceInspectSetRequest, deviceInspectSetEntity); BeanUtil.copyProperties(addDeviceInspectSetRequest, deviceInspectSetEntity, "id");
deviceInspectSetEntity.setStatus(1); deviceInspectSetEntity.setStatus(1);
deviceInspectSetEntity.setCreateTime(new Date()); deviceInspectSetEntity.setCreateTime(new Date());
deviceInspectSetEntity.setUpdateTime(new Date()); deviceInspectSetEntity.setUpdateTime(new Date());

@ -23,10 +23,10 @@ public class IdUtil {
* @return * @return
*/ */
public String getDeptDeviceCode() { public String getDeptDeviceCode() {
long code = redisUtil.incr(Constant.DEPT_CACHE_CODE, 1); Long code = redisUtil.incr(Constant.DEPT_CACHE_CODE, 1);
if (code == 1) { if (code == 1) {
//redis中的key不存在重新缓存当前最大的key进去 //redis中的key不存在重新缓存当前最大的key进去
redisUtil.set(Constant.DEPT_CACHE_CODE, deptDeviceDetailDao.selectMaxCode()); redisUtil.set(Constant.DEPT_CACHE_CODE, Long.valueOf(deptDeviceDetailDao.selectMaxCode()));
//重新获取最新的编码 //重新获取最新的编码
code = redisUtil.incr(Constant.DEPT_CACHE_CODE, 1); code = redisUtil.incr(Constant.DEPT_CACHE_CODE, 1);
} }

@ -362,6 +362,9 @@
<if test="advanceType != null"> <if test="advanceType != null">
AND auth_warehouse.advanceType = #{advanceType} AND auth_warehouse.advanceType = #{advanceType}
</if> </if>
<if test="deptCode != null and deptCode != ''">
AND auth_warehouse.parentId = #{deptCode}
</if>
</where> </where>
</select> </select>

@ -29,7 +29,9 @@
t.maTime, t.maTime,
t.remark, t.remark,
(select employeeName from auth_user where id = t.createUser) creatUserName, (select employeeName from auth_user where id = t.createUser) creatUserName,
(select employeeName from auth_user where id = t.manager) managerName (select employeeName from auth_user where id = t.manager) managerName,
(select `name` from auth_dept where code = t.deptCode) deptName,
(select `name` from auth_warehouse where code = t.invCode) invName
from dept_device_detail t from dept_device_detail t
<where> <where>
<if test="deptCode != null and deptCode != ''"> <if test="deptCode != null and deptCode != ''">
@ -62,4 +64,13 @@
</where> </where>
order by t.updateTime desc order by t.updateTime desc
</select> </select>
<select id="selectInspectSet" resultType="com.glxp.api.res.inv.DeviceInspectSetResponse">
select (select `name` from auth_dept where code = t.deptCode) deptName,
(select `name` from auth_warehouse where code = t.invCode) invName,
t.deviceName,
t.code
from dept_device_detail t
where t.code = #{code}
</select>
</mapper> </mapper>

@ -2,7 +2,8 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glxp.api.dao.inv.DeviceInspectSetDao"> <mapper namespace="com.glxp.api.dao.inv.DeviceInspectSetDao">
<select id="selectInspectSet" resultType="com.glxp.api.res.inv.DeviceInspectSetResponse"> <select id="selectInspectSet" resultType="com.glxp.api.res.inv.DeviceInspectSetResponse">
select t.code, select t.id,
t.code,
t.frequency, t.frequency,
t.frequency, t.frequency,
t.frequencyUnit, t.frequencyUnit,

Loading…
Cancel
Save