增加执法一张图、案件信息、文书送达扥controller类
This commit is contained in:
parent
b3798bcb20
commit
d0d0a5712f
|
|
@ -0,0 +1,209 @@
|
|||
package com.aisino.iles.lawenforcement.controller;
|
||||
|
||||
import com.aisino.iles.common.model.Ok;
|
||||
import com.aisino.iles.common.model.Result;
|
||||
import com.aisino.iles.common.util.Constants;
|
||||
import com.aisino.iles.core.annotation.CurrentUser;
|
||||
import com.aisino.iles.lawenforcement.model.EnforcementInfo;
|
||||
import com.aisino.iles.lawenforcement.model.Enterprise;
|
||||
import com.aisino.iles.lawenforcement.model.dto.BigScreenDto;
|
||||
import com.aisino.iles.lawenforcement.service.BigScreenService;
|
||||
import com.smartlx.sso.client.model.RemoteUserInfo;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 综合执法/执法一张图
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(Constants.API_PREFIX + "/bigscreen")
|
||||
public class BigScreenController {
|
||||
|
||||
private final BigScreenService bigScreenService;
|
||||
|
||||
public BigScreenController(BigScreenService bigScreenService) {
|
||||
this.bigScreenService = bigScreenService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据概览统计
|
||||
*
|
||||
* @param
|
||||
* @return 数据概览统计
|
||||
*/
|
||||
@GetMapping("/dataoverview")
|
||||
public Result<Map> getDataOverview() {
|
||||
return Ok.of(bigScreenService.getDataOverview());
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业信息统计
|
||||
*
|
||||
* @param
|
||||
* @return 企业信息统计
|
||||
*/
|
||||
@GetMapping("/qytj")
|
||||
public Result<Map> getEnterpriseStatistics(@CurrentUser RemoteUserInfo user) {
|
||||
// return Ok.of(bigScreenService.getEnterpriseStatistics(user));
|
||||
return Ok.of(bigScreenService.getEnterpriseStatistics2(user));
|
||||
}
|
||||
|
||||
/**
|
||||
* 执法检查统计
|
||||
*
|
||||
* @param
|
||||
* @return 执法检查统计
|
||||
*/
|
||||
@GetMapping("/zfjc")
|
||||
public Result<List> getZfjcs(BigScreenDto bigScreenDto) {
|
||||
return Ok.of(bigScreenService.getZfjcs(bigScreenDto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 案件办理统计
|
||||
*
|
||||
* @param
|
||||
* @return 案件办理统计
|
||||
*/
|
||||
@GetMapping("/ajbl")
|
||||
public Result<Map> getAjbl() {
|
||||
return Ok.of(bigScreenService.getAjbl());
|
||||
}
|
||||
|
||||
/**
|
||||
* 执法形式
|
||||
*
|
||||
* @param
|
||||
* @return 执法形式统计
|
||||
*/
|
||||
@GetMapping("/zfxs")
|
||||
public Result<List> getZfxs() {
|
||||
//return Ok.of(bigScreenService.getZfxs());
|
||||
return Ok.of(bigScreenService.getZfxs2());
|
||||
}
|
||||
|
||||
/**
|
||||
* 案件来源
|
||||
*
|
||||
* @param
|
||||
* @return 案件来源统计
|
||||
*/
|
||||
@GetMapping("/ajly")
|
||||
public Result<List> getAjly(@CurrentUser RemoteUserInfo user) {
|
||||
return Ok.of(bigScreenService.getAjly(user));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查案件趋势
|
||||
*
|
||||
* @param
|
||||
* @return 检查案件趋势统计
|
||||
*/
|
||||
@GetMapping("/jcajqs")
|
||||
public Result<List> getJcajqs(BigScreenDto bigScreenDto) {
|
||||
return Ok.of(bigScreenService.getJcajqs(bigScreenDto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查统计
|
||||
*
|
||||
* @param
|
||||
* @return 检查统计
|
||||
*/
|
||||
@GetMapping("/jctj")
|
||||
public Result<List> getJctj(BigScreenDto bigScreenDto) {
|
||||
return Ok.of(bigScreenService.getJctj(bigScreenDto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 案件统计
|
||||
*
|
||||
* @param
|
||||
* @return 案件统计
|
||||
*/
|
||||
@GetMapping("/ajtj")
|
||||
public Result<List> getAjtj(BigScreenDto bigScreenDto) {
|
||||
return Ok.of(bigScreenService.getAjtj(bigScreenDto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 处罚金额统计
|
||||
*
|
||||
* @param
|
||||
* @return 处罚金额统计
|
||||
*/
|
||||
@GetMapping("/cfjetj")
|
||||
public Result<List> getCfjetj(BigScreenDto bigScreenDto) {
|
||||
return Ok.of(bigScreenService.getCfjetj(bigScreenDto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 任务完结
|
||||
*
|
||||
* @param
|
||||
* @return 任务完结统计
|
||||
*/
|
||||
@GetMapping("/rwwj")
|
||||
public Result<List> getRwwj(BigScreenDto bigScreenDto) {
|
||||
return Ok.of(bigScreenService.getRwwj(bigScreenDto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 非现场执法统计
|
||||
*
|
||||
* @param
|
||||
* @return 非现场执法统计
|
||||
*/
|
||||
@GetMapping("/fxczftj")
|
||||
public Result<List> getFxczftj(String type) {
|
||||
return Ok.of(bigScreenService.getFxczftj(type));
|
||||
}
|
||||
|
||||
/**
|
||||
* 监督检查计划统计
|
||||
*
|
||||
* @param
|
||||
* @return 监督检查计划统计
|
||||
*/
|
||||
@GetMapping("/jdjcjhtj")
|
||||
public Result<List> getJdjcjhtj() {
|
||||
return Ok.of(bigScreenService.getJdjcjhtj());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据企业分级查询企业列表
|
||||
*
|
||||
* @param businessRating 企业分级
|
||||
* @return 企业列表
|
||||
*/
|
||||
@GetMapping("/qyxx")
|
||||
public Result<List<Enterprise>> getEnterprisesByBusinessRating(String businessRating) {
|
||||
return Ok.of(bigScreenService.findEnterprisesByBusinessRating(businessRating));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据企业id查询企业执法信息
|
||||
*
|
||||
* @param enterpriseId 企业id
|
||||
* @return 企业列表
|
||||
*/
|
||||
@GetMapping("/qyxx/zfxx")
|
||||
public Result<List<EnforcementInfo>> getEnforcementInfoByEnterpriseId(String enterpriseId) {
|
||||
return Ok.of(bigScreenService.findEnforcementInfoByEnterpriseId(enterpriseId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 任务完成情况
|
||||
*
|
||||
* @return 列表结果
|
||||
*/
|
||||
@GetMapping("/rwwctj")
|
||||
public Result<List<Map<String, Object>>> rwwctj() {
|
||||
return Ok.of(bigScreenService.rwwctj());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,361 @@
|
|||
package com.aisino.iles.lawenforcement.controller;
|
||||
|
||||
import com.aisino.iles.common.model.Ok;
|
||||
import com.aisino.iles.common.model.PageResult;
|
||||
import com.aisino.iles.common.model.Result;
|
||||
import com.aisino.iles.common.util.Constants;
|
||||
import com.aisino.iles.lawenforcement.model.EnforcementInfo;
|
||||
import com.aisino.iles.lawenforcement.model.Officer;
|
||||
import com.aisino.iles.lawenforcement.model.dto.HomePageDetailDto;
|
||||
import com.aisino.iles.lawenforcement.model.dto.HomePageDto;
|
||||
import com.aisino.iles.lawenforcement.model.dto.NodeCaseNumDto;
|
||||
import com.aisino.iles.lawenforcement.model.query.*;
|
||||
import com.aisino.iles.lawenforcement.service.BigScreenService;
|
||||
import com.aisino.iles.lawenforcement.service.HomePageService;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.temporal.TemporalAdjusters;
|
||||
|
||||
/**
|
||||
* 接口对接/提供大屏展示接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(Constants.API_PREFIX + "/lawenforcement/big-screen-system")
|
||||
public class BigScreenSystemController {
|
||||
|
||||
private final BigScreenService bigScreenService;
|
||||
private final HomePageService homePageService;
|
||||
|
||||
public BigScreenSystemController(BigScreenService bigScreenService, HomePageService homePageService) {
|
||||
this.bigScreenService = bigScreenService;
|
||||
this.homePageService = homePageService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当月执法对象数量
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/zfdxsl")
|
||||
public Result<Long> getZfdxsl() {
|
||||
return Ok.of(bigScreenService.getZfdxsl());
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询当月执法对象
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/zfdxsl/fy")
|
||||
public PageResult<EnforcementInfo> getZfdxslfy(EnforcementInfoQuery query) {
|
||||
return PageResult.of(bigScreenService.getZfdxslfy(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当月执法人员数量
|
||||
*/
|
||||
@GetMapping("/zfrysl")
|
||||
public Result<Long> getZfrysl() {
|
||||
return Ok.of(bigScreenService.getZfrysl());
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询当月执法人员
|
||||
*/
|
||||
@GetMapping("/zfrysl/fy")
|
||||
public PageResult<Officer> getZfryslfy(OfficerQuery query) {
|
||||
return PageResult.of(bigScreenService.getZfryslfy(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当月执法信息数量
|
||||
*/
|
||||
@GetMapping("/zfxxsl")
|
||||
public Result<Long> getZfxxsl() {
|
||||
return Ok.of(bigScreenService.getZfdxsl());
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询当月执法信息
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/zfxxsl/fy")
|
||||
public PageResult<EnforcementInfo> getZfxxslfy(EnforcementInfoQuery query) {
|
||||
return PageResult.of(bigScreenService.getZfdxslfy(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当月执法检查数量
|
||||
*
|
||||
* @return 执法检查数量
|
||||
*/
|
||||
@RequestMapping("/zfjcsl")
|
||||
public Result<Long> checkCount() {
|
||||
return Ok.of(bigScreenService.checkCount());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当月执法检查情况分页列表
|
||||
*
|
||||
* @param query {page:1,pagesize:20 }
|
||||
* @return 查询当月执法检查情况列表
|
||||
*/
|
||||
@GetMapping("/getzfjcslDetail")
|
||||
public PageResult<BigScreenService.ZfjcDto> getzfjcslDetail(EnforceCheckQuery query) {
|
||||
return PageResult.of(bigScreenService.getzfjcslDetail(query));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询当月事故单位报告、公众举报、下级部门报告、媒体舆情监测、其他部分移送数量(当月举报统计)
|
||||
*
|
||||
* @return 举报统计结果
|
||||
*/
|
||||
@GetMapping("/dytjs")
|
||||
public Result<BigScreenService.DytjDto> dytjs() {
|
||||
return Ok.of(bigScreenService.dytjs());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当月日常检查发现情况列表
|
||||
*
|
||||
* @param query {page:1,pagesize:20 }
|
||||
* @return 查询当月日常检查发现分页列表
|
||||
*/
|
||||
@GetMapping("/getzfjcslDetail/rcjdfx")
|
||||
public PageResult<BigScreenService.DytjsDto> getrcjdfxDetail(CaseQuery query) {
|
||||
query.setConditionlike("1");
|
||||
return PageResult.of(bigScreenService.getdytjDetail(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当月机构监测报告情况列表
|
||||
*
|
||||
* @param query {page:1,pagesize:20 }
|
||||
* @return 查询当月机构监测报告分页列表
|
||||
*/
|
||||
@GetMapping("/getzfjcslDetail/jgjcbg")
|
||||
public PageResult<BigScreenService.DytjsDto> getjgjcbgDetail(CaseQuery query) {
|
||||
query.setConditionlike("2");
|
||||
return PageResult.of(bigScreenService.getdytjDetail(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当月举报投诉情况列
|
||||
*
|
||||
* @param query {page:1,pagesize:20 }
|
||||
* @return 查询当月举报投诉情况分页列表
|
||||
*/
|
||||
@GetMapping("/getzfjcslDetail/jbts")
|
||||
public PageResult<BigScreenService.DytjsDto> getjbtsDetail(CaseQuery query) {
|
||||
query.setConditionlike("3");
|
||||
return PageResult.of(bigScreenService.getdytjDetail(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当月上级交办情况列表
|
||||
*
|
||||
* @param query {page:1,pagesize:20 }
|
||||
* @return 查询当月上级交办情况列表
|
||||
*/
|
||||
@GetMapping("/getzfjcslDetail/sjjb")
|
||||
public PageResult<BigScreenService.DytjsDto> getsjjbDetail(CaseQuery query) {
|
||||
query.setConditionlike("4");
|
||||
return PageResult.of(bigScreenService.getdytjDetail(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当月下级情报情况列表
|
||||
*
|
||||
* @param query {page:1,pagesize:20 }
|
||||
* @return 查询当月下级情报情况列表
|
||||
*/
|
||||
@GetMapping("/getzfjcslDetail/xjqb")
|
||||
public PageResult<BigScreenService.DytjsDto> getxjqbDetail(CaseQuery query) {
|
||||
query.setConditionlike("5");
|
||||
return PageResult.of(bigScreenService.getdytjDetail(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当月有关部门移送情况列表
|
||||
*
|
||||
* @param query {page:1,pagesize:20 }
|
||||
* @return 查询当月有关部门移送情况列表
|
||||
*/
|
||||
@GetMapping("/getzfjcslDetail/ygbmys")
|
||||
public PageResult<BigScreenService.DytjsDto> getygbmysDetail(CaseQuery query) {
|
||||
query.setConditionlike("6");
|
||||
return PageResult.of(bigScreenService.getdytjDetail(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当月其他情况列表
|
||||
*
|
||||
* @param query {page:1,pagesize:20 }
|
||||
* @return 查询当月其他情况列表
|
||||
*/
|
||||
@GetMapping("/getzfjcslDetail/qt")
|
||||
public PageResult<BigScreenService.DytjsDto> getqtDetail(CaseQuery query) {
|
||||
query.setConditionlike("7");
|
||||
return PageResult.of(bigScreenService.getdytjDetail(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当月执法文书数量
|
||||
*
|
||||
* @return 查询当月执法文书数量
|
||||
*/
|
||||
@GetMapping("/getDocumentNum")
|
||||
public Result<Long> getDocumentNum() {
|
||||
return Ok.of(homePageService.getDocumentNumForPlatform());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当月文书数详情列表
|
||||
*
|
||||
* @return 查询当月查询当月文书数详情列表
|
||||
*/
|
||||
@GetMapping("/getDocumentDetail")
|
||||
public PageResult<HomePageDetailDto> getDocumentDetail(DocumentQuery query) {
|
||||
return PageResult.of(homePageService.getDocumentForPlatformDetail(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当月查询当月案卷数量
|
||||
*
|
||||
* @return 查询当月查询当月案卷数量
|
||||
*/
|
||||
@GetMapping("/getDossiersNum")
|
||||
public Result<Long> getDossiersNum() {
|
||||
return Ok.of(homePageService.getDossiersNumForPlatform());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当月案卷数详情列表
|
||||
*
|
||||
* @param query {page:1,pagesize:20 }
|
||||
* @return 查询当月查询当月案卷数详情列表
|
||||
*/
|
||||
@GetMapping("/getDossiersDetail")
|
||||
public PageResult<HomePageDetailDto> getDossiersDetail(CaseQuery query) {
|
||||
return PageResult.of(homePageService.gettDossiersNumForPlatformDetail(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当月受理、调查、决定、执行数量
|
||||
*
|
||||
* @return 查询当月查询当月受理、调查、决定、执行数量
|
||||
*/
|
||||
@GetMapping("/getCaseNodeNum")
|
||||
public Result<HomePageDto> getCaseNodeNum() {
|
||||
return Ok.of(homePageService.getCaseNodeNumForPlatform());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当月受理数详情列表
|
||||
*
|
||||
* @param query {page:1,pagesize:20 }
|
||||
* @return 查询当月查询当月受理详情列表
|
||||
*/
|
||||
@GetMapping("/getSlDetail")
|
||||
public PageResult<HomePageDetailDto> getSlDetail(CaseQuery query) {
|
||||
query.setConditionlike("sl");
|
||||
LocalDate firstDayOfMonth = LocalDate.now().with(TemporalAdjusters.firstDayOfMonth());
|
||||
LocalDate lastDayOfMonth = LocalDate.now().with(TemporalAdjusters.lastDayOfMonth());
|
||||
query.setFillingDate(new LocalDate[]{firstDayOfMonth, lastDayOfMonth});
|
||||
return PageResult.of(homePageService.getCaseNodeNumForPlatformDetail(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当月调查数详情列表
|
||||
*
|
||||
* @param query {page:1,pagesize:20 }
|
||||
* @return 查询当月查询当月调查详情列表
|
||||
*/
|
||||
@GetMapping("/getDcDetail")
|
||||
public PageResult<HomePageDetailDto> getDcDetail(CaseQuery query) {
|
||||
query.setConditionlike("dc");
|
||||
LocalDate firstDayOfMonth = LocalDate.now().with(TemporalAdjusters.firstDayOfMonth());
|
||||
LocalDate lastDayOfMonth = LocalDate.now().with(TemporalAdjusters.lastDayOfMonth());
|
||||
query.setFillingDate(new LocalDate[]{firstDayOfMonth, lastDayOfMonth});
|
||||
return PageResult.of(homePageService.getCaseNodeNumForPlatformDetail(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当月决定数详情列表
|
||||
*
|
||||
* @param query {page:1,pagesize:20 }
|
||||
* @return 查询当月查询当月决定详情列表
|
||||
*/
|
||||
@GetMapping("/getJdDetail")
|
||||
public PageResult<HomePageDetailDto> getJdDetail(CaseQuery query) {
|
||||
query.setConditionlike("jd");
|
||||
LocalDate firstDayOfMonth = LocalDate.now().with(TemporalAdjusters.firstDayOfMonth());
|
||||
LocalDate lastDayOfMonth = LocalDate.now().with(TemporalAdjusters.lastDayOfMonth());
|
||||
query.setFillingDate(new LocalDate[]{firstDayOfMonth, lastDayOfMonth});
|
||||
return PageResult.of(homePageService.getCaseNodeNumForPlatformDetail(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当月执行数详情列表
|
||||
*
|
||||
* @param query {page:1,pagesize:20 }
|
||||
* @return 查询当月查询当月执行详情列表
|
||||
*/
|
||||
@GetMapping("/getZxDetail")
|
||||
public PageResult<HomePageDetailDto> getZxDetail(CaseQuery query) {
|
||||
query.setConditionlike("zx");
|
||||
LocalDate firstDayOfMonth = LocalDate.now().with(TemporalAdjusters.firstDayOfMonth());
|
||||
LocalDate lastDayOfMonth = LocalDate.now().with(TemporalAdjusters.lastDayOfMonth());
|
||||
query.setFillingDate(new LocalDate[]{firstDayOfMonth, lastDayOfMonth});
|
||||
return PageResult.of(homePageService.getCaseNodeNumForPlatformDetail(query));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询节点的案件数
|
||||
* 立案、完成调查取证、审理、告知、陈述申辩或听证、执行、决定、结案
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 节点的案件数
|
||||
*/
|
||||
@GetMapping("/nodeCaseNum")
|
||||
public Result<NodeCaseNumDto> getNodeCaseNum(CaseQuery query) {
|
||||
return Ok.of(homePageService.getNodeCaseNum(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询各节点案件列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 案件列表
|
||||
*/
|
||||
@GetMapping("/getNodeCaseDetail")
|
||||
public PageResult<HomePageDetailDto> getNodeCaseDetail(CaseQuery query) {
|
||||
if (!StringUtils.hasText(query.getTag()))
|
||||
throw new IllegalArgumentException("节点类型不能为空");
|
||||
if (!"la".equals(query.getTag()) &&
|
||||
!"dcqz".equals(query.getTag()) &&
|
||||
!"sl".equals(query.getTag()) &&
|
||||
!"gz".equals(query.getTag()) &&
|
||||
!"tz".equals(query.getTag()) &&
|
||||
!"zx".equals(query.getTag()) &&
|
||||
!"jd".equals(query.getTag()) &&
|
||||
!"ja".equals(query.getTag())) {
|
||||
throw new IllegalArgumentException("节点类型错误");
|
||||
}
|
||||
query.setConditionlike(query.getTag());
|
||||
if ("sl".equals(query.getTag()))
|
||||
query.setConditionlike("sls");
|
||||
return PageResult.of(homePageService.getCaseNodeNumForPlatformDetail(query));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,279 @@
|
|||
package com.aisino.iles.lawenforcement.controller;
|
||||
|
||||
import com.aisino.iles.common.model.Fail;
|
||||
import com.aisino.iles.common.model.Ok;
|
||||
import com.aisino.iles.common.model.PageResult;
|
||||
import com.aisino.iles.common.model.Result;
|
||||
import com.aisino.iles.common.service.FtpService;
|
||||
import com.aisino.iles.common.util.Constants;
|
||||
import com.aisino.iles.core.annotation.CurrentUser;
|
||||
import com.aisino.iles.lawenforcement.model.Case;
|
||||
import com.aisino.iles.lawenforcement.model.dto.FormDataDto;
|
||||
import com.aisino.iles.lawenforcement.model.query.CaseQuery;
|
||||
import com.aisino.iles.lawenforcement.service.CaseService;
|
||||
import com.smartlx.sso.client.model.RemoteUserInfo;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 综合执法/行政处罚流程
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(Constants.API_PREFIX + "/lawenforcement/cases")
|
||||
public class CaseController {
|
||||
private final CaseService caseService;
|
||||
private final FtpService ftpService;
|
||||
|
||||
public CaseController(CaseService caseService, FtpService ftpService) {
|
||||
this.caseService = caseService;
|
||||
this.ftpService = ftpService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询案件信息
|
||||
*
|
||||
* @param query 案件数据项查询条件
|
||||
* @return 分页案件信息
|
||||
*/
|
||||
@GetMapping
|
||||
public PageResult<Case> getCasesPage(CaseQuery query, @CurrentUser RemoteUserInfo user) {
|
||||
Page<Case> page = caseService.findCasesPage(query, user);
|
||||
return PageResult.of(page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询案件信息(单条)
|
||||
*
|
||||
* @param caseId 案件id
|
||||
* @return 案件实体
|
||||
*/
|
||||
@GetMapping("/{caseId}")
|
||||
public Result<Case> getCaseById(@PathVariable String caseId) {
|
||||
return caseService.findCaseById(caseId)
|
||||
.map(o -> ((Result<Case>) Ok.of(o)))
|
||||
.orElse(Fail.of("数据错误"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询案件信息(不分页)
|
||||
*
|
||||
* @param query 案件数据项查询条件
|
||||
* @return 查询结果
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public Result<List<Case>> listCases(CaseQuery query, @CurrentUser RemoteUserInfo user) {
|
||||
return Ok.of(caseService.listCases(query, user));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据案件id修改
|
||||
*
|
||||
* @param caseId 案件id
|
||||
* @param caseInfo 案件实体
|
||||
* @return 案件实体
|
||||
*/
|
||||
@PutMapping("/{caseId}")
|
||||
public Result<Case> updateCase(@PathVariable String caseId, @RequestBody Case caseInfo) {
|
||||
caseInfo.setCaseId(caseId);
|
||||
return Ok.of(caseService.saveCase(caseInfo));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 调查取证 直接传文件到后台保存方式
|
||||
*
|
||||
* @param formData 文件数据
|
||||
* @return 案件实体
|
||||
*/
|
||||
@PostMapping("/upload-evidenceFile")
|
||||
public Result<Case> addEvidenceFile(FormDataDto formData) {
|
||||
return Ok.of(caseService.saveEvidence(formData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 调查取证 保存已经上传后路径方式
|
||||
*
|
||||
* @param caseId 案件id
|
||||
* @param caseInfo 案件实体
|
||||
* @return 案件实体
|
||||
*/
|
||||
@PutMapping("/saveEvidence/{caseId}")
|
||||
public Result<Case> saveEvidence(@PathVariable String caseId, @RequestBody Case caseInfo) {
|
||||
caseInfo.setCaseId(caseId);
|
||||
return Ok.of(((Case) caseService.saveEvidence(caseInfo).get(0)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 法制审核(原分析研判)
|
||||
*
|
||||
* @param caseId 案件id
|
||||
* @param caseInfo 案件实体
|
||||
* @return 案件实体
|
||||
*/
|
||||
@PutMapping("/fxyp/{caseId}")
|
||||
public Result<Case> fxyp(@PathVariable String caseId, @RequestBody Case caseInfo) {
|
||||
caseInfo.setCaseId(caseId);
|
||||
List<Object> fxyp = caseService.fxyp(caseInfo);
|
||||
if (!fxyp.isEmpty()) {
|
||||
return Ok.of((Case) fxyp.get(0));
|
||||
}
|
||||
return Ok.of();
|
||||
}
|
||||
|
||||
/**
|
||||
* 集体讨论
|
||||
*
|
||||
* @param caseId 案件id
|
||||
* @param caseInfo 案件实体
|
||||
* @return 案件实体
|
||||
*/
|
||||
@PutMapping("/discuss/{caseId}")
|
||||
public Result<Case> discuss(@PathVariable String caseId, @RequestBody Case caseInfo) {
|
||||
caseInfo.setCaseId(caseId);
|
||||
List<Object> fxyp = caseService.discuss(caseInfo);
|
||||
if (!fxyp.isEmpty()) {
|
||||
return Ok.of((Case) fxyp.get(0));
|
||||
}
|
||||
return Ok.of();
|
||||
}
|
||||
|
||||
/**
|
||||
* 告知
|
||||
*
|
||||
* @param caseId 案件id
|
||||
* @param caseInfo 案件实体
|
||||
* @return 案件实体
|
||||
*/
|
||||
@PutMapping("/inform/{caseId}")
|
||||
public Result<Case> inform(@PathVariable String caseId, @RequestBody Case caseInfo) {
|
||||
caseInfo.setCaseId(caseId);
|
||||
List<Object> o = caseService.inform(caseInfo);
|
||||
if (!o.isEmpty()) {
|
||||
return Ok.of((Case) o.get(0));
|
||||
}
|
||||
return Ok.of();
|
||||
}
|
||||
|
||||
/**
|
||||
* 案件 陈述申辩或听证
|
||||
* @param caseId 案件id
|
||||
* @param caseInfo 案件实体
|
||||
* @return 案件实体
|
||||
*/
|
||||
@PutMapping("/informsbtz/{caseId}")
|
||||
public Result<Case> informsbtz(@PathVariable String caseId, @RequestBody Case caseInfo) {
|
||||
caseInfo.setCaseId(caseId);
|
||||
List<Object> o = caseService.informsbtz(caseInfo);
|
||||
if (!o.isEmpty()) {
|
||||
return Ok.of((Case) o.get(0));
|
||||
}
|
||||
return Ok.of();
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成案卷文件并下载
|
||||
*
|
||||
* @param caseId 请求
|
||||
* @return 案件实体
|
||||
*/
|
||||
@GetMapping("/downloadDocument/{caseId}")
|
||||
public Result<Case> downloadDocument(@PathVariable String caseId) throws IOException {
|
||||
return Ok.of(caseService.exportPdf(caseId));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 立案上报
|
||||
*
|
||||
* @param caseId 案件id
|
||||
* @param caseInfo 案件实体
|
||||
* @return 案件实体
|
||||
*/
|
||||
@PutMapping("/updateSupplement/{caseId}")
|
||||
public Result<Case> updateSupplement(@PathVariable String caseId, @RequestBody Case caseInfo, @CurrentUser RemoteUserInfo user) {
|
||||
caseInfo.setCaseId(caseId);
|
||||
return Ok.of(caseService.saveSupplement(caseInfo, user));
|
||||
}
|
||||
|
||||
/**
|
||||
* 立案上报审核
|
||||
*
|
||||
* @param caseId 案件id
|
||||
* @param caseInfo 案件实体
|
||||
* @return 案件实体
|
||||
*/
|
||||
@PutMapping("/updateSupplementVerify/{caseId}")
|
||||
public Result<Case> updateSupplementVerify(@PathVariable String caseId, @RequestBody Case caseInfo, @CurrentUser RemoteUserInfo user) {
|
||||
caseInfo.setCaseId(caseId);
|
||||
return Ok.of(caseService.updateSupplementVerify(caseInfo, user));
|
||||
}
|
||||
|
||||
/**
|
||||
* 执法立案统计(不分页)
|
||||
*
|
||||
* @param query
|
||||
* @return 查询执法立案统计结果
|
||||
*/
|
||||
@GetMapping("/listZflatj")
|
||||
public Result<List<Case>> listZflatj(CaseQuery query, @CurrentUser RemoteUserInfo user) {
|
||||
return Ok.of(caseService.listZflatj(query, user));
|
||||
}
|
||||
|
||||
/**
|
||||
* 决定
|
||||
*
|
||||
* @param caseId 案件id
|
||||
* @param caseInfo 案件实体
|
||||
* @return 案件实体
|
||||
*/
|
||||
@PutMapping("/decided/{caseId}")
|
||||
public Result<Case> decided(@PathVariable String caseId, @RequestBody Case caseInfo) {
|
||||
caseInfo.setCaseId(caseId);
|
||||
List<Object> o = caseService.decided(caseInfo);
|
||||
if (!o.isEmpty()) {
|
||||
return Ok.of((Case) o.get(0));
|
||||
}
|
||||
return Ok.of();
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行
|
||||
*
|
||||
* @param caseInfo 案件实体
|
||||
* @return 案件实体
|
||||
*/
|
||||
@PutMapping("/execute")
|
||||
public Result execute(@RequestBody Case caseInfo) {
|
||||
caseService.execute(caseInfo);
|
||||
return Ok.of();
|
||||
}
|
||||
|
||||
/**
|
||||
* 结案
|
||||
*
|
||||
* @param caseInfo 案件实体
|
||||
* @return 案件实体
|
||||
*/
|
||||
@PutMapping("/finalcase")
|
||||
public Result finalCase(@RequestBody Case caseInfo) {
|
||||
caseService.finalCase(caseInfo);
|
||||
return Ok.of();
|
||||
}
|
||||
|
||||
/**
|
||||
* 案件统计
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/tj")
|
||||
public Result<Map> ajtj(@CurrentUser RemoteUserInfo user) {
|
||||
return Ok.of(caseService.ajtj(user));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,121 @@
|
|||
package com.aisino.iles.lawenforcement.controller;
|
||||
|
||||
import com.aisino.iles.common.model.Fail;
|
||||
import com.aisino.iles.common.model.Ok;
|
||||
import com.aisino.iles.common.model.PageResult;
|
||||
import com.aisino.iles.common.model.Result;
|
||||
import com.aisino.iles.common.util.Constants;
|
||||
import com.aisino.iles.core.annotation.CurrentUser;
|
||||
import com.aisino.iles.lawenforcement.model.CheckItem;
|
||||
import com.aisino.iles.lawenforcement.model.query.CheckItemQuery;
|
||||
import com.aisino.iles.lawenforcement.service.CheckItemService;
|
||||
import com.smartlx.sso.client.model.RemoteUserInfo;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 综合执法/检查事项
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(Constants.API_PREFIX + "/lawenforcement/checkItems")
|
||||
public class CheckItemController {
|
||||
|
||||
private final CheckItemService checkItemService;
|
||||
|
||||
public CheckItemController(CheckItemService checkItemService) {
|
||||
this.checkItemService = checkItemService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建检查项信息
|
||||
*
|
||||
* @param checkItem 检查项信息
|
||||
* @return 创建结果
|
||||
*/
|
||||
@PostMapping
|
||||
public Result<CheckItem> createCheckItem(@RequestBody CheckItem checkItem, @CurrentUser RemoteUserInfo user) {
|
||||
return Ok.of(checkItemService.saveCheckItem(checkItem, user, "add"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询检查项
|
||||
*
|
||||
* @param itemId 检查项ID
|
||||
* @return 检查项信息
|
||||
*/
|
||||
@GetMapping("/{itemId}")
|
||||
public Result<CheckItem> getCheckItemById(@PathVariable String itemId) {
|
||||
return checkItemService.findCheckItemById(itemId)
|
||||
.map(s -> (Result<CheckItem>) Ok.of(s))
|
||||
.orElse(Fail.of("检查项不存在"));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询检查项
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 分页检查项信息
|
||||
*/
|
||||
@GetMapping
|
||||
public PageResult<CheckItem> getCheckItemPage(CheckItemQuery query) {
|
||||
Page<CheckItem> page = checkItemService.findCheckItemPage(query);
|
||||
return PageResult.of(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新检查项
|
||||
*
|
||||
* @param itemId 检查项ID
|
||||
* @param checkItem 检查项信息
|
||||
* @return 更新结果
|
||||
*/
|
||||
@PutMapping("/{itemId}")
|
||||
public Result<CheckItem> updateCheckItem(@PathVariable String itemId, @RequestBody CheckItem checkItem, @CurrentUser RemoteUserInfo user) {
|
||||
if (!checkItemService.existsCheckItemById(itemId)) {
|
||||
return Fail.of("检查项不存在");
|
||||
}
|
||||
checkItem.setItemId(itemId);
|
||||
return Ok.of(checkItemService.saveCheckItem(checkItem, user, "up"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID删除检查项
|
||||
*
|
||||
* @param itemId 检查项ID
|
||||
* @return 删除结果
|
||||
*/
|
||||
@DeleteMapping("/{itemId}")
|
||||
public Result<Void> deleteCheckItemById(@PathVariable String itemId) {
|
||||
if (!checkItemService.existsCheckItemById(itemId)) {
|
||||
return Fail.of("检查项不存在");
|
||||
}
|
||||
checkItemService.deleteCheckItemById(itemId);
|
||||
return Ok.of();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除检查项
|
||||
*
|
||||
* @param itemIds 检查项ID列表
|
||||
* @return 删除结果
|
||||
*/
|
||||
@DeleteMapping
|
||||
public Result<Void> deleteCheckItemByIds(@RequestBody List<String> itemIds) {
|
||||
checkItemService.deleteCheckItemByIds(itemIds);
|
||||
return Ok.of();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询检查项列表
|
||||
*
|
||||
* @return 检查项信息列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public Result<List<CheckItem>> getCheckItems(CheckItemQuery query) {
|
||||
return Ok.of(checkItemService.findCheckItems(query));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,121 @@
|
|||
package com.aisino.iles.lawenforcement.controller;
|
||||
|
||||
import com.aisino.iles.common.model.Fail;
|
||||
import com.aisino.iles.common.model.Ok;
|
||||
import com.aisino.iles.common.model.PageResult;
|
||||
import com.aisino.iles.common.model.Result;
|
||||
import com.aisino.iles.common.util.Constants;
|
||||
import com.aisino.iles.core.annotation.CurrentUser;
|
||||
import com.aisino.iles.lawenforcement.model.Checklist;
|
||||
import com.aisino.iles.lawenforcement.model.query.ChecklistQuery;
|
||||
import com.aisino.iles.lawenforcement.service.ChecklistService;
|
||||
import com.smartlx.sso.client.model.RemoteUserInfo;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 综合执法/检查表
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(Constants.API_PREFIX + "/lawenforcement/checklists")
|
||||
public class ChecklistController {
|
||||
|
||||
private final ChecklistService checklistService;
|
||||
|
||||
public ChecklistController(ChecklistService checklistService) {
|
||||
this.checklistService = checklistService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建检查表信息
|
||||
*
|
||||
* @param checklist 检查表信息
|
||||
* @return 创建结果
|
||||
*/
|
||||
@PostMapping
|
||||
public Result<Checklist> createChecklist(@RequestBody Checklist checklist, @CurrentUser RemoteUserInfo user) {
|
||||
return Ok.of(checklistService.saveChecklist(checklist, user, "add"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询检查表
|
||||
*
|
||||
* @param checklistId 检查表ID
|
||||
* @return 检查表信息
|
||||
*/
|
||||
@GetMapping("/{checklistId}")
|
||||
public Result<Checklist> getChecklistById(@PathVariable String checklistId) {
|
||||
return checklistService.findChecklistById(checklistId)
|
||||
.map(s -> (Result<Checklist>) Ok.of(s))
|
||||
.orElse(Fail.of("检查表不存在"));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询检查表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 分页检查表信息
|
||||
*/
|
||||
@GetMapping
|
||||
public PageResult<Checklist> getChecklistPage(ChecklistQuery query) {
|
||||
Page<Checklist> page = checklistService.findChecklistPage(query);
|
||||
return PageResult.of(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询检查表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 检查表信息
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public Result<List<Checklist>> getChecklistList(ChecklistQuery query) {
|
||||
return Ok.of(checklistService.getChecklistList(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新检查表
|
||||
*
|
||||
* @param checklistId 检查表ID
|
||||
* @param checklist 检查表信息
|
||||
* @return 更新结果
|
||||
*/
|
||||
@PutMapping("/{checklistId}")
|
||||
public Result<Checklist> updateChecklist(@PathVariable String checklistId, @RequestBody Checklist checklist, @CurrentUser RemoteUserInfo user) {
|
||||
if (!checklistService.existsChecklistById(checklistId)) {
|
||||
return Fail.of("检查表不存在");
|
||||
}
|
||||
checklist.setChecklistId(checklistId);
|
||||
return Ok.of(checklistService.saveChecklist(checklist, user, "up"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID删除检查表
|
||||
*
|
||||
* @param checklistId 检查表ID
|
||||
* @return 删除结果
|
||||
*/
|
||||
@DeleteMapping("/{checklistId}")
|
||||
public Result<Void> deleteChecklistById(@PathVariable String checklistId) {
|
||||
if (!checklistService.existsChecklistById(checklistId)) {
|
||||
return Fail.of("检查表不存在");
|
||||
}
|
||||
checklistService.deleteChecklistById(checklistId);
|
||||
return Ok.of();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除检查表
|
||||
*
|
||||
* @param checklistIds 检查表ID列表
|
||||
* @return 删除结果
|
||||
*/
|
||||
@DeleteMapping
|
||||
public Result<Void> deleteChecklistByIds(@RequestBody List<String> checklistIds) {
|
||||
checklistService.deleteChecklistByIds(checklistIds);
|
||||
return Ok.of();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,121 @@
|
|||
package com.aisino.iles.lawenforcement.controller;
|
||||
|
||||
import com.aisino.iles.common.model.Fail;
|
||||
import com.aisino.iles.common.model.Ok;
|
||||
import com.aisino.iles.common.model.PageResult;
|
||||
import com.aisino.iles.common.model.Result;
|
||||
import com.aisino.iles.common.util.Constants;
|
||||
import com.aisino.iles.core.annotation.CurrentUser;
|
||||
import com.aisino.iles.lawenforcement.model.DeliveryMethod;
|
||||
import com.aisino.iles.lawenforcement.model.query.DeliveryQuery;
|
||||
import com.aisino.iles.lawenforcement.service.DeliveryMethodService;
|
||||
import com.smartlx.sso.client.model.RemoteUserInfo;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 综合执法/文书送达方式
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(Constants.API_PREFIX + "/lawenforcement/deliveryMethods")
|
||||
public class DeliveryMethodController {
|
||||
|
||||
private final DeliveryMethodService deliveryMethodService;
|
||||
|
||||
public DeliveryMethodController(DeliveryMethodService deliveryMethodService) {
|
||||
this.deliveryMethodService = deliveryMethodService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建送达方式信息
|
||||
*
|
||||
* @param deliveryMethod 送达方式信息
|
||||
* @return 创建结果
|
||||
*/
|
||||
@PostMapping
|
||||
public Result<DeliveryMethod> createDeliveryMethod(@RequestBody DeliveryMethod deliveryMethod, @CurrentUser RemoteUserInfo user) {
|
||||
return Ok.of(deliveryMethodService.saveDeliveryMethod(deliveryMethod, user, "add"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询送达方式
|
||||
*
|
||||
* @param deliveryMethodId 送达方式ID
|
||||
* @return 送达方式信息
|
||||
*/
|
||||
@GetMapping("/{deliveryMethodId}")
|
||||
public Result<DeliveryMethod> getDeliveryMethodById(@PathVariable String deliveryMethodId) {
|
||||
return deliveryMethodService.findDeliveryMethodById(deliveryMethodId)
|
||||
.map(s -> (Result<DeliveryMethod>) Ok.of(s))
|
||||
.orElse(Fail.of("送达方式不存在"));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询送达方式
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 分页送达方式信息
|
||||
*/
|
||||
@GetMapping
|
||||
public PageResult<DeliveryMethod> getDeliveryMethodPage(DeliveryQuery query) {
|
||||
Page<DeliveryMethod> page = deliveryMethodService.findDeliveryMethodPage(query);
|
||||
return PageResult.of(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询送达方式
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 送达方式信息
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public Result<List<DeliveryMethod>> getDeliveryMethodList(DeliveryQuery query) {
|
||||
return Ok.of(deliveryMethodService.getDeliveryMethodList(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新送达方式
|
||||
*
|
||||
* @param deliveryMethodId 送达方式ID
|
||||
* @param deliveryMethod 送达方式信息
|
||||
* @return 更新结果
|
||||
*/
|
||||
@PutMapping("/{deliveryMethodId}")
|
||||
public Result<DeliveryMethod> updateDeliveryMethod(@PathVariable String deliveryMethodId, @RequestBody DeliveryMethod deliveryMethod, @CurrentUser RemoteUserInfo user) {
|
||||
if (!deliveryMethodService.existsDeliveryMethodById(deliveryMethodId)) {
|
||||
return Fail.of("送达方式不存在");
|
||||
}
|
||||
deliveryMethod.setDeliveryMethodId(deliveryMethodId);
|
||||
return Ok.of(deliveryMethodService.saveDeliveryMethod(deliveryMethod, user, "up"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID删除送达方式
|
||||
*
|
||||
* @param deliveryMethodId 送达方式ID
|
||||
* @return 删除结果
|
||||
*/
|
||||
@DeleteMapping("/{deliveryMethodId}")
|
||||
public Result<Void> deleteDeliveryMethodById(@PathVariable String deliveryMethodId) {
|
||||
if (!deliveryMethodService.existsDeliveryMethodById(deliveryMethodId)) {
|
||||
return Fail.of("送达方式不存在");
|
||||
}
|
||||
deliveryMethodService.deleteDeliveryMethodById(deliveryMethodId);
|
||||
return Ok.of();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除送达方式
|
||||
*
|
||||
* @param deliveryMethodIds 送达方式ID列表
|
||||
* @return 删除结果
|
||||
*/
|
||||
@DeleteMapping
|
||||
public Result<Void> deleteDeliveryMethodByIds(@RequestBody List<String> deliveryMethodIds) {
|
||||
deliveryMethodService.deleteDeliveryMethodByIds(deliveryMethodIds);
|
||||
return Ok.of();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,297 @@
|
|||
package com.aisino.iles.lawenforcement.controller;
|
||||
|
||||
import com.aisino.iles.common.model.Fail;
|
||||
import com.aisino.iles.common.model.Ok;
|
||||
import com.aisino.iles.common.model.PageResult;
|
||||
import com.aisino.iles.common.model.Result;
|
||||
import com.aisino.iles.common.util.BeanUtils;
|
||||
import com.aisino.iles.common.util.Constants;
|
||||
import com.aisino.iles.core.annotation.CurrentUser;
|
||||
import com.aisino.iles.lawenforcement.model.DeliveryRecord;
|
||||
import com.aisino.iles.lawenforcement.model.SmsSendRecord;
|
||||
import com.aisino.iles.lawenforcement.model.dto.DeliveryScenePicDto;
|
||||
import com.aisino.iles.lawenforcement.model.query.DeliveryQuery;
|
||||
import com.aisino.iles.lawenforcement.service.DeliveryRecordService;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.smartlx.sso.client.model.RemoteUserInfo;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 综合执法/文书送达记录
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(Constants.API_PREFIX + "/lawenforcement/deliveryRecords")
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class DeliveryRecordController {
|
||||
|
||||
private final DeliveryRecordService deliveryRecordService;
|
||||
|
||||
/**
|
||||
* 创建文书送达记录信息
|
||||
*
|
||||
* @param deliveryRecord 文书送达记录信息
|
||||
* @return 创建结果
|
||||
*/
|
||||
@PostMapping
|
||||
public Result<DeliveryRecord> createDeliveryRecord(@RequestBody DeliveryRecord deliveryRecord, @CurrentUser RemoteUserInfo user) {
|
||||
return Ok.of(deliveryRecordService.saveDeliveryRecord(deliveryRecord, user, "add"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询文书送达记录
|
||||
*
|
||||
* @param deliveryId 文书送达记录ID
|
||||
* @return 文书送达记录信息
|
||||
*/
|
||||
@GetMapping("/{deliveryId}")
|
||||
public Result<DeliveryRecord> getDeliveryRecordById(@PathVariable String deliveryId) {
|
||||
return deliveryRecordService.findDeliveryRecordById(deliveryId)
|
||||
.map(s -> (Result<DeliveryRecord>) Ok.of(s))
|
||||
.orElse(Fail.of("文书送达记录不存在"));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询文书送达记录
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 分页文书送达记录信息
|
||||
*/
|
||||
@GetMapping
|
||||
public PageResult<DeliveryRecord> getDeliveryRecordPage(DeliveryQuery query) {
|
||||
Page<DeliveryRecord> page = deliveryRecordService.findDeliveryRecordPage(query);
|
||||
return PageResult.of(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新文书送达记录
|
||||
*
|
||||
* @param deliveryId 文书送达记录ID
|
||||
* @param deliveryRecord 文书送达记录信息
|
||||
* @return 更新结果
|
||||
*/
|
||||
@PutMapping("/{deliveryId}")
|
||||
public Result<DeliveryRecord> updateDeliveryRecord(@PathVariable String deliveryId, @RequestBody DeliveryRecord deliveryRecord, @CurrentUser RemoteUserInfo user) {
|
||||
if (!deliveryRecordService.existsDeliveryRecordById(deliveryId)) {
|
||||
return Fail.of("文书送达记录不存在");
|
||||
}
|
||||
deliveryRecord.setDeliveryId(deliveryId);
|
||||
return Ok.of(deliveryRecordService.saveDeliveryRecord(deliveryRecord, user, "up"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID删除文书送达记录
|
||||
*
|
||||
* @param deliveryId 文书送达记录ID
|
||||
* @return 删除结果
|
||||
*/
|
||||
@DeleteMapping("/{deliveryId}")
|
||||
public Result<Void> deleteDeliveryRecordById(@PathVariable String deliveryId) {
|
||||
if (!deliveryRecordService.existsDeliveryRecordById(deliveryId)) {
|
||||
return Fail.of("文书送达记录不存在");
|
||||
}
|
||||
deliveryRecordService.deleteDeliveryRecordById(deliveryId);
|
||||
return Ok.of();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除文书送达记录
|
||||
*
|
||||
* @param deliveryIds 文书送达记录ID列表
|
||||
* @return 删除结果
|
||||
*/
|
||||
@DeleteMapping
|
||||
public Result<Void> deleteDeliveryRecordByIds(@RequestBody List<String> deliveryIds) {
|
||||
deliveryRecordService.deleteDeliveryRecordByIds(deliveryIds);
|
||||
return Ok.of();
|
||||
}
|
||||
|
||||
/**
|
||||
* 送达业务统计
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @param user 用户信息
|
||||
* @return 统计结果
|
||||
*/
|
||||
@GetMapping("/statistics")
|
||||
public Result<List<Map<String, Object>>> statistics(DeliveryQuery query, @CurrentUser RemoteUserInfo user) {
|
||||
return Ok.of(deliveryRecordService.statistics(query, user));
|
||||
}
|
||||
|
||||
/**
|
||||
* 下发短信通知叫应
|
||||
*
|
||||
* @param deliveryIds 文书送达记录ID列表
|
||||
* @param user 用户信息
|
||||
* @return ok
|
||||
*/
|
||||
@PostMapping("/publishSMSCall")
|
||||
public Result<Void> publishSmsCall(@RequestBody List<String> deliveryIds, @CurrentUser RemoteUserInfo user) {
|
||||
deliveryRecordService.publishSmsCall(deliveryIds, user);
|
||||
return Ok.of();
|
||||
}
|
||||
|
||||
/**
|
||||
* 下发机器人语音叫应
|
||||
*
|
||||
* @param deliveryRecord 文书送达记录
|
||||
* @param user 用户信息
|
||||
* @return ok
|
||||
*/
|
||||
@PostMapping("/publishVoiceCall")
|
||||
public Result<Void> publishVoiceCall(@RequestBody DeliveryRecord deliveryRecord, @CurrentUser RemoteUserInfo user) {
|
||||
deliveryRecordService.publishVoiceCall(deliveryRecord, user);
|
||||
return Ok.of();
|
||||
}
|
||||
|
||||
/**
|
||||
* 短信状态推送回调接口
|
||||
* 接收短信状态反馈
|
||||
* 推送参数示例:
|
||||
* {
|
||||
* "JYBH": "dc641e51b11d499eb5de4aadae5f1724",
|
||||
* "RYBH": "001",
|
||||
* "RYXM": "张三",
|
||||
* "YDDH": "17532147896",
|
||||
* "TZZT": {
|
||||
* "CODE": "02",
|
||||
* "DESC": "已读"
|
||||
* },
|
||||
* "TZSJ": "2024-05-22 21:43:10",
|
||||
* "TZSM": ""
|
||||
* }
|
||||
* <p>
|
||||
* 返回示例:
|
||||
* {
|
||||
* "code": 0,
|
||||
* "msg": "请求成功"
|
||||
* }
|
||||
*/
|
||||
@PostMapping("/smsStatusCallback")
|
||||
public ResponseEntity<SmsStatusCallbackResponse> smsStatusCallback(@RequestBody SmsStatusCallbackRequest callbackRequest) {
|
||||
log.info("Received SMS status callback: {}", callbackRequest);
|
||||
SmsSendRecord smsSendRecord = new SmsSendRecord();
|
||||
BeanUtils.copyProperties(callbackRequest, smsSendRecord);
|
||||
if (null != callbackRequest.getTzzt()) {
|
||||
smsSendRecord.setTzztCode(callbackRequest.getTzzt().getCode());
|
||||
smsSendRecord.setTzztDesc(callbackRequest.getTzzt().getDesc());
|
||||
}
|
||||
deliveryRecordService.smsStatusCallback(smsSendRecord);
|
||||
// 在这里可以添加处理逻辑,如记录日志、更新状态等
|
||||
SmsStatusCallbackResponse response = new SmsStatusCallbackResponse();
|
||||
response.setCode(0);
|
||||
response.setMsg("请求成功");
|
||||
return ResponseEntity.ok(response);
|
||||
}
|
||||
|
||||
// 用于描述通知状态信息 01-未读, 02-已读, 03-已反馈, 04-已完结, 0401-已完成, 0402-已退回
|
||||
@Data
|
||||
public static class StatusInfo {
|
||||
/**
|
||||
* 状态码, 必填, String
|
||||
*/
|
||||
@JsonProperty("CODE")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 状态描述, 必填, String
|
||||
*/
|
||||
@JsonProperty("DESC")
|
||||
private String desc;
|
||||
}
|
||||
|
||||
// DTO定义:短信状态推送回调请求数据实体
|
||||
@Data
|
||||
public static class SmsStatusCallbackRequest {
|
||||
/**
|
||||
* 叫应编号, 必填, String
|
||||
*/
|
||||
@JsonProperty("JYBH")
|
||||
private String jybh;
|
||||
|
||||
/**
|
||||
* 人员编号, 必填, String
|
||||
*/
|
||||
@JsonProperty("RYBH")
|
||||
private String rybh;
|
||||
|
||||
/**
|
||||
* 人员姓名, 必填, String
|
||||
*/
|
||||
@JsonProperty("RYXM")
|
||||
private String ryxm;
|
||||
|
||||
/**
|
||||
* 移动电话, 必填, String
|
||||
*/
|
||||
@JsonProperty("YDDH")
|
||||
private String yddh;
|
||||
|
||||
/**
|
||||
* 通知状态, 必填, Object 类型, 包含 CODE 与 DESC
|
||||
*/
|
||||
@JsonProperty("TZZT")
|
||||
private StatusInfo tzzt;
|
||||
|
||||
/**
|
||||
* 通知结果, 可选, Object 类型
|
||||
*/
|
||||
@JsonProperty("TZJG")
|
||||
private String tzjg;
|
||||
|
||||
/**
|
||||
* 通知时间, 必填, String, 格式:yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
@JsonProperty("TZSJ")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime tzsj;
|
||||
|
||||
/**
|
||||
* 通知说明, 可选, String
|
||||
*/
|
||||
@JsonProperty("TZSM")
|
||||
private String tzsm;
|
||||
}
|
||||
|
||||
// DTO定义:回调接口响应数据实体
|
||||
@Data
|
||||
public static class SmsStatusCallbackResponse {
|
||||
/**
|
||||
* 结果码, 必填, Integer
|
||||
*/
|
||||
@JsonProperty("code")
|
||||
private Integer code;
|
||||
|
||||
/**
|
||||
* 结果信息, 必填, String
|
||||
*/
|
||||
@JsonProperty("msg")
|
||||
private String msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加现场图片
|
||||
*
|
||||
* @param scenePicDto 图片信息
|
||||
* @return 结果码
|
||||
*/
|
||||
@PostMapping("/addScenePic")
|
||||
@Validated(DeliveryScenePicDto.class)
|
||||
public Result<Void> addScenePic(DeliveryScenePicDto scenePicDto) {
|
||||
deliveryRecordService.addScenePic(scenePicDto);
|
||||
return Ok.of();
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue