Commit 0ceddb6e authored by 刘林's avatar 刘林

Merge remote-tracking branch 'origin/develop_tzs_register' into develop_tzs_register

parents e3197b6c 4da27367
...@@ -6,9 +6,7 @@ import com.alibaba.fastjson.JSONObject; ...@@ -6,9 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil; import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationUnitDto; import com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationUnitDto;
import com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgChangeRegistrationUnit; import com.yeejoin.amos.boot.module.jg.api.entity.JgChangeRegistrationUnit;
import com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.CommonServiceImpl; import com.yeejoin.amos.boot.module.jg.biz.service.impl.CommonServiceImpl;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -17,25 +15,19 @@ import io.swagger.annotations.Api; ...@@ -17,25 +15,19 @@ import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.io.*;
import java.net.URLEncoder;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgChangeRegistrationUnitServiceImpl; import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgChangeRegistrationUnitServiceImpl;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationUnitDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
...@@ -97,12 +89,8 @@ public class JgChangeRegistrationUnitController extends BaseController { ...@@ -97,12 +89,8 @@ public class JgChangeRegistrationUnitController extends BaseController {
@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 = "sequenceNbr") Long sequenceNbr) {
JgChangeRegistrationUnit changeRegistrationUnit = jgChangeRegistrationUnitServiceImpl.getById(sequenceNbr); jgChangeRegistrationUnitServiceImpl.deleteForBatch(new Long[]{sequenceNbr});
boolean bool = jgChangeRegistrationUnitServiceImpl.removeById(sequenceNbr); return ResponseHelper.buildResponse(Boolean.TRUE);
if (bool){
commonService.deleteTaskModel(sequenceNbr+"",changeRegistrationUnit.getInstanceId());
}
return ResponseHelper.buildResponse(bool);
} }
/** /**
......
...@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController; ...@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil; import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeDto; import com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice; import com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeEqMapper;
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.biz.service.impl.CommonServiceImpl; import com.yeejoin.amos.boot.module.jg.biz.service.impl.CommonServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -40,10 +41,6 @@ public class JgInstallationNoticeController extends BaseController { ...@@ -40,10 +41,6 @@ public class JgInstallationNoticeController extends BaseController {
@Autowired @Autowired
private IJgInstallationNoticeService iJgInstallationNoticeService; private IJgInstallationNoticeService iJgInstallationNoticeService;
@Autowired
private CommonServiceImpl commonService;
/** /**
* 新增 * 新增
* *
...@@ -91,11 +88,8 @@ public class JgInstallationNoticeController extends BaseController { ...@@ -91,11 +88,8 @@ public class JgInstallationNoticeController extends BaseController {
@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 = "sequenceNbr") Long sequenceNbr) {
// 删除待办 + 中止流程 iJgInstallationNoticeService.deleteForBatch(new Long[]{sequenceNbr});
JgInstallationNotice jgInstallationNotice = iJgInstallationNoticeService.getBaseMapper().selectById(sequenceNbr); return ResponseHelper.buildResponse(Boolean.TRUE);
commonService.deleteTaskModel(String.valueOf(sequenceNbr),jgInstallationNotice.getInstanceId());
jgInstallationNotice.setIsDelete(true);
return ResponseHelper.buildResponse(iJgInstallationNoticeService.updateById(jgInstallationNotice));
} }
/** /**
......
...@@ -7,15 +7,14 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController; ...@@ -7,15 +7,14 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil; import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.module.jg.api.dto.JgTransferNoticeDto; import com.yeejoin.amos.boot.module.jg.api.dto.JgTransferNoticeDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgTransferNotice; import com.yeejoin.amos.boot.module.jg.api.entity.JgTransferNotice;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgTransferNoticeEqMapper;
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.IJgTransferNoticeService; import com.yeejoin.amos.boot.module.jg.api.service.IJgTransferNoticeService;
import com.yeejoin.amos.boot.module.jg.biz.service.ICommonService; import com.yeejoin.amos.boot.module.jg.biz.service.ICommonService;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.CommonServiceImpl; import com.yeejoin.amos.boot.module.jg.biz.service.impl.CommonServiceImpl;
import com.yeejoin.amos.boot.module.jg.biz.utils.ImageUtils;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import jdk.nashorn.api.scripting.JSObject;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
...@@ -43,10 +42,6 @@ public class JgTransferNoticeController extends BaseController { ...@@ -43,10 +42,6 @@ public class JgTransferNoticeController extends BaseController {
@Autowired @Autowired
private ICommonService commonService; private ICommonService commonService;
@Autowired
private CommonServiceImpl commonServiceImpl;
@Autowired @Autowired
private IJgInstallationNoticeService iJgInstallationNoticeService; private IJgInstallationNoticeService iJgInstallationNoticeService;
...@@ -101,10 +96,8 @@ public class JgTransferNoticeController extends BaseController { ...@@ -101,10 +96,8 @@ public class JgTransferNoticeController extends BaseController {
@DeleteMapping(value = "/delete") @DeleteMapping(value = "/delete")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除移装造告知", notes = "根据sequenceNbr删除移装造告知") @ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除移装造告知", notes = "根据sequenceNbr删除移装造告知")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @RequestParam(value = "sequenceNbr") Long sequenceNbr) { public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @RequestParam(value = "sequenceNbr") Long sequenceNbr) {
// 删除待办 及 中止流程 jgTransferNoticeService.deleteForBatch(new Long[]{sequenceNbr});
JgTransferNotice jgTransferNotice = jgTransferNoticeService.getBaseMapper().selectById(sequenceNbr); return ResponseHelper.buildResponse(Boolean.TRUE);
commonServiceImpl.deleteTaskModel(String.valueOf(sequenceNbr),jgTransferNotice.getInstanceId());
return ResponseHelper.buildResponse(jgTransferNoticeService.removeById(sequenceNbr));
} }
/** /**
......
...@@ -119,6 +119,8 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg ...@@ -119,6 +119,8 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
private static String template = "来自企业(%s)的业务办理"; private static String template = "来自企业(%s)的业务办理";
public static String JG_COMAPNY_TYPE = "监管机构"; public static String JG_COMAPNY_TYPE = "监管机构";
@Autowired
private JgRegistrationHistoryMapper jgRegistrationHistoryMapper;
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
...@@ -446,21 +448,19 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg ...@@ -446,21 +448,19 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void deleteBatch(List<Long> ids) { public void deleteBatch(List<Long> ids) {
// 删除待办 for (Long seq : ids) {
this.deleteTaskBatch(ids); JgChangeRegistrationName jgChangeRegistrationName = this.baseMapper.selectById(seq);
// 删除业务数据 // 删除代办 + 中止流程
JgChangeRegistrationName jgChangeRegistrationName = new JgChangeRegistrationName(); commonService.deleteTaskModel(String.valueOf(seq),jgChangeRegistrationName.getInstanceId());
jgChangeRegistrationName.setIsDelete(true); // 删除单子
LambdaQueryWrapper<JgChangeRegistrationName> lambda = new QueryWrapper<JgChangeRegistrationName>().lambda(); this.baseMapper.deleteById(seq);
lambda.in(JgChangeRegistrationName::getSequenceNbr, ids); // 删除单子对应eq
this.update(jgChangeRegistrationName, lambda); jgChangeRegistrationNameEqMapper.delete(new LambdaQueryWrapper<JgChangeRegistrationNameEq>()
.eq(JgChangeRegistrationNameEq::getNameChangeRegistrationId, seq));
// 删除单子对应历史表数据
jgRegistrationHistoryMapper.delete(new LambdaQueryWrapper<JgRegistrationHistory>()
.eq(JgRegistrationHistory::getCurrentDocumentId, jgChangeRegistrationName.getApplyNo()));
} }
private void deleteTaskBatch(List<Long> ids) {
ids.forEach(id-> {
JgChangeRegistrationName jgChangeRegistrationName = this.baseMapper.selectById(id);
commonService.deleteTaskModel(id + "",jgChangeRegistrationName.getInstanceId());
});
} }
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
......
...@@ -492,24 +492,21 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR ...@@ -492,24 +492,21 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
} }
} }
@Transactional(rollbackFor = Exception.class)
public void deleteBatch(List<Long> ids) { public void deleteBatch(List<Long> ids) {
List<JgChangeRegistrationReform> jgChangeRegistrationReformList = this.getBaseMapper().selectList(new QueryWrapper<JgChangeRegistrationReform>().in("sequence_nbr", ids)); // 删除暂存的待办
List<String> applyNos = jgChangeRegistrationReformList.stream().map(JgChangeRegistrationReform::getApplyNo).collect(Collectors.toList());
JgChangeRegistrationReform jgChangeRegistrationReform = new JgChangeRegistrationReform();
jgChangeRegistrationReform.setIsDelete(true);
LambdaQueryWrapper<JgChangeRegistrationReform> lambda = new QueryWrapper<JgChangeRegistrationReform>().lambda();
lambda.in(JgChangeRegistrationReform::getSequenceNbr, ids);
this.getBaseMapper().delete(lambda);
JgChangeRegistrationReformEq jgChangeRegistrationReformEq = new JgChangeRegistrationReformEq();
jgChangeRegistrationReformEq.setIsDelete(true);
LambdaQueryWrapper<JgChangeRegistrationReformEq> lambda1 = new QueryWrapper<JgChangeRegistrationReformEq>().lambda();
lambda1.in(JgChangeRegistrationReformEq::getEquipTransferId, ids);
jgChangeRegistrationReformEqMapper.delete(lambda1);
jgRegistrationHistoryMapper.delete(new QueryWrapper<JgRegistrationHistory>().in("current_document_id", applyNos));
//删除暂存的待办
ids.forEach(id -> { ids.forEach(id -> {
JgChangeRegistrationReform registrationReform = this.baseMapper.selectById(id); JgChangeRegistrationReform registrationReform = this.baseMapper.selectById(id);
// 删除代办 + 流程流程
commonServiceImpl.deleteTaskModel(String.valueOf(id),registrationReform.getInstanceId()); commonServiceImpl.deleteTaskModel(String.valueOf(id),registrationReform.getInstanceId());
// 删除单子
this.baseMapper.deleteById(id);
// 删除单子对应eq
jgChangeRegistrationReformEqMapper.delete(new LambdaQueryWrapper<JgChangeRegistrationReformEq>()
.eq(JgChangeRegistrationReformEq::getEquipTransferId, id));
// 删除单子对应历史表数据
jgRegistrationHistoryMapper.delete(new LambdaQueryWrapper<JgRegistrationHistory>()
.eq(JgRegistrationHistory::getCurrentDocumentId, registrationReform.getApplyNo()));
}); });
} }
......
...@@ -133,6 +133,9 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang ...@@ -133,6 +133,9 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
@Autowired @Autowired
private RedissonClient redissonClient; private RedissonClient redissonClient;
@Autowired
private JgRegistrationHistoryMapper jgRegistrationHistoryMapper;
/** /**
* 新增移装变更登记 * 新增移装变更登记
* *
...@@ -524,48 +527,25 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang ...@@ -524,48 +527,25 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
return false; return false;
} }
try { try {
//删除移装变更信息 for (Long sequenceNbr : sequenceNbrs) {
JgChangeRegistrationTransfer transfer = new JgChangeRegistrationTransfer(); JgChangeRegistrationTransfer registrationTransfer = this.baseMapper.selectById(sequenceNbr);
transfer.setIsDelete(true); // 删除代办 + 中止流程
LambdaQueryWrapper<JgChangeRegistrationTransfer> transferWapper = new QueryWrapper<JgChangeRegistrationTransfer>().lambda(); commonService.deleteTaskModel(String.valueOf(sequenceNbr),registrationTransfer.getInstanceId());
transferWapper.in(JgChangeRegistrationTransfer::getSequenceNbr, Arrays.asList(sequenceNbrs)); // 删除单子
this.update(transfer, transferWapper); this.baseMapper.deleteById(sequenceNbr);
//删除关联表信息 // 删除单子对应eq
JgChangeRegistrationTransferEq eq = new JgChangeRegistrationTransferEq(); jgChangeRegistrationTransferEqMapper.delete(new LambdaQueryWrapper<JgChangeRegistrationTransferEq>()
transfer.setIsDelete(true); .eq(JgChangeRegistrationTransferEq::getEquipTransferId, sequenceNbr));
LambdaQueryWrapper<JgChangeRegistrationTransferEq> eqWapper = new QueryWrapper<JgChangeRegistrationTransferEq>().lambda(); // 删除单子对应历史表数据
eqWapper.in(JgChangeRegistrationTransferEq::getEquipTransferId, Arrays.asList(sequenceNbrs)); jgRegistrationHistoryMapper.delete(new LambdaQueryWrapper<JgRegistrationHistory>()
jgChangeRegistrationTransferEqService.updateDate(eq, eqWapper); .eq(JgRegistrationHistory::getCurrentDocumentId, registrationTransfer.getApplyNo()));
//删除历史表 }
JgRegistrationHistory history = new JgRegistrationHistory();
history.setIsDelete(true);
List<JgChangeRegistrationTransferDto> transferDtos = this.queryBatchSeq(Arrays.asList(sequenceNbrs));
if (!ValidationUtil.isEmpty(transferDtos)) {
List<String> applyNos = transferDtos.stream().map(item -> item.getApplyNo()).collect(Collectors.toList());
if (!ValidationUtil.isEmpty(applyNos)) {
LambdaQueryWrapper<JgRegistrationHistory> historyWapper = new QueryWrapper<JgRegistrationHistory>().lambda();
historyWapper.in(JgRegistrationHistory::getCurrentDocumentId, applyNos);
jgRegistrationHistoryService.updateDate(history, historyWapper);
}
}
// 删除待办
this.deleteTaskBatch(Arrays.asList(sequenceNbrs));
} catch (Exception e) { } catch (Exception e) {
return false; return false;
} }
return true; return true;
} }
// 删除待办
private void deleteTaskBatch(List<Long> ids) {
ids.forEach(id -> {
JgChangeRegistrationTransfer jgChangeRegistrationTransfer = this.baseMapper.selectById(id);
commonService.deleteTaskModel(id + "",jgChangeRegistrationTransfer.getInstanceId());
});
}
/** /**
* 根据移装变更记录sequenceNbr查询详情 * 根据移装变更记录sequenceNbr查询详情
* @param sequenceNbr 变更记录sequenceNbr * @param sequenceNbr 变更记录sequenceNbr
......
...@@ -383,11 +383,20 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg ...@@ -383,11 +383,20 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
if (Objects.isNull(sequenceNbrs) || sequenceNbrs.length == 0) { if (Objects.isNull(sequenceNbrs) || sequenceNbrs.length == 0) {
return false; return false;
} }
Collection<JgChangeRegistrationUnit> JgChangeRegistrationUnits = this.listByIds(Arrays.asList(sequenceNbrs)); for (Long sequenceNbr : sequenceNbrs) {
JgChangeRegistrationUnits.forEach(notice -> { JgChangeRegistrationUnit changeRegistrationUnit = this.baseMapper.selectById(sequenceNbr);
notice.setIsDelete(true); // 删除代办 + 中止流程
}); commonServiceImpl.deleteTaskModel(String.valueOf(sequenceNbr),changeRegistrationUnit.getInstanceId());
return this.updateBatchById(JgChangeRegistrationUnits); // 删除单子
this.baseMapper.deleteById(sequenceNbr);
// 删除单子对应eq
jgChangeRegistrationUnitEqMapper.delete(new LambdaQueryWrapper<JgChangeRegistrationUnitEq>()
.eq(JgChangeRegistrationUnitEq::getUnitChangeRegistrationId, sequenceNbr));
// 删除单子对应历史表数据
jgRegistrationHistoryMapper.delete(new LambdaQueryWrapper<JgRegistrationHistory>()
.eq(JgRegistrationHistory::getCurrentDocumentId, changeRegistrationUnit.getApplyNo()));
}
return Boolean.TRUE;
} }
......
...@@ -16,6 +16,7 @@ import com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum; ...@@ -16,6 +16,7 @@ import com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgEnableDisableEqMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgEnableDisableEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgEnableDisableMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgEnableDisableMapper;
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.IJgEnableDisableService; import com.yeejoin.amos.boot.module.jg.api.service.IJgEnableDisableService;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo; import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient; import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
...@@ -97,6 +98,9 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -97,6 +98,9 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
@Autowired @Autowired
private IdxBizJgUseInfoMapper idxBizJgUseInfoMapper; private IdxBizJgUseInfoMapper idxBizJgUseInfoMapper;
@Autowired
private JgRegistrationHistoryMapper jgRegistrationHistoryMapper;
/** /**
* 设备状态:启用 * 设备状态:启用
*/ */
...@@ -701,14 +705,19 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -701,14 +705,19 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
this.getBaseMapper().updateById(jgEnableDisable); this.getBaseMapper().updateById(jgEnableDisable);
} }
@Transactional(rollbackFor = Exception.class)
public void deleteMessage(Long sequenceNbr) { public void deleteMessage(Long sequenceNbr) {
this.baseMapper.deleteById(sequenceNbr);
LambdaQueryWrapper<JgEnableDisableEq> lambda = new QueryWrapper<JgEnableDisableEq>().lambda();
lambda.eq(JgEnableDisableEq::getEnableDisableApplyId, sequenceNbr);
jgEnableDisableEqService.getBaseMapper().delete(lambda);
// 删除待办
JgEnableDisable jgEnableDisable = this.baseMapper.selectById(sequenceNbr); JgEnableDisable jgEnableDisable = this.baseMapper.selectById(sequenceNbr);
commonService.deleteTaskModel(sequenceNbr + "",jgEnableDisable.getInstanceId()); // 删除代办 + 中止流程
commonService.deleteTaskModel(String.valueOf(sequenceNbr),jgEnableDisable.getInstanceId());
// 删除单子
this.baseMapper.deleteById(sequenceNbr);
// 删除单子对应eq
jgEnableDisableEqService.getBaseMapper().delete(new QueryWrapper<JgEnableDisableEq>().lambda()
.eq(JgEnableDisableEq::getEnableDisableApplyId, sequenceNbr));
// 删除单子对应历史表数据
jgRegistrationHistoryMapper.delete(new LambdaQueryWrapper<JgRegistrationHistory>()
.eq(JgRegistrationHistory::getCurrentDocumentId, jgEnableDisable.getApplyNo()));
} }
public Map<String, Object> getDetail(Long sequenceNbr) { public Map<String, Object> getDetail(Long sequenceNbr) {
......
...@@ -15,10 +15,12 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; ...@@ -15,10 +15,12 @@ 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.JgEquipTransfer; import com.yeejoin.amos.boot.module.jg.api.entity.JgEquipTransfer;
import com.yeejoin.amos.boot.module.jg.api.entity.JgEquipTransferEq; import com.yeejoin.amos.boot.module.jg.api.entity.JgEquipTransferEq;
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.enums.CompanyTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgEquipTransferEqMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgEquipTransferEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgEquipTransferMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgEquipTransferMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgRegistrationHistoryMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgEquipTransferService; import com.yeejoin.amos.boot.module.jg.api.service.IJgEquipTransferService;
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.vo.SortVo; import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
...@@ -82,6 +84,9 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto, ...@@ -82,6 +84,9 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
@Autowired @Autowired
private RedissonClient redissonClient; private RedissonClient redissonClient;
@Autowired
private JgRegistrationHistoryMapper jgRegistrationHistoryMapper;
/** /**
* 保存和保存并提交 * 保存和保存并提交
* *
...@@ -745,9 +750,17 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto, ...@@ -745,9 +750,17 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
public Boolean deleteForBatch(Long[] ids) { public Boolean deleteForBatch(Long[] ids) {
Collection<JgEquipTransfer> jgEquipTransfers = this.listByIds(Arrays.asList(ids)); Collection<JgEquipTransfer> jgEquipTransfers = this.listByIds(Arrays.asList(ids));
for (JgEquipTransfer notice : jgEquipTransfers) { for (JgEquipTransfer notice : jgEquipTransfers) {
notice.setIsDelete(true); // 删除代办 + 中止流程
commonService.deleteTaskModel(String.valueOf(notice.getSequenceNbr()),notice.getInstanceId()); commonService.deleteTaskModel(String.valueOf(notice.getSequenceNbr()),notice.getInstanceId());
} // 删除单子
return this.updateBatchById(jgEquipTransfers); this.baseMapper.deleteById(notice.getSequenceNbr());
// 删除对应eq
jgEquipTransferEqMapper.delete(new LambdaQueryWrapper<JgEquipTransferEq>()
.eq(JgEquipTransferEq::getEquipTransferId, notice.getSequenceNbr()));
// 删除单子对应历史表数据
jgRegistrationHistoryMapper.delete(new LambdaQueryWrapper<JgRegistrationHistory>()
.eq(JgRegistrationHistory::getCurrentDocumentId, notice.getApplyNo()));
}
return Boolean.TRUE;
} }
} }
\ No newline at end of file
...@@ -19,10 +19,12 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; ...@@ -19,10 +19,12 @@ 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.JgInstallationNotice; import com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice;
import com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNoticeEq; import com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNoticeEq;
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.enums.CompanyTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeEqMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgRegistrationHistoryMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper;
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.vo.SortVo; import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
...@@ -162,6 +164,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -162,6 +164,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
private JgResumeInfoServiceImpl jgResumeInfoService; private JgResumeInfoServiceImpl jgResumeInfoService;
@Autowired @Autowired
private TzBaseEnterpriseInfoMapper tzBaseEnterpriseInfoMapper; private TzBaseEnterpriseInfoMapper tzBaseEnterpriseInfoMapper;
@Autowired
private JgRegistrationHistoryMapper jgRegistrationHistoryMapper;
/** /**
* 根据sequenceNbr查询 * 根据sequenceNbr查询
...@@ -448,19 +452,21 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -448,19 +452,21 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
if (Objects.isNull(sequenceNbrs) || sequenceNbrs.length == 0) { if (Objects.isNull(sequenceNbrs) || sequenceNbrs.length == 0) {
return false; return false;
} }
Collection<JgInstallationNotice> jgInstallationNotices = this.listByIds(Arrays.asList(sequenceNbrs)); for (Long sequenceNbr : sequenceNbrs) {
// jgInstallationNotices.forEach(notice -> { // 删除待办 + 中止流程
// if (StringUtils.hasText(notice.getInspectUnitId())) { JgInstallationNotice jgInstallationNotice = this.baseMapper.selectById(sequenceNbr);
// throw new IllegalStateException("所选数据已存在流程,不能删除!"); commonService.deleteTaskModel(String.valueOf(sequenceNbr),jgInstallationNotice.getInstanceId());
// } // 删除业务单
// notice.setIsDelete(true); jgInstallationNotice.setIsDelete(true);
// }); this.getBaseMapper().deleteById(sequenceNbr);
// 删除暂存的待办 // 删除对应equ
jgInstallationNotices.forEach(installationNotice -> { jgInstallationNoticeEqMapper.delete(new LambdaUpdateWrapper<JgInstallationNoticeEq>()
installationNotice.setIsDelete(true); .eq(JgInstallationNoticeEq::getEquipTransferId, sequenceNbr));
commonService.deleteTaskModel(String.valueOf(installationNotice.getSequenceNbr()), installationNotice.getInstanceId()); // 删除单子对应历史表数据
}); jgRegistrationHistoryMapper.delete(new LambdaQueryWrapper<JgRegistrationHistory>()
return this.updateBatchById(jgInstallationNotices); .eq(JgRegistrationHistory::getCurrentDocumentId, jgInstallationNotice.getApplyNo()));
}
return Boolean.TRUE;
} }
/** /**
......
...@@ -16,12 +16,13 @@ import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl; ...@@ -16,12 +16,13 @@ import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; 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.JgInstallationNotice;
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 +117,8 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -116,6 +117,8 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
@Autowired @Autowired
private RedissonClient redissonClient; private RedissonClient redissonClient;
@Autowired
private JgRegistrationHistoryMapper jgRegistrationHistoryMapper;
/** /**
* 根据sequenceNbr查询 * 根据sequenceNbr查询
...@@ -365,14 +368,21 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -365,14 +368,21 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
} }
@Override @Override
public boolean deleteBySequenceNbr(Long[] sequenceNbr) { @Transactional(rollbackFor = Exception.class)
this.baseMapper.deleteById(sequenceNbr); public boolean deleteBySequenceNbr(Long[] sequenceNbrs) {
LambdaQueryWrapper<JgMaintainNoticeEq> lambda = new QueryWrapper<JgMaintainNoticeEq>().lambda(); for (Long sequenceNbr : sequenceNbrs) {
lambda.eq(JgMaintainNoticeEq::getEquipTransferId, sequenceNbr);
jgMaintainNoticeEqMapper.delete(lambda);
// 删除待办 + 中止流程
JgMaintainNotice jgMaintainNotice = this.baseMapper.selectById(sequenceNbr); JgMaintainNotice jgMaintainNotice = this.baseMapper.selectById(sequenceNbr);
// 删除待办 + 中止流程
commonService.deleteTaskModel(sequenceNbr + "",jgMaintainNotice.getInstanceId()); commonService.deleteTaskModel(sequenceNbr + "",jgMaintainNotice.getInstanceId());
// 删除业务单
this.baseMapper.deleteById(sequenceNbr);
// 删除对应equ
jgMaintainNoticeEqMapper.delete(new QueryWrapper<JgMaintainNoticeEq>().lambda()
.eq(JgMaintainNoticeEq::getEquipTransferId, sequenceNbr));
// 删除单子对应历史表数据
jgRegistrationHistoryMapper.delete(new LambdaQueryWrapper<JgRegistrationHistory>()
.eq(JgRegistrationHistory::getCurrentDocumentId, jgMaintainNotice.getApplyNo()));
}
return true; return true;
} }
......
...@@ -13,12 +13,14 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; ...@@ -13,12 +13,14 @@ 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.JgMaintenanceContract; import com.yeejoin.amos.boot.module.jg.api.entity.JgMaintenanceContract;
import com.yeejoin.amos.boot.module.jg.api.entity.JgMaintenanceContractEq; import com.yeejoin.amos.boot.module.jg.api.entity.JgMaintenanceContractEq;
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.enums.CompanyTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.SafetyProblemTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.SafetyProblemTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum; import com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgMaintenanceContractEqMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgMaintenanceContractEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgMaintenanceContractMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgMaintenanceContractMapper;
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.IJgMaintenanceContractService; import com.yeejoin.amos.boot.module.jg.api.service.IJgMaintenanceContractService;
import com.yeejoin.amos.boot.module.jg.api.vo.JgMaintenanceContractVo; import com.yeejoin.amos.boot.module.jg.api.vo.JgMaintenanceContractVo;
...@@ -94,6 +96,8 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC ...@@ -94,6 +96,8 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
private RedissonClient redissonClient; private RedissonClient redissonClient;
@Autowired @Autowired
private JgResumeInfoServiceImpl jgResumeInfoService; private JgResumeInfoServiceImpl jgResumeInfoService;
@Autowired
private JgRegistrationHistoryMapper jgRegistrationHistoryMapper;
/** /**
* 分页查询 * 分页查询
...@@ -244,8 +248,16 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC ...@@ -244,8 +248,16 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
List<Long> list = Arrays.asList(ids); List<Long> list = Arrays.asList(ids);
list.forEach(seq -> { list.forEach(seq -> {
JgMaintenanceContract jgMaintenanceContract = this.baseMapper.selectById(seq); JgMaintenanceContract jgMaintenanceContract = this.baseMapper.selectById(seq);
// 删除待办 及 中止流程
commonService.deleteTaskModel(String.valueOf(jgMaintenanceContract.getSequenceNbr()),jgMaintenanceContract.getInstanceId()); commonService.deleteTaskModel(String.valueOf(jgMaintenanceContract.getSequenceNbr()),jgMaintenanceContract.getInstanceId());
// 删除业务单
this.baseMapper.deleteById(seq); this.baseMapper.deleteById(seq);
// 删除对应eq
jgMaintenanceContractEqService.getBaseMapper().delete(new LambdaQueryWrapper<JgMaintenanceContractEq>()
.eq(JgMaintenanceContractEq::getEquipTransferId, seq));
// 删除单子对应历史表数据
jgRegistrationHistoryMapper.delete(new LambdaQueryWrapper<JgRegistrationHistory>()
.eq(JgRegistrationHistory::getCurrentDocumentId, jgMaintenanceContract.getApplyNo()));
}); });
return true; return true;
} }
......
...@@ -15,9 +15,11 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; ...@@ -15,9 +15,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.JgReformNotice; import com.yeejoin.amos.boot.module.jg.api.entity.JgReformNotice;
import com.yeejoin.amos.boot.module.jg.api.entity.JgReformNoticeEq; import com.yeejoin.amos.boot.module.jg.api.entity.JgReformNoticeEq;
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.JgReformNoticeEqMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgReformNoticeEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgReformNoticeMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgReformNoticeMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgRegistrationHistoryMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgReformNoticeService; import com.yeejoin.amos.boot.module.jg.api.service.IJgReformNoticeService;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo; import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient; import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
...@@ -105,6 +107,8 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -105,6 +107,8 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
private CmWorkflowServiceImpl cmWorkflowService; private CmWorkflowServiceImpl cmWorkflowService;
@Autowired @Autowired
private RedissonClient redissonClient; private RedissonClient redissonClient;
@Autowired
private JgRegistrationHistoryMapper jgRegistrationHistoryMapper;
/** /**
* 根据sequenceNbr查询 * 根据sequenceNbr查询
...@@ -305,14 +309,18 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -305,14 +309,18 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
} }
Collection<JgReformNotice> JgReformNotices = this.listByIds(Arrays.asList(sequenceNbrs)); Collection<JgReformNotice> JgReformNotices = this.listByIds(Arrays.asList(sequenceNbrs));
JgReformNotices.forEach(notice -> { JgReformNotices.forEach(notice -> {
// if (StringUtils.hasText(notice.getInspectUnitId())) { // 删除代办 + 中止流程
// throw new IllegalStateException("所选数据已存在流程,不能删除!");
// }
notice.setIsDelete(true);
commonService.deleteTaskModel(String.valueOf(notice.getSequenceNbr()),notice.getInstanceId()); commonService.deleteTaskModel(String.valueOf(notice.getSequenceNbr()),notice.getInstanceId());
// 删除单子
this.baseMapper.deleteById(notice.getSequenceNbr());
// 删除对应eq
jgReformNoticeEqMapper.delete(new LambdaQueryWrapper<JgReformNoticeEq>()
.eq(JgReformNoticeEq::getEquipTransferId, notice.getSequenceNbr()));
// 删除单子对应历史表数据
jgRegistrationHistoryMapper.delete(new LambdaQueryWrapper<JgRegistrationHistory>()
.eq(JgRegistrationHistory::getCurrentDocumentId, notice.getApplyNo()));
}); });
return Boolean.TRUE;
return this.updateBatchById(JgReformNotices);
} }
/** /**
......
...@@ -11,11 +11,13 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams; ...@@ -11,11 +11,13 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; 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.JgRegistrationHistory;
import com.yeejoin.amos.boot.module.jg.api.entity.JgScrapCancel; import com.yeejoin.amos.boot.module.jg.api.entity.JgScrapCancel;
import com.yeejoin.amos.boot.module.jg.api.entity.JgScrapCancelEq; import com.yeejoin.amos.boot.module.jg.api.entity.JgScrapCancelEq;
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.enums.CancelTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.CancelTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum; import com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgRegistrationHistoryMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgScrapCancelEqMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgScrapCancelEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgScrapCancelMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgScrapCancelMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgScrapCancelService; import com.yeejoin.amos.boot.module.jg.api.service.IJgScrapCancelService;
...@@ -23,7 +25,6 @@ import com.yeejoin.amos.boot.module.jg.api.vo.SortVo; ...@@ -23,7 +25,6 @@ import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient; import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgRegisterInfoService; import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgRegisterInfoService;
import com.yeejoin.amos.boot.module.jg.flc.api.fegin.WorkFlowFeignService; import com.yeejoin.amos.boot.module.jg.flc.api.fegin.WorkFlowFeignService;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgRegisterInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.OtherInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.OtherInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.SuperviseInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.SuperviseInfo;
...@@ -97,6 +98,8 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc ...@@ -97,6 +98,8 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
private JgScrapCancelEqMapper jgScrapCancelEqMapper; private JgScrapCancelEqMapper jgScrapCancelEqMapper;
@Autowired @Autowired
private IdxBizJgUseInfoMapper idxBizJgUseInfoMapper; private IdxBizJgUseInfoMapper idxBizJgUseInfoMapper;
@Autowired
private JgRegistrationHistoryMapper jgRegistrationHistoryMapper;
@Autowired @Autowired
private RedissonClient redissonClient; private RedissonClient redissonClient;
...@@ -330,17 +333,23 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc ...@@ -330,17 +333,23 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
return String.format(template, equListName, Objects.isNull(supervisoryCode) ? "无" : supervisoryCode, type); return String.format(template, equListName, Objects.isNull(supervisoryCode) ? "无" : supervisoryCode, type);
} }
@Transactional(rollbackFor = Exception.class)
public void deleteBatch(List<Long> ids) { public void deleteBatch(List<Long> ids) {
if (!ids.isEmpty()) { if (!ids.isEmpty()) {
for (Long id : ids) { for (Long id : ids) {
LambdaQueryWrapper<JgScrapCancel> lambda = new QueryWrapper<JgScrapCancel>().lambda(); LambdaQueryWrapper<JgScrapCancel> lambda = new QueryWrapper<JgScrapCancel>().lambda();
lambda.eq(JgScrapCancel::getSequenceNbr, id); lambda.eq(JgScrapCancel::getSequenceNbr, id);
JgScrapCancel jgScrapCancel = this.baseMapper.selectOne(lambda); JgScrapCancel jgScrapCancel = this.baseMapper.selectOne(lambda);
// 删除代办消息 // 删除代办 + 中止流程
commonService.deleteTaskModel(String.valueOf(jgScrapCancel.getSequenceNbr()),jgScrapCancel.getInstanceId()); commonService.deleteTaskModel(String.valueOf(jgScrapCancel.getSequenceNbr()),jgScrapCancel.getInstanceId());
// 更新jgScrapCancel数据 // 删除单子
jgScrapCancel.setIsDelete(true); this.baseMapper.deleteById(jgScrapCancel.getSequenceNbr());
this.updateById(jgScrapCancel); // 删除对应eq
jgScrapCancelEqMapper.delete(new LambdaQueryWrapper<JgScrapCancelEq>()
.eq(JgScrapCancelEq::getEquipTransferId,jgScrapCancel.getSequenceNbr()));
// 删除单子对应历史表数据
jgRegistrationHistoryMapper.delete(new LambdaQueryWrapper<JgRegistrationHistory>()
.eq(JgRegistrationHistory::getCurrentDocumentId, jgScrapCancel.getApplyNo()));
} }
} }
} }
......
...@@ -14,9 +14,11 @@ import com.yeejoin.amos.boot.biz.common.utils.DateUtils; ...@@ -14,9 +14,11 @@ import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; 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.JgRegistrationHistory;
import com.yeejoin.amos.boot.module.jg.api.entity.JgTransferNotice; import com.yeejoin.amos.boot.module.jg.api.entity.JgTransferNotice;
import com.yeejoin.amos.boot.module.jg.api.entity.JgTransferNoticeEq; import com.yeejoin.amos.boot.module.jg.api.entity.JgTransferNoticeEq;
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.JgRegistrationHistoryMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgTransferNoticeEqMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgTransferNoticeEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgTransferNoticeMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgTransferNoticeMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper;
...@@ -30,7 +32,6 @@ import com.yeejoin.amos.boot.module.ymt.api.entity.RegistrationInfo; ...@@ -30,7 +32,6 @@ import com.yeejoin.amos.boot.module.ymt.api.entity.RegistrationInfo;
import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.*; import com.yeejoin.amos.boot.module.ymt.api.mapper.*;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.TaskV2Model; import com.yeejoin.amos.feign.systemctl.model.TaskV2Model;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO; import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO; import com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO;
...@@ -98,7 +99,8 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto ...@@ -98,7 +99,8 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
private JgTransferNoticeMapper jgTransferNoticeMapper; private JgTransferNoticeMapper jgTransferNoticeMapper;
@Autowired @Autowired
private CommonServiceImpl commonService; private CommonServiceImpl commonService;
@Autowired
private JgRegistrationHistoryMapper jgRegistrationHistoryMapper;
@Autowired @Autowired
private RedissonClient redissonClient; private RedissonClient redissonClient;
...@@ -194,19 +196,20 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto ...@@ -194,19 +196,20 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
if (Objects.isNull(sequenceNbrs) || sequenceNbrs.length == 0) { if (Objects.isNull(sequenceNbrs) || sequenceNbrs.length == 0) {
return false; return false;
} }
Collection<JgTransferNotice> jgTransferNotices = this.listByIds(Arrays.asList(sequenceNbrs)); for (Long sequenceNbr : sequenceNbrs) {
// jgTransferNotices.forEach(notice -> { // 删除待办 及 中止流程
// if (StringUtils.hasText(notice.getInspectionUnitCreditCode())) { JgTransferNotice jgTransferNotice = this.getBaseMapper().selectById(sequenceNbr);
// throw new IllegalStateException("所选数据已存在流程,不能删除!"); commonService.deleteTaskModel(String.valueOf(sequenceNbr),jgTransferNotice.getInstanceId());
// } // 删除业务单
// notice.setIsDelete(true); this.getBaseMapper().deleteById(sequenceNbr);
// }); // 删除对应eq
// 删除待办及中止流程 jgTransferNoticeEqMapper.delete(new LambdaQueryWrapper<JgTransferNoticeEq>()
jgTransferNotices.forEach(jgTransferNotice -> { .eq(JgTransferNoticeEq::getEquipTransferId, sequenceNbr));
jgTransferNotice.setIsDelete(true); // 删除单子对应历史表数据
commonService.deleteTaskModel(String.valueOf(jgTransferNotice.getSequenceNbr()),jgTransferNotice.getInstanceId()); jgRegistrationHistoryMapper.delete(new LambdaQueryWrapper<JgRegistrationHistory>()
}); .eq(JgRegistrationHistory::getCurrentDocumentId, jgTransferNotice.getApplyNo()));
return this.updateBatchById(jgTransferNotices); }
return Boolean.TRUE;
} }
/** /**
......
...@@ -166,8 +166,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -166,8 +166,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
@Autowired @Autowired
private JgUseRegistrationMapper jgUseRegistrationMapper; private JgUseRegistrationMapper jgUseRegistrationMapper;
@Autowired @Autowired
private ConstructionInfoMapper constructionInfoMapper;
@Autowired
private ESEquipmentCategory esEquipmentCategory; private ESEquipmentCategory esEquipmentCategory;
@Autowired @Autowired
private JgResumeInfoServiceImpl jgResumeInfoService; private JgResumeInfoServiceImpl jgResumeInfoService;
...@@ -1294,17 +1292,21 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -1294,17 +1292,21 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
} }
} }
@Transactional(rollbackFor = Exception.class)
public void deleteBatch(List<Long> ids) { public void deleteBatch(List<Long> ids) {
JgUseRegistration jgUseRegistration = new JgUseRegistration();
jgUseRegistration.setIsDelete(true);
LambdaQueryWrapper<JgUseRegistration> lambda = new QueryWrapper<JgUseRegistration>().lambda();
lambda.in(JgUseRegistration::getSequenceNbr, ids);
// 删除暂存的待办
ids.forEach(id -> { ids.forEach(id -> {
JgUseRegistration useRegistration = this.baseMapper.selectById(id); JgUseRegistration useRegistration = this.baseMapper.selectById(id);
// 删除代办 + 中止流程
commonServiceImpl.deleteTaskModel(String.valueOf(id), useRegistration.getInstanceId()); commonServiceImpl.deleteTaskModel(String.valueOf(id), useRegistration.getInstanceId());
// 删除单子
this.baseMapper.deleteById(id);
// 删除对应eq
jgUseRegistrationEqService.getBaseMapper().delete(new LambdaQueryWrapper<JgUseRegistrationEq>()
.eq(JgUseRegistrationEq::getEquipTransferId, id));
// 删除单子对应历史表数据
jgRegistrationHistoryService.getBaseMapper().delete(new LambdaQueryWrapper<JgRegistrationHistory>()
.eq(JgRegistrationHistory::getCurrentDocumentId, useRegistration.getApplyNo()));
}); });
this.update(jgUseRegistration, lambda);
} }
public Map<String, Object> getDetail(String record, Long sequenceNbr) { public Map<String, Object> getDetail(String record, Long sequenceNbr) {
......
...@@ -840,19 +840,22 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform ...@@ -840,19 +840,22 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
/** /**
* 批量删除 * 批量删除
* *
* @param ids ids
*/ */
@Transactional(rollbackFor = Exception.class)
public void deleteBatch(List<Long> ids) { public void deleteBatch(List<Long> ids) {
JgVehicleInformation jgVehicleInformation = new JgVehicleInformation();
jgVehicleInformation.setIsDelete(true);
LambdaQueryWrapper<JgVehicleInformation> lambda = new QueryWrapper<JgVehicleInformation>().lambda();
lambda.in(JgVehicleInformation::getSequenceNbr, ids);
// 删除暂存的待办
ids.forEach(id -> { ids.forEach(id -> {
JgVehicleInformation vehicleInformation = this.baseMapper.selectById(id); JgVehicleInformation vehicleInformation = this.baseMapper.selectById(id);
// 删除代办 + 中止流程
commonService.deleteTaskModel(String.valueOf(id),vehicleInformation.getInstanceId()); commonService.deleteTaskModel(String.valueOf(id),vehicleInformation.getInstanceId());
// 删除单子
this.deleteBySeq(id);
// 删除单子对应设备
jgVehicleInformationEqMapper.delete(new LambdaQueryWrapper<JgVehicleInformationEq>()
.eq(JgVehicleInformationEq::getVehicleId, id));
// 删除单子对应历史表数据
jgRegistrationHistoryService.getBaseMapper().delete(new LambdaQueryWrapper<JgRegistrationHistory>()
.eq(JgRegistrationHistory::getCurrentDocumentId, vehicleInformation.getApplyNo()));
}); });
this.update(jgVehicleInformation, lambda);
} }
public Page<Map<String, Object>> getPageList(JgVehicleInformationDto dto, String sort, Page<Map<String, Object>> page, List<String> roleIds) { public Page<Map<String, Object>> getPageList(JgVehicleInformationDto dto, String sort, Page<Map<String, Object>> page, List<String> roleIds) {
......
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