设备综合报表

master
A0010407 1 year ago
parent 4c7b2aae74
commit 8452e5b19e

@ -3,7 +3,10 @@ package com.op.device.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.op.device.domain.EquRepairOrder;
import com.op.device.domain.WorkCenter;
import com.op.device.domain.dto.EquCheckItemDTO;
import com.op.device.domain.dto.SummaryReportDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -118,4 +121,31 @@ public class EquCheckItemController extends BaseController {
public AjaxResult remove(@PathVariable String[] itemIds) {
return equCheckItemService.deleteEquCheckItemByItemIds(itemIds);
}
//检查标准汇总 点检、巡检、保养
@RequiresPermissions("device:item:summaryReport")
@GetMapping("/summaryReport")
public AjaxResult getSummaryReport(EquCheckItem equCheckItem) {
return equCheckItemService.getSummaryReport(equCheckItem);
}
/**
*
*
* @return
*/
@GetMapping("/getWorkCenter")
public AjaxResult getWorkCenter() {
return equCheckItemService.getWorkCenter();
}
/**
*
* @return
*/
@GetMapping("/matchList")
public AjaxResult selectMatchListByEquipmentCode(SummaryReportDTO summaryReportDTO) {
return equCheckItemService.selectMatchListByEquipmentCode(summaryReportDTO);
}
}

@ -0,0 +1,477 @@
package com.op.device.domain.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.op.common.core.annotation.Excel;
import com.op.device.domain.EquCheckItemDetail;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
// 检查项维护页面DTO
public class SummaryReportDTO {
/** 主键 */
private String itemId ;
/** 检查项编码 */
private String itemCode ;
/** 检查项名称 */
private String itemName ;
/** 检查项方法/工具 */
private String itemMethod ;
/** 维护类型编码 */
private String itemType ;
/** 维护类型名称 */
private String itemTypeName ;
/** 检查项备注 */
private String itemRemark ;
// 检查工具
private String itemTools;
//标准类型
private String standardType;
//标准名称
private String standardName;
// 循环周期类型
private String itemLoopType;
// 循环周期
private int itemLoop;
/** 主键 */
private String orderId;
//设备
private String equipmentCode;
/** 维修前达标 */
private String detailReach;
//维修后是否达标
private String repairReach;
/** 主键 */
private String detailId ;
/** 主键 */
private String id ;
//1号
private String one ;
//2号
private String two ;
//3号
private String three ;
//4号
private String four ;
//5号
private String five ;
//6号
private String six ;
//7号
private String seven ;
//8号
private String eight ;
//9号
private String nine ;
//10号
private String ten ;
//11号
private String eleven ;
//12号
private String twelve ;
//13号
private String thirteen ;
//14号
private String fourteen;
//15号
private String fifteen;
//16号
private String sixteen;
//17号
private String seventeen;
//18号
private String eighteen;
//19号
private String nineteen;
//20号
private String twenty;
//21号
private String twentyOne;
//22号
private String twentyTwo;
//23号
private String twentyThree;
//24号
private String twentyFour;
//25号
private String twentyFive;
//26号
private String twentySix;
//27号
private String twentySeven;
//28号
private String twentyEight;
//29号
private String twentyNine;
//30号
private String thirty;
//31号
private String thirtyOne;
/** 实际结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
private Date orderEnd;
/** 时间 */
private String yearMouth;
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public String getOrderId() {
return orderId;
}
public String getItemTools() {
return itemTools;
}
public void setItemTools(String itemTools) {
this.itemTools = itemTools;
}
public String getItemId() {
return itemId;
}
public void setItemId(String itemId) {
this.itemId = itemId;
}
public String getItemCode() {
return itemCode;
}
public void setItemCode(String itemCode) {
this.itemCode = itemCode;
}
public String getItemName() {
return itemName;
}
public void setItemName(String itemName) {
this.itemName = itemName;
}
public String getItemMethod() {
return itemMethod;
}
public void setItemMethod(String itemMethod) {
this.itemMethod = itemMethod;
}
public String getItemType() {
return itemType;
}
public void setItemType(String itemType) {
this.itemType = itemType;
}
public String getItemTypeName() {
return itemTypeName;
}
public void setItemTypeName(String itemTypeName) {
this.itemTypeName = itemTypeName;
}
public String getItemRemark() {
return itemRemark;
}
public void setItemRemark(String itemRemark) {
this.itemRemark = itemRemark;
}
public String getStandardType() {
return standardType;
}
public void setStandardType(String standardType) {
this.standardType = standardType;
}
public String getStandardName() {
return standardName;
}
public void setStandardName(String standardName) {
this.standardName = standardName;
}
public int getItemLoop() {
return itemLoop;
}
public void setItemLoop(int itemLoop) {
this.itemLoop = itemLoop;
}
public String getItemLoopType() {
return itemLoopType;
}
public void setItemLoopType(String itemLoopType) {
this.itemLoopType = itemLoopType;
}
public void setEquipmentCode(String equipmentCode) {
this.equipmentCode = equipmentCode;
}
public String getEquipmentCode() {
return equipmentCode;
}
public void setDetailId(String detailId) {
this.detailId = detailId;
}
public String getDetailId() {
return detailId;
}
public String getRepairReach() {
return repairReach;
}
public void setRepairReach(String repairReach) {
this.repairReach = repairReach;
}
public String getDetailReach() {
return detailReach;
}
public void setDetailReach(String detailReach) {
this.detailReach = detailReach;
}
public void setOrderEnd(Date orderEnd) {
this.orderEnd = orderEnd;
}
public Date getOrderEnd() {
return orderEnd;
}
public void setYearMouth(String yearMouth) {
this.yearMouth = yearMouth;
}
public String getYearMouth() {
return yearMouth;
}
public void setOne(String one) {
this.one = one;
}
public String getOne() {
return one;
}
public void setTwo(String two) {
this.two = two;
}
public String getTwo() {
return two;
}
public void setThree(String three) {
this.three = three;
}
public String getThree() {
return three;
}
public void setFour(String four) {
this.four = four;
}
public String getFour() {
return four;
}
public void setFive(String five) {
this.five = five;
}
public String getFive() {
return five;
}
public void setSix(String six) {
this.six = six;
}
public String getSix() {
return six;
}
public void setSeven(String seven) {
this.seven = seven;
}
public String getSeven() {
return seven;
}
public void setEight(String eight) {
this.eight = eight;
}
public String getEight() {
return eight;
}
public void setNine(String nine) {
this.nine = nine;
}
public String getNine() {
return nine;
}
public void setTen(String ten) {
this.ten = ten;
}
public String getTen() {
return ten;
}
public void setEleven(String eleven) {
this.eleven = eleven;
}
public String getEleven() {
return eleven;
}
public void setTwelve(String twelve) {
this.twelve = twelve;
}
public String getTwelve() {
return twelve;
}
public void setThirteen(String thirteen) {
this.thirteen = thirteen;
}
public String getThirteen() {
return thirteen;
}
public void setFourteen(String fourteen) {
this.fourteen = fourteen;
}
public String getFourteen() {
return fourteen;
}
public void setFifteen(String fifteen) {
this.fifteen = fifteen;
}
public String getFifteen() {
return fifteen;
}
public void setSixteen(String sixteen) {
this.sixteen = sixteen;
}
public String getSixteen() {
return sixteen;
}
public void setSeventeen(String seventeen) {
this.seventeen = seventeen;
}
public String getSeventeen() {
return seventeen;
}
public void setEighteen(String eighteen) {
this.eighteen = eighteen;
}
public String getEighteen() {
return eighteen;
}
public void setNineteen(String nineteen) {
this.nineteen = nineteen;
}
public String getNineteen() {
return nineteen;
}
public void setTwenty(String twenty) {
this.twenty = twenty;
}
public String getTwenty() {
return twenty;
}
public void setTwentyOne(String twentyOne) {
this.twentyOne = twentyOne;
}
public String getTwentyOne() {
return twentyOne;
}
public void setTwentyTwo(String twentyTwo) {
this.twentyTwo = twentyTwo;
}
public String getTwentyTwo() {
return twentyTwo;
}
public void setTwentyThree(String twentyThree) {
this.twentyThree = twentyThree;
}
public String getTwentyThree() {
return twentyThree;
}
public void setTwentyFour(String twentyFour) {
this.twentyFour = twentyFour;
}
public String getTwentyFour() {
return twentyFour;
}
public void setTwentyFive(String twentyFive) {
this.twentyFive = twentyFive;
}
public String getTwentyFive() {
return twentyFive;
}
public void setTwentySix(String twentySix) {
this.twentySix = twentySix;
}
public String getTwentySix() {
return twentySix;
}
public void setTwentySeven(String twentySeven) {
this.twentySeven = twentySeven;
}
public String getTwentySeven() {
return twentySeven;
}
public void setTwentyEight(String twentyEight) {
this.twentyEight = twentyEight;
}
public String getTwentyEight() {
return twentyEight;
}
public void setTwentyNine(String twentyNine) {
this.twentyNine = twentyNine;
}
public String getTwentyNine() {
return twentyNine;
}
public void setThirty(String thirty) {
this.thirty = thirty;
}
public String getThirty() {
return thirty;
}
public void setThirtyOne(String thirtyOne) {
this.thirtyOne = thirtyOne;
}
public String getThirtyOne() {
return thirtyOne;
}
}

@ -4,6 +4,8 @@ import java.util.List;
import com.op.device.domain.EquCheckItem;
import com.op.device.domain.EquPlanDetail;
import com.op.device.domain.WorkCenter;
import com.op.device.domain.dto.SummaryReportDTO;
import com.op.device.domain.vo.EquCheckItemVO;
import org.apache.ibatis.annotations.Param;
@ -94,4 +96,24 @@ public interface EquCheckItemMapper {
* @return
*/
List<EquPlanDetail> checkDelItem(String itemCode);
////////////////////////////////////////////////汇总页面
/**
*
* @param equCheckItem
* @return
*/
List<SummaryReportDTO> getSummaryReport(EquCheckItem equCheckItem);
/**
*
* @return
*/
List<WorkCenter> selectWorkCenter();
/**
*
* @return
*/
List<SummaryReportDTO> selectMatchListByEquipmentCode(SummaryReportDTO summaryReportDTO);
}

@ -4,7 +4,9 @@ import java.util.List;
import com.op.common.core.web.domain.AjaxResult;
import com.op.device.domain.EquCheckItem;
import com.op.device.domain.EquRepairOrder;
import com.op.device.domain.dto.EquCheckItemDTO;
import com.op.device.domain.dto.SummaryReportDTO;
import com.op.device.domain.vo.EquCheckItemVO;
/**
@ -66,11 +68,29 @@ public interface IEquCheckItemService {
* list
* @return
*/
AjaxResult getEquipmentList();
public AjaxResult getEquipmentList();
/**
* codecode
* @return
*/
AjaxResult getEquipmentCodeListByItemCode(String itemCode);
public AjaxResult getEquipmentCodeListByItemCode(String itemCode);
/**
*
* @return
*/
public AjaxResult getSummaryReport(EquCheckItem equCheckItem);
/**
*
* @return
*/
public AjaxResult getWorkCenter();
/**
*
* @return
*/
public AjaxResult selectMatchListByEquipmentCode(SummaryReportDTO summaryReportDTO);
}

@ -693,6 +693,9 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
//维修工单结束时间
equRepairWorkOrder.setWorkEndTime(DateUtils.getNowDate());
//计算维修工单用时
//获取工单的开始时间
////更新每一项点检/巡检检查项信息
//判空
if(StringUtils.isNotEmpty(equRepairWorkOrder.getDetailList())){

@ -1,7 +1,9 @@
package com.op.device.service.impl;
import java.text.DateFormat;
import java.text.Format;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
@ -9,10 +11,9 @@ import com.op.common.core.context.SecurityContextHolder;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.device.domain.EquCheckItemDetail;
import com.op.device.domain.EquItemEquipment;
import com.op.device.domain.EquPlanDetail;
import com.op.device.domain.*;
import com.op.device.domain.dto.EquCheckItemDTO;
import com.op.device.domain.dto.SummaryReportDTO;
import com.op.device.domain.vo.EquCheckItemVO;
import com.op.device.mapper.EquCheckItemDetailMapper;
import com.op.device.mapper.EquItemEquipmentMapper;
@ -160,14 +161,14 @@ public class EquCheckItemServiceImpl implements IEquCheckItemService {
@Transactional
public AjaxResult updateEquCheckItem(EquCheckItemDTO equCheckItemDTO) {
// 校验检查项是否已存在
// 检验
EquCheckItem checkQuery = new EquCheckItem();
checkQuery.setItemType(equCheckItemDTO.getItemType());
checkQuery.setItemName(equCheckItemDTO.getItemName());
List<EquCheckItem> check = equCheckItemMapper.selectEquCheckItemList(checkQuery);
if (check.size() > 0) {
if (check.size()>0) {
if (!check.get(0).getItemCode().equals(equCheckItemDTO.getItemCode())) {
return error(500, "检查项已存在!不可修改!");
return error(500,"检查项已存在!不可修改!");
}
}
@ -329,4 +330,41 @@ public class EquCheckItemServiceImpl implements IEquCheckItemService {
equItemEquipmentMapper.insertEquItemEquipment(equItemEquipment);
}
}
/**
*
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult getSummaryReport(EquCheckItem equCheckItem){
List<SummaryReportDTO> summaryReportList = equCheckItemMapper.getSummaryReport(equCheckItem);
return success(summaryReportList);
}
/**
*
*
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult getWorkCenter() {
List<WorkCenter> workCenterList = equCheckItemMapper.selectWorkCenter();
return success(workCenterList);
}
/**
*
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult selectMatchListByEquipmentCode(SummaryReportDTO summaryReportDTO){
DateFormat df = new SimpleDateFormat("yyyy-MM");
summaryReportDTO.setYearMouth(df.format(summaryReportDTO.getOrderEnd()));
List<SummaryReportDTO> matchList = equCheckItemMapper.selectMatchListByEquipmentCode(summaryReportDTO);
return success(matchList);
}
}

@ -168,4 +168,49 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{itemId}
</foreach>
</delete>
<select id="getSummaryReport" resultType="com.op.device.domain.dto.SummaryReportDTO">
SELECT
eci.item_type_name AS itemTypeName,
eci.item_name AS itemName,
eci.item_method AS itemMethod,
eci.item_tools AS itemTools,
eci.item_loop_type AS itemLoopType,
eci.item_loop AS itemLoop,
ecid.detail_id AS detailId,
ecid.standard_type AS standardType,
ecid.standard_name AS standardName
FROM equ_check_item eci
left join equ_check_item_detail ecid on eci.item_code = ecid.parent_code
where eci.del_flag = '0'
</select>
<select id="selectWorkCenter" resultType="com.op.device.domain.WorkCenter">
select
factory_name AS factoryName,
factory_code AS factoryCode
from sys_factory
where f_type = 'c'
</select>
<select id="selectMatchListByEquipmentCode" resultType="com.op.device.domain.dto.SummaryReportDTO">
SELECT
eo.order_id AS orderId,
eo.equipment_code AS equipmentCode,
eo.order_end AS orderEnd,
eod.item_type_name AS itemTypeName,
eod.item_name AS itemName,
eos.id AS id,
eos.standard_name AS standardName,
eos.detail_reach AS detailReach,
eos.repair_reach AS repairReach
from equ_order eo
left join equ_order_detail eod on eo.order_code = eod.order_code
left join equ_order_standard eos on eod.id = eos.parent_code
where eo.del_flag = '0'
and eo.order_status = '1'
and eo.equipment_code = #{equipmentCode}
and CONVERT(varchar,order_end,21) like concat('%',#{yearMouth}, '%')
</select>
</mapper>
Loading…
Cancel
Save