修改维修报告id来源

This commit is contained in:
xusd 2024-09-14 11:11:42 +08:00
parent 45dfbc327a
commit 66f8e463d0
9 changed files with 47 additions and 15 deletions

View File

@ -90,4 +90,10 @@ public class MaintenanceOrderRespVO {
@Schema(description = "审批状态bpm_process_instance_status")
private Integer approveStatus;
@Schema(description = "报警id")
private String alarmId;
@Schema(description = "报告id")
private String reportId;
}

View File

@ -64,4 +64,7 @@ public class MaintenanceOrderSaveReqVO {
@Schema(description = "审批状态bpm_process_instance_status")
private Integer approveStatus;
@Schema(description = "报警id")
private String alarmId;
}

View File

@ -81,6 +81,10 @@ public class MaintenanceOrderDO extends BaseDO {
* 审批状态
*/
private Integer approveStatus;
/**
* 报警id
*/
private String alarmId;
@TableField(exist = false)
private String equipNo;
@ -90,4 +94,6 @@ public class MaintenanceOrderDO extends BaseDO {
private String customerName;
@TableField(exist = false)
private String executorName;
@TableField(exist = false)
private String reportId;
}

View File

@ -3,6 +3,7 @@ package com.inspur.module.system.service.maintenance;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.RandomUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.inspur.framework.common.enums.CommonStatusEnum;
import com.inspur.framework.common.pojo.PageResult;
@ -16,9 +17,11 @@ import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderRecord
import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderRespVO;
import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderSaveReqVO;
import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceOrderDO;
import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceReportDO;
import com.inspur.module.system.dal.dataobject.user.AdminUserDO;
import com.inspur.module.system.dal.mysql.maintenance.MaintenanceOrderMapper;
import com.inspur.module.system.dal.mysql.maintenance.MaintenanceOrderRecordMapper;
import com.inspur.module.system.dal.mysql.maintenance.MaintenanceReportMapper;
import com.inspur.module.system.service.baseData.CustomerInfoService;
import com.inspur.module.system.service.equip.ComponentInfoService;
import com.inspur.module.system.service.equip.EquipInfoService;
@ -67,6 +70,9 @@ public class MaintenanceOrderServiceImpl implements MaintenanceOrderService {
@Resource
private BpmProcessInstanceApi processInstanceApi;
@Resource
private MaintenanceReportMapper maintenanceReportMapper;
/**
* OA 请假对应的流程定义 KEY
*/
@ -130,7 +136,17 @@ public class MaintenanceOrderServiceImpl implements MaintenanceOrderService {
@Override
public MaintenanceOrderDO getRemoteMaintenanceOrder(String id) {
return maintenanceOrderMapper.selectById(id);
MaintenanceOrderDO maintenanceOrderDO = maintenanceOrderMapper.selectById(id);
//获取维修报告
if (Objects.nonNull(maintenanceOrderDO)){
LambdaQueryWrapper<MaintenanceReportDO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(MaintenanceReportDO::getMaintenanceOrderId,maintenanceOrderDO.getMaintenanceOrderId());
MaintenanceReportDO maintenanceReportDO = maintenanceReportMapper.selectOne(queryWrapper);
if (Objects.nonNull(maintenanceReportDO)){
maintenanceOrderDO.setReportId(maintenanceReportDO.getMaintenanceReportId());
}
}
return maintenanceOrderDO;
}
@Override

View File

@ -3,9 +3,7 @@ package com.inspur.module.system.service.maintenance;
import com.inspur.framework.common.pojo.PageResult;
import com.inspur.module.system.controller.maintenance.vo.MaintenanceReportPageReqVO;
import com.inspur.module.system.controller.maintenance.vo.MaintenanceReportSaveReqVO;
import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceOrderDO;
import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceReportDO;
import com.inspur.module.system.dal.mysql.maintenance.MaintenanceOrderMapper;
import com.inspur.module.system.dal.mysql.maintenance.MaintenanceReportMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -29,17 +27,12 @@ public class MaintenanceReportServiceImpl implements MaintenanceReportService {
@Resource
private MaintenanceReportMapper maintenanceReportMapper;
@Resource
private MaintenanceOrderMapper maintenanceOrderMapper;
@Override
@Transactional(rollbackFor = Exception.class)
public String createMaintenanceReport(MaintenanceReportSaveReqVO createReqVO) {
// 插入
MaintenanceReportDO maintenanceReport = BeanUtils.toBean(createReqVO, MaintenanceReportDO.class);
maintenanceReportMapper.insert(maintenanceReport);
//更新工单表中的报告id
maintenanceOrderMapper.updateById(new MaintenanceOrderDO().setMaintenanceOrderId(maintenanceReport.getMaintenanceOrderId()).setDiagnoiseReportId(maintenanceReport.getMaintenanceReportId()));
// 返回
return maintenanceReport.getMaintenanceReportId();
}

View File

@ -104,6 +104,7 @@ export default {
processInstanceId: undefined,
customerId: undefined,
approveStatus: undefined,
reportId: undefined,
},
//
formRules: {
@ -230,6 +231,7 @@ export default {
processInstanceId: undefined,
customerId: undefined,
approveStatus: undefined,
reportId: undefined,
};
this.cascaderValue = [];
this.resetForm("formRef");

View File

@ -8,7 +8,7 @@
<el-cascader
v-model="cascaderValue"
:options="equipCascader"
:props="{ value: 'id',label: 'name',children: 'children',emitPath:false}"
:props="{ value: 'id',label: 'name',children: 'children'}"
clearable
@change="cascaderChange"></el-cascader>
</el-form-item>
@ -124,6 +124,7 @@ export default {
processInstanceId: undefined,
customerId: undefined,
faultType: undefined,
reportId: undefined,
},
//
//
@ -171,6 +172,7 @@ export default {
}else {
this.formData.equipId = null;
}
console.log(value)
},
initSelection(){
getEquipCascader().then(res=>{
@ -211,9 +213,11 @@ export default {
},
/** 提交按钮 */
async submitForm() {
console.log(this.formData)
//
await this.$refs["formRef"].validate();
this.formData.status = 1;
console.log(this.formData)
await RemoteMaintenanceOrderApi.createRemoteMaintenanceOrder(this.formData)
this.$modal.msgSuccess("提交成功");
this.$tab.closeOpenPage({ path: "/maintenance/remote-maintenance-order" });
@ -234,6 +238,7 @@ export default {
processInstanceId: undefined,
customerId: undefined,
faultType: undefined,
reportId: undefined,
};
this.cascaderValue = [];
this.resetForm("formRef");

View File

@ -117,6 +117,7 @@ export default {
processInstanceId: undefined,
customerId: undefined,
faultType: undefined,
reportId: undefined,
},
reportFormData:{},
evaluateFormData:{},
@ -172,8 +173,8 @@ export default {
RemoteMaintenanceOrderApi.getRemoteMaintenanceOrderRecord(this.id).then(res=>{
this.formData = res.data;
//
if (this.formData.diagnoiseReportId != null){
MaintenanceReportApi.getMaintenanceReport(this.formData.diagnoiseReportId).then(res=>{
if (this.formData.reportId != null){
MaintenanceReportApi.getMaintenanceReport(this.formData.reportId).then(res=>{
this.reportFormData = res.data;
this.evaluateFormData = res.data;
})
@ -213,8 +214,8 @@ export default {
}
//
else if ("Activity_048xfy8" === taskKey){
this.evaluateFormData.maintenanceReportId = this.formData.diagnoiseReportId;
console.log(this.formData.diagnoiseReportId)
this.evaluateFormData.maintenanceReportId = this.formData.reportId;
console.log(this.formData.reportId)
MaintenanceReportApi.submitEvaluate(this.evaluateFormData)
console.log("评价表单提交!")
}

View File

@ -109,9 +109,9 @@
<el-col :span="12">
<el-form-item
label="维修报告:"
prop="diagnoiseReportId"
prop="reportId"
>
<el-button v-if="detailForm.diagnoiseReportId !== null" size="mini" type="text" @click="openReport(detailForm.maintenanceOrderNo,detailForm.diagnoiseReportId)">维修报告</el-button>
<el-button v-if="detailForm.reportId !== null" size="mini" type="text" @click="openReport(detailForm.maintenanceOrderNo,detailForm.reportId)">维修报告</el-button>
<span v-else></span>
</el-form-item>
</el-col>