Browse Source

新增导出方法;修改接种管理-用户管理

feature/vim
YUJT 4 years ago
parent
commit
3069f4872f
  1. 2
      epdc-cloud-commons-yushan
  2. 2
      epdc-cloud-custom/src/main/resources/logback-spring.xml
  3. 15
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/controller/EpidemicUserInfoController.java
  4. 46
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/impl/EpidemicUserInfoExportServer.java
  5. 8
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationUserRoleServiceImpl.java
  6. 2
      epdc-cloud-vim-yushan/src/main/resources/application.yml
  7. 1
      epdc-cloud-vim-yushan/src/main/resources/logback-spring.xml
  8. 3
      epdc-cloud-vim-yushan/src/main/resources/mapper/epidemic/EpidemicUserInfoDao.xml
  9. 13
      epdc-cloud-vim-yushan/src/main/resources/mapper/vim/VaccinationUserRoleDao.xml

2
epdc-cloud-commons-yushan

@ -1 +1 @@
Subproject commit 5b077ffda98e46ce47e9c5540dabbc50f092968d
Subproject commit 4bc760d91246751ea4d99ab2e382518f87389ed0

2
epdc-cloud-custom/src/main/resources/logback-spring.xml

@ -139,6 +139,8 @@
<logger name="com.elink.esua.epdc.modules.issue.dao" level="DEBUG"/>
<logger name="com.elink.esua.epdc.modules.enterprise.dao" level="DEBUG"/>
<logger name="com.elink.esua.epdc.modules.consult.dao" level="DEBUG"/>
<logger name="com.elink.esua.epdc.vaccine.epidemic.dao" level="DEBUG"/>
<logger name="com.elink.esua.epdc.vaccine.vim.dao" level="DEBUG"/>
<root level="INFO">
<appender-ref ref="DEBUG_FILE"/>
<appender-ref ref="INFO_FILE"/>

15
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/controller/EpidemicUserInfoController.java

@ -20,6 +20,8 @@ import com.elink.esua.epdc.vaccine.epidemic.dto.result.EpidemicPageResultDTO;
import com.elink.esua.epdc.vaccine.epidemic.dto.result.VaccinationInfoResultDTO;
import com.elink.esua.epdc.vaccine.epidemic.excel.EpidecmicUserNewExcel;
import com.elink.esua.epdc.vaccine.epidemic.service.EpidemicUserInfoService;
import com.elink.esua.epdc.vaccine.epidemic.service.impl.EpidemicUserInfoExportServer;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -39,9 +41,13 @@ import java.util.Map;
@RestController
@RequestMapping("epidemicuserinfo")
public class EpidemicUserInfoController {
@Autowired
private EpidemicUserInfoService epidemicUserInfoService;
@Autowired
private EpidemicUserInfoExportServer exportServer;
@GetMapping("page")
public Result<PageData<EpidemicRecordListDTO>> page(@RequestParam Map<String, Object> params) {
// 按人员往返时间倒序排列
@ -83,6 +89,14 @@ public class EpidemicUserInfoController {
return epidemicUserInfoService.deleteUserById(ids);
}
@GetMapping("export")
@LogOperation("导出")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
ExportParams exportParams = new ExportParams();
exportParams.setHeight((short) (2 * 256));
ExcelUtils.exportBigExcel(StringUtils.EMPTY, params, exportServer, response, new ExportParams(), EpidecmicUserNewExcel.class);
}
/*
@GetMapping("export")
@LogOperation("导出")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
@ -90,6 +104,7 @@ public class EpidemicUserInfoController {
ExcelUtils.exportExcelToTarget(response, null, list, EpidecmicUserNewExcel.class);
}
*/
/**
* @return io.pingyin.common.utils.Result<io.pingyin.common.page.PageData < io.pingyin.modules.epidemic.dto.result.EpidemicPageResultDTO>>

46
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/impl/EpidemicUserInfoExportServer.java

@ -0,0 +1,46 @@
package com.elink.esua.epdc.vaccine.epidemic.service.impl;
import cn.afterturn.easypoi.handler.inter.IExcelExportServer;
import cn.hutool.core.collection.CollUtil;
import com.elink.esua.epdc.vaccine.epidemic.dao.EpidemicUserInfoDao;
import com.elink.esua.epdc.vaccine.epidemic.dto.EpidemicRecordListDTO;
import com.elink.esua.epdc.vaccine.epidemic.excel.EpidecmicUserNewExcel;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* 人员信息数据导出
*
* @author work@yujt.net.cn
* @date 2021/6/17 14:04
*/
@Service
public class EpidemicUserInfoExportServer implements IExcelExportServer {
@Autowired
private EpidemicUserInfoDao epidemicUserInfoDao;
@Override
public List<Object> selectListForExcelExport(Object queryParams, int page) {
Map<String, Object> params = (Map<String, Object>) queryParams;
params.put("excelBigDataPageSize", 50000);
params.put("excelBigDataPageIndex", (page - 1) * 50000);
List<EpidemicRecordListDTO> recordList = epidemicUserInfoDao.getEpidemicUserRecordList(params);
List<Object> targetList = new ArrayList<>();
if (CollUtil.isNotEmpty(recordList)) {
Object target;
for (int i = 0; i < recordList.size(); i++) {
target = new EpidecmicUserNewExcel();
BeanUtils.copyProperties(recordList.get(i), target);
targetList.add(target);
}
}
return targetList;
}
}

8
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationUserRoleServiceImpl.java

@ -17,6 +17,8 @@
package com.elink.esua.epdc.vaccine.vim.service.impl;
import cn.hutool.core.map.MapUtil;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
@ -71,6 +73,12 @@ public class VaccinationUserRoleServiceImpl extends BaseVimCurdServiceImpl<Vacci
@Override
public PageData<VaccinationUserRoleDTO> page(Map<String, Object> params) {
String userIdStr = MapUtil.getStr(params, "userIdList");
if (StringUtils.isBlank(userIdStr)) {
params.put("userIdList", new ArrayList<>());
} else {
params.put("userIdList", JSONArray.parseArray(userIdStr));
}
IPage<VaccinationUserRoleEntity> page = getPage(params, FieldConstant.CREATED_TIME, false);
List<VaccinationUserRoleDTO> list = baseDao.getList(params);
return new PageData<>(list, page.getTotal());

2
epdc-cloud-vim-yushan/src/main/resources/application.yml

@ -25,4 +25,4 @@ mybatis-plus:
map-underscore-to-camel-case: true
cache-enabled: false
call-setters-on-nulls: true
jdbc-type-for-null: 'null'
jdbc-type-for-null: 'null'

1
epdc-cloud-vim-yushan/src/main/resources/logback-spring.xml

@ -6,7 +6,6 @@
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="INFO"/>
<logger name="com.elink.esua.epdc" level="INFO"/>
<logger name="com.elink.esua.epdc.optimize.modules.macode.dao" level="DEBUG"/>
<root level="INFO">
<appender-ref ref="DEBUG_FILE"/>
<appender-ref ref="INFO_FILE"/>

3
epdc-cloud-vim-yushan/src/main/resources/mapper/epidemic/EpidemicUserInfoDao.xml

@ -126,6 +126,9 @@
</if>
GROUP BY ui.ID
ORDER BY uir.CREATED_TIME DESC
<if test="excelBigDataPageSize != null and excelBigDataPageIndex != null">
limit #{excelBigDataPageIndex},#{excelBigDataPageSize}
</if>
</select>
<select id="getDetailById" resultType="com.elink.esua.epdc.vaccine.epidemic.dto.EpidemicRecordDetailDTO">
SELECT

13
epdc-cloud-vim-yushan/src/main/resources/mapper/vim/VaccinationUserRoleDao.xml

@ -17,18 +17,19 @@
<select id="getList" resultType="com.elink.esua.epdc.vaccine.vim.dto.VaccinationUserRoleDTO">
SELECT
ur.*, u.username AS userName,
ur.*,
group_concat(r.ROLE_NAME) AS roleNames
FROM
vaccination_user_role ur
INNER JOIN sys_user u ON u.id = ur.USER_ID
INNER JOIN vaccination_role r ON r.id = ur.ROLE_ID
WHERE
ur.DEL_FLAG = '0'
AND u.del_flag = '0'
AND r.DEL_FLAG = '0'
<if test="userName != null and userName != ''">
AND u.username LIKE concat('%', #{userName}, '%')
AND r.DEL_FLAG = '0'
<if test="userIdList != null and userIdList.size()>0">
AND ur.USER_ID in
<foreach collection="userIdList" open="(" close=")" separator="," item="userId">
#{userId}
</foreach>
</if>
GROUP BY
ur.USER_ID

Loading…
Cancel
Save