Commit d8a5da58 by 陶光胜

门店控件增加接口

parent cc12ceb9
......@@ -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">
......
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