diff --git a/devdoc/XQ-20260327-008_开发思路与改动.md b/devdoc/XQ-20260327-008_开发思路与改动.md new file mode 100644 index 0000000..8c5b479 --- /dev/null +++ b/devdoc/XQ-20260327-008_开发思路与改动.md @@ -0,0 +1,113 @@ +# XQ-20260327-008 开发思路与改动 + +## 一、开发思路 + +基于原有的行政处罚修复功能(TBizRemPunishmentController),新建一套外省行政处罚修复接口。主要区别在于: +1. 数据来源不同:本地表 → 跨省表QG_CASE_PUB_NBASEINFO +2. 主体信息查询不同:从EBaseinfo查询 → 从QG_CASE_PUB_NBASEINFO直接获取 +3. 办结后处理不同:插入CASE_CRE_INFORMATION → 修改QG_CASE_PUB_NBASEINFO + 插入CR_E_CASE + +## 二、代码改动清单 + +### 1. 新建实体类 + +#### 1.1 QG_CASE_PUB_NBASEINFO 实体 +- **路径**: `src/main/java/com/chinaweal/aiccs/aiccs/punishment/entity/QgCasePubNbaseinfo.java` +- **说明**: 跨省行政处罚基本信息实体,对应表crgs.QG_CASE_PUB_NBASEINFO +- **主要字段**: + - `caseid`: 案件ID + - `entname`: 企业名称 + - `uniscid`: 统一社会信用代码 + - `regno`: 注册号 + - `penDecNo`: 处罚决定书文号 + - `penAuthCn`: 处罚机关中文 + - `opflag`: 操作标志(修复时改为D) + - `pubDeadline`: 公示截止日期 + - `sExtDatetime`: 时间戳 + +### 2. 新建Mapper + +#### 2.1 QgCasePubNbaseinfoMapper +- **路径**: `src/main/java/com/chinaweal/aiccs/aiccs/punishment/mapper/QgCasePubNbaseinfoMapper.java` +- **接口**: `IQgCasePubNbaseinfoService` + +#### 2.2 Mapper XML +- **路径**: `src/main/resources/mybatis/mapper/aiccs/punishment/QgCasePubNbaseinfoMapper.xml` +- **说明**: 包含分页查询、按ID查询、更新修复状态方法 + +### 3. 新建Service + +#### 3.1 IQgCasePubNbaseinfoService +- **路径**: `src/main/java/com/chinaweal/aiccs/aiccs/punishment/service/IQgCasePubNbaseinfoService.java` +- **方法**: + - `searchByPage`: 分页查询跨省行政处罚信息 + - `findById`: 根据ID查询 + - `updateForRepair`: 更新修复状态(opflag='D', pubdeadline, S_EXT_DATETIME) + +#### 3.2 QgCasePubNbaseinfoServiceImpl +- **路径**: `src/main/java/com/chinaweal/aiccs/aiccs/punishment/service/impl/QgCasePubNbaseinfoServiceImpl.java` + +### 4. 新建Controller + +#### 4.1 TBizRemPunishmentNController(外省行政处罚修复) +- **路径**: `src/main/java/com/chinaweal/aiccs/aiccs/punishment/controller/TBizRemPunishmentNController.java` +- **说明**: 外省行政处罚修复控制器,复用原有界面和流程 +- **主要接口**(与原TBizRemPunishmentController对应): + - `punishmentList`: 查询外省行政处罚记录(走QG表) + - `startTask`: 启动待办(主体信息从QG表获取) + - `submitTask`: 提交待办(办结时修改QG表+插入CR_E_CASE) + +### 5. 复用现有类 + +#### 5.1 复用实体 +- `TBizRemPunishment`: 业务表(新增一个业务类型标识区分) +- `CrECase`: 跨省修复案例表(办结时插入) + +#### 5.2 复用Service +- `ICrECaseService`: 插入CR_E_CASE表 +- `TSTaskListService`: 工作流任务 +- `TSAttachmentService`: 附件 +- `TswrittemplateService`: 文书模板 +- `TbIlcPunInfoQueryService`: 保持接口不变(实际不走这个) + +## 三、接口设计 + +### 3.1 行政处罚记录查询(外省) +``` +POST /punishment/tBizRemPunishmentN/punishmentList +``` +- 复用原有查询页面 +- 数据来源改为 `crgs.QG_CASE_PUB_NBASEINFO` + +### 3.2 启动待办(外省) +``` +POST /punishment/tBizRemPunishmentN/startTask +``` +- 业务表ID: `TBizRemPunishment.id`(业务表共用) +- 主体信息从 `QG_CASE_PUB_NBASEINFO` 获取 +- 工作流使用原流程 + +### 3.3 提交待办(外省) +``` +POST /punishment/tBizRemPunishmentN/submitTask +``` +- 办结时处理: + 1. 更新 `crgs.QG_CASE_PUB_NBASEINFO`: opflag='D', pubdeadline=审批日期, S_EXT_DATETIME=审批日期 + 2. 插入 `AICCS.CR_E_CASE` + 3. **不再**插入 `crgs.CASE_CRE_INFORMATION` + +## 四、数据流差异 + +| 环节 | 原有流程 | 外省流程 | +|------|---------|---------| +| 主体信息获取 | EBaseinfo表 | QG_CASE_PUB_NBASEINFO表 | +| 行政处罚信息 | CASE_PUB_NBASEINFO表 | QG_CASE_PUB_NBASEINFO表 | +| 办结-主体表 | 无操作 | opflag='D' | +| 办结-公示表 | 插入CASE_CRE_INFORMATION | 修改QG表 + 插入CR_E_CASE | + +## 五、注意事项 + +1. 工作流复用原有流程,不需要新建工作流 +2. 业务表TBizRemPunishment共用,通过字段区分或新建业务类型 +3. 附件、文书模板共用 +4. 外省数据没有本地EBaseinfo,所以主体信息直接从QG表获取 diff --git a/devdoc/XQ-20260327-008_需求清单.md b/devdoc/XQ-20260327-008_需求清单.md new file mode 100644 index 0000000..e807975 --- /dev/null +++ b/devdoc/XQ-20260327-008_需求清单.md @@ -0,0 +1,41 @@ +# XQ-20260327-008 需求清单 + +## 任务概述 +- **待办编号**: XQ-20260327-008 +- **任务标题**: 内蒙信用监管-新增外单位行政处罚修复功能 +- **需求方**: 周熙尧 +- **执行人**: 黎润豪 +- **截止日期**: 2026-04-02 + +## 功能需求 + +### 1. 新增跨省主体行政处罚修复功能 +在原有的信用修复菜单下的行政处罚修复功能基础上,新增可查询外省的行政处罚信息数据。 + +### 2. 数据表变更 +- **主表**: `crgs.QG_CASE_PUB_NBASEINFO` (跨省行政处罚基本信息表) +- **说明**: 跨省的主体数据无法在本地查询到,因此原流程中涉及查询主体信息的地方均需改为查询该表 + +### 3. 业务流程 +- 业务流程复用原有的行政处罚修复流程 +- 查询主体信息改用 `crgs.QG_CASE_PUB_NBASEINFO` 表 + +### 4. 流程办结后数据处理 +流程办结后**不再**插入数据到 `crgs.CASE_CRE_INFORMATION`,而是: + +#### 4.1 修改 `crgs.QG_CASE_PUB_NBASEINFO` +- `opflag` 改成 `D` +- `pubdeadline` 改为审批日期当天 +- `S_EXT_DATETIME` 改为审批日期当天 + +#### 4.2 插入数据到 `AICCS.CR_E_CASE` 表 +- 跨省主体修复信息同步表 + +## 参考类 +- `com.chinaweal.aiccs.aiccs.punishment.controller.TBizRemPunishmentController` +- 原有行政处罚修复业务逻辑 + +## 技术要点 +1. 复用原有行政处罚修复的流程和界面 +2. 数据来源改为跨省表 `QG_CASE_PUB_NBASEINFO` +3. 办结后数据处理逻辑调整 diff --git a/src/main/java/com/chinaweal/aiccs/aiccs/punishment/controller/TBizRemPunishmentNController.java b/src/main/java/com/chinaweal/aiccs/aiccs/punishment/controller/TBizRemPunishmentNController.java new file mode 100644 index 0000000..0cde40b --- /dev/null +++ b/src/main/java/com/chinaweal/aiccs/aiccs/punishment/controller/TBizRemPunishmentNController.java @@ -0,0 +1,286 @@ +package com.chinaweal.aiccs.aiccs.punishment.controller; + +import cn.hutool.core.util.IdUtil; +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.chinaweal.aiccs.aiccs.abnormal.entity.TSAttachment; +import com.chinaweal.aiccs.aiccs.abnormal.service.TSAttachmentService; +import com.chinaweal.aiccs.aiccs.business.entity.TSTaskList; +import com.chinaweal.aiccs.aiccs.business.service.TSTaskListService; +import com.chinaweal.aiccs.aiccs.punishment.entity.QgCasePubNbaseinfo; +import com.chinaweal.aiccs.aiccs.punishment.entity.TBizRemPunishment; +import com.chinaweal.aiccs.aiccs.punishment.service.ICrECaseService; +import com.chinaweal.aiccs.aiccs.punishment.service.IQgCasePubNbaseinfoService; +import com.chinaweal.aiccs.aiccs.punishment.service.ITBizRemPunishmentService; +import com.chinaweal.aiccs.aiccs.punishment.service.TswrittemplateService; +import com.chinaweal.aiccs.aiccs.writs.entity.Tswrittemplate; +import com.chinaweal.aiccs.common.base.controller.BaseController; +import com.chinaweal.aiccs.common.constant.BaseDataConstant; +import com.chinaweal.aiccs.common.util.*; +import com.chinaweal.aiccs.config.CommonConfig; +import com.chinaweal.aiccs.common.util.filestorage.FileStorageService; +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.mybatis.plus.page.PageRequestDto; +import com.chinaweal.youfool.framework.springboot.rest.RestResult; +import com.chinaweal.youfool.framework.springboot.rest.ResultCode; +import com.chinaweal.youfool.framework.springboot.util.AssertUtils; +import com.chinaweal.youfool.framework.sso.util.SSOUtil; +import com.github.xiaoymin.knife4j.annotations.ApiSort; +import io.swagger.annotations.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.IOException; +import java.io.Serializable; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.time.LocalDate; +import java.util.*; + +/** + *

+ * 外省行政处罚修复控制器 + *

+ * + * @author developer + * @since 2026-03-30 + */ +@Api(tags = "外省行政处罚修复控制器") +@ApiSort(1) +@RestController +@RequestMapping("/punishment/tBizRemPunishmentN") +@Slf4j +public class TBizRemPunishmentNController extends BaseController { + + @Resource + private ITBizRemPunishmentService iTBizRemPunishmentService; + @Resource + private IQgCasePubNbaseinfoService qgCasePubNbaseinfoService; + @Resource + private ICrECaseService crECaseService; + @Resource + private TSTaskListService taskListService; + @Resource + private TSAttachmentService attachmentService; + @Resource + private TswrittemplateService tswrittemplateService; + @Resource + private FileStorageService fileStorageService; + + @ApiOperation(value = "1.新增外省行政处罚修复业务", position = 1) + @PostMapping("/save") + public RestResult saveTBizRemPunishment(@RequestBody @Valid TBizRemPunishment tBizRemPunishment, BindingResult bindingResult) { + AssertUtils.isBndingValidit(bindingResult); + tBizRemPunishment = iTBizRemPunishmentService.saveTBizRemPunishment(tBizRemPunishment); + return RestResult.ok(tBizRemPunishment); + } + + @ApiOperation(value = "2.删除外省行政处罚修复业务", position = 2) + @PostMapping("/delete") + public RestResult removeTBizRemPunishment(@RequestParam @ApiParam("id") Serializable id) { + iTBizRemPunishmentService.removeById(id); + return RestResult.ok(); + } + + @ApiOperation(value = "3.修改外省行政处罚修复业务", position = 3) + @PostMapping("/update") + public RestResult updateTBizRemPunishment(@RequestBody @Valid TBizRemPunishment tBizRemPunishment, BindingResult bindingResult) { + AssertUtils.isBndingValidit(bindingResult); + iTBizRemPunishmentService.updateTBizRemPunishment(tBizRemPunishment); + return RestResult.ok(); + } + + @ApiOperation(value = "4.查询外省行政处罚修复业务", position = 4) + @GetMapping("/get") + public RestResult getTBizRemPunishment(@RequestParam @ApiParam("id") Serializable id) { + TBizRemPunishment tBizRemPunishment = iTBizRemPunishmentService.getById(id); + QgCasePubNbaseinfo qgCasePubNbaseinfo = qgCasePubNbaseinfoService.findById(tBizRemPunishment.getPunishmentId()); + TSTaskList task = taskListService.getOne(new LambdaQueryWrapper() + .eq(TSTaskList::getBizseqid, tBizRemPunishment.getBizSeq())); + return RestResult.ok(new HashMap() {{ + put("punishInfo", tBizRemPunishment); + put("qgPunInfo", qgCasePubNbaseinfo); + put("task", task); + }}); + } + + @ApiOperation(value = "5.分页查询外省行政处罚修复业务", position = 5) + @PostMapping("/list") + public RestResult> listTBizRemPunishment(@RequestBody BaseQuery query) { + IPage data = iTBizRemPunishmentService.listTBizRemPunishment(query); + return RestResult.ok(data); + } + + @ApiOperation(value = "6.查询外省行政处罚记录", position = 6) + @PostMapping("/punishmentList") + public RestResult> punishmentList(@RequestBody PageRequestDto pageRequestDto) { + // 获取当前用户所在辖区 + AICUser curUser = SSOUtil.getUser(); + + // 设置查询参数,排除已修复的数据 + pageRequestDto.getParamMap().put("excludeRepaired", true); + + // 外省数据查询 + IPage iPage = qgCasePubNbaseinfoService.searchByPage( + new Page<>(pageRequestDto.getCurPage(), pageRequestDto.getPageSize()), + pageRequestDto.getParamMap()); + return RestResult.ok(iPage); + } + + @ApiOperation(value = "7.启动外省行政处罚修复待办", position = 7) + @PostMapping("/startTask") + public RestResult startTask(@RequestBody TBizRemPunishment tBizRemPunishment) { + // 检查是否已有修复业务 + Integer count = iTBizRemPunishmentService.lambdaQuery() + .eq(TBizRemPunishment::getPunishmentId, tBizRemPunishment.getPunishmentId()).count(); + if (count > 0) { + throw new BusinessException("该行政处罚记录已有修复业务"); + } + + AICUser loginUser = SSOUtil.getUser(); + Map resultMap = new HashMap<>(); + + // 从跨省表获取处罚信息 + QgCasePubNbaseinfo qgCasePubNbaseinfo = qgCasePubNbaseinfoService.findById(tBizRemPunishment.getPunishmentId()); + if (qgCasePubNbaseinfo == null) { + throw new BusinessException("未找到对应的行政处罚记录"); + } + + // 生成业务号 + String bizSeq = IdUtil.simpleUUID(); + tBizRemPunishment.setId(bizSeq); + tBizRemPunishment.setUserId(loginUser.getPrimaryKey()); + tBizRemPunishment.setStatus("0"); + tBizRemPunishment.setLinkType("1"); + tBizRemPunishment.setBizSeq(bizSeq); + // 跨省主体的pripid从QG表获取 + tBizRemPunishment.setPripid(qgCasePubNbaseinfo.getPripid()); + this.iTBizRemPunishmentService.save(tBizRemPunishment); + + // 启动工作流 + TSTaskList tsTaskList = new TSTaskList(); + tsTaskList.setBizseqid(bizSeq); + tsTaskList.setBustype(BaseDataConstant.BUSINESS_TYPE_REM_PUNISH); + tsTaskList.setBusname(qgCasePubNbaseinfo.getEntname()); + // 新待办设置待办信息 + tsTaskList = HandleWorkFlowUtil.createTaskList(tsTaskList, loginUser); + // 开始工作流 + taskListService.startWorkFlow(tsTaskList, loginUser, FlowUtil.REM_PUNISH_WORKFLOW); + + // 返回结果 + resultMap.put("taskId", tsTaskList.getTasklistid()); + resultMap.put("bizSeq", bizSeq); + resultMap.put("workflowId", tsTaskList.getWorkflowid()); + return RestResult.ok(resultMap); + } + + @ApiOperation(value = "8.提交外省行政处罚修复待办", position = 8) + @PostMapping("/submitTask") + public RestResult submitTask(@RequestBody TBizRemPunishment tBizRemPunishment) { + List listTask = taskListService.selectByBizSeqID(tBizRemPunishment.getBizSeq()); + AssertUtils.isTrue(!listTask.isEmpty(), ResultCode.DATA_NONE); + + // 意见不能为空 + if (StringUtils.isEmpty(tBizRemPunishment.getOpinion())) { + return RestResult.error(ResultCode.PARAM_IS_BLANK); + } + + // 业务不是处于审批状态时,需要有下一步操作人 + if (!StringUtils.equals(tBizRemPunishment.getLinkType(), "2") + && StringUtils.isEmpty(tBizRemPunishment.getNextPerformerids())) { + // 除非是不予受理或者是回退操作 + if (!StringUtils.equals(tBizRemPunishment.getIsAccept(), "0") + && !"returnRemPunish".equals(tBizRemPunishment.getNextNodeId())) { + return RestResult.error(ResultCode.PARAM_IS_BLANK); + } + } + + // 判断文书模板是否有数据,除非是不予受理 + Tswrittemplate tswrittemplate = null; + if (!StringUtils.equals(tBizRemPunishment.getIsAccept(), "0")) { + List tswrittemplateList = tswrittemplateService.list(new LambdaQueryWrapper() + .eq(Tswrittemplate::getIsTemplate, "0") + .eq(Tswrittemplate::getBizseq, tBizRemPunishment.getBizSeq())); + if (tswrittemplateList.isEmpty()) { + return RestResult.error(ResultCode.DATA_NONE); + } + tswrittemplate = tswrittemplateList.get(0); + } + + // 调用提交处理 + iTBizRemPunishmentService.submitTaskN(tBizRemPunishment, listTask.get(0), tswrittemplate, qgCasePubNbaseinfoService, crECaseService); + return RestResult.ok(); + } + + @ApiOperation(value = "9.上传附件", position = 9) + @PostMapping("/upload") + public RestResult upload(MultipartFile[] files, String attachType, String id) throws IOException { + AICUser curUser = SSOUtil.getUser(); + // 获得上传目录 + String realPath = CommonConfig.getRemPunishmentPath() + File.separator + id; + + for (MultipartFile multipartFile : files) { + String fileName = multipartFile.getOriginalFilename(); + String ext = StringUtils.isNotBlank(fileName) && fileName.lastIndexOf(Constant.DOT) > -1 ? fileName.substring(fileName.lastIndexOf(Constant.DOT)) : StringUtils.EMPTY; + String virtualFileName = IdUtil.simpleUUID() + ext; + fileStorageService.writeFromStream(realPath, virtualFileName, multipartFile.getInputStream()); + + TSAttachment tsAttachment = new TSAttachment(); + tsAttachment.setBizseq(id); + tsAttachment.setPripid(StringUtils.EMPTY); + tsAttachment.setFileext(ext); + tsAttachment.setFilename(fileName); + tsAttachment.setFileurl(realPath + File.separator + virtualFileName); + tsAttachment.setUploaddate(LocalDate.now()); + tsAttachment.setUserid(curUser.getPrimaryKey()); + tsAttachment.setUsername(curUser.getName()); + tsAttachment.setAttachtype(attachType); // 1-信用修复决定审批表 2-准予信用修复决定文书 3-补充材料 + attachmentService.save(tsAttachment); + } + + return RestResult.ok(); + } + + @ApiOperation(value = "10.附件回显", position = 10) + @GetMapping(value = "/listFile") + public RestResult> listFile(@RequestParam String id) { + AssertUtils.isNotBlank(id); + return RestResult.ok(attachmentService.lambdaQuery().eq(TSAttachment::getBizseq, id).list()); + } + + @ApiOperation(value = "11.材料文件下载", position = 11) + @GetMapping("/downloadFile") + public void uploadFile(@RequestParam String fileId, HttpServletResponse response) throws IOException { + TSAttachment tsAttachment = attachmentService.getById(fileId); + if (tsAttachment == null) { + throw new BusinessException("文件无法找到" + fileId); + } + response.setHeader("Content-Disposition", "attachment; filename=\"" + new String(tsAttachment.getFilename().getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1) + "\""); + fileStorageService.writeToStream(tsAttachment.getFileurl(), response.getOutputStream()); + } + + @ApiOperation(value = "12.附件删除", position = 12) + @GetMapping("/delFile") + public RestResult delFile(@RequestParam String id) { + TSAttachment tsAttachmentModel = attachmentService.getById(id); + if (tsAttachmentModel == null) return RestResult.error(ResultCode.DATA_NONE); + String realPath = CommonConfig.getUploadPath() + File.separator + tsAttachmentModel.getTemppath(); + try { + Files.delete(Paths.get(realPath)); + } catch (IOException e) { + log.error("删除文件异常", e); + } + attachmentService.removeById(id); + return RestResult.ok(); + } + +} diff --git a/src/main/java/com/chinaweal/aiccs/aiccs/punishment/entity/QgCasePubNbaseinfo.java b/src/main/java/com/chinaweal/aiccs/aiccs/punishment/entity/QgCasePubNbaseinfo.java new file mode 100644 index 0000000..3e0a3f6 --- /dev/null +++ b/src/main/java/com/chinaweal/aiccs/aiccs/punishment/entity/QgCasePubNbaseinfo.java @@ -0,0 +1,328 @@ +package com.chinaweal.aiccs.aiccs.punishment.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.extension.activerecord.Model; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.Date; + +/** + *

+ * 跨省行政处罚基本信息表 对应表 crgs.QG_CASE_PUB_NBASEINFO + *

+ * + * @author developer + * @since 2026-03-30 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("QG_CASE_PUB_NBASEINFO") +@ApiModel(value = "QgCasePubNbaseinfo对象", description = "跨省行政处罚基本信息") +public class QgCasePubNbaseinfo extends Model { + + private static final long serialVersionUID = 1L; + + /** + * 案件ID + */ + @ApiModelProperty(value = "案件ID") + @TableId(value = "CASEID", type = IdType.INPUT) + private String caseid; + + /** + * 案件类型 + */ + @ApiModelProperty(value = "案件类型") + @TableField("ACTYPE") + private String actype; + + /** + * 主体身份标识 + */ + @ApiModelProperty(value = "主体身份标识") + @TableField("PRIPID") + private String pripid; + + /** + * 企业名称 + */ + @ApiModelProperty(value = "企业名称") + @TableField("ENTNAME") + private String entname; + + /** + * 统一社会信用代码 + */ + @ApiModelProperty(value = "统一社会信用代码") + @TableField("UNISCID") + private String uniscid; + + /** + * 注册号 + */ + @ApiModelProperty(value = "注册号") + @TableField("REGNO") + private String regno; + + /** + * 机构证书代码 + */ + @ApiModelProperty(value = "机构证书代码") + @TableField("INSCERCODE") + private String inscercode; + + /** + * 社会组织代码 + */ + @ApiModelProperty(value = "社会组织代码") + @TableField("SOCORGCODE") + private String socorgcode; + + /** + * 组织机构代码 + */ + @ApiModelProperty(value = "组织机构代码") + @TableField("ORGCODE") + private String orgcode; + + /** + * 税务登记号 + */ + @ApiModelProperty(value = "税务登记号") + @TableField("TAXID") + private String taxid; + + /** + * 法定代表人 + */ + @ApiModelProperty(value = "法定代表人") + @TableField("LEREP") + private String lerep; + + /** + * 证件类型 + */ + @ApiModelProperty(value = "证件类型") + @TableField("CERTYPE") + private String certype; + + /** + * 证件号码 + */ + @ApiModelProperty(value = "证件号码") + @TableField("CERNO") + private String cerNo; + + /** + * 姓名 + */ + @ApiModelProperty(value = "姓名") + @TableField("NAME") + private String name; + + /** + * 违法当事人证件类型 + */ + @ApiModelProperty(value = "违法当事人证件类型") + @TableField("AC_CERTYPE") + private String acCertype; + + /** + * 违法当事人证件号码 + */ + @ApiModelProperty(value = "违法当事人证件号码") + @TableField("AC_CERNO") + private String acCerNo; + + /** + * 处罚决定书文号 + */ + @ApiModelProperty(value = "处罚决定书文号") + @TableField("PENDECNO") + private String penDecNo; + + /** + * 违法行为类型代码 + */ + @ApiModelProperty(value = "违法行为类型代码") + @TableField("ILLEGACTTYPECODE") + private String illegActTypeCode; + + /** + * 违法行为类型 + */ + @ApiModelProperty(value = "违法行为类型") + @TableField("ILLEGACTTYPE") + private String illegActType; + + /** + * 主要违法事实 + */ + @ApiModelProperty(value = "主要违法事实") + @TableField("MAINILLEGFACT") + private String mainIllegFact; + + /** + * 处罚依据 + */ + @ApiModelProperty(value = "处罚依据") + @TableField("PENBASIS") + private String penBasis; + + /** + * 处罚依据中文 + */ + @ApiModelProperty(value = "处罚依据中文") + @TableField("PENBASIS_CN") + private String penBasisCn; + + /** + * 处罚种类 + */ + @ApiModelProperty(value = "处罚种类") + @TableField("PENTYPE") + private String penType; + + /** + * 处罚种类中文 + */ + @ApiModelProperty(value = "处罚种类中文") + @TableField("PENTYPE_CN") + private String penTypeCn; + + /** + * 处罚金额 + */ + @ApiModelProperty(value = "处罚金额") + @TableField("PENAM") + private BigDecimal penam; + + /** + * 没收违法所得金额 + */ + @ApiModelProperty(value = "没收违法所得金额") + @TableField("FORFAM") + private BigDecimal forfam; + + /** + * 处罚决定日期 + */ + @ApiModelProperty(value = "处罚决定日期") + @TableField("PENDECISSDATE") + private Date penDecissDate; + + /** + * 处罚期限 + */ + @ApiModelProperty(value = "处罚期限") + @TableField("PENPERI") + private Date penPeri; + + /** + * 处罚机关 + */ + @ApiModelProperty(value = "处罚机关") + @TableField("PENAUTH") + private String penAuth; + + /** + * 处罚机关中文 + */ + @ApiModelProperty(value = "处罚机关中文") + @TableField("PENAUTH_CN") + private String penAuthCn; + + /** + * 处罚机关统一社会信用代码 + */ + @ApiModelProperty(value = "处罚机关统一社会信用代码") + @TableField("PENAUTHUNISCID") + private String penAuthUniscid; + + /** + * 处罚内容 + */ + @ApiModelProperty(value = "处罚内容") + @TableField("PENCONTENT") + private String penContent; + + /** + * 吊销许可证数量 + */ + @ApiModelProperty(value = "吊销许可证数量") + @TableField("REVLICNUM") + private String revLicNum; + + /** + * 公示日期 + */ + @ApiModelProperty(value = "公示日期") + @TableField("PUBLICDATE") + private Date publicDate; + + /** + * 公示截止日期 + */ + @ApiModelProperty(value = "公示截止日期") + @TableField("PUBDEADLINE") + private Date pubDeadline; + + /** + * 数据部门 + */ + @ApiModelProperty(value = "数据部门") + @TableField("DATADEPT") + private String dataDept; + + /** + * 数据部门统一社会信用代码 + */ + @ApiModelProperty(value = "数据部门统一社会信用代码") + @TableField("DATADEPTUNISCID") + private String dataDeptUniscid; + + /** + * 备注 + */ + @ApiModelProperty(value = "备注") + @TableField("REMARK") + private String remark; + + /** + * 操作标志(修复时改为D) + */ + @ApiModelProperty(value = "操作标志") + @TableField("OPFLAG") + private String opflag; + + /** + * 内蒙数据中心时间戳 + */ + @ApiModelProperty(value = "内蒙数据中心时间戳") + @TableField("S_EXT_DATETIME") + private LocalDateTime sExtDatetime; + + /** + * 最后更新时间 + */ + @ApiModelProperty(value = "最后更新时间") + @TableField("LASTUPDATETIME") + private Date lastUpdateTime; + + + @Override + protected Serializable pkVal() { + return this.caseid; + } +} diff --git a/src/main/java/com/chinaweal/aiccs/aiccs/punishment/mapper/QgCasePubNbaseinfoMapper.java b/src/main/java/com/chinaweal/aiccs/aiccs/punishment/mapper/QgCasePubNbaseinfoMapper.java new file mode 100644 index 0000000..7b51c1d --- /dev/null +++ b/src/main/java/com/chinaweal/aiccs/aiccs/punishment/mapper/QgCasePubNbaseinfoMapper.java @@ -0,0 +1,45 @@ +package com.chinaweal.aiccs.aiccs.punishment.mapper; + +import com.chinaweal.aiccs.aiccs.punishment.entity.QgCasePubNbaseinfo; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.ibatis.annotations.Param; + +import java.time.LocalDateTime; +import java.util.Map; + +/** + *

+ * 跨省行政处罚基本信息表 Mapper 接口 + *

+ * + * @author developer + * @since 2026-03-30 + */ +public interface QgCasePubNbaseinfoMapper extends BaseMapper { + + /** + * 分页查询跨省行政处罚信息 + * @param page 分页参数 + * @param params 查询参数 + * @return 分页结果 + */ + IPage searchByPage(Page page, @Param("params") Map params); + + /** + * 根据ID查询 + * @param caseid 案件ID + * @return 跨省行政处罚信息 + */ + QgCasePubNbaseinfo findById(@Param("caseid") String caseid); + + /** + * 更新修复状态 + * @param caseid 案件ID + * @param approvalDate 审批日期 + * @param now 当前时间戳 + * @return 更新行数 + */ + int updateForRepair(@Param("caseid") String caseid, @Param("approvalDate") java.util.Date approvalDate, @Param("now") LocalDateTime now); +} diff --git a/src/main/java/com/chinaweal/aiccs/aiccs/punishment/service/IQgCasePubNbaseinfoService.java b/src/main/java/com/chinaweal/aiccs/aiccs/punishment/service/IQgCasePubNbaseinfoService.java new file mode 100644 index 0000000..fc39fec --- /dev/null +++ b/src/main/java/com/chinaweal/aiccs/aiccs/punishment/service/IQgCasePubNbaseinfoService.java @@ -0,0 +1,42 @@ +package com.chinaweal.aiccs.aiccs.punishment.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.chinaweal.aiccs.aiccs.punishment.entity.QgCasePubNbaseinfo; + +import java.util.Map; + +/** + *

+ * 跨省行政处罚基本信息表 服务类 + *

+ * + * @author developer + * @since 2026-03-30 + */ +public interface IQgCasePubNbaseinfoService extends IService { + + /** + * 分页查询跨省行政处罚信息 + * @param page 分页参数 + * @param params 查询参数 + * @return 分页结果 + */ + IPage searchByPage(Page page, Map params); + + /** + * 根据ID查询 + * @param caseid 案件ID + * @return 跨省行政处罚信息 + */ + QgCasePubNbaseinfo findById(String caseid); + + /** + * 更新修复状态 + * @param caseid 案件ID + * @param approvalDate 审批日期 + * @return 是否成功 + */ + boolean updateForRepair(String caseid, java.util.Date approvalDate); +} diff --git a/src/main/java/com/chinaweal/aiccs/aiccs/punishment/service/ITBizRemPunishmentService.java b/src/main/java/com/chinaweal/aiccs/aiccs/punishment/service/ITBizRemPunishmentService.java index 2b38821..7f69d4b 100644 --- a/src/main/java/com/chinaweal/aiccs/aiccs/punishment/service/ITBizRemPunishmentService.java +++ b/src/main/java/com/chinaweal/aiccs/aiccs/punishment/service/ITBizRemPunishmentService.java @@ -2,7 +2,6 @@ package com.chinaweal.aiccs.aiccs.punishment.service; import com.chinaweal.aiccs.aiccs.business.entity.TSTaskList; import com.chinaweal.aiccs.aiccs.punishment.entity.TBizRemPunishment; -import com.baomidou.mybatisplus.core.metadata.IPage; import com.chinaweal.aiccs.aiccs.writs.entity.Tswrittemplate; import com.chinaweal.youfool.framework.springboot.base.query.BaseQuery; import com.chinaweal.youfool.framework.springboot.mybatis.plus.BaseService; @@ -40,6 +39,17 @@ public interface ITBizRemPunishmentService extends BaseService selectbizRembizseq(String bizseqid); } diff --git a/src/main/java/com/chinaweal/aiccs/aiccs/punishment/service/impl/IQgCasePubNbaseinfoServiceImpl.java b/src/main/java/com/chinaweal/aiccs/aiccs/punishment/service/impl/IQgCasePubNbaseinfoServiceImpl.java new file mode 100644 index 0000000..75bf581 --- /dev/null +++ b/src/main/java/com/chinaweal/aiccs/aiccs/punishment/service/impl/IQgCasePubNbaseinfoServiceImpl.java @@ -0,0 +1,40 @@ +package com.chinaweal.aiccs.aiccs.punishment.service.impl; + +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.punishment.entity.QgCasePubNbaseinfo; +import com.chinaweal.aiccs.aiccs.punishment.mapper.QgCasePubNbaseinfoMapper; +import com.chinaweal.aiccs.aiccs.punishment.service.IQgCasePubNbaseinfoService; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.Map; + +/** + *

+ * 跨省行政处罚基本信息表 服务实现类 + *

+ * + * @author developer + * @since 2026-03-30 + */ +@Service +public class IQgCasePubNbaseinfoServiceImpl extends ServiceImpl implements IQgCasePubNbaseinfoService { + + @Override + public IPage searchByPage(Page page, Map params) { + return this.baseMapper.searchByPage(page, params); + } + + @Override + public QgCasePubNbaseinfo findById(String caseid) { + return this.baseMapper.findById(caseid); + } + + @Override + public boolean updateForRepair(String caseid, java.util.Date approvalDate) { + int rows = this.baseMapper.updateForRepair(caseid, approvalDate, LocalDateTime.now()); + return rows > 0; + } +} diff --git a/src/main/java/com/chinaweal/aiccs/aiccs/punishment/service/impl/TBizRemPunishmentServiceImpl.java b/src/main/java/com/chinaweal/aiccs/aiccs/punishment/service/impl/TBizRemPunishmentServiceImpl.java index cafc26d..6578503 100644 --- a/src/main/java/com/chinaweal/aiccs/aiccs/punishment/service/impl/TBizRemPunishmentServiceImpl.java +++ b/src/main/java/com/chinaweal/aiccs/aiccs/punishment/service/impl/TBizRemPunishmentServiceImpl.java @@ -254,6 +254,145 @@ public class TBizRemPunishmentServiceImpl extends BaseServiceImpl() + .orderByDesc(TSOpinion::getHandledate) // 按 handledate 降序排列 + .last("LIMIT 1")); + if(tsOpinion != null){ + //取上一个节点的人 + nextPerformerids = tsOpinion.getHandlerid(); + nextPerformerName = tsOpinion.getHandler(); + } + } else { //流程无法找到 + throw new RuntimeException("流程无法找到"); + } + } + //修改业务表 + this.updateById(tBizRemPunishment); + + // 流程推进 + taskListService.updateWorkFlow(loginUser, opinion, tsTaskList, + nextNodeID, new String[]{ nextPerformerids }, new String[]{ nextPerformerName }); + } + + /** + * 外省行政处罚修复 - 插入跨省修复案例表并更新跨省处罚表 + * @param tBizRemPunishment 业务信息 + * @param qgCasePubNbaseinfoService 跨省处罚信息服务 + * @param crECaseService 跨省修复案例服务 + */ + private void insertCrECase(TBizRemPunishment tBizRemPunishment, + com.chinaweal.aiccs.aiccs.punishment.service.IQgCasePubNbaseinfoService qgCasePubNbaseinfoService, + com.chinaweal.aiccs.aiccs.punishment.service.ICrECaseService crECaseService) { + // 1. 更新跨省处罚表:opflag='D', pubdeadline=审批日期, S_EXT_DATETIME=审批日期 + LocalDateTime now = LocalDateTime.now(); + Date approvalDate = Date.from(now.atZone(ZoneId.systemDefault()).toInstant()); + qgCasePubNbaseinfoService.updateForRepair(tBizRemPunishment.getPunishmentId(), approvalDate); + + // 2. 获取跨省处罚信息用于插入CR_E_CASE + com.chinaweal.aiccs.aiccs.punishment.entity.QgCasePubNbaseinfo qgCasePubNbaseinfo = + qgCasePubNbaseinfoService.findById(tBizRemPunishment.getPunishmentId()); + + // 3. 插入跨省修复案例表 + com.chinaweal.aiccs.aiccs.punishment.entity.CrECase crECase = new com.chinaweal.aiccs.aiccs.punishment.entity.CrECase(); + crECase.setCasecreid(IdUtil.simpleUUID()) + .setPripid(tBizRemPunishment.getPripid()) + .setEntname(qgCasePubNbaseinfo != null ? qgCasePubNbaseinfo.getEntname() : "") + .setUniscid(qgCasePubNbaseinfo != null ? qgCasePubNbaseinfo.getUniscid() : "") + .setCaseid(tBizRemPunishment.getPunishmentId()); + + // 修复日期 + LocalDateTime localDateTimeRepairDate = tBizRemPunishment.getRepairDate(); + Date repairDate = Date.from(localDateTimeRepairDate.atZone(ZoneId.systemDefault()).toInstant()); + LocalDate localDate = tBizRemPunishment.getApplyDate(); + Date applyDate = Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant()); + + crECase.setRepairdate(applyDate) + .setRepauth(tBizRemPunishment.getRepairOrg()) + .setRepauthcn(tBizRemPunishment.getRepairOrgCn()) + .setRepdate(repairDate) + .setRepstate("1") // 修复状态:1-已修复 + .setUploadtime(now) + .setEntrytype("0") // 录入方式:0-页面 + .setPenauth(qgCasePubNbaseinfo != null ? qgCasePubNbaseinfo.getPenAuth() : "") + .setPenauthcn(qgCasePubNbaseinfo != null ? qgCasePubNbaseinfo.getPenAuthCn() : "") + .setPendecno(qgCasePubNbaseinfo != null ? qgCasePubNbaseinfo.getPenDecNo() : "") + .setRepairno(tBizRemPunishment.getRepairNo()) + .setSExtDatetime(now); + + crECaseService.save(crECase); + } + private TBizRemPunishment handleTsWrit(TBizRemPunishment tBizRemPunishment, Tswrittemplate tswrittemplate){ TSWrit tsWritModel = new TSWrit(); String tswritId = UUID.randomUUID().toString(); diff --git a/src/main/resources/mybatis/mapper/aiccs/punishment/QgCasePubNbaseinfoMapper.xml b/src/main/resources/mybatis/mapper/aiccs/punishment/QgCasePubNbaseinfoMapper.xml new file mode 100644 index 0000000..b430fc2 --- /dev/null +++ b/src/main/resources/mybatis/mapper/aiccs/punishment/QgCasePubNbaseinfoMapper.xml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CASEID, ACTYPE, PRIPID, ENTNAME, UNISCID, REGNO, INSCERCODE, SOCORGCODE, ORGCODE, TAXID, + LEREP, CERTYPE, CERNO, NAME, AC_CERTYPE, AC_CERNO, PENDECNO, ILLEGACTTYPECODE, ILLEGACTTYPE, + MAINILLEGFACT, PENBASIS, PENBASIS_CN, PENTYPE, PENTYPE_CN, PENAM, FORFAM, PENDECISSDATE, + PENPERI, PENAUTH, PENAUTH_CN, PENAUTHUNISCID, PENCONTENT, REVLICNUM, PUBLICDATE, PUBDEADLINE, + DATADEPT, DATADEPTUNISCID, REMARK, OPFLAG, S_EXT_DATETIME, LASTUPDATETIME + + + + + + + + + + + UPDATE QG_CASE_PUB_NBASEINFO + SET OPFLAG = 'D', + PUBDEADLINE = #{approvalDate}, + S_EXT_DATETIME = #{now} + WHERE CASEID = #{caseid} + + +