Merge remote-tracking branch 'origin/ah-simple' into ah-simple
This commit is contained in:
commit
c657f023f6
|
|
@ -2,25 +2,27 @@ package com.bonus.material.devchange.controller;
|
||||||
|
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import com.bonus.common.biz.config.ListPagingUtil;
|
import com.bonus.common.biz.config.ListPagingUtil;
|
||||||
|
import com.bonus.common.core.web.controller.BaseController;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.common.core.web.page.TableDataInfo;
|
||||||
|
import com.bonus.material.devchange.domain.CsDeviceChangeDetailsVo;
|
||||||
|
import com.bonus.material.devchange.domain.CsDeviceChangeVo;
|
||||||
import com.bonus.material.devchange.domain.DevChangeVo;
|
import com.bonus.material.devchange.domain.DevChangeVo;
|
||||||
|
import com.bonus.material.devchange.domain.JjProjectVo;
|
||||||
import com.bonus.material.devchange.service.DevChangeService;
|
import com.bonus.material.devchange.service.DevChangeService;
|
||||||
|
|
||||||
import com.bonus.material.device.domain.vo.DevInfoVo;
|
import com.bonus.material.device.domain.vo.DevInfoVo;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/decChange")
|
@RequestMapping("/decChange")
|
||||||
@Api(value = "设备台账",tags = "设备台账")
|
@Api(value = "设备台账",tags = "设备台账")
|
||||||
public class DevChangeController {
|
public class DevChangeController extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private DevChangeService service;
|
private DevChangeService service;
|
||||||
|
|
@ -32,15 +34,62 @@ public class DevChangeController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "设备列表")
|
@ApiOperation(value = "出库设备列表")
|
||||||
@PostMapping("/list")
|
@GetMapping("/list")
|
||||||
public AjaxResult list(@RequestBody DevChangeVo devInfo) {
|
public TableDataInfo devList(DevChangeVo vo) {
|
||||||
List<DevChangeVo> list = service.selectDevInfoList(devInfo);
|
startPage();
|
||||||
Integer pageIndex = Convert.toInt(devInfo.getPageNum(), 1);
|
List<DevChangeVo> list = service.selectDevInfoList(vo);
|
||||||
Integer pageSize = Convert.toInt(devInfo.getPageSize(), 10);
|
return getDataTable(list);
|
||||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
|
}
|
||||||
|
/**
|
||||||
|
* 查询在库 的status =1
|
||||||
|
* status =0 出库
|
||||||
|
* status=4退役
|
||||||
|
*
|
||||||
|
* 5 维修
|
||||||
|
* @param vo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "查询工程下拉选集合")
|
||||||
|
@PostMapping("/getProList")
|
||||||
|
public AjaxResult list(@RequestBody JjProjectVo vo) {
|
||||||
|
List<JjProjectVo> list = service.getProList(vo);
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询工程下拉选集合")
|
||||||
|
@PostMapping("/getVoltageLevel")
|
||||||
|
public AjaxResult getVoltageLevel(@RequestBody JjProjectVo vo) {
|
||||||
|
List<JjProjectVo> list = service.getVoltageLevel(vo);
|
||||||
|
return AjaxResult.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增出库、入库、-退役、维修 ")
|
||||||
|
@PostMapping("/addChangeInfo")
|
||||||
|
public AjaxResult addChangeInfo(@RequestBody CsDeviceChangeVo vo) {
|
||||||
|
return service.addChangeInfo(vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation(value = "设备流转台账记录")
|
||||||
|
@GetMapping("/getDevChangeList")
|
||||||
|
public TableDataInfo getDevChangeList(CsDeviceChangeVo vo) {
|
||||||
|
startPage();
|
||||||
|
List<CsDeviceChangeVo> list = service.getDevChangeList(vo);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "出库记录单")
|
||||||
|
@PostMapping("/getDevDetails")
|
||||||
|
public AjaxResult getDevDetails(@RequestBody CsDeviceChangeDetailsVo vo) {
|
||||||
|
return service.getDevDetails(vo);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,49 @@
|
||||||
|
package com.bonus.material.devchange.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CsDeviceChangeDetailsVo {
|
||||||
|
|
||||||
|
private Integer pageNum;
|
||||||
|
|
||||||
|
private Integer pageSize;
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
private String devId;
|
||||||
|
/**
|
||||||
|
* 变更id
|
||||||
|
*/
|
||||||
|
private String changeId;
|
||||||
|
/**
|
||||||
|
* 使用时间
|
||||||
|
*/
|
||||||
|
private String useTime;
|
||||||
|
/**
|
||||||
|
* 退役原因
|
||||||
|
*/
|
||||||
|
private String reasonId;
|
||||||
|
/**
|
||||||
|
* 退役原因
|
||||||
|
*/
|
||||||
|
private String reasonVal;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* 维修人
|
||||||
|
*/
|
||||||
|
private String repairman;
|
||||||
|
/**
|
||||||
|
* 维修时间
|
||||||
|
*/
|
||||||
|
private String repairTime;
|
||||||
|
/**
|
||||||
|
* 维修内容
|
||||||
|
*/
|
||||||
|
private String repairContent;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,106 @@
|
||||||
|
package com.bonus.material.devchange.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CsDeviceChangeVo {
|
||||||
|
/**
|
||||||
|
* 地市权限id
|
||||||
|
*/
|
||||||
|
private String deptId;
|
||||||
|
|
||||||
|
private Integer pageNum;
|
||||||
|
|
||||||
|
private Integer pageSize;
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 变更状前状态
|
||||||
|
*/
|
||||||
|
private String changeStatus;
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
* 变更类型 1入库 2出库 3 退役 4 维修
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
/**
|
||||||
|
* 变更状态 0自用 1共享
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 工程编码
|
||||||
|
*/
|
||||||
|
private String proCode;
|
||||||
|
/**
|
||||||
|
* 工程名称
|
||||||
|
*/
|
||||||
|
private String proName;
|
||||||
|
/**
|
||||||
|
* 工程类型
|
||||||
|
*/
|
||||||
|
private String proType;
|
||||||
|
/**
|
||||||
|
* 设备数量
|
||||||
|
*/
|
||||||
|
private String devNum;
|
||||||
|
/**
|
||||||
|
* 电压等级
|
||||||
|
*/
|
||||||
|
private String voltageLevel;
|
||||||
|
/**
|
||||||
|
* 使用单位
|
||||||
|
*/
|
||||||
|
private String useUint;
|
||||||
|
/**
|
||||||
|
* 省
|
||||||
|
*/
|
||||||
|
private String proProvince;
|
||||||
|
/**
|
||||||
|
* 市
|
||||||
|
*/
|
||||||
|
private String proCity;
|
||||||
|
/**
|
||||||
|
* 区
|
||||||
|
*/
|
||||||
|
private String proCounty;
|
||||||
|
/**
|
||||||
|
* 详细地址
|
||||||
|
*/
|
||||||
|
private String proLocation;
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private String createTime;
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
private String createUser;
|
||||||
|
/**
|
||||||
|
* 使用人
|
||||||
|
*/
|
||||||
|
private String userName;
|
||||||
|
/**
|
||||||
|
* 联系方式
|
||||||
|
*/
|
||||||
|
private String userPhone;
|
||||||
|
|
||||||
|
private String jsonData;
|
||||||
|
|
||||||
|
private String devId;
|
||||||
|
/**
|
||||||
|
* 变更前单位
|
||||||
|
*/
|
||||||
|
private String changeUnit;
|
||||||
|
|
||||||
|
private String keyWord;
|
||||||
|
|
||||||
|
private String startTime;
|
||||||
|
|
||||||
|
private String endTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -87,6 +87,8 @@ public class DevChangeVo {
|
||||||
* 下次检验日期
|
* 下次检验日期
|
||||||
*/
|
*/
|
||||||
private String nextDate;
|
private String nextDate;
|
||||||
|
|
||||||
|
private String jsonData;
|
||||||
/**
|
/**
|
||||||
* 生产厂商
|
* 生产厂商
|
||||||
*/
|
*/
|
||||||
|
|
@ -103,9 +105,15 @@ public class DevChangeVo {
|
||||||
* 设备状态
|
* 设备状态
|
||||||
*/
|
*/
|
||||||
private String status;
|
private String status;
|
||||||
|
/**
|
||||||
|
* 年限
|
||||||
|
*/
|
||||||
|
private String year;
|
||||||
|
|
||||||
private List<DevInfoPropertyVo> propertyVoList;
|
private List<DevInfoPropertyVo> propertyVoList;
|
||||||
|
|
||||||
|
private String deptId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
package com.bonus.material.devchange.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class JjProjectVo {
|
||||||
|
/**
|
||||||
|
* 工程编码
|
||||||
|
*/
|
||||||
|
private String proCode;
|
||||||
|
/**
|
||||||
|
* 工程名称
|
||||||
|
*/
|
||||||
|
private String proName;
|
||||||
|
/**
|
||||||
|
* 工程类型
|
||||||
|
*/
|
||||||
|
private String proType;
|
||||||
|
/**
|
||||||
|
* 工程类型
|
||||||
|
*/
|
||||||
|
private String proTypeName;
|
||||||
|
/**
|
||||||
|
* 电压等级
|
||||||
|
*/
|
||||||
|
private String voltage;
|
||||||
|
/**
|
||||||
|
* 组织机构名称
|
||||||
|
*/
|
||||||
|
private String orgName;
|
||||||
|
/**
|
||||||
|
* 转化率
|
||||||
|
*/
|
||||||
|
private String mechanizeRate;
|
||||||
|
/**
|
||||||
|
* 省
|
||||||
|
*/
|
||||||
|
private String province;
|
||||||
|
/**
|
||||||
|
* 市
|
||||||
|
*/
|
||||||
|
private String city;
|
||||||
|
/**
|
||||||
|
* 区
|
||||||
|
*/
|
||||||
|
private String county;
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,11 @@
|
||||||
package com.bonus.material.devchange.mapper;
|
package com.bonus.material.devchange.mapper;
|
||||||
|
|
||||||
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.material.devchange.domain.CsDeviceChangeDetailsVo;
|
||||||
|
import com.bonus.material.devchange.domain.CsDeviceChangeVo;
|
||||||
import com.bonus.material.devchange.domain.DevChangeVo;
|
import com.bonus.material.devchange.domain.DevChangeVo;
|
||||||
|
import com.bonus.material.devchange.domain.JjProjectVo;
|
||||||
|
import com.bonus.material.device.domain.vo.DevInfoPropertyVo;
|
||||||
import com.bonus.material.device.domain.vo.DevInfoVo;
|
import com.bonus.material.device.domain.vo.DevInfoVo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
|
@ -18,4 +23,85 @@ public interface DevChangeMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<DevChangeVo> selectDevInfoList(DevChangeVo devInfo);
|
List<DevChangeVo> selectDevInfoList(DevChangeVo devInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设备集合
|
||||||
|
* @param vo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<DevInfoPropertyVo> getDevPropertyList(DevChangeVo vo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新数据
|
||||||
|
* @param vo
|
||||||
|
*/
|
||||||
|
void updateJson(DevChangeVo vo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工程下拉选集合
|
||||||
|
* @param vo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<JjProjectVo> getProList(JjProjectVo vo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* xinz
|
||||||
|
* @param vo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int addChangeInfo(CsDeviceChangeVo vo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增设备变更记录数据
|
||||||
|
* @param deviceChangeDetailsVo
|
||||||
|
*/
|
||||||
|
int addDetailsInfo(CsDeviceChangeDetailsVo deviceChangeDetailsVo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param vo
|
||||||
|
*/
|
||||||
|
void updateDevInfo(CsDeviceChangeVo vo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设备变更前状态
|
||||||
|
* @param devId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String getChangeStatus(String devId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询 设备变更记录
|
||||||
|
* @param vo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<CsDeviceChangeVo> getDevChangeList(CsDeviceChangeVo vo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取变更前设备
|
||||||
|
* @param devId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String getChangeUnit(String devId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询 设备单位
|
||||||
|
* @param devId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String getChangeUnitById(String devId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询出库单
|
||||||
|
* @param vo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<CsDeviceChangeDetailsVo> getDevDetails(CsDeviceChangeDetailsVo vo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压等级
|
||||||
|
* @param vo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<JjProjectVo> getVoltageLevel(JjProjectVo vo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
package com.bonus.material.devchange.service;
|
package com.bonus.material.devchange.service;
|
||||||
|
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.material.devchange.domain.CsDeviceChangeDetailsVo;
|
||||||
|
import com.bonus.material.devchange.domain.CsDeviceChangeVo;
|
||||||
import com.bonus.material.devchange.domain.DevChangeVo;
|
import com.bonus.material.devchange.domain.DevChangeVo;
|
||||||
|
import com.bonus.material.devchange.domain.JjProjectVo;
|
||||||
import com.bonus.material.device.domain.vo.DevInfoVo;
|
import com.bonus.material.device.domain.vo.DevInfoVo;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -19,4 +22,39 @@ public interface DevChangeService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<DevChangeVo> selectDevInfoList(DevChangeVo devInfo);
|
List<DevChangeVo> selectDevInfoList(DevChangeVo devInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增 数据变化
|
||||||
|
* @param vo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
AjaxResult addChangeInfo(CsDeviceChangeVo vo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工程 下拉选
|
||||||
|
* @param vo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<JjProjectVo> getProList(JjProjectVo vo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询 流转台账记录
|
||||||
|
* @param vo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<CsDeviceChangeVo> getDevChangeList(CsDeviceChangeVo vo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设备出库单
|
||||||
|
* @param vo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
AjaxResult getDevDetails(CsDeviceChangeDetailsVo vo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压等级下拉选
|
||||||
|
* @param vo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<JjProjectVo> getVoltageLevel(JjProjectVo vo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,20 @@
|
||||||
package com.bonus.material.devchange.service;
|
package com.bonus.material.devchange.service;
|
||||||
|
|
||||||
|
import com.alibaba.cloud.commons.lang.StringUtils;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
|
import com.bonus.material.common.utils.StringUtil;
|
||||||
|
import com.bonus.material.devchange.domain.CsDeviceChangeDetailsVo;
|
||||||
|
import com.bonus.material.devchange.domain.CsDeviceChangeVo;
|
||||||
import com.bonus.material.devchange.domain.DevChangeVo;
|
import com.bonus.material.devchange.domain.DevChangeVo;
|
||||||
|
import com.bonus.material.devchange.domain.JjProjectVo;
|
||||||
import com.bonus.material.devchange.mapper.DevChangeMapper;
|
import com.bonus.material.devchange.mapper.DevChangeMapper;
|
||||||
|
import com.bonus.material.device.domain.vo.DevInfoPropertyVo;
|
||||||
import com.bonus.material.device.domain.vo.DevInfoVo;
|
import com.bonus.material.device.domain.vo.DevInfoVo;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.autoconfigure.kafka.KafkaProperties;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
@ -42,8 +51,144 @@ public class DevChangeServiceImpl implements DevChangeService {
|
||||||
try{
|
try{
|
||||||
List<DevChangeVo> list=mapper.selectDevInfoList(devInfo);
|
List<DevChangeVo> list=mapper.selectDevInfoList(devInfo);
|
||||||
for (DevChangeVo vo:list){
|
for (DevChangeVo vo:list){
|
||||||
|
List<DevInfoPropertyVo> devInfoPropertyVos=mapper.getDevPropertyList(vo);
|
||||||
|
if(devInfoPropertyVos!=null && !devInfoPropertyVos.isEmpty()){
|
||||||
|
String json= JSON.toJSONString(devInfoPropertyVos);
|
||||||
|
vo.setJsonData(json);
|
||||||
|
mapper.updateJson(vo);
|
||||||
|
vo.setPropertyVoList(devInfoPropertyVos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error(e.getMessage());
|
||||||
|
}
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增设备台账数据
|
||||||
|
* @param vo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult addChangeInfo(CsDeviceChangeVo vo) {
|
||||||
|
try{
|
||||||
|
String username = SecurityUtils.getLoginUser().getUsername();
|
||||||
|
vo.setCreateUser(username);
|
||||||
|
String proCode=vo.getProCode();
|
||||||
|
if (StringUtils.isBlank(proCode)) {
|
||||||
|
return AjaxResult.error("请选择工程");
|
||||||
}
|
}
|
||||||
|
if (StringUtils.isBlank(vo.getType())) {
|
||||||
|
return AjaxResult.error("请上传类型type:1入库 2出库 3 退役 4 维修");
|
||||||
|
}
|
||||||
|
String json=vo.getJsonData();
|
||||||
|
if (StringUtils.isBlank(json)) {
|
||||||
|
return AjaxResult.error("请选择变更的设备");
|
||||||
|
}
|
||||||
|
List<CsDeviceChangeDetailsVo> list=JSON.parseArray(json, CsDeviceChangeDetailsVo.class);
|
||||||
|
if(list==null || list.isEmpty()){
|
||||||
|
return AjaxResult.error("请选择变更的设备");
|
||||||
|
}
|
||||||
|
//出库
|
||||||
|
if("2".equals(vo.getType())){
|
||||||
|
String changeUnit=mapper.getChangeUnit(list.get(0).getDevId());
|
||||||
|
vo.setChangeUnit(changeUnit);
|
||||||
|
} else {
|
||||||
|
//
|
||||||
|
String changeUnit=mapper.getChangeUnitById(list.get(0).getDevId());
|
||||||
|
vo.setChangeUnit(changeUnit);
|
||||||
|
}
|
||||||
|
if("1".equals(vo.getType())){
|
||||||
|
//入库厂家
|
||||||
|
String changeUnit=mapper.getChangeUnit(list.get(0).getDevId());
|
||||||
|
vo.setUseUint(changeUnit);
|
||||||
|
}
|
||||||
|
//变更前状态查询
|
||||||
|
String changeStatus=mapper.getChangeStatus(list.get(0).getDevId());
|
||||||
|
vo.setChangeStatus(changeStatus);
|
||||||
|
vo.setDevNum(list.size()+"");
|
||||||
|
int num=mapper.addChangeInfo(vo);
|
||||||
|
if(num>0){
|
||||||
|
for (CsDeviceChangeDetailsVo deviceChangeDetailsVo:list){
|
||||||
|
//新增设备列表数据
|
||||||
|
deviceChangeDetailsVo.setChangeId(vo.getId());
|
||||||
|
//新增设备详情
|
||||||
|
int isSuccess= mapper.addDetailsInfo(deviceChangeDetailsVo);
|
||||||
|
if(isSuccess>0){
|
||||||
|
vo.setDevId(deviceChangeDetailsVo.getDevId());
|
||||||
|
if("2".startsWith(vo.getType())){
|
||||||
|
if("0".equals(vo.getStatus())){
|
||||||
|
vo.setChangeStatus("2");
|
||||||
|
}else{
|
||||||
|
vo.setChangeStatus("3");
|
||||||
|
}
|
||||||
|
}else if("3".startsWith(vo.getType())){
|
||||||
|
vo.setChangeStatus("4");
|
||||||
|
}else if("4".startsWith(vo.getType())){
|
||||||
|
vo.setChangeStatus("5");
|
||||||
|
}
|
||||||
|
mapper.updateDevInfo(vo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error(e.getMessage());
|
||||||
|
}
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工程下拉选
|
||||||
|
* @param vo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<JjProjectVo> getProList(JjProjectVo vo) {
|
||||||
|
try{
|
||||||
|
return mapper.getProList(vo);
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error(e.getMessage());
|
||||||
|
}
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设备流转台账记录
|
||||||
|
* @param vo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<CsDeviceChangeVo> getDevChangeList(CsDeviceChangeVo vo) {
|
||||||
|
try{
|
||||||
|
return mapper.getDevChangeList(vo);
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error(e.getMessage());
|
||||||
|
}
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备出库单记录
|
||||||
|
* @param vo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult getDevDetails(CsDeviceChangeDetailsVo vo) {
|
||||||
|
try{
|
||||||
|
List<CsDeviceChangeDetailsVo> list=mapper.getDevDetails(vo);
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error(e.getMessage());
|
||||||
|
}
|
||||||
|
return AjaxResult.success(new ArrayList<>());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<JjProjectVo> getVoltageLevel(JjProjectVo vo) {
|
||||||
|
try{
|
||||||
|
return mapper.getVoltageLevel(vo);
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
log.error(e.getMessage());
|
log.error(e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,13 +6,15 @@ server:
|
||||||
spring:
|
spring:
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
|
username: nacos
|
||||||
|
password: Jjsp@nacos2023
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 127.0.0.1:18848
|
||||||
namespace: material_mall
|
namespace: material_mall
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 127.0.0.1:18848
|
||||||
namespace: material_mall
|
namespace: material_mall
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
|
|
@ -20,6 +22,7 @@ spring:
|
||||||
shared-configs:
|
shared-configs:
|
||||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
|
|
||||||
|
|
||||||
#加密组件
|
#加密组件
|
||||||
jasypt:
|
jasypt:
|
||||||
encryptor:
|
encryptor:
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,38 @@
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.bonus.material.devchange.mapper.DevChangeMapper">
|
<mapper namespace="com.bonus.material.devchange.mapper.DevChangeMapper">
|
||||||
|
<insert id="addChangeInfo" keyProperty="id" useGeneratedKeys="true">
|
||||||
|
insert into cs_device_change(
|
||||||
|
change_status,type, status, pro_code, pro_name,
|
||||||
|
pro_type, dev_num,voltage_level, use_unit, pro_province, pro_city,
|
||||||
|
pro_county,pro_location, create_time,create_user,del_flag, user_name, user_phone,change_unit
|
||||||
|
)values (#{changeStatus},#{type},#{status},#{proCode},#{proName},#{proType},#{devNum},#{voltageLevel},#{useUint}
|
||||||
|
,#{proProvince},#{proCity},#{proCounty},#{proLocation},now(),#{createUser},0,#{userName},#{userName},#{changeUnit})
|
||||||
|
</insert>
|
||||||
|
<insert id="addDetailsInfo">
|
||||||
|
insert into cs_device_change_details(
|
||||||
|
change_id, dev_id, use_time, reason_id,
|
||||||
|
reason_val, remark,
|
||||||
|
repairman,repair_time, repair_content, del_flag
|
||||||
|
)values (
|
||||||
|
#{changeId},#{devId},#{useTime},#{reasonId},#{reasonVal},#{remark},#{repairman},#{repairTime},#{repairContent},0
|
||||||
|
)
|
||||||
|
|
||||||
|
</insert>
|
||||||
|
<update id="updateJson">
|
||||||
|
update ma_dev_info set json_data=#{jsonData} where ma_id=#{devId}
|
||||||
|
</update>
|
||||||
|
<update id="updateDevInfo">
|
||||||
|
update ma_dev_info set xq_unit=#{useUint},user_info=#{userName},user_phone=#{userPhone},on_project=#{proCode},
|
||||||
|
change_status=#{changeStatus}
|
||||||
|
where ma_id=#{devId}
|
||||||
|
</update>
|
||||||
<select id="getMaxFeature" resultType="java.lang.Integer">
|
<select id="getMaxFeature" resultType="java.lang.Integer">
|
||||||
select count(1) num
|
select count(1) num
|
||||||
from ma_dev_info_properties
|
from ma_dev_info_properties
|
||||||
GROUP BY ma_id
|
GROUP BY ma_id
|
||||||
ORDER BY num desc
|
ORDER BY num desc
|
||||||
limit 1
|
limit 1
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
<select id="selectDevInfoList" resultType="com.bonus.material.devchange.domain.DevChangeVo">
|
<select id="selectDevInfoList" resultType="com.bonus.material.devchange.domain.DevChangeVo">
|
||||||
select dev.ma_id devId,dev.device_name devName,dev.code devCode,dev.json_data,DATE(dev.production_date ) productDate ,dev.buy_price buyPrice ,dev.brand ,
|
select dev.ma_id devId,dev.device_name devName,dev.code devCode,dev.json_data,DATE(dev.production_date ) productDate ,dev.buy_price buyPrice ,dev.brand ,
|
||||||
|
|
@ -19,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
mt.devModel ,bci.company_name compName,bci.operate_address orgName,IFNULL(pro.pro_name,'-') proName,
|
mt.devModel ,bci.company_name compName,bci.operate_address orgName,IFNULL(pro.pro_name,'-') proName,
|
||||||
dev.on_project proId
|
dev.on_project proId
|
||||||
FROM ma_dev_info dev
|
FROM ma_dev_info dev
|
||||||
left join bm_company_info bci on bci.company_id=dev.own_id
|
left join bm_company_info bci on bci.company_id=dev.own_co
|
||||||
left join ma_type_view mt on mt.typeId=dev.type_id
|
left join ma_type_view mt on mt.typeId=dev.type_id
|
||||||
LEFT JOIN ma_dev_qc mdq on dev.ma_id=mdq.ma_id
|
LEFT JOIN ma_dev_qc mdq on dev.ma_id=mdq.ma_id
|
||||||
left join jj_sing_project pro on pro.pro_code=dev.on_project
|
left join jj_sing_project pro on pro.pro_code=dev.on_project
|
||||||
|
|
@ -31,7 +55,89 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
and mt.typeId=#{typeId}
|
and mt.typeId=#{typeId}
|
||||||
</if>
|
</if>
|
||||||
<if test="status!=null and status!=''">
|
<if test="status!=null and status!=''">
|
||||||
AND dev.change_status=#{status}
|
<if test='status=="0"'>
|
||||||
|
and dev.change_status in(2,3)
|
||||||
|
</if>
|
||||||
|
<if test='status!="0"'>
|
||||||
|
AND dev.change_status=#{status}
|
||||||
|
</if>
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getDevPropertyList" resultType="com.bonus.material.device.domain.vo.DevInfoPropertyVo">
|
||||||
|
select property_name propertyName,property_value propertyValue
|
||||||
|
from ma_dev_info_properties
|
||||||
|
where ma_id=#{devId}
|
||||||
|
</select>
|
||||||
|
<select id="getProList" resultType="com.bonus.material.devchange.domain.JjProjectVo">
|
||||||
|
select pro_code proCode,pro_name proName,voltage,org_name orgName,mechanize_rate,
|
||||||
|
project_type proType,project_type_name proTypeName ,province,
|
||||||
|
city,county
|
||||||
|
from jj_sing_project
|
||||||
|
</select>
|
||||||
|
<select id="getChangeStatus" resultType="java.lang.String">
|
||||||
|
select change_status
|
||||||
|
from ma_dev_info
|
||||||
|
where ma_id=#{devId}
|
||||||
|
</select>
|
||||||
|
<select id="getDevChangeList" resultType="com.bonus.material.devchange.domain.CsDeviceChangeVo">
|
||||||
|
select cds.id,cds.change_status changeStatus,cds.type,cds.status,cds.pro_code proCode,cds.pro_name proName,
|
||||||
|
cds.pro_type proType,cds.dev_num devNum,cds.voltage_level voltageLevel,
|
||||||
|
cds.use_unit useUint,cds.pro_province proProvince,cds.pro_city proCity,cds.pro_county proCounty,
|
||||||
|
cds.pro_location proLocation,cds.create_time createTime,
|
||||||
|
cds.create_user createUser,cds.del_flag,cds.user_name userName,cds.user_phone userPhone,
|
||||||
|
cds.change_unit changeUnit
|
||||||
|
from cs_device_change cds
|
||||||
|
WHERE cds.del_flag=0
|
||||||
|
<if test="keyWord!=null and keyWord!=''">
|
||||||
|
and (
|
||||||
|
cds.pro_name like concat('%',#{keyWord},'%') or
|
||||||
|
cds.voltage_level like concat('%',#{keyWord},'%') or
|
||||||
|
cds.use_unit like concat('%',#{keyWord},'%') or
|
||||||
|
cds.pro_province like concat('%',#{keyWord},'%') or
|
||||||
|
cds.pro_city like concat('%',#{keyWord},'%') or
|
||||||
|
cds.pro_county like concat('%',#{keyWord},'%') or
|
||||||
|
cds.create_user like concat('%',#{keyWord},'%') or
|
||||||
|
cds.pro_location like concat('%',#{keyWord},'%') or
|
||||||
|
cds.pro_code like concat('%',#{keyWord},'%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
<if test="status!=null and status!=''">
|
||||||
|
and cds.type=#{status}
|
||||||
|
</if>
|
||||||
|
<if test="status!=null and status!=''">
|
||||||
|
and cds.create_time between #{startTime} and #{endTime}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<select id="getChangeUnit" resultType="java.lang.String">
|
||||||
|
select bci.company_name compName
|
||||||
|
FROM ma_dev_info dev
|
||||||
|
left join bm_company_info bci on bci.company_id=dev.own_co
|
||||||
|
where is_active=1 and bci.company_name is not null
|
||||||
|
and dev. ma_id=#{devId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getChangeUnitById" resultType="java.lang.String">
|
||||||
|
select xq_unit
|
||||||
|
from ma_dev_info
|
||||||
|
where ma_id=#{devId}
|
||||||
|
</select>
|
||||||
|
<select id="getDevDetails" resultType="com.bonus.material.devchange.domain.CsDeviceChangeDetailsVo">
|
||||||
|
select dev.ma_id devId,dev.device_name devName,dev.code devCode,dev.json_data,DATE(dev.production_date ) productDate ,dev.buy_price buyPrice ,dev.brand ,
|
||||||
|
mdq.next_check_time nextDate,mt.typeId, mt.unit_name unit,mt.maintenance_alarm_day ,
|
||||||
|
mt.lease_price,mt.proType,mt.level,mt.mainGx,mt.childGx,mt.devCategory ,mt.devSubcategory ,mt.devName,
|
||||||
|
mt.devModel ,bci.company_name compName,bci.operate_address orgName,IFNULL(pro.pro_name,'-') proName,
|
||||||
|
dev.on_project proId
|
||||||
|
FROM cs_device_change_details dcd
|
||||||
|
left join ma_dev_info dev on dcd.dev_id=dev.ma_id
|
||||||
|
left join bm_company_info bci on bci.company_id=dev.own_co
|
||||||
|
left join ma_type_view mt on mt.typeId=dev.type_id
|
||||||
|
LEFT JOIN ma_dev_qc mdq on dev.ma_id=mdq.ma_id
|
||||||
|
left join jj_sing_project pro on pro.pro_code=dev.on_project
|
||||||
|
where is_active=1 and dcd.change_id=#{id}
|
||||||
|
</select>
|
||||||
|
<select id="getVoltageLevel" resultType="com.bonus.material.devchange.domain.JjProjectVo">
|
||||||
|
select distinct voltage
|
||||||
|
from jj_sing_project
|
||||||
|
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue