DMS:完成PDA点巡检工单相关接口和故障报修接口
master
xins 1 year ago
parent cd7e92c428
commit 28576f6ffa

@ -12,12 +12,50 @@ public class DmsConstants {
/**故障报修工单状态*/
public static final String DMS_BILLS_FAULT_INSTANCE_STATUS_TO_REPAIR = "0";//待维修
public static final String DMS_BILLS_FAULT_INSTANCE_STATUS_REPAIRING = "1";//维修中
public static final String DMS_BILLS_FAULT_INSTANCE_STATUS_FINISH = "2";//维修完成
/**故障报修工单实例状态*/
public static final String DMS_BILLS_FAULT_INSTANCE_ACTIVITY_STATUS_TO_PICK = "2";//待接取
public static final String DMS_BILLS_FAULT_INSTANCE_ACTIVITY_HANDLE_STATUS_FINISH = "0";//已结束
public static final String DMS_BILLS_FAULT_INSTANCE_ACTIVITY_HANDLE_STATUS_EXECUTING = "1";//执行中
public static final String DMS_BILLS_FAULT_INSTANCE_ACTIVITY_HANDLE_STATUS_TO_PICK = "2";//待接取
/**故障报修工单类型*/
public static final String DMS_BILLS_FAULT_INSTANCE_TYPE_MAUAL = "1";//手工创建
/**点巡检工单巡检状态*/
public static final String DMS_BILLS_INSPECT_INSTANCE_INSPECT_STATUS_TO_INSPECT="1";//待巡检
public static final String DMS_BILLS_INSPECT_INSTANCE_INSPECT_STATUS_INSPECTING="2";//巡检中
public static final String DMS_BILLS_INSPECT_INSTANCE_INSPECT_STATUS_FINISH="3";//巡检完成
/**点巡检项目属性*/
public static final String DMS_INSPECT_INSTANCE_PROJECT_PROPERTY_QUALITATIVE = "1";//定性
/**点巡检工单明细状态*/
public static final String DMS_INSPECT_INSTANCE_DETAIL_STATUS_TO_INSPECT = "1";//待巡检
public static final String DMS_INSPECT_INSTANCE_DETAIL_STATUS_INSPECTING = "2";//巡检中
public static final String DMS_INSPECT_INSTANCE_DETAIL_STATUS_FINISH = "3";//巡检完成
/**点巡检工单明细检验状态*/
public static final String DMS_INSPECT_INSTANCE_DETAIL_INSPECT_STATUS_PASS = "1";//正常
public static final String DMS_INSPECT_INSTANCE_DETAIL_INSPECT_STATUS_FAIL = "0";//异常
/**点巡检工单明细项目信息检验状态*/
public static final String DMS_INSPECT_INSTANCE_DETAIL_PROJECT_STATUS_PASS = "1";//正常
public static final String DMS_INSPECT_INSTANCE_DETAIL_PROJECT_STATUS_FAIL = "0";//异常
/**外协信息状态*/
public static final Long DMS_BASE_OUTSRC_INFO_STATUS_NROMAL = 1L;//启用
/**工单文件关联类型*/
public static final String DMS_INSTANCE_FILE_TARGET_TYPE_FAULT_INSTANCE_ACTIVITY = "1";//故障报修工单实例节点
}

@ -12,7 +12,7 @@ public class WfConstants {
public static final Long WF_BILLS_FAULT_INSTANCE_PROCESS_ID = 102L;//故障报修工单流程ID
public static final Long WF_BILLS_FAULT_INSTANCE_PROCESS_ACTIVITY_FIRST_ID = 1021L;//故障报修工单流程节点第一步ID
public static final Long WF_BILLS_FAULT_INSTANCE_PROCESS_ACTIVITY_SECOND_ID = 1022L;//故障报修工单流程节点第二步ID
public static final Long WF_QUALITY_ABNORMAL_PROCESS_ID = 301L;//不合格处置工单流程ID

@ -1,19 +1,24 @@
package com.hw.dms.controller;
import com.hw.common.core.constant.DmsConstants;
import com.hw.common.core.domain.R;
import com.hw.common.core.web.controller.BaseController;
import com.hw.common.core.web.domain.AjaxResult;
import com.hw.common.core.web.page.TableDataInfo;
import com.hw.common.log.annotation.Log;
import com.hw.common.log.enums.BusinessType;
import com.hw.dms.domain.DmsBillsFaultInstance;
import com.hw.dms.domain.*;
import com.hw.dms.domain.vo.DmsBillsFaultInstanceScanVo;
import com.hw.dms.domain.vo.DmsBillsInspectInstanceScanVo;
import com.hw.dms.service.IDmsBaseDeviceLedgerService;
import com.hw.dms.service.IDmsBaseOutsrcInfoService;
import com.hw.dms.service.IDmsBillsFaultInstanceService;
import com.hw.dms.service.IDmsBillsInspectInstanceService;
import com.hw.system.api.RemoteFileService;
import com.hw.system.api.domain.SysFile;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
@ -33,13 +38,48 @@ public class DmsMobileController extends BaseController {
@Autowired
private IDmsBillsFaultInstanceService dmsBillsFaultInstanceService;
@Autowired
private IDmsBillsInspectInstanceService dmsBillsInspectInstanceService;
@Autowired
private IDmsBaseDeviceLedgerService baseDeviceLedgerService;
@Autowired
private IDmsBaseOutsrcInfoService dmsBaseOutsrcInfoService;
@Resource
private RemoteFileService remoteFileService;
/**
*
*
* @return
*/
// @RequiresPermissions("qms:checkrule:list")
@GetMapping("/getDeviceByDeviceCode/{deviceCode}")
public AjaxResult getDeviceByDeviceCode(@PathVariable("deviceCode") String deviceCode) {
DmsBaseDeviceLedger dmsBaseDeviceLedger = baseDeviceLedgerService.selectDmsBaseDeviceLedgerByDeviceCode(deviceCode);
return success(dmsBaseDeviceLedger);
}
/**
* PDA-
*
*
* @return
*/
// @RequiresPermissions("qms:checkrule:list")
@GetMapping("/getOutsrcInfos")
public AjaxResult getOutsrcInfos() {
DmsBaseOutsrcInfo queryBaseOutsrcInfo = new DmsBaseOutsrcInfo();
queryBaseOutsrcInfo.setOutsrcStatus(DmsConstants.DMS_BASE_OUTSRC_INFO_STATUS_NROMAL);
List<DmsBaseOutsrcInfo> baseOutsrcInfos = dmsBaseOutsrcInfoService.selectDmsBaseOutsrcInfoList(queryBaseOutsrcInfo);
return success(baseOutsrcInfos);
}
/**
* PDA-
* <p>
*
* id deviceId
* faultType
@ -48,12 +88,12 @@ public class DmsMobileController extends BaseController {
* repairType
* id outsrcId()
* files
* */
*/
// @RequiresPermissions("qms:checkresultdetail:add")
@Log(title = "故障报修工单", businessType = BusinessType.INSERT)
@PostMapping("/insertFaultInstsanceActivity")
public AjaxResult insertFaultInstsanceActivity(DmsBillsFaultInstance dmsBillsFaultInstance,
@RequestParam(value = "files") List<MultipartFile> files) {
@RequestParam(value = "files") List<MultipartFile> files) {
List<String> fileUrls = new ArrayList<>();
for (MultipartFile file : files) {
R<SysFile> sysFileR = remoteFileService.upload(file);
@ -64,4 +104,129 @@ public class DmsMobileController extends BaseController {
return success(dmsBillsFaultInstanceService.insertDmsBillsFaultInstance(dmsBillsFaultInstance));
}
/**
*
*
* @return
*/
// @RequiresPermissions("qms:checkrule:list")
@GetMapping("/getBillsFaultInstances")
public TableDataInfo getBillsFaultInstances() {
startPage();
DmsBillsFaultInstance queryBillsFaultInstance = new DmsBillsFaultInstance();
List<DmsBillsFaultInstance> billsFaultInstances = dmsBillsFaultInstanceService.selectDmsBillsFaultInstanceJoinList(queryBillsFaultInstance);
return getDataTable(billsFaultInstances);
}
/**
* ,使
*
* @return
*/
// @RequiresPermissions("qms:checkrule:list")
@GetMapping("/getBillsFaultInstanceByRepairInstanceId/{repairInstanceId}")
public AjaxResult getBillsFaultInstanceByRepairInstanceId(@PathVariable("repairInstanceId") Long repairInstanceId) {
DmsBillsFaultInstance billsFaultInstance = dmsBillsFaultInstanceService.selectDmsBillsFaultInstanceByRepairInstanceId(repairInstanceId);
return success(billsFaultInstance);
}
/**
*
*/
// @RequiresPermissions("qms:checkresultdetail:add")
@Log(title = "故障报修工单", businessType = BusinessType.UPDATE)
@PostMapping("/updateFaultInstanceActivity")
public AjaxResult updateFaultInstanceActivity(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.updateDmsFaultInstanceActivity(dmsFaultInstanceActivity));
}
/**
* ,使
*
* @return
*/
// @RequiresPermissions("qms:checkrule:list")
@GetMapping("/getBillsFaultInstance4Repair/{repairInstanceId}")
public AjaxResult getBillsFaultInstance4Repair(@PathVariable("repairInstanceId") Long repairInstanceId) {
DmsBillsFaultInstance billsFaultInstance = dmsBillsFaultInstanceService.getDmsBillsFaultInstance4Repair(repairInstanceId);
return success(billsFaultInstance);
}
/**
*
*
* @return
*/
// @RequiresPermissions("qms:checkrule:list")
@GetMapping("/scanDevice4Repair")
public AjaxResult scanDevice4Repair(@Validated DmsBillsFaultInstanceScanVo dmsBillsFaultInstanceScanVo) {
dmsBillsFaultInstanceService.scanDevice4Repair(dmsBillsFaultInstanceScanVo);
return success();
}
/**
*
*/
// @RequiresPermissions("qms:checkresultdetail:add")
@Log(title = "故障报修工单", businessType = BusinessType.START)
@PostMapping("/startRepair")
public AjaxResult startRepair(@RequestBody DmsFaultInstanceActivity dmsFaultInstanceActivity) {
return success(dmsBillsFaultInstanceService.startRepair(dmsFaultInstanceActivity));
}
/**
*
*/
// @RequiresPermissions("qms:checkresultdetail:add")
@Log(title = "故障报修工单", businessType = BusinessType.COMPLETE)
@PostMapping("/completeRepair")
public AjaxResult completeRepair(@RequestBody DmsFaultInstanceActivity dmsFaultInstanceActivity) {
return success(dmsBillsFaultInstanceService.completeRepair(dmsFaultInstanceActivity));
}
/**
* (inspectType(1,2))
*
* @return
*/
// @RequiresPermissions("qms:checkrule:list")
@GetMapping("/getNewestInspectInstance")
public AjaxResult getNewestInspectInstance(DmsBillsInspectInstance dmsBillsInspectInstance) {
DmsBillsInspectInstance newestInspectInstance = dmsBillsInspectInstanceService.getNewestBillsInspectInstance(dmsBillsInspectInstance);
return success(newestInspectInstance);
}
/**
*
* */
// @RequiresPermissions("qms:checkrule:list")
@GetMapping("/scanInspectInstanceDetail")
public AjaxResult scanInspectInstanceDetail(@Validated DmsBillsInspectInstanceScanVo dmsBillsInspectInstanceScanVo) {
return success(dmsBillsInspectInstanceService.scanInspectInstanceDetail(dmsBillsInspectInstanceScanVo));
}
/**
*
*/
// @RequiresPermissions("qms:checkresultdetail:add")
@Log(title = "点巡检工单明细", businessType = BusinessType.INSERT)
@PostMapping("/saveInspectInstanceDetail")
public AjaxResult saveInspectInstanceDetail(@RequestBody DmsInspectInstanceDetail dmsInspectInstanceDetail) {
return success(dmsBillsInspectInstanceService.updateDmsInspectInstanceDetail(dmsInspectInstanceDetail));
}
}

@ -8,7 +8,7 @@ import com.hw.common.core.web.domain.BaseEntity;
/**
* dms_base_inspect_project
*
*
* @author Open Platform
* @date 2024-01-17
*/
@ -31,6 +31,9 @@ public class DmsBaseInspectProject extends BaseEntity
@Excel(name = "检查类型(1巡检,2点检)")
private String inspectType;
/**巡检项目属性(1定性,2定量) */
private String inspectProjectProperty;
/** 记录方式 */
@Excel(name = "记录方式")
private String recordMethod;
@ -51,84 +54,93 @@ public class DmsBaseInspectProject extends BaseEntity
@Excel(name = "是否标识1-是0-否")
private String isFlag;
public void setInspectProjectId(Long inspectProjectId)
public void setInspectProjectId(Long inspectProjectId)
{
this.inspectProjectId = inspectProjectId;
}
public Long getInspectProjectId()
public Long getInspectProjectId()
{
return inspectProjectId;
}
public void setInspectProjectCode(String inspectProjectCode)
public void setInspectProjectCode(String inspectProjectCode)
{
this.inspectProjectCode = inspectProjectCode;
}
public String getInspectProjectCode()
public String getInspectProjectCode()
{
return inspectProjectCode;
}
public void setInspectProject(String inspectProject)
public void setInspectProject(String inspectProject)
{
this.inspectProject = inspectProject;
}
public String getInspectProject()
public String getInspectProject()
{
return inspectProject;
}
public void setInspectType(String inspectType)
public void setInspectType(String inspectType)
{
this.inspectType = inspectType;
}
public String getInspectType()
public String getInspectType()
{
return inspectType;
}
public void setRecordMethod(String recordMethod)
public String getInspectProjectProperty() {
return inspectProjectProperty;
}
public void setInspectProjectProperty(String inspectProjectProperty) {
this.inspectProjectProperty = inspectProjectProperty;
}
public void setRecordMethod(String recordMethod)
{
this.recordMethod = recordMethod;
}
public String getRecordMethod()
public String getRecordMethod()
{
return recordMethod;
}
public void setUpLimit(BigDecimal upLimit)
public void setUpLimit(BigDecimal upLimit)
{
this.upLimit = upLimit;
}
public BigDecimal getUpLimit()
public BigDecimal getUpLimit()
{
return upLimit;
}
public void setLowLimit(BigDecimal lowLimit)
public void setLowLimit(BigDecimal lowLimit)
{
this.lowLimit = lowLimit;
}
public BigDecimal getLowLimit()
public BigDecimal getLowLimit()
{
return lowLimit;
}
public void setDefValue(BigDecimal defValue)
public void setDefValue(BigDecimal defValue)
{
this.defValue = defValue;
}
public BigDecimal getDefValue()
public BigDecimal getDefValue()
{
return defValue;
}
public void setIsFlag(String isFlag)
public void setIsFlag(String isFlag)
{
this.isFlag = isFlag;
}
public String getIsFlag()
public String getIsFlag()
{
return isFlag;
}

@ -71,18 +71,22 @@ public class DmsBillsFaultInstance extends BaseEntity
@Excel(name = "工单类型", readConverterExp = "1=手工创建,2自动创建")
private String instanceType;
/** 是否标识1-是0-否 */
@Excel(name = "是否标识1-是0-否")
private String deviceCode;
private List<SysFile> sysFiles;
private String deviceName;
private String deviceLocation;
private String deviceSpec;
private String imgUrl;
/** 是否标识1-是0-否 */
@Excel(name = "是否标识1-是0-否")
private String isFlag;
private Long instanceActivityId;
private String faultType;
private String faultDescription;
@ -95,8 +99,25 @@ public class DmsBillsFaultInstance extends BaseEntity
private Long outsrcId;
private String processHandleResolution;
private List<String> fileUrls;
private List<SysFile> sysFiles;
private List<DmsInstanceFile> dmsInstanceFiles;
public Long getInstanceActivityId() {
return instanceActivityId;
}
public void setInstanceActivityId(Long instanceActivityId) {
this.instanceActivityId = instanceActivityId;
}
private List<DmsFaultInstanceActivity> dmsFaultInstanceActivityList;
public List<SysFile> getSysFiles() {
return sysFiles;
}
@ -161,6 +182,14 @@ public class DmsBillsFaultInstance extends BaseEntity
this.outsrcId = outsrcId;
}
public String getProcessHandleResolution() {
return processHandleResolution;
}
public void setProcessHandleResolution(String processHandleResolution) {
this.processHandleResolution = processHandleResolution;
}
public void setRepairInstanceId(Long repairInstanceId)
{
this.repairInstanceId = repairInstanceId;
@ -269,6 +298,39 @@ public class DmsBillsFaultInstance extends BaseEntity
{
return instanceType;
}
public String getDeviceCode() {
return deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getDeviceName() {
return deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceLocation() {
return deviceLocation;
}
public void setDeviceLocation(String deviceLocation) {
this.deviceLocation = deviceLocation;
}
public String getDeviceSpec() {
return deviceSpec;
}
public void setDeviceSpec(String deviceSpec) {
this.deviceSpec = deviceSpec;
}
public void setIsFlag(String isFlag)
{
this.isFlag = isFlag;
@ -287,6 +349,22 @@ public class DmsBillsFaultInstance extends BaseEntity
this.fileUrls = fileUrls;
}
public List<DmsFaultInstanceActivity> getDmsFaultInstanceActivityList() {
return dmsFaultInstanceActivityList;
}
public void setDmsFaultInstanceActivityList(List<DmsFaultInstanceActivity> dmsFaultInstanceActivityList) {
this.dmsFaultInstanceActivityList = dmsFaultInstanceActivityList;
}
public List<DmsInstanceFile> getDmsInstanceFiles() {
return dmsInstanceFiles;
}
public void setDmsInstanceFiles(List<DmsInstanceFile> dmsInstanceFiles) {
this.dmsInstanceFiles = dmsInstanceFiles;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -1,6 +1,8 @@
package com.hw.dms.domain;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@ -74,9 +76,12 @@ public class DmsBillsInspectInstance extends BaseEntity
@Excel(name = "是否标识1-是0-否")
private String isFlag;
private String routeName;
/**多个状态时使用,以,隔开*/
private String inspectStatusStr;
private List<DmsInspectInstanceDetail> dmsInspectInstanceDetailList;
public void setInspectInstanceId(Long inspectInstanceId)
{
@ -204,6 +209,30 @@ public class DmsBillsInspectInstance extends BaseEntity
return isFlag;
}
public String getRouteName() {
return routeName;
}
public void setRouteName(String routeName) {
this.routeName = routeName;
}
public String getInspectStatusStr() {
return inspectStatusStr;
}
public void setInspectStatusStr(String inspectStatusStr) {
this.inspectStatusStr = inspectStatusStr;
}
public List<DmsInspectInstanceDetail> getDmsInspectInstanceDetailList() {
return dmsInspectInstanceDetailList;
}
public void setDmsInspectInstanceDetailList(List<DmsInspectInstanceDetail> dmsInspectInstanceDetailList) {
this.dmsInspectInstanceDetailList = dmsInspectInstanceDetailList;
}
@Override
public String toString() {
return "DmsBillsInspectInstance{" +

@ -1,6 +1,8 @@
package com.hw.dms.domain;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@ -96,6 +98,8 @@ public class DmsFaultInstanceActivity extends BaseEntity
private String attr1;
private Long wfLength;
private List<String> fileUrls;
public Long getWfLength() {
return wfLength;
}
@ -276,6 +280,14 @@ public class DmsFaultInstanceActivity extends BaseEntity
return attr1;
}
public List<String> getFileUrls() {
return fileUrls;
}
public void setFileUrls(List<String> fileUrls) {
this.fileUrls = fileUrls;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -0,0 +1,200 @@
package com.hw.dms.domain;
import java.math.BigDecimal;
import java.util.List;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.hw.common.core.annotation.Excel;
import com.hw.common.core.web.domain.BaseEntity;
/**
* dms_inspect_instance_detail
*
* @author xins
* @date 2024-03-19
*/
public class DmsInspectInstanceDetail extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键标识 */
private Long instanceDetailId;
/** 点巡检工单ID */
@Excel(name = "点巡检工单ID")
private Long inspectInstanceId;
/** 巡检步骤 */
@Excel(name = "巡检步骤")
private Long lineStep;
/** 实际巡检步骤 */
@Excel(name = "实际巡检步骤")
private Long realLineStep;
/** 巡检设备ID关联dms_base_device_ledger的device_id */
@Excel(name = "巡检设备ID关联dms_base_device_ledger的device_id")
private Long deviceId;
/** 点巡检状态1-待巡检2-巡检中3-已完成 */
@Excel(name = "点巡检状态1-待巡检2-巡检中3-已完成")
private String instanceDetailStatus;
/** 巡检标准 */
@Excel(name = "巡检标准")
private String inspectStandard;
/** 操作描述 */
@Excel(name = "操作描述")
private String inspectDesc;
/** 巡检值,对于定量的需要输入 */
@Excel(name = "巡检值,对于定量的需要输入")
private BigDecimal inspectValue;
/** 巡检状态1正常 0异常对于定性的需要输入 */
@Excel(name = "巡检状态", readConverterExp = "1=正常,0=异常")
private String inspectStatus;
private String deviceCode;
private String deviceName;
private List<DmsInspectInstanceDetailProject> dmsInspectInstanceDetailProjectList;
public void setInstanceDetailId(Long instanceDetailId)
{
this.instanceDetailId = instanceDetailId;
}
public Long getInstanceDetailId()
{
return instanceDetailId;
}
public void setInspectInstanceId(Long inspectInstanceId)
{
this.inspectInstanceId = inspectInstanceId;
}
public Long getInspectInstanceId()
{
return inspectInstanceId;
}
public void setLineStep(Long lineStep)
{
this.lineStep = lineStep;
}
public Long getLineStep()
{
return lineStep;
}
public void setRealLineStep(Long realLineStep)
{
this.realLineStep = realLineStep;
}
public Long getRealLineStep()
{
return realLineStep;
}
public void setDeviceId(Long deviceId)
{
this.deviceId = deviceId;
}
public Long getDeviceId()
{
return deviceId;
}
public void setInstanceDetailStatus(String instanceDetailStatus)
{
this.instanceDetailStatus = instanceDetailStatus;
}
public String getInstanceDetailStatus()
{
return instanceDetailStatus;
}
public void setInspectStandard(String inspectStandard)
{
this.inspectStandard = inspectStandard;
}
public String getInspectStandard()
{
return inspectStandard;
}
public void setInspectDesc(String inspectDesc)
{
this.inspectDesc = inspectDesc;
}
public String getInspectDesc()
{
return inspectDesc;
}
public void setInspectValue(BigDecimal inspectValue)
{
this.inspectValue = inspectValue;
}
public BigDecimal getInspectValue()
{
return inspectValue;
}
public void setInspectStatus(String inspectStatus)
{
this.inspectStatus = inspectStatus;
}
public String getInspectStatus()
{
return inspectStatus;
}
public String getDeviceCode() {
return deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getDeviceName() {
return deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public List<DmsInspectInstanceDetailProject> getDmsInspectInstanceDetailProjectList() {
return dmsInspectInstanceDetailProjectList;
}
public void setDmsInspectInstanceDetailProjectList(List<DmsInspectInstanceDetailProject> dmsInspectInstanceDetailProjectList) {
this.dmsInspectInstanceDetailProjectList = dmsInspectInstanceDetailProjectList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("instanceDetailId", getInstanceDetailId())
.append("inspectInstanceId", getInspectInstanceId())
.append("lineStep", getLineStep())
.append("realLineStep", getRealLineStep())
.append("deviceId", getDeviceId())
.append("instanceDetailStatus", getInstanceDetailStatus())
.append("inspectStandard", getInspectStandard())
.append("inspectDesc", getInspectDesc())
.append("inspectValue", getInspectValue())
.append("inspectStatus", getInspectStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -0,0 +1,203 @@
package com.hw.dms.domain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.hw.common.core.annotation.Excel;
import com.hw.common.core.web.domain.BaseEntity;
/**
* ; dms_inspect_instance_detail_project
*
* @author xins
* @date 2024-03-19
*/
public class DmsInspectInstanceDetailProject extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 点巡检工单明细项目信息ID */
private Long instanceDetailProjectId;
/** 点巡检工单明细ID关联dms_inspect_instance_detail主键 */
@Excel(name = "点巡检工单明细ID关联dms_inspect_instance_detail主键")
private Long instanceDetailId;
/** 巡检项目ID关联dms_base_inspect_project主键 */
@Excel(name = "巡检项目ID关联dms_base_inspect_project主键")
private Long inspectProjectId;
/** 巡检结果(1正常,0异常);定性需选择,定量的话根据检验结果的具体值自动选择 */
@Excel(name = "巡检结果(1正常,0异常);定性需选择,定量的话根据检验结果的具体值自动选择")
private String inspectProjectStatus;
/** 巡检结果,具体值 */
@Excel(name = "巡检结果,具体值")
private BigDecimal inspectProjectResult;
/** 巡检顺序 */
@Excel(name = "巡检顺序")
private Long projectStepOrder;
/** 标准值 */
@Excel(name = "标准值")
private BigDecimal defValue;
/** 巡检项目名称(冗余字段) */
@Excel(name = "巡检项目名称", readConverterExp = "冗=余字段")
private String inspectProjectName;
/** 巡检项目属性(1定性,2定量),冗余字段 */
@Excel(name = "巡检项目属性(1定性,2定量),冗余字段")
private String inspectProjectProperty;
/** 上差值,检验时从检验项目复制过来的值 */
@Excel(name = "上差值,检验时从检验项目复制过来的值")
private BigDecimal upLimit;
/** 下差值,检验时从检验项目复制过来的值 */
@Excel(name = "下差值,检验时从检验项目复制过来的值")
private BigDecimal lowLimit;
@Excel(name = "巡检描述")
private String inspectProjectDesc;
private Long deviceId;
public void setInstanceDetailProjectId(Long instanceDetailProjectId)
{
this.instanceDetailProjectId = instanceDetailProjectId;
}
public Long getInstanceDetailProjectId()
{
return instanceDetailProjectId;
}
public void setInstanceDetailId(Long instanceDetailId)
{
this.instanceDetailId = instanceDetailId;
}
public Long getInstanceDetailId()
{
return instanceDetailId;
}
public void setInspectProjectId(Long inspectProjectId)
{
this.inspectProjectId = inspectProjectId;
}
public Long getInspectProjectId()
{
return inspectProjectId;
}
public void setInspectProjectStatus(String inspectProjectStatus)
{
this.inspectProjectStatus = inspectProjectStatus;
}
public String getInspectProjectStatus()
{
return inspectProjectStatus;
}
public void setInspectProjectResult(BigDecimal inspectProjectResult)
{
this.inspectProjectResult = inspectProjectResult;
}
public BigDecimal getInspectProjectResult()
{
return inspectProjectResult;
}
public void setProjectStepOrder(Long projectStepOrder)
{
this.projectStepOrder = projectStepOrder;
}
public Long getProjectStepOrder()
{
return projectStepOrder;
}
public void setDefValue(BigDecimal defValue)
{
this.defValue = defValue;
}
public BigDecimal getDefValue()
{
return defValue;
}
public void setInspectProjectName(String inspectProjectName)
{
this.inspectProjectName = inspectProjectName;
}
public String getInspectProjectName()
{
return inspectProjectName;
}
public void setInspectProjectProperty(String inspectProjectProperty)
{
this.inspectProjectProperty = inspectProjectProperty;
}
public String getInspectProjectProperty()
{
return inspectProjectProperty;
}
public void setUpLimit(BigDecimal upLimit)
{
this.upLimit = upLimit;
}
public BigDecimal getUpLimit()
{
return upLimit;
}
public void setLowLimit(BigDecimal lowLimit)
{
this.lowLimit = lowLimit;
}
public BigDecimal getLowLimit()
{
return lowLimit;
}
public String getInspectProjectDesc() {
return inspectProjectDesc;
}
public void setInspectProjectDesc(String inspectProjectDesc) {
this.inspectProjectDesc = inspectProjectDesc;
}
public Long getDeviceId() {
return deviceId;
}
public void setDeviceId(Long deviceId) {
this.deviceId = deviceId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("instanceDetailProjectId", getInstanceDetailProjectId())
.append("instanceDetailId", getInstanceDetailId())
.append("inspectProjectId", getInspectProjectId())
.append("inspectProjectStatus", getInspectProjectStatus())
.append("inspectProjectResult", getInspectProjectResult())
.append("projectStepOrder", getProjectStepOrder())
.append("defValue", getDefValue())
.append("inspectProjectName", getInspectProjectName())
.append("inspectProjectProperty", getInspectProjectProperty())
.append("upLimit", getUpLimit())
.append("lowLimit", getLowLimit())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -0,0 +1,24 @@
package com.hw.dms.domain.vo;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* @Description: VO
* @ClassName: DmsBillsFaultInstanceScanVo
* @Author : xins
* @Date :2024-03-20 10:44
* @Version :1.0
*/
@Data
public class DmsBillsFaultInstanceScanVo {
@NotNull(message="故障报修工单ID必须输入")
private Long repairInstanceId;
/** 设备编号 */
@NotBlank(message="设备编号必须输入")
private String deviceCode;
}

@ -0,0 +1,24 @@
package com.hw.dms.domain.vo;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* @Description:VO
* @ProjectName:HwMes
* @Author:xins
* @Date:2024-03-19 14:43
* @Version:1.0
*/
@Data
public class DmsBillsInspectInstanceScanVo {
@NotNull(message="点巡检工单ID必须输入")
private Long inspectInstanceId;
/** 设备编号 */
@NotBlank(message="设备编号必须输入")
private String deviceCode;
}

@ -5,15 +5,15 @@ import com.hw.dms.domain.DmsBaseDeviceLedger;
/**
* Mapper
*
*
* @author xins
* @date 2023-12-28
*/
public interface DmsBaseDeviceLedgerMapper
public interface DmsBaseDeviceLedgerMapper
{
/**
*
*
*
* @param deviceId
* @return
*/
@ -21,7 +21,7 @@ public interface DmsBaseDeviceLedgerMapper
/**
*
*
*
* @param dmsBaseDeviceLedger
* @return
*/
@ -29,7 +29,7 @@ public interface DmsBaseDeviceLedgerMapper
/**
*
*
*
* @param dmsBaseDeviceLedger
* @return
*/
@ -37,7 +37,7 @@ public interface DmsBaseDeviceLedgerMapper
/**
*
*
*
* @param dmsBaseDeviceLedger
* @return
*/
@ -45,7 +45,7 @@ public interface DmsBaseDeviceLedgerMapper
/**
*
*
*
* @param deviceId
* @return
*/
@ -53,9 +53,20 @@ public interface DmsBaseDeviceLedgerMapper
/**
*
*
*
* @param deviceIds
* @return
*/
public int deleteDmsBaseDeviceLedgerByDeviceIds(Long[] deviceIds);
/**
*
*
* @param deviceCode CODE
* @return
*/
public DmsBaseDeviceLedger selectDmsBaseDeviceLedgerByDeviceCode(String deviceCode);
}

@ -2,6 +2,7 @@ package com.hw.dms.mapper;
import java.util.List;
import com.hw.dms.domain.DmsBillsFaultInstance;
import org.apache.ibatis.annotations.Param;
/**
* Mapper
@ -60,6 +61,44 @@ public interface DmsBillsFaultInstanceMapper
public int deleteDmsBillsFaultInstanceByRepairInstanceIds(Long[] repairInstanceIds);
public Long selectProcessActivityId(Long wfProcessId);
/**
*
*
* @param dmsBillsFaultInstance
* @return
*/
public List<DmsBillsFaultInstance> selectDmsBillsFaultInstanceJoinList(DmsBillsFaultInstance dmsBillsFaultInstance);
/**
* ,Join device,Join dms_fault_instance_activiy
*
* @param repairInstanceId
* @return
*/
public DmsBillsFaultInstance selectFaultInstanceJoinFirstAndDeviceById(Long repairInstanceId);
/**
* ,Join device,Join dms_fault_instance_activiy
*
* @param repairInstanceId
* @return
*/
public DmsBillsFaultInstance selectFaultInstanceJoinActivityByRepairInstanceId(Long repairInstanceId);
public Long selectCountByRepairInstanceIdAndDeviceCode(@Param("repairInstanceId") Long repairInstanceId,
@Param("deviceCode") String deviceCode);
/**
* ,Join dms_fault_instance_activiy
*
* @param repairInstanceId
* @return
*/
public DmsBillsFaultInstance selectFaultInstanceJoinFirstById(Long repairInstanceId);
}

@ -63,4 +63,13 @@ public interface DmsBillsInspectInstanceMapper
int insertDmsBillsInspectInstancePDA(DmsBillsInspectInstance dmsBillsInspectInstance);
/**
*
*
* @param dmsBillsInspectInstance
* @return
*/
public DmsBillsInspectInstance selectNewestDmsBillsInspectInstance(DmsBillsInspectInstance dmsBillsInspectInstance);
}

@ -0,0 +1,83 @@
package com.hw.dms.mapper;
import java.util.List;
import com.hw.dms.domain.DmsInspectInstanceDetail;
import org.apache.ibatis.annotations.Param;
/**
* Mapper
*
* @author xins
* @date 2024-03-19
*/
public interface DmsInspectInstanceDetailMapper
{
/**
*
*
* @param instanceDetailId
* @return
*/
public DmsInspectInstanceDetail selectDmsInspectInstanceDetailByInstanceDetailId(Long instanceDetailId);
/**
*
*
* @param dmsInspectInstanceDetail
* @return
*/
public List<DmsInspectInstanceDetail> selectDmsInspectInstanceDetailList(DmsInspectInstanceDetail dmsInspectInstanceDetail);
/**
*
*
* @param dmsInspectInstanceDetail
* @return
*/
public int insertDmsInspectInstanceDetail(DmsInspectInstanceDetail dmsInspectInstanceDetail);
/**
*
*
* @param dmsInspectInstanceDetail
* @return
*/
public int updateDmsInspectInstanceDetail(DmsInspectInstanceDetail dmsInspectInstanceDetail);
/**
*
*
* @param instanceDetailId
* @return
*/
public int deleteDmsInspectInstanceDetailByInstanceDetailId(Long instanceDetailId);
/**
*
*
* @param instanceDetailIds
* @return
*/
public int deleteDmsInspectInstanceDetailByInstanceDetailIds(Long[] instanceDetailIds);
/**
* ,Join
*
* @param dmsInspectInstanceDetail
* @return
*/
public List<DmsInspectInstanceDetail> selectDmsInspectInstanceDetailJoinList(DmsInspectInstanceDetail dmsInspectInstanceDetail);
/**
* inspectInstanceIddeviceCode
* @param inspectInstanceId
* @param deviceCode
* @return
*/
public DmsInspectInstanceDetail selectDmsInspectInstanceDetailByUI(@Param("inspectInstanceId") Long inspectInstanceId,
@Param("deviceCode") String deviceCode);
}

@ -0,0 +1,76 @@
package com.hw.dms.mapper;
import java.util.List;
import com.hw.dms.domain.DmsInspectInstanceDetailProject;
/**
* ;Mapper
*
* @author xins
* @date 2024-03-19
*/
public interface DmsInspectInstanceDetailProjectMapper
{
/**
* ;
*
* @param instanceDetailProjectId ;
* @return ;
*/
public DmsInspectInstanceDetailProject selectDmsInspectInstanceDetailProjectByInstanceDetailProjectId(Long instanceDetailProjectId);
/**
* ;
*
* @param dmsInspectInstanceDetailProject ;
* @return ;
*/
public List<DmsInspectInstanceDetailProject> selectDmsInspectInstanceDetailProjectList(DmsInspectInstanceDetailProject dmsInspectInstanceDetailProject);
/**
* ;
*
* @param dmsInspectInstanceDetailProject ;
* @return
*/
public int insertDmsInspectInstanceDetailProject(DmsInspectInstanceDetailProject dmsInspectInstanceDetailProject);
/**
* ;
*
* @param dmsInspectInstanceDetailProject ;
* @return
*/
public int updateDmsInspectInstanceDetailProject(DmsInspectInstanceDetailProject dmsInspectInstanceDetailProject);
/**
* ;
*
* @param instanceDetailProjectId ;
* @return
*/
public int deleteDmsInspectInstanceDetailProjectByInstanceDetailProjectId(Long instanceDetailProjectId);
/**
* ;
*
* @param instanceDetailProjectIds
* @return
*/
public int deleteDmsInspectInstanceDetailProjectByInstanceDetailProjectIds(Long[] instanceDetailProjectIds);
/**
* ;Join
*
* @param dmsInspectInstanceDetailProject ;
* @return ;
*/
public List<DmsInspectInstanceDetailProject> selectDmsInspectInstanceDetailProjectJoinList(DmsInspectInstanceDetailProject dmsInspectInstanceDetailProject);
}

@ -5,15 +5,15 @@ import com.hw.dms.domain.DmsBaseDeviceLedger;
/**
* Service
*
*
* @author xins
* @date 2023-12-28
*/
public interface IDmsBaseDeviceLedgerService
public interface IDmsBaseDeviceLedgerService
{
/**
*
*
*
* @param deviceId
* @return
*/
@ -21,7 +21,7 @@ public interface IDmsBaseDeviceLedgerService
/**
*
*
*
* @param dmsBaseDeviceLedger
* @return
*/
@ -29,7 +29,7 @@ public interface IDmsBaseDeviceLedgerService
/**
*
*
*
* @param dmsBaseDeviceLedger
* @return
*/
@ -37,7 +37,7 @@ public interface IDmsBaseDeviceLedgerService
/**
*
*
*
* @param dmsBaseDeviceLedger
* @return
*/
@ -45,7 +45,7 @@ public interface IDmsBaseDeviceLedgerService
/**
*
*
*
* @param deviceIds
* @return
*/
@ -53,9 +53,20 @@ public interface IDmsBaseDeviceLedgerService
/**
*
*
*
* @param deviceId
* @return
*/
public int deleteDmsBaseDeviceLedgerByDeviceId(Long deviceId);
/**
*
*
* @param deviceCode Code
* @return
*/
public DmsBaseDeviceLedger selectDmsBaseDeviceLedgerByDeviceCode(String deviceCode);
}

@ -2,6 +2,9 @@ package com.hw.dms.service;
import java.util.List;
import com.hw.dms.domain.DmsBillsFaultInstance;
import com.hw.dms.domain.DmsFaultInstanceActivity;
import com.hw.dms.domain.vo.DmsBillsFaultInstanceScanVo;
import org.springframework.transaction.annotation.Transactional;
/**
* Service
@ -60,4 +63,50 @@ public interface IDmsBillsFaultInstanceService
public int deleteDmsBillsFaultInstanceByRepairInstanceId(Long repairInstanceId);
int insertDmsBillsFaultInstancePDA(DmsBillsFaultInstance dmsBillsFaultInstance);
/**
* Join
*
* @param dmsBillsFaultInstance
* @return
*/
public List<DmsBillsFaultInstance> selectDmsBillsFaultInstanceJoinList(DmsBillsFaultInstance dmsBillsFaultInstance);
/**
* 使
* @param repairInstanceId
* @return
*/
public DmsBillsFaultInstance getDmsBillsFaultInstance4Repair(Long repairInstanceId);
/**
*
*
* @param dmsFaultInstanceActivity
* @return
*/
public int updateDmsFaultInstanceActivity(DmsFaultInstanceActivity dmsFaultInstanceActivity);
/**
*
* @param dmsBillsFaultInstanceScanVo
*/
public void scanDevice4Repair(DmsBillsFaultInstanceScanVo dmsBillsFaultInstanceScanVo);
/**
*
*
* @param dmsFaultInstanceActivity
* @return
*/
public int startRepair(DmsFaultInstanceActivity dmsFaultInstanceActivity);
/**
*
*
* @param dmsFaultInstanceActivity
* @return
*/
public int completeRepair(DmsFaultInstanceActivity dmsFaultInstanceActivity);
}

@ -2,6 +2,9 @@ package com.hw.dms.service;
import java.util.List;
import com.hw.dms.domain.DmsBillsInspectInstance;
import com.hw.dms.domain.DmsInspectInstanceDetail;
import com.hw.dms.domain.vo.DmsBillsInspectInstanceScanVo;
import org.springframework.transaction.annotation.Transactional;
/**
* Service
@ -64,4 +67,27 @@ public interface IDmsBillsInspectInstanceService
public int deleteDmsBillsInspectInstanceByInspectInstanceId(Long inspectInstanceId);
int insertDmsBillsInspectInstancePDA(DmsBillsInspectInstance dmsBillsInspectInstance);
/**
*
*
* @param dmsBillsInspectInstance
* @return
*/
public DmsBillsInspectInstance getNewestBillsInspectInstance(DmsBillsInspectInstance dmsBillsInspectInstance);
/**
*
* @param dmsBillsInspectInstanceScanVo
* @return
*/
public DmsInspectInstanceDetail scanInspectInstanceDetail(DmsBillsInspectInstanceScanVo dmsBillsInspectInstanceScanVo);
/**
*
*
* @param dmsInspectInstanceDetail
* @return
*/
public int updateDmsInspectInstanceDetail(DmsInspectInstanceDetail dmsInspectInstanceDetail);
}

@ -1,6 +1,8 @@
package com.hw.dms.service.impl;
import java.util.List;
import com.hw.common.core.exception.ServiceException;
import com.hw.common.core.utils.DateUtils;
import com.hw.system.api.model.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
@ -16,8 +18,7 @@ import com.hw.dms.service.IDmsBaseDeviceLedgerService;
* @date 2023-12-28
*/
@Service
public class DmsBaseDeviceLedgerServiceImpl implements IDmsBaseDeviceLedgerService
{
public class DmsBaseDeviceLedgerServiceImpl implements IDmsBaseDeviceLedgerService {
@Autowired
private DmsBaseDeviceLedgerMapper dmsBaseDeviceLedgerMapper;
@ -28,8 +29,7 @@ public class DmsBaseDeviceLedgerServiceImpl implements IDmsBaseDeviceLedgerServi
* @return
*/
@Override
public DmsBaseDeviceLedger selectDmsBaseDeviceLedgerByDeviceId(Long deviceId)
{
public DmsBaseDeviceLedger selectDmsBaseDeviceLedgerByDeviceId(Long deviceId) {
return dmsBaseDeviceLedgerMapper.selectDmsBaseDeviceLedgerByDeviceId(deviceId);
}
@ -40,8 +40,7 @@ public class DmsBaseDeviceLedgerServiceImpl implements IDmsBaseDeviceLedgerServi
* @return
*/
@Override
public List<DmsBaseDeviceLedger> selectDmsBaseDeviceLedgerList(DmsBaseDeviceLedger dmsBaseDeviceLedger)
{
public List<DmsBaseDeviceLedger> selectDmsBaseDeviceLedgerList(DmsBaseDeviceLedger dmsBaseDeviceLedger) {
return dmsBaseDeviceLedgerMapper.selectDmsBaseDeviceLedgerList(dmsBaseDeviceLedger);
}
@ -52,8 +51,7 @@ public class DmsBaseDeviceLedgerServiceImpl implements IDmsBaseDeviceLedgerServi
* @return
*/
@Override
public int insertDmsBaseDeviceLedger(DmsBaseDeviceLedger dmsBaseDeviceLedger)
{
public int insertDmsBaseDeviceLedger(DmsBaseDeviceLedger dmsBaseDeviceLedger) {
dmsBaseDeviceLedger.setIsFlag(1l);
LoginUser loginUser = new LoginUser();
dmsBaseDeviceLedger.setCreateBy(loginUser.getUsername());
@ -68,8 +66,7 @@ public class DmsBaseDeviceLedgerServiceImpl implements IDmsBaseDeviceLedgerServi
* @return
*/
@Override
public int updateDmsBaseDeviceLedger(DmsBaseDeviceLedger dmsBaseDeviceLedger)
{
public int updateDmsBaseDeviceLedger(DmsBaseDeviceLedger dmsBaseDeviceLedger) {
LoginUser loginUser = new LoginUser();
dmsBaseDeviceLedger.setUpdateBy(loginUser.getUsername());
dmsBaseDeviceLedger.setUpdateTime(DateUtils.getNowDate());
@ -83,8 +80,7 @@ public class DmsBaseDeviceLedgerServiceImpl implements IDmsBaseDeviceLedgerServi
* @return
*/
@Override
public int deleteDmsBaseDeviceLedgerByDeviceIds(Long[] deviceIds)
{
public int deleteDmsBaseDeviceLedgerByDeviceIds(Long[] deviceIds) {
return dmsBaseDeviceLedgerMapper.deleteDmsBaseDeviceLedgerByDeviceIds(deviceIds);
}
@ -95,8 +91,24 @@ public class DmsBaseDeviceLedgerServiceImpl implements IDmsBaseDeviceLedgerServi
* @return
*/
@Override
public int deleteDmsBaseDeviceLedgerByDeviceId(Long deviceId)
{
public int deleteDmsBaseDeviceLedgerByDeviceId(Long deviceId) {
return dmsBaseDeviceLedgerMapper.deleteDmsBaseDeviceLedgerByDeviceId(deviceId);
}
/**
*
*
* @param deviceCode Code
* @return
*/
@Override
public DmsBaseDeviceLedger selectDmsBaseDeviceLedgerByDeviceCode(String deviceCode) {
DmsBaseDeviceLedger dmsBaseDeviceLedger = dmsBaseDeviceLedgerMapper.selectDmsBaseDeviceLedgerByDeviceCode(deviceCode);
if (dmsBaseDeviceLedger == null) {
throw new ServiceException("无此设备");
}
return dmsBaseDeviceLedger;
}
}

@ -6,11 +6,13 @@ import java.util.List;
import com.hw.common.core.constant.DmsConstants;
import com.hw.common.core.constant.WfConstants;
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.DmsFaultInstanceActivity;
import com.hw.dms.domain.DmsInstanceFile;
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;
@ -45,26 +47,20 @@ public class DmsBillsFaultInstanceServiceImpl implements IDmsBillsFaultInstanceS
*/
@Override
public DmsBillsFaultInstance selectDmsBillsFaultInstanceByRepairInstanceId(Long repairInstanceId) {
DmsFaultInstanceActivity dmsFaultInstanceActivity = dmsFaultInstanceActivityMapper.selectDmsFaultInstanceActivityByRepairIdMin(repairInstanceId);
DmsBillsFaultInstance dmsBillsFaultInstance = dmsBillsFaultInstanceMapper.selectDmsBillsFaultInstanceByRepairInstanceId(repairInstanceId);
// List<DmsFaultInstanceFile> dmsFaultInstanceFiles = dmsFaultInstanceFileMapper.selectDmsFaultInstanceFileByFaultId(repairInstanceId);
List<SysFile> sysFiles = new ArrayList<SysFile>();
SysFile sysFile = new SysFile();
dmsBillsFaultInstance.setFaultType(dmsFaultInstanceActivity.getFaultType());
dmsBillsFaultInstance.setFaultDescription(dmsFaultInstanceActivity.getFaultDescription());
dmsBillsFaultInstance.setDesignOperations(dmsFaultInstanceActivity.getDesignOperations());
dmsBillsFaultInstance.setDesignOperations(dmsFaultInstanceActivity.getDesignOperations());
dmsBillsFaultInstance.setDeviceId(dmsFaultInstanceActivity.getDeviceId());
dmsBillsFaultInstance.setRepairType(dmsFaultInstanceActivity.getRepairType());
if (dmsFaultInstanceActivity.getOutsrcId() != null) {
dmsBillsFaultInstance.setOutsrcId(dmsFaultInstanceActivity.getOutsrcId());
}
// for (DmsFaultInstanceFile dmsFaultFor : dmsFaultInstanceFiles) {
// sysFile.setUrl(dmsFaultFor.getFaultFile());
// sysFiles.add(sysFile);
// }
// dmsBillsFaultInstance.setDmsFaultInstanceFiles(dmsFaultInstanceFiles);
dmsBillsFaultInstance.setSysFiles(sysFiles);
// DmsFaultInstanceActivity dmsFaultInstanceActivity = dmsFaultInstanceActivityMapper.selectDmsFaultInstanceActivityByRepairIdMin(repairInstanceId);
// DmsBillsFaultInstance dmsBillsFaultInstance = dmsBillsFaultInstanceMapper.selectDmsBillsFaultInstanceByRepairInstanceId(repairInstanceId);
DmsBillsFaultInstance dmsBillsFaultInstance = dmsBillsFaultInstanceMapper.selectFaultInstanceJoinFirstAndDeviceById(repairInstanceId);
DmsInstanceFile queryInstanceFile = new DmsInstanceFile();
queryInstanceFile.setTargetType(DmsConstants.DMS_INSTANCE_FILE_TARGET_TYPE_FAULT_INSTANCE_ACTIVITY);
queryInstanceFile.setTargetId(dmsBillsFaultInstance.getInstanceActivityId());
List<DmsInstanceFile> dmsInstanceFiles = dmsInstanceFileMapper.selectDmsInstanceFileList(queryInstanceFile);
dmsBillsFaultInstance.setDmsInstanceFiles(dmsInstanceFiles);
// dmsBillsFaultInstance.setFaultType(dmsFaultInstanceActivity.getFaultType());
// dmsBillsFaultInstance.setFaultDescription(dmsFaultInstanceActivity.getFaultDescription());
// dmsBillsFaultInstance.setDesignOperations(dmsFaultInstanceActivity.getDesignOperations());
// dmsBillsFaultInstance.setDeviceId(dmsFaultInstanceActivity.getDeviceId());
// dmsBillsFaultInstance.setRepairType(dmsFaultInstanceActivity.getRepairType());
return dmsBillsFaultInstance;
}
@ -113,23 +109,13 @@ public class DmsBillsFaultInstanceServiceImpl implements IDmsBillsFaultInstanceS
if (dmsBillsFaultInstance.getOutsrcId() != null) {
dmsFaultInstanceActivity.setOutsrcId(dmsBillsFaultInstance.getOutsrcId());
}
dmsFaultInstanceActivity.setProcessHandleStatus(DmsConstants.DMS_BILLS_FAULT_INSTANCE_ACTIVITY_STATUS_TO_PICK);
dmsFaultInstanceActivity.setProcessHandleStatus(DmsConstants.DMS_BILLS_FAULT_INSTANCE_ACTIVITY_HANDLE_STATUS_TO_PICK);
dmsFaultInstanceActivity.setProcessStepOrder(1l);
dmsFaultInstanceActivityMapper.insertDmsFaultInstanceActivity(dmsFaultInstanceActivity);
//存储图片
List<String> fileUrls = dmsBillsFaultInstance.getFileUrls();
if (fileUrls != null && !fileUrls.isEmpty()) {
List<DmsInstanceFile> dmsInstanceFiles = new ArrayList<>();
for (String fileUrl : fileUrls) {
DmsInstanceFile dmsInstanceFile = new DmsInstanceFile();
dmsInstanceFile.setTargetId(dmsFaultInstanceActivity.getInstanceActivityId());
dmsInstanceFile.setTargetType("1");
dmsInstanceFile.setFilePath(fileUrl);
dmsInstanceFiles.add(dmsInstanceFile);
}
dmsInstanceFileMapper.batchDmsInstanceFile(dmsInstanceFiles);
}
batchInsertInstanceFiles(fileUrls, dmsFaultInstanceActivity.getInstanceActivityId());
return rows;
}
@ -191,4 +177,196 @@ public class DmsBillsFaultInstanceServiceImpl implements IDmsBillsFaultInstanceS
return i;
}
/**
* Join
*
* @param dmsBillsFaultInstance
* @return
*/
@Override
public List<DmsBillsFaultInstance> selectDmsBillsFaultInstanceJoinList(DmsBillsFaultInstance dmsBillsFaultInstance) {
return dmsBillsFaultInstanceMapper.selectDmsBillsFaultInstanceJoinList(dmsBillsFaultInstance);
}
/**
* 使
*
* @param repairInstanceId
* @return
*/
@Override
public DmsBillsFaultInstance getDmsBillsFaultInstance4Repair(Long repairInstanceId) {
DmsBillsFaultInstance dmsBillsFaultInstance = dmsBillsFaultInstanceMapper.selectFaultInstanceJoinActivityByRepairInstanceId(repairInstanceId);
List<DmsFaultInstanceActivity> dmsBillsFaultInstanceActivityList = dmsBillsFaultInstance.getDmsFaultInstanceActivityList();
DmsFaultInstanceActivity firstStepActivity = dmsBillsFaultInstanceActivityList.get(0);
DmsFaultInstanceActivity dmsFaultInstanceActivity;
if (dmsBillsFaultInstanceActivityList.size() == 1) {
dmsFaultInstanceActivity = firstStepActivity;
} else {
dmsFaultInstanceActivity = dmsBillsFaultInstanceActivityList.get(1);
dmsBillsFaultInstance.setInstanceActivityId(dmsFaultInstanceActivity.getInstanceActivityId());
}
dmsBillsFaultInstance.setFaultType(dmsFaultInstanceActivity.getFaultType());
dmsBillsFaultInstance.setFaultDescription(firstStepActivity.getFaultDescription());
dmsBillsFaultInstance.setDesignOperations(dmsFaultInstanceActivity.getDesignOperations());
dmsBillsFaultInstance.setDeviceId(dmsFaultInstanceActivity.getDeviceId());
dmsBillsFaultInstance.setRepairType(dmsFaultInstanceActivity.getRepairType());
dmsBillsFaultInstance.setOutsrcId(dmsFaultInstanceActivity.getOutsrcId());
dmsBillsFaultInstance.setProcessHandleResolution(dmsFaultInstanceActivity.getProcessHandleResolution());
dmsBillsFaultInstance.setDmsFaultInstanceActivityList(null);
DmsInstanceFile queryInstanceFile = new DmsInstanceFile();
queryInstanceFile.setTargetType(DmsConstants.DMS_INSTANCE_FILE_TARGET_TYPE_FAULT_INSTANCE_ACTIVITY);
queryInstanceFile.setTargetId(firstStepActivity.getInstanceActivityId());
List<DmsInstanceFile> dmsInstanceFiles = dmsInstanceFileMapper.selectDmsInstanceFileList(queryInstanceFile);
dmsBillsFaultInstance.setDmsInstanceFiles(dmsInstanceFiles);
return dmsBillsFaultInstance;
}
/**
*
*
* @param dmsFaultInstanceActivity
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int updateDmsFaultInstanceActivity(DmsFaultInstanceActivity dmsFaultInstanceActivity) {
//存储图片
List<String> fileUrls = dmsFaultInstanceActivity.getFileUrls();
batchInsertInstanceFiles(fileUrls, dmsFaultInstanceActivity.getInstanceActivityId());
return dmsFaultInstanceActivityMapper.updateDmsFaultInstanceActivity(dmsFaultInstanceActivity);
}
/**
*
*
* @param dmsBillsFaultInstanceScanVo
*/
@Override
public void scanDevice4Repair(DmsBillsFaultInstanceScanVo dmsBillsFaultInstanceScanVo) {
Long count = dmsBillsFaultInstanceMapper.selectCountByRepairInstanceIdAndDeviceCode(
dmsBillsFaultInstanceScanVo.getRepairInstanceId(), dmsBillsFaultInstanceScanVo.getDeviceCode());
if (count <= 0) {
throw new ServiceException("扫描验证失败");
}
}
/**
*
*
* @param dmsFaultInstanceActivity
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int startRepair(DmsFaultInstanceActivity dmsFaultInstanceActivity) {
DmsBillsFaultInstance dmsBillsFaultInstance = dmsBillsFaultInstanceMapper
.selectFaultInstanceJoinFirstById(dmsFaultInstanceActivity.getRepairInstanceId());//join 第一步activity
String dmsBillsStatus = dmsBillsFaultInstance.getBillsStatus();
if (dmsBillsStatus.equals(DmsConstants.DMS_BILLS_FAULT_INSTANCE_STATUS_FINISH)) {//维修完成
throw new ServiceException("已经维修完成");
}
Date currentDate = new Date();
String userName = SecurityUtils.getUsername();
if (dmsBillsStatus.equals(DmsConstants.DMS_BILLS_FAULT_INSTANCE_STATUS_TO_REPAIR)) {//待维修
dmsBillsFaultInstance.setBillsStatus(DmsConstants.DMS_BILLS_FAULT_INSTANCE_STATUS_REPAIRING);
dmsBillsFaultInstance.setRealBeginTime(currentDate);
dmsBillsFaultInstance.setUpdateTime(currentDate);
dmsBillsFaultInstance.setUpdateBy(userName);
dmsBillsFaultInstanceMapper.updateDmsBillsFaultInstance(dmsBillsFaultInstance);
dmsFaultInstanceActivity.setRepairInstanceId(dmsBillsFaultInstance.getRepairInstanceId());
dmsFaultInstanceActivity.setProcessActivityId(WfConstants.WF_BILLS_FAULT_INSTANCE_PROCESS_ACTIVITY_SECOND_ID);
dmsFaultInstanceActivity.setDeviceId(dmsBillsFaultInstance.getDeviceId());
dmsFaultInstanceActivity.setProcessHandleStatus(DmsConstants.DMS_BILLS_FAULT_INSTANCE_ACTIVITY_HANDLE_STATUS_EXECUTING);
dmsFaultInstanceActivity.setProcessStepOrder(2L);
dmsFaultInstanceActivity.setStartTime(currentDate);
dmsFaultInstanceActivity.setHandleUserId(SecurityUtils.getUserId());
dmsFaultInstanceActivity.setHandleBy(userName);
dmsFaultInstanceActivity.setHandleTime(currentDate);
dmsFaultInstanceActivity.setCreateBy(userName);
dmsFaultInstanceActivity.setCreateTime(currentDate);
dmsFaultInstanceActivityMapper.insertDmsFaultInstanceActivity(dmsFaultInstanceActivity);
DmsFaultInstanceActivity firstInstanceActivity = new DmsFaultInstanceActivity();
firstInstanceActivity.setInstanceActivityId(dmsBillsFaultInstance.getInstanceActivityId());
firstInstanceActivity.setProcessHandleStatus(DmsConstants.DMS_BILLS_FAULT_INSTANCE_ACTIVITY_HANDLE_STATUS_FINISH);
firstInstanceActivity.setEndTime(currentDate);
dmsFaultInstanceActivityMapper.updateDmsFaultInstanceActivity(firstInstanceActivity);
} else {//维修中
dmsFaultInstanceActivityMapper.updateDmsFaultInstanceActivity(dmsFaultInstanceActivity);
}
return 1;
}
/**
*
*
* @param dmsFaultInstanceActivity
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int completeRepair(DmsFaultInstanceActivity dmsFaultInstanceActivity) {
DmsBillsFaultInstance dmsBillsFaultInstance = dmsBillsFaultInstanceMapper.
selectDmsBillsFaultInstanceByRepairInstanceId(dmsFaultInstanceActivity.getRepairInstanceId());
String dmsBillsStatus = dmsBillsFaultInstance.getBillsStatus();
if (dmsBillsStatus.equals(DmsConstants.DMS_BILLS_FAULT_INSTANCE_STATUS_FINISH)) {//维修完成
throw new ServiceException("已经维修完成");
}
if (dmsBillsStatus.equals(DmsConstants.DMS_BILLS_FAULT_INSTANCE_STATUS_TO_REPAIR)) {//待维修
throw new ServiceException("请先开始维修");
}
Date currentDate = new Date();
String userName = SecurityUtils.getUsername();
dmsBillsFaultInstance.setBillsStatus(DmsConstants.DMS_BILLS_FAULT_INSTANCE_STATUS_FINISH);
dmsBillsFaultInstance.setRealEndTime(currentDate);
dmsBillsFaultInstance.setUpdateBy(userName);
dmsBillsFaultInstance.setUpdateTime(currentDate);
dmsBillsFaultInstanceMapper.updateDmsBillsFaultInstance(dmsBillsFaultInstance);
dmsFaultInstanceActivity.setProcessHandleStatus(DmsConstants.DMS_BILLS_FAULT_INSTANCE_ACTIVITY_HANDLE_STATUS_FINISH);
dmsFaultInstanceActivity.setEndTime(currentDate);
dmsFaultInstanceActivityMapper.updateDmsFaultInstanceActivity(dmsFaultInstanceActivity);
return 1;
}
public void batchInsertInstanceFiles(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(DmsConstants.DMS_INSTANCE_FILE_TARGET_TYPE_FAULT_INSTANCE_ACTIVITY);
dmsInstanceFile.setFilePath(fileUrl);
dmsInstanceFiles.add(dmsInstanceFile);
}
dmsInstanceFileMapper.batchDmsInstanceFile(dmsInstanceFiles);
}
}
}

@ -1,20 +1,30 @@
package com.hw.dms.service.impl;
import java.text.SimpleDateFormat;
import java.util.List;
import com.hw.common.core.constant.DmsConstants;
import com.hw.common.core.constant.QmsConstants;
import com.hw.common.core.constant.SecurityConstants;
import com.hw.common.core.exception.ServiceException;
import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.StringUtils;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.dms.domain.DmsBillsInspectInstance;
import com.hw.dms.domain.DmsBillsInspectInstanceActivity;
import com.hw.dms.mapper.DmsBillsInspectInstanceActivityMapper;
import com.hw.dms.mapper.DmsRepairInstanceMapper;
import com.hw.dms.domain.DmsInspectInstanceDetail;
import com.hw.dms.domain.DmsInspectInstanceDetailProject;
import com.hw.dms.domain.vo.DmsBillsInspectInstanceScanVo;
import com.hw.dms.mapper.*;
import com.hw.dms.service.IDmsBillsInspectInstanceService;
import com.hw.system.api.RemoteSysCommonService;
import com.hw.system.api.model.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.dms.mapper.DmsBillsInspectInstanceMapper;
import com.hw.dms.domain.DmsBillsInspectInstance;
import com.hw.dms.service.IDmsBillsInspectInstanceService;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* Service
@ -23,8 +33,7 @@ import com.hw.dms.service.IDmsBillsInspectInstanceService;
* @date 2024-01-23
*/
@Service
public class DmsBillsInspectInstanceServiceImpl implements IDmsBillsInspectInstanceService
{
public class DmsBillsInspectInstanceServiceImpl implements IDmsBillsInspectInstanceService {
@Autowired
private DmsBillsInspectInstanceMapper dmsBillsInspectInstanceMapper;
@Autowired
@ -32,6 +41,12 @@ public class DmsBillsInspectInstanceServiceImpl implements IDmsBillsInspectInsta
@Autowired
private DmsRepairInstanceMapper dmsRepairInstanceMapper;
@Autowired
private DmsInspectInstanceDetailMapper dmsInspectInstanceDetailMapper;
@Autowired
private DmsInspectInstanceDetailProjectMapper dmsInspectInstanceDetailProjectMapper;
@Autowired
private DmsInspectInstanceDetailProjectMapper dmsInspectInstanceDetailPrjectMapper;
@Autowired
private RemoteSysCommonService remoteSysCommonService;
/**
@ -41,8 +56,7 @@ public class DmsBillsInspectInstanceServiceImpl implements IDmsBillsInspectInsta
* @return
*/
@Override
public DmsBillsInspectInstance selectDmsBillsInspectInstanceByInspectInstanceId(Long inspectInstanceId)
{
public DmsBillsInspectInstance selectDmsBillsInspectInstanceByInspectInstanceId(Long inspectInstanceId) {
return dmsBillsInspectInstanceMapper.selectDmsBillsInspectInstanceByInspectInstanceId(inspectInstanceId);
}
@ -53,8 +67,7 @@ public class DmsBillsInspectInstanceServiceImpl implements IDmsBillsInspectInsta
* @return
*/
@Override
public List<DmsBillsInspectInstance> selectDmsBillsInspectInstanceList(DmsBillsInspectInstance dmsBillsInspectInstance)
{
public List<DmsBillsInspectInstance> selectDmsBillsInspectInstanceList(DmsBillsInspectInstance dmsBillsInspectInstance) {
return dmsBillsInspectInstanceMapper.selectDmsBillsInspectInstanceList(dmsBillsInspectInstance);
}
@ -75,14 +88,13 @@ public class DmsBillsInspectInstanceServiceImpl implements IDmsBillsInspectInsta
* @return
*/
@Override
public int insertDmsBillsInspectInstance(DmsBillsInspectInstance dmsBillsInspectInstance)
{
public int insertDmsBillsInspectInstance(DmsBillsInspectInstance dmsBillsInspectInstance) {
LoginUser user = new LoginUser();
//写死105也可根据传入对象的wfprocessid作为传参。
Long aLong = dmsRepairInstanceMapper.selectWfProcessActivityId(105l);
if (dmsBillsInspectInstance.getInspectType().equals("1")){
if (dmsBillsInspectInstance.getInspectType().equals("1")) {
dmsBillsInspectInstance.setWfProcessId(105l);
}else if (dmsBillsInspectInstance.getInspectType().equals("2")){
} else if (dmsBillsInspectInstance.getInspectType().equals("2")) {
dmsBillsInspectInstance.setWfProcessId(104l);
}
dmsBillsInspectInstance.setCreateTime(DateUtils.getNowDate());
@ -109,8 +121,7 @@ public class DmsBillsInspectInstanceServiceImpl implements IDmsBillsInspectInsta
* @return
*/
@Override
public int updateDmsBillsInspectInstance(DmsBillsInspectInstance dmsBillsInspectInstance)
{
public int updateDmsBillsInspectInstance(DmsBillsInspectInstance dmsBillsInspectInstance) {
dmsBillsInspectInstance.setUpdateTime(DateUtils.getNowDate());
return dmsBillsInspectInstanceMapper.updateDmsBillsInspectInstance(dmsBillsInspectInstance);
}
@ -122,8 +133,7 @@ public class DmsBillsInspectInstanceServiceImpl implements IDmsBillsInspectInsta
* @return
*/
@Override
public int deleteDmsBillsInspectInstanceByInspectInstanceIds(Long[] inspectInstanceIds)
{
public int deleteDmsBillsInspectInstanceByInspectInstanceIds(Long[] inspectInstanceIds) {
return dmsBillsInspectInstanceMapper.deleteDmsBillsInspectInstanceByInspectInstanceIds(inspectInstanceIds);
}
@ -134,8 +144,7 @@ public class DmsBillsInspectInstanceServiceImpl implements IDmsBillsInspectInsta
* @return
*/
@Override
public int deleteDmsBillsInspectInstanceByInspectInstanceId(Long inspectInstanceId)
{
public int deleteDmsBillsInspectInstanceByInspectInstanceId(Long inspectInstanceId) {
return dmsBillsInspectInstanceMapper.deleteDmsBillsInspectInstanceByInspectInstanceId(inspectInstanceId);
}
@ -143,13 +152,12 @@ public class DmsBillsInspectInstanceServiceImpl implements IDmsBillsInspectInsta
public int insertDmsBillsInspectInstancePDA(DmsBillsInspectInstance dmsBillsInspectInstance) {
Long along = null;
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHH");
if (dmsBillsInspectInstance.getInspectType().equals("1")){
if (dmsBillsInspectInstance.getInspectType().equals("1")) {
dmsBillsInspectInstance.setWfProcessId(105l);
along = remoteSysCommonService.selectProcessActivityIdByWfProcessId(SecurityConstants.INNER,105l);
}
else if (dmsBillsInspectInstance.getInspectType().equals("2")){
along = remoteSysCommonService.selectProcessActivityIdByWfProcessId(SecurityConstants.INNER, 105l);
} else if (dmsBillsInspectInstance.getInspectType().equals("2")) {
dmsBillsInspectInstance.setWfProcessId(104l);
along = remoteSysCommonService.selectProcessActivityIdByWfProcessId(SecurityConstants.INNER,104l);
along = remoteSysCommonService.selectProcessActivityIdByWfProcessId(SecurityConstants.INNER, 104l);
}
dmsBillsInspectInstance.setBillsInspectCode(sdf.format(DateUtils.getNowDate()));
@ -171,4 +179,153 @@ public class DmsBillsInspectInstanceServiceImpl implements IDmsBillsInspectInsta
}
/**
*
*
* @param dmsBillsInspectInstance
* @return
*/
@Override
public DmsBillsInspectInstance getNewestBillsInspectInstance(DmsBillsInspectInstance dmsBillsInspectInstance) {
dmsBillsInspectInstance.setInspectStatusStr(DmsConstants.DMS_BILLS_INSPECT_INSTANCE_INSPECT_STATUS_TO_INSPECT + "," + DmsConstants.DMS_BILLS_INSPECT_INSTANCE_INSPECT_STATUS_INSPECTING);
DmsBillsInspectInstance newestBillsInspectInstance = dmsBillsInspectInstanceMapper.selectNewestDmsBillsInspectInstance(dmsBillsInspectInstance);
if (newestBillsInspectInstance != null) {
DmsInspectInstanceDetail queryInspectInstanceDetail = new DmsInspectInstanceDetail();
queryInspectInstanceDetail.setInspectInstanceId(newestBillsInspectInstance.getInspectInstanceId());
List<DmsInspectInstanceDetail> inspectInstanceDetails = dmsInspectInstanceDetailMapper.selectDmsInspectInstanceDetailJoinList(queryInspectInstanceDetail);
newestBillsInspectInstance.setDmsInspectInstanceDetailList(inspectInstanceDetails);
}
return newestBillsInspectInstance;
}
/**
*
*
* @param dmsBillsInspectInstanceScanVo
* @return
*/
@Override
public DmsInspectInstanceDetail scanInspectInstanceDetail(DmsBillsInspectInstanceScanVo dmsBillsInspectInstanceScanVo) {
DmsInspectInstanceDetail dmsInspectInstanceDetail = dmsInspectInstanceDetailMapper.selectDmsInspectInstanceDetailByUI(dmsBillsInspectInstanceScanVo.getInspectInstanceId(),
dmsBillsInspectInstanceScanVo.getDeviceCode());
if (dmsInspectInstanceDetail == null) {
throw new ServiceException("无此设备的检查工单");
}
Long deviceId = dmsInspectInstanceDetail.getDeviceId();
DmsInspectInstanceDetailProject queryInspectInstanceDetailProject = new DmsInspectInstanceDetailProject();
queryInspectInstanceDetailProject.setDeviceId(deviceId);
List<DmsInspectInstanceDetailProject> dmsInspectInstanceDetailProjects = dmsInspectInstanceDetailPrjectMapper.selectDmsInspectInstanceDetailProjectJoinList(queryInspectInstanceDetailProject);
dmsInspectInstanceDetail.setDmsInspectInstanceDetailProjectList(dmsInspectInstanceDetailProjects);
return dmsInspectInstanceDetail;
}
/**
*
*
* @param dmsInspectInstanceDetail
* @return
*/
@Transactional
@Override
public int updateDmsInspectInstanceDetail(DmsInspectInstanceDetail dmsInspectInstanceDetail) {
String userName = SecurityUtils.getUsername();
Date currentDate = new Date();
dmsInspectInstanceDetail.setUpdateTime(currentDate);
dmsInspectInstanceDetail.setUpdateBy(userName);
DmsInspectInstanceDetail returnInspectInstanceDetail = handleDmsInspectInstanceDetailProject(dmsInspectInstanceDetail);
if (returnInspectInstanceDetail != null) {
dmsInspectInstanceDetail.setInspectStatus(returnInspectInstanceDetail.getInspectStatus());
dmsInspectInstanceDetail.setInstanceDetailStatus(returnInspectInstanceDetail.getInstanceDetailStatus());
dmsInspectInstanceDetail.setDmsInspectInstanceDetailProjectList(returnInspectInstanceDetail.getDmsInspectInstanceDetailProjectList());
batchUpdateDmsInspectInstanceDetailProject(dmsInspectInstanceDetail);
}
return dmsInspectInstanceDetailMapper.updateDmsInspectInstanceDetail(dmsInspectInstanceDetail);
}
/**
*
*
* @param dmsInspectInstanceDetail
*/
public DmsInspectInstanceDetail handleDmsInspectInstanceDetailProject(DmsInspectInstanceDetail dmsInspectInstanceDetail) {
String instanceDetailStatus = DmsConstants.DMS_INSPECT_INSTANCE_DETAIL_STATUS_FINISH;
String inspectStatus = DmsConstants.DMS_INSPECT_INSTANCE_DETAIL_INSPECT_STATUS_PASS;//质检结果检验状态
List<DmsInspectInstanceDetailProject> inspectInstanceDetailProjectList = dmsInspectInstanceDetail.getDmsInspectInstanceDetailProjectList();
if (StringUtils.isNotNull(inspectInstanceDetailProjectList)) {
DmsInspectInstanceDetail returnInspectInstanceDetail = new DmsInspectInstanceDetail();
List<DmsInspectInstanceDetailProject> toUpdatedList = new ArrayList<>();
for (DmsInspectInstanceDetailProject inspectInstanceDetailProject : inspectInstanceDetailProjectList) {
String inspectProjectProperty = inspectInstanceDetailProject.getInspectProjectProperty();
if (inspectProjectProperty.equals(DmsConstants.DMS_INSPECT_INSTANCE_PROJECT_PROPERTY_QUALITATIVE)) {//如果是定性
String inspectProjectStatus = inspectInstanceDetailProject.getInspectProjectStatus();
if (inspectProjectStatus != null) {
if (inspectProjectStatus.equals(DmsConstants.DMS_INSPECT_INSTANCE_DETAIL_PROJECT_STATUS_FAIL)) {
inspectStatus = DmsConstants.DMS_INSPECT_INSTANCE_DETAIL_INSPECT_STATUS_FAIL;
}
} else {
instanceDetailStatus = DmsConstants.DMS_INSPECT_INSTANCE_DETAIL_STATUS_INSPECTING;
}
} else {//如果是定量
BigDecimal inspectProjectResult = inspectInstanceDetailProject.getInspectProjectResult();
if (inspectProjectResult != null) {
BigDecimal standardValue = inspectInstanceDetailProject.getDefValue();
BigDecimal upperDiff = inspectInstanceDetailProject.getUpLimit();
BigDecimal downDiff = inspectInstanceDetailProject.getLowLimit();
if (upperDiff == null) {//如果没设置上差值,则标准值为上差值
upperDiff = standardValue;
} else if (downDiff == null) {//如果没设置下差值,则标准值为下差值
downDiff = standardValue;
}
if (inspectProjectResult.compareTo(downDiff) >= 0 && inspectProjectResult.compareTo(upperDiff) <= 0) {
inspectInstanceDetailProject.setInspectProjectStatus(DmsConstants.DMS_INSPECT_INSTANCE_DETAIL_PROJECT_STATUS_PASS);
} else {
inspectInstanceDetailProject.setInspectProjectStatus(DmsConstants.DMS_INSPECT_INSTANCE_DETAIL_PROJECT_STATUS_FAIL);
inspectStatus = DmsConstants.DMS_INSPECT_INSTANCE_DETAIL_INSPECT_STATUS_FAIL;
}
} else {
instanceDetailStatus = DmsConstants.DMS_INSPECT_INSTANCE_DETAIL_STATUS_INSPECTING;
}
}
toUpdatedList.add(inspectInstanceDetailProject);
}
returnInspectInstanceDetail.setInspectStatus(inspectStatus);
returnInspectInstanceDetail.setInstanceDetailStatus(instanceDetailStatus);
returnInspectInstanceDetail.setDmsInspectInstanceDetailProjectList(toUpdatedList);
return returnInspectInstanceDetail;
}
return null;
}
/**
* (publicprivate)
*/
public void batchUpdateDmsInspectInstanceDetailProject(DmsInspectInstanceDetail dmsInspectInstanceDetail) {
List<DmsInspectInstanceDetailProject> inspectInstanceDetailProjects = dmsInspectInstanceDetail.getDmsInspectInstanceDetailProjectList();
for (DmsInspectInstanceDetailProject dmsInspectInstanceDetailProject : inspectInstanceDetailProjects) {
if (dmsInspectInstanceDetailProject.getInstanceDetailProjectId() == null) {
dmsInspectInstanceDetailProject.setInstanceDetailId(dmsInspectInstanceDetail.getInstanceDetailId());
dmsInspectInstanceDetailProjectMapper.insertDmsInspectInstanceDetailProject(dmsInspectInstanceDetailProject);
} else {
dmsInspectInstanceDetailProjectMapper.updateDmsInspectInstanceDetailProject(dmsInspectInstanceDetailProject);
}
}
}
}

@ -121,4 +121,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{deviceId}
</foreach>
</delete>
<select id="selectDmsBaseDeviceLedgerByDeviceCode" parameterType="Long" resultMap="DmsBaseDeviceLedgerResult">
<include refid="selectDmsBaseDeviceLedgerVo"/>
where device_code = #{deviceCode}
</select>
</mapper>

@ -24,6 +24,49 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="deviceId" column="device_id" />
<result property="deviceCode" column="device_code" />
<result property="deviceName" column="device_name" />
<result property="deviceLocation" column="device_location" />
<result property="deviceSpec" column="device_spec" />
<result property="instanceActivityId" column="instance_activity_id" />
<result property="faultType" column="fault_type" />
<result property="faultDescription" column="fault_description" />
<result property="designOperations" column="design_operations" />
<result property="repairType" column="repair_type" />
<result property="outsrcId" column="outsrc_id" />
<result property="processHandleResolution" column="process_handle_resolution" />
</resultMap>
<resultMap id="DmsBillsFaultInstanceDmsFaultInstanceActivityResult" type="DmsBillsFaultInstance" extends="DmsBillsFaultInstanceResult">
<collection property="dmsFaultInstanceActivityList" notNullColumn="sub_instance_activity_id" javaType="java.util.List" resultMap="DmsFaultInstanceActivityResult" />
</resultMap>
<resultMap type="DmsFaultInstanceActivity" id="DmsFaultInstanceActivityResult">
<result property="instanceActivityId" column="sub_instance_activity_id" />
<result property="repairInstanceId" column="sub_repair_instance_id" />
<result property="processActivityId" column="sub_process_activity_id" />
<result property="faultType" column="sub_fault_type" />
<result property="faultDescription" column="sub_fault_description" />
<result property="designOperations" column="sub_design_operations" />
<result property="deviceId" column="sub_device_id" />
<result property="repairType" column="sub_repair_type" />
<result property="outsrcId" column="sub_outsrc_id" />
<result property="processHandleResolution" column="sub_process_handle_resolution" />
<result property="remark" column="sub_remark" />
<result property="processHandleStatus" column="sub_process_handle_status" />
<result property="processStepOrder" column="sub_process_step_order" />
<result property="startTime" column="sub_start_time" />
<result property="endTime" column="sub_end_time" />
<result property="handleUserId" column="sub_handle_user_id" />
<result property="handleBy" column="sub_handle_by" />
<result property="handleTime" column="sub_handle_time" />
<result property="createBy" column="sub_create_by" />
<result property="createTime" column="sub_create_time" />
<result property="transferUserId" column="sub_transfer_user_id" />
<result property="attr1" column="sub_attr1" />
</resultMap>
@ -139,4 +182,76 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select min(process_activity_id) from wf_process_activity where wf_process_id = #{wfProcessId}
</select>
<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,
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>
<select id="selectDmsBillsFaultInstanceJoinList" parameterType="DmsBillsFaultInstance" resultMap="DmsBillsFaultInstanceResult">
<include refid="selectDmsBillsFaultInstanceJoinVo"/>
<where>
<if test="faultSourceType != null and faultSourceType != ''"> and fault_source_type = #{faultSourceType}</if>
<if test="faultSourceId != null "> and fault_source_id = #{faultSourceId}</if>
<if test="repairInstanceId != null "> and repair_instance_id = #{repairInstanceId}</if>
<if test="wfProcessId != null "> and wf_process_id = #{wfProcessId}</if>
<if test="billsFaultCode != null and billsFaultCode != ''"> and bills_fault_code = #{billsFaultCode}</if>
<if test="billsStatus != null and billsStatus != ''"> and bills_status = #{billsStatus}</if>
<if test="applyUser != null and applyUser != ''"> and apply_user = #{applyUser}</if>
<if test="applyTime != null "> and apply_time = #{applyTime}</if>
<if test="instanceType != null and instanceType != ''"> and instance_type = #{instanceType}</if>
<if test="isFlag != null and isFlag != ''"> and is_flag = #{isFlag}</if>
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
</where>
</select>
<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,
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
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
</select>
<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,
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>
<select id="selectCountByRepairInstanceIdAndDeviceCode" resultType="Long">
select count(1) from dms_bills_fault_instance dbfi where dbfi.repair_instance_id=#{repairInstanceId}
and exists (select 1 from dms_base_device_ledger dbdl where dbfi.device_id=dbdl.device_id and dbdl.device_code=#{deviceCode})
</select>
<select id="selectFaultInstanceJoinFirstById" 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,
dfia.instance_activity_id,dfia.fault_type,dfia.fault_description,dfia.design_operations,dfia.repair_type,dfia.outsrc_id,dfia.process_handle_resolution
from dms_bills_fault_instance dbfi
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>
</mapper>

@ -21,6 +21,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="inspectRouteId" column="inspect_route_id" />
<result property="routeName" column="route_name" />
</resultMap>
<sql id="selectDmsBillsInspectInstanceVo">
@ -127,4 +129,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{inspectInstanceId}
</foreach>
</delete>
<select id="selectNewestDmsBillsInspectInstance" parameterType="DmsBillsInspectInstance" resultMap="DmsBillsInspectInstanceResult">
select dbii.inspect_instance_id, dbii.plan_inspect_id, dbii.wf_process_id, dbii.inspect_type, dbii.bills_inspect_code,
dbii.plan_begin_time,dbii.plan_end_time, dbii.real_begin_time, dbii.real_end_time, dbii.inspect_status,dbii.create_time,
dbir.route_name
from dms_bills_inspect_instance dbii left join dms_base_inspect_route dbir on dbii.inspect_route_id=dbir.inspect_route_id
<where>
<if test="inspectRouteId != null "> and dbii.inspect_route_id = #{inspectRouteId}</if>
<if test="wfProcessId != null "> and dbii.wf_process_id = #{wfProcessId}</if>
<if test="inspectType != null and inspectType != ''"> and dbii.inspect_type = #{inspectType}</if>
<if test="billsInspectCode != null and billsInspectCode != ''"> and dbii.bills_inspect_code = #{billsInspectCode}</if>
<if test="inspectStatus != null and inspectStatus != ''"> and dbii.inspect_status = #{inspectStatus}</if>
<if test="inspectStatusStr != null and inspectStatusStr != ''"> and dbii.inspect_status in (${inspectStatusStr})</if>
<if test="isFlag != null and isFlag != ''"> and dbii.is_flag = #{isFlag}</if>
</where>
order by dbii.create_time desc limit 1
</select>
</mapper>

@ -0,0 +1,141 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hw.dms.mapper.DmsInspectInstanceDetailMapper">
<resultMap type="DmsInspectInstanceDetail" id="DmsInspectInstanceDetailResult">
<result property="instanceDetailId" column="instance_detail_id" />
<result property="inspectInstanceId" column="inspect_instance_id" />
<result property="lineStep" column="line_step" />
<result property="realLineStep" column="real_line_step" />
<result property="deviceId" column="device_id" />
<result property="instanceDetailStatus" column="instance_detail_status" />
<result property="inspectStandard" column="inspect_standard" />
<result property="inspectDesc" column="inspect_desc" />
<result property="inspectStatus" column="inspect_status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="deviceCode" column="device_code" />
<result property="deviceName" column="device_name" />
</resultMap>
<sql id="selectDmsInspectInstanceDetailVo">
select instance_detail_id, inspect_instance_id, line_step, real_line_step, device_id, instance_detail_status, inspect_standard, inspect_desc, inspect_value, inspect_status, create_by, create_time, update_by, update_time from dms_inspect_instance_detail
</sql>
<select id="selectDmsInspectInstanceDetailList" parameterType="DmsInspectInstanceDetail" resultMap="DmsInspectInstanceDetailResult">
<include refid="selectDmsInspectInstanceDetailVo"/>
<where>
<if test="inspectInstanceId != null "> and inspect_instance_id = #{inspectInstanceId}</if>
<if test="lineStep != null "> and line_step = #{lineStep}</if>
<if test="realLineStep != null "> and real_line_step = #{realLineStep}</if>
<if test="deviceId != null "> and device_id = #{deviceId}</if>
<if test="instanceDetailStatus != null and instanceDetailStatus != ''"> and instance_detail_status = #{instanceDetailStatus}</if>
<if test="inspectStandard != null and inspectStandard != ''"> and inspect_standard = #{inspectStandard}</if>
<if test="inspectDesc != null and inspectDesc != ''"> and inspect_desc = #{inspectDesc}</if>
<if test="inspectStatus != null and inspectStatus != ''"> and inspect_status = #{inspectStatus}</if>
</where>
</select>
<select id="selectDmsInspectInstanceDetailByInstanceDetailId" parameterType="Long" resultMap="DmsInspectInstanceDetailResult">
<include refid="selectDmsInspectInstanceDetailVo"/>
where instance_detail_id = #{instanceDetailId}
</select>
<insert id="insertDmsInspectInstanceDetail" parameterType="DmsInspectInstanceDetail" useGeneratedKeys="true" keyProperty="instanceDetailId">
insert into dms_inspect_instance_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="inspectInstanceId != null">inspect_instance_id,</if>
<if test="lineStep != null">line_step,</if>
<if test="realLineStep != null">real_line_step,</if>
<if test="deviceId != null">device_id,</if>
<if test="instanceDetailStatus != null">instance_detail_status,</if>
<if test="inspectStandard != null">inspect_standard,</if>
<if test="inspectDesc != null">inspect_desc,</if>
<if test="inspectStatus != null">inspect_status,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="inspectInstanceId != null">#{inspectInstanceId},</if>
<if test="lineStep != null">#{lineStep},</if>
<if test="realLineStep != null">#{realLineStep},</if>
<if test="deviceId != null">#{deviceId},</if>
<if test="instanceDetailStatus != null">#{instanceDetailStatus},</if>
<if test="inspectStandard != null">#{inspectStandard},</if>
<if test="inspectDesc != null">#{inspectDesc},</if>
<if test="inspectStatus != null">#{inspectStatus},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateDmsInspectInstanceDetail" parameterType="DmsInspectInstanceDetail">
update dms_inspect_instance_detail
<trim prefix="SET" suffixOverrides=",">
<if test="inspectInstanceId != null">inspect_instance_id = #{inspectInstanceId},</if>
<if test="lineStep != null">line_step = #{lineStep},</if>
<if test="realLineStep != null">real_line_step = #{realLineStep},</if>
<if test="deviceId != null">device_id = #{deviceId},</if>
<if test="instanceDetailStatus != null">instance_detail_status = #{instanceDetailStatus},</if>
<if test="inspectStandard != null">inspect_standard = #{inspectStandard},</if>
<if test="inspectDesc != null">inspect_desc = #{inspectDesc},</if>
<if test="inspectStatus != null">inspect_status = #{inspectStatus},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where instance_detail_id = #{instanceDetailId}
</update>
<delete id="deleteDmsInspectInstanceDetailByInstanceDetailId" parameterType="Long">
delete from dms_inspect_instance_detail where instance_detail_id = #{instanceDetailId}
</delete>
<delete id="deleteDmsInspectInstanceDetailByInstanceDetailIds" parameterType="String">
delete from dms_inspect_instance_detail where instance_detail_id in
<foreach item="instanceDetailId" collection="array" open="(" separator="," close=")">
#{instanceDetailId}
</foreach>
</delete>
<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
</sql>
<select id="selectDmsInspectInstanceDetailJoinList" parameterType="DmsInspectInstanceDetail" resultMap="DmsInspectInstanceDetailResult">
<include refid="selectDmsInspectInstanceDetailJoinVo"/>
<where>
<if test="deviceCode != null and deviceCode != ''"> and dbdl.device_code = #{deviceCode}</if>
<if test="inspectInstanceId != null "> and diid.inspect_instance_id = #{inspectInstanceId}</if>
<if test="lineStep != null "> and diid.line_step = #{lineStep}</if>
<if test="realLineStep != null "> and diid.real_line_step = #{realLineStep}</if>
<if test="deviceId != null "> and diid.device_id = #{deviceId}</if>
<if test="instanceDetailStatus != null and instanceDetailStatus != ''"> and diid.instance_detail_status = #{instanceDetailStatus}</if>
<if test="inspectStandard != null and inspectStandard != ''"> and diid.inspect_standard = #{inspectStandard}</if>
<if test="inspectStatus != null and inspectStatus != ''"> and diid.inspect_status = #{inspectStatus}</if>
</where>
</select>
<select id="selectDmsInspectInstanceDetailByUI" resultMap="DmsInspectInstanceDetailResult">
<include refid="selectDmsInspectInstanceDetailJoinVo"/>
where diid.inspect_instance_id = #{inspectInstanceId} and dbdl.device_code = #{deviceCode}
limit 1
</select>
</mapper>

@ -0,0 +1,149 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hw.dms.mapper.DmsInspectInstanceDetailProjectMapper">
<resultMap type="DmsInspectInstanceDetailProject" id="DmsInspectInstanceDetailProjectResult">
<result property="instanceDetailProjectId" column="instance_detail_project_id" />
<result property="instanceDetailId" column="instance_detail_id" />
<result property="inspectProjectId" column="inspect_project_id" />
<result property="inspectProjectStatus" column="inspect_project_status" />
<result property="inspectProjectResult" column="inspect_project_result" />
<result property="projectStepOrder" column="project_step_order" />
<result property="defValue" column="def_value" />
<result property="inspectProjectName" column="inspect_project_name" />
<result property="inspectProjectProperty" column="inspect_project_property" />
<result property="upLimit" column="up_limit" />
<result property="lowLimit" column="low_limit" />
<result property="inspectProjectDesc" column="inspect_project_desc" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectDmsInspectInstanceDetailProjectVo">
select instance_detail_project_id, instance_detail_id, inspect_project_id, inspect_project_status, inspect_project_result, project_step_order, def_value, inspect_project_name, inspect_project_property, up_limit, low_limit, create_by, create_time, update_by, update_time from dms_inspect_instance_detail_project
</sql>
<select id="selectDmsInspectInstanceDetailProjectList" parameterType="DmsInspectInstanceDetailProject" resultMap="DmsInspectInstanceDetailProjectResult">
<include refid="selectDmsInspectInstanceDetailProjectVo"/>
<where>
<if test="instanceDetailId != null "> and instance_detail_id = #{instanceDetailId}</if>
<if test="inspectProjectId != null "> and inspect_project_id = #{inspectProjectId}</if>
<if test="inspectProjectStatus != null and inspectProjectStatus != ''"> and inspect_project_status = #{inspectProjectStatus}</if>
<if test="inspectProjectResult != null "> and inspect_project_result = #{inspectProjectResult}</if>
<if test="projectStepOrder != null "> and project_step_order = #{projectStepOrder}</if>
<if test="defValue != null "> and def_value = #{defValue}</if>
<if test="inspectProjectName != null and inspectProjectName != ''"> and inspect_project_name like concat('%', #{inspectProjectName}, '%')</if>
<if test="inspectProjectProperty != null and inspectProjectProperty != ''"> and inspect_project_property = #{inspectProjectProperty}</if>
<if test="upLimit != null "> and up_limit = #{upLimit}</if>
<if test="lowLimit != null "> and low_limit = #{lowLimit}</if>
</where>
</select>
<select id="selectDmsInspectInstanceDetailProjectByInstanceDetailProjectId" parameterType="Long" resultMap="DmsInspectInstanceDetailProjectResult">
<include refid="selectDmsInspectInstanceDetailProjectVo"/>
where instance_detail_project_id = #{instanceDetailProjectId}
</select>
<insert id="insertDmsInspectInstanceDetailProject" parameterType="DmsInspectInstanceDetailProject" useGeneratedKeys="true" keyProperty="instanceDetailProjectId">
insert into dms_inspect_instance_detail_project
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="instanceDetailId != null">instance_detail_id,</if>
<if test="inspectProjectId != null">inspect_project_id,</if>
<if test="inspectProjectStatus != null">inspect_project_status,</if>
<if test="inspectProjectResult != null">inspect_project_result,</if>
<if test="projectStepOrder != null">project_step_order,</if>
<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="upLimit != null">up_limit,</if>
<if test="lowLimit != null">low_limit,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="instanceDetailId != null">#{instanceDetailId},</if>
<if test="inspectProjectId != null">#{inspectProjectId},</if>
<if test="inspectProjectStatus != null">#{inspectProjectStatus},</if>
<if test="inspectProjectResult != null">#{inspectProjectResult},</if>
<if test="projectStepOrder != null">#{projectStepOrder},</if>
<if test="defValue != null">#{defValue},</if>
<if test="inspectProjectName != null">#{inspectProjectName},</if>
<if test="inspectProjectProperty != null">#{inspectProjectProperty},</if>
<if test="upLimit != null">#{upLimit},</if>
<if test="lowLimit != null">#{lowLimit},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateDmsInspectInstanceDetailProject" parameterType="DmsInspectInstanceDetailProject">
update dms_inspect_instance_detail_project
<trim prefix="SET" suffixOverrides=",">
<if test="instanceDetailId != null">instance_detail_id = #{instanceDetailId},</if>
<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="projectStepOrder != null">project_step_order = #{projectStepOrder},</if>
<if test="defValue != null">def_value = #{defValue},</if>
<if test="inspectProjectName != null">inspect_project_name = #{inspectProjectName},</if>
<if test="inspectProjectProperty != null">inspect_project_property = #{inspectProjectProperty},</if>
<if test="upLimit != null">up_limit = #{upLimit},</if>
<if test="lowLimit != null">low_limit = #{lowLimit},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where instance_detail_project_id = #{instanceDetailProjectId}
</update>
<delete id="deleteDmsInspectInstanceDetailProjectByInstanceDetailProjectId" parameterType="Long">
delete from dms_inspect_instance_detail_project where instance_detail_project_id = #{instanceDetailProjectId}
</delete>
<delete id="deleteDmsInspectInstanceDetailProjectByInstanceDetailProjectIds" parameterType="String">
delete from dms_inspect_instance_detail_project where instance_detail_project_id in
<foreach item="instanceDetailProjectId" collection="array" open="(" separator="," close=")">
#{instanceDetailProjectId}
</foreach>
</delete>
<sql id="selectDmsInspectInstanceDetailProjectJoinVo">
select diidp.instance_detail_project_id, diidp.instance_detail_id, diidp.inspect_project_id, diidp.inspect_project_status,
diidp.inspect_project_result, diidp.inspect_project_desc,
dbip.inspect_project as inspect_project_name,dbip.inspect_project_property, dbip.up_limit, dbip.low_limit,dbip.def_value
from dms_inspect_instance_detail_project diidp right join dms_base_inspect_project dbip on dbip.inspect_project_id=diidp.inspect_project_id
</sql>
<select id="selectDmsInspectInstanceDetailProjectJoinList" parameterType="DmsInspectInstanceDetailProject" resultMap="DmsInspectInstanceDetailProjectResult">
<include refid="selectDmsInspectInstanceDetailProjectJoinVo"/>
<where>
<if test="deviceId != null "> and exists (select 1 from dms_inspect_project_device dipd where dipd.target_type=1
and dipd.target_id = (select device_type_id from dms_base_device_ledger where device_id=#{deviceId})
and dipd.inspect_project_id = dbip.inspect_project_id)</if>
<if test="instanceDetailId != null "> and instance_detail_id = #{instanceDetailId}</if>
<if test="inspectProjectId != null "> and inspect_project_id = #{inspectProjectId}</if>
<if test="inspectProjectStatus != null and inspectProjectStatus != ''"> and inspect_project_status = #{inspectProjectStatus}</if>
<if test="inspectProjectResult != null "> and inspect_project_result = #{inspectProjectResult}</if>
<if test="projectStepOrder != null "> and project_step_order = #{projectStepOrder}</if>
<if test="defValue != null "> and def_value = #{defValue}</if>
<if test="inspectProjectName != null and inspectProjectName != ''"> and inspect_project_name like concat('%', #{inspectProjectName}, '%')</if>
<if test="inspectProjectProperty != null and inspectProjectProperty != ''"> and inspect_project_property = #{inspectProjectProperty}</if>
<if test="upLimit != null "> and up_limit = #{upLimit}</if>
<if test="lowLimit != null "> and low_limit = #{lowLimit}</if>
</where>
</select>
</mapper>
Loading…
Cancel
Save