Commit d251009f by 徐高华

log

parent b62e836d
...@@ -211,13 +211,13 @@ public class HmLinkController { ...@@ -211,13 +211,13 @@ public class HmLinkController {
JSONObject oldStoreRuleObj = JSONObject.parseObject(oldValue); JSONObject oldStoreRuleObj = JSONObject.parseObject(oldValue);
JSONObject newStoreRuleObj = JSONObject.parseObject(newValue); JSONObject newStoreRuleObj = JSONObject.parseObject(newValue);
logger.info("{},{}", oldStoreRuleObj, newStoreRuleObj); logger.info("{},{}", oldStoreRuleObj, newStoreRuleObj);
otherStoreRuleLog(oldStoreRuleObj, newStoreRuleObj, sb); otherStoreRuleLog(oldStoreRuleObj, newStoreRuleObj);
return sb.toString(); return sb.toString();
} }
return null; return null;
} }
private static String otherStoreRuleLog(JSONObject oldStoreRuleObj, JSONObject newStoreRuleObj, StringBuilder sb) { private static String otherStoreRuleLog(JSONObject oldStoreRuleObj, JSONObject newStoreRuleObj) {
StringBuilder tempSb = new StringBuilder(); StringBuilder tempSb = new StringBuilder();
int oldOpenFlag = oldStoreRuleObj.getIntValue("open"); int oldOpenFlag = oldStoreRuleObj.getIntValue("open");
int newOpenFlag = newStoreRuleObj.getIntValue("open"); int newOpenFlag = newStoreRuleObj.getIntValue("open");
...@@ -234,27 +234,26 @@ public class HmLinkController { ...@@ -234,27 +234,26 @@ public class HmLinkController {
// 开启 // 开启
tempSb.append("开启"); tempSb.append("开启");
if (newStoreType == 1) { if (newStoreType == 1) {
tempSb.append(otherOpenLog(newStore, sb, 5)); tempSb.append(otherOpenLog(newStore, 5));
} else if (newStoreType == 2) { } else if (newStoreType == 2) {
tempSb.append(otherOpenLog(newStore, sb, 6)); tempSb.append(otherOpenLog(newStore, 6));
} }
String cityLog = otherOpenLog(newCityStore, sb, 4); String cityLog = otherOpenLog(newCityStore, 4);
tempSb.append(cityLog); tempSb.append(cityLog);
} else { } else {
if (newStoreType == 1) { if (newStoreType == 1) {
tempSb.append(ruleLogOther(oldtore, newStore, sb, 5)); tempSb.append(ruleLogOther(oldtore, newStore, 5));
} else if (newStoreType == 2) { } else if (newStoreType == 2) {
tempSb.append(ruleLogOther(oldtore, newStore, sb, 6)); tempSb.append(ruleLogOther(oldtore, newStore, 6));
} }
tempSb.append(ruleLogOther(oldCityStore, newCityStore, sb, 4)); tempSb.append(ruleLogOther(oldCityStore, newCityStore, 4));
} }
} }
sb.append(tempSb); return tempSb.toString();
return tempSb.toString() ;
} }
private static String otherOpenLog(HmLinkStoreSettingDTO newStore, StringBuilder sb, int level) { private static String otherOpenLog(HmLinkStoreSettingDTO newStore, int level) {
StringBuilder tempSb = new StringBuilder(); StringBuilder tempSb = new StringBuilder();
String title = ""; String title = "";
if (level == 4) { if (level == 4) {
...@@ -278,13 +277,11 @@ public class HmLinkController { ...@@ -278,13 +277,11 @@ public class HmLinkController {
newTitle = getLogOption(0, 0, newNdz, newNdy, newNdz, newNdy, level); newTitle = getLogOption(0, 0, newNdz, newNdy, newNdz, newNdy, level);
} }
tempSb.append("「").append(title).append("-").append(newTitle).append("」"); tempSb.append("「").append(title).append("-").append(newTitle).append("」");
sb.append(tempSb);
return tempSb.toString(); return tempSb.toString();
} }
private static String ruleLogOther(HmLinkStoreSettingDTO oldStore, HmLinkStoreSettingDTO newStore, StringBuilder sb, private static String ruleLogOther(HmLinkStoreSettingDTO oldStore, HmLinkStoreSettingDTO newStore, int level) {
int level) {
StringBuilder tempSb = new StringBuilder(); StringBuilder tempSb = new StringBuilder();
String title = ""; String title = "";
if (level == 5) { if (level == 5) {
...@@ -312,10 +309,10 @@ public class HmLinkController { ...@@ -312,10 +309,10 @@ public class HmLinkController {
newTitle = getLogOption(0, 0, newNdz, newNdy, newNdz, newNdy, level); newTitle = getLogOption(0, 0, newNdz, newNdy, newNdz, newNdy, level);
} }
if (!oldTitle.equals(newTitle)) { if (!oldTitle.equals(newTitle)) {
sb.append("分配规则").append("「").append(title).append("-").append(oldTitle).append("」").append("变更为") tempSb.append("分配规则").append("「").append(title).append("-").append(oldTitle).append("」").append("变更为")
.append("「").append(title).append("-").append(newTitle).append("」"); .append("「").append(title).append("-").append(newTitle).append("」");
} }
sb.append(tempSb); tempSb.append(tempSb);
return tempSb.toString(); return tempSb.toString();
} }
...@@ -388,32 +385,35 @@ public class HmLinkController { ...@@ -388,32 +385,35 @@ public class HmLinkController {
} }
String s1 = "(同意授权)"; String s1 = "(同意授权)";
if (dz == 1) { if (dz == 1) {
if(level==6) { if (level == 6) {
list.add(s1) ; list.add(s1 + "店长");
} } else {
list.add("店长"); list.add("店长");
} }
if (dy == 1) {
if(level==6 && !list.contains(s1)) {
list.add(s1) ;
} }
if (dy == 1) {
if (level == 6 && !list.toString().contains(s1)) {
list.add(s1 + "导购");
} else {
if (level == 1 && level == 2) { if (level == 1 && level == 2) {
list.add("其他导购"); list.add("其他导购");
} else { } else {
list.add("导购"); list.add("导购");
} }
} }
}
String s2 = "(拒绝授权)"; String s2 = "(拒绝授权)";
if (ndz == 1) { if (ndz == 1) {
list.add(s2) ; list.add(s2 + "店长");
list.add("店长");
} }
if (ndy == 1) { if (ndy == 1) {
if(!list.contains(s2)) { if (!list.toString().contains(s2)) {
list.add(s2) ; list.add(s2 + "导购");
} } else {
list.add("导购"); list.add("导购");
} }
}
return list.stream().collect(Collectors.joining("、")); return list.stream().collect(Collectors.joining("、"));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment