|
|
@@ -1,20 +1,21 @@ |
|
|
|
package com.tuoheng.miniprogram.service.impl; |
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.tuoheng.common.core.common.BaseServiceImpl; |
|
|
|
import com.tuoheng.common.core.utils.DateUtils; |
|
|
|
import com.tuoheng.common.core.utils.JsonResult; |
|
|
|
import com.tuoheng.common.core.utils.SecurityUserUtils; |
|
|
|
import com.tuoheng.common.core.utils.StringUtils; |
|
|
|
import com.tuoheng.miniprogram.dao.DeptMapper; |
|
|
|
import com.tuoheng.miniprogram.dao.UserMapper; |
|
|
|
import com.tuoheng.miniprogram.dao.WorkOrderFileMapper; |
|
|
|
import com.tuoheng.miniprogram.dao.WorkOrderMapper; |
|
|
|
import com.tuoheng.miniprogram.dao.*; |
|
|
|
import com.tuoheng.miniprogram.entity.InspectionFile; |
|
|
|
import com.tuoheng.miniprogram.entity.User; |
|
|
|
import com.tuoheng.miniprogram.entity.WorkOrder; |
|
|
|
import com.tuoheng.miniprogram.entity.WorkOrderFile; |
|
|
|
import com.tuoheng.miniprogram.entity.dto.WorkOrderDto; |
|
|
|
import com.tuoheng.miniprogram.enums.InspectionFileStatusEnum; |
|
|
|
import com.tuoheng.miniprogram.enums.WorkOrderEnum; |
|
|
|
import com.tuoheng.miniprogram.enums.WorkOrderStatusEnum; |
|
|
|
import com.tuoheng.miniprogram.service.IWorkOrderService; |
|
|
@@ -42,6 +43,9 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
@Autowired |
|
|
|
private WorkOrderFileMapper workOrderFileMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private InspectionFileMapper inspectionFileMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private DeptMapper deptMapper; |
|
|
|
|
|
|
@@ -96,7 +100,17 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
workOrderFile.setTenantId(dto.getTenantId()); |
|
|
|
workOrderFile.setInspectionFileId(dto.getInspectionFileId()); |
|
|
|
workOrderFile.setWorkOrderId(workOrder.getId()); |
|
|
|
workOrderFileMapper.insert(workOrderFile); |
|
|
|
int num = workOrderFileMapper.insert(workOrderFile); |
|
|
|
if(num<=0){ |
|
|
|
return JsonResult.error(); |
|
|
|
} |
|
|
|
//更新问题状态为工单已生成 |
|
|
|
InspectionFile inspectionFile = inspectionFileMapper.selectById(dto.getInspectionFileId()); |
|
|
|
inspectionFile.setStatus(InspectionFileStatusEnum.GENERATE_ORDER.getCode()); |
|
|
|
int count = inspectionFileMapper.updateById(inspectionFile); |
|
|
|
if(count<=0){ |
|
|
|
return JsonResult.error(); |
|
|
|
} |
|
|
|
|
|
|
|
return JsonResult.success(); |
|
|
|
} |