设备管理点巡检记录页面修改,设备维修接口修改

master
马雪伟 5 hours ago
parent 9da65b49f7
commit dd1bc05ee4

@ -117,6 +117,7 @@ public class DmsBillsFaultInstanceController extends BaseController
beanParams.put("applyTime",format.format(faulsts.getApplyTime()));
beanParams.put("deviceName",faulsts.getDeviceName());
beanParams.put("deviceLocation",faulsts.getDeviceLocation());
beanParams.put("deviceCode",faulsts.getDeviceCode());
if (faulsts.getRealBeginTime()!=null){
beanParams.put("realEndTime",format.format(faulsts.getRealEndTime()));
@ -133,7 +134,13 @@ public class DmsBillsFaultInstanceController extends BaseController
beanParams.put("repairContent",faulsts.getRepairContent());
beanParams.put("protectedMethod",faulsts.getProtectedMethod());
beanParams.put("repairer",faulsts.getRepairer());
beanParams.put("repairConfirm",faulsts.getRepairConfirm());
String repairConfirm;
if (faulsts.getRepairConfirm()==2){
repairConfirm = "确认完成";
}else {
repairConfirm = "未完成";
}
beanParams.put("repairConfirm",repairConfirm);
beanParams.put("list",faulsts.getParts());
TemplateExcelUtils.downLoadExcel("维修记录","",beanParams, response);

@ -1,5 +1,6 @@
package com.hw.dms.controller;
import java.util.Date;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
@ -120,6 +121,7 @@ public class DmsBillsInspectInstanceController extends BaseController
dmsBillsInspectInstance.setWfProcessId(105l);
dmsBillsInspectInstance.setInspectType(dmsPlanInspect.getInspectType());
dmsBillsInspectInstance.setPlanBeginTime(dmsPlanInspect.getPlanTime());
dmsBillsInspectInstance.setPlanEndTime(new Date(dmsPlanInspect.getPlanTime().getTime()+dmsPlanInspect.getTimeLimit()*1000l));
dmsBillsInspectInstance.setInspectRouteId(dmsPlanInspect.getInspectRouteId());
dmsBillsInspectInstance.setDeviceAmount(dmsPlanInspect.getDeviceAmount());
dmsBillsInspectInstance.setPerformer(dmsPlanInspect.getPerformer());

@ -1,5 +1,8 @@
package com.hw.dms.controller;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.hw.common.core.constant.DmsConstants;
import com.hw.common.core.domain.R;
import com.hw.common.core.web.controller.BaseController;
@ -21,6 +24,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@ -200,8 +204,14 @@ public class DmsMobileController extends BaseController {
// @RequiresPermissions("qms:checkresultdetail:add")
@Log(title = "故障报修工单", businessType = BusinessType.COMPLETE)
@PostMapping("/completeRepair")
public AjaxResult completeRepair(DmsFaultInstanceActivity dmsFaultInstanceActivity,@RequestParam(value = "files") List<MultipartFile> files) {
List<String> fileUrls = new ArrayList<>();
public AjaxResult completeRepair(DmsFaultInstanceActivity dmsFaultInstanceActivity,@RequestParam(value = "files") List<MultipartFile> files) throws JsonProcessingException {
dmsFaultInstanceActivity.setRepairConfirm(2);
dmsFaultInstanceActivity.setConfirmTime(new Date());
String parts1 = dmsFaultInstanceActivity.getParts1();
ObjectMapper objectMapper = new ObjectMapper();
List<DmsFaultCompentsParts> parts2 = objectMapper.readValue(parts1, new TypeReference<List<DmsFaultCompentsParts>>() {});
dmsFaultInstanceActivity.setParts(parts2);
List < String > fileUrls = new ArrayList<>();
for (MultipartFile file : files) {
R<SysFile> sysFileR = remoteFileService.upload(file);
SysFile sysFile = sysFileR.getData();

@ -108,6 +108,7 @@ public class DmsBillsFaultInstance extends BaseEntity
private List<SysFile> sysFiles;
private List<DmsInstanceFile> dmsInstanceFiles;
private List<DmsInstanceFile> dmsInstanceFiles1;
private String checkedFault;
private String repairContent;
private String protectedMethod;

@ -111,9 +111,11 @@ public class DmsFaultInstanceActivity extends BaseEntity
private Integer repairConfirm;
private Date confirmTime;
private Long componentsPartsId;
private String parts1;
private List<DmsFaultCompentsParts> parts;
private String deviceName;
private String deviceLocation;
private String deviceCode;
private String applyUser;
private Date applyTime;
private Date realBeginTime;

@ -72,7 +72,16 @@ public class DmsRecordInspect extends BaseEntity
/** 是否标识1-是0-否 */
@Excel(name = "是否标识1-是0-否")
private String isFlag;
private Long inspectInstanceId;
public void setInspectInstanceId(Long inspectInstanceId)
{
this.inspectInstanceId = inspectInstanceId;
}
public Long getInspectInstanceId()
{
return inspectInstanceId;
}
public void setRecordInspectId(Long recordInspectId)
{
this.recordInspectId = recordInspectId;

@ -2,6 +2,8 @@ package com.hw.dms.mapper;
import java.util.List;
import com.hw.dms.domain.DmsBillsInspectInstance;
import com.hw.dms.domain.DmsRecordInspect;
import org.apache.ibatis.annotations.Param;
/**
* Mapper
@ -72,4 +74,9 @@ public interface DmsBillsInspectInstanceMapper
public DmsBillsInspectInstance selectNewestDmsBillsInspectInstance(DmsBillsInspectInstance dmsBillsInspectInstance);
DmsRecordInspect selectRecord(@Param("instanceDetailId") Long instanceDetailId);
int insertRecord(DmsRecordInspect dmsRecordInspect);
List<DmsRecordInspect> selectRecordByInstainceId(@Param("inspectInstanceId") Long inspectInstanceId);
}

@ -19,6 +19,7 @@ import com.hw.dms.domain.vo.DmsBillsFaultInstanceScanVo;
import com.hw.dms.mapper.DmsFaultInstanceActivityMapper;
import com.hw.dms.mapper.DmsInstanceFileMapper;
import com.hw.system.api.domain.SysFile;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.dms.mapper.DmsBillsFaultInstanceMapper;
@ -228,6 +229,18 @@ public class DmsBillsFaultInstanceServiceImpl implements IDmsBillsFaultInstanceS
dmsFaultInstanceActivity = dmsBillsFaultInstanceActivityList.get(1);
dmsBillsFaultInstance.setInstanceActivityId(dmsFaultInstanceActivity.getInstanceActivityId());
}
for (DmsFaultInstanceActivity activity : dmsBillsFaultInstanceActivityList) {
DmsFaultInstanceActivity instanceActivity = dmsFaultInstanceActivityMapper.selectDmsFaultInstanceActivityByInstanceActivityId(activity.getInstanceActivityId());
if (instanceActivity.getProcessActivityId()==1021l){
dmsBillsFaultInstance.setCheckedFault(instanceActivity.getCheckedFault());
}else {
dmsBillsFaultInstance.setConfirmTime(instanceActivity.getConfirmTime());
dmsBillsFaultInstance.setRepairContent(instanceActivity.getRepairContent());
dmsBillsFaultInstance.setProtectedMethod(instanceActivity.getProtectedMethod());
dmsBillsFaultInstance.setRepairer(instanceActivity.getRepairer());
dmsBillsFaultInstance.setRepairConfirm(instanceActivity.getRepairConfirm());
}
}
dmsBillsFaultInstance.setFaultType(dmsFaultInstanceActivity.getFaultType());
dmsBillsFaultInstance.setFaultDescription(firstStepActivity.getFaultDescription());
dmsBillsFaultInstance.setDesignOperations(dmsFaultInstanceActivity.getDesignOperations());
@ -241,9 +254,12 @@ public class DmsBillsFaultInstanceServiceImpl implements IDmsBillsFaultInstanceS
DmsInstanceFile queryInstanceFile = new DmsInstanceFile();
// queryInstanceFile.setTargetType(DmsConstants.DMS_INSTANCE_FILE_TARGET_TYPE_FAULT_INSTANCE_ACTIVITY);
queryInstanceFile.setTargetId(firstStepActivity.getInstanceActivityId());
queryInstanceFile.setTargetType("1");
List<DmsInstanceFile> dmsInstanceFiles = dmsInstanceFileMapper.selectDmsInstanceFileList(queryInstanceFile);
queryInstanceFile.setTargetType("2");
List<DmsInstanceFile> dmsInstanceFiles1 = dmsInstanceFileMapper.selectDmsInstanceFileList(queryInstanceFile);
dmsBillsFaultInstance.setDmsInstanceFiles(dmsInstanceFiles);
dmsBillsFaultInstance.setDmsInstanceFiles1(dmsInstanceFiles1);
return dmsBillsFaultInstance;
}
@ -346,8 +362,11 @@ public class DmsBillsFaultInstanceServiceImpl implements IDmsBillsFaultInstanceS
public DmsFaultInstanceActivity selectFaults(Long repairInstanceId) {
List<DmsFaultInstanceActivity> list = dmsBillsFaultInstanceMapper.selectFaults(repairInstanceId);
List<DmsFaultCompentsParts> parts = dmsBillsFaultInstanceMapper.selectParts(repairInstanceId);
list.get(0).setParts(parts);
return list.get(0);
DmsFaultInstanceActivity activity = new DmsFaultInstanceActivity();
BeanUtils.copyProperties(list.get(1),activity);
activity.setCheckedFault(list.get(0).getCheckedFault());
activity.setParts(parts);
return activity;
}
/**

@ -255,7 +255,10 @@ public class DmsBillsInspectInstanceServiceImpl implements IDmsBillsInspectInsta
List<DmsInspectInstanceDetailProject> dmsInspectInstanceDetailProjects = dmsInspectInstanceDetailPrjectMapper.selectDmsInspectInstanceDetailProjectJoinList(queryInspectInstanceDetailProject);
dmsInspectInstanceDetail.setDmsInspectInstanceDetailProjectList(dmsInspectInstanceDetailProjects);
DmsBillsInspectInstance dmsBillsInspectInstance = new DmsBillsInspectInstance();
dmsBillsInspectInstance.setInspectInstanceId(dmsBillsInspectInstanceScanVo.getInspectInstanceId());
dmsBillsInspectInstance.setRealBeginTime(new Date());
int i = dmsBillsInspectInstanceMapper.updateDmsBillsInspectInstance(dmsBillsInspectInstance);
return dmsInspectInstanceDetail;
}
@ -270,6 +273,19 @@ public class DmsBillsInspectInstanceServiceImpl implements IDmsBillsInspectInsta
@Transactional
@Override
public int updateDmsInspectInstanceDetail(DmsInspectInstanceDetail dmsInspectInstanceDetail) {
DmsRecordInspect dmsRecordInspect = dmsBillsInspectInstanceMapper.selectRecord(dmsInspectInstanceDetail.getInstanceDetailId());
List<DmsRecordInspect> recordInspect = dmsBillsInspectInstanceMapper.selectRecordByInstainceId(dmsRecordInspect.getInspectInstanceId());
if (recordInspect!=null&&recordInspect.size()>0){
dmsRecordInspect.setInspectStatus(2l);
}else {
dmsRecordInspect.setInspectStatus(3l);
}
int i1 = dmsBillsInspectInstanceMapper.insertRecord(dmsRecordInspect);
DmsBillsInspectInstance dmsBillsInspectInstance = new DmsBillsInspectInstance();
dmsBillsInspectInstance.setInspectInstanceId(dmsInspectInstanceDetail.getInspectInstanceId());
dmsBillsInspectInstance.setRealEndTime(new Date());
int i = dmsBillsInspectInstanceMapper.updateDmsBillsInspectInstance(dmsBillsInspectInstance);
String userName = SecurityUtils.getUsername();
Date currentDate = new Date();
dmsInspectInstanceDetail.setUpdateTime(currentDate);
@ -283,6 +299,7 @@ public class DmsBillsInspectInstanceServiceImpl implements IDmsBillsInspectInsta
batchUpdateDmsInspectInstanceDetailProject(dmsInspectInstanceDetail);
}
return dmsInspectInstanceDetailMapper.updateDmsInspectInstanceDetail(dmsInspectInstanceDetail);
}

@ -36,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="repairType" column="repair_type" />
<result property="outsrcId" column="outsrc_id" />
<result property="processHandleResolution" column="process_handle_resolution" />
<result property="approveStatus" column="approveStatus" />
</resultMap>
@ -237,7 +238,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectFaultInstanceJoinActivityByRepairInstanceId" parameterType="Long" resultMap="DmsBillsFaultInstanceDmsFaultInstanceActivityResult">
select a.repair_instance_id, a.fault_source_type, a.fault_source_id, a.wf_process_id, a.bills_fault_code, a.bills_status, a.apply_user, a.apply_time, a.real_begin_time, a.real_end_time, a.require_end_time, a.instance_type, a.is_flag, a.remark, a.create_by, a.create_time, a.update_by, a.update_time,a.approveStatus,dbdl.device_code,dbdl.device_name,dbdl.device_location,dbdl.device_spec,
b.instance_activity_id as sub_instance_activity_id, b.repair_instance_id as sub_repair_instance_id, b.process_activity_id as sub_process_activity_id, b.fault_type as sub_fault_type, b.fault_description as sub_fault_description, b.design_operations as sub_design_operations, b.device_id as sub_device_id, b.repair_type as sub_repair_type, b.outsrc_id as sub_outsrc_id, b.process_handle_resolution as sub_process_handle_resolution, b.remark as sub_remark, b.process_handle_status as sub_process_handle_status, b.process_step_order as sub_process_step_order, b.start_time as sub_start_time, b.end_time as sub_end_time, b.handle_user_id as sub_handle_user_id, b.handle_by as sub_handle_by, b.handle_time as sub_handle_time
b.instance_activity_id as sub_instance_activity_id, b.repair_instance_id as sub_repair_instance_id, b.process_activity_id as sub_process_activity_id, b.fault_type as sub_fault_type, b.fault_description as sub_fault_description, b.design_operations as sub_design_operations, b.device_id as sub_device_id, b.repair_type as sub_repair_type, b.outsrc_id as sub_outsrc_id, b.process_handle_resolution as sub_process_handle_resolution, b.remark as sub_remark, b.process_handle_status as sub_process_handle_status, b.process_step_order as sub_process_step_order, b.start_time as sub_start_time, b.end_time as sub_end_time, b.handle_user_id as sub_handle_user_id, b.handle_by as sub_handle_by, b.handle_time as sub_handle_time,
a.approveStatus
from dms_bills_fault_instance a
left join dms_base_device_ledger dbdl on a.device_id=dbdl.device_id
left join dms_fault_instance_activity b on b.repair_instance_id = a.repair_instance_id
@ -265,7 +267,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectFaults" resultType="com.hw.dms.domain.DmsFaultInstanceActivity"
parameterType="java.lang.Long">
select
x.*,a.device_name ,a.device_location ,b.apply_user ,b.apply_time ,b.real_begin_time ,b.real_end_time
x.*,a.device_name ,a.device_code,a.device_location ,b.apply_user ,b.apply_time ,b.real_begin_time ,b.real_end_time
from
`hwjy-cloud`.dms_fault_instance_activity x left join dms_base_device_ledger a on x.device_id = a.device_id
left join dms_bills_fault_instance b on x.repair_instance_id = b.repair_instance_id where x.repair_instance_id = #{repairInstanceId}

@ -118,6 +118,43 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<insert id="insertRecord" parameterType="com.hw.dms.domain.DmsRecordInspect">
insert into dms_record_inspect
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="planInspectId != null">plan_inspect_id,</if>
<if test="billsInspectCode != null">bills_inspect_code,</if>
<if test="planBeginTime != null">plan_begin_time,</if>
<if test="planEndTime != null">plan_end_time,</if>
<if test="realBeginTime != null">real_begin_time,</if>
<if test="realEndTime != null">real_end_time,</if>
<if test="inspectStatus != null">inspect_status,</if>
<if test="inspectType != null and inspectType != ''">inspect_type,</if>
<if test="inspectRouteId != null and inspectRouteId != ''">inspect_route_id,</if>
<if test="deviceAmount != null and deviceAmount != ''">device_amount,</if>
<if test="performer != null and performer != ''">performer,</if>
<if test="remark != null">remark,</if>
<if test="inspectDuration != null">inspect_duration,</if>
<if test="isFlag != null and isFlag != ''">is_flag,</if>
<if test="inspectInstanceId != null and inspectInstanceId != ''">inspect_instance_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="planInspectId != null">#{planInspectId},</if>
<if test="billsInspectCode != null">#{billsInspectCode},</if>
<if test="planBeginTime != null">#{planBeginTime},</if>
<if test="planEndTime != null">#{planEndTime},</if>
<if test="realBeginTime != null">#{realBeginTime},</if>
<if test="realEndTime != null">#{realEndTime},</if>
<if test="inspectStatus != null">#{inspectStatus},</if>
<if test="inspectType != null and inspectType != ''">#{inspectType},</if>
<if test="inspectRouteId != null and inspectRouteId != ''">#{inspectRouteId},</if>
<if test="deviceAmount != null and deviceAmount != ''">#{deviceAmount},</if>
<if test="performer != null and performer != ''">#{performer},</if>
<if test="remark != null">#{remark},</if>
<if test="inspectDuration != null">#{inspectDuration},</if>
<if test="isFlag != null and isFlag != ''">#{isFlag},</if>
<if test="inspectInstanceId != null and inspectInstanceId != ''">#{inspectInstanceId},</if>
</trim>
</insert>
<update id="updateDmsBillsInspectInstance" parameterType="DmsBillsInspectInstance">
update dms_bills_inspect_instance
@ -193,5 +230,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
order by dbii.create_time desc limit 1
</select>
<select id="selectRecord" resultType="com.hw.dms.domain.DmsRecordInspect" parameterType="java.lang.Long">
select
x.inspect_instance_id,
c.plan_inspect_code bills_inspect_code,
c.inspect_type ,
c.device_amount ,
a.plan_begin_time ,
a.plan_end_time ,
a.real_begin_time ,
a.real_end_time ,
b.inspect_route_id inspect_route_id ,
c.performer ,
x.instance_detail_status inspect_status,
c.remark
from
dms_inspect_instance_detail x
left join dms_bills_inspect_instance a on
x.inspect_instance_id = a.inspect_instance_id
left join dms_base_inspect_route b on
a.inspect_route_id = b.inspect_route_id
left join dms_plan_inspect c on
a.plan_inspect_id = c.plan_inspect_id
where
x.instance_detail_id = #{instanceDetailId}
</select>
<select id="selectRecordByInstainceId" resultType="com.hw.dms.domain.DmsRecordInspect"
parameterType="java.lang.Long">
select * from dms_record_inspect where inspect_instance_id = #{inspectInstanceId} and inspect_status != 3
</select>
</mapper>

@ -27,6 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createTime" column="create_time" />
<result property="transferUserId" column="transfer_user_id" />
<result property="attr1" column="attr1" />
<result property="approveStatus" column="approveStatus" />
</resultMap>
<sql id="selectDmsFaultInstanceActivityVo">
@ -58,7 +59,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectDmsFaultInstanceActivityByInstanceActivityId" parameterType="Long" resultMap="DmsFaultInstanceActivityResult">
<include refid="selectDmsFaultInstanceActivityVo"/>
select instance_activity_id, repair_instance_id, process_activity_id, fault_type, fault_description, design_operations, device_id, repair_type, outsrc_id, process_handle_resolution, remark, process_handle_status, process_step_order, start_time, end_time, handle_user_id, handle_by, handle_time, create_by, create_time, transfer_user_id, attr1,checked_fault,
repair_content,
protected_method,
repairer,
repair_confirm,
confirm_time from dms_fault_instance_activity
where instance_activity_id = #{instanceActivityId}
</select>

Loading…
Cancel
Save