dyh-service/dyh-base/src/main/java/cn/huge/base/common/constant/GzAreaEnum.java
New file @@ -0,0 +1,76 @@ package cn.huge.base.common.constant; /** * @title: 广州市区枚举类 * @description: 广州市区枚举类 * @company: hugeinfo * @author: liyj * @time: 2021-11-05 16:51:48 * @version: 1.0.0 */ public enum GzAreaEnum { GZEnum_0("1601","广州市"), GZAREAEnum_1("3633","天河区"), GZAREAEnum_2("3634","海珠区"), GZAREAEnum_3("3635","荔湾区"), GZAREAEnum_4("3637","越秀区"), GZAREAEnum_5("36953","番禺区"), GZAREAEnum_6("50256","花都区"), GZAREAEnum_7("50258","白云区"), GZAREAEnum_8("50259","南沙区"), GZAREAEnum_9("50283","黄埔区"), GZAREAEnum_10("50284","增城区"), GZAREAEnum_11("50285","从化区"); /** * 代码编号 */ private String index; /** * 名称 */ private String des; public String getIndex() { return index; } public void setIndex(String index) { this.index = index; } public String getDes() { return des; } public void setDes(String des) { this.des = des; } /** * 构造方法 * @param index * @param des */ GzAreaEnum(String index, String des) { this.index = index; this.des = des; } /** * 静态方法 * @param index * @return */ public static String getDes(String index) { for (GzAreaEnum constantEnum : GzAreaEnum.values()) { if (constantEnum.getIndex().equals(index)) { return constantEnum.des; } } return null; } } dyh-service/dyh-base/src/main/java/cn/huge/base/common/utils/BaiduOcrUtils.java
@@ -1,5 +1,6 @@ package cn.huge.base.common.utils; import com.baidu.aip.ocr.AipOcr; import com.google.common.collect.Maps; import org.json.JSONObject; @@ -88,11 +89,6 @@ JSONObject result = json.getJSONObject("words_result"); String sex = result.getJSONObject("性别").getString("words"); map.put("sex",sex); // if(sex.equals(CaseBaseConstsEnum.SEX_1.getDes())){ // map.put("sexName",CaseBaseConstsEnum.SEX_1.getIndex()); // }else{ // map.put("sexName",CaseBaseConstsEnum.SEX_2.getIndex()); // } String name = result.getJSONObject("姓名").getString("words"); map.put("trueName",name); String address = result.getJSONObject("住址").getString("words"); dyh-service/dyh-utils/src/main/java/cn/huge/module/cases/controller/CaseNoUtilsController.java
File was deleted dyh-service/dyh-utils/src/main/java/cn/huge/module/cases/dao/mapper/xml/CaseInfoMapper.xml
File was deleted dyh-service/dyh-utils/src/main/java/cn/huge/module/cases/service/CaseInfoService.java
File was deleted dyh-service/dyh-utils/src/main/java/cn/huge/module/common/controller/IdUtilsController.java
@@ -2,9 +2,7 @@ import cn.huge.base.common.utils.ReturnFailUtils; import cn.huge.base.common.utils.ReturnSucUtils; import cn.huge.module.common.utils.CaseIdUtils; import cn.huge.module.common.utils.CommonIdUtils; import cn.huge.module.common.utils.JudicIdUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -28,36 +26,6 @@ @Autowired(required = false) private HttpServletRequest request; /** * 案件id-获取时间Id,后四位常量 * @url {ctx}/common/api/idUtils/getCaseNewTimeId * @return Object */ @GetMapping("/getCaseNewTimeId") public Object getCaseNewTimeId() { try { return ReturnSucUtils.getRepInfo(CaseIdUtils.getNewTimeId()); } catch (Exception e) { return ReturnFailUtils.getRepInfo(); } } /** * 司法确认id-获取时间Id,后四位常量 * @url {ctx}/common/api/idUtils/getJudicNewTimeId * @return Object */ @GetMapping("/getJudicNewTimeId") public Object getJudicNewTimeId() { try { return ReturnSucUtils.getRepInfo(JudicIdUtils.getNewTimeId()); } catch (Exception e) { return ReturnFailUtils.getRepInfo(); } } /** dyh-service/dyh-utils/src/main/java/cn/huge/module/common/utils/CaseNoUtils.java
File was deleted dyh-service/dyh-utils/src/main/java/cn/huge/module/common/utils/CommonIdUtils.java
@@ -16,17 +16,17 @@ /** * 时间Id统计常量 */ private static int COUNT_NUM = 1000; private static int COUNT_NUM = 10000; /** * 时间Id统计常量,常量前缀 */ private static int SIGN_COUNT_NUM = 1000; private static int SIGN_COUNT_NUM = 10000; /** * 时间Id统计常量,常量后缀 */ private static int COUNT_NUM_SIGN = 1000; private static int COUNT_NUM_SIGN = 10000; /** * 获取时间Id,后四位常量 @@ -34,8 +34,8 @@ */ public synchronized static String getNewTimeId(){ String timeId = getNowTime() + (COUNT_NUM++); if(COUNT_NUM > 9999){ COUNT_NUM = 1000; if(COUNT_NUM > 99999){ COUNT_NUM = 10000; } timeId=timeId.substring(2, timeId.length()); return timeId; @@ -48,8 +48,8 @@ */ public synchronized static String getSignNewTimeId(String sign){ String timeId = getNowTime() + sign + (SIGN_COUNT_NUM++); if(SIGN_COUNT_NUM > 9999){ SIGN_COUNT_NUM = 1000; if(SIGN_COUNT_NUM > 99999){ SIGN_COUNT_NUM = 10000; } timeId=timeId.substring(2, timeId.length()); return timeId; @@ -62,8 +62,8 @@ */ public synchronized static String getNewTimeIdSign(String sign){ String timeId = getNowTime() + (COUNT_NUM_SIGN++) + sign; if(COUNT_NUM_SIGN > 9999){ COUNT_NUM_SIGN = 1000; if(COUNT_NUM_SIGN > 99999){ COUNT_NUM_SIGN = 10000; } timeId=timeId.substring(2, timeId.length()); return timeId; dyh-service/dyh-utils/src/main/java/cn/huge/module/cust/controller/client/CustUtilsController.java
New file @@ -0,0 +1,45 @@ package cn.huge.module.cust.controller.client; import cn.huge.base.common.utils.ReturnFailUtils; import cn.huge.base.common.utils.ReturnSucUtils; import cn.huge.module.cust.utils.CustIdUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; /** * @title: 公共参数-id工具接口api-cust服务专用 * @description: 公共参数-id工具接口api-cust服务专用 * @company: hugeinfo * @author: liyj * @time: 2022-04-29 10:12:39 * @version: 1.0.0 */ @Slf4j @RestController @RequestMapping("/api/client/custUtils") public class CustUtilsController { @Autowired(required = false) private HttpServletRequest request; /** * 公共id-获取时间Id,后四位常量 * @url {ctx}/api/client/custUtils/getNewTimeId * @return Object */ @GetMapping("/getNewTimeId") public Object getNewTimeId() { try { return ReturnSucUtils.getRepInfo(CustIdUtils.getNewTimeId()); } catch (Exception e) { return ReturnFailUtils.getRepInfo(); } } } dyh-service/dyh-utils/src/main/java/cn/huge/module/cust/utils/CustIdUtils.javacopy from dyh-service/dyh-utils/src/main/java/cn/huge/module/common/utils/JudicIdUtils.java copy to dyh-service/dyh-utils/src/main/java/cn/huge/module/cust/utils/CustIdUtils.java
File was copied from dyh-service/dyh-utils/src/main/java/cn/huge/module/common/utils/JudicIdUtils.java @@ -1,32 +1,32 @@ package cn.huge.module.common.utils; package cn.huge.module.cust.utils; import java.text.SimpleDateFormat; import java.util.Date; /** * @title: 司法确认ID生成工具 * @description: 司法确认ID生成工具 * @title: 公共ID生成工具 * @description: 公共ID生成工具 * @company: hugeinfo * @author: liyj * @time: 2021-11-05 16:51:48 * @version: 1.0.0 */ public class JudicIdUtils { public class CustIdUtils { /** * 时间Id统计常量 */ private static int COUNT_NUM = 1000; private static int COUNT_NUM = 10000; /** * 时间Id统计常量,常量前缀 */ private static int SIGN_COUNT_NUM = 1000; private static int SIGN_COUNT_NUM = 10000; /** * 时间Id统计常量,常量后缀 */ private static int COUNT_NUM_SIGN = 1000; private static int COUNT_NUM_SIGN = 10000; /** * 获取时间Id,后四位常量 @@ -34,8 +34,8 @@ */ public synchronized static String getNewTimeId(){ String timeId = getNowTime() + (COUNT_NUM++); if(COUNT_NUM > 9999){ COUNT_NUM = 1000; if(COUNT_NUM > 99999){ COUNT_NUM = 10000; } timeId=timeId.substring(2, timeId.length()); return timeId; @@ -48,8 +48,8 @@ */ public synchronized static String getSignNewTimeId(String sign){ String timeId = getNowTime() + sign + (SIGN_COUNT_NUM++); if(SIGN_COUNT_NUM > 9999){ SIGN_COUNT_NUM = 1000; if(SIGN_COUNT_NUM > 99999){ SIGN_COUNT_NUM = 10000; } timeId=timeId.substring(2, timeId.length()); return timeId; @@ -62,8 +62,8 @@ */ public synchronized static String getNewTimeIdSign(String sign){ String timeId = getNowTime() + (COUNT_NUM_SIGN++) + sign; if(COUNT_NUM_SIGN > 9999){ COUNT_NUM_SIGN = 1000; if(COUNT_NUM_SIGN > 99999){ COUNT_NUM_SIGN = 10000; } timeId=timeId.substring(2, timeId.length()); return timeId; dyh-service/dyh-utils/src/main/java/cn/huge/module/disp/controller/client/DispUtilsController.java
New file @@ -0,0 +1,45 @@ package cn.huge.module.disp.controller.client; import cn.huge.base.common.utils.ReturnFailUtils; import cn.huge.base.common.utils.ReturnSucUtils; import cn.huge.module.disp.utils.DispIdUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; /** * @title: 公共参数-id工具接口api-disp服务专用 * @description: 公共参数-id工具接口api-disp服务专用 * @company: hugeinfo * @author: liyj * @time: 2022-04-29 10:12:39 * @version: 1.0.0 */ @Slf4j @RestController @RequestMapping("/api/client/dispUtils") public class DispUtilsController { @Autowired(required = false) private HttpServletRequest request; /** * 公共id-获取时间Id,后四位常量 * @url {ctx}/api/client/dispUtils/getNewTimeId * @return Object */ @GetMapping("/getNewTimeId") public Object getNewTimeId() { try { return ReturnSucUtils.getRepInfo(DispIdUtils.getNewTimeId()); } catch (Exception e) { return ReturnFailUtils.getRepInfo(); } } } dyh-service/dyh-utils/src/main/java/cn/huge/module/disp/utils/DispIdUtils.javacopy from dyh-service/dyh-utils/src/main/java/cn/huge/module/common/utils/JudicIdUtils.java copy to dyh-service/dyh-utils/src/main/java/cn/huge/module/disp/utils/DispIdUtils.java
File was copied from dyh-service/dyh-utils/src/main/java/cn/huge/module/common/utils/JudicIdUtils.java @@ -1,32 +1,32 @@ package cn.huge.module.common.utils; package cn.huge.module.disp.utils; import java.text.SimpleDateFormat; import java.util.Date; /** * @title: 司法确认ID生成工具 * @description: 司法确认ID生成工具 * @title: 公共ID生成工具 * @description: 公共ID生成工具 * @company: hugeinfo * @author: liyj * @time: 2021-11-05 16:51:48 * @version: 1.0.0 */ public class JudicIdUtils { public class DispIdUtils { /** * 时间Id统计常量 */ private static int COUNT_NUM = 1000; private static int COUNT_NUM = 10000; /** * 时间Id统计常量,常量前缀 */ private static int SIGN_COUNT_NUM = 1000; private static int SIGN_COUNT_NUM = 10000; /** * 时间Id统计常量,常量后缀 */ private static int COUNT_NUM_SIGN = 1000; private static int COUNT_NUM_SIGN = 10000; /** * 获取时间Id,后四位常量 @@ -34,8 +34,8 @@ */ public synchronized static String getNewTimeId(){ String timeId = getNowTime() + (COUNT_NUM++); if(COUNT_NUM > 9999){ COUNT_NUM = 1000; if(COUNT_NUM > 99999){ COUNT_NUM = 10000; } timeId=timeId.substring(2, timeId.length()); return timeId; @@ -48,8 +48,8 @@ */ public synchronized static String getSignNewTimeId(String sign){ String timeId = getNowTime() + sign + (SIGN_COUNT_NUM++); if(SIGN_COUNT_NUM > 9999){ SIGN_COUNT_NUM = 1000; if(SIGN_COUNT_NUM > 99999){ SIGN_COUNT_NUM = 10000; } timeId=timeId.substring(2, timeId.length()); return timeId; @@ -62,8 +62,8 @@ */ public synchronized static String getNewTimeIdSign(String sign){ String timeId = getNowTime() + (COUNT_NUM_SIGN++) + sign; if(COUNT_NUM_SIGN > 9999){ COUNT_NUM_SIGN = 1000; if(COUNT_NUM_SIGN > 99999){ COUNT_NUM_SIGN = 10000; } timeId=timeId.substring(2, timeId.length()); return timeId; dyh-service/dyh-utils/src/main/java/cn/huge/module/judic/controller/JudicNoUtilsController.java
File was deleted dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/controller/client/MediateUtilsController.java
New file @@ -0,0 +1,193 @@ package cn.huge.module.mediate.controller.client; import cn.huge.base.common.constant.GzAreaEnum; import cn.huge.base.common.utils.DateUtils; import cn.huge.base.common.utils.ReturnFailUtils; import cn.huge.base.common.utils.ReturnSucUtils; import cn.huge.module.mediate.service.CaseInfoService; import cn.huge.module.mediate.service.JudicInfoService; import cn.huge.module.mediate.utils.*; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; import java.text.SimpleDateFormat; import java.util.Date; /** * @title: 公共参数-id工具接口api-mediate服务专用 * @description: 公共参数-id工具接口api-mediate服务专用 * @company: hugeinfo * @author: liyj * @time: 2022-04-29 10:12:39 * @version: 1.0.0 */ @Slf4j @RestController @RequestMapping("/api/client/mediateUtils") public class MediateUtilsController { @Autowired(required = false) private HttpServletRequest request; @Autowired private CaseInfoService caseInfoService; @Autowired private JudicInfoService judicInfoService; /** * 公共id-获取时间Id,后四位常量 * @url {ctx}/api/client/mediateUtils/getNewTimeId * @return Object */ @GetMapping("/getNewTimeId") public Object getNewTimeId() { try { return ReturnSucUtils.getRepInfo(MediateIdUtils.getNewTimeId()); } catch (Exception e) { return ReturnFailUtils.getRepInfo(); } } /** * 案件id-获取时间Id,后四位常量 * @url {ctx}/api/client/mediateUtils/getNewTimeCaseId * @return Object */ @GetMapping("/getNewTimeCaseId") public Object getNewTimeCaseId() { try { return ReturnSucUtils.getRepInfo(CaseIdUtils.getNewTimeId()); } catch (Exception e) { return ReturnFailUtils.getRepInfo(); } } /** * 生成新的调解案号 * @url {ctx}/api/client/mediateUtils/createCaseNo * @param area 区 * @return Object */ @GetMapping("/createCaseNo") public Object createCaseNo(@RequestParam(value = "area") String area) { try { if (CaseNoUtils.getFlag(area)){ int year = DateUtils.getYear(new Date()); String caseNoLogo = caseInfoService.getCaseNoLogo(area); if (StringUtils.isEmpty(caseNoLogo)){ caseNoLogo = caseInfoService.getCaseNoLogo(GzAreaEnum.GZEnum_0.getIndex()); } String caseNoPrefix = "(" + year + ")"+caseNoLogo; String newCaseNo = caseInfoService.getNewCaseNo(caseNoPrefix); if(StringUtils.isBlank(newCaseNo)){ newCaseNo = "0"; } String numStr = newCaseNo.replace(caseNoPrefix, "").replace("号", ""); int num = Integer.parseInt(numStr); CaseNoUtils.setCount(area, num); CaseNoUtils.setFlag(area, false); } return ReturnSucUtils.getRepInfo(CaseNoUtils.getCaseNo(area)); } catch (Exception e) { return ReturnFailUtils.getRepInfo(); } } /** * 从startNo(包括startNo)开始生成新的调解案号 * @url {ctx}/common/api/caseNoUtils/setCaseNoByStartNo * @return Object */ @GetMapping("/setCaseNoByStartNo") public Object setCaseNoByStartNo(@RequestParam(value = "area") String area, @RequestParam(value = "startNo") int startNo) { try { CaseNoUtils.setCount(area, startNo-1); CaseNoUtils.setFlag(area, false); return ReturnSucUtils.getRepInfo(); } catch (Exception e) { return ReturnFailUtils.getRepInfo(); } } /** * 生成新的事项编号 * @url {ctx}/common/api/caseNoUtils/createCaseRef * @return Object */ @GetMapping("/createCaseRef") public Object createCaseRef() { try { return ReturnSucUtils.getRepInfo(CaseRefUtils.getCaseRef()); } catch (Exception e) { return ReturnFailUtils.getRepInfo(); } } /** * 司法确认id-获取时间Id,后四位常量 * @url {ctx}/api/client/mediateUtils/getNewTimeJudicId * @return Object */ @GetMapping("/getNewTimeJudicId") public Object getNewTimeJudicId() { try { return ReturnSucUtils.getRepInfo(JudicIdUtils.getNewTimeId()); } catch (Exception e) { return ReturnFailUtils.getRepInfo(); } } /** * 生成新的调解案号 * @url {ctx}/api/client/mediateUtils/createJudicNo * @param custId 客户编号 * @return Object */ @GetMapping("/createJudicNo") public Object createJudicNo(@RequestParam(value = "custId") String custId) { try { if (JudicNoUtils.JUDIC_NO_FALG){ int year = DateUtils.getYear(new Date()); String judicNoPrefix = "(" + year + ")司法确认"; String newJudicNo = judicInfoService.getNewJudicNo(judicNoPrefix, custId); if(StringUtils.isBlank(newJudicNo)){ newJudicNo = "0"; } String numStr = newJudicNo.replace(judicNoPrefix, "").replace("号", ""); int num = Integer.parseInt(numStr); JudicNoUtils.JUDIC_NO_SIGN = num; JudicNoUtils.JUDIC_NO_FALG = false; } return ReturnSucUtils.getRepInfo(JudicNoUtils.getJudicNo()); } catch (Exception e) { return ReturnFailUtils.getRepInfo(); } } /** * 从startNo(包括startNo)开始生成新的司法确认号 * @url {ctx}/api/client/mediateUtils/setJudicByStartNo * @return Object */ @GetMapping("/setJudicByStartNo") public Object setJudicByStartNo(@RequestParam(value = "startNo") int startNo) { try { JudicNoUtils.JUDIC_NO_SIGN = startNo-1; JudicNoUtils.JUDIC_NO_FALG = false; return ReturnSucUtils.getRepInfo(); } catch (Exception e) { return ReturnFailUtils.getRepInfo(); } } } dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/dao/mapper/CaseInfoMapper.java
File was renamed from dyh-service/dyh-utils/src/main/java/cn/huge/module/cases/dao/mapper/CaseInfoMapper.java @@ -1,4 +1,4 @@ package cn.huge.module.cases.dao.mapper; package cn.huge.module.mediate.dao.mapper; import org.apache.ibatis.annotations.Param; @@ -18,8 +18,21 @@ /** * 获取最新的案号 * @param caseNoPrefix 案号前缀 * @param custId 客户编号 * @return */ String getNewCaseNo(@Param("caseNoPrefix") String caseNoPrefix, @Param("custId") String custId); String getNewCaseNo(@Param("caseNoPrefix") String caseNoPrefix); /** * 获取最新的事项编号 * @param caseRefPrefix 事项编号前缀 * @return */ Integer getNewCaseRef(@Param("caseRefPrefix") String caseRefPrefix); /** * 获取各区调解案号标识 * @param area 区 * @return */ String getCaseNoLogo(@Param("area") String area); } dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/dao/mapper/JudicInfoMapper.java
File was renamed from dyh-service/dyh-utils/src/main/java/cn/huge/module/judic/dao/mapper/JudicInfoMapper.java @@ -1,4 +1,4 @@ package cn.huge.module.judic.dao.mapper; package cn.huge.module.mediate.dao.mapper; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/dao/mapper/xml/CaseInfoMapper.xml
New file @@ -0,0 +1,38 @@ <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!-- * @title: 纠纷信息表 * @description: 自定义sql,请自行实现业务逻辑 * @company: hugeinfo * @author: liyj * @time:2023-04-04 14:10:21 * @version 1.0.0 --> <mapper namespace="cn.huge.module.mediate.dao.mapper.CaseInfoMapper"> <!-- 获取最新的案号 --> <select id="getNewCaseNo" resultType="string"> select case_no from dyh_case_info where case_no like concat('%', #{caseNoPrefix}, '%') and delete_status = 0 order by isnull(create_time), create_time desc limit 0, 1 </select> <!-- 获取最新的事项编号 --> <select id="getNewCaseRef" resultType="Integer"> select count(1) from dyh_case_info where delete_status = 0 </select> <!-- 获取各区调解案号标识 --> <select id="getCaseNoLogo" resultType="string"> SELECT logo FROM dyh_case_no_rule WHERE area = #{area} and delete_status = 0 </select> </mapper> dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/dao/mapper/xml/JudicInfoMapper.xml
File was renamed from dyh-service/dyh-utils/src/main/java/cn/huge/module/judic/dao/mapper/xml/JudicInfoMapper.xml @@ -8,7 +8,7 @@ * @time:2022-11-08 15:29:20 * @version 1.0.0 --> <mapper namespace="cn.huge.module.judic.dao.mapper.JudicInfoMapper"> <mapper namespace="cn.huge.module.mediate.dao.mapper.JudicInfoMapper"> <!-- 表 --> <sql id='table-name'>dyh_judic_info</sql> dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/service/CaseInfoService.java
New file @@ -0,0 +1,54 @@ package cn.huge.module.mediate.service; import cn.huge.module.mediate.dao.mapper.CaseInfoMapper; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; /** * @title: 纠纷信息表业务逻辑处理 * @Description JPA的单表数据查询以由BaseService完成 * @company hugeinfo * @author liyj * @Time 2022-03-11 11:43:25 * @version 1.0.0 */ @Slf4j @Service @Transactional(rollbackFor = Exception.class) public class CaseInfoService { @Autowired private CaseInfoMapper mapper; /** * 查询最新的调解案号 * @param caseNoPrefix 案号前缀 * @return */ public String getNewCaseNo(String caseNoPrefix){ return mapper.getNewCaseNo(caseNoPrefix); } /** * 获取最新的事项编号 * @param caseRefPrefix 事项编号前缀 * @return */ public Integer getNewCaseRef(String caseRefPrefix){ return mapper.getNewCaseRef(caseRefPrefix); } /** * 获取各区调解案号标识 * @param area 区 * @return */ public String getCaseNoLogo(String area){ return mapper.getCaseNoLogo(area); } } dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/service/JudicInfoService.java
File was renamed from dyh-service/dyh-utils/src/main/java/cn/huge/module/judic/service/JudicInfoService.java @@ -1,7 +1,7 @@ package cn.huge.module.judic.service; package cn.huge.module.mediate.service; import cn.huge.module.judic.dao.mapper.JudicInfoMapper; import cn.huge.module.mediate.dao.mapper.JudicInfoMapper; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/utils/CaseIdUtils.java
File was renamed from dyh-service/dyh-utils/src/main/java/cn/huge/module/common/utils/CaseIdUtils.java @@ -1,4 +1,4 @@ package cn.huge.module.common.utils; package cn.huge.module.mediate.utils; import org.apache.commons.lang3.StringUtils; @@ -21,17 +21,17 @@ /** * 时间Id统计常量 */ private static int COUNT_NUM = 1000; private static int COUNT_NUM = 10000; /** * 时间Id统计常量,常量前缀 */ private static int SIGN_COUNT_NUM = 1000; private static int SIGN_COUNT_NUM = 10000; /** * 时间Id统计常量,常量后缀 */ private static int COUNT_NUM_SIGN = 1000; private static int COUNT_NUM_SIGN = 10000; /** * 获取时间Id,后四位常量 @@ -39,8 +39,8 @@ */ public synchronized static String getNewTimeId(){ String timeId = getNowTime() + (COUNT_NUM++); if(COUNT_NUM > 9999){ COUNT_NUM = 1000; if(COUNT_NUM > 99999){ COUNT_NUM = 10000; } timeId=timeId.substring(2, timeId.length()); return timeId; @@ -53,8 +53,8 @@ */ public synchronized static String getSignNewTimeId(String sign){ String timeId = getNowTime() + sign + (SIGN_COUNT_NUM++); if(SIGN_COUNT_NUM > 9999){ SIGN_COUNT_NUM = 1000; if(SIGN_COUNT_NUM > 99999){ SIGN_COUNT_NUM = 10000; } timeId=timeId.substring(2, timeId.length()); return timeId; @@ -67,8 +67,8 @@ */ public synchronized static String getNewTimeIdSign(String sign){ String timeId = getNowTime() + (COUNT_NUM_SIGN++) + sign; if(COUNT_NUM_SIGN > 9999){ COUNT_NUM_SIGN = 1000; if(COUNT_NUM_SIGN > 99999){ COUNT_NUM_SIGN = 10000; } timeId=timeId.substring(2, timeId.length()); return timeId; dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/utils/CaseNoUtils.java
New file @@ -0,0 +1,263 @@ package cn.huge.module.mediate.utils; import cn.huge.base.common.constant.GzAreaEnum; import cn.huge.base.common.utils.DateUtils; /** * @title: 纠纷调解案号生成工具 * @description: 纠纷调解案号生成工具 * @company: hugeinfo * @author: liyj * @time: 2021-11-05 16:51:48 * @version: 1.0.0 */ public class CaseNoUtils { /** * 时间Id统计常量,常量后缀 */ public static int CASE_NO_COUNT_TH = 0; public static int CASE_NO_COUNT_HZ = 0; public static int CASE_NO_COUNT_LW = 0; public static int CASE_NO_COUNT_YX = 0; public static int CASE_NO_COUNT_PY = 0; public static int CASE_NO_COUNT_HD = 0; public static int CASE_NO_COUNT_BY = 0; public static int CASE_NO_COUNT_NS = 0; public static int CASE_NO_COUNT_HP = 0; public static int CASE_NO_COUNT_ZC = 0; public static int CASE_NO_COUNT_CH = 0; /** * 时间Id统计常量,常量后缀 */ public static String CASE_NO_SIGN_TH = ""; public static String CASE_NO_SIGN_HZ = ""; public static String CASE_NO_SIGN_LW = ""; public static String CASE_NO_SIGN_YX = ""; public static String CASE_NO_SIGN_PY = ""; public static String CASE_NO_SIGN_HD = ""; public static String CASE_NO_SIGN_BY = ""; public static String CASE_NO_SIGN_NS = ""; public static String CASE_NO_SIGN_HP = ""; public static String CASE_NO_SIGN_ZC = ""; public static String CASE_NO_SIGN_CH = ""; /** * 各区调解案号是否要重新查询 */ public static boolean CASE_NO_FLAG_TH = true; public static boolean CASE_NO_FLAG_HZ = true; public static boolean CASE_NO_FLAG_LW = true; public static boolean CASE_NO_FLAG_YX = true; public static boolean CASE_NO_FLAG_PY = true; public static boolean CASE_NO_FLAG_HD = true; public static boolean CASE_NO_FLAG_BY = true; public static boolean CASE_NO_FLAG_NS = true; public static boolean CASE_NO_FLAG_HP = true; public static boolean CASE_NO_FLAG_ZC = true; public static boolean CASE_NO_FLAG_CH = true; /** * 匹配不到各区,公共配置 */ public static int CASE_NO_COUNT = 0; public static String CASE_NO_SIGN = "穗智调"; public static boolean CASE_NO_FLAG = true; /** * 判断是否要重新查询 * @return */ public synchronized static Boolean getFlag(String area){ if (GzAreaEnum.GZAREAEnum_1.getIndex().equals(area)){ return CASE_NO_FLAG_TH; }else if (GzAreaEnum.GZAREAEnum_2.getIndex().equals(area)){ return CASE_NO_FLAG_HZ; }else if (GzAreaEnum.GZAREAEnum_3.getIndex().equals(area)){ return CASE_NO_FLAG_LW; }else if (GzAreaEnum.GZAREAEnum_4.getIndex().equals(area)){ return CASE_NO_FLAG_YX; }else if (GzAreaEnum.GZAREAEnum_5.getIndex().equals(area)){ return CASE_NO_FLAG_PY; }else if (GzAreaEnum.GZAREAEnum_6.getIndex().equals(area)){ return CASE_NO_FLAG_HD; }else if (GzAreaEnum.GZAREAEnum_7.getIndex().equals(area)){ return CASE_NO_FLAG_BY; }else if (GzAreaEnum.GZAREAEnum_8.getIndex().equals(area)){ return CASE_NO_FLAG_NS; }else if (GzAreaEnum.GZAREAEnum_9.getIndex().equals(area)){ return CASE_NO_FLAG_HP; }else if (GzAreaEnum.GZAREAEnum_10.getIndex().equals(area)){ return CASE_NO_FLAG_ZC; }else if (GzAreaEnum.GZAREAEnum_11.getIndex().equals(area)){ return CASE_NO_FLAG_CH; }else { return CASE_NO_FLAG; } } /** * 设置常量数 * @return */ public synchronized static void setCount(String area, int num){ if (GzAreaEnum.GZAREAEnum_1.getIndex().equals(area)){ CASE_NO_COUNT_TH = num; }else if (GzAreaEnum.GZAREAEnum_2.getIndex().equals(area)){ CASE_NO_COUNT_HZ = num; }else if (GzAreaEnum.GZAREAEnum_3.getIndex().equals(area)){ CASE_NO_COUNT_LW = num; }else if (GzAreaEnum.GZAREAEnum_4.getIndex().equals(area)){ CASE_NO_COUNT_YX = num; }else if (GzAreaEnum.GZAREAEnum_5.getIndex().equals(area)){ CASE_NO_COUNT_PY = num; }else if (GzAreaEnum.GZAREAEnum_6.getIndex().equals(area)){ CASE_NO_COUNT_HD = num; }else if (GzAreaEnum.GZAREAEnum_7.getIndex().equals(area)){ CASE_NO_COUNT_BY = num; }else if (GzAreaEnum.GZAREAEnum_8.getIndex().equals(area)){ CASE_NO_COUNT_NS = num; }else if (GzAreaEnum.GZAREAEnum_9.getIndex().equals(area)){ CASE_NO_COUNT_HP = num; }else if (GzAreaEnum.GZAREAEnum_10.getIndex().equals(area)){ CASE_NO_COUNT_ZC = num; }else if (GzAreaEnum.GZAREAEnum_11.getIndex().equals(area)){ CASE_NO_COUNT_CH = num; }else { CASE_NO_COUNT = num; } } /** * 设置是否要重新查询 * @return */ public synchronized static void setFlag(String area, boolean flag){ if (GzAreaEnum.GZAREAEnum_1.getIndex().equals(area)){ CASE_NO_FLAG_TH = flag; }else if (GzAreaEnum.GZAREAEnum_2.getIndex().equals(area)){ CASE_NO_FLAG_HZ = flag; }else if (GzAreaEnum.GZAREAEnum_3.getIndex().equals(area)){ CASE_NO_FLAG_LW = flag; }else if (GzAreaEnum.GZAREAEnum_4.getIndex().equals(area)){ CASE_NO_FLAG_YX = flag; }else if (GzAreaEnum.GZAREAEnum_5.getIndex().equals(area)){ CASE_NO_FLAG_PY = flag; }else if (GzAreaEnum.GZAREAEnum_6.getIndex().equals(area)){ CASE_NO_FLAG_HD = flag; }else if (GzAreaEnum.GZAREAEnum_7.getIndex().equals(area)){ CASE_NO_FLAG_BY = flag; }else if (GzAreaEnum.GZAREAEnum_8.getIndex().equals(area)){ CASE_NO_FLAG_NS = flag; }else if (GzAreaEnum.GZAREAEnum_9.getIndex().equals(area)){ CASE_NO_FLAG_HP = flag; }else if (GzAreaEnum.GZAREAEnum_10.getIndex().equals(area)){ CASE_NO_FLAG_ZC = flag; }else if (GzAreaEnum.GZAREAEnum_11.getIndex().equals(area)){ CASE_NO_FLAG_CH = flag; }else { CASE_NO_FLAG = flag; } } /** * 设置是否要重新查询 * @return */ public synchronized static void setSign(String area, String logo){ if (GzAreaEnum.GZAREAEnum_1.getIndex().equals(area)){ CASE_NO_SIGN_TH = logo; }else if (GzAreaEnum.GZAREAEnum_2.getIndex().equals(area)){ CASE_NO_SIGN_HZ = logo; }else if (GzAreaEnum.GZAREAEnum_3.getIndex().equals(area)){ CASE_NO_SIGN_LW = logo; }else if (GzAreaEnum.GZAREAEnum_4.getIndex().equals(area)){ CASE_NO_SIGN_YX = logo; }else if (GzAreaEnum.GZAREAEnum_5.getIndex().equals(area)){ CASE_NO_SIGN_PY = logo; }else if (GzAreaEnum.GZAREAEnum_6.getIndex().equals(area)){ CASE_NO_SIGN_HD = logo; }else if (GzAreaEnum.GZAREAEnum_7.getIndex().equals(area)){ CASE_NO_SIGN_BY = logo; }else if (GzAreaEnum.GZAREAEnum_8.getIndex().equals(area)){ CASE_NO_SIGN_NS = logo; }else if (GzAreaEnum.GZAREAEnum_9.getIndex().equals(area)){ CASE_NO_SIGN_HP = logo; }else if (GzAreaEnum.GZAREAEnum_10.getIndex().equals(area)){ CASE_NO_SIGN_ZC = logo; }else if (GzAreaEnum.GZAREAEnum_11.getIndex().equals(area)){ CASE_NO_SIGN_CH = logo; } } /** * 获取粤云调号 * @return */ public synchronized static String getCaseNo(String area){ int year = DateUtils.getYear(DateUtils.getNowDate()); String cloudCaseNo = ""; if (GzAreaEnum.GZAREAEnum_1.getIndex().equals(area)){ CASE_NO_COUNT_TH += 1; cloudCaseNo = "(" + year + ")"+ CASE_NO_SIGN_TH + (CASE_NO_COUNT_TH) + "号"; }else if (GzAreaEnum.GZAREAEnum_2.getIndex().equals(area)){ CASE_NO_COUNT_HZ += 1; cloudCaseNo = "(" + year + ")"+ CASE_NO_SIGN_HZ + (CASE_NO_COUNT_HZ) + "号"; }else if (GzAreaEnum.GZAREAEnum_3.getIndex().equals(area)){ CASE_NO_COUNT_LW += 1; cloudCaseNo = "(" + year + ")"+ CASE_NO_SIGN_LW + (CASE_NO_COUNT_LW) + "号"; }else if (GzAreaEnum.GZAREAEnum_4.getIndex().equals(area)){ CASE_NO_COUNT_YX += 1; cloudCaseNo = "(" + year + ")"+ CASE_NO_SIGN_YX + (CASE_NO_COUNT_YX) + "号"; }else if (GzAreaEnum.GZAREAEnum_5.getIndex().equals(area)){ CASE_NO_COUNT_PY += 1; cloudCaseNo = "(" + year + ")"+ CASE_NO_SIGN_PY + (CASE_NO_COUNT_PY) + "号"; }else if (GzAreaEnum.GZAREAEnum_6.getIndex().equals(area)){ CASE_NO_COUNT_HD += 1; cloudCaseNo = "(" + year + ")"+ CASE_NO_SIGN_HD + (CASE_NO_COUNT_HD) + "号"; }else if (GzAreaEnum.GZAREAEnum_7.getIndex().equals(area)){ CASE_NO_COUNT_BY += 1; cloudCaseNo = "(" + year + ")"+ CASE_NO_SIGN_BY + (CASE_NO_COUNT_BY) + "号"; }else if (GzAreaEnum.GZAREAEnum_8.getIndex().equals(area)){ CASE_NO_COUNT_NS += 1; cloudCaseNo = "(" + year + ")"+ CASE_NO_SIGN_NS + (CASE_NO_COUNT_NS) + "号"; }else if (GzAreaEnum.GZAREAEnum_9.getIndex().equals(area)){ CASE_NO_COUNT_HP += 1; cloudCaseNo = "(" + year + ")"+ CASE_NO_SIGN_HP + (CASE_NO_COUNT_HP) + "号"; }else if (GzAreaEnum.GZAREAEnum_10.getIndex().equals(area)){ CASE_NO_COUNT_ZC += 1; cloudCaseNo = "(" + year + ")"+ CASE_NO_SIGN_ZC + (CASE_NO_COUNT_ZC) + "号"; }else if (GzAreaEnum.GZAREAEnum_11.getIndex().equals(area)) { CASE_NO_COUNT_CH += 1; cloudCaseNo = "(" + year + ")"+ CASE_NO_SIGN_CH + (CASE_NO_COUNT_CH) + "号"; }else { CASE_NO_COUNT += 1; cloudCaseNo = "(" + year + ")"+ CASE_NO_SIGN + (CASE_NO_COUNT) + "号"; } System.out.println(cloudCaseNo); return cloudCaseNo; } } /** * -------------------_ooOoo_------------------- * ------------------o8888888o------------------ * ------------------88" . "88------------------ * ------------------(| -_- |)------------------ * ------------------O\ = /O------------------ * ---------------____/`---'\____--------------- * -------------.' \\| |// `.------------- * ------------/ \\||| : |||// \------------ * -----------/ _||||| -:- |||||- \----------- * -----------| | \\\ - /// | |----------- * -----------| \_| ''\---/'' | |----------- * -----------\ .-\__ `-` ___/-. /----------- * ---------___`. .' /--.--\ `. . __---------- * ------."" '< `.___\_<|>_/___.' >'"".------- * -----| | : `- \`.;`\ _ /`;.`/ - ` : | |----- * -----\ \ `-. \_ __\ /__ _/ .-` / /----- * ======`-.____`-.___\_____/___.-`____.-'====== * -------------------`=---=' * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ * ---------佛祖保佑---hugeinfo---永无BUG---------- */ dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/utils/CaseRefUtils.java
New file @@ -0,0 +1,79 @@ package cn.huge.module.mediate.utils; import cn.huge.base.common.constant.GzAreaEnum; import cn.huge.base.common.utils.DateUtils; import java.text.SimpleDateFormat; import java.util.Date; /** * @title: 事项编号生成工具 * @description: 事项编号生成工具 * @company: hugeinfo * @author: liyj * @time: 2021-11-05 16:51:48 * @version: 1.0.0 */ public class CaseRefUtils { /** * 时间Id统计常量,常量后缀 */ public static int CASE_REF_COUNT = 10000; /** * 时间Id统计常量,常量后缀 */ public static String CASE_REF_SIGN = "GZ"; /** * 各区调解案号是否要重新查询 */ public static boolean CASE_REF_FLAG = true; /** * 获取粤云调号 * @return */ public synchronized static String getCaseRef(){ String timeId = getNowTime() + (CASE_REF_COUNT++); if(CASE_REF_COUNT > 99999){ CASE_REF_COUNT = 10000; } String cloudCaseRef = CASE_REF_SIGN + timeId.substring(2, timeId.length()); System.out.println(cloudCaseRef); return cloudCaseRef; } /** * 获取时间Id,后四位常量 * @return String */ public synchronized static String getNowTime(){ SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); String nowTime = sdf.format(new Date()); return nowTime; } } /** * -------------------_ooOoo_------------------- * ------------------o8888888o------------------ * ------------------88" . "88------------------ * ------------------(| -_- |)------------------ * ------------------O\ = /O------------------ * ---------------____/`---'\____--------------- * -------------.' \\| |// `.------------- * ------------/ \\||| : |||// \------------ * -----------/ _||||| -:- |||||- \----------- * -----------| | \\\ - /// | |----------- * -----------| \_| ''\---/'' | |----------- * -----------\ .-\__ `-` ___/-. /----------- * ---------___`. .' /--.--\ `. . __---------- * ------."" '< `.___\_<|>_/___.' >'"".------- * -----| | : `- \`.;`\ _ /`;.`/ - ` : | |----- * -----\ \ `-. \_ __\ /__ _/ .-` / /----- * ======`-.____`-.___\_____/___.-`____.-'====== * -------------------`=---=' * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ * ---------佛祖保佑---hugeinfo---永无BUG---------- */ dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/utils/JudicIdUtils.java
File was renamed from dyh-service/dyh-utils/src/main/java/cn/huge/module/common/utils/JudicIdUtils.java @@ -1,4 +1,4 @@ package cn.huge.module.common.utils; package cn.huge.module.mediate.utils; import java.text.SimpleDateFormat; import java.util.Date; @@ -16,17 +16,17 @@ /** * 时间Id统计常量 */ private static int COUNT_NUM = 1000; private static int COUNT_NUM = 10000; /** * 时间Id统计常量,常量前缀 */ private static int SIGN_COUNT_NUM = 1000; private static int SIGN_COUNT_NUM = 10000; /** * 时间Id统计常量,常量后缀 */ private static int COUNT_NUM_SIGN = 1000; private static int COUNT_NUM_SIGN = 10000; /** * 获取时间Id,后四位常量 @@ -34,8 +34,8 @@ */ public synchronized static String getNewTimeId(){ String timeId = getNowTime() + (COUNT_NUM++); if(COUNT_NUM > 9999){ COUNT_NUM = 1000; if(COUNT_NUM > 99999){ COUNT_NUM = 10000; } timeId=timeId.substring(2, timeId.length()); return timeId; @@ -48,8 +48,8 @@ */ public synchronized static String getSignNewTimeId(String sign){ String timeId = getNowTime() + sign + (SIGN_COUNT_NUM++); if(SIGN_COUNT_NUM > 9999){ SIGN_COUNT_NUM = 1000; if(SIGN_COUNT_NUM > 99999){ SIGN_COUNT_NUM = 10000; } timeId=timeId.substring(2, timeId.length()); return timeId; @@ -62,8 +62,8 @@ */ public synchronized static String getNewTimeIdSign(String sign){ String timeId = getNowTime() + (COUNT_NUM_SIGN++) + sign; if(COUNT_NUM_SIGN > 9999){ COUNT_NUM_SIGN = 1000; if(COUNT_NUM_SIGN > 99999){ COUNT_NUM_SIGN = 10000; } timeId=timeId.substring(2, timeId.length()); return timeId; dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/utils/JudicNoUtils.java
File was renamed from dyh-service/dyh-utils/src/main/java/cn/huge/module/common/utils/JudicNoUtils.java @@ -1,4 +1,4 @@ package cn.huge.module.common.utils; package cn.huge.module.mediate.utils; import cn.huge.base.common.utils.DateUtils; dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/utils/MediateIdUtils.javacopy from dyh-service/dyh-utils/src/main/java/cn/huge/module/common/utils/JudicIdUtils.java copy to dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/utils/MediateIdUtils.java
File was copied from dyh-service/dyh-utils/src/main/java/cn/huge/module/common/utils/JudicIdUtils.java @@ -1,32 +1,32 @@ package cn.huge.module.common.utils; package cn.huge.module.mediate.utils; import java.text.SimpleDateFormat; import java.util.Date; /** * @title: 司法确认ID生成工具 * @description: 司法确认ID生成工具 * @title: 公共ID生成工具 * @description: 公共ID生成工具 * @company: hugeinfo * @author: liyj * @time: 2021-11-05 16:51:48 * @version: 1.0.0 */ public class JudicIdUtils { public class MediateIdUtils { /** * 时间Id统计常量 */ private static int COUNT_NUM = 1000; private static int COUNT_NUM = 10000; /** * 时间Id统计常量,常量前缀 */ private static int SIGN_COUNT_NUM = 1000; private static int SIGN_COUNT_NUM = 10000; /** * 时间Id统计常量,常量后缀 */ private static int COUNT_NUM_SIGN = 1000; private static int COUNT_NUM_SIGN = 10000; /** * 获取时间Id,后四位常量 @@ -34,8 +34,8 @@ */ public synchronized static String getNewTimeId(){ String timeId = getNowTime() + (COUNT_NUM++); if(COUNT_NUM > 9999){ COUNT_NUM = 1000; if(COUNT_NUM > 99999){ COUNT_NUM = 10000; } timeId=timeId.substring(2, timeId.length()); return timeId; @@ -48,8 +48,8 @@ */ public synchronized static String getSignNewTimeId(String sign){ String timeId = getNowTime() + sign + (SIGN_COUNT_NUM++); if(SIGN_COUNT_NUM > 9999){ SIGN_COUNT_NUM = 1000; if(SIGN_COUNT_NUM > 99999){ SIGN_COUNT_NUM = 10000; } timeId=timeId.substring(2, timeId.length()); return timeId; @@ -62,8 +62,8 @@ */ public synchronized static String getNewTimeIdSign(String sign){ String timeId = getNowTime() + (COUNT_NUM_SIGN++) + sign; if(COUNT_NUM_SIGN > 9999){ COUNT_NUM_SIGN = 1000; if(COUNT_NUM_SIGN > 99999){ COUNT_NUM_SIGN = 10000; } timeId=timeId.substring(2, timeId.length()); return timeId;