|
@@ -10,12 +10,10 @@ import com.zfjg.common.core.domain.R;
|
|
|
import com.zfjg.common.core.exception.ServiceException;
|
|
|
import com.zfjg.common.core.utils.StringUtils;
|
|
|
import com.zfjg.common.core.utils.bean.BeanUtils;
|
|
|
-import com.zfjg.common.core.web.domain.AjaxResult;
|
|
|
import com.zfjg.common.core.web.page.TableInfo;
|
|
|
import com.zfjg.manage.api.domain.other.WReport;
|
|
|
import com.zfjg.manage.api.dto.other.WReportDto;
|
|
|
import com.zfjg.manage.api.dto.other.WReportQuery;
|
|
|
-import com.zfjg.manage.api.vo.other.WReportDetailVO;
|
|
|
import com.zfjg.manage.api.vo.other.WReportVo;
|
|
|
import com.zfjg.manage.mapper.other.WReportMapper;
|
|
|
import com.zfjg.manage.service.other.IWReportService;
|
|
@@ -23,16 +21,11 @@ import com.zfjg.manage.service.other.WReportBizService;
|
|
|
import com.zfjg.system.api.RemoteUserService;
|
|
|
import com.zfjg.system.api.domain.SysDept;
|
|
|
import com.zfjg.system.api.domain.SysUser;
|
|
|
-import com.zfjg.system.api.model.LoginUser;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
-
|
|
|
import javax.annotation.Resource;
|
|
|
import java.time.LocalDateTime;
|
|
|
-import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
import java.util.Optional;
|
|
|
-import java.util.stream.Collector;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -123,11 +116,15 @@ public class WReportServiceImpl extends ServiceImpl<WReportMapper, WReport> impl
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public TableInfo<?> listReport(WReportQuery wReportQuery) {
|
|
|
+ public TableInfo<WReportVo> listReport(WReportQuery wReportQuery) {
|
|
|
QueryWrapper<WReport> queryWrapper = new QueryWrapper<>();
|
|
|
if (StringUtils.isNoneBlank(wReportQuery.getOrgId())) {
|
|
|
queryWrapper.eq("org_id", wReportQuery.getOrgId());
|
|
|
}
|
|
|
+ if (StringUtils.isNoneBlank(wReportQuery.getYear())){
|
|
|
+ queryWrapper.ge("create_time", wReportQuery.getYear());
|
|
|
+ queryWrapper.le("create_time", wReportQuery.getYear());
|
|
|
+ }
|
|
|
if (StringUtils.isNoneBlank(wReportQuery.getUsername())) {
|
|
|
R<SysUser> info2 = remoteUserService.getInfo2(wReportQuery.getUsername(), SecurityConstants.INNER);
|
|
|
queryWrapper.eq("w_user", info2.getData().getNickName());
|
|
@@ -139,7 +136,8 @@ public class WReportServiceImpl extends ServiceImpl<WReportMapper, WReport> impl
|
|
|
queryWrapper.lt("create_time", wReportQuery.getEndTime());
|
|
|
}
|
|
|
queryWrapper.groupBy("org_id");
|
|
|
- queryWrapper.select("id", "org_id", "org_name", "w_user", "create_time", "w_type", "sum(w_type_c) as w_type_c", "n_type", "sum(n_type_c) as n_type_c", "s_type", "sum(s_type_c) as s_type_c");
|
|
|
+ queryWrapper.select("ANY_VALUE(id) as id", "ANY_VALUE(org_id) as org_id", "ANY_VALUE(org_name) as org_name", "ANY_VALUE(w_user) as w_user", "ANY_VALUE(create_time) as create_time", "ANY_VALUE(w_type) as w_type", "sum(w_type_c) as w_type_c", "ANY_VALUE(n_type) as n_type", "sum(n_type_c) as n_type_c", "ANY_VALUE(s_type) as s_type", "sum(s_type_c) as s_type_c");
|
|
|
+// queryWrapper.select("id", "org_id", "org_name", "w_user", "create_time", "w_type", "w_type_c", "n_type", "n_type_c", "s_type", "as s_type_c");
|
|
|
List<WReport> wReports = this.list(queryWrapper);
|
|
|
|
|
|
|
|
@@ -166,4 +164,58 @@ public class WReportServiceImpl extends ServiceImpl<WReportMapper, WReport> impl
|
|
|
reportVoPageInfo.setRows(wReportVos);
|
|
|
return reportVoPageInfo;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<WReportVo> getList(WReportQuery wReportQuery) {
|
|
|
+ QueryWrapper<WReport> queryWrapper = new QueryWrapper<>();
|
|
|
+ if (StringUtils.isNoneBlank(wReportQuery.getOrgId())) {
|
|
|
+ queryWrapper.eq("org_id", wReportQuery.getOrgId());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNoneBlank(wReportQuery.getYear())){
|
|
|
+ queryWrapper.ge("create_time", wReportQuery.getYear());
|
|
|
+ queryWrapper.le("create_time", wReportQuery.getYear());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNoneBlank(wReportQuery.getUsername())) {
|
|
|
+ R<SysUser> info2 = remoteUserService.getInfo2(wReportQuery.getUsername(), SecurityConstants.INNER);
|
|
|
+ queryWrapper.eq("w_user", info2.getData().getNickName());
|
|
|
+ }
|
|
|
+ if (ObjectUtil.isNotEmpty(wReportQuery.getStartTime())) {
|
|
|
+ queryWrapper.gt("create_time", wReportQuery.getStartTime());
|
|
|
+ }
|
|
|
+ if (ObjectUtil.isNotEmpty(wReportQuery.getEndTime())) {
|
|
|
+ queryWrapper.lt("create_time", wReportQuery.getEndTime());
|
|
|
+ }
|
|
|
+ queryWrapper.groupBy("org_id");
|
|
|
+ queryWrapper.select("ANY_VALUE(id) as id", "ANY_VALUE(org_id) as org_id", "ANY_VALUE(org_name) as org_name", "ANY_VALUE(w_user) as w_user", "ANY_VALUE(create_time) as create_time", "ANY_VALUE(w_type) as w_type", "sum(w_type_c) as w_type_c", "ANY_VALUE(n_type) as n_type", "sum(n_type_c) as n_type_c", "ANY_VALUE(s_type) as s_type", "sum(s_type_c) as s_type_c");
|
|
|
+// queryWrapper.select("id", "org_id", "org_name", "w_user", "create_time", "w_type", "w_type_c", "n_type", "n_type_c", "s_type", "as s_type_c");
|
|
|
+ List<WReport> wReports = this.list(queryWrapper);
|
|
|
+
|
|
|
+
|
|
|
+ TableInfo<WReportVo> reportVoPageInfo = new TableInfo<>();
|
|
|
+ BeanUtils.copyProperties(wReports, reportVoPageInfo);
|
|
|
+ List<WReportVo> wReportVos = wReports.stream().map(it -> {
|
|
|
+ WReportVo wReportVo = new WReportVo();
|
|
|
+ wReportVo.setId(it.getId());
|
|
|
+ wReportVo.setOrgId(it.getOrgId());
|
|
|
+ wReportVo.setOrgName(it.getOrgName());
|
|
|
+ wReportVo.setWUser(it.getWUser());
|
|
|
+ Integer i = Optional.ofNullable(it.getWTypeC()).orElse(0);
|
|
|
+ Integer i1 = Optional.ofNullable(it.getNTypeC()).orElse(0);
|
|
|
+ Integer i2 = Optional.ofNullable(it.getSTypeC()).orElse(0);
|
|
|
+ wReportVo.setDCount(it.getWTypeC());
|
|
|
+ wReportVo.setNCount(it.getNTypeC());
|
|
|
+ wReportVo.setWCount(it.getSTypeC());
|
|
|
+ Integer i3 = i + i1 + i2;
|
|
|
+ wReportVo.setACount(i3);
|
|
|
+ wReportVo.setCreateTime(it.getCreateTime());
|
|
|
+ return wReportVo;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ return wReportVos;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public WReport info(Long id) {
|
|
|
+ return this.getById(id);
|
|
|
+ }
|
|
|
+
|
|
|
}
|