Commit 229974cc by zhiwj

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

parents cc2fae4e d8a5da58
......@@ -65,5 +65,5 @@ public interface TabStoreDictMapper {
List<String> listStoreField(Integer enterpriseId);
void deleteStoreField(@Param("enterpriseId") Integer enterpriseId, @Param("value")String value);
void deleteStoreDict(@Param("enterpriseId") Integer enterpriseId, @Param("value")String value, @Param("type") String type);
}
\ No newline at end of file
......@@ -40,5 +40,5 @@ public interface StoreDictService {
void saveStoreField(TabStoreDict tabStoreDict);
void deleteStoreField(Integer enterpriseId, String value);
void deleteStoreDict(Integer enterpriseId, String value, String type);
}
......@@ -46,7 +46,7 @@ public class StoreDictServiceImpl implements StoreDictService {
}
@Override
public void deleteStoreField(Integer enterpriseId, String value) {
this.tabStoreDictMapper.deleteStoreField(enterpriseId, value);
public void deleteStoreDict(Integer enterpriseId, String value, String type) {
this.tabStoreDictMapper.deleteStoreDict(enterpriseId, value, type);
}
}
......@@ -107,6 +107,11 @@ public class StoreDictApiServiceImpl implements StoreDictApiService {
return ServiceResponse.failure(ErrorCode.MISS_PARAMETER.getCode(), ErrorCode.MISS_PARAMETER.getMsg());
}
List<String> listSelected = this.storeDictService.listStoreType(enterpriseId);
List<String> list = Arrays.asList(storeTypeArr);
List<String> delList = listSelected.stream().filter(s -> !list.contains(s)).collect(Collectors.toList());
delList.forEach(s ->{
this.storeDictService.deleteStoreDict(enterpriseId, s, "storeType");
});
for(String storeType : storeTypeArr){
boolean isExist = false;
for(String s : listSelected){
......@@ -131,6 +136,11 @@ public class StoreDictApiServiceImpl implements StoreDictApiService {
return ServiceResponse.failure(ErrorCode.MISS_PARAMETER.getCode(), ErrorCode.MISS_PARAMETER.getMsg());
}
List<String> listSelected = this.storeDictService.listStoreStatus(enterpriseId);
List<String> list = Arrays.asList(storeStatusArr);
List<String> delList = listSelected.stream().filter(s -> !list.contains(s)).collect(Collectors.toList());
delList.forEach(s ->{
this.storeDictService.deleteStoreDict(enterpriseId, s, "storeStatus");
});
for(String storeStatus : storeStatusArr){
boolean isExist = false;
for(String s : listSelected){
......@@ -235,7 +245,7 @@ public class StoreDictApiServiceImpl implements StoreDictApiService {
return;
}
String key = StoreRedisKeyUtils.getStoreFieldKey(enterpriseId, Integer.valueOf(s));
this.storeDictService.deleteStoreField(enterpriseId, s);
this.storeDictService.deleteStoreDict(enterpriseId, s, "storeField");
Object c = RedisUtil.getCache(key);
String storeListSourceKey = StoreRedisKeyUtils.getStoreListSourceKey(enterpriseId, userId);
if(c != null){
......
......@@ -104,11 +104,11 @@
where store_dict_id = #{storeDictId,jdbcType=INTEGER}
</update>
<update id="deleteStoreField" >
<update id="deleteStoreDict" >
update tab_store_dict
set status=0
where enterprise_id = #{enterpriseId,jdbcType=INTEGER}
and type = 'storeField'
and type = #{type}
and value = #{value,jdbcType=VARCHAR}
</update>
<select id="listStoreType" parameterType="java.lang.Integer" resultType="java.lang.String">
......
......@@ -139,7 +139,7 @@ public class StoreDictController {
@RequestMapping("save-status-type")
@ResponseBody
public RestResponse saveStoreStatusAndStoreType(String storeStatus, String storeType){
AuditLogDTO auditLogDTO = new AuditLogDTO();
/* AuditLogDTO auditLogDTO = new AuditLogDTO();
// 商户id
auditLogDTO.setEnterpriseId(UserDetailUtils.getUserDetail().getEnterpriseId());
// 申请人id
......@@ -154,14 +154,14 @@ public class StoreDictController {
jsonObject.put("storeType", storeType);
auditLogDTO.setExtraInfo(jsonObject.toJSONString());
ServiceResponse<Void> serviceResponse = auditLogApiService.apply(auditLogDTO);
return ResultControllerUtils.commonResult(serviceResponse);
/*Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
return ResultControllerUtils.commonResult(serviceResponse);*/
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
String key = "storeStatusAndType:"+enterpriseId;
Object cache = RedisUtil.getCache(key);
if(cache != null){
return RestResponse.failure(ErrorCode.SYSTEM_ERROR.getCode(), "请稍后重试");
return RestResponse.failure(ErrorCode.SYSTEM_ERROR.getCode(), "请稍后重试,修改间隔为24个小时");
}
RedisUtil.setCache(key, 1, 12l, TimeUnit.HOURS);
RedisUtil.setCache(key, 1, 24l, TimeUnit.HOURS);
ServiceResponse serviceResponse = this.storeDictApiService.saveStoreStatusAndStoreType(enterpriseId, storeStatus.split(","), storeType.split(","));
if(serviceResponse.isSuccess()){
LogUtils.createLog("配置商户门店类型和门店状态", "门店状态和门店类型");
......@@ -170,7 +170,7 @@ public class StoreDictController {
return RestResponse.success();
}else {
return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
}*/
}
}
......@@ -188,7 +188,7 @@ public class StoreDictController {
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(), "请稍后重试,修改间隔为24个小时");
}
/*AuditLogDTO auditLogDTO = new AuditLogDTO();
auditLogDTO.setEnterpriseId(1129);
......@@ -201,7 +201,7 @@ public class StoreDictController {
jsonObject.put("userId", userId);
auditLogDTO.setExtraInfo(jsonObject.toJSONString());
auditLogApiService.apply(auditLogDTO);*/
RedisUtil.setCache(key, 1, 12l, TimeUnit.HOURS);
RedisUtil.setCache(key, 1, 24l, TimeUnit.HOURS);
ServiceResponse serviceResponse = this.storeDictApiService.saveStoreField(enterpriseId, values, userId);
if(serviceResponse.isSuccess()){
LogUtils.createLog("自定义字段列表支持筛选配置", "自定义字段");
......
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