Commit 21b2dda7 by zhiwj

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-store into developer

parents 52f8a8f8 1985ccb0
......@@ -179,53 +179,63 @@ public class StoreDictApiServiceImpl implements StoreDictApiService {
List<String> newList = Arrays.asList(values.split(","));
List<String> add = newList.stream().filter(s -> !existList.contains(s)).collect(Collectors.toList());
List<String> del = existList.stream().filter(s -> !newList.contains(s)).collect(Collectors.toList());
add.forEach(s -> {
TabStoreField tabStoreField = this.storeFieldService.getStoreFieldById(Integer.valueOf(s));
if(tabStoreField.getStoreFieldType() != null && tabStoreField.getStoreFieldType().intValue() == 1){
return;
}
TabStoreDict tabStoreDict = new TabStoreDict();
tabStoreDict.setEnterpriseId(enterpriseId);
tabStoreDict.setCreateTime(new Date());
tabStoreDict.setValue(s);
this.storeDictService.saveStoreField(tabStoreDict);
String key = StoreRedisKeyUtils.getStoreFieldKey(enterpriseId, Integer.valueOf(s));
Object existObj = RedisUtil.getCache(key);
if(existObj == null){
for(int i=1; i<=10; i++){
Object obj = RedisUtil.getCache(keyc+"c"+i);
if(obj == null){
RedisUtil.setCache(keyc+"c"+i, s);
RedisUtil.setCache(key, "c"+i);
break;
}
if(CollectionUtils.isNotEmpty(add)){
add.forEach(s -> {
if(StringUtils.isBlank(s)){
return;
}
}
});
del.forEach(s -> {
String key = StoreRedisKeyUtils.getStoreFieldKey(enterpriseId, Integer.valueOf(s));
this.storeDictService.deleteStoreField(enterpriseId, s);
Object c = RedisUtil.getCache(key);
String storeListSourceKey = StoreRedisKeyUtils.getStoreListSourceKey(enterpriseId, userId);
if(c != null){
RedisUtil.delCache(c.toString());
//门店列表自定义字段配置,取消时需要删除当前已经配置的列表显示字段
Object storeListSource = RedisUtil.getCache(storeListSourceKey);
if(storeListSource != null){
String[] arr = storeListSource.toString().split(",");
String result = "";
for(String a : arr){
if(!c.toString().equals(a)){
result += a+",";
TabStoreField tabStoreField = this.storeFieldService.getStoreFieldById(Integer.valueOf(s));
if(tabStoreField.getStoreFieldType() != null && tabStoreField.getStoreFieldType().intValue() == 1){
return;
}
TabStoreDict tabStoreDict = new TabStoreDict();
tabStoreDict.setEnterpriseId(enterpriseId);
tabStoreDict.setCreateTime(new Date());
tabStoreDict.setValue(s);
this.storeDictService.saveStoreField(tabStoreDict);
String key = StoreRedisKeyUtils.getStoreFieldKey(enterpriseId, Integer.valueOf(s));
Object existObj = RedisUtil.getCache(key);
if(existObj == null){
for(int i=1; i<=10; i++){
Object obj = RedisUtil.getCache(keyc+"c"+i);
if(obj == null){
RedisUtil.setCache(keyc+"c"+i, s);
RedisUtil.setCache(key, "c"+i);
break;
}
}
if(StringUtils.isNotBlank(result)){
RedisUtil.setCache(storeListSourceKey, result);
}
});
}
if(CollectionUtils.isNotEmpty(del)){
del.forEach(s -> {
if(StringUtils.isBlank(s)){
return;
}
String key = StoreRedisKeyUtils.getStoreFieldKey(enterpriseId, Integer.valueOf(s));
this.storeDictService.deleteStoreField(enterpriseId, s);
Object c = RedisUtil.getCache(key);
String storeListSourceKey = StoreRedisKeyUtils.getStoreListSourceKey(enterpriseId, userId);
if(c != null){
RedisUtil.delCache(c.toString());
//门店列表自定义字段配置,取消时需要删除当前已经配置的列表显示字段
Object storeListSource = RedisUtil.getCache(storeListSourceKey);
if(storeListSource != null){
String[] arr = storeListSource.toString().split(",");
String result = "";
for(String a : arr){
if(!c.toString().equals(a)){
result += a+",";
}
}
if(StringUtils.isNotBlank(result)){
RedisUtil.setCache(storeListSourceKey, result);
}
}
}
}
RedisUtil.delCache(key);
});
RedisUtil.delCache(key);
});
}
return ServiceResponse.success();
}
......
......@@ -151,7 +151,7 @@ public class ClerkController extends DownloadUtils {
@RequestMapping("clerk-qrcode-download")
public RestResponse clerkQrcodeDownload(@RequestBody ClerkQrcodeQO clerkQrcodeQO){
int total = clerkQrcodeQO.getContent().size();
int total = 0;
if(clerkQrcodeQO.getIsAll() == 1){
ClerkSearchDTO clerkSearchDTO = clerkQrcodeQO.getClerkSearchDTO();
clerkSearchDTO.setEnterpriseId(UserDetailUtils.getUserDetail().getEnterpriseId());
......@@ -160,6 +160,8 @@ public class ClerkController extends DownloadUtils {
if (totalClerkServiceResponse.getResult() == 0) {
return RestResponse.failure(ErrorCode.NOTEXISTS.getCode(), ErrorCode.NOTEXISTS.getMsg());
}
} else {
total = clerkQrcodeQO.getContent().size();
}
new QrcodeDownload(){
@Override
......
......@@ -350,7 +350,7 @@ public class StoreController extends DownloadUtils {
@RequestMapping("store-qrcode-download")
public RestResponse storeQrcodeDownload(@RequestBody QrcodeQO qrcodeQO){
int total = qrcodeQO.getContent().size();
int total = 0;
if(qrcodeQO.getIsAll() == 1){
StoreSearchDTO storeSearchDTO = qrcodeQO.getStoreSearchDTO();
storeSearchDTO.setEnterpriseId(UserDetailUtils.getUserDetail().getEnterpriseId());
......@@ -359,6 +359,8 @@ public class StoreController extends DownloadUtils {
if(total == 0){
return RestResponse.failure(ErrorCode.NOTEXISTS.getCode(), "没有门店下载二维码");
}
}else {
total = qrcodeQO.getContent().size();
}
new QrcodeDownload(){
@Override
......
......@@ -157,13 +157,10 @@ public class StoreDictController {
public RestResponse setStoreField(String values){
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
Integer userId = UserDetailUtils.getUserDetail().getUserId();
if(StringUtils.isBlank(values)){
return EnterpriseRestResponse.failure(com.gic.enterprise.error.ErrorCode.MISS_PARAMETER);
}
String key = "relevanceStorefield:"+enterpriseId;
Object cache = RedisUtil.getCache(key);
if(cache != null){
return RestResponse.failure(ErrorCode.SYSTEM_ERROR.getCode(), "请稍后重试");
//return RestResponse.failure(ErrorCode.SYSTEM_ERROR.getCode(), "请稍后重试");
}
AuditLogDTO auditLogDTO = new AuditLogDTO();
auditLogDTO.setEnterpriseId(1129);
......
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