Commit 2d5fc8bc authored by 韩桐桐's avatar 韩桐桐

fix(jg):维修告知删除

parent 69734302
...@@ -81,8 +81,8 @@ public class JgMaintainNoticeController extends BaseController { ...@@ -81,8 +81,8 @@ public class JgMaintainNoticeController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/delete") @DeleteMapping(value = "/delete")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除维修告知", notes = "根据sequenceNbr删除维修告知") @ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除维修告知", notes = "根据sequenceNbr删除维修告知")
public ResponseModel<Boolean> deleteBySequenceNbr(@RequestParam(value = "sequenceNbr") Long[] sequenceNbr) { public ResponseModel<Boolean> deleteBySequenceNbr(@RequestParam(value = "sequenceNbrs") Long sequenceNbr) {
return ResponseHelper.buildResponse(iJgMaintainNoticeService.deleteBySequenceNbr(sequenceNbr)); return ResponseHelper.buildResponse(iJgMaintainNoticeService.deleteBySequenceNbr(new Long[]{sequenceNbr}));
} }
/** /**
......
...@@ -17,9 +17,11 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; ...@@ -17,9 +17,11 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jg.api.dto.*; import com.yeejoin.amos.boot.module.jg.api.dto.*;
import com.yeejoin.amos.boot.module.jg.api.entity.JgMaintainNotice; import com.yeejoin.amos.boot.module.jg.api.entity.JgMaintainNotice;
import com.yeejoin.amos.boot.module.jg.api.entity.JgMaintainNoticeEq; import com.yeejoin.amos.boot.module.jg.api.entity.JgMaintainNoticeEq;
import com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory;
import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgMaintainNoticeEqMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgMaintainNoticeEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgMaintainNoticeMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgMaintainNoticeMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgRegistrationHistoryMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService; import com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService;
import com.yeejoin.amos.boot.module.jg.api.service.IJgMaintainNoticeService; import com.yeejoin.amos.boot.module.jg.api.service.IJgMaintainNoticeService;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo; import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
...@@ -116,6 +118,9 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -116,6 +118,9 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
@Autowired @Autowired
private TzBaseEnterpriseInfoMapper tzBaseEnterpriseInfoMapper; private TzBaseEnterpriseInfoMapper tzBaseEnterpriseInfoMapper;
@Autowired
private JgRegistrationHistoryMapper jgRegistrationHistoryMapper;
/** /**
* 根据sequenceNbr查询 * 根据sequenceNbr查询
* *
...@@ -372,14 +377,20 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -372,14 +377,20 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
} }
@Override @Override
public boolean deleteBySequenceNbr(Long[] sequenceNbr) { public boolean deleteBySequenceNbr(Long[] sequenceNbrs) {
this.baseMapper.deleteById(sequenceNbr); for (Long sequenceNbr : sequenceNbrs) {
LambdaQueryWrapper<JgMaintainNoticeEq> lambda = new QueryWrapper<JgMaintainNoticeEq>().lambda(); JgMaintainNotice jgMaintainNotice = this.baseMapper.selectById(sequenceNbr);
lambda.eq(JgMaintainNoticeEq::getEquipTransferId, sequenceNbr); // 删除待办 + 中止流程
jgMaintainNoticeEqMapper.delete(lambda); commonService.deleteTaskModel(sequenceNbr + "",jgMaintainNotice.getInstanceId());
// 删除待办 + 中止流程 // 删除业务单
JgMaintainNotice jgMaintainNotice = this.baseMapper.selectById(sequenceNbr); this.baseMapper.deleteById(sequenceNbr);
commonService.deleteTaskModel(sequenceNbr + "",jgMaintainNotice.getInstanceId()); // 删除对应equ
jgMaintainNoticeEqMapper.delete(new QueryWrapper<JgMaintainNoticeEq>().lambda()
.eq(JgMaintainNoticeEq::getEquipTransferId, sequenceNbr));
// 删除单子对应历史表数据
jgRegistrationHistoryMapper.delete(new LambdaQueryWrapper<JgRegistrationHistory>()
.eq(JgRegistrationHistory::getCurrentDocumentId, jgMaintainNotice.getSequenceNbr()));
}
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment