diff --git a/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/DmsConstants.java b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/DmsConstants.java new file mode 100644 index 0000000..1c099a6 --- /dev/null +++ b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/DmsConstants.java @@ -0,0 +1,23 @@ +package com.hw.common.core.constant; + +/** + * @Description: 设备管理常量定义 + * @ClassName: DmsConstants + * @Author : xins + * @Date :2024-03-13 17:26 + * @Version :1.0 + */ +public class DmsConstants { + + + /**故障报修工单状态*/ + public static final String DMS_BILLS_FAULT_INSTANCE_STATUS_TO_REPAIR = "0";//待维修 + + /**故障报修工单实例状态*/ + public static final String DMS_BILLS_FAULT_INSTANCE_ACTIVITY_STATUS_TO_PICK = "2";//待接取 + + + /**故障报修工单类型*/ + public static final String DMS_BILLS_FAULT_INSTANCE_TYPE_MAUAL = "1";//手工创建 + +} diff --git a/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/WfConstants.java b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/WfConstants.java index 3309013..1ad9d62 100644 --- a/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/WfConstants.java +++ b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/WfConstants.java @@ -9,7 +9,13 @@ package com.hw.common.core.constant; */ public class WfConstants { - public static final Long WF_QUALITY_ABNORMAL_PROCESS_ID = 301L; + 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_QUALITY_ABNORMAL_PROCESS_ID = 301L;//不合格处置工单流程ID /**质检工单实例状态*/ public static final String WF_INSTANCE_STATUS_TO_START = "0";//未启动 diff --git a/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/uuid/Seq.java b/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/uuid/Seq.java index a948286..05078e6 100644 --- a/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/uuid/Seq.java +++ b/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/uuid/Seq.java @@ -99,6 +99,15 @@ public class Seq { public static final String mesBarcodeCode = "TM"; + // 设备报修工单编号记录标识 + public static final String dmsBillsFaultInstanceSeqType = "DMSBILLSFAULTINSTANCE"; + + // 设备报修工单接口序列数 + private static AtomicInteger dmsBillsFaultInstanceSeq = new AtomicInteger(1); + + // 设备报修工单标识 + public static final String dmsBillsFaultInstanceSeqCode = "BF"; + /** * 获取通用序列号 * @@ -177,6 +186,8 @@ public class Seq { atomicInt = mesBatchCodeSeq; }else if (mesBarcodeSeqType.equals(type)) { atomicInt = mesBarcodeSeq; + }else if (dmsBillsFaultInstanceSeqType.equals(type)) { + atomicInt = dmsBillsFaultInstanceSeq; } return getId(atomicInt, 3, code); } diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsApiController.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsApiController.java index 10c21a6..45cfbe2 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsApiController.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsApiController.java @@ -4,7 +4,6 @@ import com.hw.common.core.web.controller.BaseController; import com.hw.common.core.web.domain.AjaxResult; import com.hw.dms.domain.*; import com.hw.dms.service.*; -import oracle.jdbc.proxy.annotation.Post; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsFaultInstanceFileController.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsFaultInstanceFileController.java deleted file mode 100644 index 7291cdd..0000000 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsFaultInstanceFileController.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.hw.dms.controller; - -import java.util.List; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.hw.common.log.annotation.Log; -import com.hw.common.log.enums.BusinessType; -import com.hw.common.security.annotation.RequiresPermissions; -import com.hw.dms.domain.DmsFaultInstanceFile; -import com.hw.dms.service.IDmsFaultInstanceFileService; -import com.hw.common.core.web.controller.BaseController; -import com.hw.common.core.web.domain.AjaxResult; -import com.hw.common.core.utils.poi.ExcelUtil; -import com.hw.common.core.web.page.TableDataInfo; - -/** - * 故障文件;手工创建,从故障报修开始Controller - * - * @author Open Platform - * @date 2024-02-29 - */ -@RestController -@RequestMapping("/dmsFaultInstanceFile") -public class DmsFaultInstanceFileController extends BaseController -{ - @Autowired - private IDmsFaultInstanceFileService dmsFaultInstanceFileService; - - /** - * 查询故障文件;手工创建,从故障报修开始列表 - */ - @RequiresPermissions("dms:dmsFaultInstanceFile:list") - @GetMapping("/list") - public TableDataInfo list(DmsFaultInstanceFile dmsFaultInstanceFile) - { - startPage(); - List list = dmsFaultInstanceFileService.selectDmsFaultInstanceFileList(dmsFaultInstanceFile); - return getDataTable(list); - } - - /** - * 导出故障文件;手工创建,从故障报修开始列表 - */ - @RequiresPermissions("dms:dmsFaultInstanceFile:export") - @Log(title = "故障文件;手工创建,从故障报修开始", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, DmsFaultInstanceFile dmsFaultInstanceFile) - { - List list = dmsFaultInstanceFileService.selectDmsFaultInstanceFileList(dmsFaultInstanceFile); - ExcelUtil util = new ExcelUtil(DmsFaultInstanceFile.class); - util.exportExcel(response, list, "故障文件;手工创建,从故障报修开始数据"); - } - - /** - * 获取故障文件;手工创建,从故障报修开始详细信息 - */ - @RequiresPermissions("dms:dmsFaultInstanceFile:query") - @GetMapping(value = "/{repairInstanceFileId}") - public AjaxResult getInfo(@PathVariable("repairInstanceFileId") Long repairInstanceFileId) - { - return success(dmsFaultInstanceFileService.selectDmsFaultInstanceFileByRepairInstanceFileId(repairInstanceFileId)); - } - - /** - * 新增故障文件;手工创建,从故障报修开始 - */ - @RequiresPermissions("dms:dmsFaultInstanceFile:add") - @Log(title = "故障文件;手工创建,从故障报修开始", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody DmsFaultInstanceFile dmsFaultInstanceFile) - { - return toAjax(dmsFaultInstanceFileService.insertDmsFaultInstanceFile(dmsFaultInstanceFile)); - } - - /** - * 修改故障文件;手工创建,从故障报修开始 - */ - @RequiresPermissions("dms:dmsFaultInstanceFile:edit") - @Log(title = "故障文件;手工创建,从故障报修开始", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody DmsFaultInstanceFile dmsFaultInstanceFile) - { - return toAjax(dmsFaultInstanceFileService.updateDmsFaultInstanceFile(dmsFaultInstanceFile)); - } - - /** - * 删除故障文件;手工创建,从故障报修开始 - */ - @RequiresPermissions("dms:dmsFaultInstanceFile:remove") - @Log(title = "故障文件;手工创建,从故障报修开始", businessType = BusinessType.DELETE) - @DeleteMapping("/{repairInstanceFileIds}") - public AjaxResult remove(@PathVariable Long[] repairInstanceFileIds) - { - return toAjax(dmsFaultInstanceFileService.deleteDmsFaultInstanceFileByRepairInstanceFileIds(repairInstanceFileIds)); - } -} diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsMobileController.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsMobileController.java new file mode 100644 index 0000000..0fb89e4 --- /dev/null +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsMobileController.java @@ -0,0 +1,67 @@ +package com.hw.dms.controller; + +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.log.annotation.Log; +import com.hw.common.log.enums.BusinessType; +import com.hw.dms.domain.DmsBillsFaultInstance; +import com.hw.dms.service.IDmsBillsFaultInstanceService; +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.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; + +/** + * @Description:手持PDA接口 + * @ProjectName:HwMes + * @Author:xins + * @Date:2024-03-13 17:08 + * @Version:1.0 + */ +@RestController +@RequestMapping("/mobile") +public class DmsMobileController extends BaseController { + @Autowired + private IDmsBillsFaultInstanceService dmsBillsFaultInstanceService; + + @Resource + private RemoteFileService remoteFileService; + + + /** + * PDA-报修 + * + * 需传入 + * 设备id deviceId + * 故障类别 faultType + * 故障描述 faultDescription + * 涉及操作 designOperations + * 维修类型 repairType + * 外协id outsrcId(可不传入) + * 图片 files + * */ +// @RequiresPermissions("qms:checkresultdetail:add") + @Log(title = "故障报修工单", businessType = BusinessType.INSERT) + @PostMapping("/insertFaultInstsanceActivity") + public AjaxResult insertFaultInstsanceActivity(DmsBillsFaultInstance dmsBillsFaultInstance, + @RequestParam(value = "files") List files) { + List fileUrls = new ArrayList<>(); + for (MultipartFile file : files) { + R sysFileR = remoteFileService.upload(file); + SysFile sysFile = sysFileR.getData(); + fileUrls.add(sysFile.getUrl()); + } + dmsBillsFaultInstance.setFileUrls(fileUrls); + return success(dmsBillsFaultInstanceService.insertDmsBillsFaultInstance(dmsBillsFaultInstance)); + } + +} diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsBillsFaultInstance.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsBillsFaultInstance.java index 9ec0025..c796246 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsBillsFaultInstance.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsBillsFaultInstance.java @@ -74,7 +74,6 @@ public class DmsBillsFaultInstance extends BaseEntity /** 是否标识:1-是;0-否 */ @Excel(name = "是否标识:1-是;0-否") - private List dmsFaultInstanceFiles; private List sysFiles; @@ -96,6 +95,8 @@ public class DmsBillsFaultInstance extends BaseEntity private Long outsrcId; + private List fileUrls; + public List getSysFiles() { return sysFiles; } @@ -104,13 +105,6 @@ public class DmsBillsFaultInstance extends BaseEntity this.sysFiles = sysFiles; } - public List getDmsFaultInstanceFiles() { - return dmsFaultInstanceFiles; - } - - public void setDmsFaultInstanceFiles(List dmsFaultInstanceFiles) { - this.dmsFaultInstanceFiles = dmsFaultInstanceFiles; - } public String getImgUrl() { return imgUrl; } @@ -285,6 +279,14 @@ public class DmsBillsFaultInstance extends BaseEntity return isFlag; } + public List getFileUrls() { + return fileUrls; + } + + public void setFileUrls(List fileUrls) { + this.fileUrls = fileUrls; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsFaultInstanceFile.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsFaultInstanceFile.java index 1a47c4b..b8b5d28 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsFaultInstanceFile.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsFaultInstanceFile.java @@ -1,79 +1,79 @@ -package com.hw.dms.domain; - -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_fault_instance_file - * - * @author Open Platform - * @date 2024-02-29 - */ -public class DmsFaultInstanceFile extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - /** 主键标识 */ - private Long repairInstanceFileId; - - /** 关联类型(1故障报修工单实例节点,2故障记录) */ - @Excel(name = "关联类型(1故障报修工单实例节点,2故障记录)") - private String targetType; - - /** 关联类型为1时关联维修工单实例节点主键,关联类型为2时关联维修记录ID */ - @Excel(name = "关联类型为1时关联维修工单实例节点主键,关联类型为2时关联维修记录ID") - private Long targetId; - - /** 故障文件地址,一般是图片 */ - @Excel(name = "故障文件地址,一般是图片") - private String faultFile; - - public void setRepairInstanceFileId(Long repairInstanceFileId) - { - this.repairInstanceFileId = repairInstanceFileId; - } - - public Long getRepairInstanceFileId() - { - return repairInstanceFileId; - } - public void setTargetType(String targetType) - { - this.targetType = targetType; - } - - public String getTargetType() - { - return targetType; - } - public void setTargetId(Long targetId) - { - this.targetId = targetId; - } - - public Long getTargetId() - { - return targetId; - } - public void setFaultFile(String faultFile) - { - this.faultFile = faultFile; - } - - public String getFaultFile() - { - return faultFile; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("repairInstanceFileId", getRepairInstanceFileId()) - .append("targetType", getTargetType()) - .append("targetId", getTargetId()) - .append("faultFile", getFaultFile()) - .toString(); - } -} +//package com.hw.dms.domain; +// +//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_fault_instance_file +// * +// * @author Open Platform +// * @date 2024-02-29 +// */ +//public class DmsFaultInstanceFile extends BaseEntity +//{ +// private static final long serialVersionUID = 1L; +// +// /** 主键标识 */ +// private Long repairInstanceFileId; +// +// /** 关联类型(1故障报修工单实例节点,2故障记录) */ +// @Excel(name = "关联类型(1故障报修工单实例节点,2故障记录)") +// private String targetType; +// +// /** 关联类型为1时关联维修工单实例节点主键,关联类型为2时关联维修记录ID */ +// @Excel(name = "关联类型为1时关联维修工单实例节点主键,关联类型为2时关联维修记录ID") +// private Long targetId; +// +// /** 故障文件地址,一般是图片 */ +// @Excel(name = "故障文件地址,一般是图片") +// private String faultFile; +// +// public void setRepairInstanceFileId(Long repairInstanceFileId) +// { +// this.repairInstanceFileId = repairInstanceFileId; +// } +// +// public Long getRepairInstanceFileId() +// { +// return repairInstanceFileId; +// } +// public void setTargetType(String targetType) +// { +// this.targetType = targetType; +// } +// +// public String getTargetType() +// { +// return targetType; +// } +// public void setTargetId(Long targetId) +// { +// this.targetId = targetId; +// } +// +// public Long getTargetId() +// { +// return targetId; +// } +// public void setFaultFile(String faultFile) +// { +// this.faultFile = faultFile; +// } +// +// public String getFaultFile() +// { +// return faultFile; +// } +// +// @Override +// public String toString() { +// return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) +// .append("repairInstanceFileId", getRepairInstanceFileId()) +// .append("targetType", getTargetType()) +// .append("targetId", getTargetId()) +// .append("faultFile", getFaultFile()) +// .toString(); +// } +//} diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsInstanceFile.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsInstanceFile.java new file mode 100644 index 0000000..0d39132 --- /dev/null +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsInstanceFile.java @@ -0,0 +1,79 @@ +package com.hw.dms.domain; + +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_instance_file + * + * @author xins + * @date 2024-03-13 + */ +public class DmsInstanceFile extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键标识 */ + private Long instanceFileId; + + /** 关联类型(1故障报修工单实例节点,2故障记录) */ + @Excel(name = "关联类型(1故障报修工单实例节点,2故障记录)") + private String targetType; + + /** 关联类型为1时关联维修工单实例节点主键,关联类型为2时关联维修记录ID */ + @Excel(name = "关联类型为1时关联维修工单实例节点主键,关联类型为2时关联维修记录ID") + private Long targetId; + + /** 故障文件地址,一般是图片 */ + @Excel(name = "故障文件地址,一般是图片") + private String filePath; + + public void setInstanceFileId(Long instanceFileId) + { + this.instanceFileId = instanceFileId; + } + + public Long getInstanceFileId() + { + return instanceFileId; + } + public void setTargetType(String targetType) + { + this.targetType = targetType; + } + + public String getTargetType() + { + return targetType; + } + public void setTargetId(Long targetId) + { + this.targetId = targetId; + } + + public Long getTargetId() + { + return targetId; + } + public void setFilePath(String filePath) + { + this.filePath = filePath; + } + + public String getFilePath() + { + return filePath; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("instanceFileId", getInstanceFileId()) + .append("targetType", getTargetType()) + .append("targetId", getTargetId()) + .append("filePath", getFilePath()) + .toString(); + } +} diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsFaultInstanceFileMapper.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsFaultInstanceFileMapper.java deleted file mode 100644 index 1a4993c..0000000 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsFaultInstanceFileMapper.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.hw.dms.mapper; - -import java.util.List; -import com.hw.dms.domain.DmsFaultInstanceFile; - -/** - * 故障文件;手工创建,从故障报修开始Mapper接口 - * - * @author Open Platform - * @date 2024-02-29 - */ -public interface DmsFaultInstanceFileMapper -{ - /** - * 查询故障文件;手工创建,从故障报修开始 - * - * @param repairInstanceFileId 故障文件;手工创建,从故障报修开始主键 - * @return 故障文件;手工创建,从故障报修开始 - */ - public DmsFaultInstanceFile selectDmsFaultInstanceFileByRepairInstanceFileId(Long repairInstanceFileId); - - /** - * 查询故障文件;手工创建,从故障报修开始列表 - * - * @param dmsFaultInstanceFile 故障文件;手工创建,从故障报修开始 - * @return 故障文件;手工创建,从故障报修开始集合 - */ - public List selectDmsFaultInstanceFileList(DmsFaultInstanceFile dmsFaultInstanceFile); - - /** - * 新增故障文件;手工创建,从故障报修开始 - * - * @param dmsFaultInstanceFile 故障文件;手工创建,从故障报修开始 - * @return 结果 - */ - public int insertDmsFaultInstanceFile(DmsFaultInstanceFile dmsFaultInstanceFile); - - /** - * 修改故障文件;手工创建,从故障报修开始 - * - * @param dmsFaultInstanceFile 故障文件;手工创建,从故障报修开始 - * @return 结果 - */ - public int updateDmsFaultInstanceFile(DmsFaultInstanceFile dmsFaultInstanceFile); - - /** - * 删除故障文件;手工创建,从故障报修开始 - * - * @param repairInstanceFileId 故障文件;手工创建,从故障报修开始主键 - * @return 结果 - */ - public int deleteDmsFaultInstanceFileByRepairInstanceFileId(Long repairInstanceFileId); - - /** - * 批量删除故障文件;手工创建,从故障报修开始 - * - * @param repairInstanceFileIds 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteDmsFaultInstanceFileByRepairInstanceFileIds(Long[] repairInstanceFileIds); - - /** - * 通过工单id查询故障文件 - * */ - List selectDmsFaultInstanceFileByFaultId(Long repairInstanceId); -} diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsInstanceFileMapper.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsInstanceFileMapper.java new file mode 100644 index 0000000..4e70cfe --- /dev/null +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsInstanceFileMapper.java @@ -0,0 +1,72 @@ +package com.hw.dms.mapper; + +import java.util.List; +import com.hw.dms.domain.DmsInstanceFile; + +/** + * 工单文件;手工创建,从故障报修开始Mapper接口 + * + * @author xins + * @date 2024-03-13 + */ +public interface DmsInstanceFileMapper +{ + /** + * 查询工单文件;手工创建,从故障报修开始 + * + * @param instanceFileId 工单文件;手工创建,从故障报修开始主键 + * @return 工单文件;手工创建,从故障报修开始 + */ + public DmsInstanceFile selectDmsInstanceFileByInstanceFileId(Long instanceFileId); + + /** + * 查询工单文件;手工创建,从故障报修开始列表 + * + * @param dmsInstanceFile 工单文件;手工创建,从故障报修开始 + * @return 工单文件;手工创建,从故障报修开始集合 + */ + public List selectDmsInstanceFileList(DmsInstanceFile dmsInstanceFile); + + /** + * 新增工单文件;手工创建,从故障报修开始 + * + * @param dmsInstanceFile 工单文件;手工创建,从故障报修开始 + * @return 结果 + */ + public int insertDmsInstanceFile(DmsInstanceFile dmsInstanceFile); + + /** + * 修改工单文件;手工创建,从故障报修开始 + * + * @param dmsInstanceFile 工单文件;手工创建,从故障报修开始 + * @return 结果 + */ + public int updateDmsInstanceFile(DmsInstanceFile dmsInstanceFile); + + /** + * 删除工单文件;手工创建,从故障报修开始 + * + * @param instanceFileId 工单文件;手工创建,从故障报修开始主键 + * @return 结果 + */ + public int deleteDmsInstanceFileByInstanceFileId(Long instanceFileId); + + /** + * 批量删除工单文件;手工创建,从故障报修开始 + * + * @param instanceFileIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteDmsInstanceFileByInstanceFileIds(Long[] instanceFileIds); + + + + + /** + * 批量新增工单文件;手工创建,从故障报修开始 + * + * @param dmsInstanceFileList 工单文件;手工创建,从故障报修开始列表 + * @return 结果 + */ + public int batchDmsInstanceFile(List dmsInstanceFileList); +} diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/IDmsFaultInstanceFileService.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/IDmsFaultInstanceFileService.java deleted file mode 100644 index 3cea41f..0000000 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/IDmsFaultInstanceFileService.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.hw.dms.service; - -import java.util.List; -import com.hw.dms.domain.DmsFaultInstanceFile; - -/** - * 故障文件;手工创建,从故障报修开始Service接口 - * - * @author Open Platform - * @date 2024-02-29 - */ -public interface IDmsFaultInstanceFileService -{ - /** - * 查询故障文件;手工创建,从故障报修开始 - * - * @param repairInstanceFileId 故障文件;手工创建,从故障报修开始主键 - * @return 故障文件;手工创建,从故障报修开始 - */ - public DmsFaultInstanceFile selectDmsFaultInstanceFileByRepairInstanceFileId(Long repairInstanceFileId); - - /** - * 查询故障文件;手工创建,从故障报修开始列表 - * - * @param dmsFaultInstanceFile 故障文件;手工创建,从故障报修开始 - * @return 故障文件;手工创建,从故障报修开始集合 - */ - public List selectDmsFaultInstanceFileList(DmsFaultInstanceFile dmsFaultInstanceFile); - - /** - * 新增故障文件;手工创建,从故障报修开始 - * - * @param dmsFaultInstanceFile 故障文件;手工创建,从故障报修开始 - * @return 结果 - */ - public int insertDmsFaultInstanceFile(DmsFaultInstanceFile dmsFaultInstanceFile); - - /** - * 修改故障文件;手工创建,从故障报修开始 - * - * @param dmsFaultInstanceFile 故障文件;手工创建,从故障报修开始 - * @return 结果 - */ - public int updateDmsFaultInstanceFile(DmsFaultInstanceFile dmsFaultInstanceFile); - - /** - * 批量删除故障文件;手工创建,从故障报修开始 - * - * @param repairInstanceFileIds 需要删除的故障文件;手工创建,从故障报修开始主键集合 - * @return 结果 - */ - public int deleteDmsFaultInstanceFileByRepairInstanceFileIds(Long[] repairInstanceFileIds); - - /** - * 删除故障文件;手工创建,从故障报修开始信息 - * - * @param repairInstanceFileId 故障文件;手工创建,从故障报修开始主键 - * @return 结果 - */ - public int deleteDmsFaultInstanceFileByRepairInstanceFileId(Long repairInstanceFileId); -} diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBillsFaultInstanceServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBillsFaultInstanceServiceImpl.java index 6bc4c98..1905fdc 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBillsFaultInstanceServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBillsFaultInstanceServiceImpl.java @@ -1,22 +1,19 @@ package com.hw.dms.service.impl; -import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Date; import java.util.List; -import com.hw.common.core.constant.SecurityConstants; -import com.hw.common.core.domain.R; +import com.hw.common.core.constant.DmsConstants; +import com.hw.common.core.constant.WfConstants; 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.DmsFaultInstanceFile; -import com.hw.dms.domain.DmsRepairInstanceActivity; +import com.hw.dms.domain.DmsInstanceFile; import com.hw.dms.mapper.DmsFaultInstanceActivityMapper; -import com.hw.dms.mapper.DmsFaultInstanceFileMapper; -import com.hw.dms.mapper.DmsRepairInstanceActivityMapper; -import com.hw.dms.service.IDmsRepairInstanceActivityService; -import com.hw.system.api.RemoteSysCommonService; +import com.hw.dms.mapper.DmsInstanceFileMapper; import com.hw.system.api.domain.SysFile; -import com.hw.system.api.model.LoginUser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.hw.dms.mapper.DmsBillsFaultInstanceMapper; @@ -31,16 +28,14 @@ import org.springframework.transaction.annotation.Transactional; * @date 2024-01-23 */ @Service -public class DmsBillsFaultInstanceServiceImpl implements IDmsBillsFaultInstanceService -{ +public class DmsBillsFaultInstanceServiceImpl implements IDmsBillsFaultInstanceService { @Autowired private DmsBillsFaultInstanceMapper dmsBillsFaultInstanceMapper; @Autowired private DmsFaultInstanceActivityMapper dmsFaultInstanceActivityMapper; @Autowired - private RemoteSysCommonService remoteSysCommonService; - @Autowired - private DmsFaultInstanceFileMapper dmsFaultInstanceFileMapper; + private DmsInstanceFileMapper dmsInstanceFileMapper; + /** * 查询报修工单 @@ -49,11 +44,10 @@ public class DmsBillsFaultInstanceServiceImpl implements IDmsBillsFaultInstanceS * @return 报修工单 */ @Override - public DmsBillsFaultInstance selectDmsBillsFaultInstanceByRepairInstanceId(Long repairInstanceId) - { + public DmsBillsFaultInstance selectDmsBillsFaultInstanceByRepairInstanceId(Long repairInstanceId) { DmsFaultInstanceActivity dmsFaultInstanceActivity = dmsFaultInstanceActivityMapper.selectDmsFaultInstanceActivityByRepairIdMin(repairInstanceId); DmsBillsFaultInstance dmsBillsFaultInstance = dmsBillsFaultInstanceMapper.selectDmsBillsFaultInstanceByRepairInstanceId(repairInstanceId); - List dmsFaultInstanceFiles = dmsFaultInstanceFileMapper.selectDmsFaultInstanceFileByFaultId(repairInstanceId); +// List dmsFaultInstanceFiles = dmsFaultInstanceFileMapper.selectDmsFaultInstanceFileByFaultId(repairInstanceId); List sysFiles = new ArrayList(); SysFile sysFile = new SysFile(); dmsBillsFaultInstance.setFaultType(dmsFaultInstanceActivity.getFaultType()); @@ -62,14 +56,14 @@ public class DmsBillsFaultInstanceServiceImpl implements IDmsBillsFaultInstanceS dmsBillsFaultInstance.setDesignOperations(dmsFaultInstanceActivity.getDesignOperations()); dmsBillsFaultInstance.setDeviceId(dmsFaultInstanceActivity.getDeviceId()); dmsBillsFaultInstance.setRepairType(dmsFaultInstanceActivity.getRepairType()); - if (dmsFaultInstanceActivity.getOutsrcId()!=null) { + if (dmsFaultInstanceActivity.getOutsrcId() != null) { dmsBillsFaultInstance.setOutsrcId(dmsFaultInstanceActivity.getOutsrcId()); } - for (DmsFaultInstanceFile dmsFaultFor : dmsFaultInstanceFiles){ - sysFile.setUrl(dmsFaultFor.getFaultFile()); - sysFiles.add(sysFile); - } - dmsBillsFaultInstance.setDmsFaultInstanceFiles(dmsFaultInstanceFiles); +// for (DmsFaultInstanceFile dmsFaultFor : dmsFaultInstanceFiles) { +// sysFile.setUrl(dmsFaultFor.getFaultFile()); +// sysFiles.add(sysFile); +// } +// dmsBillsFaultInstance.setDmsFaultInstanceFiles(dmsFaultInstanceFiles); dmsBillsFaultInstance.setSysFiles(sysFiles); return dmsBillsFaultInstance; } @@ -81,8 +75,7 @@ public class DmsBillsFaultInstanceServiceImpl implements IDmsBillsFaultInstanceS * @return 报修工单 */ @Override - public List selectDmsBillsFaultInstanceList(DmsBillsFaultInstance dmsBillsFaultInstance) - { + public List selectDmsBillsFaultInstanceList(DmsBillsFaultInstance dmsBillsFaultInstance) { return dmsBillsFaultInstanceMapper.selectDmsBillsFaultInstanceList(dmsBillsFaultInstance); } @@ -93,46 +86,52 @@ public class DmsBillsFaultInstanceServiceImpl implements IDmsBillsFaultInstanceS * @param dmsBillsFaultInstance 报修工单 * @return 结果 */ + @Transactional @Override - @Transactional(rollbackFor = Exception.class) - public int insertDmsBillsFaultInstance(DmsBillsFaultInstance dmsBillsFaultInstance) - { - - SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmm"); - String str = sdf.format(DateUtils.getNowDate()); - LoginUser user = new LoginUser(); - dmsBillsFaultInstance.setWfProcessId(102l); - dmsBillsFaultInstance.setApplyUser(user.getUsername()); - dmsBillsFaultInstance.setApplyTime(DateUtils.getNowDate()); - dmsBillsFaultInstance.setCreateTime(DateUtils.getNowDate()); - dmsBillsFaultInstance.setBillsFaultCode(str); - dmsBillsFaultInstance.setBillsStatus("0"); - dmsBillsFaultInstance.setInstanceType("1"); - int i = dmsBillsFaultInstanceMapper.insertDmsBillsFaultInstance(dmsBillsFaultInstance); - Long aLong = dmsBillsFaultInstanceMapper.selectProcessActivityId(102l); + public int insertDmsBillsFaultInstance(DmsBillsFaultInstance dmsBillsFaultInstance) { + Date curretnDate = new Date(); + String userName = SecurityUtils.getUsername(); + dmsBillsFaultInstance.setWfProcessId(WfConstants.WF_BILLS_FAULT_INSTANCE_PROCESS_ID); + dmsBillsFaultInstance.setApplyUser(userName); + dmsBillsFaultInstance.setApplyTime(curretnDate); + dmsBillsFaultInstance.setCreateTime(curretnDate); + dmsBillsFaultInstance.setCreateBy(userName); + dmsBillsFaultInstance.setBillsFaultCode(Seq.getId(Seq.dmsBillsFaultInstanceSeqType, Seq.dmsBillsFaultInstanceSeqCode)); + dmsBillsFaultInstance.setBillsStatus(DmsConstants.DMS_BILLS_FAULT_INSTANCE_STATUS_TO_REPAIR); + dmsBillsFaultInstance.setInstanceType(DmsConstants.DMS_BILLS_FAULT_INSTANCE_TYPE_MAUAL); + + int rows = dmsBillsFaultInstanceMapper.insertDmsBillsFaultInstance(dmsBillsFaultInstance); + DmsFaultInstanceActivity dmsFaultInstanceActivity = new DmsFaultInstanceActivity(); dmsFaultInstanceActivity.setRepairInstanceId(dmsBillsFaultInstance.getRepairInstanceId()); - dmsFaultInstanceActivity.setProcessActivityId(aLong); + dmsFaultInstanceActivity.setProcessActivityId(WfConstants.WF_BILLS_FAULT_INSTANCE_PROCESS_ACTIVITY_FIRST_ID); dmsFaultInstanceActivity.setFaultType(dmsBillsFaultInstance.getFaultType()); dmsFaultInstanceActivity.setFaultDescription(dmsBillsFaultInstance.getFaultDescription()); dmsFaultInstanceActivity.setDesignOperations(dmsBillsFaultInstance.getDesignOperations()); dmsFaultInstanceActivity.setDeviceId(dmsBillsFaultInstance.getDeviceId()); dmsFaultInstanceActivity.setRepairType(dmsBillsFaultInstance.getRepairType()); - if (dmsBillsFaultInstance.getOutsrcId()!=null){ + if (dmsBillsFaultInstance.getOutsrcId() != null) { dmsFaultInstanceActivity.setOutsrcId(dmsBillsFaultInstance.getOutsrcId()); } - dmsFaultInstanceActivity.setProcessHandleStatus("2"); + dmsFaultInstanceActivity.setProcessHandleStatus(DmsConstants.DMS_BILLS_FAULT_INSTANCE_ACTIVITY_STATUS_TO_PICK); dmsFaultInstanceActivity.setProcessStepOrder(1l); dmsFaultInstanceActivityMapper.insertDmsFaultInstanceActivity(dmsFaultInstanceActivity); + //存储图片 + List fileUrls = dmsBillsFaultInstance.getFileUrls(); + if (fileUrls != null && !fileUrls.isEmpty()) { + List 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); + } - DmsFaultInstanceFile dmsFaultInstanceFile = new DmsFaultInstanceFile(); - if (dmsBillsFaultInstance.getImgUrl()!=""&&dmsBillsFaultInstance.getImgUrl()!=null){ - dmsFaultInstanceFile.setTargetId(dmsFaultInstanceActivity.getInstanceActivityId()); - dmsFaultInstanceFile.setTargetType("1"); - dmsFaultInstanceFile.setFaultFile(dmsBillsFaultInstance.getImgUrl()); - dmsFaultInstanceFileMapper.insertDmsFaultInstanceFile(dmsFaultInstanceFile);} - return i; + return rows; } /** @@ -142,8 +141,7 @@ public class DmsBillsFaultInstanceServiceImpl implements IDmsBillsFaultInstanceS * @return 结果 */ @Override - public int updateDmsBillsFaultInstance(DmsBillsFaultInstance dmsBillsFaultInstance) - { + public int updateDmsBillsFaultInstance(DmsBillsFaultInstance dmsBillsFaultInstance) { dmsBillsFaultInstance.setUpdateTime(DateUtils.getNowDate()); return dmsBillsFaultInstanceMapper.updateDmsBillsFaultInstance(dmsBillsFaultInstance); } @@ -155,8 +153,7 @@ public class DmsBillsFaultInstanceServiceImpl implements IDmsBillsFaultInstanceS * @return 结果 */ @Override - public int deleteDmsBillsFaultInstanceByRepairInstanceIds(Long[] repairInstanceIds) - { + public int deleteDmsBillsFaultInstanceByRepairInstanceIds(Long[] repairInstanceIds) { return dmsBillsFaultInstanceMapper.deleteDmsBillsFaultInstanceByRepairInstanceIds(repairInstanceIds); } @@ -167,14 +164,14 @@ public class DmsBillsFaultInstanceServiceImpl implements IDmsBillsFaultInstanceS * @return 结果 */ @Override - public int deleteDmsBillsFaultInstanceByRepairInstanceId(Long repairInstanceId) - { + public int deleteDmsBillsFaultInstanceByRepairInstanceId(Long repairInstanceId) { return dmsBillsFaultInstanceMapper.deleteDmsBillsFaultInstanceByRepairInstanceId(repairInstanceId); } + /** * pda-新增报修工单 - * */ - public int insertDmsBillsFaultInstancePDA(DmsBillsFaultInstance dmsBillsFaultInstance){ + */ + public int insertDmsBillsFaultInstancePDA(DmsBillsFaultInstance dmsBillsFaultInstance) { //根据报修流程查询工单流程节点id Long aLong = dmsBillsFaultInstanceMapper.selectProcessActivityId(102l); int i = dmsBillsFaultInstanceMapper.insertDmsBillsFaultInstance(dmsBillsFaultInstance); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsFaultInstanceFileServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsFaultInstanceFileServiceImpl.java deleted file mode 100644 index c4704f1..0000000 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsFaultInstanceFileServiceImpl.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.hw.dms.service.impl; - -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.hw.dms.mapper.DmsFaultInstanceFileMapper; -import com.hw.dms.domain.DmsFaultInstanceFile; -import com.hw.dms.service.IDmsFaultInstanceFileService; - -/** - * 故障文件;手工创建,从故障报修开始Service业务层处理 - * - * @author Open Platform - * @date 2024-02-29 - */ -@Service -public class DmsFaultInstanceFileServiceImpl implements IDmsFaultInstanceFileService -{ - @Autowired - private DmsFaultInstanceFileMapper dmsFaultInstanceFileMapper; - - /** - * 查询故障文件;手工创建,从故障报修开始 - * - * @param repairInstanceFileId 故障文件;手工创建,从故障报修开始主键 - * @return 故障文件;手工创建,从故障报修开始 - */ - @Override - public DmsFaultInstanceFile selectDmsFaultInstanceFileByRepairInstanceFileId(Long repairInstanceFileId) - { - return dmsFaultInstanceFileMapper.selectDmsFaultInstanceFileByRepairInstanceFileId(repairInstanceFileId); - } - - /** - * 查询故障文件;手工创建,从故障报修开始列表 - * - * @param dmsFaultInstanceFile 故障文件;手工创建,从故障报修开始 - * @return 故障文件;手工创建,从故障报修开始 - */ - @Override - public List selectDmsFaultInstanceFileList(DmsFaultInstanceFile dmsFaultInstanceFile) - { - return dmsFaultInstanceFileMapper.selectDmsFaultInstanceFileList(dmsFaultInstanceFile); - } - - /** - * 新增故障文件;手工创建,从故障报修开始 - * - * @param dmsFaultInstanceFile 故障文件;手工创建,从故障报修开始 - * @return 结果 - */ - @Override - public int insertDmsFaultInstanceFile(DmsFaultInstanceFile dmsFaultInstanceFile) - { - if (dmsFaultInstanceFile!=null){ - return dmsFaultInstanceFileMapper.insertDmsFaultInstanceFile(dmsFaultInstanceFile);} - return 0; - } - - /** - * 修改故障文件;手工创建,从故障报修开始 - * - * @param dmsFaultInstanceFile 故障文件;手工创建,从故障报修开始 - * @return 结果 - */ - @Override - public int updateDmsFaultInstanceFile(DmsFaultInstanceFile dmsFaultInstanceFile) - { - return dmsFaultInstanceFileMapper.updateDmsFaultInstanceFile(dmsFaultInstanceFile); - } - - /** - * 批量删除故障文件;手工创建,从故障报修开始 - * - * @param repairInstanceFileIds 需要删除的故障文件;手工创建,从故障报修开始主键 - * @return 结果 - */ - @Override - public int deleteDmsFaultInstanceFileByRepairInstanceFileIds(Long[] repairInstanceFileIds) - { - return dmsFaultInstanceFileMapper.deleteDmsFaultInstanceFileByRepairInstanceFileIds(repairInstanceFileIds); - } - - /** - * 删除故障文件;手工创建,从故障报修开始信息 - * - * @param repairInstanceFileId 故障文件;手工创建,从故障报修开始主键 - * @return 结果 - */ - @Override - public int deleteDmsFaultInstanceFileByRepairInstanceFileId(Long repairInstanceFileId) - { - return dmsFaultInstanceFileMapper.deleteDmsFaultInstanceFileByRepairInstanceFileId(repairInstanceFileId); - } -} diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsFaultInstanceFileMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsFaultInstanceFileMapper.xml deleted file mode 100644 index 05ebd34..0000000 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsFaultInstanceFileMapper.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - select repair_instance_file_id, target_type, target_id, fault_file from dms_fault_instance_file - - - - - - - - insert into dms_fault_instance_file - - target_type, - target_id, - fault_file, - - - #{targetType}, - #{targetId}, - #{faultFile}, - - - - - update dms_fault_instance_file - - target_type = #{targetType}, - target_id = #{targetId}, - fault_file = #{faultFile}, - - where repair_instance_file_id = #{repairInstanceFileId} - - - - delete from dms_fault_instance_file where repair_instance_file_id = #{repairInstanceFileId} - - - - delete from dms_fault_instance_file where repair_instance_file_id in - - #{repairInstanceFileId} - - - - diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsInstanceFileMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsInstanceFileMapper.xml new file mode 100644 index 0000000..5493012 --- /dev/null +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsInstanceFileMapper.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + select instance_file_id, target_type, target_id, file_path from dms_instance_file + + + + + + + + insert into dms_instance_file + + target_type, + target_id, + file_path, + + + #{targetType}, + #{targetId}, + #{filePath}, + + + + + update dms_instance_file + + target_type = #{targetType}, + target_id = #{targetId}, + file_path = #{filePath}, + + where instance_file_id = #{instanceFileId} + + + + delete from dms_instance_file where instance_file_id = #{instanceFileId} + + + + delete from dms_instance_file where instance_file_id in + + #{instanceFileId} + + + + + + + + insert into dms_instance_file( instance_file_id, target_type, target_id, file_path) values + + ( #{item.instanceFileId}, #{item.targetType}, #{item.targetId}, #{item.filePath}) + + +