设备模块-报修-1

highway
A0010407 12 months ago
parent d551bac244
commit 76ef1fd102

@ -4,6 +4,7 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.op.device.domain.EquEquipment;
import com.op.device.domain.EquTeamUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -130,9 +131,9 @@ public class EquRepairOrderController extends BaseController {
*
*/
@GetMapping("/getRepairPersonList")
public TableDataInfo getRepairPersonList(EquEquipment equEquipment) {
public TableDataInfo getRepairPersonList(EquTeamUser equTeamUser) {
startPage();
List<EquEquipment> list = equRepairOrderService.getRepairPersonList(equEquipment);
List<EquTeamUser> list = equRepairOrderService.getRepairPersonList(equTeamUser);
return getDataTable(list);
}

@ -605,6 +605,35 @@ public class EquOrder extends BaseEntity {
return delFlag;
}
//检查项详情
public void setItemName(String itemName) {
this.itemName = itemName;
}
public String getItemName() {
return itemName;
}
public void setItemMethod(String itemMethod) {
this.itemMethod = itemMethod;
}
public String getItemMethod() {
return itemMethod;
}
public void setItemType(String itemType) {
this.itemType = itemType;
}
public String getItemType() {
return itemType;
}
public void setItemTypeName(String itemTypeName) {
this.itemTypeName = itemTypeName;
}
public String getItemTypeName() {
return itemTypeName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -178,6 +178,16 @@ public class EquRepairOrder extends BaseEntity {
//检查项列表
private List<EquOrder> checkList;
//时间列表 虚拟字段
private List<Date> orderBreakdownTimeArray;
private List<Date> orderTimeArray;
//故障开始时间、故障结束时间
private String orderBreakdownTimeStart;
private String orderBreakdownTimeEnd;
//报修开始时间、结束时间
private String orderTimeStart;
private String orderTimeEnd;
//图片文件
public String getFileList() {
return fileList;
@ -463,6 +473,49 @@ public class EquRepairOrder extends BaseEntity {
this.checkList = checkList;
}
//时间列表
public List<Date> getOrderBreakdownTimeArray() {
return orderBreakdownTimeArray;
}
public void setOrderBreakdownTimeArray(List<Date> orderBreakdownTimeArray) {
this.orderBreakdownTimeArray = orderBreakdownTimeArray;
}
public List<Date> getOrderTimeArray() {
return orderTimeArray;
}
public void setOrderTimeArray(List<Date> orderTimeArray) {
this.orderTimeArray = orderTimeArray;
}
//故障开始时间、结束时间
public String getOrderBreakdownTimeStart() {
return orderBreakdownTimeStart;
}
public void setOrderBreakdownTimeStart(String orderBreakdownTimeStart) {
this.orderBreakdownTimeStart = orderBreakdownTimeStart;
}
public String getOrderBreakdownTimeEnd() {
return orderBreakdownTimeEnd;
}
public void setOrderBreakdownTimeEnd(String orderBreakdownTimeEnd) {
this.orderBreakdownTimeEnd = orderBreakdownTimeEnd;
}
//报修开始时间、结束时间
public String getOrderTimeStart() {
return orderTimeStart;
}
public void setOrderTimeStart(String orderTimeStart) {
this.orderTimeStart = orderTimeStart;
}
public String getOrdeTimeEnd() {
return orderTimeEnd;
}
public void setOrderTimeEnd(String orderTimeEnd) {
this.orderTimeEnd = orderTimeEnd;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -134,4 +134,18 @@ public interface EquOrderMapper {
* @return
*/
String selectEquipmentNameByEquCode(String equipmentCode);
/**
* OrderCodeID
* @param orderCode
* @return
*/
List<String> getIdsByOrderCode(String orderCode);
/**
*
* @param equOrder
* @return
*/
void updateEquOrderRepairCode(EquOrder equOrder);
}

@ -7,6 +7,7 @@ import com.op.common.core.domain.BaseFileData;
import com.op.device.domain.EquEquipment;
import com.op.device.domain.EquFile;
import com.op.device.domain.EquRepairOrder;
import com.op.device.domain.EquTeamUser;
import org.apache.ibatis.annotations.Param;
/**
@ -72,7 +73,7 @@ public interface EquRepairOrderMapper {
//查询报修人员列表
@DS("master")
List<EquEquipment> getRepairPersonList(EquEquipment equEquipment);
List<EquTeamUser> getRepairPersonList(EquTeamUser equTeamUser);
/**
* code

@ -3,10 +3,8 @@ package com.op.device.service;
import java.util.List;
import com.op.common.core.web.domain.AjaxResult;
import com.op.device.domain.*;
import com.op.device.domain.EquEquipment;
import com.op.device.domain.EquEquipment;
import com.op.device.domain.EquRepairOrder;
import com.op.device.domain.EquRepairWorkOrder;
/**
* Service
@ -78,5 +76,5 @@ public interface IEquRepairOrderService {
public int checkEquRepairOrder(EquRepairOrder equRepairOrder);
//查询报修人员列表
List<EquEquipment> getRepairPersonList(EquEquipment equEquipment);
List<EquTeamUser> getRepairPersonList(EquTeamUser equTeamUser);
}

@ -1,5 +1,6 @@
package com.op.device.service.impl;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -66,19 +67,6 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
list.setFiles(files);
}
// //查询对应检查项信息
// EquOrder equOrder = new EquOrder();
// equOrder.setOrderCode(list.getOrderCode());
// List<EquOrderStandard> checkLists = equOrderStandardMapper.selectPdaEquOrderList(equOrder);
// //每个检查项对应文件
// for(EquOrderStandard equOrderStandard :checkLists){
// List<BaseFileData> file = equOrderStandardMapper.getBaseFileBatch(equOrderStandard.getId());
// if (!CollectionUtils.isEmpty(file)) {
// equOrderStandard.setPicturePaths(file);
// }
// }
// list.setCheckList(checkLists);
//查询对应检查项信息
EquOrder equOrder = new EquOrder();
//报修单号
@ -112,6 +100,22 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
@Override
@DS("#header.poolName")
public List<EquRepairOrder> selectEquRepairOrderList(EquRepairOrder equRepairOrder) {
if (equRepairOrder.getOrderBreakdownTimeArray() != null) {
// 设置故障开始时间、结束时间
if (equRepairOrder.getOrderBreakdownTimeArray().size() == 2) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
equRepairOrder.setOrderBreakdownTimeStart(formatter.format(equRepairOrder.getOrderBreakdownTimeArray().get(0)));
equRepairOrder.setOrderBreakdownTimeEnd(formatter.format(equRepairOrder.getOrderBreakdownTimeArray().get(1)));
}
}
if (equRepairOrder.getOrderTimeArray() != null) {
// 设置更新日期开始和结束
if (equRepairOrder.getOrderTimeArray().size() == 2) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
equRepairOrder.setOrderTimeStart(formatter.format(equRepairOrder.getOrderTimeArray().get(0)));
equRepairOrder.setOrderTimeEnd(formatter.format(equRepairOrder.getOrderTimeArray().get(1)));
}
}
return equRepairOrderMapper.selectEquRepairOrderList(equRepairOrder);
}
@ -166,14 +170,31 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
@Override
@DS("#header.poolName")
public int checkEquRepairOrder(EquRepairOrder equRepairOrder) {
//改了,不生成流水号,从第十位开始切割
String code = equRepairOrder.getOrderCode().substring(10);
String workCode = DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + code;
//判断是否是点检、巡检过来的
if(equRepairOrder.getOrderSource().equals("点检") || equRepairOrder.getOrderSource().equals("巡检")){
//更新检查项信息
EquOrder equOrder = new EquOrder();
List<String> ids = equOrderMapper.getIdsByOrderCode(equRepairOrder.getOrderCode());
for(String id :ids){
EquOrder one = new EquOrder();
one.setOrderId(id);
one.setWorkCode("WX" + workCode);
one.setUpdateBy(SecurityUtils.getUsername());
one.setUpdateTime(DateUtils.getNowDate());
//只更新其中一个信息
equOrderMapper.updateEquOrderRepairCode(one);
}
}
if(equRepairOrder.getRepairDestination().equals("计划性维修")){
EquRepairWorkOrder equRepairWorkOrder = new EquRepairWorkOrder();
//报修单号
equRepairWorkOrder.setOrderCode(equRepairOrder.getOrderCode());
//维修单号
String serialNum = String.format("%03d", equRepairWorkOrderMapper.selectWorkCodeSerialNumber());
String equipmentCode = equRepairOrder.getEquipmentCode();
equRepairWorkOrder.setWorkCode("WX"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
equRepairWorkOrder.setWorkCode("WX" + workCode);
equRepairWorkOrder.setOrderId(equRepairOrder.getOrderId());
equRepairWorkOrder.setEquipmentCode(equRepairOrder.getEquipmentCode());
equRepairWorkOrder.setWorkTeam(equRepairOrder.getWorkTeam());
@ -202,17 +223,17 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
equRepairWorkOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
equRepairWorkOrderMapper.insertEquRepairWorkOrder(equRepairWorkOrder);
equRepairOrder.setOrderStatus("审核通过");
}else if(equRepairOrder.getRepairDestination().equals("不维修")){
equRepairOrder.setOrderStatus("驳回");
}else if(equRepairOrder.getRepairDestination().equals("委外维修")){
EquOutsourceWork equOutsourceWork = new EquOutsourceWork();
//委外工单编码、id、联系方式、委外单位、委外人员、委外原因
equOutsourceWork.setWorkId(IdUtils.fastSimpleUUID());
equOutsourceWork.setOrderCode(equRepairOrder.getOrderCode());
String serialNum = String.format("%03d", equOutsourceWorkMapper.selectWorkCodeSerialNumber());
String equipmentCode = equRepairOrder.getEquipmentCode();
equOutsourceWork.setEquipmentCode(equipmentCode);
equOutsourceWork.setWorkCode("WW"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
equOutsourceWork.setEquipmentCode(equRepairOrder.getEquipmentCode());
equOutsourceWork.setWorkCode("WW" + workCode);
equOutsourceWork.setRepairCode("无");
equOutsourceWork.setWorkConnection(equRepairOrder.getWorkConnection());
equOutsourceWork.setWorkOutsourcingUnit(equRepairOrder.getWorkOutsourcingUnit());
@ -226,10 +247,38 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
equOutsourceWorkMapper.insertEquOutsourceWork(equOutsourceWork);
equRepairOrder.setOrderStatus("审核通过");
}else if(equRepairOrder.getRepairDestination().equals("立即维修")){
//立即维修
//是否立即维修 1是 0 否
EquRepairWorkOrder equRepairWorkOrder = new EquRepairWorkOrder();
//报修单号
equRepairWorkOrder.setOrderCode(equRepairOrder.getOrderCode());
//维修单号
equRepairWorkOrder.setWorkCode("WX"+workCode);
equRepairWorkOrder.setOrderId(equRepairOrder.getOrderId());
equRepairWorkOrder.setEquipmentCode(equRepairOrder.getEquipmentCode());
equRepairWorkOrder.setWorkTeam(equRepairOrder.getWorkTeam());
//不委外
equRepairWorkOrder.setWorkOutsource("0");
equRepairWorkOrder.setOutWorkCode("无");
//是否立即维修 1是 0 否
equRepairWorkOrder.setWorkHandle("0");
//计划维修时间
equRepairWorkOrder.setWorkPlanTime(equRepairOrder.getWorkPlanTime());
//是否停机维修 停机维修时间
if(equRepairOrder.getWorkPlanDownTime() != null){
equRepairWorkOrder.setWorkDownMachine("1");
equRepairWorkOrder.setWorkPlanDownTime(equRepairOrder.getWorkPlanDownTime());
}else{
equRepairWorkOrder.setWorkDownMachine("0");
}
equRepairWorkOrder.setWorkFaultDesc(equRepairOrder.getOrderDesc());
equRepairWorkOrder.setWorkStatus("0");
equRepairWorkOrder.setWorkId(IdUtils.fastSimpleUUID());
equRepairWorkOrder.setCreateTime(DateUtils.getNowDate());
equRepairWorkOrder.setCreateBy(SecurityUtils.getUsername());
//工厂
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
equRepairWorkOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
equRepairWorkOrderMapper.insertEquRepairWorkOrder(equRepairWorkOrder);
equRepairOrder.setOrderStatus("审核通过");
}
equRepairOrder.setUpdateTime(DateUtils.getNowDate());
@ -326,12 +375,12 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
/**
*
*
* @param equEquipment
* @param equTeamUser
* @return
*/
@Override
@DS("#header.poolName")
public List<EquEquipment> getRepairPersonList(EquEquipment equEquipment) {
return equRepairOrderMapper.getRepairPersonList(equEquipment);
public List<EquTeamUser> getRepairPersonList(EquTeamUser equTeamUser) {
return equRepairOrderMapper.getRepairPersonList(equTeamUser);
}
}

@ -305,4 +305,25 @@
</where>
</select>
<!-- 查询对应检查项id-->
<select id="getIdsByOrderCode" parameterType="EquOrder" resultType="java.lang.String">
select
order_id
from equ_order
where repair_code = #{orderCode}
and del_flag = '0'
</select>
<!-- 更新维修单号 -->
<update id="updateEquOrderRepairCode" parameterType="EquOrder">
update equ_order
<trim prefix="SET" suffixOverrides=",">
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="workCode != null">work_code = #{workCode},</if>
</trim>
where order_id = #{orderId}
</update>
</mapper>

@ -226,7 +226,7 @@
eos.id,
eos.order_code,
eos.standard_name,
eod.item_method,
<!--eod.item_method,-->
eos.detail_up_limit,
eos.detail_down_limit,
eos.detail_unit,

@ -46,6 +46,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="workOutsourcingUnit" column="work_outsourcing_unit" />
<result property="workConnection" column="work_connection" />
<result property="outSourceReason" column="work_reason" />
<!-- 检查项信息 -->
</resultMap>
<resultMap type="com.op.common.core.domain.BaseFileData" id="BaseFileResult">
@ -81,9 +84,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="orderCode != null and orderCode != ''"> and order_code like concat('%', #{orderCode}, '%')</if>
<if test="equipmentCode != null and equipmentCode != ''"> and equipment_code like concat('%', #{equipmentCode}, '%')</if>
<if test="orderDesc != null and orderDesc != ''"> and order_desc like concat('%', #{orderDesc}, '%')</if>
<if test="orderBreakdownTime != null "> and order_breakdown_time = #{orderBreakdownTime}</if>
<!--故障开始时间 结束时间-->
<if test="orderBreakdownTimeStart != null "> and CONVERT(date,order_breakdown_time) >= #{orderBreakdownTimeStart}</if>
<if test="orderBreakdownTimeEnd != null "> and #{orderBreakdownTimeEnd} >= CONVERT(date,order_breakdown_time)</if>
<if test="orderSource != null and orderSource != ''"> and order_source like concat('%', #{orderSource}, '%')</if>
<if test="orderTime != null "> and order_time = #{orderTime}</if>
<!--报修开始时间 结束时间-->
<if test="orderTimeStart != null "> and CONVERT(date,order_time) >= #{orderTimeStart}</if>
<if test="orderTimeEnd != null "> and #{orderTimeEnd} >= CONVERT(date,order_time)</if>
<if test="orderHandle != null and orderHandle != ''"> and order_handle = #{orderHandle}</if>
<if test="orderRepairmanCode != null and orderRepairmanCode != ''"> and order_repairman_code like concat('%', #{orderRepairmanCode}, '%')</if>
<if test="orderRepairmanName != null and orderRepairmanName != ''"> and order_repairman_name like concat('%', #{orderRepairmanName}, '%')</if>
@ -268,7 +275,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
nick_name AS nickName,
CONCAT(nick_name,user_name) AS teamUserName
from sys_user
where del_flag = '0'
<where>
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
and del_flag = '0'
</where>
</select>
<select id="selectEquRepairOrderByRepairCode" parameterType="String" resultMap="EquRepairOrderResult">

Loading…
Cancel
Save