add 国内海外标准编号生成逻辑
This commit is contained in:
@@ -44,12 +44,16 @@ public class FieldCommon {
|
|||||||
public static final String ID = "id";
|
public static final String ID = "id";
|
||||||
// 标准编号
|
// 标准编号
|
||||||
public static final String STANDARD_NUMBER = "standard_number";
|
public static final String STANDARD_NUMBER = "standard_number";
|
||||||
|
// 年代号
|
||||||
|
public static final String YEAR_NUMBER = "year_number";
|
||||||
// 标准名称
|
// 标准名称
|
||||||
public static final String STANDARD_NAME = "standard_name";
|
public static final String STANDARD_NAME = "standard_name";
|
||||||
|
// 国标
|
||||||
|
public static final String GB = "GB";
|
||||||
|
// 外标
|
||||||
|
public static final String FB = "FB";
|
||||||
// 树节点编码
|
// 树节点编码
|
||||||
public static final String NODE_CODE = "nodeCode";
|
public static final String NODE_CODE = "nodeCode";
|
||||||
// ids
|
|
||||||
public static final String IDS = "ids";
|
|
||||||
// 分隔符
|
// 分隔符
|
||||||
public static final String SEPARATOR = ",";
|
public static final String SEPARATOR = ",";
|
||||||
// 中文双引号
|
// 中文双引号
|
||||||
|
|||||||
+7
@@ -84,4 +84,11 @@ public interface ILawsCommonService {
|
|||||||
* @Description: 多选标准弹框
|
* @Description: 多选标准弹框
|
||||||
**/
|
**/
|
||||||
IPage<ManyStandardSelectionBox> getManyStandardSelectionBox(ManyStandardSelectionBoxVO selectionBoxVO, Integer pageNo, Integer pageSize);
|
IPage<ManyStandardSelectionBox> getManyStandardSelectionBox(ManyStandardSelectionBoxVO selectionBoxVO, Integer pageNo, Integer pageSize);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: liao
|
||||||
|
* @Date: 2023/9/14 15:42
|
||||||
|
* @Description: 生成法规编号
|
||||||
|
**/
|
||||||
|
void setStandardNumber(Map<String, Object> parameterMap, String type);
|
||||||
}
|
}
|
||||||
|
|||||||
+28
-2
@@ -224,7 +224,8 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
|||||||
throw new JeroBootException(ResultCommon.EMPTY_STANDARD_NAME, "");
|
throw new JeroBootException(ResultCommon.EMPTY_STANDARD_NAME, "");
|
||||||
}
|
}
|
||||||
// 获取操作模块
|
// 获取操作模块
|
||||||
String module = parameterMap.get(FieldCommon.MODULE).toString();
|
String module = (String) parameterMap.get(FieldCommon.MODULE);
|
||||||
|
|
||||||
// 获取要操作的表名
|
// 获取要操作的表名
|
||||||
String tableName = TableNameEnum.getTableName(module);
|
String tableName = TableNameEnum.getTableName(module);
|
||||||
// 获取全部字段
|
// 获取全部字段
|
||||||
@@ -284,10 +285,11 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
|||||||
String module = parameterMap.get(FieldCommon.MODULE).toString();
|
String module = parameterMap.get(FieldCommon.MODULE).toString();
|
||||||
parameterMap.remove(FieldCommon.MODULE);
|
parameterMap.remove(FieldCommon.MODULE);
|
||||||
// 获取id
|
// 获取id
|
||||||
String id = parameterMap.get(FieldCommon.ID).toString();
|
String id = (String) parameterMap.get(FieldCommon.ID);
|
||||||
parameterMap.remove(FieldCommon.ID);
|
parameterMap.remove(FieldCommon.ID);
|
||||||
// 获取数据库里没修改的数据
|
// 获取数据库里没修改的数据
|
||||||
Map<String, Object> oldDataMap = getByIdAndModule(id, module);
|
Map<String, Object> oldDataMap = getByIdAndModule(id, module);
|
||||||
|
|
||||||
// 组装更新内容
|
// 组装更新内容
|
||||||
StringBuilder recordBuffer = new StringBuilder();
|
StringBuilder recordBuffer = new StringBuilder();
|
||||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
@@ -296,6 +298,7 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
|||||||
recordBuffer.append(loginUser.getNameWorkNo() + " " + now + " 修改" +
|
recordBuffer.append(loginUser.getNameWorkNo() + " " + now + " 修改" +
|
||||||
standardNumber + "《" + standardName + "》,");
|
standardNumber + "《" + standardName + "》,");
|
||||||
String oldStr = recordBuffer.toString();
|
String oldStr = recordBuffer.toString();
|
||||||
|
|
||||||
// 获取要操作的表名
|
// 获取要操作的表名
|
||||||
String tableName = TableNameEnum.getTableName(module);
|
String tableName = TableNameEnum.getTableName(module);
|
||||||
// 获取全部字段
|
// 获取全部字段
|
||||||
@@ -487,6 +490,29 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
|||||||
return lawsCommonMapper.getManyStandardSelectionBox(page, selectionBoxVO);
|
return lawsCommonMapper.getManyStandardSelectionBox(page, selectionBoxVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: liao
|
||||||
|
* @Date: 2023/9/14 15:44
|
||||||
|
* @Description: 生成法规编号
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public void setStandardNumber(Map<String, Object> parameterMap, String type) {
|
||||||
|
// 法规编号不能为空
|
||||||
|
String standardNumber = (String) parameterMap.get(FieldCommon.STANDARD_NUMBER);
|
||||||
|
// 年代号
|
||||||
|
String yearNumber = (String) parameterMap.get(FieldCommon.YEAR_NUMBER);
|
||||||
|
if (StringUtils.isBlank(standardNumber)) {
|
||||||
|
throw new JeroBootException(ResultCommon.EMPTY_STANDARD_NUMBER, "");
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(yearNumber)) {
|
||||||
|
throw new JeroBootException(ResultCommon.EMPTY_COMMON, FieldCommon.YEAR_NUMBER);
|
||||||
|
}
|
||||||
|
// 最后生成的法规编号
|
||||||
|
standardNumber = type + standardNumber + "-" + yearNumber;
|
||||||
|
|
||||||
|
parameterMap.put(FieldCommon.STANDARD_NUMBER, standardNumber);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: liao
|
* @Author: liao
|
||||||
* @Date: 2023/8/24 9:53
|
* @Date: 2023/8/24 9:53
|
||||||
|
|||||||
+3
-1
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.jero.common.api.vo.Result;
|
import com.jero.common.api.vo.Result;
|
||||||
import com.jero.common.aspect.annotation.AutoLog;
|
import com.jero.common.aspect.annotation.AutoLog;
|
||||||
|
import com.jero.common.exception.JeroBootException;
|
||||||
import com.jero.common.util.MessageUtils;
|
import com.jero.common.util.MessageUtils;
|
||||||
import com.jero.modules.laws.common.constant.FieldCommon;
|
import com.jero.modules.laws.common.constant.FieldCommon;
|
||||||
import com.jero.modules.laws.common.constant.ResultCommon;
|
import com.jero.modules.laws.common.constant.ResultCommon;
|
||||||
@@ -17,6 +18,7 @@ import com.jero.modules.tag.entity.LawsTag;
|
|||||||
import com.jero.modules.tag.enums.TableNameEnum;
|
import com.jero.modules.tag.enums.TableNameEnum;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@@ -45,7 +47,6 @@ public class LawsDomesticController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ILawsStandardSharingService lawsStandardSharingService;
|
private ILawsStandardSharingService lawsStandardSharingService;
|
||||||
|
|
||||||
|
|
||||||
private static final String MODULE_VALUE = TableNameEnum.DOMESTIC_REGULATIONS.getValue();
|
private static final String MODULE_VALUE = TableNameEnum.DOMESTIC_REGULATIONS.getValue();
|
||||||
|
|
||||||
@AutoLog(value = "国内法规标准-分页列表查询")
|
@AutoLog(value = "国内法规标准-分页列表查询")
|
||||||
@@ -67,6 +68,7 @@ public class LawsDomesticController {
|
|||||||
@ApiOperation(value="国内法规标准-新增数据", notes="国内法规标准-新增数据")
|
@ApiOperation(value="国内法规标准-新增数据", notes="国内法规标准-新增数据")
|
||||||
@PostMapping(value = "/commonAdd")
|
@PostMapping(value = "/commonAdd")
|
||||||
public Result<String> commonAdd(@RequestBody Map<String,Object> parameterMap) {
|
public Result<String> commonAdd(@RequestBody Map<String,Object> parameterMap) {
|
||||||
|
lawsCommonService.setStandardNumber(parameterMap, FieldCommon.GB);
|
||||||
parameterMap.put(FieldCommon.MODULE, MODULE_VALUE);
|
parameterMap.put(FieldCommon.MODULE, MODULE_VALUE);
|
||||||
return Result.OK(lawsCommonService.commonAdd(parameterMap));
|
return Result.OK(lawsCommonService.commonAdd(parameterMap));
|
||||||
}
|
}
|
||||||
|
|||||||
+1
@@ -66,6 +66,7 @@ public class LawsOverseasController {
|
|||||||
@ApiOperation(value="海外法规标准-新增数据", notes="海外法规标准-新增数据")
|
@ApiOperation(value="海外法规标准-新增数据", notes="海外法规标准-新增数据")
|
||||||
@PostMapping(value = "/commonAdd")
|
@PostMapping(value = "/commonAdd")
|
||||||
public Result<String> commonAdd(@RequestBody Map<String,Object> parameterMap) {
|
public Result<String> commonAdd(@RequestBody Map<String,Object> parameterMap) {
|
||||||
|
lawsCommonService.setStandardNumber(parameterMap, FieldCommon.FB);
|
||||||
parameterMap.put(FieldCommon.MODULE, MODULE_VALUE);
|
parameterMap.put(FieldCommon.MODULE, MODULE_VALUE);
|
||||||
return Result.OK(lawsCommonService.commonAdd(parameterMap));
|
return Result.OK(lawsCommonService.commonAdd(parameterMap));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,9 @@ public enum LawsFieldTypeEnum {
|
|||||||
OPTION_SINGLE("下拉单选","10"),
|
OPTION_SINGLE("下拉单选","10"),
|
||||||
OPTION_MANY("下拉多选","11"),
|
OPTION_MANY("下拉多选","11"),
|
||||||
TREE_BOX("树型结构","12"),
|
TREE_BOX("树型结构","12"),
|
||||||
OPTION_Link("输入框(链接)","13");
|
OPTION_Link("输入框(链接)","13"),
|
||||||
|
YEAR_OPTION("年份选择","14")
|
||||||
|
;
|
||||||
|
|
||||||
String name;
|
String name;
|
||||||
String value;
|
String value;
|
||||||
|
|||||||
Reference in New Issue
Block a user