1.内蒙古信用监管系统除名告知、异议及决定等业务流程调整

2.新增内蒙古信用监管系统除名告知、异议及决定等业务详情查看功能
3.新增内蒙古信用监管系统除名告知、异议及决定等业务审批文书生成功能
This commit is contained in:
cc_caijp 2026-01-21 17:15:11 +08:00
parent f4353a5232
commit e7f846d0fb
29 changed files with 1479 additions and 174 deletions

View File

@ -5,9 +5,9 @@ import com.chinaweal.aiccs.aiccs.expelled.entity.EntBaseExpelledInfo;
import com.chinaweal.aiccs.aiccs.expelled.entity.ExpelledApplyInfo;
import com.chinaweal.aiccs.aiccs.expelled.entity.ExpelledBizInfo;
import com.chinaweal.aiccs.aiccs.expelled.service.IEntBaseExpelledInfoService;
import com.chinaweal.aiccs.aiccs.expelled.service.IExpelledApplyInfoService;
import com.chinaweal.aiccs.aiccs.expelled.service.IExpelledAuditInfoService;
import com.chinaweal.aiccs.aiccs.expelled.service.IExpelledBizInfoService;
import com.chinaweal.aiccs.aiccs.expelled.service.IExpelledApplyInfoService;
import com.chinaweal.aiccs.aiccs.expelled.vo.AuditInfoVo;
import com.chinaweal.aiccs.aiccs.expelled.vo.BizInfoVo;
import com.chinaweal.aiccs.aiccs.expelled.vo.RemoveApproveInfo;
@ -19,7 +19,6 @@ import com.github.xiaoymin.knife4j.annotations.ApiSort;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@ -87,136 +86,153 @@ public class EntBaseExpelledInfoController extends BaseController {
return RestResult.ok();
}
@ApiOperation(value = "5.分页查询除名告知通知书管理", position = 5)
@PostMapping("/notice/list")
public RestResult<IPage<ExpelledBizInfo>> listNotice(@RequestBody BaseQuery<ExpelledBizInfo> query) {
IPage<ExpelledBizInfo> data = expelledBizInfoService.listExpelledNoticeInfo(query);
return RestResult.ok(data);
@ApiOperation(value = "5.启动除名告知业务", position = 5)
@PostMapping("/notice/startBiz")
public RestResult<?> startNoticeBiz(@RequestBody ExpelledBizInfo query, HttpServletRequest request) {
return expelledBizInfoService.startNoticeBiz(query, request);
}
@ApiOperation(value = "6.新增、更新、删除除名告知通知书管理", position = 6)
@PostMapping("/notice/save")
public RestResult<?> saveNotice(@RequestBody ExpelledBizInfo query) {
if (CollectionUtils.isEmpty(query.getExpelledIds())) {
return RestResult.error(ResultCode.PARAM_IS_BLANK, "请至少勾选一个拟除名市场主体");
}
expelledBizInfoService.saveExpelledNoticeInfo(query);
return RestResult.ok();
@ApiOperation(value = "6.获取除名告知业务详情", position = 6)
@GetMapping("/notice/getBiz")
public RestResult<?> getNoticeBiz(String bizId) {
return expelledBizInfoService.getNoticeBiz(bizId);
}
@ApiOperation(value = "7.分页查询可引用的市场主体拟除名告知业务信息", position = 7)
@ApiOperation(value = "7.除名告知业务审批流程", position = 7)
@PostMapping("/notice/nextBiz")
public RestResult<?> nextNoticeBiz(@RequestBody RemoveApproveInfo removeApproveInfo, HttpServletRequest request) {
return expelledBizInfoService.nextNoticeBiz(removeApproveInfo, request);
}
@ApiOperation(value = "8.分页查询可引用的市场主体拟除名告知业务信息", position = 8)
@PostMapping("/notice/toDo")
public RestResult<IPage<BizInfoVo>> listTodoNoticeInfo(@RequestBody BaseQuery<BizInfoVo> query) {
IPage<BizInfoVo> data = expelledBizInfoService.listTodoNoticeInfo(query);
return RestResult.ok(data);
}
@ApiOperation(value = "8.分页查询除名异议管理", position = 8)
@PostMapping("/objection/list")
public RestResult<IPage<AuditInfoVo>> listObjection(@RequestBody BaseQuery<AuditInfoVo> query) {
IPage<AuditInfoVo> data = expelledAuditInfoService.listHavedoAuditInfo(query);
return RestResult.ok(data);
@ApiOperation(value = "9.启动除名异议业务", position = 9)
@PostMapping("/objection/startBiz")
public RestResult<?> startObjectionBiz(@RequestBody AuditInfoVo query, HttpServletRequest request) {
return expelledAuditInfoService.startObjectionBiz(query, request);
}
@ApiOperation(value = "9.新增、更新、删除除名异议管理", position = 9)
@PostMapping("/objection/save")
public RestResult<?> saveObjection(@RequestBody AuditInfoVo query) {
if (CollectionUtils.isEmpty(query.getBizInfos())) {
return RestResult.error(ResultCode.PARAM_IS_BLANK, "请至少勾选一个拟除名市场主体");
}
expelledAuditInfoService.saveObjection(query);
return RestResult.ok();
@ApiOperation(value = "10.获取除名异议业务详情", position = 10)
@GetMapping("/objection/getBiz")
public RestResult<?> getObjectionBiz(String bizId) {
return expelledAuditInfoService.getObjectionBiz(bizId);
}
@ApiOperation(value = "10.分页查询除名决定管理", position = 10)
@PostMapping("/audit/list")
public RestResult<IPage<AuditInfoVo>> listAudit(@RequestBody BaseQuery<AuditInfoVo> query) {
IPage<AuditInfoVo> data = expelledAuditInfoService.listHavedoAuditInfo(query);
return RestResult.ok(data);
@ApiOperation(value = "11.除名异议业务审批流程", position = 11)
@PostMapping("/objection/nextBiz")
public RestResult<?> nextObjectionBiz(@RequestBody RemoveApproveInfo removeApproveInfo, HttpServletRequest request) {
return expelledAuditInfoService.nextObjectionBiz(removeApproveInfo, request);
}
@ApiOperation(value = "11.新增、更新、删除除名决定管理", position = 11)
@PostMapping("/audit/save")
public RestResult<?> saveAudit(@RequestBody AuditInfoVo query, HttpServletRequest request) {
if (CollectionUtils.isEmpty(query.getBizInfos())) {
return RestResult.error(ResultCode.PARAM_IS_BLANK, "请至少勾选一个拟除名市场主体");
}
expelledAuditInfoService.saveAudit(query, request);
return RestResult.ok();
@ApiOperation(value = "12.启动除名决定业务", position = 12)
@PostMapping("/audit/startBiz")
public RestResult<?> startAuditBiz(@RequestBody AuditInfoVo query, HttpServletRequest request) {
return expelledAuditInfoService.startAuditBiz(query, request);
}
@ApiOperation(value = "12.分页查询除名公告管理", position = 12)
@ApiOperation(value = "13.获取除名决定业务详情", position = 13)
@GetMapping("/audit/getBiz")
public RestResult<?> getAuditBiz(String bizId) {
return expelledAuditInfoService.getAuditBiz(bizId);
}
@ApiOperation(value = "14.除名决定业务审批流程", position = 14)
@PostMapping("/audit/nextBiz")
public RestResult<?> nextAuditBiz(@RequestBody RemoveApproveInfo removeApproveInfo, HttpServletRequest request) {
return expelledAuditInfoService.nextAuditBiz(removeApproveInfo, request);
}
@ApiOperation(value = "15.分页查询除名公告管理", position = 15)
@PostMapping("/announcement/list")
public RestResult<IPage<AuditInfoVo>> listAnnouncement(@RequestBody BaseQuery<AuditInfoVo> query) {
IPage<AuditInfoVo> data = expelledAuditInfoService.listHavedoAuditInfo(query);
return RestResult.ok(data);
}
@ApiOperation(value = "13.启动除名修复业务", position = 13)
@ApiOperation(value = "16.启动除名修复业务", position = 16)
@PostMapping("/repair/startBiz")
public RestResult<?> startRepairBiz(@RequestBody AuditInfoVo query, HttpServletRequest request) {
return expelledApplyInfoService.startRepairBiz(query, request);
}
@ApiOperation(value = "14.获取除名修复业务详情", position = 14)
@ApiOperation(value = "17.获取除名修复业务详情", position = 17)
@GetMapping("/repair/getBiz")
public RestResult<?> getRepairBiz(String bizId) {
return expelledApplyInfoService.getRepairBiz(bizId);
}
@ApiOperation(value = "15.除名修复业务审批流程", position = 15)
@ApiOperation(value = "18.除名修复业务审批流程", position = 18)
@PostMapping("/repair/nextBiz")
public RestResult<?> nextRepairBiz(@RequestBody RemoveApproveInfo removeApproveInfo, HttpServletRequest request) {
return expelledApplyInfoService.nextRepairBiz(removeApproveInfo, request);
}
@ApiOperation(value = "16.启动除名复议业务", position = 16)
@ApiOperation(value = "19.启动除名复议业务", position = 19)
@PostMapping("/review/startBiz")
public RestResult<?> startReviewBiz(@RequestBody AuditInfoVo query, HttpServletRequest request) {
return expelledApplyInfoService.startReviewBiz(query, request);
}
@ApiOperation(value = "17.获取除名复议业务详情", position = 17)
@ApiOperation(value = "20.获取除名复议业务详情", position = 20)
@GetMapping("/review/getBiz")
public RestResult<?> getReviewBiz(String bizId) {
return expelledApplyInfoService.getReviewBiz(bizId);
}
@ApiOperation(value = "18.除名复议业务审批流程", position = 18)
@ApiOperation(value = "21.除名复议业务审批流程", position = 21)
@PostMapping("/review/nextBiz")
public RestResult<?> nextReviewBiz(@RequestBody RemoveApproveInfo removeApproveInfo, HttpServletRequest request) {
return expelledApplyInfoService.nextReviewBiz(removeApproveInfo, request);
}
@ApiOperation(value = "19.启动除名撤销业务", position = 19)
@ApiOperation(value = "22.启动除名撤销业务", position = 22)
@PostMapping("/revoke/startBiz")
public RestResult<?> startRevokeBiz(@RequestBody AuditInfoVo query, HttpServletRequest request) {
return expelledApplyInfoService.startRevokeBiz(query, request);
}
@ApiOperation(value = "20.获取除名撤销业务详情", position = 20)
@ApiOperation(value = "23.获取除名撤销业务详情", position = 23)
@GetMapping("/revoke/getBiz")
public RestResult<?> getRevokeBiz(String bizId) {
return expelledApplyInfoService.getRevokeBiz(bizId);
}
@ApiOperation(value = "21.除名撤销业务审批流程", position = 21)
@ApiOperation(value = "24.除名撤销业务审批流程", position = 24)
@PostMapping("/revoke/nextBiz")
public RestResult<?> nextRevokeBiz(@RequestBody RemoveApproveInfo removeApproveInfo, HttpServletRequest request) {
return expelledApplyInfoService.nextRevokeBiz(removeApproveInfo, request);
}
@ApiOperation(value = "22.分页查询撤销除名公告管理", position = 22)
@ApiOperation(value = "25.分页查询撤销除名公告管理", position = 25)
@PostMapping("/revoke/listAnnouncement")
public RestResult<IPage<ExpelledApplyInfo>> listRevokeAnnouncement(@RequestBody BaseQuery<ExpelledApplyInfo> query) {
IPage<ExpelledApplyInfo> data = expelledApplyInfoService.listRevokeAnnouncement(query);
return RestResult.ok(data);
}
@ApiOperation(value = "23.下载文书", position = 23)
@ApiOperation(value = "26.下载除名告知书", position = 26)
@GetMapping("/downloadNoticeDoc")
@ResponseBody
public void downloadNoticeDoc(HttpServletResponse response, String noticeNo) {
expelledBizInfoService.downloadNoticeDoc(response, noticeNo);
}
@ApiOperation(value = "27.下载除名决定书", position = 27)
@GetMapping("/downloadAuditDoc")
@ResponseBody
public void downloadAuditDoc(HttpServletResponse response, String resultId, String noticeNo) {
expelledAuditInfoService.downloadAuditDoc(response, resultId, noticeNo);
}
@ApiOperation(value = "27.下载文书", position = 27)
@GetMapping("/downloadDoc")
@ResponseBody
public void downloadDoc(HttpServletResponse response, String bizId, String attachType) {
expelledApplyInfoService.downloadDoc(response, bizId, attachType);
expelledApplyInfoService.downloadApproveDoc(response, bizId, attachType);
}
}

View File

@ -63,6 +63,13 @@ public class EntBaseExpelledInfo extends SuperEntity implements Serializable {
@TableField(value = "ADDRESS")
private String address;
/**
* 拟除名状态0-拟除名中1-已除名2-有效
*/
@ApiModelProperty(value = "拟除名状态0-拟除名中1-已除名2-有效")
@TableField(value = "STATE")
private String state;
/**
* 逻辑删除标识0-未删除1-已删除2-已除名
*/

View File

@ -182,9 +182,9 @@ public class ExpelledApplyInfo extends SuperEntity implements Serializable {
private String remark;
/**
* 状态10-有效11-修复中12-复议中13-撤销中91-修复完成92-复议通过被动撤销完成93-主动撤销完成
* 状态10-有效11-修复中12-复议中13-撤销中61-修复不通过62-复议不通过63-撤销不通过91-修复完成92-复议通过被动撤销完成93-主动撤销完成
*/
@ApiModelProperty(value = "状态10-有效11-修复中12-复议中13-撤销中,91-修复完成92-复议通过被动撤销完成93-主动撤销完成")
@ApiModelProperty(value = "状态10-有效11-修复中12-复议中13-撤销中,61-修复不通过62-复议不通过63-撤销不通过,91-修复完成92-复议通过被动撤销完成93-主动撤销完成")
@TableField(value = "STATE")
private String state;
}

View File

@ -77,4 +77,18 @@ public class ExpelledAuditInfo extends SuperEntity implements Serializable {
@ApiModelProperty(value = "逻辑删除标识0-未删除1-已删除")
@TableField(value = "IS_DELETE")
private String isDelete;
/**
* 拟除名市场主体提出的陈述申辩意见
*/
@ApiModelProperty(value = "拟除名市场主体提出的陈述、申辩意见")
@TableField(exist = false)
private String opinion;
/**
* 异议/决定意见
*/
@ApiModelProperty(value = "异议/决定意见")
@TableField(exist = false)
private String auditOpinion;
}

View File

@ -79,6 +79,20 @@ public class ExpelledBizInfo extends SuperEntity implements Serializable {
@TableField(value = "REMOVE_TIME")
private LocalDate removeTime;
/**
* 除名机关编码
*/
@ApiModelProperty(value = "除名机关编码")
@TableField(value = "REMOVE_ORG_NO")
private String removeOrgNo;
/**
* 除名机关名称
*/
@ApiModelProperty(value = "除名机关名称")
@TableField(value = "REMOVE_ORG_NAME")
private String removeOrgName;
/**
* 逻辑删除标识0-未删除1-已删除
*/
@ -92,4 +106,11 @@ public class ExpelledBizInfo extends SuperEntity implements Serializable {
@ApiModelProperty(value = "拟除名市场主体ID")
@TableField(exist = false)
private List<String> expelledIds;
/**
* 业务名称
*/
@ApiModelProperty(value = "业务名称")
@TableField(exist = false)
private String busName;
}

View File

@ -72,9 +72,9 @@ public class ExpelledEntInfo extends SuperEntity implements Serializable {
private LocalDate sendTime;
/**
* 当前状态0-可用1-已异议2-已决定
* 当前状态0-有效1-异议中2-决定中3-已异议4-已决定5-异议不通过6-决定不通过
*/
@ApiModelProperty(value = "当前状态0-可用1-已异议2-已决定")
@ApiModelProperty(value = "当前状态0-有效1-异议中2-决定中3-已异议4-已决定5-异议不通过6-决定不通过")
@TableField(value = "STATUS")
private String status;
}

View File

@ -7,6 +7,8 @@ import com.chinaweal.aiccs.aiccs.expelled.entity.ExpelledAuditInfo;
import com.chinaweal.aiccs.aiccs.expelled.vo.AuditInfoVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @Description: 市场主体拟除名名单决定业务表dao层
* @Author: TiAmo-cc
@ -16,4 +18,6 @@ import org.apache.ibatis.annotations.Param;
public interface ExpelledAuditInfoMapper extends BaseMapper<ExpelledAuditInfo> {
IPage<AuditInfoVo> listHavedoAuditInfo(Page<AuditInfoVo> page, @Param("map") AuditInfoVo query);
List<AuditInfoVo> listAuditEntBaseInfo(@Param("map") AuditInfoVo query);
}

View File

@ -7,6 +7,8 @@ import com.chinaweal.aiccs.aiccs.expelled.entity.ExpelledBizInfo;
import com.chinaweal.aiccs.aiccs.expelled.vo.BizInfoVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @Description: 市场主体拟除名名单业务表dao类
* @Author: TiAmo-cc
@ -16,4 +18,6 @@ import org.apache.ibatis.annotations.Param;
public interface ExpelledBizInfoMapper extends BaseMapper<ExpelledBizInfo> {
IPage<BizInfoVo> listTodoNoticeInfo(Page<BizInfoVo> page, @Param("map") BizInfoVo query);
List<BizInfoVo> listNoticeEntBaseInfo(@Param("map") BizInfoVo query);
}

View File

@ -41,4 +41,9 @@ public interface IEntBaseExpelledInfoService extends IService<EntBaseExpelledInf
* 批量导入市场主体拟除名名单信息
*/
void batchImportExpelledInfo(MultipartFile annex) throws IOException;
/**
* 除名申请通过修复复议撤销时同步更新拟除名名单库状态
*/
void syncEntBaseExpelledInfo(String resultId, String state);
}

View File

@ -84,10 +84,10 @@ public interface IExpelledApplyInfoService extends IService<ExpelledApplyInfo> {
/**
* 生成审批表
*/
void createDoc(ExpelledApplyInfo applyInfo, TSTaskList tsTaskList);
void createApproveDoc(ExpelledApplyInfo applyInfo, TSTaskList tsTaskList);
/**
* 下载审批表
*/
void downloadDoc(HttpServletResponse response, String bizId, String attachType);
void downloadApproveDoc(HttpServletResponse response, String bizId, String attachType);
}

View File

@ -2,11 +2,19 @@ package com.chinaweal.aiccs.aiccs.expelled.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.chinaweal.aiccs.aiccs.auditing.entity.TSOpinion;
import com.chinaweal.aiccs.aiccs.business.entity.TSTaskList;
import com.chinaweal.aiccs.aiccs.expelled.entity.ExpelledAuditInfo;
import com.chinaweal.aiccs.aiccs.expelled.entity.ExpelledEntInfo;
import com.chinaweal.aiccs.aiccs.expelled.entity.ExpelledResultInfo;
import com.chinaweal.aiccs.aiccs.expelled.vo.AuditInfoVo;
import com.chinaweal.aiccs.aiccs.expelled.vo.RemoveApproveInfo;
import com.chinaweal.aicorg.model.AICUser;
import com.chinaweal.youfool.framework.springboot.base.query.BaseQuery;
import com.chinaweal.youfool.framework.springboot.rest.RestResult;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* @Description: 市场主体拟除名名单决定业务表接口类
@ -22,14 +30,38 @@ public interface IExpelledAuditInfoService extends IService<ExpelledAuditInfo> {
IPage<AuditInfoVo> listHavedoAuditInfo(BaseQuery<AuditInfoVo> query);
/**
* 保存市场主体拟除名名单异议业务信息
* 启动除名异议业务
*/
void saveObjection(AuditInfoVo query);
RestResult<?> startObjectionBiz(AuditInfoVo query, HttpServletRequest request);
/**
* 保存市场主体拟除名名单决定业务信息
* 查询除名异议业务
*/
void saveAudit(AuditInfoVo query, HttpServletRequest request);
RestResult<?> getObjectionBiz(String bizId);
/**
* 除名异议业务审批流程
*/
RestResult<?> nextObjectionBiz(RemoveApproveInfo removeApproveInfo, HttpServletRequest request);
/**
* 启动除名决定业务
*/
RestResult<?> startAuditBiz(AuditInfoVo query, HttpServletRequest request);
/**
* 查询除名决定业务
*/
RestResult<?> getAuditBiz(String bizId);
/**
* 除名决定业务审批流程
*/
RestResult<?> nextAuditBiz(RemoveApproveInfo removeApproveInfo, HttpServletRequest request);
TSTaskList startBizAccept(AICUser user, TSTaskList tsTaskList, ExpelledAuditInfo auditInfo);
TSTaskList saveAuditProcess(AICUser user, TSTaskList tsTaskList, ExpelledAuditInfo auditInfo, TSOpinion opinion, String nextNodeId, String[] nextPerformerIds, String[] nextPerformerNames);
/**
* 根据业务号查询市场主体拟除名名单异议/决定业务信息
@ -40,4 +72,19 @@ public interface IExpelledAuditInfoService extends IService<ExpelledAuditInfo> {
* 生成业务号
*/
String generateAuditNo();
/**
* 生成审批表
*/
void createApproveDoc(ExpelledAuditInfo auditInfo, TSTaskList tsTaskList);
/**
* 生成除名决定书
*/
void createAuditDoc(ExpelledResultInfo resultInfo, ExpelledEntInfo entInfo);
/**
* 下载除名决定书
*/
void downloadAuditDoc(HttpServletResponse response, String resultId, String noticeNo);
}

View File

@ -2,9 +2,18 @@ package com.chinaweal.aiccs.aiccs.expelled.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.chinaweal.aiccs.aiccs.auditing.entity.TSOpinion;
import com.chinaweal.aiccs.aiccs.business.entity.TSTaskList;
import com.chinaweal.aiccs.aiccs.expelled.entity.ExpelledBizInfo;
import com.chinaweal.aiccs.aiccs.expelled.entity.ExpelledEntInfo;
import com.chinaweal.aiccs.aiccs.expelled.vo.BizInfoVo;
import com.chinaweal.aiccs.aiccs.expelled.vo.RemoveApproveInfo;
import com.chinaweal.aicorg.model.AICUser;
import com.chinaweal.youfool.framework.springboot.base.query.BaseQuery;
import com.chinaweal.youfool.framework.springboot.rest.RestResult;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* @Description: 市场主体拟除名名单业务表接口类
@ -15,19 +24,23 @@ import com.chinaweal.youfool.framework.springboot.base.query.BaseQuery;
public interface IExpelledBizInfoService extends IService<ExpelledBizInfo> {
/**
* 分页查询市场主体拟除名告知业务信息
* 启动除名告知业务
*/
IPage<ExpelledBizInfo> listExpelledNoticeInfo(BaseQuery<ExpelledBizInfo> query);
RestResult<?> startNoticeBiz(ExpelledBizInfo query, HttpServletRequest request);
/**
* 保存更新市场主体拟除名告知业务信息
* 查询除名告知业务
*/
void saveExpelledNoticeInfo(ExpelledBizInfo query);
RestResult<?> getNoticeBiz(String bizId);
/**
* 分页查询可引用的市场主体拟除名告知业务信息
* 除名告知业务审批流程
*/
IPage<BizInfoVo> listTodoNoticeInfo(BaseQuery<BizInfoVo> query);
RestResult<?> nextNoticeBiz(RemoveApproveInfo removeApproveInfo, HttpServletRequest request);
TSTaskList startNoticeBizAccept(AICUser user, TSTaskList tsTaskList, ExpelledBizInfo noticeInfo);
TSTaskList saveNoticeAuditProcess(AICUser user, TSTaskList tsTaskList, ExpelledBizInfo noticeInfo, TSOpinion opinion, String nextNodeId, String[] nextPerformerIds, String[] nextPerformerNames);
/**
* 根据业务号查询市场主体拟除名名单业务信息
@ -38,4 +51,24 @@ public interface IExpelledBizInfoService extends IService<ExpelledBizInfo> {
* 生成业务号
*/
String generateBizNo();
/**
* 分页查询可引用的市场主体拟除名告知业务信息
*/
IPage<BizInfoVo> listTodoNoticeInfo(BaseQuery<BizInfoVo> query);
/**
* 生成审批表
*/
void createApproveDoc(ExpelledBizInfo noticeInfo, TSTaskList tsTaskList);
/**
* 生成除名告知书
*/
void createNoticeDoc(ExpelledEntInfo entInfo);
/**
* 下载除名告知书
*/
void downloadNoticeDoc(HttpServletResponse response, String noticeNo);
}

View File

@ -3,6 +3,8 @@ package com.chinaweal.aiccs.aiccs.expelled.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.chinaweal.aiccs.aiccs.expelled.entity.ExpelledEntInfo;
import java.util.List;
/**
* @Description: 市场主体拟除名名单企业信息表接口类
* @Author: TiAmo-cc
@ -30,4 +32,9 @@ public interface IExpelledEntInfoService extends IService<ExpelledEntInfo> {
* 生成告知书编号
*/
String generateNoticeNo();
/**
* 查询告知业务的拟除名企业信息
*/
List<ExpelledEntInfo> searchEntInfoByBizId(String bizId);
}

View File

@ -3,6 +3,8 @@ package com.chinaweal.aiccs.aiccs.expelled.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.chinaweal.aiccs.aiccs.expelled.entity.ExpelledResultInfo;
import java.util.List;
/**
* @Description: 市场主体拟除名名单结果表接口类
* @Author: TiAmo-cc
@ -20,4 +22,9 @@ public interface IExpelledResultInfoService extends IService<ExpelledResultInfo>
* 查询市场主体拟除名名单结果信息
*/
ExpelledResultInfo getExpelledResultInfo(String auditId, String entId);
/**
* 查询异议/决定业务的拟除名企业结果信息
*/
List<ExpelledResultInfo> searchResultInfoByAudit(String auditId);
}

View File

@ -6,8 +6,12 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chinaweal.aiccs.aiccs.expelled.entity.EntBaseExpelledInfo;
import com.chinaweal.aiccs.aiccs.expelled.entity.ExpelledEntInfo;
import com.chinaweal.aiccs.aiccs.expelled.entity.ExpelledResultInfo;
import com.chinaweal.aiccs.aiccs.expelled.mapper.EntBaseExpelledInfoMapper;
import com.chinaweal.aiccs.aiccs.expelled.service.IEntBaseExpelledInfoService;
import com.chinaweal.aiccs.aiccs.expelled.service.IExpelledEntInfoService;
import com.chinaweal.aiccs.aiccs.expelled.service.IExpelledResultInfoService;
import com.chinaweal.aiccs.aiccs.expelled.vo.EntBaseExpelledInfoExcelVo;
import com.chinaweal.aiccs.aiccs.punishment.util.ExcelIePortUtils;
import com.chinaweal.aiccs.aiccs.punishment.util.ExcelListener;
@ -21,6 +25,7 @@ import org.springframework.core.io.ClassPathResource;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.nio.charset.StandardCharsets;
@ -41,6 +46,11 @@ public class EntBaseExpelledInfoServiceImpl extends ServiceImpl<EntBaseExpelledI
@Value("${excelTemplate.expelled.name}")
private String expelledExcelTemplateName;
@Resource
private IExpelledResultInfoService expelledResultInfoService;
@Resource
private IExpelledEntInfoService expelledEntInfoService;
@Override
public IPage<EntBaseExpelledInfo> listEntBaseExpelledInfo(BaseQuery<EntBaseExpelledInfo> query) {
EntBaseExpelledInfo entity = query.getEntity(EntBaseExpelledInfo.class);
@ -48,6 +58,7 @@ public class EntBaseExpelledInfoServiceImpl extends ServiceImpl<EntBaseExpelledI
LambdaQueryWrapper<EntBaseExpelledInfo> wrapper = Wrappers.<EntBaseExpelledInfo>lambdaQuery()
.like(StringUtils.isNotBlank(entity.getSearchEntName()), EntBaseExpelledInfo::getEntName, entity.getSearchEntName())
.eq(StringUtils.isNotBlank(entity.getSearchUscc()), EntBaseExpelledInfo::getUscc, entity.getSearchUscc())
.eq(EntBaseExpelledInfo::getState, "2")
.eq(EntBaseExpelledInfo::getIsDelete, "0");
return page(page, wrapper);
}
@ -58,6 +69,7 @@ public class EntBaseExpelledInfoServiceImpl extends ServiceImpl<EntBaseExpelledI
if (expelledInfo == null) {
expelledInfo = new EntBaseExpelledInfo();
expelledInfo.setId(UUID.randomUUID().toString());
expelledInfo.setState("2"); // 默认有效
expelledInfo.setIsDelete("0");
}
BeanUtil.copyBean(query, expelledInfo);
@ -119,4 +131,22 @@ public class EntBaseExpelledInfoServiceImpl extends ServiceImpl<EntBaseExpelledI
saveEntBaseExpelledInfo(expelledInfo);
}
}
@Override
public void syncEntBaseExpelledInfo(String resultId, String state) {
ExpelledResultInfo resultInfo = expelledResultInfoService.getById(resultId);
if (resultInfo == null) {
return;
}
ExpelledEntInfo entInfo = expelledEntInfoService.getById(resultInfo.getEntId());
if (entInfo == null) {
return;
}
EntBaseExpelledInfo expelledInfo = getById(entInfo.getExpelledId());
if (expelledInfo == null) {
return;
}
expelledInfo.setState(state);
saveOrUpdate(expelledInfo);
}
}

View File

@ -18,6 +18,7 @@ import com.chinaweal.aiccs.aiccs.expelled.entity.ExpelledApplyInfo;
import com.chinaweal.aiccs.aiccs.expelled.entity.ExpelledAuditInfo;
import com.chinaweal.aiccs.aiccs.expelled.entity.ExpelledResultInfo;
import com.chinaweal.aiccs.aiccs.expelled.mapper.ExpelledApplyInfoMapper;
import com.chinaweal.aiccs.aiccs.expelled.service.IEntBaseExpelledInfoService;
import com.chinaweal.aiccs.aiccs.expelled.service.IExpelledApplyInfoService;
import com.chinaweal.aiccs.aiccs.expelled.service.IExpelledAuditInfoService;
import com.chinaweal.aiccs.aiccs.expelled.service.IExpelledResultInfoService;
@ -77,6 +78,8 @@ public class ExpelledApplyInfoServiceImpl extends ServiceImpl<ExpelledApplyInfoM
private IExpelledAuditInfoService expelledAuditInfoService;
@Resource
private TSAttachmentService attachmentService;
@Resource
private IEntBaseExpelledInfoService entBaseExpelledInfoService;
@Override
public RestResult<?> startRepairBiz(AuditInfoVo query, HttpServletRequest request) {
@ -666,9 +669,10 @@ public class ExpelledApplyInfoServiceImpl extends ServiceImpl<ExpelledApplyInfoM
LocalDate now = LocalDate.now();
ExpelledResultInfo resultInfo = expelledResultInfoService.getById(applyInfo.getResultId());
if (FlowUtil.EXPTLISTWORKFLOW_ENDEXPTLIST.equals(nextNodeId)) { // 完结时
// 同步更新拟除名名单库状态
entBaseExpelledInfoService.syncEntBaseExpelledInfo(resultInfo.getId(), "2");
applyInfo.setApproveDate(now); // 核准时间
applyInfo.setLinkType("4"); // 1-受理中2-审核中3-审批中4-通过5-不通过
saveOrUpdate(applyInfo);
if (StringUtils.equals(BaseDataConstant.BUSINESS_TYPE_REMOVE_REPAIR, tsTaskList.getBustype())) {
applyInfo.setState("91"); // 修复完成
resultInfo.setState("91"); // 修复完成
@ -679,23 +683,35 @@ public class ExpelledApplyInfoServiceImpl extends ServiceImpl<ExpelledApplyInfoM
applyInfo.setState("93"); // 主动撤销完成
resultInfo.setState("93"); // 主动撤销完成
}
// 生成文书
createDoc(applyInfo, tsTaskList);
}
if (FlowUtil.EXPTLISTWORKFLOW_OVEREXPTLIST.equals(nextNodeId)) {
applyInfo.setApproveDate(now); // 核准时间
applyInfo.setLinkType("5"); // 1-受理中2-审核中3-审批中4-通过5-不通过
saveOrUpdate(applyInfo);
resultInfo.setState("10"); // 恢复有效
if (StringUtils.equals(BaseDataConstant.BUSINESS_TYPE_REMOVE_REPAIR, tsTaskList.getBustype())) {
applyInfo.setState("61"); // 修复不通过
} else if (StringUtils.equals(BaseDataConstant.BUSINESS_TYPE_REMOVE_REVIEW, tsTaskList.getBustype())) {
applyInfo.setState("62"); // 复议不通过
} else if (StringUtils.equals(BaseDataConstant.BUSINESS_TYPE_REMOVE_REVOKE, tsTaskList.getBustype())) {
applyInfo.setState("63"); // 撤销不通过
}
}
if (FlowUtil.EXPTLISTWORKFLOW_OVERFINISH.equals(nextNodeId)) {
applyInfo.setApproveDate(now); // 核准时间
applyInfo.setLinkType("5"); // 1-受理中2-审核中3-审批中4-通过5-不通过
saveOrUpdate(applyInfo);
resultInfo.setState("10"); // 恢复有效
if (StringUtils.equals(BaseDataConstant.BUSINESS_TYPE_REMOVE_REPAIR, tsTaskList.getBustype())) {
applyInfo.setState("61"); // 修复不通过
} else if (StringUtils.equals(BaseDataConstant.BUSINESS_TYPE_REMOVE_REVIEW, tsTaskList.getBustype())) {
applyInfo.setState("62"); // 复议不通过
} else if (StringUtils.equals(BaseDataConstant.BUSINESS_TYPE_REMOVE_REVOKE, tsTaskList.getBustype())) {
applyInfo.setState("63"); // 撤销不通过
}
}
expelledResultInfoService.saveOrUpdate(resultInfo);
saveOrUpdate(applyInfo);
// 生成文书
createApproveDoc(applyInfo, tsTaskList);
} catch (Exception e) {
log.error("除名申请(修复、复议、撤销)流程审核出错", e);
throw new BusinessException("除名申请(修复、复议、撤销)流程审核出错");
@ -715,7 +731,7 @@ public class ExpelledApplyInfoServiceImpl extends ServiceImpl<ExpelledApplyInfoM
}
@Override
public void createDoc(ExpelledApplyInfo applyInfo, TSTaskList tsTaskList) {
public void createApproveDoc(ExpelledApplyInfo applyInfo, TSTaskList tsTaskList) {
Map<String, Object> map = new HashMap<>();
map.put("orgName", applyInfo.getRemoveOrgName());
map.put("entName", applyInfo.getEntName());
@ -748,38 +764,45 @@ public class ExpelledApplyInfoServiceImpl extends ServiceImpl<ExpelledApplyInfoM
if (StringUtils.equals("92", applyInfo.getState()) || StringUtils.equals("93", applyInfo.getState())) {
wordTemplatePath = "static" + File.separator + "template" + File.separator + "expelled" + File.separator + "revokeDoc.docx";
}
String resource = ExpelledApplyInfoServiceImpl.class.getClassLoader().getResource(wordTemplatePath).getPath();
String resource = this.getClass().getClassLoader().getResource(wordTemplatePath).getPath();
// URL解码
resource = URLDecoder.decode(resource, "UTF-8");
String realPath = CommonConfig.getUploadPath();
String realPath = CommonConfig.getUploadPath(); // 存储路径
String docName = UUID.randomUUID().toString(); // 文件名
TSAttachment tsAttachment = attachmentService.getByBizseqAndType(applyInfo.getBizId(), "1");
if (tsAttachment == null) {
tsAttachment = new TSAttachment();
tsAttachment.setAttachmentid(UUID.randomUUID().toString());
tsAttachment.setUploaddate(LocalDate.now());
} else {
realPath = CommonConfig.getUploadPathByDate(tsAttachment.getUploaddate());
docName = tsAttachment.getFilename().substring(0, tsAttachment.getFilename().lastIndexOf("."));
}
realPath += File.separator + applyInfo.getBizId();
File dir = new File(realPath);
if (!dir.exists()) {
dir.mkdirs();
}
// 生成
String docName = UUID.randomUUID().toString();
XWPFTemplate.compile(resource).render(map).writeToFile(realPath + File.separator + docName + ".docx");
// 保存记录
String ext = ".docx";
String fileName = docName + ext;
String tempPath = applyInfo.getBizId() + File.separator + fileName;
TSAttachment tsAttachment = new TSAttachment();
tsAttachment.setCreatetype("1"); // 文件为系统生成
tsAttachment.setBizseq(applyInfo.getBizId());
tsAttachment.setFileext(ext);
tsAttachment.setFilename(fileName);
tsAttachment.setTemppath(tempPath);
tsAttachment.setAttachtype("1"); // 审批表
tsAttachment.setUploaddate(LocalDate.now());
attachmentService.save(tsAttachment);
attachmentService.saveOrUpdate(tsAttachment);
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void downloadDoc(HttpServletResponse response, String bizId, String attachType) {
public void downloadApproveDoc(HttpServletResponse response, String bizId, String attachType) {
TSAttachment tsAttachment = attachmentService.getByBizseqAndType(bizId, attachType);
if (tsAttachment == null) {
return;

View File

@ -4,28 +4,51 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chinaweal.aiccs.aiccs.expelled.entity.EntBaseExpelledInfo;
import com.chinaweal.aiccs.aiccs.expelled.entity.ExpelledAuditInfo;
import com.chinaweal.aiccs.aiccs.expelled.entity.ExpelledEntInfo;
import com.chinaweal.aiccs.aiccs.expelled.entity.ExpelledResultInfo;
import com.chinaweal.aiccs.aiccs.abnormal.entity.TSAttachment;
import com.chinaweal.aiccs.aiccs.abnormal.service.TSAttachmentService;
import com.chinaweal.aiccs.aiccs.auditing.entity.TSOpinion;
import com.chinaweal.aiccs.aiccs.auditing.service.TSOpinionService;
import com.chinaweal.aiccs.aiccs.business.entity.TSTaskList;
import com.chinaweal.aiccs.aiccs.business.entity.TSTwfProcessNode;
import com.chinaweal.aiccs.aiccs.business.rules.model.SequenceFlowModel;
import com.chinaweal.aiccs.aiccs.business.service.TSTaskListService;
import com.chinaweal.aiccs.aiccs.business.service.WorkFlowService;
import com.chinaweal.aiccs.aiccs.expelled.entity.*;
import com.chinaweal.aiccs.aiccs.expelled.mapper.ExpelledAuditInfoMapper;
import com.chinaweal.aiccs.aiccs.expelled.service.IEntBaseExpelledInfoService;
import com.chinaweal.aiccs.aiccs.expelled.service.IExpelledAuditInfoService;
import com.chinaweal.aiccs.aiccs.expelled.service.IExpelledEntInfoService;
import com.chinaweal.aiccs.aiccs.expelled.service.IExpelledResultInfoService;
import com.chinaweal.aiccs.aiccs.expelled.service.*;
import com.chinaweal.aiccs.aiccs.expelled.vo.AuditInfoVo;
import com.chinaweal.aiccs.aiccs.expelled.vo.BizInfoVo;
import com.chinaweal.aiccs.aiccs.expelled.vo.RemoveApproveInfo;
import com.chinaweal.aiccs.common.base.controller.BaseController;
import com.chinaweal.aiccs.common.constant.BaseDataConstant;
import com.chinaweal.aiccs.common.constant.Constant;
import com.chinaweal.aiccs.common.util.FlowUtil;
import com.chinaweal.aiccs.common.util.HandleWorkFlowUtil;
import com.chinaweal.aiccs.common.util.WorkFlowUtil;
import com.chinaweal.aiccs.config.CommonConfig;
import com.chinaweal.aiccs.utils.BeanUtil;
import com.chinaweal.aiccs.utils.DocumentNoGenerator;
import com.chinaweal.aicorg.model.AICUser;
import com.chinaweal.youfool.framework.springboot.base.query.BaseQuery;
import com.chinaweal.youfool.framework.springboot.exception.custom.BusinessException;
import com.chinaweal.youfool.framework.springboot.rest.RestResult;
import com.chinaweal.youfool.framework.springboot.rest.ResultCode;
import com.deepoove.poi.XWPFTemplate;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.time.LocalDate;
import java.util.UUID;
import java.util.*;
/**
* @Description: 市场主体拟除名名单决定业务表实现类
@ -39,9 +62,19 @@ public class ExpelledAuditInfoServiceImpl extends ServiceImpl<ExpelledAuditInfoM
@Resource
private IExpelledResultInfoService expelledResultInfoService;
@Resource
private IExpelledBizInfoService expelledBizInfoService;
@Resource
private IExpelledEntInfoService expelledEntInfoService;
@Resource
private IEntBaseExpelledInfoService entBaseExpelledInfoService;
@Resource
private TSTaskListService tsTaskListService;
@Resource
private WorkFlowService workFlowService;
@Resource
private TSOpinionService opinionService;
@Resource
private TSAttachmentService attachmentService;
@Override
public IPage<AuditInfoVo> listHavedoAuditInfo(BaseQuery<AuditInfoVo> query) {
@ -51,76 +84,444 @@ public class ExpelledAuditInfoServiceImpl extends ServiceImpl<ExpelledAuditInfoM
}
@Override
public void saveObjection(AuditInfoVo query) {
ExpelledAuditInfo objectionInfo = getById(query.getAuditId());
if (objectionInfo == null) {
objectionInfo = new ExpelledAuditInfo();
objectionInfo.setId(UUID.randomUUID().toString());
objectionInfo.setBizType("1"); // 异议管理
objectionInfo.setAuditNo(generateAuditNo());
objectionInfo.setIsDelete("0");
}
saveOrUpdate(objectionInfo);
// 初始化市场主体除名异议信息
for (BizInfoVo bizInfo : query.getBizInfos()) {
ExpelledResultInfo resultInfo = new ExpelledResultInfo();
resultInfo.setAuditId(objectionInfo.getId());
resultInfo.setEntId(bizInfo.getEntId());
resultInfo.setIsObjection("1");
resultInfo.setAuditOpinion(query.getAuditOpinion());
expelledResultInfoService.saveExpelledResultInfo(resultInfo);
// 同步更新除名告知业务申请中的市场主体企业信息的已异议状态
ExpelledEntInfo entInfo = expelledEntInfoService.getById(bizInfo.getEntId());
if (entInfo == null) {
continue;
}
entInfo.setStatus("1"); // 已异议
expelledEntInfoService.saveOrUpdate(entInfo);
}
}
@Override
public void saveAudit(AuditInfoVo query, HttpServletRequest request) {
public RestResult<?> startObjectionBiz(AuditInfoVo query, HttpServletRequest request) {
AICUser user = BaseController.getLoginUser(request);
if (user == null) {
throw new BusinessException("登录超时,请重新登录");
}
ExpelledAuditInfo objectionInfo = getById(query.getAuditId());
if (objectionInfo == null) {
objectionInfo = new ExpelledAuditInfo();
objectionInfo.setId(UUID.randomUUID().toString());
objectionInfo.setBizType("2"); // 决定管理
objectionInfo.setAuditNo(generateAuditNo());
objectionInfo.setRemoveDate(LocalDate.now());
objectionInfo.setRemoveOrgNo(user.getRegionID());
objectionInfo.setRemoveOrgName(user.getOrgName());
objectionInfo.setIsDelete("0");
if (CollectionUtils.isEmpty(query.getBizInfos())) {
return RestResult.error(ResultCode.PARAM_IS_BLANK, "请至少勾选一个拟除名市场主体");
}
saveOrUpdate(objectionInfo);
Map<String, Object> resultMap = new HashMap<>();
String bizId = UUID.randomUUID().toString();
// 添加待办启动流程
TSTaskList tsTaskList = new TSTaskList();
tsTaskList.setBizseqid(bizId);
tsTaskList.setBustype(BaseDataConstant.BUSINESS_TYPE_REMOVE_OBJECTION); // 除名异议
tsTaskList.setBusname(query.getBusName());
// 保存除名异议数据
ExpelledAuditInfo objectionInfo = new ExpelledAuditInfo();
objectionInfo.setId(bizId);
objectionInfo.setBizType("1");
objectionInfo.setAuditNo(generateAuditNo());
// 初始化市场主体除名异议信息
for (BizInfoVo bizInfo : query.getBizInfos()) {
ExpelledResultInfo resultInfo = new ExpelledResultInfo();
resultInfo.setAuditId(objectionInfo.getId());
resultInfo.setEntId(bizInfo.getEntId());
resultInfo.setIsRemove("1");
resultInfo.setState("10");
resultInfo.setAuditOpinion(query.getAuditOpinion());
expelledResultInfoService.saveExpelledResultInfo(resultInfo);
// 同步更新除名告知业务申请中的市场主体企业信息的已决定状态
// 同步更新除名告知业务申请中的市场主体企业信息的异议中状态
ExpelledEntInfo entInfo = expelledEntInfoService.getById(bizInfo.getEntId());
if (entInfo == null) {
continue;
}
entInfo.setStatus("2"); // 已决定
entInfo.setStatus("1"); // 异议中
expelledEntInfoService.saveOrUpdate(entInfo);
// 同步更新市场主体拟除名名单库中的市场主体除名状态
EntBaseExpelledInfo expelledInfo = entBaseExpelledInfoService.getById(entInfo.getExpelledId());
if (expelledInfo == null) {
}
// 保存业务待办信息
tsTaskList = startBizAccept(user, tsTaskList, objectionInfo);
List<SequenceFlowModel> nextSequenceFlows = workFlowService.findNextSequenceFlowList(tsTaskList.getWorkflowid());
TSTwfProcessNode currentNode = workFlowService.findCurrentNode(tsTaskList.getWorkflowid());
String opinionType = BaseDataConstant.getOpinionTypeByWorkFlowNode(currentNode.getCurrentnode());
if (opinionType == null) {
opinionType = "1";
}
resultMap.put("objectionInfo", objectionInfo);
resultMap.put("taskId", tsTaskList.getTasklistid());
resultMap.put("bizId", bizId);
resultMap.put("nextSequenceFlows", nextSequenceFlows);
resultMap.put("currentNode", currentNode.getCurrentnode());
resultMap.put("currentNodeName", WorkFlowUtil.getNodeName(currentNode.getCurrentnode()));
resultMap.put("currentLinkTypeID", opinionType);
return RestResult.ok(resultMap);
}
@Override
public RestResult<?> getObjectionBiz(String bizId) {
Map<String, Object> resultMap = new HashMap<>();
// 除名异议业务表
ExpelledAuditInfo objectionInfo = getById(bizId);
if (objectionInfo == null) {
throw new BusinessException("除名异议业务信息不存在,请联系管理员");
}
List<ExpelledResultInfo> resultInfos = expelledResultInfoService.searchResultInfoByAudit(bizId);
if (CollectionUtils.isNotEmpty(resultInfos)) {
objectionInfo.setOpinion(resultInfos.get(0).getOpinion());
objectionInfo.setAuditOpinion(resultInfos.get(0).getAuditOpinion());
}
resultMap.put("objectionInfo", objectionInfo);
// 拟除名异议企业信息
AuditInfoVo query = new AuditInfoVo();
query.setAuditId(bizId);
query.setBizType("1");
List<AuditInfoVo> entInfos = baseMapper.listAuditEntBaseInfo(query);
resultMap.put("entInfos", entInfos);
// 除名业务待办
TSTaskList tsTaskList = tsTaskListService.searchTaskListByBizId(bizId);
if (tsTaskList == null) {
throw new BusinessException("除名异议业务待办信息不存在,请联系管理员");
}
resultMap.put("tsTaskList", new TSTaskList().setTasklistid(tsTaskList.getTasklistid()).setWorkflowid(tsTaskList.getWorkflowid()));
// 获取历史审批意见
LambdaQueryWrapper<TSOpinion> opinionWrapper = new LambdaQueryWrapper<>();
opinionWrapper.eq(TSOpinion::getBizseq, bizId)
.ne(TSOpinion::getOpiniontype, "55")
.orderByAsc(TSOpinion::getHandledate);
List<TSOpinion> tsOpinions = opinionService.list(opinionWrapper);
resultMap.put("historyOpinions", tsOpinions);
return RestResult.ok(resultMap);
}
@Override
public RestResult<?> nextObjectionBiz(RemoveApproveInfo removeApproveInfo, HttpServletRequest request) {
AICUser user = BaseController.getLoginUser(request);
if (user == null) {
throw new BusinessException("登录超时,请重新登录");
}
String bizId = removeApproveInfo.getBizId();
String taskId = removeApproveInfo.getTaskId();
String nextNodeId = removeApproveInfo.getNextNodeId();
String nextPerformerIds = removeApproveInfo.getNextPerformerIds();
String nextPerformerNames = removeApproveInfo.getNextPerformerNames();
ExpelledAuditInfo objectionInfoQuery = removeApproveInfo.getObjectionInfo();
if (StringUtils.isBlank(bizId)) {
throw new BusinessException("bizId参数缺失");
}
if (StringUtils.isBlank(taskId)) {
throw new BusinessException("taskId参数缺失");
}
if (StringUtils.isBlank(nextNodeId)) {
throw new BusinessException("nextNodeId参数缺失");
}
if (objectionInfoQuery == null) {
throw new BusinessException("objectionInfoQuery参数缺失");
}
Map<String, Object> resultMap = new HashMap<>();
ExpelledAuditInfo objectionInfo = getById(bizId);
if (objectionInfo == null) {
throw new BusinessException("除名异议业务信息不存在,请联系管理员");
}
// 更新除名异议业务表
if (objectionInfoQuery != null && StringUtils.isNotBlank(objectionInfoQuery.getId())) {
TSTaskList tsTaskList = tsTaskListService.selectByTasklistID(taskId);
TSTwfProcessNode processNode = workFlowService.findCurrentNode(tsTaskList.getWorkflowid());
// 下一步为审核
if (StringUtils.equals(FlowUtil.EXPTLISTWORKFLOW_HANDLEEXPTLIST, nextNodeId)) {
if (StringUtils.equals(FlowUtil.EXPTLISTWORKFLOW_EXPTLISTENTER, processNode.getCurrentnode())) {
BeanUtil.copyBean(objectionInfoQuery, objectionInfo);
}
}
if (StringUtils.isBlank(nextPerformerIds)) {
processNode = workFlowService.findCurrentNode(tsTaskList.getWorkflowid());
int order = WorkFlowUtil.checkNextOrder(processNode.getCurrentnode(), nextNodeId);
// 通过order判断为回退还是前进 >0 前进
if (order > 0) {
LambdaQueryWrapper<TSOpinion> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(TSOpinion::getWorkflowid, tsTaskList.getWorkflowid())
.eq(TSOpinion::getOpiniontype, "0") // 经办为0
.orderByDesc(TSOpinion::getLauptime);
List<TSOpinion> list = opinionService.list(wrapper);
if (org.apache.commons.collections.CollectionUtils.isEmpty(list)) {
return RestResult.error(ResultCode.DATA_NONE, "除名异议审批意见不存在,请联系管理员");
}
nextPerformerIds = list.get(0).getHandlerid();
nextPerformerNames = list.get(0).getHandler();
}
// 回退时获取经办人
if (order < 0) {
// 获取经办人
LambdaQueryWrapper<TSOpinion> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(TSOpinion::getWorkflowid, tsTaskList.getWorkflowid())
.eq(TSOpinion::getOpiniontype, '0')
.orderByDesc(TSOpinion::getLauptime);
List<TSOpinion> list = opinionService.list(wrapper);
if (org.apache.commons.collections.CollectionUtils.isEmpty(list)) {
return RestResult.error(ResultCode.DATA_NONE, "除名异议审批意见不存在,请联系管理员");
}
nextPerformerIds = list.get(0).getHandlerid();
nextPerformerNames = list.get(0).getHandler();
}
}
// 发送
String[] ids = StringUtils.split(nextPerformerIds, Constant.COMMA);
String[] names = StringUtils.split(nextPerformerNames, Constant.COMMA);
try {
tsTaskList = saveAuditProcess(user, tsTaskList, objectionInfo, removeApproveInfo.getOpinionQuery(), nextNodeId, ids, names);
if (ids.length == 1 && StringUtils.equals(user.getPrimaryKey(), ids[0])) {
resultMap.put("bizId", bizId);
resultMap.put("taskId", taskId);
resultMap.put("nextNodeId", nextNodeId);
resultMap.put("workFlowId", tsTaskList.getWorkflowid());
}
} catch (Exception e) {
log.error("除名异议业务审批出错:", e);
throw new BusinessException("除名异议业务审批出错");
}
}
return RestResult.ok(resultMap);
}
@Override
public RestResult<?> startAuditBiz(AuditInfoVo query, HttpServletRequest request) {
AICUser user = BaseController.getLoginUser(request);
if (user == null) {
throw new BusinessException("登录超时,请重新登录");
}
if (CollectionUtils.isEmpty(query.getBizInfos())) {
return RestResult.error(ResultCode.PARAM_IS_BLANK, "请至少勾选一个拟除名市场主体");
}
Map<String, Object> resultMap = new HashMap<>();
String bizId = UUID.randomUUID().toString();
// 添加待办启动流程
TSTaskList tsTaskList = new TSTaskList();
tsTaskList.setBizseqid(bizId);
tsTaskList.setBustype(BaseDataConstant.BUSINESS_TYPE_REMOVE_AUDIT); // 除名决定
tsTaskList.setBusname(query.getBusName());
// 保存除名决定数据
ExpelledAuditInfo auditInfo = new ExpelledAuditInfo();
auditInfo.setId(bizId);
auditInfo.setBizType("2");
auditInfo.setAuditNo(generateAuditNo());
// 初始化市场主体除名决定信息
for (BizInfoVo bizInfo : query.getBizInfos()) {
ExpelledResultInfo resultInfo = new ExpelledResultInfo();
resultInfo.setAuditId(auditInfo.getId());
resultInfo.setEntId(bizInfo.getEntId());
expelledResultInfoService.saveExpelledResultInfo(resultInfo);
// 同步更新除名告知业务申请中的市场主体企业信息的决定中状态
ExpelledEntInfo entInfo = expelledEntInfoService.getById(bizInfo.getEntId());
if (entInfo == null) {
continue;
}
expelledInfo.setIsDelete("2"); // 已除名
entBaseExpelledInfoService.saveOrUpdate(expelledInfo);
entInfo.setStatus("2"); // 决定中
expelledEntInfoService.saveOrUpdate(entInfo);
}
// 保存业务待办信息
tsTaskList = startBizAccept(user, tsTaskList, auditInfo);
List<SequenceFlowModel> nextSequenceFlows = workFlowService.findNextSequenceFlowList(tsTaskList.getWorkflowid());
TSTwfProcessNode currentNode = workFlowService.findCurrentNode(tsTaskList.getWorkflowid());
String opinionType = BaseDataConstant.getOpinionTypeByWorkFlowNode(currentNode.getCurrentnode());
if (opinionType == null) {
opinionType = "1";
}
resultMap.put("auditInfo", auditInfo);
resultMap.put("taskId", tsTaskList.getTasklistid());
resultMap.put("bizId", bizId);
resultMap.put("nextSequenceFlows", nextSequenceFlows);
resultMap.put("currentNode", currentNode.getCurrentnode());
resultMap.put("currentNodeName", WorkFlowUtil.getNodeName(currentNode.getCurrentnode()));
resultMap.put("currentLinkTypeID", opinionType);
return RestResult.ok(resultMap);
}
@Override
public RestResult<?> getAuditBiz(String bizId) {
Map<String, Object> resultMap = new HashMap<>();
// 除名决定业务表
ExpelledAuditInfo auditInfo = getById(bizId);
if (auditInfo == null) {
throw new BusinessException("除名决定业务信息不存在,请联系管理员");
}
List<ExpelledResultInfo> resultInfos = expelledResultInfoService.searchResultInfoByAudit(bizId);
if (CollectionUtils.isNotEmpty(resultInfos)) {
auditInfo.setAuditOpinion(resultInfos.get(0).getAuditOpinion());
}
resultMap.put("auditInfo", auditInfo);
// 拟除名决定企业信息
AuditInfoVo query = new AuditInfoVo();
query.setAuditId(bizId);
query.setBizType("2");
List<AuditInfoVo> entInfos = baseMapper.listAuditEntBaseInfo(query);
resultMap.put("entInfos", entInfos);
// 除名业务待办
TSTaskList tsTaskList = tsTaskListService.searchTaskListByBizId(bizId);
if (tsTaskList == null) {
throw new BusinessException("除名决定业务待办信息不存在,请联系管理员");
}
resultMap.put("tsTaskList", new TSTaskList().setTasklistid(tsTaskList.getTasklistid()).setWorkflowid(tsTaskList.getWorkflowid()));
// 获取历史审批意见
LambdaQueryWrapper<TSOpinion> opinionWrapper = new LambdaQueryWrapper<>();
opinionWrapper.eq(TSOpinion::getBizseq, bizId)
.ne(TSOpinion::getOpiniontype, "55")
.orderByAsc(TSOpinion::getHandledate);
List<TSOpinion> tsOpinions = opinionService.list(opinionWrapper);
resultMap.put("historyOpinions", tsOpinions);
return RestResult.ok(resultMap);
}
@Override
public RestResult<?> nextAuditBiz(RemoveApproveInfo removeApproveInfo, HttpServletRequest request) {
AICUser user = BaseController.getLoginUser(request);
if (user == null) {
throw new BusinessException("登录超时,请重新登录");
}
String bizId = removeApproveInfo.getBizId();
String taskId = removeApproveInfo.getTaskId();
String nextNodeId = removeApproveInfo.getNextNodeId();
String nextPerformerIds = removeApproveInfo.getNextPerformerIds();
String nextPerformerNames = removeApproveInfo.getNextPerformerNames();
ExpelledAuditInfo auditInfoQuery = removeApproveInfo.getAuditInfo();
if (StringUtils.isBlank(bizId)) {
throw new BusinessException("bizId参数缺失");
}
if (StringUtils.isBlank(taskId)) {
throw new BusinessException("taskId参数缺失");
}
if (StringUtils.isBlank(nextNodeId)) {
throw new BusinessException("nextNodeId参数缺失");
}
if (auditInfoQuery == null) {
throw new BusinessException("auditInfoQuery参数缺失");
}
Map<String, Object> resultMap = new HashMap<>();
ExpelledAuditInfo auditInfo = getById(bizId);
if (auditInfo == null) {
throw new BusinessException("除名决定业务信息不存在,请联系管理员");
}
// 更新除名决定业务表
if (auditInfoQuery != null && StringUtils.isNotBlank(auditInfoQuery.getId())) {
TSTaskList tsTaskList = tsTaskListService.selectByTasklistID(taskId);
TSTwfProcessNode processNode = workFlowService.findCurrentNode(tsTaskList.getWorkflowid());
// 下一步为审核
if (StringUtils.equals(FlowUtil.EXPTLISTWORKFLOW_HANDLEEXPTLIST, nextNodeId)) {
if (StringUtils.equals(FlowUtil.EXPTLISTWORKFLOW_EXPTLISTENTER, processNode.getCurrentnode())) {
BeanUtil.copyBean(auditInfoQuery, auditInfo);
}
}
if (StringUtils.isBlank(nextPerformerIds)) {
processNode = workFlowService.findCurrentNode(tsTaskList.getWorkflowid());
int order = WorkFlowUtil.checkNextOrder(processNode.getCurrentnode(), nextNodeId);
// 通过order判断为回退还是前进 >0 前进
if (order > 0) {
LambdaQueryWrapper<TSOpinion> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(TSOpinion::getWorkflowid, tsTaskList.getWorkflowid())
.eq(TSOpinion::getOpiniontype, "0") // 经办为0
.orderByDesc(TSOpinion::getLauptime);
List<TSOpinion> list = opinionService.list(wrapper);
if (org.apache.commons.collections.CollectionUtils.isEmpty(list)) {
return RestResult.error(ResultCode.DATA_NONE, "除名决定审批意见不存在,请联系管理员");
}
nextPerformerIds = list.get(0).getHandlerid();
nextPerformerNames = list.get(0).getHandler();
}
// 回退时获取经办人
if (order < 0) {
// 获取经办人
LambdaQueryWrapper<TSOpinion> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(TSOpinion::getWorkflowid, tsTaskList.getWorkflowid())
.eq(TSOpinion::getOpiniontype, '0')
.orderByDesc(TSOpinion::getLauptime);
List<TSOpinion> list = opinionService.list(wrapper);
if (org.apache.commons.collections.CollectionUtils.isEmpty(list)) {
return RestResult.error(ResultCode.DATA_NONE, "除名决定审批意见不存在,请联系管理员");
}
nextPerformerIds = list.get(0).getHandlerid();
nextPerformerNames = list.get(0).getHandler();
}
}
// 发送
String[] ids = StringUtils.split(nextPerformerIds, Constant.COMMA);
String[] names = StringUtils.split(nextPerformerNames, Constant.COMMA);
try {
tsTaskList = saveAuditProcess(user, tsTaskList, auditInfo, removeApproveInfo.getOpinionQuery(), nextNodeId, ids, names);
if (ids.length == 1 && StringUtils.equals(user.getPrimaryKey(), ids[0])) {
resultMap.put("bizId", bizId);
resultMap.put("taskId", taskId);
resultMap.put("nextNodeId", nextNodeId);
resultMap.put("workFlowId", tsTaskList.getWorkflowid());
}
} catch (Exception e) {
log.error("除名决定业务审批出错:", e);
throw new BusinessException("除名决定业务审批出错");
}
}
return RestResult.ok(resultMap);
}
@Override
public TSTaskList startBizAccept(AICUser user, TSTaskList tsTaskList, ExpelledAuditInfo auditInfo) {
if (StringUtils.isBlank(tsTaskList.getTasklistid())) {
auditInfo.setIsDelete("0");
saveOrUpdate(auditInfo);
String definedname = FlowUtil.EXPTLISTWORKFLOW; // 除名异议/决定,这类参考使用企业经营异常名录流程模板,应该是可以的吧
// 新待办
tsTaskList = HandleWorkFlowUtil.createTaskList(tsTaskList, user);
// 开始工作流
tsTaskListService.startWorkFlow(tsTaskList, user, definedname);
}
return tsTaskList;
}
@Override
public TSTaskList saveAuditProcess(AICUser user, TSTaskList tsTaskList, ExpelledAuditInfo auditInfo, TSOpinion opinion, String nextNodeId, String[] nextPerformerIds, String[] nextPerformerNames) {
try {
if (StringUtils.isNotBlank(tsTaskList.getAcceptgroupid())) {
workFlowService.claimGroup(tsTaskList.getWorkflowid(), user.getPrimaryKey());
}
tsTaskListService.updateWorkFlow(user, opinion, tsTaskList, nextNodeId, nextPerformerIds, nextPerformerNames);
auditInfo.setRemoveDate(LocalDate.now());
auditInfo.setRemoveOrgNo(user.getRegionID());
auditInfo.setRemoveOrgName(user.getOrgName());
saveOrUpdate(auditInfo);
List<ExpelledResultInfo> resultInfos = expelledResultInfoService.searchResultInfoByAudit(auditInfo.getId());
if (!CollectionUtils.isEmpty(resultInfos)) {
for (ExpelledResultInfo resultInfo : resultInfos) {
resultInfo.setOpinion(auditInfo.getOpinion());
resultInfo.setAuditOpinion(auditInfo.getAuditOpinion());
// 同步更新拟除名名单企业信息表状态
ExpelledEntInfo entInfo = expelledEntInfoService.getById(resultInfo.getEntId());
if (entInfo == null) {
continue;
}
// 同步更新拟除名名单库状态
EntBaseExpelledInfo expelledInfo = entBaseExpelledInfoService.getById(entInfo.getExpelledId());
if (expelledInfo == null) {
continue;
}
if (FlowUtil.EXPTLISTWORKFLOW_ENDEXPTLIST.equals(nextNodeId)) { // 完结时
resultInfo.setState("10");
if (StringUtils.equals(BaseDataConstant.BUSINESS_TYPE_REMOVE_OBJECTION, tsTaskList.getBustype())) {
resultInfo.setIsObjection("1"); // 有异议
entInfo.setStatus("3"); // 已异议
expelledInfo.setState("2"); // 有效
} else if (StringUtils.equals(BaseDataConstant.BUSINESS_TYPE_REMOVE_AUDIT, tsTaskList.getBustype())) {
resultInfo.setIsRemove("1"); // 同意除名
entInfo.setStatus("4"); // 已决定
expelledInfo.setState("1"); // 已除名
}
}
if (FlowUtil.EXPTLISTWORKFLOW_OVEREXPTLIST.equals(nextNodeId) || FlowUtil.EXPTLISTWORKFLOW_OVERFINISH.equals(nextNodeId)) {
if (StringUtils.equals(BaseDataConstant.BUSINESS_TYPE_REMOVE_OBJECTION, tsTaskList.getBustype())) {
resultInfo.setIsObjection("0"); // 无异议
resultInfo.setState("-1"); // 除名异议不通过
entInfo.setStatus("5"); // 异议不通过
} else if (StringUtils.equals(BaseDataConstant.BUSINESS_TYPE_REMOVE_AUDIT, tsTaskList.getBustype())) {
resultInfo.setIsRemove("0"); // 不同意除名
resultInfo.setState("-2"); // 除名决定不通过
entInfo.setStatus("6"); // 决定不通过
}
expelledInfo.setState("2"); // 有效
}
expelledEntInfoService.saveOrUpdate(entInfo);
entBaseExpelledInfoService.saveOrUpdate(expelledInfo);
expelledResultInfoService.saveOrUpdate(resultInfo);
}
}
// 生成文书
if (StringUtils.equals(BaseDataConstant.BUSINESS_TYPE_REMOVE_AUDIT, tsTaskList.getBustype())) {
createApproveDoc(auditInfo, tsTaskList);
}
} catch (Exception e) {
log.error("除名申请(异议、决定)流程审核出错", e);
throw new BusinessException("除名申请(异议、决定)流程审核出错");
}
return tsTaskList;
}
@Override
@ -137,4 +538,188 @@ public class ExpelledAuditInfoServiceImpl extends ServiceImpl<ExpelledAuditInfoM
}
return generateAuditNo();
}
@Override
public void createApproveDoc(ExpelledAuditInfo auditInfo, TSTaskList tsTaskList) {
Map<String, Object> map = new HashMap<>();
map.put("orgName", auditInfo.getRemoveOrgName());
// 拟除名企业信息
AuditInfoVo query = new AuditInfoVo();
query.setAuditId(auditInfo.getId());
query.setBizType("2");
List<AuditInfoVo> entInfos = baseMapper.listAuditEntBaseInfo(query);
String entNames = "";
String auditOpinion = "";
if (!CollectionUtils.isEmpty(entInfos)) {
auditOpinion = entInfos.get(0).getAuditOpinion();
for (int i = 0; i < entInfos.size(); i++) {
if (i >= 3) {
continue;
}
entNames += entInfos.get(i).getEntName() + '、';
}
entNames = entNames.substring(0, entNames.length() - 1) + "等" + entInfos.size() + "户企业/个体户";
}
map.put("entNames", entNames);
map.put("auditOpinion", auditOpinion);
// 获取历史审批意见
LambdaQueryWrapper<TSOpinion> opinionWrapper = new LambdaQueryWrapper<>();
opinionWrapper.eq(TSOpinion::getBizseq, auditInfo.getId())
.in(TSOpinion::getOpiniontype,"0", "1", "2")
.orderByAsc(TSOpinion::getHandledate);
List<TSOpinion> tsOpinions = opinionService.list(opinionWrapper);
for (TSOpinion item : tsOpinions) {
int index = Integer.parseInt(item.getOpiniontype()) + 1;
map.put("opinion" + index, item.getOpinioncontent());
map.put("handler" + index, item.getHandler());
map.put("year" + index, item.getHandledate().getYear());
map.put("month" + index, item.getHandledate().getMonthValue());
map.put("day" + index, item.getHandledate().getDayOfMonth());
}
try {
// 文书模板路径
String wordTemplatePath = "static" + File.separator + "template" + File.separator + "expelled" + File.separator + "auditDoc.docx";
String resource = this.getClass().getClassLoader().getResource(wordTemplatePath).getPath();
// URL解码
resource = URLDecoder.decode(resource, "UTF-8");
String realPath = CommonConfig.getUploadPath(); // 存储路径
String docName = UUID.randomUUID().toString(); // 文件名
TSAttachment tsAttachment = attachmentService.getByBizseqAndType(auditInfo.getId(), "1");
if (tsAttachment == null) {
tsAttachment = new TSAttachment();
tsAttachment.setAttachmentid(UUID.randomUUID().toString());
tsAttachment.setUploaddate(LocalDate.now());
} else {
realPath = CommonConfig.getUploadPathByDate(tsAttachment.getUploaddate());
docName = tsAttachment.getFilename().substring(0, tsAttachment.getFilename().lastIndexOf("."));
}
realPath += File.separator + auditInfo.getId();
File dir = new File(realPath);
if (!dir.exists()) {
dir.mkdirs();
}
// 生成
XWPFTemplate.compile(resource).render(map).writeToFile(realPath + File.separator + docName + ".docx");
// 保存记录
String ext = ".docx";
String fileName = docName + ext;
String tempPath = auditInfo.getId() + File.separator + fileName;
tsAttachment.setCreatetype("1"); // 文件为系统生成
tsAttachment.setBizseq(auditInfo.getId());
tsAttachment.setFileext(ext);
tsAttachment.setFilename(fileName);
tsAttachment.setTemppath(tempPath);
tsAttachment.setAttachtype("1"); // 审批表
attachmentService.saveOrUpdate(tsAttachment);
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void createAuditDoc(ExpelledResultInfo resultInfo, ExpelledEntInfo entInfo) {
Map<String, Object> map = new HashMap<>();
ExpelledAuditInfo auditInfo = getById(resultInfo.getAuditId());
if (auditInfo == null) {
throw new BusinessException("除名决定业务信息不存在,请联系管理员");
}
map.put("orgName", auditInfo.getRemoveOrgName());
map.put("noticeNo", entInfo.getNoticeNo());
EntBaseExpelledInfo expelledInfo = entBaseExpelledInfoService.getById(entInfo.getExpelledId());
if (expelledInfo == null) {
throw new BusinessException("拟除名企业信息不存在,请联系管理员");
}
map.put("entName", expelledInfo.getEntName());
map.put("uscc", expelledInfo.getUscc());
map.put("lerepName", expelledInfo.getLerepName());
map.put("year", auditInfo.getRemoveDate().getYear());
map.put("month", auditInfo.getRemoveDate().getMonthValue());
map.put("day", auditInfo.getRemoveDate().getDayOfMonth());
try {
// 文书模板路径
String wordTemplatePath = "static" + File.separator + "template" + File.separator + "expelled" + File.separator + "auditEntDoc.docx";
String resource = this.getClass().getClassLoader().getResource(wordTemplatePath).getPath();
// URL解码
resource = URLDecoder.decode(resource, "UTF-8");
String realPath = CommonConfig.getUploadPath(); // 存储路径
String docName = UUID.randomUUID().toString(); // 文件名
TSAttachment tsAttachment = attachmentService.getByBizseqAndType(resultInfo.getId(), "1");
if (tsAttachment == null) {
tsAttachment = new TSAttachment();
tsAttachment.setAttachmentid(UUID.randomUUID().toString());
tsAttachment.setUploaddate(LocalDate.now());
} else {
realPath = CommonConfig.getUploadPathByDate(tsAttachment.getUploaddate());
docName = tsAttachment.getFilename().substring(0, tsAttachment.getFilename().lastIndexOf("."));
}
realPath += File.separator + resultInfo.getId();
File dir = new File(realPath);
if (!dir.exists()) {
dir.mkdirs();
}
// 生成
XWPFTemplate.compile(resource).render(map).writeToFile(realPath + File.separator + docName + ".docx");
// 保存记录
String ext = ".docx";
String fileName = docName + ext;
String tempPath = resultInfo.getId() + File.separator + fileName;
tsAttachment.setCreatetype("1"); // 文件为系统生成
tsAttachment.setBizseq(resultInfo.getId());
tsAttachment.setFileext(ext);
tsAttachment.setFilename(fileName);
tsAttachment.setTemppath(tempPath);
tsAttachment.setAttachtype("3"); // 除名决定书
attachmentService.saveOrUpdate(tsAttachment);
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void downloadAuditDoc(HttpServletResponse response, String resultId, String noticeNo) {
ExpelledResultInfo resultInfo = expelledResultInfoService.getById(resultId);
if (resultInfo == null) {
return;
}
ExpelledEntInfo entInfo = expelledEntInfoService.getExpelledEntInfo(noticeNo);
if (entInfo == null) {
return;
}
TSAttachment tsAttachment = attachmentService.getByBizseqAndType(resultInfo.getId(), "3");
if (tsAttachment == null) {
createAuditDoc(resultInfo, entInfo);
tsAttachment = attachmentService.getByBizseqAndType(resultInfo.getId(), "3");
if (tsAttachment == null) {
return;
}
}
// 获取流
InputStream is = null;
OutputStream os = null;
try {
// 获取文件
String realPath = CommonConfig.getUploadPathByDate(tsAttachment.getUploaddate()) + File.separator + tsAttachment.getTemppath();
is = new FileInputStream(realPath);
os = response.getOutputStream();
String fileName = new String(tsAttachment.getFilename().getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1);
// 设置:当浏览器收到这份资源的时候,以下载的方式提醒用户,而不是直接显示
response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
byte[] buffer = new byte[4096];
int len;
while ((len = is.read(buffer)) != -1) {
os.write(buffer, 0, len);
}
} catch (Exception e) {
e.printStackTrace();
log.error("下载文书时发生异常:{}=", e);
return;
} finally {
try {
os.close();
is.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}

View File

@ -2,9 +2,17 @@ package com.chinaweal.aiccs.aiccs.expelled.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chinaweal.aiccs.aiccs.abnormal.entity.TSAttachment;
import com.chinaweal.aiccs.aiccs.abnormal.service.TSAttachmentService;
import com.chinaweal.aiccs.aiccs.auditing.entity.TSOpinion;
import com.chinaweal.aiccs.aiccs.auditing.service.TSOpinionService;
import com.chinaweal.aiccs.aiccs.business.entity.TSTaskList;
import com.chinaweal.aiccs.aiccs.business.entity.TSTwfProcessNode;
import com.chinaweal.aiccs.aiccs.business.rules.model.SequenceFlowModel;
import com.chinaweal.aiccs.aiccs.business.service.TSTaskListService;
import com.chinaweal.aiccs.aiccs.business.service.WorkFlowService;
import com.chinaweal.aiccs.aiccs.expelled.entity.EntBaseExpelledInfo;
import com.chinaweal.aiccs.aiccs.expelled.entity.ExpelledBizInfo;
import com.chinaweal.aiccs.aiccs.expelled.entity.ExpelledEntInfo;
@ -13,13 +21,39 @@ import com.chinaweal.aiccs.aiccs.expelled.service.IEntBaseExpelledInfoService;
import com.chinaweal.aiccs.aiccs.expelled.service.IExpelledBizInfoService;
import com.chinaweal.aiccs.aiccs.expelled.service.IExpelledEntInfoService;
import com.chinaweal.aiccs.aiccs.expelled.vo.BizInfoVo;
import com.chinaweal.aiccs.aiccs.expelled.vo.RemoveApproveInfo;
import com.chinaweal.aiccs.common.base.controller.BaseController;
import com.chinaweal.aiccs.common.constant.BaseDataConstant;
import com.chinaweal.aiccs.common.constant.Constant;
import com.chinaweal.aiccs.common.util.FlowUtil;
import com.chinaweal.aiccs.common.util.HandleWorkFlowUtil;
import com.chinaweal.aiccs.common.util.WorkFlowUtil;
import com.chinaweal.aiccs.config.CommonConfig;
import com.chinaweal.aiccs.utils.BeanUtil;
import com.chinaweal.aiccs.utils.DocumentNoGenerator;
import com.chinaweal.aicorg.model.AICUser;
import com.chinaweal.youfool.framework.springboot.base.query.BaseQuery;
import com.chinaweal.youfool.framework.springboot.exception.custom.BusinessException;
import com.chinaweal.youfool.framework.springboot.rest.RestResult;
import com.chinaweal.youfool.framework.springboot.rest.ResultCode;
import com.deepoove.poi.XWPFTemplate;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.time.LocalDate;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
/**
@ -35,28 +69,35 @@ public class ExpelledBizInfoServiceImpl extends ServiceImpl<ExpelledBizInfoMappe
private IEntBaseExpelledInfoService entBaseExpelledInfoService;
@Resource
private IExpelledEntInfoService expelledEntInfoService;
@Resource
private TSTaskListService tsTaskListService;
@Resource
private WorkFlowService workFlowService;
@Resource
private TSOpinionService opinionService;
@Resource
private TSAttachmentService attachmentService;
@Override
public IPage<ExpelledBizInfo> listExpelledNoticeInfo(BaseQuery<ExpelledBizInfo> query) {
ExpelledBizInfo entity = query.getEntity(ExpelledBizInfo.class);
Page<ExpelledBizInfo> page = query.getPage();
LambdaQueryWrapper<ExpelledBizInfo> wrapper = Wrappers.<ExpelledBizInfo>lambdaQuery()
.eq(StringUtils.isNotBlank(entity.getBizNo()), ExpelledBizInfo::getBizNo, entity.getBizNo())
.eq(ExpelledBizInfo::getIsDelete, "0");
return page(page, wrapper);
}
@Override
public void saveExpelledNoticeInfo(ExpelledBizInfo query) {
ExpelledBizInfo bizInfo = getById(query.getId());
if (bizInfo == null) {
bizInfo = new ExpelledBizInfo();
bizInfo.setId(UUID.randomUUID().toString());
bizInfo.setBizNo(generateBizNo());
bizInfo.setIsDelete("0");
public RestResult<?> startNoticeBiz(ExpelledBizInfo query, HttpServletRequest request) {
AICUser user = BaseController.getLoginUser(request);
if (user == null) {
throw new BusinessException("登录超时,请重新登录");
}
BeanUtil.copyBean(query, bizInfo);
saveOrUpdate(bizInfo);
if (CollectionUtils.isEmpty(query.getExpelledIds())) {
return RestResult.error(ResultCode.PARAM_IS_BLANK, "请至少勾选一个拟除名市场主体");
}
Map<String, Object> resultMap = new HashMap<>();
String bizId = UUID.randomUUID().toString();
// 添加待办启动流程
TSTaskList tsTaskList = new TSTaskList();
tsTaskList.setBizseqid(bizId);
tsTaskList.setBustype(BaseDataConstant.BUSINESS_TYPE_REMOVE_NOTICE); // 除名告知
tsTaskList.setBusname(query.getBusName());
// 保存除名告知数据
ExpelledBizInfo noticeInfo = new ExpelledBizInfo();
noticeInfo.setId(bizId);
noticeInfo.setBizNo(generateBizNo());
// 初始化市场主体除名结果信息
for (String expelledId : query.getExpelledIds()) {
EntBaseExpelledInfo expelledInfo = entBaseExpelledInfoService.getById(expelledId);
@ -64,17 +105,203 @@ public class ExpelledBizInfoServiceImpl extends ServiceImpl<ExpelledBizInfoMappe
continue;
}
ExpelledEntInfo entInfo = new ExpelledEntInfo();
entInfo.setBizId(bizInfo.getId());
entInfo.setBizId(noticeInfo.getId());
entInfo.setExpelledId(expelledId);
expelledEntInfoService.saveExpelledEntInfo(entInfo);
// 更新拟除名名单库状态
expelledInfo.setState("0"); // 拟除名中
entBaseExpelledInfoService.saveOrUpdate(expelledInfo);
}
// 保存业务待办信息
tsTaskList = startNoticeBizAccept(user, tsTaskList, noticeInfo);
List<SequenceFlowModel> nextSequenceFlows = workFlowService.findNextSequenceFlowList(tsTaskList.getWorkflowid());
TSTwfProcessNode currentNode = workFlowService.findCurrentNode(tsTaskList.getWorkflowid());
String opinionType = BaseDataConstant.getOpinionTypeByWorkFlowNode(currentNode.getCurrentnode());
if (opinionType == null) {
opinionType = "1";
}
resultMap.put("noticeInfo", noticeInfo);
resultMap.put("taskId", tsTaskList.getTasklistid());
resultMap.put("bizId", bizId);
resultMap.put("nextSequenceFlows", nextSequenceFlows);
resultMap.put("currentNode", currentNode.getCurrentnode());
resultMap.put("currentNodeName", WorkFlowUtil.getNodeName(currentNode.getCurrentnode()));
resultMap.put("currentLinkTypeID", opinionType);
return RestResult.ok(resultMap);
}
@Override
public IPage<BizInfoVo> listTodoNoticeInfo(BaseQuery<BizInfoVo> query) {
BizInfoVo entity = query.getEntity(BizInfoVo.class);
Page<BizInfoVo> page = query.getPage();
return baseMapper.listTodoNoticeInfo(page, entity);
public RestResult<?> getNoticeBiz(String bizId) {
Map<String, Object> resultMap = new HashMap<>();
// 除名告知业务表
ExpelledBizInfo noticeInfo = getById(bizId);
if (noticeInfo == null) {
throw new BusinessException("除名告知业务信息不存在,请联系管理员");
}
resultMap.put("noticeInfo", noticeInfo);
// 拟除名企业信息
BizInfoVo query = new BizInfoVo();
query.setId(bizId);
List<BizInfoVo> entInfos = baseMapper.listNoticeEntBaseInfo(query);
resultMap.put("entInfos", entInfos);
// 除名业务待办
TSTaskList tsTaskList = tsTaskListService.searchTaskListByBizId(bizId);
if (tsTaskList == null) {
throw new BusinessException("除名告知业务待办信息不存在,请联系管理员");
}
resultMap.put("tsTaskList", new TSTaskList().setTasklistid(tsTaskList.getTasklistid()).setWorkflowid(tsTaskList.getWorkflowid()));
// 获取历史审批意见
LambdaQueryWrapper<TSOpinion> opinionWrapper = new LambdaQueryWrapper<>();
opinionWrapper.eq(TSOpinion::getBizseq, bizId)
.ne(TSOpinion::getOpiniontype, "55")
.orderByAsc(TSOpinion::getHandledate);
List<TSOpinion> tsOpinions = opinionService.list(opinionWrapper);
resultMap.put("historyOpinions", tsOpinions);
return RestResult.ok(resultMap);
}
@Override
public RestResult<?> nextNoticeBiz(RemoveApproveInfo removeApproveInfo, HttpServletRequest request) {
AICUser user = BaseController.getLoginUser(request);
if (user == null) {
throw new BusinessException("登录超时,请重新登录");
}
String bizId = removeApproveInfo.getBizId();
String taskId = removeApproveInfo.getTaskId();
String nextNodeId = removeApproveInfo.getNextNodeId();
String nextPerformerIds = removeApproveInfo.getNextPerformerIds();
String nextPerformerNames = removeApproveInfo.getNextPerformerNames();
ExpelledBizInfo noticeInfoQuery = removeApproveInfo.getNoticeInfo();
if (StringUtils.isBlank(bizId)) {
throw new BusinessException("bizId参数缺失");
}
if (StringUtils.isBlank(taskId)) {
throw new BusinessException("taskId参数缺失");
}
if (StringUtils.isBlank(nextNodeId)) {
throw new BusinessException("nextNodeId参数缺失");
}
if (noticeInfoQuery == null) {
throw new BusinessException("noticeInfoQuery参数缺失");
}
Map<String, Object> resultMap = new HashMap<>();
ExpelledBizInfo noticeInfo = getById(bizId);
if (noticeInfo == null) {
throw new BusinessException("除名告知业务信息不存在,请联系管理员");
}
// 更新除名告知业务表
if (noticeInfoQuery != null && StringUtils.isNotBlank(noticeInfoQuery.getId())) {
TSTaskList tsTaskList = tsTaskListService.selectByTasklistID(taskId);
TSTwfProcessNode processNode = workFlowService.findCurrentNode(tsTaskList.getWorkflowid());
// 下一步为审核
if (StringUtils.equals(FlowUtil.EXPTLISTWORKFLOW_HANDLEEXPTLIST, nextNodeId)) {
if (StringUtils.equals(FlowUtil.EXPTLISTWORKFLOW_EXPTLISTENTER, processNode.getCurrentnode())) {
BeanUtil.copyBean(noticeInfoQuery, noticeInfo);
}
}
if (StringUtils.isBlank(nextPerformerIds)) {
processNode = workFlowService.findCurrentNode(tsTaskList.getWorkflowid());
int order = WorkFlowUtil.checkNextOrder(processNode.getCurrentnode(), nextNodeId);
// 通过order判断为回退还是前进 >0 前进
if (order > 0) {
LambdaQueryWrapper<TSOpinion> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(TSOpinion::getWorkflowid, tsTaskList.getWorkflowid())
.eq(TSOpinion::getOpiniontype, "0") // 经办为0
.orderByDesc(TSOpinion::getLauptime);
List<TSOpinion> list = opinionService.list(wrapper);
if (CollectionUtils.isEmpty(list)) {
return RestResult.error(ResultCode.DATA_NONE, "除名告知审批意见不存在,请联系管理员");
}
nextPerformerIds = list.get(0).getHandlerid();
nextPerformerNames = list.get(0).getHandler();
}
// 回退时获取经办人
if (order < 0) {
// 获取经办人
LambdaQueryWrapper<TSOpinion> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(TSOpinion::getWorkflowid, tsTaskList.getWorkflowid())
.eq(TSOpinion::getOpiniontype, '0')
.orderByDesc(TSOpinion::getLauptime);
List<TSOpinion> list = opinionService.list(wrapper);
if (org.apache.commons.collections.CollectionUtils.isEmpty(list)) {
return RestResult.error(ResultCode.DATA_NONE, "除名告知审批意见不存在,请联系管理员");
}
nextPerformerIds = list.get(0).getHandlerid();
nextPerformerNames = list.get(0).getHandler();
}
}
// 发送
String[] ids = StringUtils.split(nextPerformerIds, Constant.COMMA);
String[] names = StringUtils.split(nextPerformerNames, Constant.COMMA);
try {
tsTaskList = saveNoticeAuditProcess(user, tsTaskList, noticeInfo, removeApproveInfo.getOpinionQuery(), nextNodeId, ids, names);
if (ids.length == 1 && StringUtils.equals(user.getPrimaryKey(), ids[0])) {
resultMap.put("bizId", bizId);
resultMap.put("taskId", taskId);
resultMap.put("nextNodeId", nextNodeId);
resultMap.put("workFlowId", tsTaskList.getWorkflowid());
}
} catch (Exception e) {
log.error("除名告知业务审批出错:", e);
throw new BusinessException("除名告知业务审批出错");
}
}
return RestResult.ok(resultMap);
}
@Override
public TSTaskList startNoticeBizAccept(AICUser user, TSTaskList tsTaskList, ExpelledBizInfo noticeInfo) {
if (StringUtils.isBlank(tsTaskList.getTasklistid())) {
noticeInfo.setIsDelete("0");
saveOrUpdate(noticeInfo);
String definedname = FlowUtil.EXPTLISTWORKFLOW; // 除名告知,这类参考使用企业经营异常名录流程模板,应该是可以的吧
// 新待办
tsTaskList = HandleWorkFlowUtil.createTaskList(tsTaskList, user);
// 开始工作流
tsTaskListService.startWorkFlow(tsTaskList, user, definedname);
}
return tsTaskList;
}
@Override
public TSTaskList saveNoticeAuditProcess(AICUser user, TSTaskList tsTaskList, ExpelledBizInfo noticeInfo, TSOpinion opinion, String nextNodeId, String[] nextPerformerIds, String[] nextPerformerNames) {
try {
if (StringUtils.isNotBlank(tsTaskList.getAcceptgroupid())) {
workFlowService.claimGroup(tsTaskList.getWorkflowid(), user.getPrimaryKey());
}
tsTaskListService.updateWorkFlow(user, opinion, tsTaskList, nextNodeId, nextPerformerIds, nextPerformerNames);
noticeInfo.setRemoveTime(LocalDate.now()); // 核准时间
noticeInfo.setRemoveOrgNo(user.getRegionID());
noticeInfo.setRemoveOrgName(user.getOrgName());
saveOrUpdate(noticeInfo);
List<ExpelledEntInfo> entInfos = expelledEntInfoService.searchEntInfoByBizId(noticeInfo.getId());
if (!CollectionUtils.isEmpty(entInfos)) {
for (ExpelledEntInfo entInfo : entInfos) {
if (FlowUtil.EXPTLISTWORKFLOW_ENDEXPTLIST.equals(nextNodeId)) { // 完结时
entInfo.setStatus("0");
}
if (FlowUtil.EXPTLISTWORKFLOW_OVEREXPTLIST.equals(nextNodeId) || FlowUtil.EXPTLISTWORKFLOW_OVERFINISH.equals(nextNodeId)) {
entInfo.setStatus("-1"); // 除名告知不通过,即是不建议
// 更新拟除名名单库状态为有效
EntBaseExpelledInfo expelledInfo = entBaseExpelledInfoService.getById(entInfo.getExpelledId());
if (expelledInfo != null) {
expelledInfo.setState("2"); // 有效
entBaseExpelledInfoService.saveOrUpdate(expelledInfo);
}
}
expelledEntInfoService.saveOrUpdate(entInfo);
}
}
// 生成文书
createApproveDoc(noticeInfo, tsTaskList);
} catch (Exception e) {
log.error("除名告知流程审核出错", e);
throw new BusinessException("除名告知流程审核出错");
}
return tsTaskList;
}
@Override
@ -91,4 +318,186 @@ public class ExpelledBizInfoServiceImpl extends ServiceImpl<ExpelledBizInfoMappe
}
return generateBizNo();
}
@Override
public IPage<BizInfoVo> listTodoNoticeInfo(BaseQuery<BizInfoVo> query) {
BizInfoVo entity = query.getEntity(BizInfoVo.class);
Page<BizInfoVo> page = query.getPage();
return baseMapper.listTodoNoticeInfo(page, entity);
}
@Override
public void createApproveDoc(ExpelledBizInfo noticeInfo, TSTaskList tsTaskList) {
Map<String, Object> map = new HashMap<>();
map.put("orgName", noticeInfo.getRemoveOrgName());
// 拟除名企业信息
BizInfoVo query = new BizInfoVo();
query.setId(noticeInfo.getId());
List<BizInfoVo> entInfos = baseMapper.listNoticeEntBaseInfo(query);
String entNames = "";
if (!CollectionUtils.isEmpty(entInfos)) {
for (int i = 0; i < entInfos.size(); i++) {
if (i >= 3) {
continue;
}
entNames += entInfos.get(i).getEntName() + '、';
}
entNames = entNames.substring(0, entNames.length() - 1) + "等" + entInfos.size() + "户企业/个体户";
}
map.put("entNames", entNames);
map.put("removeReason", new StringBuilder(noticeInfo.getTruth()).append(System.lineSeparator()).append(noticeInfo.getReason()).append(System.lineSeparator()).append(noticeInfo.getLaw()).toString());
// 获取历史审批意见
LambdaQueryWrapper<TSOpinion> opinionWrapper = new LambdaQueryWrapper<>();
opinionWrapper.eq(TSOpinion::getBizseq, noticeInfo.getId())
.in(TSOpinion::getOpiniontype,"0", "1", "2")
.orderByAsc(TSOpinion::getHandledate);
List<TSOpinion> tsOpinions = opinionService.list(opinionWrapper);
for (TSOpinion item : tsOpinions) {
int index = Integer.parseInt(item.getOpiniontype()) + 1;
map.put("opinion" + index, item.getOpinioncontent());
map.put("handler" + index, item.getHandler());
map.put("year" + index, item.getHandledate().getYear());
map.put("month" + index, item.getHandledate().getMonthValue());
map.put("day" + index, item.getHandledate().getDayOfMonth());
}
try {
// 文书模板路径
String wordTemplatePath = "static" + File.separator + "template" + File.separator + "expelled" + File.separator + "noticeDoc.docx";
String resource = this.getClass().getClassLoader().getResource(wordTemplatePath).getPath();
// URL解码
resource = URLDecoder.decode(resource, "UTF-8");
String realPath = CommonConfig.getUploadPath(); // 存储路径
String docName = UUID.randomUUID().toString(); // 文件名
TSAttachment tsAttachment = attachmentService.getByBizseqAndType(noticeInfo.getId(), "1");
if (tsAttachment == null) {
tsAttachment = new TSAttachment();
tsAttachment.setAttachmentid(UUID.randomUUID().toString());
tsAttachment.setUploaddate(LocalDate.now());
} else {
realPath = CommonConfig.getUploadPathByDate(tsAttachment.getUploaddate());
docName = tsAttachment.getFilename().substring(0, tsAttachment.getFilename().lastIndexOf("."));
}
realPath += File.separator + noticeInfo.getId();
File dir = new File(realPath);
if (!dir.exists()) {
dir.mkdirs();
}
// 生成
XWPFTemplate.compile(resource).render(map).writeToFile(realPath + File.separator + docName + ".docx");
// 保存记录
String ext = ".docx";
String fileName = docName + ext;
String tempPath = noticeInfo.getId() + File.separator + fileName;
tsAttachment.setCreatetype("1"); // 文件为系统生成
tsAttachment.setBizseq(noticeInfo.getId());
tsAttachment.setFileext(ext);
tsAttachment.setFilename(fileName);
tsAttachment.setTemppath(tempPath);
tsAttachment.setAttachtype("1"); // 审批表
attachmentService.saveOrUpdate(tsAttachment);
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void createNoticeDoc(ExpelledEntInfo entInfo) {
Map<String, Object> map = new HashMap<>();
ExpelledBizInfo noticeInfo = getById(entInfo.getBizId());
if (noticeInfo == null) {
throw new BusinessException("除名告知业务信息不存在,请联系管理员");
}
map.put("orgName", noticeInfo.getRemoveOrgName());
map.put("noticeNo", entInfo.getNoticeNo());
EntBaseExpelledInfo expelledInfo = entBaseExpelledInfoService.getById(entInfo.getExpelledId());
if (expelledInfo == null) {
throw new BusinessException("拟除名企业信息不存在,请联系管理员");
}
map.put("entName", expelledInfo.getEntName());
map.put("year", noticeInfo.getRemoveTime().getYear());
map.put("month", noticeInfo.getRemoveTime().getMonthValue());
map.put("day", noticeInfo.getRemoveTime().getDayOfMonth());
try {
// 文书模板路径
String wordTemplatePath = "static" + File.separator + "template" + File.separator + "expelled" + File.separator + "noticeEntDoc.docx";
String resource = this.getClass().getClassLoader().getResource(wordTemplatePath).getPath();
// URL解码
resource = URLDecoder.decode(resource, "UTF-8");
String realPath = CommonConfig.getUploadPath(); // 存储路径
String docName = UUID.randomUUID().toString(); // 文件名
TSAttachment tsAttachment = attachmentService.getByBizseqAndType(entInfo.getId(), "1");
if (tsAttachment == null) {
tsAttachment = new TSAttachment();
tsAttachment.setAttachmentid(UUID.randomUUID().toString());
tsAttachment.setUploaddate(LocalDate.now());
} else {
realPath = CommonConfig.getUploadPathByDate(tsAttachment.getUploaddate());
docName = tsAttachment.getFilename().substring(0, tsAttachment.getFilename().lastIndexOf("."));
}
realPath += File.separator + entInfo.getId();
File dir = new File(realPath);
if (!dir.exists()) {
dir.mkdirs();
}
// 生成
XWPFTemplate.compile(resource).render(map).writeToFile(realPath + File.separator + docName + ".docx");
// 保存记录
String ext = ".docx";
String fileName = docName + ext;
String tempPath = entInfo.getId() + File.separator + fileName;
tsAttachment.setCreatetype("1"); // 文件为系统生成
tsAttachment.setBizseq(entInfo.getId());
tsAttachment.setFileext(ext);
tsAttachment.setFilename(fileName);
tsAttachment.setTemppath(tempPath);
tsAttachment.setAttachtype("2"); // 除名告知书
attachmentService.saveOrUpdate(tsAttachment);
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void downloadNoticeDoc(HttpServletResponse response, String noticeNo) {
ExpelledEntInfo entInfo = expelledEntInfoService.getExpelledEntInfo(noticeNo);
if (entInfo == null) {
return;
}
TSAttachment tsAttachment = attachmentService.getByBizseqAndType(entInfo.getId(), "2");
if (tsAttachment == null) {
createNoticeDoc(entInfo);
tsAttachment = attachmentService.getByBizseqAndType(entInfo.getId(), "2");
if (tsAttachment == null) {
return;
}
}
// 获取流
InputStream is = null;
OutputStream os = null;
try {
// 获取文件
String realPath = CommonConfig.getUploadPathByDate(tsAttachment.getUploaddate()) + File.separator + tsAttachment.getTemppath();
is = new FileInputStream(realPath);
os = response.getOutputStream();
String fileName = new String(tsAttachment.getFilename().getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1);
// 设置:当浏览器收到这份资源的时候,以下载的方式提醒用户,而不是直接显示
response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
byte[] buffer = new byte[4096];
int len;
while ((len = is.read(buffer)) != -1) {
os.write(buffer, 0, len);
}
} catch (Exception e) {
e.printStackTrace();
log.error("下载文书时发生异常:{}=", e);
return;
} finally {
try {
os.close();
is.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}

View File

@ -9,6 +9,7 @@ import com.chinaweal.aiccs.utils.BeanUtil;
import com.chinaweal.aiccs.utils.DocumentNoGenerator;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.UUID;
/**
@ -28,7 +29,6 @@ public class ExpelledEntInfoServiceImpl extends ServiceImpl<ExpelledEntInfoMappe
entInfo.setId(UUID.randomUUID().toString());
entInfo.setNoticeNo(generateNoticeNo());
entInfo.setSendStatus("0");
entInfo.setStatus("0");
}
BeanUtil.copyBean(query, entInfo);
saveOrUpdate(entInfo);
@ -53,4 +53,9 @@ public class ExpelledEntInfoServiceImpl extends ServiceImpl<ExpelledEntInfoMappe
}
return generateNoticeNo();
}
@Override
public List<ExpelledEntInfo> searchEntInfoByBizId(String bizId) {
return list(new LambdaQueryWrapper<ExpelledEntInfo>().eq(ExpelledEntInfo::getBizId, bizId));
}
}

View File

@ -8,6 +8,7 @@ import com.chinaweal.aiccs.aiccs.expelled.service.IExpelledResultInfoService;
import com.chinaweal.aiccs.utils.BeanUtil;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.UUID;
/**
@ -34,4 +35,9 @@ public class ExpelledResultInfoServiceImpl extends ServiceImpl<ExpelledResultInf
public ExpelledResultInfo getExpelledResultInfo(String auditId, String entId) {
return getOne(new LambdaQueryWrapper<ExpelledResultInfo>().eq(ExpelledResultInfo::getAuditId, auditId).eq(ExpelledResultInfo::getEntId, entId));
}
@Override
public List<ExpelledResultInfo> searchResultInfoByAudit(String auditId) {
return list(new LambdaQueryWrapper<ExpelledResultInfo>().eq(ExpelledResultInfo::getAuditId, auditId));
}
}

View File

@ -1,5 +1,6 @@
package com.chinaweal.aiccs.aiccs.expelled.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.chinaweal.youfool.framework.springboot.json.LocalDateTimeStringSerializer;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.ApiModelProperty;
@ -159,4 +160,11 @@ public class AuditInfoVo implements Serializable {
*/
@ApiModelProperty(value = "拟除名异议告知业务信息")
private List<BizInfoVo> bizInfos;
/**
* 业务名称
*/
@ApiModelProperty(value = "业务名称")
@TableField(exist = false)
private String busName;
}

View File

@ -2,6 +2,8 @@ package com.chinaweal.aiccs.aiccs.expelled.vo;
import com.chinaweal.aiccs.aiccs.auditing.entity.TSOpinion;
import com.chinaweal.aiccs.aiccs.expelled.entity.ExpelledApplyInfo;
import com.chinaweal.aiccs.aiccs.expelled.entity.ExpelledAuditInfo;
import com.chinaweal.aiccs.aiccs.expelled.entity.ExpelledBizInfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -33,7 +35,16 @@ public class RemoveApproveInfo implements Serializable {
@ApiModelProperty(value = "下一环节操作人姓名")
private String nextPerformerNames;
@ApiModelProperty(value = "除名申请业务信息")
@ApiModelProperty(value = "除名告知业务信息")
private ExpelledBizInfo noticeInfo;
@ApiModelProperty(value = "除名异议业务信息")
private ExpelledAuditInfo objectionInfo;
@ApiModelProperty(value = "除名决定业务信息")
private ExpelledAuditInfo auditInfo;
@ApiModelProperty(value = "除名申请(修复、复议、撤销)业务信息")
private ExpelledApplyInfo applyInfoQuery;
@ApiModelProperty(value = "审批意见")

View File

@ -93,9 +93,12 @@ public class BaseDataConstant {
public static final String BUSTNESS_TYPE_REM_ABN_OBJECTION = "20"; // 移出异常名录异议
public static final String BUSINESS_TYPE_FORCE_DEREGISTER = "50";// 拟强制注销
public static final String BUSINESS_TYPE_REMOVE_REPAIR = "1001"; // 除名修复
public static final String BUSINESS_TYPE_REMOVE_REVIEW = "1002"; // 除名复议
public static final String BUSINESS_TYPE_REMOVE_REVOKE = "1003"; // 除名撤销
public static final String BUSINESS_TYPE_REMOVE_NOTICE = "1001"; // 除名告知
public static final String BUSINESS_TYPE_REMOVE_OBJECTION = "1002"; // 除名异议
public static final String BUSINESS_TYPE_REMOVE_AUDIT = "1003"; // 除名决定
public static final String BUSINESS_TYPE_REMOVE_REPAIR = "1004"; // 除名修复
public static final String BUSINESS_TYPE_REMOVE_REVIEW = "1005"; // 除名复议
public static final String BUSINESS_TYPE_REMOVE_REVOKE = "1006"; // 除名撤销
// 地址批量列异
public static final String EXPTLIST_TYPE_ADDRESSBATCH_ENTEREXCP = "71";//企业地址批量列异

View File

@ -47,4 +47,40 @@
</if>
</where>
</select>
<select id="listAuditEntBaseInfo" resultType="com.chinaweal.aiccs.aiccs.expelled.vo.AuditInfoVo">
SELECT
r.ID resultId,
e.NOTICE_NO noticeNo,
b.ENT_NAME entName,
b.USCC uscc,
b.LEREP_NAME lerepName,
b.ADDRESS address,
r.AUDIT_OPINION auditOpinion
FROM
EXPELLED_AUDIT_INFO i
LEFT JOIN EXPELLED_RESULT_INFO r ON i.ID = r.AUDIT_ID
LEFT JOIN EXPELLED_ENT_INFO e ON r.ENT_ID = e.ID
LEFT JOIN ENT_BASE_EXPELLED_INFO b ON e.EXPELLED_ID = b.ID
<where>
<if test="map.bizType != null and map.bizType != ''">
AND i.BIZ_TYPE = #{map.bizType}
</if>
<if test="map.auditId != null and map.auditId != ''">
AND i.ID = #{map.auditId}
</if>
<if test="map.auditNo != null and map.auditNo != ''">
AND i.AUDIT_NO = #{map.auditNo}
</if>
<if test="map.entName != null and map.entName != ''">
AND b.ENT_NAME LIKE '%' || #{map.entName} || '%'
</if>
<if test="map.uscc != null and map.uscc != ''">
AND b.USCC = #{map.uscc}
</if>
<if test="map.state != null and map.state != ''">
AND r.STATE = #{map.state}
</if>
</where>
</select>
</mapper>

View File

@ -36,4 +36,28 @@
</if>
</where>
</select>
<select id="listNoticeEntBaseInfo" resultType="com.chinaweal.aiccs.aiccs.expelled.vo.BizInfoVo">
SELECT
r.NOTICE_NO noticeNo,
e.ENT_NAME entName,
e.USCC uscc,
e.LEREP_NAME lerepName,
e.ADDRESS address
FROM
EXPELLED_BIZ_INFO i
LEFT JOIN EXPELLED_ENT_INFO r ON i.ID = r.BIZ_ID
LEFT JOIN ENT_BASE_EXPELLED_INFO e ON r.EXPELLED_ID = e.ID
<where>
<if test="map.id != null and map.id != ''">
AND i.ID = #{map.id}
</if>
<if test="map.entName != null and map.entName != ''">
AND e.ENT_NAME LIKE '%' || #{map.entName} || '%'
</if>
<if test="map.uscc != null and map.uscc != ''">
AND e.USCC = #{map.uscc}
</if>
</where>
</select>
</mapper>

View File

@ -0,0 +1,27 @@
{{orgName}}除名决定审批表
当事人
{{entNames}}
当事人陈述、申辩或者听证中提出的主要意见
{{auditOpinion}}
经办人意见
{{opinion1}}
签名: {{handler1}}
{{year1}}年 {{month1}}月 {{day1}}日
经办机构
负责人意见
{{opinion2}}
签名: {{handler2}}
{{year2}}年 {{month2}}月 {{day2}}日
分管负责人意见
{{opinion3}}
签名:{{handler3}}
{{year3}}年 {{month3}}月 {{day3}}日

View File

@ -0,0 +1,25 @@
{{orgName}}除名决定书
{{noticeNo}}
当事人:{{entName}}
统一社会信用代码:{{uscc}}
法定代表人(负责人):{{lerepName}}
当事人被列入经营异常名录(被标记为经营异常状态)已满两年,且近两年未申报纳税。该情况符合《通辽市市场主体除名试点工作暂行办法》关于除名情形的规定。上述事实,主要有以下证据证明:
1.经营异常名录决定书
2.近两年未纳税证明
根据以上查明事实,本局于{{year}}年{{month}}月{{day}}日通过X方式告知拟除名决定同时告知当事人有陈述、申辩和要求举行听证的权利。当事人在法定期间未提出陈述、申辩、听证意见或提出的理由未能成立。
根据《通辽市市场主体除名试点工作暂行办法》的规定,本局决定对当事人作出除名决定。除名后市场主体应当依法完成清算、办理注销登记,且不得从事与清算和注销无关的活动。
自除名决定作出之日起三年内,当事人经税务部门确认已缴纳罚款并补办纳税申报,同时已纠正被列入经营异常名录或被标记为经营异常状态违法行为的,可向我局申请除名修复。
当事人如不服本决定,可以在收到本决定书之日起六十日内向{{orgName}}申请行政复议;也可以在六个月内依法向{{orgName}}提起行政诉讼。
{{orgName}}
{{year}}年 {{month}}月 {{day}}日

View File

@ -0,0 +1,29 @@
{{orgName}}除名建议审批表
当事人
{{entNames}}
拟作出除名决定
的事由、依据
{{removeReason}}
经办机构
负责人意见
{{opinion1}}
签名: {{handler1}}
{{year1}}年 {{month1}}月 {{day1}}日
法制机构
审核意见
{{opinion2}}
签名: {{handler2}}
{{year2}}年 {{month2}}月 {{day2}}日
分管负责人意见
{{opinion3}}
签名:{{handler3}}
{{year3}}年 {{month3}}月 {{day3}}日

View File

@ -0,0 +1,19 @@
{{orgName}}除名告知书
{{noticeNo}}
{{entName}}
你单位被列入经营异常名录(被标记为经营异常状态)已满两年,且近两年未申报纳税。根据《通辽市市场主体除名试点工作暂行办法》的规定,本局拟作出除名决定。除名后市场主体应当依法完成清算、办理注销登记,且不得从事与清算和注销无关的活动。
对以上决定你单位自收到本告知书之日起5个工作日内未行使陈述、申辩权未要求举行听证的视为放弃此权利。
联系人:{{contactName}} 联系电话:{{contactPhone}}
{{orgName}}
{{year}}年 {{month}}月 {{day}}日