Commit 5ac8a75f authored by suhuiguang's avatar suhuiguang

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

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