|
|
@@ -16,6 +16,11 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
+import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
+import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
+import com.google.common.reflect.TypeToken;
|
|
|
+import com.google.gson.Gson;
|
|
|
import com.ydtech.aop.exception.DescribeException;
|
|
|
import com.ydtech.constants.enums.WechatOpenSystem;
|
|
|
import com.ydtech.core.page.HttpResult;
|
|
|
@@ -42,6 +47,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.lang.reflect.Type;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
@@ -776,7 +782,8 @@ public class SysPartnerServiceImpl extends ServiceImpl<SysPartnerMapper, SysPart
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public AppPartnerNumVo getHomePage(Integer type) {
|
|
|
+ public AppPartnerNumVo
|
|
|
+ getHomePage(Integer type) {
|
|
|
AppPartnerNumVo appPartnerNumVo = new AppPartnerNumVo();
|
|
|
//合伙人:1 ;工作室管理员:2
|
|
|
String userId = BaseController.getUserId();
|
|
|
@@ -1402,16 +1409,35 @@ public class SysPartnerServiceImpl extends ServiceImpl<SysPartnerMapper, SysPart
|
|
|
SysPremiumDetails::getCreateTime, commissionInfoDto.getBeginTime(), commissionInfoDto.getEndTime())
|
|
|
.orderByDesc(SysPremiumDetails::getId).eq(SysPremiumDetails::getStatus,1));
|
|
|
|
|
|
- Map<String, Object> stringObjectMap = sysPremiumDetailsMapper.queryInfoPage(userId, commissionInfoDto);
|
|
|
+ List<Map<String, Object>> stringObjectList = sysPremiumDetailsMapper.queryInfoPage(userId, commissionInfoDto);
|
|
|
|
|
|
- if (CollectionUtil.isEmpty(stringObjectMap)) return new BasePageResult<>(commissionInfoDto.getPageNum(), page.getSize(), 0L, 0L,
|
|
|
+ if (CollectionUtil.isEmpty(stringObjectList)) return new BasePageResult<>(commissionInfoDto.getPageNum(), page.getSize(), 0L, 0L,
|
|
|
list);
|
|
|
+ Map<String, List<SysPremiumDetails>> listMap = new HashMap<>();
|
|
|
+ for (Map<String, Object> stringObjectMap : stringObjectList) {
|
|
|
+ String companyId = (String) stringObjectMap.get("companyId");
|
|
|
+ Object json = stringObjectMap.get("sysPremiumDetails");
|
|
|
+// Gson gson = new Gson();
|
|
|
+// Type type = new TypeToken<List<SysPremiumDetails>>() {}.getType();
|
|
|
+// List<SysPremiumDetails> sysPremiumDetails1 = gson.fromJson(json.toString(),type);
|
|
|
+ String s ="["+ json.toString()+"]";
|
|
|
+
|
|
|
+ ObjectMapper objectMapper = new ObjectMapper();
|
|
|
+ objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
|
|
|
+ List<SysPremiumDetails> sysPremiumDetails1 = null;
|
|
|
+ try {
|
|
|
+ sysPremiumDetails1 = objectMapper.readValue(s , new TypeReference<List<SysPremiumDetails>>() {});
|
|
|
+ } catch (JsonProcessingException e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
+ listMap.put(companyId,sysPremiumDetails1);
|
|
|
|
|
|
+ }
|
|
|
|
|
|
- Map<String, List<SysPremiumDetails>> listMap = sysPremiumDetails.stream().sorted(Comparator.comparing(SysPremiumDetails::getId))
|
|
|
- .collect(Collectors.groupingBy(SysPremiumDetails::getCompanyId));
|
|
|
+// Map<String, List<SysPremiumDetails>> listMap = sysPremiumDetails.stream().sorted(Comparator.comparing(SysPremiumDetails::getId))
|
|
|
+// .collect(Collectors.groupingBy(SysPremiumDetails::getCompanyId));
|
|
|
for (String key : listMap.keySet()) {
|
|
|
List<SysPremiumInfoVo> proportionList = new ArrayList<>();
|
|
|
SysPremiumDetailsVo sysPremiumDetailsVo = new SysPremiumDetailsVo();
|
|
|
@@ -1460,10 +1486,10 @@ public class SysPartnerServiceImpl extends ServiceImpl<SysPartnerMapper, SysPart
|
|
|
list.add(sysPremiumDetailsVo);
|
|
|
}
|
|
|
|
|
|
- List<SysPremiumDetailsVo> collect = list.stream().limit(page.getSize()).collect(Collectors.toList());
|
|
|
+// List<SysPremiumDetailsVo> collect = list.stream().limit(page.getSize()).collect(Collectors.toList());
|
|
|
long l = (list.size()+page.getSize()-1)/page.getSize();
|
|
|
return new BasePageResult<>(commissionInfoDto.getPageNum(), page.getSize(), list.size(), l,
|
|
|
- collect);
|
|
|
+ list);
|
|
|
}
|
|
|
|
|
|
@Override
|