feat: UAT 341 标准新增时 更新记录增加创建的日志
This commit is contained in:
+28
@@ -740,6 +740,19 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
||||
// 更新语句
|
||||
UpdateWrapper updateWrapper = new UpdateWrapper();
|
||||
updateWrapper.eq("id", id);
|
||||
|
||||
// 获取数据库里没修改的数据
|
||||
Map<String, Object> oldDataMap = new HashMap<>();
|
||||
// 组装更新内容
|
||||
StringBuilder recordBuffer = new StringBuilder();
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date date = new Date();
|
||||
String now = dateFormat.format(date);
|
||||
recordBuffer.append(loginUser.calcNameWorkNo() + " " + now + " 修改" +
|
||||
standardNumber + "《" + standardName + "》,");
|
||||
String oldStr = recordBuffer.toString();
|
||||
|
||||
// 拼接要添加的数据
|
||||
for (Map.Entry<String, Object> entryMap : parameterMap.entrySet()) {
|
||||
String key = entryMap.getKey();
|
||||
@@ -747,6 +760,10 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
||||
if (!Objects.isNull(entryMap.getValue())) {
|
||||
value = (String) entryMap.getValue();
|
||||
}
|
||||
|
||||
// 添加更新记录
|
||||
addUpdateRecord(fieldList, oldDataMap, recordBuffer, null, key, value);
|
||||
|
||||
// 如果value不为null和"",则拼接查询条件
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
jointInsertFieldAndValue(fieldList, key, value, id, standardNumber, updateWrapper);
|
||||
@@ -757,6 +774,17 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
||||
//根据类型更新数据
|
||||
executeUpdateWrapperByModel(module, updateWrapper);
|
||||
|
||||
// 增加入库记录
|
||||
String addContent = loginUser.calcNameWorkNo() + " " + now + " 入库" +
|
||||
standardNumber + "《" + standardName + "》";
|
||||
lawsUpdateRecordService.addRecord(standardNumber, addContent);
|
||||
|
||||
// 增加修改内容记录
|
||||
String content = recordBuffer.toString();
|
||||
if (!oldStr.equals(content)) {
|
||||
lawsUpdateRecordService.addRecord(standardNumber, content);
|
||||
}
|
||||
|
||||
// 对标准体系做处理
|
||||
lawsNodeRelationService.addRelation(standardSystem, standardNumber, id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user