Commit 5ac8a75f authored by suhuiguang's avatar suhuiguang

1.安装告知数据作废功能

parent 22fe4a13
......@@ -83,5 +83,5 @@ public interface IJgInstallationNoticeService extends IService<JgInstallationNot
* @param cancelReason 作废原因
* @return JgInstallationNoticeDto
*/
JgInstallationNoticeDto cancelApplication(Long sequenceNbr, String cancelReason);
JgInstallationNotice cancelApplication(Long sequenceNbr, String cancelReason);
}
......@@ -115,7 +115,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.status <![CDATA[ <> ]]> '使用单位待提交' and a.status <![CDATA[ <> ]]> '一级受理已驳回' and a.status <![CDATA[ <> ]]> '使用单位已撤回')
and (a.status <![CDATA[ <> ]]> '使用单位待提交' and a.status <![CDATA[ <> ]]> '一级受理已驳回' and a.status <![CDATA[ <> ]]> '使用单位已撤回' and a.status <![CDATA[ <> ]]> '已作废')
UNION
select
count(1) as inUseNumber
......@@ -175,7 +175,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.notice_status <![CDATA[ <> ]]> '6614' and a.notice_status <![CDATA[ <> ]]> '6615' and a.notice_status <![CDATA[ <> ]]> '6610' )
and (a.notice_status <![CDATA[ <> ]]> '6614' and a.notice_status <![CDATA[ <> ]]> '6615' and a.notice_status <![CDATA[ <> ]]> '6610' and a.notice_status <![CDATA[ <> ]]> '6617')
UNION
select
count(1) as inUseNumber
......@@ -661,6 +661,7 @@
n.sequence_nbr = ne.equip_transfer_id
and n.status != '使用单位待提交'
and n.status != '使用单位已撤回'
and n.status != '已作废'
and (n.manage_type is null or n.manage_type = '' or n.manage_type = 'set')
<if test="param.beginDate != null">
and date_ge(CAST(n.reg_date as date), #{param.beginDate})
......
......@@ -192,7 +192,7 @@
tzs_jg_installation_notice_eq b
where
a.sequence_nbr = b.equip_transfer_id
and (a.notice_status <![CDATA[ <> ]]> '6614' and a.notice_status <![CDATA[ <> ]]> '6615' and a.notice_status <![CDATA[ <> ]]>'6610')
and (a.notice_status <![CDATA[ <> ]]> '6614' and a.notice_status <![CDATA[ <> ]]> '6615' and a.notice_status <![CDATA[ <> ]]>'6610' and a.notice_status <![CDATA[ <> ]]>'6617')
GROUP BY a.install_unit_credit_code
</select>
</mapper>
......@@ -571,6 +571,6 @@
tzs_jg_use_registration_eq b
where
a.sequence_nbr = b.equip_transfer_id
and (a.status <![CDATA[ <> ]]> '使用单位待提交' and a.status <![CDATA[ <> ]]> '一级受理已驳回' and a.status <![CDATA[ <> ]]> '使用单位已撤回')
and (a.status <![CDATA[ <> ]]> '使用单位待提交' and a.status <![CDATA[ <> ]]> '一级受理已驳回' and a.status <![CDATA[ <> ]]> '使用单位已撤回' and a.status <![CDATA[ <> ]]> '已作废')
</select>
</mapper>
......@@ -79,7 +79,7 @@ public class JgInstallationNoticeController extends BaseController {
installationInfo.setProxyStatementAttachmentList((List<Map<String, Object>>) o);
installationInfo.setInstallContractAttachmentList((List<Map<String, Object>>) o1);
installationInfo.setOtherAccessoriesList((List<Map<String, Object>>) o2);
return ResponseHelper.buildResponse(iJgInstallationNoticeService.updateInstallationNotice(submitType,installationInfo, op));
return ResponseHelper.buildResponse(iJgInstallationNoticeService.updateInstallationNotice(submitType, installationInfo, op));
}
/**
......@@ -144,8 +144,8 @@ public class JgInstallationNoticeController extends BaseController {
@RequestParam(value = "size", defaultValue = "20") int size,
@ApiParam(value = "类型:enterprise-企业端、supervision-监管端", required = true)
@RequestParam(value = "type", defaultValue = "enterprise") String type,
@ApiParam(value = "排序字段",required = false)
@RequestParam(value = "sort",required = false) String sort,
@ApiParam(value = "排序字段", required = false)
@RequestParam(value = "sort", required = false) String sort,
@RequestBody(required = false) JgInstallationNoticeDto model
) {
Page<JgInstallationNotice> page = new Page<>(current, size);
......@@ -167,11 +167,10 @@ public class JgInstallationNoticeController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "PUT", value = "安装告知单个作废", notes = "安装告知单个作废")
@PutMapping(value = "/cancel/application")
public ResponseModel<JgInstallationNoticeDto> cancelApplication(@RequestBody JgInstallationNoticeDto jgInstallationNoticeDto){
JgInstallationNoticeDto result = iJgInstallationNoticeService.cancelApplication(jgInstallationNoticeDto.getSequenceNbr(), jgInstallationNoticeDto.getCancelReason());
public ResponseModel<JgInstallationNotice> cancelApplication(@RequestBody JgInstallationNoticeDto jgInstallationNoticeDto) {
JgInstallationNotice result = iJgInstallationNoticeService.cancelApplication(jgInstallationNoticeDto.getSequenceNbr(), jgInstallationNoticeDto.getCancelReason());
return ResponseHelper.buildResponse(result);
}
}
......@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.util.StringUtil;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
......@@ -1249,7 +1250,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
@Override
@Transactional(rollbackFor = Exception.class)
public JgInstallationNoticeDto cancelApplication(Long sequenceNbr, String cancelReason) {
public JgInstallationNotice cancelApplication(Long sequenceNbr, String cancelReason) {
// 1.更新为已作废
JgInstallationNotice installationNotice = this.getById(sequenceNbr);
String oldNoticeStatus = installationNotice.getNoticeStatus();
......@@ -1260,7 +1261,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
this.updateById(installationNotice);
// 2.更新关联的业务
this.processElseDataByStatus(Objects.requireNonNull(FlowStatusEnum.getEumByCode(Integer.parseInt(oldNoticeStatus))), installationNotice);
return null;
return installationNotice;
}
private void processElseDataByStatus(FlowStatusEnum oldNoticeStatus, JgInstallationNotice installationNotice) {
......@@ -1283,8 +1284,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
// 流程中(驳回、撤回等)
// 1.待办任务更新为已完成
this.finishedTask(installationNotice.getInstanceId());
// 2.终止流程
iCmWorkflowService.stopProcess(installationNotice.getInstanceId());
// 2.终止流程-工作流报错暂时注释掉
// iCmWorkflowService.stopProcess(installationNotice.getInstanceId());
// 3.写入历史表
this.saveHisDataBeforeUpdate(installationNotice);
// 4.清空redis(缓存的流程中及已完成安装告知的设备)
......@@ -1311,10 +1312,12 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
LambdaQueryWrapper<JgInstallationNoticeEq> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(JgInstallationNoticeEq::getEquipTransferId, installationNotice.getSequenceNbr());
JgInstallationNoticeEq jgRelationEquip = jgInstallationNoticeEqMapper.selectOne(queryWrapper);
IdxBizJgUseInfo idxBizJgUseInfo = useInfoService.getOne(new LambdaQueryWrapper<IdxBizJgUseInfo>().eq(IdxBizJgUseInfo::getRecord,jgRelationEquip.getEquId()));
idxBizJgUseInfo.setUseUnitCreditCode(null);
idxBizJgUseInfo.setUseUnitName(null);
useInfoService.updateById(idxBizJgUseInfo);
// 强制更新字段为 NULL
LambdaUpdateWrapper<IdxBizJgUseInfo> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(IdxBizJgUseInfo::getRecord, jgRelationEquip.getEquId()); // 设置更新条件
updateWrapper.set(IdxBizJgUseInfo::getUseUnitCreditCode,null);
updateWrapper.set(IdxBizJgUseInfo::getUseUnitName,null);
useInfoService.update(updateWrapper);
// 2.2 es的USE_UNIT_CREDIT_CODE赋空
Optional<ESEquipmentCategoryDto> optional = esEquipmentCategory.findById(jgRelationEquip.getEquId());
if(optional.isPresent()){
......
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