update 国内海外标准编号生成逻辑
This commit is contained in:
@@ -48,10 +48,10 @@ public class FieldCommon {
|
||||
public static final String YEAR_NUMBER = "year_number";
|
||||
// 标准名称
|
||||
public static final String STANDARD_NAME = "standard_name";
|
||||
// 国标
|
||||
public static final String GB = "GB";
|
||||
// 外标
|
||||
public static final String FB = "FB";
|
||||
// 标准类别
|
||||
public static final String STANDARD_CLASS = "standard_class";
|
||||
// 字典值统一后缀
|
||||
public static final String _DICT_TEXT = "_dictText";
|
||||
// 树节点编码
|
||||
public static final String NODE_CODE = "nodeCode";
|
||||
// 分隔符
|
||||
|
||||
+1
-1
@@ -90,5 +90,5 @@ public interface ILawsCommonService {
|
||||
* @Date: 2023/9/14 15:42
|
||||
* @Description: 生成法规编号
|
||||
**/
|
||||
void setStandardNumber(Map<String, Object> parameterMap, String type);
|
||||
void setStandardNumber(Map<String, Object> parameterMap);
|
||||
}
|
||||
|
||||
+7
-3
@@ -496,11 +496,16 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
||||
* @Description: 生成法规编号
|
||||
**/
|
||||
@Override
|
||||
public void setStandardNumber(Map<String, Object> parameterMap, String type) {
|
||||
public void setStandardNumber(Map<String, Object> parameterMap) {
|
||||
// 标准类别
|
||||
String standardClass = (String) parameterMap.get(FieldCommon.STANDARD_CLASS);
|
||||
// 法规编号不能为空
|
||||
String standardNumber = (String) parameterMap.get(FieldCommon.STANDARD_NUMBER);
|
||||
// 年代号
|
||||
String yearNumber = (String) parameterMap.get(FieldCommon.YEAR_NUMBER);
|
||||
if (StringUtils.isBlank(standardClass)) {
|
||||
throw new JeroBootException(ResultCommon.EMPTY_COMMON, FieldCommon.STANDARD_CLASS);
|
||||
}
|
||||
if (StringUtils.isBlank(standardNumber)) {
|
||||
throw new JeroBootException(ResultCommon.EMPTY_STANDARD_NUMBER, "");
|
||||
}
|
||||
@@ -508,8 +513,7 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
||||
throw new JeroBootException(ResultCommon.EMPTY_COMMON, FieldCommon.YEAR_NUMBER);
|
||||
}
|
||||
// 最后生成的法规编号
|
||||
standardNumber = type + standardNumber + "-" + yearNumber;
|
||||
|
||||
standardNumber = standardClass + standardNumber + "-" + yearNumber;
|
||||
parameterMap.put(FieldCommon.STANDARD_NUMBER, standardNumber);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ public class LawsDomesticController {
|
||||
@ApiOperation(value="国内法规标准-新增数据", notes="国内法规标准-新增数据")
|
||||
@PostMapping(value = "/commonAdd")
|
||||
public Result<String> commonAdd(@RequestBody Map<String,Object> parameterMap) {
|
||||
lawsCommonService.setStandardNumber(parameterMap, FieldCommon.GB);
|
||||
lawsCommonService.setStandardNumber(parameterMap);
|
||||
parameterMap.put(FieldCommon.MODULE, MODULE_VALUE);
|
||||
return Result.OK(lawsCommonService.commonAdd(parameterMap));
|
||||
}
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ public class LawsOverseasController {
|
||||
@ApiOperation(value="海外法规标准-新增数据", notes="海外法规标准-新增数据")
|
||||
@PostMapping(value = "/commonAdd")
|
||||
public Result<String> commonAdd(@RequestBody Map<String,Object> parameterMap) {
|
||||
lawsCommonService.setStandardNumber(parameterMap, FieldCommon.FB);
|
||||
lawsCommonService.setStandardNumber(parameterMap);
|
||||
parameterMap.put(FieldCommon.MODULE, MODULE_VALUE);
|
||||
return Result.OK(lawsCommonService.commonAdd(parameterMap));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user