Merge remote-tracking branch 'origin/master'

highway
zhaoxiaolin 1 year ago
commit 8ce8e22a47

@ -102,8 +102,27 @@ public class DevicePDAController {
/**
*
*/
// @GetMapping(value = "/{equipmentId}")
// public AjaxResult queryEquipment(@PathVariable("equipmentId") Long equipmentId) {
// return devicePDAService.selectBaseEquipmentByEquipmentId(equipmentId);
// }
@GetMapping(value = "/queryEquipment/{equipmentId}")
public AjaxResult queryEquipment(@PathVariable("equipmentId") Long equipmentId) {
return devicePDAService.selectEquEquipmentByEquEquipmentId(equipmentId);
}
/**
*
*/
@GetMapping(value = "/selectPdaRepairWorkOrderDetails/{workId}")
public AjaxResult selectPdaRepairWorkOrderDetails(@PathVariable("workId") String workId) {
return devicePDAService.selectPdaRepairWorkOrderDetails(workId);
}
/**
*
* @param equRepairWorkOrder
* @return
*/
@PutMapping("/updateMaintenanceRecords")
public AjaxResult updateMaintenanceRecords(@RequestBody EquRepairWorkOrder equRepairWorkOrder) {
return devicePDAService.updateMaintenanceRecords(equRepairWorkOrder);
}
}

@ -142,16 +142,26 @@ public class EquOrder extends BaseEntity {
private String orderInspect;
//报修单号
private String repairCode;
//维修单号
private String workCode;
public String getRepairCode() {
return repairCode;
}
public void setRepairCode(String repairCode) {
this.repairCode = repairCode;
}
public String getWorkCode() {
return workCode;
}
public void setWorkCode(String workCode) {
this.workCode = workCode;
}
public String getOrderInspect() {
return orderInspect;
}

@ -96,6 +96,9 @@ public class EquOrderStandard extends BaseEntity {
private String repairPicture;
//检查项检查方法
private String itemMethod;
public String getRepairPicture() {
return repairPicture;
}
@ -272,6 +275,14 @@ public class EquOrderStandard extends BaseEntity {
return delFlag;
}
//检查项检查方法
public void setItemMethod(String itemMethod) {
this.itemMethod = itemMethod;
}
public String getItemMethod() {
return itemMethod;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -209,7 +209,10 @@ public class EquRepairWorkOrder extends BaseEntity {
//手持
//用户id
private String userId;
//检查项列表
private List<EquOrderStandard> checkList;
//申领单列表
private List<EquSpareApply> applyList;
//报修
public void setOrderDesc(String orderDesc) {
@ -575,6 +578,20 @@ public class EquRepairWorkOrder extends BaseEntity {
return userId;
}
public List<EquOrderStandard> getCheckList() {
return checkList;
}
public void setCheckList(List<EquOrderStandard> checkList) {
this.checkList = checkList;
}
public List<EquSpareApply> getApplyList() {
return applyList;
}
public void setApplyList(List<EquSpareApply> applyList) {
this.applyList = applyList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -18,7 +18,7 @@ public interface EquEquipmentMapper {
* @param equipmentId
* @return
*/
public EquEquipment selectEquEquipmentByEquipmentId(Long equipmentId);
public EquEquipment selectEquEquipmentByEquEquipmentId(Long equipmentId);
/**
*

@ -3,6 +3,7 @@ package com.op.device.mapper;
import java.util.List;
import com.op.common.core.domain.BaseFileData;
import com.op.device.domain.EquOrder;
import com.op.device.domain.EquOrderStandard;
/**
@ -72,4 +73,11 @@ public interface EquOrderStandardMapper {
* @param files
*/
void insertBaseFileBatch(List<BaseFileData> files);
/**
*
* @param equOrder
* @return
*/
public List<EquOrderStandard> selectPdaEquOrderList(EquOrder equOrder);
}

@ -70,9 +70,23 @@ public interface IDevicePDAService {
public AjaxResult updateDowntime(EquRepairWorkOrder equRepairWorkOrder);
/**
*
*
* @param equipmentId
* @return
*/
public AjaxResult selectEquEquipmentByEquEquipmentId(Long equipmentId);
/**
*
* @param workId
* @return
*/
public AjaxResult selectPdaRepairWorkOrderDetails(String workId);
/**
*
* @param equRepairWorkOrder
* @return
*/
// AjaxResult selectBaseEquipmentByEquipmentId(Long equipmentId);
public AjaxResult updateMaintenanceRecords(EquRepairWorkOrder equRepairWorkOrder);
}

@ -14,6 +14,7 @@ import com.op.device.service.IDevicePDAService;
import com.op.system.api.domain.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@ -56,6 +57,10 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
private EquRepairWorkOrderMapper equRepairWorkOrderMapper;
@Autowired
private EquTeamMapper equTeamMapper;
@Autowired
private EquEquipmentMapper equEquipmentMapper;
@Autowired
private EquSpareApplyMapper equSpareApplyMapper;
/**
@ -325,4 +330,84 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
return error();
}
}
/**
*
*
* @param equipmentId
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult selectEquEquipmentByEquEquipmentId(Long equipmentId) {
try {
EquEquipment list = equEquipmentMapper.selectEquEquipmentByEquEquipmentId(equipmentId);
return success(list);
} catch (Exception e) {
return error();
}
}
/**
*
*
* @param workId
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult selectPdaRepairWorkOrderDetails(String workId) {
try {
EquRepairWorkOrder list = equRepairWorkOrderMapper.selectEquRepairWorkOrderByWorkId(workId);
//查询对应检查项信息
EquOrder equOrder = new EquOrder();
equOrder.setWorkCode(list.getWorkCode());
List<EquOrderStandard> checkLists = equOrderStandardMapper.selectPdaEquOrderList(equOrder);
list.setCheckList(checkLists);
//备件申领单
EquRepairWorkOrder equRepairWorkOrder = new EquRepairWorkOrder();
equRepairWorkOrder.setWorkCode(list.getWorkCode());
List<EquSpareApply> applyLists = equSpareApplyMapper.selectRepairSparePartsRecord(equRepairWorkOrder);
list.setApplyList(applyLists);
return success(list);
} catch (Exception e) {
return error();
}
}
/**
*
*
* @param equRepairWorkOrder
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult updateMaintenanceRecords(EquRepairWorkOrder equRepairWorkOrder) {
try {
//更新每一项点检/巡检检查项信息
List<EquOrderStandard> equOrderStandards = equRepairWorkOrder.getCheckList();
for(EquOrderStandard equOrderStandard:equOrderStandards){
equOrderStandard.setUpdateBy(SecurityUtils.getUsername());
equOrderStandard.setUpdateTime(DateUtils.getNowDate());
equOrderStandardMapper.updateEquOrderStandard(equOrderStandard);
}
//新建申领单 缺少code
List<EquSpareApply> equSpareApplies = equRepairWorkOrder.getApplyList();
for(EquSpareApply equSpareApply:equSpareApplies){
equSpareApply.setApplyId(IdUtils.fastSimpleUUID());
equSpareApply.setCreateBy(SecurityUtils.getUsername());
equSpareApply.setCreateTime(DateUtils.getNowDate());
equSpareApply.setApplyTime(DateUtils.getNowDate());
equSpareApplyMapper.insertEquSpareApply(equSpareApply);
}
//维修人员名字????前端能够提供吗???
equRepairWorkOrder.setUpdateBy(SecurityUtils.getUsername());
equRepairWorkOrder.setUpdateTime(DateUtils.getNowDate());
equRepairWorkOrderMapper.updateEquRepairWorkOrder(equRepairWorkOrder);
return success("提交成功,维修完成!");
} catch (Exception e) {
return error();
}
}
}

@ -138,6 +138,8 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
//不委外
equRepairWorkOrder.setWorkOutsource("0");
equRepairWorkOrder.setOutWorkCode("无");
//是否立即维修 1是 0 否
equRepairWorkOrder.setWorkHandle("0");
//计划维修时间
equRepairWorkOrder.setWorkPlanTime(equRepairOrder.getWorkPlanTime());
//是否停机维修 停机维修时间
@ -183,6 +185,9 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
equRepairOrder.setOrderStatus("审核通过");
}else if(equRepairOrder.getRepairDestination().equals("立即维修")){
//立即维修
//是否立即维修 1是 0 否
EquRepairWorkOrder equRepairWorkOrder = new EquRepairWorkOrder();
equRepairWorkOrder.setWorkHandle("0");
equRepairOrder.setOrderStatus("审核通过");
}
equRepairOrder.setUpdateTime(DateUtils.getNowDate());

@ -38,10 +38,11 @@
<result property="shutDown" column="shut_down" />
<result property="orderInspect" column="order_inspect" />
<result property="repairCode" column="repair_code" />
<result property="workCode" column="work_code" />
</resultMap>
<sql id="selectEquOrderVo">
select order_id, plan_id, plan_code, plan_type, order_code, plan_workshop, plan_prod_line, plan_loop, plan_loop_type, plan_loop_start, plan_loop_end, order_start, order_end, equipment_code, order_status, order_cost, plan_person, order_cost_time, order_sign_person, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time,upkeep,calculation_rule,shut_down,order_inspect,repair_code from equ_order
select order_id, plan_id, plan_code, plan_type, order_code, plan_workshop, plan_prod_line, plan_loop, plan_loop_type, plan_loop_start, plan_loop_end, order_start, order_end, equipment_code, order_status, order_cost, plan_person, order_cost_time, order_sign_person, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time,upkeep,calculation_rule,shut_down,order_inspect,repair_code,work_code from equ_order
</sql>
<select id="selectEquOrderList" parameterType="EquOrder" resultMap="EquOrderResult">
@ -79,6 +80,7 @@
<if test="shutDown != null "> and shut_down = #{shutDown}</if>
<if test="orderInspect != null "> and order_inspect = #{orderInspect}</if>
<if test="repairCode != null "> and repair_code = #{repairCode}</if>
<if test="workCode != null "> and work_code = #{workCode}</if>
and del_flag = '0'
</where>
</select>
@ -161,6 +163,8 @@
<if test="shutDown != null">shut_down,</if>
<if test="orderInspect != null">order_inspect,</if>
<if test="repairCode != null">repair_code,</if>
<if test="repairCode != null">repair_code,</if>
<if test="workCode != null">work_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderId != null">#{orderId},</if>
@ -196,6 +200,7 @@
<if test="shutDown != null">#{shutDown},</if>
<if test="orderInspect != null">#{orderInspect},</if>
<if test="repairCode != null">#{repairCode},</if>
<if test="workCode != null">#{workCode},</if>
</trim>
</insert>
@ -234,6 +239,7 @@
<if test="shutDown != null">shut_down = #{shutDown},</if>
<if test="orderInspect != null">order_inspect = #{orderInspect},</if>
<if test="repairCode != null">repair_code = #{repairCode},</if>
<if test="workCode != null">work_code = #{workCode},</if>
</trim>
where order_id = #{orderId}
</update>

@ -32,6 +32,9 @@
<result property="repairReach" column="repair_reach" />
<result property="repairValue" column="repair_value" />
<result property="repairPicture" column="repair_picture" />
<!-- 检查项检查方法-->
<result property="itemMethod" column="item_method" />
</resultMap>
<sql id="selectEquOrderStandardVo">
@ -196,4 +199,26 @@
#{id}
</foreach>
</delete>
<!--手持查询维修工单接口-->
<select id="selectPdaEquOrderList" parameterType="EquOrderStandard" resultMap="EquOrderStandardResult">
select
eos.id,
eos.order_code,
eos.standard_name,
eod.item_method,
eos.detail_up_limit,
eos.detail_down_limit,
eos.detail_unit,
eos.detail_reach,
eos.actual_value
from equ_order_standard eos
left join equ_order eo on eos.order_code = eo.order_code
left join equ_order_detail eod on eos.order_code = eod.order_code
<where>
<if test="workCode != null "> and eo.work_code = #{workCode}</if>
and eo.del_flag = '0'
and eos.error_flag = '1'
</where>
</select>
</mapper>

@ -169,8 +169,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectRepairSparePartsRecord" parameterType="EquRepairWorkOrder" resultMap="EquSpareApplyResult">
<include refid="selectEquSpareApplyVo"/>
where del_flag = '0'
and work_code = #{workCode}
<where>
<if test="workCode != null and workCode != ''"> and work_code = #{workCode}</if>
and del_flag = '0'
</where>
ORDER BY apply_time DESC
</select>

Loading…
Cancel
Save