调整代码,子表不新增操作日志
This commit is contained in:
parent
c6d4f8ad3a
commit
299ba86d60
|
@ -158,10 +158,11 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
map.put("update_status", "1");//修改状态
|
||||
map.put("delete_status", "1");//删除状态
|
||||
ComparisonEntity comparisonEntityRule = comparisonEntities.get(0);
|
||||
//查询单据规则
|
||||
//查询单据规则 只查询主表得,明细表不用
|
||||
try {
|
||||
comparisonEntityRule= comparisonDao.queryComparisonById(comparisonEntityRule);
|
||||
String documentRule =comparisonEntityRule.getDocumentRule();; //"KH-2024-05-30-1";
|
||||
ComparisonEntity comparisonEntityRules = comparisonDao.queryComparisonById(comparisonEntityRule);
|
||||
String documentRule = comparisonEntityRules.getDocumentRule();
|
||||
; //"KH-2024-05-30-1";
|
||||
logger.info("通用数据保存接口中根据mId查询出来的单据规则为:{}", documentRule);
|
||||
if (documentRule != null) {
|
||||
//获取规则前缀 CK
|
||||
|
@ -173,15 +174,15 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
String ruleSuffixLength = documentRule.substring(documentRule.lastIndexOf("-") + 1);
|
||||
int ruleSuffix = ruleSuffixLength.length();
|
||||
//生成单据规则
|
||||
comparisonEntity.setRulePrefix(rulePrefix);
|
||||
comparisonEntity.setRuleMiddle(ruleMiddle);
|
||||
comparisonEntity.setRuleSuffix(ruleSuffix);
|
||||
comparisonEntityRule.setRulePrefix(rulePrefix);
|
||||
comparisonEntityRule.setRuleMiddle(ruleMiddle);
|
||||
comparisonEntityRule.setRuleSuffix(ruleSuffix);
|
||||
try {
|
||||
//新生成单据规则保存到数据库
|
||||
comparisonEntityRule = comparisonDao.queryComparisonRule(comparisonEntity);
|
||||
map.put("document_rule", comparisonEntityRule.getDocumentRule());//单据规则
|
||||
map.put("document_rule_num", comparisonEntityRule.getDocumentRuleNum());//单据规则流水号
|
||||
comparisonEntity.setMap(map);
|
||||
ComparisonEntity comparisonEntityRuleGz = comparisonDao.queryComparisonRule(comparisonEntityRule);
|
||||
map.put("document_rule", comparisonEntityRuleGz.getDocumentRule());//单据规则
|
||||
map.put("document_rule_num", comparisonEntityRuleGz.getDocumentRuleNum());//单据规则流水号
|
||||
comparisonEntityRule.setMap(map);
|
||||
} catch (Exception e) {
|
||||
logger.info("保存通用数据时候生成单据规则错误:{}", e.getMessage());
|
||||
return BaseResult.getFailureMessageEntity("保存失败");
|
||||
|
@ -193,7 +194,7 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
}
|
||||
try {
|
||||
//保存主表数据
|
||||
ComparisonEntity comparisonEntityOne = comparisonDao.saveComparison(comparisonEntity);
|
||||
ComparisonEntity comparisonEntityOne = comparisonDao.saveComparison(comparisonEntityRule);
|
||||
//保存子表数据
|
||||
if (mapDetails != null && mapDetails.size() > 0) {
|
||||
String uuidDetail = UUIDUtils.getUUID();
|
||||
|
@ -211,10 +212,10 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
//comparisonEntityOne.setComparisonDetailsEntity(comparisonDetailsEntityOne);
|
||||
map.put("details",mapDetails);
|
||||
//保存操作日志
|
||||
controlsLogDaoimpl.saveControlsLog(uuidDetail,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log");
|
||||
//controlsLogDaoimpl.saveControlsLog(uuidDetail,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log");
|
||||
}
|
||||
//保存操作日志
|
||||
controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log");
|
||||
controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonEntityRule.getDbName()+"_option_log");
|
||||
return BaseResult.getSuccessMessageEntity("保存成功", map);
|
||||
} catch (Exception e) {
|
||||
logger.info("保存通用数据时候错误:{}", e.getMessage());
|
||||
|
|
Loading…
Reference in New Issue