From cc27b45249441c3aa927be84eacd20e06966e446 Mon Sep 17 00:00:00 2001 From: 79493 <794930212@qq.com> Date: Mon, 21 Nov 2022 17:38:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=81=E4=B8=9A=E7=AB=AF=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E6=A8=A1=E5=9D=97->=E4=BC=81=E4=B8=9A=E7=AB=AFPC,=E5=B0=8F?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E6=8E=A5=E5=8F=A3=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EntDeviceMaintenancePlanMapper.java | 3 + .../rzyc/mapper/EntRepairRecordMapper.java | 8 + .../com/rzyc/model/EntInspectionRecord.java | 6 +- .../java/com/rzyc/model/EntReportRepair.java | 12 ++ .../rzyc/model/dto/EntRepairRecordDto.java | 194 ++++++++++++++++++ .../rzyc/model/dto/InspectionRecordDto.java | 10 +- .../model/dto/OperatingInstructionsDto.java | 12 ++ .../com/rzyc/model/dto/ReportRecordDto.java | 11 + .../resources/mapper/EntPostListMapper.xml | 4 +- .../resources/mapper/EntPostTaskMapper.xml | 5 +- .../resources/mapper/EntRepairPlanMapper.xml | 2 +- .../mapper/EntRepairRecordMapper.xml | 9 +- .../EnterpriseEquipmentController.java | 24 ++- .../rzyc/controller/PersonalController.java | 2 +- .../com/rzyc/service/PcBusinessService.java | 72 +++++-- 15 files changed, 337 insertions(+), 37 deletions(-) create mode 100644 inventory-dao/src/main/java/com/rzyc/model/dto/EntRepairRecordDto.java diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceMaintenancePlanMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceMaintenancePlanMapper.java index 09becdc..9503c4b 100644 --- a/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceMaintenancePlanMapper.java +++ b/inventory-dao/src/main/java/com/rzyc/mapper/EntDeviceMaintenancePlanMapper.java @@ -33,4 +33,7 @@ public interface EntDeviceMaintenancePlanMapper extends BaseMapperselectEntDeviceMaintenancePlanList(String deviceId); + + + } diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/EntRepairRecordMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/EntRepairRecordMapper.java index f9579f3..c56167b 100644 --- a/inventory-dao/src/main/java/com/rzyc/mapper/EntRepairRecordMapper.java +++ b/inventory-dao/src/main/java/com/rzyc/mapper/EntRepairRecordMapper.java @@ -24,4 +24,12 @@ public interface EntRepairRecordMapper extends BaseMapper { * */ ListrepairRecord(String deviceId); + + /** + * 新增修改维修记录 + * @param entRepairRecord + * @return int + * */ + int repairRecordUpdate(EntRepairRecord entRepairRecord); + } diff --git a/inventory-dao/src/main/java/com/rzyc/model/EntInspectionRecord.java b/inventory-dao/src/main/java/com/rzyc/model/EntInspectionRecord.java index ad6e2d1..f2198fb 100644 --- a/inventory-dao/src/main/java/com/rzyc/model/EntInspectionRecord.java +++ b/inventory-dao/src/main/java/com/rzyc/model/EntInspectionRecord.java @@ -24,7 +24,7 @@ public class EntInspectionRecord implements Serializable { @ApiModelProperty(value = "送检记录") @TableId("inspection_id") - private Integer inspectionId; + private String inspectionId; @ApiModelProperty(value = "送检设备id") @TableField("inspection_device_id") @@ -74,11 +74,11 @@ public class EntInspectionRecord implements Serializable { this.deviceId = deviceId; } - public Integer getInspectionId() { + public String getInspectionId() { return inspectionId; } - public void setInspectionId(Integer inspectionId) { + public void setInspectionId(String inspectionId) { this.inspectionId = inspectionId; } diff --git a/inventory-dao/src/main/java/com/rzyc/model/EntReportRepair.java b/inventory-dao/src/main/java/com/rzyc/model/EntReportRepair.java index 503ddf3..7261f63 100644 --- a/inventory-dao/src/main/java/com/rzyc/model/EntReportRepair.java +++ b/inventory-dao/src/main/java/com/rzyc/model/EntReportRepair.java @@ -57,6 +57,18 @@ public class EntReportRepair implements Serializable { @TableField("modify_time") private Date modifyTime; + @ApiModelProperty(value = "故障发生时间") + @TableField("fault_occurrence_time") + private String faultOccurrenceTime; + + public String getFaultOccurrenceTime() { + return faultOccurrenceTime; + } + + public void setFaultOccurrenceTime(String faultOccurrenceTime) { + this.faultOccurrenceTime = faultOccurrenceTime; + } + public String getReportRepairId() { return reportRepairId; } diff --git a/inventory-dao/src/main/java/com/rzyc/model/dto/EntRepairRecordDto.java b/inventory-dao/src/main/java/com/rzyc/model/dto/EntRepairRecordDto.java new file mode 100644 index 0000000..ff1bea2 --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/model/dto/EntRepairRecordDto.java @@ -0,0 +1,194 @@ +package com.rzyc.model.dto; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModelProperty; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 设备维修记录dto + * @author Xuwanxin + * @date 2022/11/21 + * */ +public class EntRepairRecordDto { + + @ApiModelProperty(value = "维修记录") + private String repairRecordId; + + @TableField("device_id") + private String deviceId; + + @ApiModelProperty(value = "维修Code") + private String repairCode; + + @ApiModelProperty(value = "送修时间") + private Date repairTime; + + @ApiModelProperty(value = "故障原因 1.自然磨损 2.违章操作 3.配件质量差 4.维护保养不到位 5.其他") + private Integer causeOfFailure; + + @ApiModelProperty(value = "外委维修单位") + private String externalMaintenanceUnit; + + @ApiModelProperty(value = "外委维修单位人员名称") + + private String externalMaintenancePersonName; + + @ApiModelProperty(value = "1.正在维修 2.待采购件 3.待加工件 4.待停机维修 5.停机维修 6.无法修复 7.待转外委维修 8.已完成") + private Integer repairState; + + @ApiModelProperty(value = "维修开始时间") + private Date repairStartTime; + + @ApiModelProperty(value = "维修结束时间") + private Date repairEndTime; + + @ApiModelProperty(value = "1.常见故障维修 2.突发性故障维修 3.计划项目维修 4.不正当使用维修") + private Integer repairLevel; + + @ApiModelProperty(value = "1. 否 2.是") + private Integer shutdown; + + @ApiModelProperty(value = "停机时间") + private Double downTime; + + @ApiModelProperty(value = "1.否 2.是") + private Integer affectedGeneration; + + @ApiModelProperty(value = "维修花费") + private BigDecimal repairCost; + + @ApiModelProperty(value = "工作描述") + private String workDescription; + + + public String getRepairRecordId() { + return repairRecordId; + } + + public void setRepairRecordId(String repairRecordId) { + this.repairRecordId = repairRecordId; + } + + public String getDeviceId() { + return deviceId; + } + + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } + + public String getRepairCode() { + return repairCode; + } + + public void setRepairCode(String repairCode) { + this.repairCode = repairCode; + } + + public Date getRepairTime() { + return repairTime; + } + + public void setRepairTime(Date repairTime) { + this.repairTime = repairTime; + } + + public Integer getCauseOfFailure() { + return causeOfFailure; + } + + public void setCauseOfFailure(Integer causeOfFailure) { + this.causeOfFailure = causeOfFailure; + } + + public String getExternalMaintenanceUnit() { + return externalMaintenanceUnit; + } + + public void setExternalMaintenanceUnit(String externalMaintenanceUnit) { + this.externalMaintenanceUnit = externalMaintenanceUnit; + } + + public String getExternalMaintenancePersonName() { + return externalMaintenancePersonName; + } + + public void setExternalMaintenancePersonName(String externalMaintenancePersonName) { + this.externalMaintenancePersonName = externalMaintenancePersonName; + } + + public Integer getRepairState() { + return repairState; + } + + public void setRepairState(Integer repairState) { + this.repairState = repairState; + } + + public Date getRepairStartTime() { + return repairStartTime; + } + + public void setRepairStartTime(Date repairStartTime) { + this.repairStartTime = repairStartTime; + } + + public Date getRepairEndTime() { + return repairEndTime; + } + + public void setRepairEndTime(Date repairEndTime) { + this.repairEndTime = repairEndTime; + } + + public Integer getRepairLevel() { + return repairLevel; + } + + public void setRepairLevel(Integer repairLevel) { + this.repairLevel = repairLevel; + } + + public Integer getShutdown() { + return shutdown; + } + + public void setShutdown(Integer shutdown) { + this.shutdown = shutdown; + } + + public Double getDownTime() { + return downTime; + } + + public void setDownTime(Double downTime) { + this.downTime = downTime; + } + + public Integer getAffectedGeneration() { + return affectedGeneration; + } + + public void setAffectedGeneration(Integer affectedGeneration) { + this.affectedGeneration = affectedGeneration; + } + + public BigDecimal getRepairCost() { + return repairCost; + } + + public void setRepairCost(BigDecimal repairCost) { + this.repairCost = repairCost; + } + + public String getWorkDescription() { + return workDescription; + } + + public void setWorkDescription(String workDescription) { + this.workDescription = workDescription; + } +} diff --git a/inventory-dao/src/main/java/com/rzyc/model/dto/InspectionRecordDto.java b/inventory-dao/src/main/java/com/rzyc/model/dto/InspectionRecordDto.java index 2bada39..1afe092 100644 --- a/inventory-dao/src/main/java/com/rzyc/model/dto/InspectionRecordDto.java +++ b/inventory-dao/src/main/java/com/rzyc/model/dto/InspectionRecordDto.java @@ -15,8 +15,8 @@ import java.util.Date; public class InspectionRecordDto { - @ApiModelProperty(value = "送检记录") - private Integer inspectionId; + @ApiModelProperty(value = "送检记录id") + private String inspectionId; @ApiModelProperty(value = "送检设备id") private Integer inspectionDeviceId; @@ -36,13 +36,11 @@ public class InspectionRecordDto { @ApiModelProperty(value = "检查结果") private String inspectionText; - - - public Integer getInspectionId() { + public String getInspectionId() { return inspectionId; } - public void setInspectionId(Integer inspectionId) { + public void setInspectionId(String inspectionId) { this.inspectionId = inspectionId; } diff --git a/inventory-dao/src/main/java/com/rzyc/model/dto/OperatingInstructionsDto.java b/inventory-dao/src/main/java/com/rzyc/model/dto/OperatingInstructionsDto.java index ea27a5a..b190f5a 100644 --- a/inventory-dao/src/main/java/com/rzyc/model/dto/OperatingInstructionsDto.java +++ b/inventory-dao/src/main/java/com/rzyc/model/dto/OperatingInstructionsDto.java @@ -22,6 +22,18 @@ public class OperatingInstructionsDto { @ApiModelProperty(value = "操作规程描述") private String opInstructionDescription; + @ApiModelProperty("设备id") + @TableField(value = "device_id") + private String deviceId; + + public String getDeviceId() { + return deviceId; + } + + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } + public String getOpInstructionId() { return opInstructionId; } diff --git a/inventory-dao/src/main/java/com/rzyc/model/dto/ReportRecordDto.java b/inventory-dao/src/main/java/com/rzyc/model/dto/ReportRecordDto.java index cc8a9fd..b06ead8 100644 --- a/inventory-dao/src/main/java/com/rzyc/model/dto/ReportRecordDto.java +++ b/inventory-dao/src/main/java/com/rzyc/model/dto/ReportRecordDto.java @@ -31,6 +31,17 @@ public class ReportRecordDto { @ApiModelProperty(value = "故障描述") private String reportDescription; + @ApiModelProperty(value = "故障发生时间") + private String faultOccurrenceTime; + + public String getFaultOccurrenceTime() { + return faultOccurrenceTime; + } + + public void setFaultOccurrenceTime(String faultOccurrenceTime) { + this.faultOccurrenceTime = faultOccurrenceTime; + } + public String getReportRepairId() { return reportRepairId; } diff --git a/inventory-dao/src/main/resources/mapper/EntPostListMapper.xml b/inventory-dao/src/main/resources/mapper/EntPostListMapper.xml index 6f2067c..d3a5518 100644 --- a/inventory-dao/src/main/resources/mapper/EntPostListMapper.xml +++ b/inventory-dao/src/main/resources/mapper/EntPostListMapper.xml @@ -80,9 +80,9 @@ left join ent_post_task ept on epl.post_list_id = ept.ent_list_id left join in_list il on epl.list_id = il.list_id where epl.enterprise_id = #{enterpriseId} - + and epl.ent_user_id = #{userId} - + and epl.list_id = #{listId} diff --git a/inventory-dao/src/main/resources/mapper/EntPostTaskMapper.xml b/inventory-dao/src/main/resources/mapper/EntPostTaskMapper.xml index beda8bc..7b80550 100644 --- a/inventory-dao/src/main/resources/mapper/EntPostTaskMapper.xml +++ b/inventory-dao/src/main/resources/mapper/EntPostTaskMapper.xml @@ -30,7 +30,10 @@ + diff --git a/inventory-dao/src/main/resources/mapper/EntRepairRecordMapper.xml b/inventory-dao/src/main/resources/mapper/EntRepairRecordMapper.xml index 148c7ef..9791be0 100644 --- a/inventory-dao/src/main/resources/mapper/EntRepairRecordMapper.xml +++ b/inventory-dao/src/main/resources/mapper/EntRepairRecordMapper.xml @@ -31,8 +31,13 @@ repair_record_id, device_id, repair_code, repair_time, cause_of_failure, external_maintenance_unit, external_maintenance_person_name, repair_state, repair_start_time, repair_end_time, repair_level, shutdown, down_time, affected_generation, repair_cost, work_description, create_by, create_time, modify_by, modify_time - + select * from ent_repair_record where device_id = #{deviceId} + + update ent_report_repair set device_id = #{deviceId},repair_code = #{repairCode}, repair_time = #{repairTime}, cause_of_failure = #{causeOfFailure}, external_maintenance_unit = #{externalMaintenanceUnit}, external_maintenance_person_name = #{externalMaintenancePersonName}, repair_state = #{repairState}, repair_start_time = #{repairStartTime}, repair_end_time = #{repairEndTime}, repair_level = #{repairLevel}, shutdown = #{shutdown}, down_time = #{downTime}, affected_generation = #{affectedGeneration}, repair_cost = #{repairCost}, work_description = #{workDescription},modify_by = #{modifyBy}, modify_time= #{modifyTime} + where repair_record_id = #{repairRecordId} + + diff --git a/inventory-ent/src/main/java/com/rzyc/controller/EnterpriseEquipmentController.java b/inventory-ent/src/main/java/com/rzyc/controller/EnterpriseEquipmentController.java index cf3628c..e151688 100644 --- a/inventory-ent/src/main/java/com/rzyc/controller/EnterpriseEquipmentController.java +++ b/inventory-ent/src/main/java/com/rzyc/controller/EnterpriseEquipmentController.java @@ -328,7 +328,7 @@ public class EnterpriseEquipmentController extends BaseController { @PreAuthorize("hasAnyAuthority('inspectionRecord:update')") @MethodAnnotation(authorizations = {"inspectionRecord:update"},name = "送检操作") @ResponseBody - public SingleResult submitInspection(InspectionRecordDto inspectionRecordDto)throws Exception{ + public SingleResult submitInspection(@RequestBody InspectionRecordDto inspectionRecordDto)throws Exception{ return pcBusinessService.submitInspection(inspectionRecordDto); } @@ -354,11 +354,11 @@ public class EnterpriseEquipmentController extends BaseController { * @throws Exception **/ @ApiOperation(value = "维修计划-新增,修改", notes = "维修计划-新增,修改") - @GetMapping(value = "/repairPlanAddOrUpdate") + @PostMapping(value = "/repairPlanAddOrUpdate") @PreAuthorize("hasAnyAuthority('repairPlan:update')") @MethodAnnotation(authorizations = {"repairPlan:update"},name = "维修计划-新增,修改") @ResponseBody - public SingleResult repairPlanAddOrUpdate(EntRepairPlanDto entRepairPlanDto)throws Exception{ + public SingleResult repairPlanAddOrUpdate(@RequestBody EntRepairPlanDto entRepairPlanDto)throws Exception{ return pcBusinessService.repairPlanUpdate(entRepairPlanDto); } @@ -379,6 +379,21 @@ public class EnterpriseEquipmentController extends BaseController { return pcBusinessService.repairRecord(page,pageSize,deviceId); } + /** + * 维修记录修改/新增 + * @return int + * @throws Exception + **/ + @ApiOperation(value = "维修记录修改/新增", notes = "维修记录修改/新增") + @PostMapping(value = "/repairRecordUpdate") + @PreAuthorize("hasAnyAuthority('repairRecord:update')") + @MethodAnnotation(authorizations = {"repairRecord:update"},name = "维修记录修改/新增") + @ResponseBody + public SingleResult repairRecordUpdate(@RequestBody EntRepairRecordDto entRepairRecordDto)throws Exception{ + return pcBusinessService.repairRecordUpdate(entRepairRecordDto); + } + + /** * 报修记录 * @return 报修记录 @@ -393,6 +408,9 @@ public class EnterpriseEquipmentController extends BaseController { return pcBusinessService.reportRecord(page,pageSize,deviceId); } + + + /** * 新增报修 * @throws Exception diff --git a/inventory-ent/src/main/java/com/rzyc/controller/PersonalController.java b/inventory-ent/src/main/java/com/rzyc/controller/PersonalController.java index 721dd4d..c7323fd 100644 --- a/inventory-ent/src/main/java/com/rzyc/controller/PersonalController.java +++ b/inventory-ent/src/main/java/com/rzyc/controller/PersonalController.java @@ -445,7 +445,7 @@ public class PersonalController extends BaseController{ @ResponseBody public SingleResult> entListGroupByListId(@RequestParam(required = true) String enterpriseId, String listId, - @RequestParam(required = true) String userId)throws Exception{ + String userId)throws Exception{ return pcBusinessService.entListGroupByListId(enterpriseId,listId,userId); } diff --git a/inventory-ent/src/main/java/com/rzyc/service/PcBusinessService.java b/inventory-ent/src/main/java/com/rzyc/service/PcBusinessService.java index 65c7dc9..f49942c 100644 --- a/inventory-ent/src/main/java/com/rzyc/service/PcBusinessService.java +++ b/inventory-ent/src/main/java/com/rzyc/service/PcBusinessService.java @@ -127,7 +127,6 @@ public class PcBusinessService extends BaseController { Listlist = entPostListMapper.selectEntPostList(entUserPostListDto.getEnterpriseId(),entUserPostListDto.getEntUserId(),entUserPostListDto.getFinishedState(), entUserPostListDto.getPostId(),entUserPostListDto.getPage(),entUserPostListDto.getPageSize()); - return list; } @@ -613,14 +612,19 @@ public class PcBusinessService extends BaseController { return singleResult; } - public SingleResult repairPlanUpdate(EntRepairPlanDto entRepairPlanDto){ + public SingleResult repairPlanUpdate(EntRepairPlanDto entRepairPlanDto) throws Exception { SingleResult singleResult = new SingleResult(); EntRepairPlan entRepairPlan = new EntRepairPlan(); BeanUtils.copyProperties(entRepairPlanDto,entRepairPlan); int result = 0; if (null != entRepairPlanDto && null != entRepairPlan.getRepairPlanId()){ + entRepairPlan.setModifyBy(getUserId()); + entRepairPlan.setModifyTime(new Date()); result = entRepairPlanMapper.updateRepairPlan(entRepairPlan); }else{ + entRepairPlan.setRepairPlanId(RandomNumber.getUUid()); + entRepairPlan.setCreateBy(getUserId()); + entRepairPlan.setCreateTime(new Date()); result = entRepairPlanMapper.insert(entRepairPlan); } if (result != 1 ){ @@ -630,14 +634,19 @@ public class PcBusinessService extends BaseController { return singleResult; } - public SingleResult submitInspection(InspectionRecordDto inspectionRecordDto){ + public SingleResult submitInspection(InspectionRecordDto inspectionRecordDto) throws Exception { SingleResult singleResult = new SingleResult(); EntInspectionRecord entInspectionRecord = new EntInspectionRecord(); BeanUtils.copyProperties(inspectionRecordDto,entInspectionRecord); int result = 0; if (null != inspectionRecordDto && null != entInspectionRecord.getInspectionId()){ + entInspectionRecord.setModifyBy(getUserId()); + entInspectionRecord.setModifyTime(new Date()); result = entInspectionRecordMapper.updateEntInspectionRecord(entInspectionRecord); }else { + entInspectionRecord.setInspectionId(RandomNumber.getUUid()); + entInspectionRecord.setCreateBy(getUserId()); + entInspectionRecord.setCreateTime(new Date()); result = entInspectionRecordMapper.insert(entInspectionRecord); } if (result != 1 ){ @@ -774,7 +783,7 @@ public class PcBusinessService extends BaseController { Integer total = entPostListMapper.selectEntPostListCount(enterpriseId,listId,year); //2代表已完成状态 Integer finishCount = entPostListMapper.selectEntPostListFinishedCount(enterpriseId,listId,2,year); - if (null != finishCount && finishCount > 0 ){ + if (null != finishCount && finishCount >= 0 ){ double finishPercent = Arith.div(finishCount,total) * 100; singleResult.setData(finishPercent); } @@ -790,13 +799,20 @@ public class PcBusinessService extends BaseController { long total = entPostTaskMapper.selectEntPostTaskTotal(enterpriseId,listId,year); //2代表已完成状态 EntPostTaskStatistic entPostTaskStatistic = entPostTaskMapper.selectEntPostTaskByState(enterpriseId,listId,year); - double finishPercent = Arith.div(entPostTaskStatistic.getFinished(),total) * 100; - map.put("finished",finishPercent); - double unfinishedPercent = Arith.div(entPostTaskStatistic.getOvertime(),total) * 100; - map.put("unfinished",unfinishedPercent); - double haveInHand = Arith.div(entPostTaskStatistic.getHaveInHand(),total) * 100; - map.put("haveInHand",haveInHand); - singleResult.setData(map); + if (null != entPostTaskStatistic){ + double finishPercent = Arith.div(entPostTaskStatistic.getFinished(),total) * 100; + map.put("finished",finishPercent); + double unfinishedPercent = Arith.div(entPostTaskStatistic.getOvertime(),total) * 100; + map.put("unfinished",unfinishedPercent); + double haveInHand = Arith.div(entPostTaskStatistic.getHaveInHand(),total) * 100; + map.put("haveInHand",haveInHand); + singleResult.setData(map); + }else { + map.put("finished",0); + map.put("unfinished",0); + map.put("haveInHand",0); + singleResult.setData(map); + } return singleResult; } @@ -807,14 +823,17 @@ public class PcBusinessService extends BaseController { * */ private String getUserPostId() throws Exception { String userId = getUserId(); - Object object = redisUtil.get("postId:userId"+userId); - if (null == object){ - EntUser entUser = entUserMapper.selectById(userId); - redisUtil.set("postId:userId"+userId,entUser.getPostId()); - return entUser.getPostId(); - }else { - return (String)object; + if (StringUtils.isNotBlank(userId)){ + Object object = redisUtil.get("postId:userId"+userId); + if (null == object){ + EntUser entUser = entUserMapper.selectById(userId); + redisUtil.set("postId:userId"+userId,entUser.getPostId()); + return entUser.getPostId(); + }else { + return (String)object; + } } + return null; } public SingleResult entListGroupByListId(String enterpriseId,String listId,String userId){ @@ -990,6 +1009,23 @@ public class PcBusinessService extends BaseController { return singleResult; } + public SingleResult repairRecordUpdate(EntRepairRecordDto entRepairRecordDto){ + SingleResult singleResult = new SingleResult(); + EntRepairRecord entRepairRecord = new EntRepairRecord(); + BeanUtils.copyProperties(entRepairRecordDto,entRepairRecord); + int result = 0; + if (null != entRepairRecordDto && null != entRepairRecordDto.getRepairRecordId()){ + result =entRepairRecordMapper.repairRecordUpdate(entRepairRecord); + }else { + result = entRepairRecordMapper.insert(entRepairRecord); + } + if (result <= 0){ + singleResult.setCode(Code.ERROR.getCode()); + singleResult.setMessage(Message.ERROR); + } + return singleResult; + } + }