检修预警
This commit is contained in:
parent
45aa0ad6e8
commit
920e3465d4
|
|
@ -42,6 +42,12 @@ public class SelectController {
|
|||
return service.getMaTypeData(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "分部工程下拉选")
|
||||
@PostMapping("getBranchProject")
|
||||
public AjaxResult getBranchProject(){
|
||||
return service.getBranchProject();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "标准配置下拉选")
|
||||
@PostMapping("getConfigList")
|
||||
public AjaxResult getConfigList(@RequestBody BmUnit bmUnit) {
|
||||
|
|
|
|||
|
|
@ -172,4 +172,10 @@ public interface SelectMapper {
|
|||
* @return
|
||||
*/
|
||||
List<ProjectTreeNode> getConfigList(BmUnit bmUnit);
|
||||
|
||||
/**
|
||||
* 获取分部工程下拉选
|
||||
* @return
|
||||
*/
|
||||
List<SelectVo> getBranchProject();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -206,4 +206,10 @@ public interface SelectService {
|
|||
* @return
|
||||
*/
|
||||
AjaxResult getConfigList(BmUnit bmUnit);
|
||||
|
||||
/**
|
||||
* 分部工程下拉选
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getBranchProject();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,6 +114,18 @@ public class SelectServiceImpl implements SelectService {
|
|||
return AjaxResult.success(groupList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getBranchProject() {
|
||||
List<SelectVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getBranchProject();
|
||||
return AjaxResult.success(list);
|
||||
} catch (Exception e) {
|
||||
log.error("机具类型-查询失败", e);
|
||||
return AjaxResult.success(new ArrayList<>());
|
||||
}
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public AjaxResult getDictByPidCbx(SelectDto dto) {
|
||||
// List<SelectVo> list = new ArrayList<>();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,59 @@
|
|||
package com.bonus.material.warningAnalysis.controller;
|
||||
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||
import com.bonus.material.warningAnalysis.domain.UseMaintenanceWarningBean;
|
||||
import com.bonus.material.warningAnalysis.service.UseMaintenanceWarningService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 工程在用检修预警
|
||||
* @author hay
|
||||
* @date 2025/3/6 15:32
|
||||
*/
|
||||
@Api(tags = "工程在用检修预警接口")
|
||||
@RestController
|
||||
@RequestMapping("/useMaintenanceWarning")
|
||||
public class UseMaintenanceWarningController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private UseMaintenanceWarningService service;
|
||||
|
||||
/**
|
||||
* 查询工程在用检修预警
|
||||
*/
|
||||
@ApiOperation(value = "查询检修预警列表")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(UseMaintenanceWarningBean bean)
|
||||
{
|
||||
startPage();
|
||||
List<UseMaintenanceWarningBean> list = service.getList(bean);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出
|
||||
*/
|
||||
@ApiOperation(value = "导出检修预警列表")
|
||||
@PreventRepeatSubmit
|
||||
@SysLog(title = "检修预警", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出检修预警列表")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, UseMaintenanceWarningBean bean)
|
||||
{
|
||||
List<UseMaintenanceWarningBean> list = service.getList(bean);
|
||||
ExcelUtil<UseMaintenanceWarningBean> util = new ExcelUtil<UseMaintenanceWarningBean>(UseMaintenanceWarningBean.class);
|
||||
util.exportExcel(response, list, "检修预警数据");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
package com.bonus.material.warningAnalysis.domain;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 协议管理对象 bm_agreement_info
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2024-09-26
|
||||
*/
|
||||
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
public class UseMaintenanceWarningBean extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 下次检验日期
|
||||
*/
|
||||
@ApiModelProperty(value = "下次检验日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "下次检验日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date nextCheckTime;
|
||||
|
||||
/**
|
||||
* 类型名称
|
||||
*/
|
||||
@ApiModelProperty(value = "机具类型")
|
||||
@Excel(name = "机具类型")
|
||||
private String typeName;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
@ApiModelProperty(value = "规格型号")
|
||||
@Excel(name = "规格型号")
|
||||
private String typeModelName;
|
||||
|
||||
@ApiModelProperty(value = "设备编码")
|
||||
@Excel(name = "设备编码")
|
||||
private String maCode;
|
||||
|
||||
/**
|
||||
* 往来单位
|
||||
*/
|
||||
@ApiModelProperty(value = "单位名称")
|
||||
@Excel(name = "单位名称")
|
||||
private String unitName;
|
||||
|
||||
/**
|
||||
* 工程标段名称
|
||||
*/
|
||||
@ApiModelProperty(value = "工程名称")
|
||||
@Excel(name = "工程名称")
|
||||
private String projectName;
|
||||
|
||||
/**
|
||||
* 协议ID
|
||||
*/
|
||||
private Long agreementId;
|
||||
|
||||
@ApiModelProperty(value = "协议号")
|
||||
@Excel(name = "协议号")
|
||||
private String agreementCode;
|
||||
|
||||
/**
|
||||
* 往来单位id
|
||||
*/
|
||||
@ApiModelProperty(value = "往来单位ID")
|
||||
private Long unitId;
|
||||
|
||||
/**
|
||||
* 工程标段ID
|
||||
*/
|
||||
@ApiModelProperty(value = "工程标段ID")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 超期天数
|
||||
*/
|
||||
@ApiModelProperty(value = "超期时长(天)")
|
||||
@Excel(name = "超期时长(天)")
|
||||
private Long overDays;
|
||||
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
private String startTime;
|
||||
|
||||
@ApiModelProperty(value = "结束时间")
|
||||
private String endTime;
|
||||
|
||||
@ApiModelProperty(value = "关键字")
|
||||
private String keyWord;
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.bonus.material.warningAnalysis.mapper;
|
||||
|
||||
import com.bonus.material.warningAnalysis.domain.UseMaintenanceWarningBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 工程在用检修预警
|
||||
* @author hay
|
||||
* @date 2025/3/6 15:32
|
||||
*/
|
||||
public interface UseMaintenanceWarningMapper
|
||||
{
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
public List<UseMaintenanceWarningBean> getList(UseMaintenanceWarningBean bean);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.bonus.material.warningAnalysis.service;
|
||||
|
||||
import com.bonus.material.warningAnalysis.domain.UseMaintenanceWarningBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 工程在用检修预警
|
||||
* @author hay
|
||||
* @date 2025/3/6 15:32
|
||||
*/
|
||||
public interface UseMaintenanceWarningService
|
||||
{
|
||||
|
||||
/**
|
||||
* 查询工程在用检修预警列表
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
public List<UseMaintenanceWarningBean> getList(UseMaintenanceWarningBean bean);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package com.bonus.material.warningAnalysis.service.impl;
|
||||
|
||||
import com.bonus.material.warningAnalysis.domain.UseMaintenanceWarningBean;
|
||||
import com.bonus.material.warningAnalysis.mapper.UseMaintenanceWarningMapper;
|
||||
import com.bonus.material.warningAnalysis.service.UseMaintenanceWarningService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @description 工程在用检修预警
|
||||
* @author hay
|
||||
* @date 2025/3/6 15:32
|
||||
*/
|
||||
@Service
|
||||
public class UseMaintenanceWarningServiceImpl implements UseMaintenanceWarningService
|
||||
{
|
||||
|
||||
@Resource
|
||||
private UseMaintenanceWarningMapper mapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<UseMaintenanceWarningBean> getList(UseMaintenanceWarningBean bean) {
|
||||
try {
|
||||
List<UseMaintenanceWarningBean> list = mapper.getList(bean);
|
||||
return list;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -397,4 +397,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
FROM bm_standard_config
|
||||
WHERE del_flag = 0
|
||||
</select>
|
||||
<select id="getBranchProject" resultType="com.bonus.material.common.domain.vo.SelectVo">
|
||||
SELECT dict_code as id,
|
||||
dict_label as `name`
|
||||
FROM sys_dict_data
|
||||
WHERE dict_type = 'branch_project'
|
||||
and `status` = 0
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,48 @@
|
|||
<?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.warningAnalysis.mapper.UseMaintenanceWarningMapper">
|
||||
|
||||
<select id="getList" resultType="com.bonus.material.warningAnalysis.domain.UseMaintenanceWarningBean">
|
||||
SELECT
|
||||
mm.ma_id as maId,
|
||||
mm.next_check_time as nextCheckTime,
|
||||
mt2.type_name as typeName,
|
||||
mt.type_name as typeModelName,
|
||||
mm.ma_code as maCode,
|
||||
bu.unit_name as unitName,
|
||||
bp.pro_name as projectName,
|
||||
bai.agreement_code as agreementCode,
|
||||
DATEDIFF(CURDATE(), mm.next_check_time) AS overDays
|
||||
FROM
|
||||
ma_machine mm
|
||||
LEFT JOIN ma_type mt on mt.type_id=mm.type_id
|
||||
LEFT JOIN ma_type mt2 on mt2.type_id=mt.parent_id
|
||||
LEFT JOIN slt_agreement_info sai on sai.ma_id=mm.ma_id and mm.type_id=sai.type_id and sai.`status`='0' and
|
||||
sai.end_time is null
|
||||
LEFT JOIN bm_agreement_info bai on bai.agreement_id=sai.agreement_id
|
||||
LEFT JOIN bm_unit bu ON bai.unit_id = bu.unit_id
|
||||
AND bu.del_flag = '0'
|
||||
LEFT JOIN bm_project bp ON bai.project_id = bp.pro_id
|
||||
AND bp.del_flag = '0'
|
||||
WHERE
|
||||
mm.ma_status='2'
|
||||
and bp.pro_name is not null
|
||||
AND mm.next_check_time < CURDATE()
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and (mt2.type_name like concat('%', #{keyWord}, '%') or
|
||||
mt.type_name like concat('%', #{keyWord}, '%') or
|
||||
mm.ma_code like concat('%', #{keyWord}, '%') or
|
||||
bu.unit_name like concat('%', #{keyWord}, '%') or
|
||||
bp.pro_name like concat('%', #{keyWord}, '%') or
|
||||
bai.agreement_code like concat('%', #{keyWord}, '%')
|
||||
)
|
||||
</if>
|
||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||
AND DATE_FORMAT( mm.next_check_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
|
||||
</if>
|
||||
ORDER BY mm.next_check_time ASC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue