设备管理保养,维修,点巡检手持端和web端修改

master
马雪伟 1 day ago
parent 13deb8d814
commit f140892bd9

@ -1,8 +1,14 @@
package com.hw.dms.controller;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.List;
import java.io.IOException;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import com.hw.dms.TemplateExcelUtils;
import com.hw.dms.domain.DmsFaultInstanceActivity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -102,4 +108,34 @@ public class DmsBillsFaultInstanceController extends BaseController
{
return toAjax(dmsBillsFaultInstanceService.deleteDmsBillsFaultInstanceByRepairInstanceIds(repairInstanceIds));
}
@PostMapping("faultRecordExport")
public void faultRecordExport(DmsBillsFaultInstance dmsBillsFaultInstance,HttpServletResponse response) throws Exception {
Map<String, Object> beanParams = new HashMap<>();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
DmsFaultInstanceActivity faulsts = dmsBillsFaultInstanceService.selectFaults(dmsBillsFaultInstance.getRepairInstanceId());
beanParams.put("applyUser",faulsts.getApplyUser());
beanParams.put("applyTime",format.format(faulsts.getApplyTime()));
beanParams.put("deviceName",faulsts.getDeviceName());
beanParams.put("deviceLocation",faulsts.getDeviceLocation());
if (faulsts.getRealBeginTime()!=null){
beanParams.put("realEndTime",format.format(faulsts.getRealEndTime()));
}
if (faulsts.getRealEndTime()!=null){
beanParams.put("realBeginTime",format.format(faulsts.getRealBeginTime()));
}
if (faulsts.getConfirmTime()!=null){
beanParams.put("confirmTime",format.format(faulsts.getConfirmTime()));
}
// beanParams.put("realEndTime",format.format(faulsts.getRealEndTime()));
beanParams.put("faultDescription",faulsts.getFaultDescription());
beanParams.put("checkedFault",faulsts.getCheckedFault());
beanParams.put("repairContent",faulsts.getRepairContent());
beanParams.put("protectedMethod",faulsts.getProtectedMethod());
beanParams.put("repairer",faulsts.getRepairer());
beanParams.put("repairConfirm",faulsts.getRepairConfirm());
beanParams.put("list",faulsts.getParts());
TemplateExcelUtils.downLoadExcel("维修记录","",beanParams, response);
}
}

@ -3,6 +3,9 @@ package com.hw.dms.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import com.hw.dms.domain.DmsBaseMaintStation;
import com.hw.dms.service.IDmsBaseMaintStationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -34,6 +37,8 @@ public class DmsMaintInstanceActivityController extends BaseController
{
@Autowired
private IDmsMaintInstanceActivityService dmsMaintInstanceActivityService;
@Autowired
private IDmsBaseMaintStationService dmsBaseMaintStationService;
/**
*
@ -43,7 +48,8 @@ public class DmsMaintInstanceActivityController extends BaseController
public TableDataInfo list(DmsMaintInstanceActivity dmsMaintInstanceActivity)
{
startPage();
List<DmsMaintInstanceActivity> list = dmsMaintInstanceActivityService.selectDmsMaintInstanceActivityList(dmsMaintInstanceActivity);
// List<DmsMaintInstanceActivity> list = dmsMaintInstanceActivityService.selectDmsMaintInstanceActivityList(dmsMaintInstanceActivity);
List<DmsMaintInstanceActivity> list = dmsBaseMaintStationService.selectDmsMaintInfo(dmsMaintInstanceActivity.getMaintInstanceId());
return getDataTable(list);
}

@ -14,6 +14,7 @@ import com.hw.dms.service.*;
import com.hw.system.api.RemoteFileService;
import com.hw.system.api.domain.SysFile;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@ -119,7 +120,7 @@ public class DmsMobileController extends BaseController {
// @RequiresPermissions("qms:checkrule:list")
@GetMapping("/getBillsFaultInstances")
public TableDataInfo getBillsFaultInstances() {
startPage();
// startPage();
DmsBillsFaultInstance queryBillsFaultInstance = new DmsBillsFaultInstance();
List<DmsBillsFaultInstance> billsFaultInstances = dmsBillsFaultInstanceService.selectDmsBillsFaultInstanceJoinList(queryBillsFaultInstance);
return getDataTable(billsFaultInstances);
@ -146,12 +147,14 @@ public class DmsMobileController extends BaseController {
public AjaxResult updateFaultInstanceActivity(DmsFaultInstanceActivity dmsFaultInstanceActivity,
@RequestParam(value = "files") List<MultipartFile> files) {
List<String> fileUrls = new ArrayList<>();
if (!CollectionUtils.isEmpty(files)){
for (MultipartFile file : files) {
R<SysFile> sysFileR = remoteFileService.upload(file);
SysFile sysFile = sysFileR.getData();
fileUrls.add(sysFile.getUrl());
}
dmsFaultInstanceActivity.setFileUrls(fileUrls);
}
return success(dmsBillsFaultInstanceService.updateDmsFaultInstanceActivity(dmsFaultInstanceActivity));
}
@ -197,7 +200,14 @@ public class DmsMobileController extends BaseController {
// @RequiresPermissions("qms:checkresultdetail:add")
@Log(title = "故障报修工单", businessType = BusinessType.COMPLETE)
@PostMapping("/completeRepair")
public AjaxResult completeRepair(@RequestBody DmsFaultInstanceActivity dmsFaultInstanceActivity) {
public AjaxResult completeRepair(DmsFaultInstanceActivity dmsFaultInstanceActivity,@RequestParam(value = "files") List<MultipartFile> files) {
List<String> fileUrls = new ArrayList<>();
for (MultipartFile file : files) {
R<SysFile> sysFileR = remoteFileService.upload(file);
SysFile sysFile = sysFileR.getData();
fileUrls.add(sysFile.getUrl());
}
dmsFaultInstanceActivity.setFileUrls(fileUrls);
return success(dmsBillsFaultInstanceService.completeRepair(dmsFaultInstanceActivity));
}

@ -5,6 +5,7 @@ import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hw.system.api.domain.SysFile;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.hw.common.core.annotation.Excel;
@ -16,6 +17,7 @@ import com.hw.common.core.web.domain.BaseEntity;
* @author Open Platform
* @date 2024-01-23
*/
@Data
public class DmsBillsFaultInstance extends BaseEntity
{
private static final long serialVersionUID = 1L;
@ -106,6 +108,15 @@ public class DmsBillsFaultInstance extends BaseEntity
private List<SysFile> sysFiles;
private List<DmsInstanceFile> dmsInstanceFiles;
private String checkedFault;
private String repairContent;
private String protectedMethod;
private String repairer;
private String approveStatus;
private Integer repairConfirm;
private Date confirmTime;
private Long componentsPartsId;
private List<DmsFaultCompentsParts> parts;
public Long getInstanceActivityId() {
return instanceActivityId;

@ -81,6 +81,15 @@ public class DmsBillsInspectInstance extends BaseEntity
/**多个状态时使用,以,隔开*/
private String inspectStatusStr;
private String planInspectCode;
private String inspectDesc;
public String getInspectDesc()
{
return inspectDesc;
}
public void setInspectDesc(String inspectDesc)
{
this.inspectDesc = inspectDesc;
}
public String getPlanInspectCode()
{
return planInspectCode;

@ -71,8 +71,24 @@ public class DmsBillsMaintInstance extends BaseEntity
private String maintSupervisor;
private String maintStatusStr;
private String maintLevelName;
private String maintProtocol;
public String getMaintProtocol() {
return maintProtocol;
}
public void setMaintProtocol(String maintProtocol) {
this.maintProtocol = maintProtocol;
}
private List<DmsBillsMaintDetail> dmsBillsMaintDetailList;
public String getMaintLevelName() {
return maintLevelName;
}
public void setMaintLevelName(String maintLevelName) {
this.maintLevelName = maintLevelName;
}
public Long getMaintLevel() {
return maintLevel;

@ -4,6 +4,7 @@ import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.hw.common.core.annotation.Excel;
@ -15,6 +16,7 @@ import com.hw.common.core.web.domain.BaseEntity;
* @author Open Platform
* @date 2024-02-27
*/
@Data
public class DmsFaultInstanceActivity extends BaseEntity
{
private static final long serialVersionUID = 1L;
@ -57,6 +59,7 @@ public class DmsFaultInstanceActivity extends BaseEntity
/** 处理意见;第一步不显示从第2个步骤开始显示此字段 */
@Excel(name = "处理意见;第一步不显示从第2个步骤开始显示此字段")
private String processHandleResolution;
private String faultSourceType;
/** 状态(0已结束1执行中2、待接取3、已转发 */
@Excel(name = "状态(0已结束1执行中2、待接取3、已转发")
@ -101,6 +104,20 @@ public class DmsFaultInstanceActivity extends BaseEntity
private List<String> fileUrls;
private List<DmsInstanceFile> dmsInstanceFileList;
private String checkedFault;
private String repairContent;
private String protectedMethod;
private String repairer;
private Integer repairConfirm;
private Date confirmTime;
private Long componentsPartsId;
private List<DmsFaultCompentsParts> parts;
private String deviceName;
private String deviceLocation;
private String applyUser;
private Date applyTime;
private Date realBeginTime;
private Date realEndTime;
public Long getWfLength() {
return wfLength;

@ -61,8 +61,18 @@ public class DmsInspectInstanceDetailProject extends BaseEntity
@Excel(name = "巡检描述")
private String inspectProjectDesc;
private String inspectDesc;
private Long deviceId;
public void setInspectDesc(String inspectDesc)
{
this.inspectDesc = inspectDesc;
}
public String getInspectDesc()
{
return inspectDesc;
}
public void setInstanceDetailProjectId(Long instanceDetailProjectId)
{

@ -83,6 +83,15 @@ public class DmsMaintInstanceActivity extends BaseEntity
@Excel(name = "用户预留1")
private String attr1;
private Long wfLength;
private String remark;
public String getRemark()
{
return remark;
}
public void setRemark(String remark)
{
this.remark = remark;
}
public Long getWfLength() {
return wfLength;

@ -2,6 +2,7 @@ package com.hw.dms.mapper;
import java.util.List;
import com.hw.dms.domain.DmsBaseMaintStation;
import com.hw.dms.domain.DmsMaintInstanceActivity;
/**
* Mapper
@ -58,4 +59,6 @@ public interface DmsBaseMaintStationMapper
* @return
*/
public int deleteDmsBaseMaintStationByMaintStationIds(Long[] maintStationIds);
List<DmsMaintInstanceActivity> selectDmsMainInfo(Long maintInstanceId);
}

@ -2,6 +2,8 @@ package com.hw.dms.mapper;
import java.util.List;
import com.hw.dms.domain.DmsBillsFaultInstance;
import com.hw.dms.domain.DmsFaultCompentsParts;
import com.hw.dms.domain.DmsFaultInstanceActivity;
import org.apache.ibatis.annotations.Param;
/**
@ -99,6 +101,10 @@ public interface DmsBillsFaultInstanceMapper
* @return
*/
public DmsBillsFaultInstance selectFaultInstanceJoinFirstById(Long repairInstanceId);
List<DmsFaultInstanceActivity> selectFaults(@Param("repairInstanceId") Long repairInstanceId);
List<DmsFaultCompentsParts> selectParts(@Param("repairInstanceId")Long repairInstanceId);
}

@ -6,6 +6,7 @@ import java.util.List;
import com.hw.dms.domain.DmsBillsMaintDetail;
import com.hw.dms.domain.DmsBillsMaintDetailProject;
import com.hw.dms.domain.DmsBillsMaintInstance;
import com.hw.dms.domain.DmsMaintInstanceActivity;
/**
* Mapper
@ -83,4 +84,5 @@ public interface DmsBillsMaintInstanceMapper {
int batchDmsProject(List<DmsBillsMaintDetailProject> list);
List<DmsMaintInstanceActivity> selectDmsMaintInfo(Long maintInstanceId);
}

@ -1,7 +1,10 @@
package com.hw.dms.mapper;
import java.util.List;
import com.hw.dms.domain.DmsFaultCompentsParts;
import com.hw.dms.domain.DmsFaultInstanceActivity;
import org.apache.ibatis.annotations.Param;
/**
* Mapper
@ -61,4 +64,12 @@ public interface DmsFaultInstanceActivityMapper
Long[] selectUserIdByDmsFaultInstanceActivity(Long repairInstanceId);
DmsFaultInstanceActivity selectDmsFaultInstanceActivityByRepairIdMin(Long repairInstanceId);
List<DmsFaultCompentsParts> selectPartsById(@Param("repairInstanceId") Long repairInstanceId);
int insertParts(List<DmsFaultCompentsParts> parts);
int deleteByTargetId(@Param("activityId") Long activityId);
Long selectRepairInstanceId(@Param("activityId")Long activityId);
}

@ -2,6 +2,7 @@ package com.hw.dms.mapper;
import java.util.List;
import com.hw.dms.domain.DmsMaintInstanceActivity;
import org.apache.ibatis.annotations.Param;
/**
* Mapper
@ -60,4 +61,6 @@ public interface DmsMaintInstanceActivityMapper
public int deleteDmsMaintInstanceActivityByInstanceActivityIds(Long[] instanceActivityIds);
Long[] selectUserIdByDmsMaintInstanceActivityId(Long maintInstanceId);
// List<DmsMaintInstanceActivity> selectDmsMaintInfo(@Param("maintInstanceId") Long maintInstanceId);
}

@ -2,6 +2,7 @@ package com.hw.dms.service;
import java.util.List;
import com.hw.dms.domain.DmsBaseMaintStation;
import com.hw.dms.domain.DmsMaintInstanceActivity;
/**
* Service
@ -58,4 +59,8 @@ public interface IDmsBaseMaintStationService
* @return
*/
public int deleteDmsBaseMaintStationByMaintStationId(Long maintStationId);
List<DmsMaintInstanceActivity> selectDmsMaintInfo(Long maintInstanceId);
}

@ -109,4 +109,6 @@ public interface IDmsBillsFaultInstanceService
* @return
*/
public int completeRepair(DmsFaultInstanceActivity dmsFaultInstanceActivity);
DmsFaultInstanceActivity selectFaults(Long repairInstanceId);
}

@ -62,4 +62,5 @@ public interface IDmsMaintInstanceActivityService
boolean selectUserIdByDmsMaintInstanceActivityId(Long maintInstanceId,Long userId);
List<DmsMaintInstanceActivity> selectDmsMaintInfo(Long maintInstanceId);
}

@ -170,6 +170,11 @@ public class DmsBaseMaintStationServiceImpl implements IDmsBaseMaintStationServi
return dmsBaseMaintStationMapper.deleteDmsBaseMaintStationByMaintStationIds(maintStationIds);
}
@Override
public List<DmsMaintInstanceActivity> selectDmsMaintInfo(Long maintInstanceId) {
return dmsBaseMaintStationMapper.selectDmsMainInfo(maintInstanceId);
}
/**
*
*

@ -2,6 +2,7 @@ package com.hw.dms.service.impl;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
@ -11,6 +12,7 @@ import com.hw.common.core.exception.ServiceException;
import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.uuid.Seq;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.dms.domain.DmsFaultCompentsParts;
import com.hw.dms.domain.DmsFaultInstanceActivity;
import com.hw.dms.domain.DmsInstanceFile;
import com.hw.dms.domain.vo.DmsBillsFaultInstanceScanVo;
@ -23,6 +25,7 @@ import com.hw.dms.mapper.DmsBillsFaultInstanceMapper;
import com.hw.dms.domain.DmsBillsFaultInstance;
import com.hw.dms.service.IDmsBillsFaultInstanceService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
/**
* Service
@ -213,6 +216,9 @@ public class DmsBillsFaultInstanceServiceImpl implements IDmsBillsFaultInstanceS
@Override
public DmsBillsFaultInstance getDmsBillsFaultInstance4Repair(Long repairInstanceId) {
DmsBillsFaultInstance dmsBillsFaultInstance = dmsBillsFaultInstanceMapper.selectFaultInstanceJoinActivityByRepairInstanceId(repairInstanceId);
Long repairInstanceId1 = dmsBillsFaultInstance.getRepairInstanceId();
List<DmsFaultCompentsParts> parts = dmsFaultInstanceActivityMapper.selectPartsById(repairInstanceId1);
dmsBillsFaultInstance.setParts(parts);
List<DmsFaultInstanceActivity> dmsBillsFaultInstanceActivityList = dmsBillsFaultInstance.getDmsFaultInstanceActivityList();
DmsFaultInstanceActivity firstStepActivity = dmsBillsFaultInstanceActivityList.get(0);
DmsFaultInstanceActivity dmsFaultInstanceActivity;
@ -233,7 +239,7 @@ public class DmsBillsFaultInstanceServiceImpl implements IDmsBillsFaultInstanceS
dmsBillsFaultInstance.setDmsFaultInstanceActivityList(null);
DmsInstanceFile queryInstanceFile = new DmsInstanceFile();
queryInstanceFile.setTargetType(DmsConstants.DMS_INSTANCE_FILE_TARGET_TYPE_FAULT_INSTANCE_ACTIVITY);
// queryInstanceFile.setTargetType(DmsConstants.DMS_INSTANCE_FILE_TARGET_TYPE_FAULT_INSTANCE_ACTIVITY);
queryInstanceFile.setTargetId(firstStepActivity.getInstanceActivityId());
List<DmsInstanceFile> dmsInstanceFiles = dmsInstanceFileMapper.selectDmsInstanceFileList(queryInstanceFile);
dmsBillsFaultInstance.setDmsInstanceFiles(dmsInstanceFiles);
@ -251,7 +257,17 @@ public class DmsBillsFaultInstanceServiceImpl implements IDmsBillsFaultInstanceS
@Override
@Transactional(rollbackFor = Exception.class)
public int updateDmsFaultInstanceActivity(DmsFaultInstanceActivity dmsFaultInstanceActivity) {
List<String> fileUrls = dmsFaultInstanceActivity.getFileUrls();
Long activityId = dmsFaultInstanceActivity.getInstanceActivityId();
Long repairInstanceId = dmsFaultInstanceActivityMapper.selectRepairInstanceId(activityId);
DmsBillsFaultInstance dmsBillsFaultInstance = new DmsBillsFaultInstance();
dmsBillsFaultInstance.setOutsrcId(dmsFaultInstanceActivity.getOutsrcId());
dmsBillsFaultInstance.setFaultSourceType(dmsFaultInstanceActivity.getFaultSourceType());
dmsBillsFaultInstance.setFaultType(dmsFaultInstanceActivity.getFaultType());
dmsBillsFaultInstance.setRepairInstanceId(repairInstanceId);
int i = dmsBillsFaultInstanceMapper.updateDmsBillsFaultInstance(dmsBillsFaultInstance);
int rows = dmsFaultInstanceActivityMapper.deleteByTargetId(activityId);
batchInsertInstanceFiles(fileUrls,activityId);
return dmsFaultInstanceActivityMapper.updateDmsFaultInstanceActivity(dmsFaultInstanceActivity);
}
@ -326,6 +342,14 @@ public class DmsBillsFaultInstanceServiceImpl implements IDmsBillsFaultInstanceS
}
@Override
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);
}
/**
*
*
@ -335,6 +359,14 @@ public class DmsBillsFaultInstanceServiceImpl implements IDmsBillsFaultInstanceS
@Override
@Transactional(rollbackFor = Exception.class)
public int completeRepair(DmsFaultInstanceActivity dmsFaultInstanceActivity) {
batchInsertInstanceAfterFiles(dmsFaultInstanceActivity.getFileUrls(),dmsFaultInstanceActivity.getInstanceActivityId());
List<DmsFaultCompentsParts> parts = dmsFaultInstanceActivity.getParts();
if (!CollectionUtils.isEmpty(parts)){
for (DmsFaultCompentsParts part : parts) {
part.setFaultId(dmsFaultInstanceActivity.getRepairInstanceId());
}
dmsFaultInstanceActivityMapper.insertParts(parts);
}
DmsBillsFaultInstance dmsBillsFaultInstance = dmsBillsFaultInstanceMapper.
selectDmsBillsFaultInstanceByRepairInstanceId(dmsFaultInstanceActivity.getRepairInstanceId());
String dmsBillsStatus = dmsBillsFaultInstance.getBillsStatus();
@ -378,6 +410,19 @@ public class DmsBillsFaultInstanceServiceImpl implements IDmsBillsFaultInstanceS
dmsInstanceFileMapper.batchDmsInstanceFile(dmsInstanceFiles);
}
}
public void batchInsertInstanceAfterFiles(List<String> fileUrls, Long instanceActivityId) {
if (fileUrls != null && !fileUrls.isEmpty()) {
List<DmsInstanceFile> dmsInstanceFiles = new ArrayList<>();
for (String fileUrl : fileUrls) {
DmsInstanceFile dmsInstanceFile = new DmsInstanceFile();
dmsInstanceFile.setTargetId(instanceActivityId);
dmsInstanceFile.setTargetType("2");
dmsInstanceFile.setFilePath(fileUrl);
dmsInstanceFiles.add(dmsInstanceFile);
}
dmsInstanceFileMapper.batchDmsInstanceFile(dmsInstanceFiles);
}
}
}

@ -228,7 +228,7 @@ public class DmsBillsInspectInstanceServiceImpl implements IDmsBillsInspectInsta
List<DmsInspectInstanceDetail> inspectInstanceDetails = dmsInspectInstanceDetailMapper.selectDmsInspectInstanceDetailJoinList(queryInspectInstanceDetail);
newestBillsInspectInstance.setDmsInspectInstanceDetailList(inspectInstanceDetails);
}
newestBillsInspectInstance.setBillsInspectCode(newestBillsInspectInstance.getPlanInspectCode());
return newestBillsInspectInstance;
}

@ -98,7 +98,10 @@ public class DmsBillsMaintInstanceServiceImpl implements IDmsBillsMaintInstanceS
dmsBillsMaintInstance.setWfProcessId(103l);
dmsBillsMaintInstance.setPlanEndTime(new Date(lubeTime.getTime() + timeLimit * 1000l));
int i = dmsBillsMaintInstanceMapper.insertDmsBillsMaintInstance(dmsBillsMaintInstance);
DmsMaintInstanceActivity dmsMaintInstanceActivity = new DmsMaintInstanceActivity();
dmsMaintInstanceActivity.setMaintInstanceId(dmsBillsMaintInstance.getMaintInstanceId());
dmsMaintInstanceActivity.setProcessStepOrder(1L);
int i1 = dmsMaintInstanceActivityMapper.insertDmsMaintInstanceActivity(dmsMaintInstanceActivity);
batchInsertDmsBillsMaintDetail(dmsPlanMaint, dmsBillsMaintInstance.getMaintInstanceId());
return i;
}
@ -206,7 +209,10 @@ public class DmsBillsMaintInstanceServiceImpl implements IDmsBillsMaintInstanceS
List<DmsBillsMaintDetail> dmsBillsMaintDetails = dmsBillsMaintDetailMapper.selectDmsBillsMaintDetailJoinList(queryBillsMaintDetail);
newestBillsMaintInstance.setDmsBillsMaintDetailList(dmsBillsMaintDetails);
}
Long maintLevel = newestBillsMaintInstance.getMaintLevel();
if (maintLevel == 1){
newestBillsMaintInstance.setMaintLevelName("日常保养");
}
return newestBillsMaintInstance;
}

@ -156,10 +156,19 @@ public class DmsMaintInstanceActivityServiceImpl implements IDmsMaintInstanceAct
return dmsMaintInstanceActivityMapper.deleteDmsMaintInstanceActivityByInstanceActivityId(instanceActivityId);
}
@Override
public boolean selectUserIdByDmsMaintInstanceActivityId(Long maintInstanceId, Long userId) {
Long[] longs = dmsMaintInstanceActivityMapper.selectUserIdByDmsMaintInstanceActivityId(maintInstanceId);
boolean contains = Arrays.asList(longs).contains(userId);
return contains;
}
@Override
public List<DmsMaintInstanceActivity> selectDmsMaintInfo(Long maintInstanceId) {
return null;
}
}

@ -62,6 +62,8 @@ public class DmsPlanMaintDetailServiceImpl implements IDmsPlanMaintDetailService
dmsPlanMaintDetail.setIsFlag(1l);
Long stationId = dmsPlanMaintDetailMapper.selectStationIdByCode(dmsPlanMaintDetail.getMaintStationCode());
dmsPlanMaintDetail.setMaintStationId(stationId);
Long standardId = dmsPlanMaintDetailMapper.selectStandardId(stationId);
dmsPlanMaintDetail.setMaintStandardId(standardId);
return dmsPlanMaintDetailMapper.insertDmsPlanMaintDetail(dmsPlanMaintDetail);
}

@ -39,6 +39,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectDmsBaseMaintStationVo"/>
where maint_station_id = #{maintStationId}
</select>
<select id="selectDmsMainInfo" resultType="com.hw.dms.domain.DmsMaintInstanceActivity"
parameterType="java.lang.Long">
select
a.maint_level,
a.maint_group,
a.maint_supervisor,
a.remark
from
`hwjy-cloud`.dms_bills_maint_instance x
left join dms_plan_maint a on
x.plan_maint_id = a.plan_maint_id
where
x.maint_instance_id = #{maintInstanceId}
</select>
<insert id="insertDmsBaseMaintStation" parameterType="DmsBaseMaintStation" useGeneratedKeys="true" keyProperty="maintStationId">
insert into dms_base_maint_station

@ -71,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectDmsBillsFaultInstanceVo">
select repair_instance_id, fault_source_type, fault_source_id, wf_process_id, bills_fault_code, bills_status, apply_user, apply_time, real_begin_time, real_end_time, require_end_time, instance_type, is_flag, remark, create_by, create_time, update_by, update_time,device_id from dms_bills_fault_instance
select repair_instance_id, fault_source_type, fault_source_id, wf_process_id, bills_fault_code, bills_status, apply_user, apply_time, real_begin_time, real_end_time, require_end_time, instance_type, is_flag, remark, create_by, create_time, update_by, update_time,device_id,approveStatus from dms_bills_fault_instance
</sql>
<select id="selectDmsBillsFaultInstanceList" parameterType="DmsBillsFaultInstance" resultMap="DmsBillsFaultInstanceResult">
@ -151,6 +151,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="wfProcessId != null">wf_process_id = #{wfProcessId},</if>
<if test="billsFaultCode != null and billsFaultCode != ''">bills_fault_code = #{billsFaultCode},</if>
<if test="billsStatus != null and billsStatus != ''">bills_status = #{billsStatus},</if>
<if test="faultSourceType != null and faultSourceType != ''">fault_source_type = #{faultSourceType},</if>
<if test="applyUser != null">apply_user = #{applyUser},</if>
<if test="applyTime != null">apply_time = #{applyTime},</if>
<if test="realBeginTime != null">real_begin_time = #{realBeginTime},</if>
@ -164,6 +165,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="deviceId != null">device_id = #{deviceId},</if>
<if test="approveStatus != null">approveStatus = #{approveStatus},</if>
</trim>
where repair_instance_id = #{repairInstanceId}
</update>
@ -190,7 +192,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectDmsBillsFaultInstanceJoinVo">
select dbfi.repair_instance_id, dbfi.fault_source_type, dbfi.fault_source_id, dbfi.wf_process_id, dbfi.bills_fault_code, dbfi.bills_status,
dbfi.apply_user, dbfi.apply_time, dbfi.real_begin_time, dbfi.real_end_time, dbfi.require_end_time, dbfi.device_id,
dbfi.apply_user, dbfi.apply_time, dbfi.real_begin_time, dbfi.real_end_time, dbfi.require_end_time, dbfi.device_id,dbfi.approveStatus,
dbdl.device_code,dbdl.device_name,dbdl.device_location,dbdl.device_spec
from dms_bills_fault_instance dbfi left join dms_base_device_ledger dbdl on dbfi.device_id=dbdl.device_id
</sql>
@ -218,9 +220,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectFaultInstanceJoinFirstAndDeviceById" parameterType="Long" resultMap="DmsBillsFaultInstanceResult">
select dbfi.repair_instance_id, dbfi.fault_source_type, dbfi.fault_source_id, dbfi.wf_process_id, dbfi.bills_fault_code, dbfi.bills_status,
dbfi.apply_user, dbfi.apply_time, dbfi.real_begin_time, dbfi.real_end_time, dbfi.require_end_time, dbfi.device_id,
dbfi.apply_user, dbfi.apply_time, dbfi.real_begin_time, dbfi.real_end_time, dbfi.require_end_time, dbfi.device_id,dbfi.approveStatus,
dbdl.device_code,dbdl.device_name,dbdl.device_location,dbdl.device_spec,
dfia.instance_activity_id,dfia.fault_type,dfia.fault_description,dfia.design_operations,dfia.repair_type,dfia.outsrc_id,dfia.process_handle_resolution
,dfia.checked_fault checked_fault,
dfia.repair_content repair_content,
dfia.protected_method protected_method,
dfia.repairer repairer,
dfia.repair_confirm repair_confirm,
dfia.confirm_time confirm_time,dfia.components_parts_id components_parts_id
from dms_bills_fault_instance dbfi left join dms_base_device_ledger dbdl on dbfi.device_id=dbdl.device_id
left join dms_fault_instance_activity dfia on dbfi.repair_instance_id=dfia.repair_instance_id
where dbfi.repair_instance_id = #{repairInstanceId} and dfia.process_step_order=1
@ -228,11 +236,12 @@ 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,dbdl.device_code,dbdl.device_name,dbdl.device_location,dbdl.device_spec,
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
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
where a.repair_instance_id = #{repairInstanceId} order by b.process_step_order
</select>
@ -253,6 +262,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join dms_fault_instance_activity dfia on dbfi.repair_instance_id=dfia.repair_instance_id
where dbfi.repair_instance_id = #{repairInstanceId} and dfia.process_step_order=1
</select>
<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
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}
</select>
<select id="selectParts" resultType="com.hw.dms.domain.DmsFaultCompentsParts"
parameterType="java.lang.Long">
SELECT x.* FROM `hwjy-cloud`.dms_fault_compents_parts x where x.fault_id = #{repairInstanceId}
</select>
</mapper>

@ -175,7 +175,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
dbii.real_end_time,
dbii.inspect_status,
dbii.create_time,
dbir.route_name,a.plan_inspect_code
dbir.route_name,a.plan_inspect_code,
a.remark inspectDesc
from
dms_bills_inspect_instance dbii
left join dms_base_inspect_route dbir on

@ -125,17 +125,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectDmsBillsMaintDetailJoinVo">
select dbmd.bills_maint_detail_id, dbmd.maint_instance_id, dbmd.device_id, dbmd.station_id, dbmd.maint_standard_id,
dbmd.operation_description, dbmd.maint_status,
dbdl.device_code,dbdl.device_name,
select
dbmd.bills_maint_detail_id,
dbmd.maint_instance_id,
dbmd.device_id,
dbmd.station_id,
dbmd.maint_standard_id,
dbmd.operation_description,
dbmd.maint_status,
dbdl.device_code,
dbdl.device_name,
dbdt.type_name,
dbms.maint_station_name,
dbmsd.maint_protocol,dbmsd.operation_description as maint_operation_description
from dms_bills_maint_detail dbmd
left join dms_base_device_ledger dbdl on dbmd.device_id=dbdl.device_id
left join dms_base_device_type dbdt on dbdl.device_type_id=dbdt.device_type_id
left join dms_base_maint_station dbms on dbmd.station_id = dbms.maint_station_id
left join dms_base_maint_standard dbmsd on dbmd.maint_standard_id = dbmsd.maint_standard_id
dbms.maint_station_code maint_station_name,
dbmsd.maint_protocol,
dbmsd.operation_description as maint_operation_description
from
dms_bills_maint_detail dbmd
left join dms_base_device_ledger dbdl on
dbmd.device_id = dbdl.device_id
left join dms_base_device_type dbdt on
dbdl.device_type_id = dbdt.device_type_id
left join dms_base_maint_station dbms on
dbmd.station_id = dbms.maint_station_id
left join dms_base_maint_standard dbmsd on
dbmd.maint_standard_id = dbmsd.maint_standard_id
</sql>
<select id="selectDmsBillsMaintDetailJoinList" parameterType="DmsBillsMaintDetail" resultMap="DmsBillsMaintDetailResult">

@ -164,14 +164,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</insert>
<select id="selectNewestDmsBillsMaintInstance" parameterType="DmsBillsMaintInstance" resultMap="DmsBillsMaintInstanceResult">
select dbmi.maint_instance_id, dbmi.plan_maint_id, dbmi.wf_process_id, dbmi.bills_maint_code, dbmi.plan_begin_time, dbmi.real_begin_time,
dbmi.plan_end_time, dbmi.real_end_time, dbmi.maint_status, dbmi.maint_comp_rate, dbmi.create_by, dbmi.create_time,
dbmi.maint_level,dbmi.maint_group,dbmi.maint_supervisor
from dms_bills_maint_instance dbmi
select
dbmi.maint_instance_id,
dbmi.plan_maint_id,
dbmi.wf_process_id,
dbmi.bills_maint_code,
dbmi.plan_begin_time,
dbmi.real_begin_time,
dbmi.plan_end_time,
dbmi.real_end_time,
dbmi.maint_status,
dbmi.maint_comp_rate,
dbmi.create_by,
dbmi.create_time,
a.maint_level,
a.maint_group,
a.maint_supervisor
from
dms_bills_maint_instance dbmi left join dms_plan_maint a on dbmi.plan_maint_id = a.plan_maint_id
<where>
<if test="maintStatusStr != null and maintStatusStr != ''"> and dbmi.maint_status in (${maintStatusStr})</if>
</where>
order by dbmi.create_time desc limit 1
</select>
<select id="selectDmsMaintInfo" resultType="com.hw.dms.domain.DmsMaintInstanceActivity"
parameterType="java.lang.Long">
select
a.maint_level,
a.maint_group,
a.maint_supervisor,
a.remark
from
`hwjy-cloud`.dms_bills_maint_instance x
left join dms_plan_maint a on
x.plan_maint_id = a.plan_maint_id
where
x.maint_instance_id = 25
</select>
</mapper>

@ -111,6 +111,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="attr1 != null">#{attr1},</if>
</trim>
</insert>
<insert id="insertParts" parameterType="java.util.List">
insert into dms_fault_compents_parts(fault_id,part_name,part_specifications,amount)
values
<foreach collection="list" item="item" index="index" open="" close="" separator=",">
(#{item.faultId},#{item.partName},#{item.partSpecifications},#{item.amount})
</foreach>
</insert>
<update id="updateDmsFaultInstanceActivity" parameterType="DmsFaultInstanceActivity">
update dms_fault_instance_activity
@ -136,6 +143,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time = #{createTime},</if>
<if test="transferUserId != null">transfer_user_id = #{transferUserId},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="checkedFault != null">checked_fault = #{checkedFault},</if>
<if test="repairContent != null">repair_content = #{repairContent},</if>
<if test="protectedMethod != null">protected_method = #{protectedMethod},</if>
<if test="repairer != null">repairer = #{repairer},</if>
<if test="repairConfirm != null">repair_confirm = #{repairConfirm},</if>
<if test="confirmTime != null">confirm_time = #{confirmTime},</if>
<if test="componentsPartsId != null">components_parts_id = #{componentsPartsId},</if>
</trim>
where instance_activity_id = #{instanceActivityId}
</update>
@ -150,6 +164,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{instanceActivityId}
</foreach>
</delete>
<delete id="deleteByTargetId" parameterType="java.lang.Long">
delete FROM `hwjy-cloud`.dms_instance_file where target_id =#{activityId}
</delete>
<!-- 先查询出该工单审批到了第几步然后根据步骤查询拥有权限的对象id集合 -->
<select id="selectUserIdByDmsFaultInstanceActivity" parameterType="Long" resultType="java.lang.Long">
select auth_target_id from wf_process_activity_auth where process_activity_id =(
@ -162,4 +179,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectDmsFaultInstanceActivityByRepairIdMin" parameterType="Long" resultMap="DmsFaultInstanceActivityResult">
select * from dms_fault_instance_activity where instance_activity_id = (select min(instance_activity_id) FROM dms_fault_instance_activity where repair_instance_id = #{repairInstanceId})
</select>
<select id="selectPartsById" resultType="com.hw.dms.domain.DmsFaultCompentsParts"
parameterType="java.lang.Long">
SELECT x.* FROM `hwjy-cloud`.dms_fault_compents_parts x where x.fault_id = #{repairInstanceId}
</select>
<select id="selectRepairInstanceId" resultType="java.lang.Long" parameterType="java.lang.Long">
SELECT x.repair_instance_id FROM `hwjy-cloud`.dms_fault_instance_activity x where x.instance_activity_id =#{activityId}
</select>
</mapper>

@ -114,9 +114,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectDmsInspectInstanceDetailJoinVo">
select diid.instance_detail_id, diid.inspect_instance_id, diid.line_step, diid.real_line_step, diid.device_id, diid.instance_detail_status,
diid.inspect_standard, diid.inspect_desc, diid.inspect_status,dbdl.device_code,dbdl.device_name
from dms_inspect_instance_detail diid left join dms_base_device_ledger dbdl on diid.device_id=dbdl.device_id
select
diid.instance_detail_id,
diid.inspect_instance_id,
diid.line_step,
diid.real_line_step,
diid.device_id,
diid.instance_detail_status,
diid.inspect_standard,
a.inspect_project_desc inspect_desc,
diid.inspect_status,
dbdl.device_code,
dbdl.device_name
from
dms_inspect_instance_detail diid
left join dms_base_device_ledger dbdl on
diid.device_id = dbdl.device_id
left join dms_inspect_instance_detail_project a on diid.instance_detail_id = a.instance_detail_id
</sql>
<select id="selectDmsInspectInstanceDetailJoinList" parameterType="DmsInspectInstanceDetail" resultMap="DmsInspectInstanceDetailResult">

@ -59,6 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="defValue != null">def_value,</if>
<if test="inspectProjectName != null">inspect_project_name,</if>
<if test="inspectProjectProperty != null">inspect_project_property,</if>
<if test="inspectProjectDesc != null">inspect_project_desc,</if>
<if test="upLimit != null">up_limit,</if>
<if test="lowLimit != null">low_limit,</if>
<if test="createBy != null">create_by,</if>
@ -75,6 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="defValue != null">#{defValue},</if>
<if test="inspectProjectName != null">#{inspectProjectName},</if>
<if test="inspectProjectProperty != null">#{inspectProjectProperty},</if>
<if test="inspectProjectDesc != null">#{inspectProjectDesc},</if>
<if test="upLimit != null">#{upLimit},</if>
<if test="lowLimit != null">#{lowLimit},</if>
<if test="createBy != null">#{createBy},</if>
@ -91,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inspectProjectId != null">inspect_project_id = #{inspectProjectId},</if>
<if test="inspectProjectStatus != null">inspect_project_status = #{inspectProjectStatus},</if>
<if test="inspectProjectResult != null">inspect_project_result = #{inspectProjectResult},</if>
<if test="inspectProjectDesc != null">inspect_project_desc = #{inspectProjectDesc},</if>
<if test="projectStepOrder != null">project_step_order = #{projectStepOrder},</if>
<if test="defValue != null">def_value = #{defValue},</if>
<if test="inspectProjectName != null">inspect_project_name = #{inspectProjectName},</if>

@ -145,4 +145,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from dms_maint_instance_activity
where maint_instance_id=#{maintInstanceId})))
</select>
<!-- <select id="selectDmsMaintInfo" resultType="com.hw.dms.domain.DmsMaintInstanceActivity"-->
<!-- parameterType="java.lang.Long"></select>-->
</mapper>

@ -8,6 +8,15 @@ export function listDmsBillsFaultInstance(query) {
params: query
})
}
// // 检修工单记录导出
// export function handleFaultExport(repairInstanceId) {
// return request({
// url: '/dms/dmsBillsFaultInstance/faultRecordExport/' + repairInstanceId,
// method: 'get',
// responseType: 'blob'
// // params: repairInstanceId
// })
// }
// 查询检修工单详细
export function getDmsBillsFaultInstance(repairInstanceId) {

Loading…
Cancel
Save