Commit d6e901d7 by 陶光胜

Merge branch 'developer' into 'master'

观云台小程序

See merge request !21
parents c9014764 9b8fc061
package com.gic.cloud.web.controller; package com.gic.cloud.web.controller;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
import com.gic.cloud.web.auth.DataAuthUtils; import com.gic.cloud.web.auth.DataAuthUtils;
...@@ -20,6 +21,8 @@ import com.gic.store.dto.ClerkDTO; ...@@ -20,6 +21,8 @@ import com.gic.store.dto.ClerkDTO;
import com.gic.store.service.ClerkApiService; import com.gic.store.service.ClerkApiService;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -30,6 +33,7 @@ import java.util.stream.Collectors; ...@@ -30,6 +33,7 @@ import java.util.stream.Collectors;
@Component @Component
public class GoDownComponent { public class GoDownComponent {
private Logger log = LogManager.getLogger(GoDownComponent.class);
@Autowired @Autowired
private ShopApiService shopApiService; private ShopApiService shopApiService;
@Autowired @Autowired
...@@ -187,9 +191,12 @@ public class GoDownComponent { ...@@ -187,9 +191,12 @@ public class GoDownComponent {
BaseDTO baseSalesDTO = (BaseDTO) b; BaseDTO baseSalesDTO = (BaseDTO) b;
return baseSalesDTO.getAreaId() == null ? baseSalesDTO.getId() : baseSalesDTO.getAreaId(); return baseSalesDTO.getAreaId() == null ? baseSalesDTO.getId() : baseSalesDTO.getAreaId();
}).collect(Collectors.toList()); }).collect(Collectors.toList());
log.info("clerkIdList:{}", JSON.toJSONString(clerkIdList));
clerkDTOS = this.clerkApiService.listClerkByIds(enterpriseId, StringUtils.join(clerkIdList, ",")).getResult(); clerkDTOS = this.clerkApiService.listClerkByIds(enterpriseId, StringUtils.join(clerkIdList, ",")).getResult();
log.info("clerkDtos:{}", clerkDTOS);
} }
final Map<String, ClerkDTO> clerkDTOMap = CollectionUtil.toMap(clerkDTOS, "clerkId"); final Map<String, ClerkDTO> clerkDTOMap = CollectionUtil.toMap(clerkDTOS, "clerkId");
log.info("clerkDTOMap:{}", JSON.toJSONString(clerkDTOMap));
page.getResult().stream().forEach(b -> { page.getResult().stream().forEach(b -> {
BaseDTO baseSalesDTO = (BaseDTO) b; BaseDTO baseSalesDTO = (BaseDTO) b;
baseSalesDTO.setLevel(level); baseSalesDTO.setLevel(level);
...@@ -208,4 +215,18 @@ public class GoDownComponent { ...@@ -208,4 +215,18 @@ public class GoDownComponent {
} }
return page; return page;
} }
public static void main(String[] args){
List<ClerkDTO> list = new ArrayList<>();
ClerkDTO clerkDTO = new ClerkDTO();
clerkDTO.setClerkId(1);
ClerkDTO clerkDTO1 = new ClerkDTO();
clerkDTO1.setClerkId(2);
list.add(clerkDTO);
list.add(clerkDTO1);
List<Integer> collect = list.stream().map(clerkDTO2 -> {
return clerkDTO2.getClerkId();
}).collect(Collectors.toList());
System.out.println(JSON.toJSONString(collect));
}
} }
...@@ -70,12 +70,6 @@ public class StoreSearchUtils { ...@@ -70,12 +70,6 @@ public class StoreSearchUtils {
return 0; return 0;
} }
public static void main(String[] args){
System.out.println(1&1);
System.out.println(1&0);
System.out.println(0&0);
}
public List<Integer> storeSearch(Integer userId, Integer enterpriseId, String searchJson){ public List<Integer> storeSearch(Integer userId, Integer enterpriseId, String searchJson){
String key = "1:" + enterpriseId + ":" + userId +":" + (StringUtils.isNotBlank(searchJson) ? searchJson.hashCode() : "searchJSON".hashCode()); String key = "1:" + enterpriseId + ":" + userId +":" + (StringUtils.isNotBlank(searchJson) ? searchJson.hashCode() : "searchJSON".hashCode());
StoreAuth storeAuth = this.dataAuthUtils.getStoreAuth(userId, enterpriseId); StoreAuth storeAuth = this.dataAuthUtils.getStoreAuth(userId, enterpriseId);
......
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