报表优化

highway
wws 1 year ago
parent 362a8ac15a
commit 92615d8e28

@ -2,6 +2,7 @@ package com.op.device.domain.vo;
import com.op.device.domain.EquOrder; import com.op.device.domain.EquOrder;
import com.op.device.domain.EquOrderDetail; import com.op.device.domain.EquOrderDetail;
import com.op.device.domain.EquOrderEquSpare;
import com.op.device.domain.Equipment; import com.op.device.domain.Equipment;
import java.util.List; import java.util.List;
@ -11,6 +12,15 @@ public class InspectionWorkVO {
private EquOrder order; private EquOrder order;
private Equipment equ; private Equipment equ;
private List<EquOrderDetail> detailList; private List<EquOrderDetail> detailList;
private List<EquOrderEquSpare> spareList;
public List<EquOrderEquSpare> getSpareList() {
return spareList;
}
public void setSpareList(List<EquOrderEquSpare> spareList) {
this.spareList = spareList;
}
public EquOrder getOrder() { public EquOrder getOrder() {
return order; return order;

@ -65,4 +65,11 @@ public interface EquOrderEquSpareMapper {
* @return * @return
*/ */
List<EquOrderEquSpare> selectEquOrderEquSpareByParentCode(String code); List<EquOrderEquSpare> selectEquOrderEquSpareByParentCode(String code);
/**
* code
* @param orderCode
* @return
*/
List<EquOrderEquSpare> selectEquOrderEquSpareByOrderCode(String orderCode);
} }

@ -33,6 +33,8 @@ public class InspectionWorkServiceImpl implements IInspectionWorkService {
private EquOrderStandardMapper equOrderStandardMapper; private EquOrderStandardMapper equOrderStandardMapper;
@Autowired @Autowired
private EquPlanMapper equPlanMapper; private EquPlanMapper equPlanMapper;
@Autowired
private EquOrderEquSpareMapper equOrderEquSpareMapper;
/** /**
* *
@ -44,6 +46,7 @@ public class InspectionWorkServiceImpl implements IInspectionWorkService {
@DS("#header.poolName") @DS("#header.poolName")
public AjaxResult selectEquOrderByOrderId(String orderId) { public AjaxResult selectEquOrderByOrderId(String orderId) {
InspectionWorkVO workVO = new InspectionWorkVO(); InspectionWorkVO workVO = new InspectionWorkVO();
// 查询工单信息
EquOrder order = equOrderMapper.selectEquOrderByOrderId(orderId); EquOrder order = equOrderMapper.selectEquOrderByOrderId(orderId);
// 设置计划名称 // 设置计划名称
EquPlan equPlan = equPlanMapper.selectEquPlanByPlanCode(order.getPlanCode()); EquPlan equPlan = equPlanMapper.selectEquPlanByPlanCode(order.getPlanCode());
@ -51,11 +54,15 @@ public class InspectionWorkServiceImpl implements IInspectionWorkService {
order.setPlanName(equPlan.getPlanName()); order.setPlanName(equPlan.getPlanName());
} }
// 查询备件信息
List<EquOrderEquSpare> spareList = equOrderEquSpareMapper.selectEquOrderEquSpareByOrderCode(order.getOrderCode());
// 替换循环周期 // 替换循环周期
order.setPlanLoopType(equOrderMapper.changeLoopType(order.getPlanLoopType())); order.setPlanLoopType(equOrderMapper.changeLoopType(order.getPlanLoopType()));
Equipment equipment = equipmentMapper.selectEquipmentByEquipmentCode(order.getEquipmentCode()); Equipment equipment = equipmentMapper.selectEquipmentByEquipmentCode(order.getEquipmentCode());
// 查询检查项、标准
List<EquOrderDetail> detailList = equOrderDetailMapper.selectEquOrderDetailByOrderCode(order.getOrderCode()); List<EquOrderDetail> detailList = equOrderDetailMapper.selectEquOrderDetailByOrderCode(order.getOrderCode());
for (EquOrderDetail detail : detailList) { for (EquOrderDetail detail : detailList) {
List<EquOrderStandard> standardList = equOrderStandardMapper.selectEquOrderStandardByParentCode(detail.getCode()); List<EquOrderStandard> standardList = equOrderStandardMapper.selectEquOrderStandardByParentCode(detail.getCode());
@ -76,6 +83,8 @@ public class InspectionWorkServiceImpl implements IInspectionWorkService {
} }
detail.setStandardList(standardList); detail.setStandardList(standardList);
} }
workVO.setSpareList(spareList);
workVO.setOrder(order); workVO.setOrder(order);
workVO.setEqu(equipment); workVO.setEqu(equipment);
workVO.setDetailList(detailList); workVO.setDetailList(detailList);

@ -55,6 +55,11 @@
where parent_code = #{parentCode} where parent_code = #{parentCode}
</select> </select>
<select id="selectEquOrderEquSpareByOrderCode" parameterType="String" resultMap="EquOrderEquSpareResult">
<include refid="selectEquOrderEquSpareVo"/>
where order_code = #{orderCode}
</select>
<insert id="insertEquOrderEquSpare" parameterType="EquOrderEquSpare"> <insert id="insertEquOrderEquSpare" parameterType="EquOrderEquSpare">
insert into equ_order_equ_spare insert into equ_order_equ_spare
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">

Loading…
Cancel
Save