Commit 25d955dc by guojuxing

pmd规范

parent 837c6158
......@@ -25,7 +25,13 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* 数据权限工具
* @ClassName: DataAuthUtils

* @Description: 

* @author guojuxing

* @date 2020/9/7 11:43 AM

*/
@Component
public class DataAuthUtils {
private static final Logger log = LogManager.getLogger(DataAuthUtils.class);
......@@ -117,7 +123,7 @@ public class DataAuthUtils {
}
}
ArrayList<Long> list = new ArrayList<>();
list.add(-9999l);
list.add(-9999L);
return list;
}
......
package com.gic.cloud.web.auth;
import java.util.List;
/**
* 上线门店权限
* @ClassName: OnLineAuth

* @Description: 

* @author guojuxing

* @date 2020/9/7 1:34 PM

*/
public class OnLineAuth {
private boolean hasAuth = false;
private List<OnLineStore> list ;
......
package com.gic.cloud.web.auth;
import java.util.List;
/**
* 上线门店
* @ClassName: OnLineStore

* @Description: 

* @author guojuxing

* @date 2020/9/7 1:34 PM

*/
public class OnLineStore {
private Integer channel;
private List<String> storeIdList;
......
package com.gic.cloud.web.auth;
import java.util.List;
/**
* 门店权限
* @ClassName: StoreAuth

* @Description: 

* @author guojuxing

* @date 2020/9/7 1:34 PM

*/
public class StoreAuth {
private boolean hasAuth = false;
private List<Integer> storeInfoIdList;
......
package com.gic.cloud.web.constant;
/**
* 数据类型
* @ClassName: DateTypeEnum

* @Description: 

* @author guojuxing

* @date 2020/9/7 11:35 AM

*/
public enum DateTypeEnum {
/**
* 天
*/
DAY(1,"天"),
/**
* 周
*/
WEEK(2, "周"),
/**
* 月
*/
MONTH(3, "月"),
/**
* 年
*/
YEAR(4, "年"),
/**
* 近三天
*/
L3DAY(5, "近三天"),
/**
* 近七天
*/
L7DAY(6, "近七天");
private Integer type;
......
package com.gic.cloud.web.constant;
/**
* 错误代码
* @ClassName: ErrorCode

* @Description: 

* @author guojuxing

* @date 2020/9/7 11:35 AM

*/
public enum ErrorCode {
/**
* 系统错误
*/
SYSTEMERROR("0001", "系统错误"),
/**
* 账号不存在
*/
ACCOUNTNOTEXISTS("0002", "账号不存在");
......
package com.gic.cloud.web.constant;
/**
* 门店渠道
* @ClassName: StoreChannelEnum

* @Description: 

* @author guojuxing

* @date 2020/9/7 11:35 AM

*/
public enum StoreChannelEnum {
/**
* 线下
*/
OFFLINE(1, "线下"),
/**
* 达摩微商城
*/
GICMALL(2, "达摩微商城"),
/**
* 微盟微商城
*/
WMMALL(3, "微盟微商城"),
/**
* 天猫
*/
TIANMAO(4, "天猫");
private Integer channel;
......
......@@ -29,7 +29,13 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 基础业绩
* @ClassName: BaseSalesController

* @Description: 

* @author boom

* @date 2020/9/7 1:37 PM

*/
@RestController
public class BaseSalesController {
private Logger log = LogManager.getLogger(BaseSalesController.class);
......@@ -45,9 +51,7 @@ public class BaseSalesController {
@RequestMapping("base-sales")
public RestResponse baseSales(BaseSalesParamQo qo){
BaseSalesVo vo = new BaseSalesVo();
List<Integer> list = this.storeSearchUtils.storeSearch(qo.getUserId(), qo.getEnterpriseId(), qo.getSearchJSON());
List<String> onLine = this.storeSearchUtils.onLineStoreSearch(qo.getUserId(), qo.getEnterpriseId(), qo.getSearchJSON());
List<Long> mbrAreaIdList = this.dataAuthUtils.getMbrAreaId(qo.getUserId(), qo.getEnterpriseId());
Integer maxLevel = 0;
/******线下渠道需要点击下钻,该值只会在线下时才会使用********/
LevelVo levelVo = this.storeSearchUtils.getLevel(qo.getUserId(), qo.getEnterpriseId(), qo.getSearchJSON());
......@@ -68,47 +72,39 @@ public class BaseSalesController {
qo.setChannel(newChannel);
}
/***********如果是线下的第一层级或者门店导购层级,需要展示切换层级按钮*************/
if((qo.getChannel() == StoreChannelEnum.OFFLINE.getChannel() && qo.getLevel() == levelVo.getLevel())
|| (qo.getLevel() == 7 || qo.getLevel() == 8)){
boolean isFirstLevel = (qo.getChannel() == StoreChannelEnum.OFFLINE.getChannel().intValue() && qo.getLevel().intValue() == levelVo.getLevel())
|| (qo.getLevel() == 7 || qo.getLevel() == 8);
if(isFirstLevel){
vo.setChangeLevel(1);
}
if(qo.getChannel() == null){
vo.setLevelName("所有渠道");
} else if(qo.getChannel() == StoreChannelEnum.OFFLINE.getChannel()){
} else if(qo.getChannel() == StoreChannelEnum.OFFLINE.getChannel().intValue()){
vo.setLevelName(LevelUtil.getLevelName(qo.getLevel()));
} else {
vo.setLevelName("店铺层级");
}
BaseSalesParamsDTO dto = new BaseSalesParamsDTO();
dto.setChannel(qo.getChannel());
dto.setEnterpriseId(qo.getEnterpriseId());
dto.setStoreInfoIdList(list);
dto.setOnLine(onLine);
dto.setMbrAreaId(StringUtils.isBlank(qo.getMbrAreaId()) ? null : Long.valueOf(qo.getMbrAreaId()));
dto.setMbrAreaIdList(mbrAreaIdList);
dto.setType(qo.getType());
dto.setDate(qo.getDate());
dto.setChildrenStoreGroupIdList(childrenStoreGroupIdList);
dto.setLevel(qo.getLevel());
dto.setSortField(qo.getSortField());
dto.setSortType(qo.getSortType() == null ? 1 : qo.getSortType());
dto.setPageNum(qo.getPageNum());
dto.setPageSize(qo.getPageSize());
setCommonBaseDTO(dto, qo, childrenStoreGroupIdList);
ServiceResponse<Page<BaseSalesDTO>> response = this.baseSalesApiService.pageBaseSales(dto);
log.info("response:{}", JSON.toJSONString(response));
vo.setPage(this.goDownComponent.parseData(response.getResult(), qo.getChannel(), qo.getEnterpriseId(), qo.getLevel(), maxLevel));
dto.setCountType(2);//合计
//合计
dto.setCountType(2);
Integer wgs = storeSearchUtils.isWgs(qo.getUserId(), qo.getEnterpriseId(), qo.getSearchJSON());
/**所有渠道或者线下渠道第一层级 合计算上无归属数据**/
if((qo.getChannel() == null || (qo.getChannel() == StoreChannelEnum.OFFLINE.getChannel() && qo.getLevel() == levelVo.getLevel())) && wgs == 1){
boolean isContainNoOwnership = (qo.getChannel() == null || (qo.getChannel() == StoreChannelEnum.OFFLINE.getChannel().intValue() && qo.getLevel().intValue() == levelVo.getLevel())) && wgs == 1;
if(isContainNoOwnership){
dto.getStoreInfoIdList().add(-1);
dto.getOnLine().add("-1");
}
ServiceResponse<Page<BaseSalesDTO>> totalResponse = this.baseSalesApiService.pageBaseSales(dto);
log.info("totalResponse:{}", JSON.toJSONString(totalResponse));
this.goDownComponent.parseTotal(totalResponse, vo);
if(qo.getChannel() != null && qo.getChannel() == 1 && qo.getLevel() == levelVo.getLevel() && wgs == 1){
dto.setCountType(3); //无归属
if(qo.getChannel() != null && qo.getChannel() == 1 && qo.getLevel().intValue() == levelVo.getLevel() && wgs == 1){
//无归属
dto.setCountType(3);
dto.setChannel(null);
dto.getStoreInfoIdList().clear();
dto.getOnLine().clear();
......@@ -120,4 +116,25 @@ public class BaseSalesController {
}
return RestResponse.success(vo);
}
private void setCommonBaseDTO(BaseSalesParamsDTO dto, BaseSalesParamQo qo, List<Integer> childrenStoreGroupIdList) {
List<Integer> list = this.storeSearchUtils.storeSearch(qo.getUserId(), qo.getEnterpriseId(), qo.getSearchJSON());
List<String> onLine = this.storeSearchUtils.onLineStoreSearch(qo.getUserId(), qo.getEnterpriseId(), qo.getSearchJSON());
List<Long> mbrAreaIdList = this.dataAuthUtils.getMbrAreaId(qo.getUserId(), qo.getEnterpriseId());
dto.setChannel(qo.getChannel());
dto.setEnterpriseId(qo.getEnterpriseId());
dto.setStoreInfoIdList(list);
dto.setOnLine(onLine);
dto.setMbrAreaId(StringUtils.isBlank(qo.getMbrAreaId()) ? null : Long.valueOf(qo.getMbrAreaId()));
dto.setMbrAreaIdList(mbrAreaIdList);
dto.setType(qo.getType());
dto.setDate(qo.getDate());
dto.setChildrenStoreGroupIdList(childrenStoreGroupIdList);
dto.setLevel(qo.getLevel());
dto.setSortField(qo.getSortField());
dto.setSortType(qo.getSortType() == null ? 1 : qo.getSortType());
dto.setPageNum(qo.getPageNum());
dto.setPageSize(qo.getPageSize());
}
}
......@@ -28,7 +28,13 @@ import com.gic.data.api.service.consumestructure.ConsumeStructureApiService;
import com.gic.enterprise.utils.ResultControllerUtils;
import java.util.List;
/**
* 业绩构成
* @ClassName: ConsumeStructureController

* @Description: 

* @author guojuxing

* @date 2020/9/7 1:36 PM

*/
@RestController
public class ConsumeStructureController {
private static final Logger log = LogManager.getLogger(ConsumeStructureController.class);
......@@ -92,7 +98,7 @@ public class ConsumeStructureController {
goDownComponent.setValueTotal(params, levelVo);
ServiceResponse<Page<AgeConsumeAreaDTO>> response1 = consumeStructureApiService.pageAgeConsumeArea(params);
this.goDownComponent.parseTotal(response1, vo);
if(params.getChannel() != null && params.getChannel() == 1 && params.getLevel() == levelVo.getLevel()){
if(params.getChannel() != null && params.getChannel() == 1 && params.getLevel().intValue() == levelVo.getLevel()){
//无归属
params.setCountType(3);
goDownComponent.setValueWgs(params, levelVo);
......@@ -138,7 +144,7 @@ public class ConsumeStructureController {
goDownComponent.setValueTotal(params, levelVo);
ServiceResponse<Page<GradeConsumeAreaDTO>> response1 = consumeStructureApiService.pageGradeConsumeArea(params);
this.goDownComponent.parseTotal(response1, vo);
if(params.getChannel() != null && params.getChannel() == 1 && params.getLevel() == levelVo.getLevel()){
if(params.getChannel() != null && params.getChannel() == 1 && params.getLevel().intValue() == levelVo.getLevel()){
params.setCountType(3);
//无归属
goDownComponent.setValueWgs(params, levelVo);
......@@ -202,7 +208,7 @@ public class ConsumeStructureController {
goDownComponent.setValueTotal(params, levelVo);
ServiceResponse<Page<BirthConsumeAreaDTO>> response1 = consumeStructureApiService.pageBirthConsumeArea(params);
this.goDownComponent.parseTotal(response1, vo);
if(params.getChannel() != null && params.getChannel() == 1 && params.getLevel() == levelVo.getLevel()){
if(params.getChannel() != null && params.getChannel() == 1 && params.getLevel().intValue() == levelVo.getLevel()){
params.setCountType(3);
//无归属
goDownComponent.setValueWgs(params, levelVo);
......@@ -258,7 +264,7 @@ public class ConsumeStructureController {
goDownComponent.setValueTotal(params, levelVo);
ServiceResponse<Page<NewOldConsumeAreaDTO>> response1 = consumeStructureApiService.pageNewOldConsumeArea(params);
this.goDownComponent.parseTotal(response1, vo);
if(params.getChannel() != null && params.getChannel() == 1 && params.getLevel() == levelVo.getLevel()){
if(params.getChannel() != null && params.getChannel() == 1 && params.getLevel().intValue() == levelVo.getLevel()){
params.setCountType(3);
//无归属
goDownComponent.setValueWgs(params, levelVo);
......@@ -314,7 +320,7 @@ public class ConsumeStructureController {
goDownComponent.setValueTotal(params, levelVo);
ServiceResponse<Page<WhetherConsumeAreaDTO>> response1 = consumeStructureApiService.pageWhetherConsumeArea(params);
this.goDownComponent.parseTotal(response1, vo);
if(params.getChannel() != null && params.getChannel() == 1 && params.getLevel() == levelVo.getLevel()){
if(params.getChannel() != null && params.getChannel() == 1 && params.getLevel().intValue() == levelVo.getLevel()){
//无归属
params.setCountType(3);
goDownComponent.setValueWgs(params, levelVo);
......
......@@ -30,7 +30,13 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
/**
* 字典
* @ClassName: IndexController

* @Description: 

* @author zhiwj

* @date 2020/9/7 1:35 PM

*/
@RestController
public class IndexController {
private Logger log = LogManager.getLogger(IndexController.class);
......
......@@ -26,7 +26,13 @@ import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
* 登录
* @ClassName: LoginController

* @Description: 

* @author boom

* @date 2020/9/7 1:32 PM

*/
@RestController
public class LoginController {
private static final Logger log = LogManager.getLogger(LoginController.class);
......@@ -60,20 +66,22 @@ public class LoginController {
userVo.setPhoneNumber(phoneNumber);
userVo.setUserId(userDTOList.get(0).getUserId());
userVo.setUserName(userDTOList.get(0).getUserName());
//单域
String singleDomainCode = "basic";
enterpriseDTOList.stream().forEach(enterpriseDTO -> {
if(enterpriseDTO.getEnterpriseId().intValue() == enterpriseId.intValue()){
if(phoneNumber.equals(enterpriseDTO.getPhoneNumber())){
userVo.setIsAdmin(1);
}
if("basic".equals(enterpriseDTO.getVersionCode())){
if(singleDomainCode.equals(enterpriseDTO.getVersionCode())){
userVo.setIsSingle(1);
}else {
userVo.setIsSingle(0);
}
}
});
RedisUtil.setCache(key, userVo, 5l, TimeUnit.MINUTES);
//RedisUtil.setCache("userEnterpriseList:"+userVo.getUserId(), enterpriseDTOList);
RedisUtil.setCache(key, userVo, 5L, TimeUnit.MINUTES);
return RestResponse.success(enterpriseId);
}else {
return RestResponse.failure(ErrorCode.SYSTEMERROR.getCode(), smsSendResult.getMessage());
......
......@@ -26,7 +26,13 @@ import com.gic.data.api.dto.member.MemberRecruitAreaDTO;
import com.gic.data.api.qo.member.*;
import com.gic.data.api.service.member.MemberCloudDataApiService;
import com.gic.enterprise.utils.ResultControllerUtils;
/**
* 会员数据
* @ClassName: MemberCloudDataController

* @Description: 

* @author guojuxing

* @date 2020/9/7 1:38 PM

*/
@RestController
public class MemberCloudDataController {
private static final Logger log = LogManager.getLogger(MemberCloudDataController.class);
......@@ -78,7 +84,7 @@ public class MemberCloudDataController {
goDownComponent.setValueTotal(params, levelVo);
ServiceResponse<Page<MemberDistributionAreaDTO>> response1 = memberCloudDataApiService.pageMemberDistributionArea(params);
this.goDownComponent.parseTotal(response1, vo);
if(params.getChannel() != null && params.getChannel() == 1 && params.getLevel() == levelVo.getLevel()){
if(params.getChannel() != null && params.getChannel() == 1 && params.getLevel() == levelVo.getLevel().intValue()){
//无归属
params.setCountType(3);
goDownComponent.setValueWgs(params, levelVo);
......@@ -106,7 +112,7 @@ public class MemberCloudDataController {
goDownComponent.setValueTotal(params, levelVo);
ServiceResponse<Page<MemberRecruitAreaDTO>> response1 = memberCloudDataApiService.pageMemberRecruitArea(params);
this.goDownComponent.parseTotal(response1, vo);
if(params.getChannel() != null && params.getChannel() == 1 && params.getLevel() == levelVo.getLevel()){
if(params.getChannel() != null && params.getChannel() == 1 && params.getLevel() == levelVo.getLevel().intValue()){
//无归属
params.setCountType(3);
goDownComponent.setValueWgs(params, levelVo);
......
......@@ -12,7 +12,13 @@ import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.data.api.qo.performanceoverview.PerformanceOverviewQO;
import com.gic.data.api.service.performanceoverview.PerformanceOverviewApiService;
import com.gic.enterprise.utils.ResultControllerUtils;
/**
* 业绩概况
* @ClassName: PerformanceOverviewController

* @Description: 

* @author guojuxing

* @date 2020/9/7 1:35 PM

*/
@RestController
public class PerformanceOverviewController {
private static final Logger log = LogManager.getLogger(PerformanceOverviewController.class);
......
......@@ -15,7 +15,13 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
/**
* 关注门店
* @ClassName: StoreAttentionController

* @Description: 

* @author boom

* @date 2020/9/7 11:44 AM

*/
@RestController
public class StoreAttentionController {
@Autowired
......
......@@ -37,7 +37,13 @@ import org.springframework.stereotype.Component;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
* 门店查询工具
* @ClassName: StoreSearchUtils

* @Description: 

* @author boom

* @date 2020/9/7 1:34 PM

*/
@Component
public class StoreSearchUtils {
private static final Logger log = LogManager.getLogger(StoreSearchUtils.class);
......@@ -132,21 +138,11 @@ public class StoreSearchUtils {
}
}
}
}else {
if(CollectionUtils.isNotEmpty(storeAuth.getStoreInfoIdList())){
resultList = storeAuth.getStoreInfoIdList().stream().filter(s -> {
if(CollectionUtils.isNotEmpty(tempStoreIdListf)){
if(tempStoreIdListf.contains(s)){
return false;
}else {
return true;
}
}else return true;
}).collect(Collectors.toList());
}
} else {
resultList = storeSearchJsonWhenNull(storeAuth, tempStoreIdListf);
}
if(CollectionUtils.isNotEmpty(resultList)){
RedisUtil.setCache(key, 1, 10l, TimeUnit.MINUTES);
RedisUtil.setCache(key, 1, 10L, TimeUnit.MINUTES);
}else {
resultList.add(0);
}
......@@ -154,6 +150,23 @@ public class StoreSearchUtils {
return resultList;
}
private List<Integer> storeSearchJsonWhenNull(StoreAuth storeAuth, final List<Integer> tempStoreIdListf) {
if(CollectionUtils.isNotEmpty(storeAuth.getStoreInfoIdList())){
return storeAuth.getStoreInfoIdList().stream().filter(s -> {
if(CollectionUtils.isNotEmpty(tempStoreIdListf)){
if(tempStoreIdListf.contains(s)){
return false;
}else {
return true;
}
} else {
return true;
}
}).collect(Collectors.toList());
}
return new ArrayList<>();
}
public List<String> onLineStoreSearch(Integer userId, Integer enterpriseId, String searchJson){
OnLineAuth onlineStoreAuth = this.dataAuthUtils.getOnlineStore(userId, enterpriseId);
log.info("onlineStoreAuth:{}", JSON.toJSONString(onlineStoreAuth));
......@@ -179,7 +192,7 @@ public class StoreSearchUtils {
return vo;
}
List<StoreDTO> result = response.getResult().getResult();
Map<Integer, Integer> map = new HashMap<>();
Map<Integer, Integer> map = new HashMap<>(16);
result.forEach(storeDTO -> {
List<Integer> storeGroupIdList = storeDTO.getStoreGroupIdList();
if (CollectionUtils.isNotEmpty(storeGroupIdList)) {
......@@ -189,7 +202,7 @@ public class StoreSearchUtils {
}
});
List<StoreGroupDTO> allStoreGroupIdList = this.storeGroupApiService.listStoreGroupByIds(null, enterpriseId).getResult();
Map<Integer, Integer> levelMap = new HashMap<>();
Map<Integer, Integer> levelMap = new HashMap<>(16);
allStoreGroupIdList.forEach(storeGroupDTO -> {
if(map.containsKey(storeGroupDTO.getStoreGroupId())){
levelMap.put(storeGroupDTO.getGroupLevel(), levelMap.get(storeGroupDTO.getGroupLevel())== null ? 1 : levelMap.get(storeGroupDTO.getGroupLevel())+1);
......@@ -221,7 +234,8 @@ public class StoreSearchUtils {
int gicMall = RedisUtil.getCache(gicMallKey) == null ? 0 : 1;
int wm = RedisUtil.getCache(wmKey) == null ? 0 : 1;
int tm = RedisUtil.getCache(tmKey) == null ? 0 : 1;
if((offline + gicMall + wm + tm) > 1){ //多渠道
if((offline + gicMall + wm + tm) > 1){
//多渠道
return null;
}else if((offline + gicMall + wm + tm) == 1){
if(offline == 1){
......@@ -241,7 +255,8 @@ public class StoreSearchUtils {
}
public List<Integer> getChildrenStoreGroupIdList(Integer enterpriseId, Integer storeGroupId, Integer level){
if(level < 7){
int storeGroupLevel = 7;
if(level < storeGroupLevel){
if(storeGroupId != null){
List<StoreGroupDTO> result = this.storeGroupApiService.listStoreGroupAndChildren(storeGroupId).getResult();
if(CollectionUtils.isNotEmpty(result)){
......@@ -268,7 +283,7 @@ public class StoreSearchUtils {
if(searchQo != null){
if(searchQo.getAll() != 1){
if(StringUtils.isNotBlank(searchQo.getStoreGroupIds())){
RedisUtil.setCache(key, 1, 10l, TimeUnit.MINUTES);
RedisUtil.setCache(key, 1, 10L, TimeUnit.MINUTES);
list.addAll(Arrays.asList(searchQo.getStoreGroupIds().split(",")));
}
}
......@@ -278,7 +293,7 @@ public class StoreSearchUtils {
onlineStoreAuth.getList().stream().forEach(s -> {
if(s.getChannel() != null && s.getChannel().intValue() == channel.intValue()){
if(CollectionUtils.isNotEmpty(s.getStoreIdList())){
RedisUtil.setCache(key, 1, 10l, TimeUnit.MINUTES);
RedisUtil.setCache(key, 1, 10L, TimeUnit.MINUTES);
list.addAll(s.getStoreIdList());
}
}
......
package com.gic.cloud.web.qo;
/**
* 基础
* @ClassName: BaseSalesParamQo

* @Description: 

* @author boom

* @date 2020/9/7 1:37 PM

*/
public class BaseSalesParamQo {
private Integer channel;
private Integer userId;
......
package com.gic.cloud.web.qo;
/**
* 日期类型
* @ClassName: DateTypeQo

* @Description: 

* @author guojuxing

* @date 2020/9/7 1:35 PM

*/
public class DateTypeQo {
private Integer type;
private String date;
......
package com.gic.cloud.web.qo;
/**
* 门店查询
* @ClassName: StoreSearchQo

* @Description: 

* @author guojuxing

* @date 2020/9/7 1:35 PM

*/
public class StoreSearchQo {
private Integer all = 0;
private String region;
......@@ -9,9 +15,18 @@ public class StoreSearchQo {
private String storeTag;
private Integer attentionStore = 0;
private Integer tmpStore = 0;
private String storeGroupIds; //和线上共享使用,当为线上门店时,该值对应店铺
private String storeIds; //和线上共享使用,当为线上门店时,该值对应店铺下门店id
private Integer hasWgs = 0; //是否有无归属
/**
* 和线上共享使用,当为线上门店时,该值对应店铺
*/
private String storeGroupIds;
/**
* 和线上共享使用,当为线上门店时,该值对应店铺下门店id
*/
private String storeIds;
/**
* 是否有无归属
*/
private Integer hasWgs = 0;
public Integer getAll() {
return all;
......
......@@ -9,7 +9,13 @@ import org.springframework.http.converter.json.MappingJackson2HttpMessageConvert
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
/**
* 数据转化
* @ClassName: BigDecimalConvertUtils

* @Description: 

* @author boom

* @date 2020/9/7 1:39 PM

*/
@Component
public class BigDecimalConvertUtils {
@Bean
......@@ -26,7 +32,6 @@ public class BigDecimalConvertUtils {
simpleModule.addSerializer(String.class, new StringJsonSeralizer());
simpleModule.addSerializer(Long.class, ToStringSerializer.instance);
simpleModule.addSerializer(Long.TYPE, ToStringSerializer.instance);
//simpleModule.addSerializer(String.class, new StringJsonSeralizer());
objectMapper.registerModule(simpleModule);
jackson2HttpMessageConverter.setObjectMapper(objectMapper);
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
......
......@@ -7,7 +7,13 @@ import com.fasterxml.jackson.databind.SerializerProvider;
import java.io.IOException;
import java.math.BigDecimal;
/**
* 数据转化
* @ClassName: BigDecimalJsonSeralizer

* @Description: 

* @author boom

* @date 2020/9/7 1:39 PM

*/
public class BigDecimalJsonSeralizer extends JsonSerializer<BigDecimal> {
@Override
......
......@@ -11,6 +11,8 @@ import java.text.DecimalFormat;
*/
public class DataFormatUtils {
private static final Integer ONE_HUNDRED_THOUSAND = 100000;
/**
* 如果大于十万,则以万为单位,否则就是元作为单位
* @param data
......@@ -20,7 +22,8 @@ public class DataFormatUtils {
if (data == null) {
return "--";
}
if (data >= 100000) {
if (data >= ONE_HUNDRED_THOUSAND) {
return data / 10000 + "万";
}
return data + "";
......
......@@ -2,7 +2,13 @@ package com.gic.cloud.web.utils;
import java.util.HashMap;
import java.util.Map;
/**
* 区域层级
* @ClassName: LevelUtil

* @Description: 

* @author boom

* @date 2020/9/7 1:38 PM

*/
public class LevelUtil {
private static Map<Integer, String> levelMap = new HashMap<>();
......
......@@ -10,14 +10,21 @@ import java.io.IOException;
import java.math.BigDecimal;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* 数据转化
* @ClassName: StringJsonSeralizer

* @Description: 

* @author boom

* @date 2020/9/7 1:38 PM

*/
public class StringJsonSeralizer extends JsonSerializer<String> {
private static Pattern NUMBER_PATTERN = Pattern.compile("\\d+\\.\\d+$|-\\d+\\.\\d+$");
@Override
public void serialize(String value, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException, JsonProcessingException {
if(StringUtils.isNotBlank(value)){
Pattern pattern = Pattern.compile("\\d+\\.\\d+$|-\\d+\\.\\d+$");
Matcher isNum = pattern.matcher(value);
Matcher isNum = NUMBER_PATTERN.matcher(value);
if(isNum.matches()){
BigDecimal decimal = new BigDecimal(value).setScale(2, BigDecimal.ROUND_HALF_UP);
jsonGenerator.writeString(decimal.toString());
......
package com.gic.cloud.web.vo;
import com.gic.api.base.commons.Page;
/**
* 基础类
* @ClassName: BaseSalesVo

* @Description: 

* @author boom

* @date 2020/9/7 1:37 PM

*/
public class BaseSalesVo<T> {
private Page<T> page;
private T total;
......
package com.gic.cloud.web.vo;
/**
* 信息
* @ClassName: EnterpriseVo

* @Description: 

* @author boom

* @date 2020/9/7 1:39 PM

*/
public class EnterpriseVo {
private static final long serialVersionUID = -2344967926907229689L;
private Integer enterpriseId;
......
package com.gic.cloud.web.vo;
import java.io.Serializable;
/**
* 指标
* @ClassName: IndexItemVo

* @Description: 

* @author guojuxing

* @date 2020/9/7 1:31 PM

*/
public class IndexItemVo implements Serializable {
private String id;
private String name;
......
package com.gic.cloud.web.vo;
/**
* 区域层级
* @ClassName: LevelNameVo

* @Description: 

* @author boom

* @date 2020/9/7 1:38 PM

*/
public class LevelNameVo {
private Integer level = 0;
private String levelName;
......
package com.gic.cloud.web.vo;
/**
* 分组层级
* @ClassName: LevelVo

* @Description: 

* @author guojuxing

* @date 2020/9/7 1:37 PM

*/
public class LevelVo {
private Integer level = 1;
private Integer maxLevel = 1;
......
package com.gic.cloud.web.vo;
import java.io.Serializable;
/**
* 登录用户
* @ClassName: LoginUserVo

* @Description: 

* @author guojuxing

* @date 2020/9/7 11:45 AM

*/
public class LoginUserVo implements Serializable {
private Integer userId;
private Integer enterpriseId;
......
package com.gic.cloud.web.vo;
/**
* 会员卡
* @ClassName: MbrVo

* @Description: 

* @author guojuxing

* @date 2020/9/7 1:36 PM

*/
public class MbrVo {
private String mbrAreaId;
private String mbrAreaName;
......
package com.gic.cloud.web.vo;
/**
* 上线门店
* @ClassName: OnLineStoreVo

* @Description: 

* @author guojuxing

* @date 2020/9/7 1:33 PM

*/
public class OnLineStoreVo {
private String id;
private String name;
......
package com.gic.cloud.web.vo;
/**
* 关注门店
* @ClassName: StoreAttenttionVo

* @Description: 

* @author guojuxing

* @date 2020/9/7 1:33 PM

*/
public class StoreAttenttionVo {
private Integer storeId;
private String storeName;
......
package com.gic.cloud.web.vo;
/**
* 门店分组
* @ClassName: StoreGroupItemsVo

* @Description: 

* @author guojuxing

* @date 2020/9/7 1:33 PM

*/
public class StoreGroupItemsVo {
private Integer id;
private String name;
......
package com.gic.cloud.web.vo;
import java.util.List;
/**
* 门店分组
* @ClassName: StoreGroupVo

* @Description: 

* @author guojuxing

* @date 2020/9/7 1:32 PM

*/
public class StoreGroupVo {
private Integer storeGroupId;
......
package com.gic.cloud.web.vo;
/**
* 门店查询条件
* @ClassName: StoreSearchVo

* @Description: 

* @author guojuxing

* @date 2020/9/7 1:33 PM

*/
public class StoreSearchVo {
private String id;
private String name;
......
package com.gic.cloud.web.vo;
/**
* 门店类型
* @ClassName: StoreTypeVo

* @Description: 

* @author guojuxing

* @date 2020/9/7 1:32 PM

*/
public class StoreTypeVo {
private String id;
private String name;
......
package com.gic.cloud.web.vo;
import java.util.List;
/**
* 门店
* @ClassName: StoreWidgetIndexVo

* @Description: 

* @author guojuxing

* @date 2020/9/7 1:31 PM

*/
public class StoreWidgetIndexVo {
/****1多渠道首页 2单渠道线下首页 3单渠道线上首页****/
private Integer type;
......
package com.gic.cloud.web.vo;
/**
* 门店选择
* @ClassName: StoreWidgetItemVo

* @Description: 

* @author guojuxing

* @date 2020/9/7 1:34 PM

*/
public class StoreWidgetItemVo {
private String id;
private String name;
......
package com.gic.cloud.web.vo;
public class T extends Object {
}
package com.gic.cloud.web.vo.index;
/**
* 首页
* @ClassName: IndexConsume

* @Description: 

* @author boom

* @date 2020/9/7 1:36 PM

*/
public class IndexConsume {
private String memberRate = "--";
private String oldRate = "--";
......
package com.gic.cloud.web.vo.index;
/**
* 首页
* @ClassName: IndexMemberVo

* @Description: 

* @author boom

* @date 2020/9/7 1:36 PM

*/
public class IndexMemberVo {
private String newMember;
private String totalMember;
......
package com.gic.cloud.web.vo.index;
/**
* 首页
* @ClassName: IndexSalesVo

* @Description: 

* @author boom

* @date 2020/9/7 1:36 PM

*/
public class IndexSalesVo {
private String totalSales = "0元";
private String perf = "0元";
......
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