Commit 12f07d62 authored by 赵啸非's avatar 赵啸非

添加同步办件进度查询

parent d3f9be7e
......@@ -381,3 +381,63 @@ INSERT INTO `mortals_sys_area` VALUES (null, ',gde17ba11bbf48568547c21b174c8a32'
INSERT INTO `mortals_sys_area` VALUES (null, ',gde17ba11bbf48568547c21b174c8a32', '福善镇', 'abe17ba11bbf48568547c21b174c8a32', 'gde17ba11bbf48568547c21b174c8a32', 'True', 'True', 'false', 'false', '511715282000', 4, '福善镇', 'dzsgxjscyy.sczwfw.gov.cn', 1, '2025-03-20 10:20:10', NULL, '2025-03-20 10:20:10');
INSERT INTO `mortals_sys_area` VALUES (null, ',gde17ba11bbf48568547c21b174c8a32', '安仁乡', 'abf17ba11bbf48568547c21b174c8a32', 'gde17ba11bbf48568547c21b174c8a32', 'True', 'True', 'false', 'false', '511715414000', 4, '安仁乡', 'dzsgxjscyy.sczwfw.gov.cn', 1, '2025-03-20 10:20:10', NULL, '2025-03-20 10:20:10');
-- ----------------------------
-- 办件结果表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_sys_process_result`;
CREATE TABLE `mortals_sys_process_result` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '序号,主键,自增长',
`site_id` bigint(20) NULL DEFAULT NULL COMMENT '站点id',
`site_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点名称',
`area_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '区域编码',
`area_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '区域名称',
`id_for_str` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '字符串id',
`event_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '事件id',
`event_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '事件编码',
`event_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '事件名称',
`affair_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '业务编码',
`applicant_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '应用名称',
`apply_date` datetime DEFAULT NULL COMMENT '申请时间',
`create_timestamp` datetime DEFAULT NULL COMMENT '创建时间',
`dept_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '部门编码',
`dept_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '部门名称',
`yJ_dept_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '一体化部门编码',
`yJ_dept_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '一体化部门名称',
`handle_status` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '办理状态',
`handle_status_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '办理状态名称',
`sys_source` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '来源',
`delete_flag` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '删除标志',
`remark` varchar(255) DEFAULT '' COMMENT '备注',
`create_user_id` bigint(20) DEFAULT NULL COMMENT '创建用户',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='办件结果';
-- ----------------------------
-- 办件统计表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_sys_dowork_stat`;
CREATE TABLE `mortals_sys_dowork_stat` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`site_id` bigint(20) NULL DEFAULT NULL COMMENT '站点id',
`site_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点名称',
`area_code` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '区域编码',
`area_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '区域名称',
`waitTime` int(9) DEFAULT '0' COMMENT '平均等待时间,单位s',
`matter_num` int(9) NOT NULL COMMENT '事项数量',
`dowork_num` int(9) NOT NULL COMMENT '业务办结总量',
`satisfaction_rate` varchar(32) NOT NULL COMMENT '满意率',
`year` int(9) NOT NULL COMMENT '年',
`month` int(9) NOT NULL COMMENT '月',
`day` int(9) NOT NULL COMMENT '日',
`create_user_id` bigint(20) DEFAULT NULL COMMENT '创建用户',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
,KEY `year` (`year`) USING BTREE
,KEY `month` (`month`) USING BTREE
,KEY `day` (`day`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='办件统计';
package com.mortals.xhx.busiz.rsp;
import lombok.Data;
/**
* @author karlhoo
*/
@Data
public class ApiZwfwResp<T> {
/**
* 结果编码
*/
private int code;
/**
* 结果描述
*/
private String msg;
protected Boolean success;
/**
* 响应数据
*/
private T data;
}
......@@ -369,6 +369,32 @@ public class MatterHtmlParseUtil {
System.out.println(JSON.toJSONString(rest1));
*/
//创建 sign https://tftb.sczwfw.gov.cn:8085/api/jmas-api-gateway-server/createsign.do
//参数
//app_id gysqfyjqyyapp
//interface_id tjtyjk
//version 1.0
//header {}
//biz_content {"code":"511722000000"}
//charset UTF-8
//timestamp 1749537093014
//origin 1
//统计接口1 https://tftb.sczwfw.gov.cn:8085/api/jmas-api-gateway-server/gateway.do
//app_id gysqfyjqyyapp
//interface_id tjtyjk
//version 1.0
//header {}
//biz_content {"code":"511722000000"}
//charset UTF-8
//timestamp 1749537093014
//origin 1
//sign v8ehGvo/ZG47wZQU3Trp/bWfUCIdHwVH1JqSU9rx1A2NYUZNMicXDyuMbguxMUXaYpy69zpJuYtrPCzuw0CWHZnfpT3bx0iygtDfqaQrZtemCVnGaLWXLYOxr9cZMC1FFbSXkJuqbaLej+k/tonBj1my7MPpEeYLHN9mx5rbQM4=
//办结进度 https://zxbl.sczwfw.gov.cn/app/affairPublicity/getMainData/v3
}
......
......@@ -85,6 +85,7 @@ public class BusinessController extends BaseCRUDJsonBodyMappingController<Busine
* 查询业务扁平结构
*/
@PostMapping(value = "flatList")
@UnAuth
public String flatList(@RequestBody BusinessEntity query) {
JSONObject jsonObject = new JSONObject();
Map<String, Object> model = new HashMap<>();
......
package com.mortals.xhx.module.dowork.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.dowork.model.DoworkStatEntity;
import java.util.List;
/**
* 办件统计Dao
* 办件统计 DAO接口
*
* @author zxfei
* @date 2025-06-10
*/
public interface DoworkStatDao extends ICRUDDao<DoworkStatEntity,Long>{
}
package com.mortals.xhx.module.dowork.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.dowork.dao.DoworkStatDao;
import com.mortals.xhx.module.dowork.model.DoworkStatEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 办件统计DaoImpl DAO接口
*
* @author zxfei
* @date 2025-06-10
*/
@Repository("doworkStatDao")
public class DoworkStatDaoImpl extends BaseCRUDDaoMybatis<DoworkStatEntity,Long> implements DoworkStatDao {
}
package com.mortals.xhx.module.dowork.model;
import com.mortals.framework.common.Rest;
import lombok.Data;
import org.apache.poi.ss.formula.functions.T;
@Data
public class DoworkInfo<T> {
private String ifResult;
private String msgId;
private T ifResultInfo;
}
package com.mortals.xhx.module.dowork.model;
import lombok.Data;
@Data
public class DoworkSign<T> {
private T sign;
}
package com.mortals.xhx.module.dowork.model;
import java.util.List;
import java.util.ArrayList;
import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.dowork.model.vo.DoworkStatVo;
import lombok.Data;
/**
* 办件统计实体对象
*
* @author zxfei
* @date 2025-06-10
*/
@Data
public class DoworkStatEntity extends DoworkStatVo {
private static final long serialVersionUID = 1L;
/**
* 站点id
*/
private Long siteId;
/**
* 站点名称
*/
private String siteName;
/**
* 区域编码
*/
private String areaCode;
/**
* 区域名称
*/
private String areaName;
/**
* 平均等待时间,单位s
*/
private Integer waitTime;
/**
* 事项数量
*/
private Integer matterNum;
/**
* 业务办结总量
*/
private Integer doworkNum;
/**
* 满意率
*/
private String satisfactionRate;
/**
* 年
*/
private Integer year;
/**
* 月
*/
private Integer month;
/**
* 日
*/
private Integer day;
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof DoworkStatEntity) {
DoworkStatEntity tmp = (DoworkStatEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public void initAttrValue(){
this.siteId = null;
this.siteName = "";
this.areaCode = "";
this.areaName = "";
this.waitTime = 0;
this.matterNum = 0;
this.doworkNum = 0;
this.satisfactionRate = "";
this.year = null;
this.month = null;
this.day = null;
}
}
\ No newline at end of file
package com.mortals.xhx.module.dowork.model;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.busiz.rsp.ApiResp;
import com.mortals.xhx.busiz.rsp.ApiZwfwResp;
import lombok.Data;
import java.util.List;
import java.util.Map;
@Data
public class DoworkStatInfo {
private String month;
private Integer apply;
private Integer review;
private Integer conclude;
private Integer accept;
private Integer matter;
private Integer activeReview;
private String activeReviewRate;
private String satisfiedRate;
public static void main(String[] args) {
String statInfo = "{\n" +
" \"success\": true,\n" +
" \"code\": 200,\n" +
" \"msg\": \"请求成功\",\n" +
" \"data\": \"{\\\"ifResult\\\":\\\"0\\\",\\\"ifResultInfo\\\":\\\"{\\\\\\\"code\\\\\\\":200,\\\\\\\"msg\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"data\\\\\\\":{\\\\\\\"matter\\\\\\\":17671,\\\\\\\"apply\\\\\\\":11079,\\\\\\\"accept\\\\\\\":10969,\\\\\\\"conclude\\\\\\\":10958,\\\\\\\"review\\\\\\\":7004,\\\\\\\"activeReview\\\\\\\":6995,\\\\\\\"activeReviewRate\\\\\\\":99.87,\\\\\\\"satisfiedRate\\\\\\\":100.0}}\\\",\\\"msgId\\\":\\\"\\\"}\"\n" +
"}";
// ApiResp
ApiZwfwResp<String> apiZwfwResp = JSON.parseObject(statInfo, new TypeReference<ApiZwfwResp<String>>() {
});
System.out.println(apiZwfwResp.getData());
String data = apiZwfwResp.getData();
DoworkInfo<String> doworkInfoResp = JSON.parseObject(data, new TypeReference<DoworkInfo<String>>() {
});
System.out.println(doworkInfoResp.getIfResultInfo());
String ifResultInfo = doworkInfoResp.getIfResultInfo();
Rest<DoworkStatInfo> doworkStatInfoRest = JSON.parseObject(ifResultInfo, new TypeReference<Rest<DoworkStatInfo>>() {
});
System.out.println(doworkStatInfoRest.getData().getAccept());
String statMonthsInfo = "{\n" +
" \"success\": true,\n" +
" \"code\": 200,\n" +
" \"msg\": \"请求成功\",\n" +
" \"data\": \"{\\\"ifResult\\\":\\\"0\\\",\\\"ifResultInfo\\\":\\\"{\\\\\\\"code\\\\\\\":200,\\\\\\\"msg\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"data\\\\\\\":[{\\\\\\\"month\\\\\\\":\\\\\\\"2024年12月\\\\\\\",\\\\\\\"apply\\\\\\\":22526,\\\\\\\"review\\\\\\\":19146,\\\\\\\"conclude\\\\\\\":22485,\\\\\\\"accept\\\\\\\":22450},{\\\\\\\"month\\\\\\\":\\\\\\\"2025年01月\\\\\\\",\\\\\\\"apply\\\\\\\":26590,\\\\\\\"review\\\\\\\":23820,\\\\\\\"conclude\\\\\\\":26532,\\\\\\\"accept\\\\\\\":26563},{\\\\\\\"month\\\\\\\":\\\\\\\"2025年02月\\\\\\\",\\\\\\\"apply\\\\\\\":28372,\\\\\\\"review\\\\\\\":21842,\\\\\\\"conclude\\\\\\\":28382,\\\\\\\"accept\\\\\\\":28359},{\\\\\\\"month\\\\\\\":\\\\\\\"2025年03月\\\\\\\",\\\\\\\"apply\\\\\\\":18886,\\\\\\\"review\\\\\\\":14840,\\\\\\\"conclude\\\\\\\":18854,\\\\\\\"accept\\\\\\\":18855},{\\\\\\\"month\\\\\\\":\\\\\\\"2025年04月\\\\\\\",\\\\\\\"apply\\\\\\\":17006,\\\\\\\"review\\\\\\\":13586,\\\\\\\"conclude\\\\\\\":16972,\\\\\\\"accept\\\\\\\":16983},{\\\\\\\"month\\\\\\\":\\\\\\\"2025年05月\\\\\\\",\\\\\\\"apply\\\\\\\":11079,\\\\\\\"review\\\\\\\":7004,\\\\\\\"conclude\\\\\\\":10958,\\\\\\\"accept\\\\\\\":10969}]}\\\",\\\"msgId\\\":\\\"\\\"}\"\n" +
"}";
}
}
package com.mortals.xhx.module.dowork.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.dowork.model.DoworkStatEntity;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import com.mortals.framework.annotation.Excel;
import java.math.BigDecimal;
import java.util.Date;
/**
* 办件统计视图对象
*
* @author zxfei
* @date 2025-06-10
*/
@Data
public class DoworkStatVo extends BaseEntityLong {
/** ID列表 */
private List <Long> idList;
}
\ No newline at end of file
package com.mortals.xhx.module.dowork.service;
import com.mortals.framework.common.Rest;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.dowork.model.DoworkStatEntity;
import com.mortals.xhx.module.dowork.dao.DoworkStatDao;
import java.util.List;
/**
* DoworkStatService
* <p>
* 办件统计 service接口
*
* @author zxfei
* @date 2025-06-10
*/
public interface DoworkStatService extends ICRUDService<DoworkStatEntity, Long> {
DoworkStatDao getDao();
/**
* 同步查询结果
*
* @param entity
* @return
*/
Rest<List<DoworkStatEntity>> queryListForWeb(DoworkStatEntity entity);
/**
* 同步查询当月结果
*
* @param entity
* @return
*/
Rest<DoworkStatEntity> getForWeb(DoworkStatEntity entity);
}
\ No newline at end of file
package com.mortals.xhx.module.dowork.service.impl;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.PageInfo;
import com.mortals.xhx.busiz.rsp.ApiZwfwResp;
import com.mortals.xhx.module.dowork.model.*;
import org.springframework.beans.BeanUtils;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.function.Function;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.xhx.module.dowork.dao.DoworkStatDao;
import com.mortals.xhx.module.dowork.service.DoworkStatService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ObjectUtils;
/**
* DoworkStatService
* 办件统计 service实现
*
* @author zxfei
* @date 2025-06-10
*/
@Service("doworkStatService")
@Slf4j
public class DoworkStatServiceImpl extends AbstractCRUDServiceImpl<DoworkStatDao, DoworkStatEntity, Long> implements DoworkStatService {
@Value("${statUrl:https://tftb.sczwfw.gov.cn:8085}")
private String statUrl;
@Override
public Rest<List<DoworkStatEntity>> queryListForWeb(DoworkStatEntity entity) {
//创建 sign https://tftb.sczwfw.gov.cn:8085/api/jmas-api-gateway-server/createsign.do
String path = "/api/jmas-api-gateway-server/createsign.do";
String areaCode = entity.getAreaCode();
HashMap<String, Object> paramsMap = new HashMap<>();
paramsMap.put("app_id", "gysqfyjqyyapp");
paramsMap.put("interface_id", "zj6ytjjk");
paramsMap.put("version", "1.0");
paramsMap.put("biz_content", "{\"code\":\"" + entity.getAreaCode() + "\"}");
paramsMap.put("charset", "UTF-8");
paramsMap.put("timestamp", new Date().getTime() + "");
paramsMap.put("origin", "1");
String resp = HttpUtil.post(statUrl + path, paramsMap);
log.info("resp:{}", resp);
ApiZwfwResp<DoworkSign<String>> apiZwfwSignResp = JSON.parseObject(resp, new TypeReference<ApiZwfwResp<DoworkSign<String>>>() {
});
if (apiZwfwSignResp.getSuccess()) {
String sign = apiZwfwSignResp.getData().getSign();
//通过sign 请求
String gatePath = "/api/jmas-api-gateway-server/gateway.do";
paramsMap.put("sign", sign);
resp = HttpUtil.post(statUrl + gatePath, paramsMap);
ApiZwfwResp<String> apiZwfwResp = JSON.parseObject(resp, new TypeReference<ApiZwfwResp<String>>() {
});
if (apiZwfwResp.getSuccess()) {
String data = apiZwfwResp.getData();
DoworkInfo<String> doworkInfoResp = JSON.parseObject(data, new TypeReference<DoworkInfo<String>>() {
});
if ("0".equals(doworkInfoResp.getIfResult())) {
String ifResultInfo = doworkInfoResp.getIfResultInfo();
Rest<List<DoworkStatInfo>> doworkStatInfoRest = JSON.parseObject(ifResultInfo, new TypeReference<Rest<List<DoworkStatInfo>>>() {
});
if (doworkStatInfoRest.getCode() == 200) {
List<DoworkStatInfo> list = doworkStatInfoRest.getData();
for (DoworkStatInfo doworkStatInfo : list) {
String month = doworkStatInfo.getMonth();
DateTime date = DateUtil.parse(month, "yyyy年MM月");
int months = date.month() + 1;
int year = date.year();
DoworkStatEntity doworkStatEntity = this.selectOne(new DoworkStatQuery().areaCode(areaCode).year(year).month(months));
if (!ObjectUtils.isEmpty(doworkStatEntity)) {
doworkStatEntity.setDoworkNum(doworkStatInfo.getConclude());
this.update(doworkStatEntity);
} else {
doworkStatEntity = new DoworkStatEntity();
doworkStatEntity.initAttrValue();
doworkStatEntity.setYear(year);
doworkStatEntity.setMonth(months);
doworkStatEntity.setAreaCode(areaCode);
doworkStatEntity.setDoworkNum(doworkStatInfo.getConclude());
this.save(doworkStatEntity);
}
}
} else {
return Rest.fail(doworkStatInfoRest.getMsg());
}
} else {
return Rest.fail(apiZwfwResp.getMsg());
}
} else {
return Rest.fail(apiZwfwResp.getMsg());
}
}
return Rest.ok();
}
@Override
public Rest<DoworkStatEntity> getForWeb(DoworkStatEntity entity) {
//创建 sign https://tftb.sczwfw.gov.cn:8085/api/jmas-api-gateway-server/createsign.do
String path = "/api/jmas-api-gateway-server/createsign.do";
String areaCode = entity.getAreaCode();
HashMap<String, Object> paramsMap = new HashMap<>();
paramsMap.put("app_id", "gysqfyjqyyapp");
paramsMap.put("interface_id", "tjtyjk");
paramsMap.put("version", "1.0");
paramsMap.put("biz_content", "{\"code\":\"" + areaCode + "\"}");
paramsMap.put("charset", "UTF-8");
paramsMap.put("timestamp", new Date().getTime() + "");
paramsMap.put("origin", "1");
String resp = HttpUtil.post(statUrl + path, paramsMap);
log.info("resp:{}", resp);
ApiZwfwResp<DoworkSign<String>> apiZwfwSignResp = JSON.parseObject(resp, new TypeReference<ApiZwfwResp<DoworkSign<String>>>() {
});
if (apiZwfwSignResp.getSuccess()) {
String sign = apiZwfwSignResp.getData().getSign();
//通过sign 请求
String gatePath = "/api/jmas-api-gateway-server/gateway.do";
paramsMap.put("sign", sign);
resp = HttpUtil.post(statUrl + gatePath, paramsMap);
ApiZwfwResp<String> apiZwfwResp = JSON.parseObject(resp, new TypeReference<ApiZwfwResp<String>>() {
});
if (apiZwfwResp.getSuccess()) {
String data = apiZwfwResp.getData();
DoworkInfo<String> doworkInfoResp = JSON.parseObject(data, new TypeReference<DoworkInfo<String>>() {
});
if ("0".equals(doworkInfoResp.getIfResult())) {
String ifResultInfo = doworkInfoResp.getIfResultInfo();
Rest<DoworkStatInfo> doworkStatInfoRest = JSON.parseObject(ifResultInfo, new TypeReference<Rest<DoworkStatInfo>>() {
});
if (doworkStatInfoRest.getCode() == 200) {
DoworkStatInfo doworkStatInfo = doworkStatInfoRest.getData();
//更新记录
int year = DateUtil.year(new Date());
int month = DateUtil.month(new Date()) + 1;
DoworkStatEntity doworkStatEntity = this.selectOne(new DoworkStatQuery().areaCode(areaCode).year(year).month(month));
if (!ObjectUtils.isEmpty(doworkStatEntity)) {
doworkStatEntity.setMatterNum(doworkStatInfo.getMatter());
doworkStatEntity.setSatisfactionRate(doworkStatInfo.getSatisfiedRate());
doworkStatEntity.setDoworkNum(doworkStatInfo.getConclude());
this.update(doworkStatEntity);
} else {
doworkStatEntity = new DoworkStatEntity();
doworkStatEntity.initAttrValue();
doworkStatEntity.setYear(year);
doworkStatEntity.setMonth(month);
doworkStatEntity.setAreaCode(areaCode);
doworkStatEntity.setMatterNum(doworkStatInfo.getMatter());
doworkStatEntity.setSatisfactionRate(doworkStatInfo.getSatisfiedRate());
doworkStatEntity.setDoworkNum(doworkStatInfo.getConclude());
this.save(doworkStatEntity);
}
} else {
return Rest.fail(doworkStatInfoRest.getMsg());
}
} else {
return Rest.fail(doworkInfoResp.getIfResultInfo());
}
} else {
return Rest.fail(apiZwfwResp.getMsg());
}
}
return Rest.ok();
}
}
\ No newline at end of file
package com.mortals.xhx.module.dowork.web;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.dowork.model.DoworkStatEntity;
import com.mortals.xhx.module.dowork.service.DoworkStatService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
import com.mortals.xhx.common.code.*;
/**
*
* 办件统计
*
* @author zxfei
* @date 2025-06-10
*/
@RestController
@RequestMapping("dowork/stat")
public class DoworkStatController extends BaseCRUDJsonBodyMappingController<DoworkStatService,DoworkStatEntity,Long> {
@Autowired
private ParamService paramService;
public DoworkStatController(){
super.setModuleDesc( "办件统计");
}
@Override
protected void doListBefore(DoworkStatEntity query, Map<String, Object> model, Context context) throws AppException {
//todo 去请求外网 同步数据到数据库。
super.doListBefore(query, model, context);
}
@Override
protected void init(Map<String, Object> model, Context context) {
super.init(model, context);
}
}
\ No newline at end of file
package com.mortals.xhx.module.process.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.process.model.ProcessResultEntity;
import java.util.List;
/**
* 办件结果Dao
* 办件结果 DAO接口
*
* @author zxfei
* @date 2025-06-10
*/
public interface ProcessResultDao extends ICRUDDao<ProcessResultEntity,Long>{
}
package com.mortals.xhx.module.process.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.process.dao.ProcessResultDao;
import com.mortals.xhx.module.process.model.ProcessResultEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 办件结果DaoImpl DAO接口
*
* @author zxfei
* @date 2025-06-10
*/
@Repository("processResultDao")
public class ProcessResultDaoImpl extends BaseCRUDDaoMybatis<ProcessResultEntity,Long> implements ProcessResultDao {
}
package com.mortals.xhx.module.process.model;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.process.model.vo.ProcessResultVo;
import lombok.Data;
/**
* 办件结果实体对象
*
* @author zxfei
* @date 2025-06-10
*/
@Data
public class ProcessResultEntity extends ProcessResultVo {
private static final long serialVersionUID = 1L;
/**
* 站点id
*/
private Long siteId;
/**
* 站点名称
*/
private String siteName;
/**
* 区域编码
*/
private String areaCode;
/**
* 区域名称
*/
private String areaName;
/**
* 字符串id
*/
private String idForStr;
/**
* 事件id
*/
private String eventId;
/**
* 事件编码
*/
private String eventCode;
/**
* 事件名称
*/
private String eventName;
/**
* 业务编码
*/
private String affairCode;
/**
* 应用名称
*/
private String applicantName;
/**
* 申请时间
*/
private Date applyDate;
/**
* 创建时间
*/
private Date createTimestamp;
/**
* 部门编码
*/
private String deptCode;
/**
* 部门名称
*/
private String deptName;
/**
* 一体化部门编码
*/
private String yjDeptCode;
/**
* 一体化部门名称
*/
private String yjDeptName;
/**
* 办理状态
*/
private String handleStatus;
/**
* 办理状态名称
*/
private String handleStatusName;
/**
* 来源
*/
private String sysSource;
/**
* 删除标志
*/
private String deleteFlag;
/**
* 备注
*/
private String remark;
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof ProcessResultEntity) {
ProcessResultEntity tmp = (ProcessResultEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public void initAttrValue(){
this.siteId = null;
this.siteName = "";
this.areaCode = "";
this.areaName = "";
this.idForStr = "";
this.eventId = "";
this.eventCode = "";
this.eventName = "";
this.affairCode = "";
this.applicantName = "";
this.applyDate = null;
this.createTimestamp = null;
this.deptCode = "";
this.deptName = "";
this.yjDeptCode = "";
this.yjDeptName = "";
this.handleStatus = "";
this.handleStatusName = "";
this.sysSource = "";
this.deleteFlag = "";
this.remark = "";
}
}
\ No newline at end of file
package com.mortals.xhx.module.process.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.process.model.ProcessResultEntity;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import com.mortals.framework.annotation.Excel;
import java.math.BigDecimal;
import java.util.Date;
/**
* 办件结果视图对象
*
* @author zxfei
* @date 2025-06-10
*/
@Data
public class ProcessResultVo extends BaseEntityLong {
/** 序号,主键,自增长列表 */
private List <Long> idList;
}
\ No newline at end of file
package com.mortals.xhx.module.process.service;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.process.model.ProcessResultEntity;
import com.mortals.xhx.module.process.dao.ProcessResultDao;
/**
* ProcessResultService
*
* 办件结果 service接口
*
* @author zxfei
* @date 2025-06-10
*/
public interface ProcessResultService extends ICRUDService<ProcessResultEntity,Long>{
ProcessResultDao getDao();
}
\ No newline at end of file
package com.mortals.xhx.module.process.service.impl;
import com.mortals.framework.model.PageInfo;
import org.springframework.beans.BeanUtils;
import java.util.function.Function;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.xhx.module.process.dao.ProcessResultDao;
import com.mortals.xhx.module.process.model.ProcessResultEntity;
import com.mortals.xhx.module.process.service.ProcessResultService;
import lombok.extern.slf4j.Slf4j;
/**
* ProcessResultService
* 办件结果 service实现
*
* @author zxfei
* @date 2025-06-10
*/
@Service("processResultService")
@Slf4j
public class ProcessResultServiceImpl extends AbstractCRUDServiceImpl<ProcessResultDao, ProcessResultEntity, Long> implements ProcessResultService {
}
\ No newline at end of file
package com.mortals.xhx.module.process.web;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.process.model.ProcessResultEntity;
import com.mortals.xhx.module.process.service.ProcessResultService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
import com.mortals.xhx.common.code.*;
/**
*
* 办件结果
*
* @author zxfei
* @date 2025-06-10
*/
@RestController
@RequestMapping("process/result")
public class ProcessResultController extends BaseCRUDJsonBodyMappingController<ProcessResultService,ProcessResultEntity,Long> {
@Autowired
private ParamService paramService;
public ProcessResultController(){
super.setModuleDesc( "办件结果");
}
@Override
protected void init(Map<String, Object> model, Context context) {
super.init(model, context);
}
}
\ No newline at end of file
......@@ -112,6 +112,7 @@ public class SiteBusinessController extends BaseCRUDJsonBodyMappingController<Si
* 查询站点业务扁平结构
*/
@PostMapping(value = "flatList")
@UnAuth
public String flatList(@RequestBody SiteBusinessEntity query) {
JSONObject jsonObject = new JSONObject();
Map<String, Object> model = new HashMap<>();
......
###登录
POST {{baseUrl}}/login/login
Content-Type: application/json
{
"loginName":"admin",
"password":"admin",
"securityCode":"8888"
}
> {%
client.global.set("SmsSet_id", JSON.parse(response.body).data.id);
client.global.set("authToken", JSON.parse(response.body).data.token);
%}
###办件统计列表
POST {{baseUrl}}/dowork/stat/list
Content-Type: application/json
{
"page":1,
"size":10
}
###办件统计更新与保存
POST {{baseUrl}}/dowork/stat/save
Authorization: {{authToken}}
Content-Type: application/json
{
"siteId":855,
"siteName":"6bmJrQ",
"areaCode":"reqtx2",
"areaName":"dXwuTQ",
"waitTime":0,
"matterNum":132,
"doworkNum":478,
"satisfactionRate":"Tk8l8l",
"year":445,
"month":229,
"day":970,
}
> {%
client.global.set("DoworkStat_id", JSON.parse(response.body).data.id);
%}
###办件统计查看
GET {{baseUrl}}/dowork/stat/info?id=1
###办件统计编辑
GET {{baseUrl}}/dowork/stat/edit?id=1
Accept: application/json
###办件统计删除
GET {{baseUrl}}/dowork/stat/delete?id=1
Authorization: {{authToken}}
Accept: application/json
###登录
POST {{baseUrl}}/login/login
Content-Type: application/json
{
"loginName":"admin",
"password":"admin",
"securityCode":"8888"
}
> {%
client.global.set("SmsSet_id", JSON.parse(response.body).data.id);
client.global.set("authToken", JSON.parse(response.body).data.token);
%}
###办件结果列表
POST {{baseUrl}}/process/result/list
Content-Type: application/json
{
"page":1,
"size":10
}
###办件结果更新与保存
POST {{baseUrl}}/process/result/save
Authorization: {{authToken}}
Content-Type: application/json
{
"siteId":317,
"siteName":"cnJOzG",
"areaCode":"7DU6MC",
"areaName":"Lqcyok",
"idForStr":"1nT76c",
"eventId":"sM717L",
"eventCode":"Nlfets",
"eventName":"MwSHGK",
"affairCode":"GdHDPO",
"applicantName":"lvHlUE",
"applyDate":"1749484800000",
"createTimestamp":"1749484800000",
"deptCode":"is7zgq",
"deptName":"VcWdrm",
"yjDeptCode":"ViStBJ",
"yjDeptName":"MEFTwh",
"handleStatus":"a9H30I",
"handleStatusName":"tuMzlE",
"sysSource":"JD4VgO",
"deleteFlag":"g2fRu0",
"remark":"3vetq9",
}
> {%
client.global.set("ProcessResult_id", JSON.parse(response.body).data.id);
%}
###办件结果查看
GET {{baseUrl}}/process/result/info?id=1
###办件结果编辑
GET {{baseUrl}}/process/result/edit?id=1
Accept: application/json
###办件结果删除
GET {{baseUrl}}/process/result/delete?id=1
Authorization: {{authToken}}
Accept: application/json
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment