Merge remote-tracking branch 'origin/ah-simple' into ah-simple
This commit is contained in:
commit
967522cec5
|
|
@ -22,6 +22,8 @@
|
|||
<groupId>com.ahsbd</groupId>
|
||||
<artifactId>sms-util</artifactId>
|
||||
<version>1.0</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/lib/sms-util-1.0.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Openfeign -->
|
||||
|
|
|
|||
|
|
@ -0,0 +1,46 @@
|
|||
package com.bonus.material.devchange.controller;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.bonus.common.biz.config.ListPagingUtil;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.devchange.domain.DevChangeVo;
|
||||
import com.bonus.material.devchange.service.DevChangeService;
|
||||
import com.bonus.material.device.domain.vo.DevInfoVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
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;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/decChange")
|
||||
@Api(value = "设备台账",tags = "设备台账")
|
||||
public class DevChangeController {
|
||||
|
||||
@Autowired
|
||||
private DevChangeService service;
|
||||
|
||||
@ApiOperation(value = "查询系统最大的特征值")
|
||||
@PostMapping("/getMaxFeature")
|
||||
public AjaxResult getMaxFeature() {
|
||||
return service.getMaxFeature();
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "设备列表")
|
||||
@PostMapping("/list")
|
||||
public AjaxResult list(@RequestBody DevChangeVo devInfo) {
|
||||
List<DevChangeVo> list = service.selectDevInfoList(devInfo);
|
||||
Integer pageIndex = Convert.toInt(devInfo.getPageNum(), 1);
|
||||
Integer pageSize = Convert.toInt(devInfo.getPageSize(), 10);
|
||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
package com.bonus.material.devchange.domain;
|
||||
|
||||
import com.bonus.material.device.domain.vo.DevInfoPropertyVo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class DevChangeVo {
|
||||
|
||||
private Integer pageNum;
|
||||
|
||||
private Integer pageSize;
|
||||
|
||||
private String typeId;
|
||||
/**
|
||||
* 公司名称
|
||||
*/
|
||||
private String compName;
|
||||
/**
|
||||
* 工程类型
|
||||
*/
|
||||
private String proType;
|
||||
/**
|
||||
* 主工序名称
|
||||
*/
|
||||
private String mainGx;
|
||||
/**
|
||||
* 子工序名称
|
||||
*/
|
||||
private String childGx;
|
||||
|
||||
/**
|
||||
* 装备大类
|
||||
*/
|
||||
private String devCategory;
|
||||
|
||||
/**
|
||||
* 装备小类
|
||||
*/
|
||||
private String devSubcategory;
|
||||
/**
|
||||
* 设备型号
|
||||
*/
|
||||
private String devModel;
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String devName;
|
||||
/**
|
||||
* 等级
|
||||
*/
|
||||
private String level;
|
||||
/**
|
||||
* 工程编码
|
||||
*/
|
||||
private String proId;
|
||||
/**
|
||||
* 工程名称
|
||||
*/
|
||||
private String proName;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
/**
|
||||
* 设备编码
|
||||
*/
|
||||
private String devCode;
|
||||
/**
|
||||
* 产权单位
|
||||
*/
|
||||
private String unitName;
|
||||
/**
|
||||
* 组织机构
|
||||
*/
|
||||
private String orgName;
|
||||
/**
|
||||
* 采购日期
|
||||
*/
|
||||
private String purchaseDate;
|
||||
/**
|
||||
* 出厂日期
|
||||
*/
|
||||
private String productDate;
|
||||
/**
|
||||
* 下次检验日期
|
||||
*/
|
||||
private String nextDate;
|
||||
/**
|
||||
* 生产厂商
|
||||
*/
|
||||
private String brand;
|
||||
/**
|
||||
* 设备id
|
||||
*/
|
||||
private String devId;
|
||||
/**
|
||||
* 采购原值
|
||||
*/
|
||||
private String buyPrice;
|
||||
/**
|
||||
* 设备状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
private List<DevInfoPropertyVo> propertyVoList;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.bonus.material.devchange.mapper;
|
||||
|
||||
import com.bonus.material.devchange.domain.DevChangeVo;
|
||||
import com.bonus.material.device.domain.vo.DevInfoVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface DevChangeMapper {
|
||||
|
||||
|
||||
Integer getMaxFeature();
|
||||
|
||||
/**
|
||||
* 查询设备列表集合
|
||||
* @param devInfo
|
||||
* @return
|
||||
*/
|
||||
List<DevChangeVo> selectDevInfoList(DevChangeVo devInfo);
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.bonus.material.devchange.service;
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.devchange.domain.DevChangeVo;
|
||||
import com.bonus.material.device.domain.vo.DevInfoVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface DevChangeService {
|
||||
/**
|
||||
* 查询系统最大的特征值
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getMaxFeature();
|
||||
|
||||
/**
|
||||
* 查询数据列表集合
|
||||
* @param devInfo
|
||||
* @return
|
||||
*/
|
||||
List<DevChangeVo> selectDevInfoList(DevChangeVo devInfo);
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
package com.bonus.material.devchange.service;
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.devchange.domain.DevChangeVo;
|
||||
import com.bonus.material.devchange.mapper.DevChangeMapper;
|
||||
import com.bonus.material.device.domain.vo.DevInfoVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class DevChangeServiceImpl implements DevChangeService {
|
||||
|
||||
@Autowired
|
||||
private DevChangeMapper mapper;
|
||||
|
||||
/**
|
||||
* 查询设备 最大的数据
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult getMaxFeature() {
|
||||
try{
|
||||
Integer num=mapper.getMaxFeature();
|
||||
if(num==null ||num ==0){
|
||||
return AjaxResult.success(8);
|
||||
}else {
|
||||
return AjaxResult.success(num);
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
return AjaxResult.success(8);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DevChangeVo> selectDevInfoList(DevChangeVo devInfo) {
|
||||
try{
|
||||
List<DevChangeVo> list=mapper.selectDevInfoList(devInfo);
|
||||
for (DevChangeVo vo:list){
|
||||
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<?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="com.bonus.material.devchange.mapper.DevChangeMapper">
|
||||
|
||||
<select id="getMaxFeature" resultType="java.lang.Integer">
|
||||
select count(1) num
|
||||
from ma_dev_info_properties
|
||||
GROUP BY ma_id
|
||||
ORDER BY num desc
|
||||
limit 1
|
||||
|
||||
</select>
|
||||
<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 ,
|
||||
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 ma_dev_info dev
|
||||
left join bm_company_info bci on bci.company_id=dev.own_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 jj_sing_project pro on pro.pro_code=dev.on_project
|
||||
where is_active=1
|
||||
<if test="devName!=null and devName!=''">
|
||||
and dev.device_name like concat('%',#{devName},'%')
|
||||
</if>
|
||||
<if test="typeId!=null and typeId!=''">
|
||||
and mt.typeId=#{typeId}
|
||||
</if>
|
||||
<if test="status!=null and status!=''">
|
||||
AND dev.change_status=#{status}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue