Browse Source

Merge remote-tracking branch 'origin/feature/lc_order'

feature/syp_points
liuchuang 5 years ago
parent
commit
6a6199b40a
  1. 86
      esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/ArchivesDeptDTO.java
  2. 92
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archives/service/impl/ArchivesServiceImpl.java
  3. 94
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/controller/ArchivesDeptController.java
  4. 33
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/dao/ArchivesDeptDao.java
  5. 56
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/entity/ArchivesDeptEntity.java
  6. 62
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/excel/ArchivesDeptExcel.java
  7. 47
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/redis/ArchivesDeptRedis.java
  8. 105
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/service/ArchivesDeptService.java
  9. 120
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/service/impl/ArchivesDeptServiceImpl.java
  10. 11
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/archives/ArchivesDao.xml
  11. 20
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/archivesdept/ArchivesDeptDao.xml
  12. 6
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/VolunteerInfoDTO.java
  13. 15
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/VolunteerInfoController.java
  14. 5
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/VolunteerInfoEntity.java
  15. 8
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml

86
esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/ArchivesDeptDTO.java

@ -0,0 +1,86 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 档案部门排序表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-07-30
*/
@Data
public class ArchivesDeptDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 归属部门
*/
private String dept;
/**
* 排序
*/
private Integer deptOrder;
/**
* 归属部门ID
*/
private Long deptId;
/**
* 删除标识 0-1-
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

92
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archives/service/impl/ArchivesServiceImpl.java

@ -43,6 +43,7 @@ import com.elink.esua.epdc.modules.archives.entity.ArchivesEntity;
import com.elink.esua.epdc.modules.archives.excel.ArchivesExcel; import com.elink.esua.epdc.modules.archives.excel.ArchivesExcel;
import com.elink.esua.epdc.modules.archives.redis.ArchivesRedis; import com.elink.esua.epdc.modules.archives.redis.ArchivesRedis;
import com.elink.esua.epdc.modules.archives.service.ArchivesService; import com.elink.esua.epdc.modules.archives.service.ArchivesService;
import com.elink.esua.epdc.modules.archivesdept.service.ArchivesDeptService;
import com.elink.esua.epdc.modules.feign.AdminFeignClient; import com.elink.esua.epdc.modules.feign.AdminFeignClient;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -71,6 +72,9 @@ public class ArchivesServiceImpl extends BaseServiceImpl<ArchivesDao, ArchivesEn
@Autowired @Autowired
private AdminFeignClient adminFeignClient; private AdminFeignClient adminFeignClient;
@Autowired
private ArchivesDeptService archivesDeptService;
@Override @Override
public PageData<ArchivesDTO> page(Map<String, Object> params) { public PageData<ArchivesDTO> page(Map<String, Object> params) {
IPage<ArchivesEntity> page = baseDao.selectPage( IPage<ArchivesEntity> page = baseDao.selectPage(
@ -87,8 +91,8 @@ public class ArchivesServiceImpl extends BaseServiceImpl<ArchivesDao, ArchivesEn
return ConvertUtils.sourceToTarget(entityList, ArchivesDTO.class); return ConvertUtils.sourceToTarget(entityList, ArchivesDTO.class);
} }
private QueryWrapper<ArchivesEntity> getWrapper(Map<String, Object> params){ private QueryWrapper<ArchivesEntity> getWrapper(Map<String, Object> params) {
String id = (String)params.get(FieldConstant.ID_HUMP); String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<ArchivesEntity> wrapper = new QueryWrapper<>(); QueryWrapper<ArchivesEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
@ -99,8 +103,8 @@ public class ArchivesServiceImpl extends BaseServiceImpl<ArchivesDao, ArchivesEn
@Override @Override
public ArchivesDTO get(String id) { public ArchivesDTO get(String id) {
ArchivesEntity entity = baseDao.selectById(id); ArchivesEntity entity = baseDao.selectById(id);
ArchivesDTO archivesDTO = ConvertUtils.sourceToTarget(entity, ArchivesDTO.class); ArchivesDTO archivesDTO = ConvertUtils.sourceToTarget(entity, ArchivesDTO.class);
if(archivesDTO.getAllDeptIds().indexOf(",")!=-1){ if (archivesDTO.getAllDeptIds().indexOf(",") != -1) {
archivesDTO.setAllDeptIdsShow(Arrays.asList(entity.getAllDeptIds().split(","))); archivesDTO.setAllDeptIdsShow(Arrays.asList(entity.getAllDeptIds().split(",")));
} }
return archivesDTO; return archivesDTO;
@ -110,19 +114,19 @@ public class ArchivesServiceImpl extends BaseServiceImpl<ArchivesDao, ArchivesEn
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void save(ArchivesDTO dto) { public void save(ArchivesDTO dto) {
//获取部门信息 //获取部门信息
if(dto.getDeptId() == null){ if (dto.getDeptId() == null) {
throw new RenException("归属部门不能为空"); throw new RenException("归属部门不能为空");
} }
Result<ParentAndAllDeptDTO> parentAndAllDept = adminFeignClient.getParentAndAllDept(dto.getDeptId()); Result<ParentAndAllDeptDTO> parentAndAllDept = adminFeignClient.getParentAndAllDept(dto.getDeptId());
if(!parentAndAllDept.success() || parentAndAllDept.getData() == null){ if (!parentAndAllDept.success() || parentAndAllDept.getData() == null) {
throw new RenException("获取归属部门信息失败"); throw new RenException("获取归属部门信息失败");
} }
//判断档号 //判断档号
if(baseDao.getArchivesDTOByArchivesNum("",dto.getArchivesNum())){ if (baseDao.getArchivesDTOByArchivesNum("", dto.getArchivesNum())) {
throw new RenException("档号不能重复"); throw new RenException("档号不能重复");
} }
//判断日期 //判断日期
if(dto.getArchiveTime().length()!=4 && dto.getArchiveTime().length()!=6 && dto.getArchiveTime().length()!=8) { if (dto.getArchiveTime().length() != 4 && dto.getArchiveTime().length() != 6 && dto.getArchiveTime().length() != 8) {
throw new RenException("日期格式错误"); throw new RenException("日期格式错误");
} }
ParentAndAllDeptDTO parentAndAllDeptDTO = parentAndAllDept.getData(); ParentAndAllDeptDTO parentAndAllDeptDTO = parentAndAllDept.getData();
@ -133,25 +137,27 @@ public class ArchivesServiceImpl extends BaseServiceImpl<ArchivesDao, ArchivesEn
dto.setDept(parentAndAllDeptDTO.getGrid()); dto.setDept(parentAndAllDeptDTO.getGrid());
ArchivesEntity entity = ConvertUtils.sourceToTarget(dto, ArchivesEntity.class); ArchivesEntity entity = ConvertUtils.sourceToTarget(dto, ArchivesEntity.class);
insert(entity); insert(entity);
// 插入排序表
archivesDeptService.modifyArchives(dto.getDeptId(), dto.getDept());
} }
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void update(ArchivesDTO dto) { public void update(ArchivesDTO dto) {
//获取部门信息 //获取部门信息
if(dto.getDeptId() == null){ if (dto.getDeptId() == null) {
throw new RenException("归属部门不能为空"); throw new RenException("归属部门不能为空");
} }
Result<ParentAndAllDeptDTO> parentAndAllDept = adminFeignClient.getParentAndAllDept(dto.getDeptId()); Result<ParentAndAllDeptDTO> parentAndAllDept = adminFeignClient.getParentAndAllDept(dto.getDeptId());
if(!parentAndAllDept.success() || parentAndAllDept.getData() == null){ if (!parentAndAllDept.success() || parentAndAllDept.getData() == null) {
throw new RenException("获取归属部门信息失败"); throw new RenException("获取归属部门信息失败");
} }
//判断档号 //判断档号
if(baseDao.getArchivesDTOByArchivesNum(dto.getId(),dto.getArchivesNum())){ if (baseDao.getArchivesDTOByArchivesNum(dto.getId(), dto.getArchivesNum())) {
throw new RenException("档号不能重复"); throw new RenException("档号不能重复");
} }
//判断日期 //判断日期
if(dto.getArchiveTime().length()!=4 && dto.getArchiveTime().length()!=6 && dto.getArchiveTime().length()!=8) { if (dto.getArchiveTime().length() != 4 && dto.getArchiveTime().length() != 6 && dto.getArchiveTime().length() != 8) {
throw new RenException("日期格式错误"); throw new RenException("日期格式错误");
} }
ParentAndAllDeptDTO parentAndAllDeptDTO = parentAndAllDept.getData(); ParentAndAllDeptDTO parentAndAllDeptDTO = parentAndAllDept.getData();
@ -162,6 +168,8 @@ public class ArchivesServiceImpl extends BaseServiceImpl<ArchivesDao, ArchivesEn
dto.setDept(parentAndAllDeptDTO.getGrid()); dto.setDept(parentAndAllDeptDTO.getGrid());
ArchivesEntity entity = ConvertUtils.sourceToTarget(dto, ArchivesEntity.class); ArchivesEntity entity = ConvertUtils.sourceToTarget(dto, ArchivesEntity.class);
updateById(entity); updateById(entity);
// 插入排序表
archivesDeptService.modifyArchives(dto.getDeptId(), dto.getDept());
} }
@Override @Override
@ -198,11 +206,11 @@ public class ArchivesServiceImpl extends BaseServiceImpl<ArchivesDao, ArchivesEn
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Result insertArchivesList(MultipartFile file, String deptId) { public Result insertArchivesList(MultipartFile file, String deptId) {
if(StringUtils.isBlank(deptId)){ if (StringUtils.isBlank(deptId)) {
throw new RenException("归属部门不能为空"); throw new RenException("归属部门不能为空");
} }
Result<ParentAndAllDeptDTO> parentAndAllDept = adminFeignClient.getParentAndAllDept(Long.parseLong(deptId)); Result<ParentAndAllDeptDTO> parentAndAllDept = adminFeignClient.getParentAndAllDept(Long.parseLong(deptId));
if(!parentAndAllDept.success() || parentAndAllDept.getData() == null){ if (!parentAndAllDept.success() || parentAndAllDept.getData() == null) {
throw new RenException("获取归属部门信息失败"); throw new RenException("获取归属部门信息失败");
} }
ParentAndAllDeptDTO parentAndAllDeptDTO = parentAndAllDept.getData(); ParentAndAllDeptDTO parentAndAllDeptDTO = parentAndAllDept.getData();
@ -212,10 +220,10 @@ public class ArchivesServiceImpl extends BaseServiceImpl<ArchivesDao, ArchivesEn
List<ArchivesExcel> archivesExcelList = ExcelImportUtil.importExcel(f, ArchivesExcel.class, importParams); List<ArchivesExcel> archivesExcelList = ExcelImportUtil.importExcel(f, ArchivesExcel.class, importParams);
// 校验数据 // 校验数据
List<EpdcArchivesErroyResultDTO> epdcArchivesErroyResultDTOS = this.checkExcel(archivesExcelList); List<EpdcArchivesErroyResultDTO> epdcArchivesErroyResultDTOS = this.checkExcel(archivesExcelList);
if(epdcArchivesErroyResultDTOS.size()>0){ if (epdcArchivesErroyResultDTOS.size() > 0) {
return new Result().ok(epdcArchivesErroyResultDTOS); return new Result().ok(epdcArchivesErroyResultDTOS);
} }
saveList(archivesExcelList,parentAndAllDeptDTO); saveList(archivesExcelList, parentAndAllDeptDTO);
for (ArchivesExcel archivesExcel : archivesExcelList) { for (ArchivesExcel archivesExcel : archivesExcelList) {
System.out.println("从Excel导入数据到数据库的详细为 :{}" + JSON.toJSONString(archivesExcel)); System.out.println("从Excel导入数据到数据库的详细为 :{}" + JSON.toJSONString(archivesExcel));
} }
@ -231,7 +239,7 @@ public class ArchivesServiceImpl extends BaseServiceImpl<ArchivesDao, ArchivesEn
int pageIndex = (formDTO.getPageIndex() - NumConstant.ONE) * formDTO.getPageSize(); int pageIndex = (formDTO.getPageIndex() - NumConstant.ONE) * formDTO.getPageSize();
formDTO.setPageIndex(pageIndex); formDTO.setPageIndex(pageIndex);
List<ArchiveDeptResultDTO> listArchiveDeptInfo = this.baseDao.selectListArchiveDeptInfo(formDTO); List<ArchiveDeptResultDTO> listArchiveDeptInfo = this.baseDao.selectListArchiveDeptInfo(formDTO);
return new Result().ok(listArchiveDeptInfo); return new Result().ok(listArchiveDeptInfo);
} }
@ -240,7 +248,7 @@ public class ArchivesServiceImpl extends BaseServiceImpl<ArchivesDao, ArchivesEn
int pageIndex = (formDTO.getPageIndex() - NumConstant.ONE) * formDTO.getPageSize(); int pageIndex = (formDTO.getPageIndex() - NumConstant.ONE) * formDTO.getPageSize();
formDTO.setPageIndex(pageIndex); formDTO.setPageIndex(pageIndex);
List<ArchiveResultDTO> listArchiveInfo = this.baseDao.selectListArchiveInfo(formDTO); List<ArchiveResultDTO> listArchiveInfo = this.baseDao.selectListArchiveInfo(formDTO);
return new Result().ok(listArchiveInfo); return new Result().ok(listArchiveInfo);
} }
@ -258,10 +266,10 @@ public class ArchivesServiceImpl extends BaseServiceImpl<ArchivesDao, ArchivesEn
*/ */
private void saveList(List<ArchivesExcel> partyList, ParentAndAllDeptDTO parentAndAllDeptDTO) { private void saveList(List<ArchivesExcel> partyList, ParentAndAllDeptDTO parentAndAllDeptDTO) {
List<ArchivesEntity> archivesEntityList = new ArrayList<>(); List<ArchivesEntity> archivesEntityList = new ArrayList<>();
for(ArchivesExcel archivesExcel : partyList){ for (ArchivesExcel archivesExcel : partyList) {
ArchivesEntity archivesEntity = ConvertUtils.sourceToTarget(archivesExcel, ArchivesEntity.class); ArchivesEntity archivesEntity = ConvertUtils.sourceToTarget(archivesExcel, ArchivesEntity.class);
if(archivesExcel.getArchiveTime().length()!=4 && archivesExcel.getArchiveTime().length()!=6 && archivesExcel.getArchiveTime().length()!=8) { if (archivesExcel.getArchiveTime().length() != 4 && archivesExcel.getArchiveTime().length() != 6 && archivesExcel.getArchiveTime().length() != 8) {
throw new RenException("日期格式错误"); throw new RenException("日期格式错误");
} }
archivesEntity.setAllDeptIds(parentAndAllDeptDTO.getAllDeptIds()); archivesEntity.setAllDeptIds(parentAndAllDeptDTO.getAllDeptIds());
@ -273,6 +281,10 @@ public class ArchivesServiceImpl extends BaseServiceImpl<ArchivesDao, ArchivesEn
archivesEntityList.add(archivesEntity); archivesEntityList.add(archivesEntity);
} }
insertBatch(archivesEntityList); insertBatch(archivesEntityList);
for (ArchivesEntity item : archivesEntityList) {
// 插入排序表
archivesDeptService.modifyArchives(parentAndAllDeptDTO.getGridId(), parentAndAllDeptDTO.getGrid());
}
} }
/*** /***
@ -283,7 +295,7 @@ public class ArchivesServiceImpl extends BaseServiceImpl<ArchivesDao, ArchivesEn
*/ */
private List<EpdcArchivesErroyResultDTO> checkExcel(List<ArchivesExcel> archivesList) { private List<EpdcArchivesErroyResultDTO> checkExcel(List<ArchivesExcel> archivesList) {
List<ArchivesEntity> archivesEntityList = baseDao.selectList(new QueryWrapper<ArchivesEntity>()); List<ArchivesEntity> archivesEntityList = baseDao.selectList(new QueryWrapper<ArchivesEntity>());
List<EpdcArchivesErroyResultDTO> errorLineinfoList=new ArrayList<>(); List<EpdcArchivesErroyResultDTO> errorLineinfoList = new ArrayList<>();
EpdcArchivesErroyResultDTO errorLineinfoDto; EpdcArchivesErroyResultDTO errorLineinfoDto;
for (int i = 0; i < archivesList.size(); i++) { for (int i = 0; i < archivesList.size(); i++) {
ArchivesExcel archivesExcel = archivesList.get(i); ArchivesExcel archivesExcel = archivesList.get(i);
@ -296,47 +308,47 @@ public class ArchivesServiceImpl extends BaseServiceImpl<ArchivesDao, ArchivesEn
//页数 //页数
Integer pageSize = archivesExcel.getPageSize(); Integer pageSize = archivesExcel.getPageSize();
//责任人 //责任人
String responsible=archivesExcel.getResponsible(); String responsible = archivesExcel.getResponsible();
if (StringUtils.isBlank(archivesNum)) { if (StringUtils.isBlank(archivesNum)) {
errorLineinfoDto=new EpdcArchivesErroyResultDTO(); errorLineinfoDto = new EpdcArchivesErroyResultDTO();
errorLineinfoDto.setErroLine((i+2)+""); errorLineinfoDto.setErroLine((i + 2) + "");
errorLineinfoDto.setErrorInfo("档号为空"); errorLineinfoDto.setErrorInfo("档号为空");
errorLineinfoList.add(errorLineinfoDto); errorLineinfoList.add(errorLineinfoDto);
} }
if (StringUtils.isBlank(responsible)) { if (StringUtils.isBlank(responsible)) {
errorLineinfoDto=new EpdcArchivesErroyResultDTO(); errorLineinfoDto = new EpdcArchivesErroyResultDTO();
errorLineinfoDto.setErroLine((i+2)+""); errorLineinfoDto.setErroLine((i + 2) + "");
errorLineinfoDto.setErrorInfo("责任人为空"); errorLineinfoDto.setErrorInfo("责任人为空");
errorLineinfoList.add(errorLineinfoDto); errorLineinfoList.add(errorLineinfoDto);
} }
if (StringUtils.isBlank(title)) { if (StringUtils.isBlank(title)) {
errorLineinfoDto=new EpdcArchivesErroyResultDTO(); errorLineinfoDto = new EpdcArchivesErroyResultDTO();
errorLineinfoDto.setErroLine((i+2)+""); errorLineinfoDto.setErroLine((i + 2) + "");
errorLineinfoDto.setErrorInfo("题名为空"); errorLineinfoDto.setErrorInfo("题名为空");
errorLineinfoList.add(errorLineinfoDto); errorLineinfoList.add(errorLineinfoDto);
} }
if(StringUtils.isBlank(archiveTime)){ if (StringUtils.isBlank(archiveTime)) {
errorLineinfoDto=new EpdcArchivesErroyResultDTO(); errorLineinfoDto = new EpdcArchivesErroyResultDTO();
errorLineinfoDto.setErroLine((i+2)+""); errorLineinfoDto.setErroLine((i + 2) + "");
errorLineinfoDto.setErrorInfo("日期为空"); errorLineinfoDto.setErrorInfo("日期为空");
errorLineinfoList.add(errorLineinfoDto); errorLineinfoList.add(errorLineinfoDto);
} }
if(StringUtils.isNotBlank(archiveTime) && archiveTime.length()!=4 && archiveTime.length()!=6 && archiveTime.length()!=8){ if (StringUtils.isNotBlank(archiveTime) && archiveTime.length() != 4 && archiveTime.length() != 6 && archiveTime.length() != 8) {
errorLineinfoDto=new EpdcArchivesErroyResultDTO(); errorLineinfoDto = new EpdcArchivesErroyResultDTO();
errorLineinfoDto.setErroLine((i+2)+""); errorLineinfoDto.setErroLine((i + 2) + "");
errorLineinfoDto.setErrorInfo("日期格式不正确"); errorLineinfoDto.setErrorInfo("日期格式不正确");
errorLineinfoList.add(errorLineinfoDto); errorLineinfoList.add(errorLineinfoDto);
} }
if (pageSize == null) { if (pageSize == null) {
errorLineinfoDto=new EpdcArchivesErroyResultDTO(); errorLineinfoDto = new EpdcArchivesErroyResultDTO();
errorLineinfoDto.setErroLine((i+2)+""); errorLineinfoDto.setErroLine((i + 2) + "");
errorLineinfoDto.setErrorInfo("页数为空"); errorLineinfoDto.setErrorInfo("页数为空");
errorLineinfoList.add(errorLineinfoDto); errorLineinfoList.add(errorLineinfoDto);
} }
for (ArchivesEntity item:archivesEntityList) { for (ArchivesEntity item : archivesEntityList) {
if(StringUtils.isNotBlank(item.getArchivesNum())&&item.getArchivesNum().equals(archivesNum)){ if (StringUtils.isNotBlank(item.getArchivesNum()) && item.getArchivesNum().equals(archivesNum)) {
errorLineinfoDto=new EpdcArchivesErroyResultDTO(); errorLineinfoDto = new EpdcArchivesErroyResultDTO();
errorLineinfoDto.setErroLine((i+2)+""); errorLineinfoDto.setErroLine((i + 2) + "");
errorLineinfoDto.setErrorInfo("档号已存在"); errorLineinfoDto.setErrorInfo("档号已存在");
errorLineinfoList.add(errorLineinfoDto); errorLineinfoList.add(errorLineinfoDto);
} }

94
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/controller/ArchivesDeptController.java

@ -0,0 +1,94 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.archivesdept.controller;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.dto.ArchivesDeptDTO;
import com.elink.esua.epdc.modules.archivesdept.excel.ArchivesDeptExcel;
import com.elink.esua.epdc.modules.archivesdept.service.ArchivesDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 档案部门排序表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-07-30
*/
@RestController
@RequestMapping("archivesdept")
public class ArchivesDeptController {
@Autowired
private ArchivesDeptService archivesDeptService;
@GetMapping("page")
public Result<PageData<ArchivesDeptDTO>> page(@RequestParam Map<String, Object> params){
PageData<ArchivesDeptDTO> page = archivesDeptService.page(params);
return new Result<PageData<ArchivesDeptDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<ArchivesDeptDTO> get(@PathVariable("id") String id){
ArchivesDeptDTO data = archivesDeptService.get(id);
return new Result<ArchivesDeptDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody ArchivesDeptDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
archivesDeptService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody ArchivesDeptDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
archivesDeptService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
archivesDeptService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<ArchivesDeptDTO> list = archivesDeptService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, ArchivesDeptExcel.class);
}
}

33
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/dao/ArchivesDeptDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.archivesdept.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.modules.archivesdept.entity.ArchivesDeptEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 档案部门排序表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-07-30
*/
@Mapper
public interface ArchivesDeptDao extends BaseDao<ArchivesDeptEntity> {
}

56
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/entity/ArchivesDeptEntity.java

@ -0,0 +1,56 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.archivesdept.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 档案部门排序表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-07-30
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_archives_dept")
public class ArchivesDeptEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 归属部门
*/
private String dept;
/**
* 归属部门ID
*/
private Long deptId;
/**
* 排序
*/
private Integer deptOrder;
}

62
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/excel/ArchivesDeptExcel.java

@ -0,0 +1,62 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.archivesdept.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 档案部门排序表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-07-30
*/
@Data
public class ArchivesDeptExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "归属部门")
private String dept;
@Excel(name = "归属部门ID")
private Long deptId;
@Excel(name = "删除标识 0-否,1-是")
private String delFlag;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

47
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/redis/ArchivesDeptRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.archivesdept.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 档案部门排序表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-07-30
*/
@Component
public class ArchivesDeptRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

105
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/service/ArchivesDeptService.java

@ -0,0 +1,105 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.archivesdept.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.dto.ArchivesDeptDTO;
import com.elink.esua.epdc.modules.archivesdept.entity.ArchivesDeptEntity;
import java.util.List;
import java.util.Map;
/**
* 档案部门排序表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-07-30
*/
public interface ArchivesDeptService extends BaseService<ArchivesDeptEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ArchivesDeptDTO>
* @author generator
* @date 2020-07-30
*/
PageData<ArchivesDeptDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<ArchivesDeptDTO>
* @author generator
* @date 2020-07-30
*/
List<ArchivesDeptDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return ArchivesDeptDTO
* @author generator
* @date 2020-07-30
*/
ArchivesDeptDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-07-30
*/
void save(ArchivesDeptDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-07-30
*/
void update(ArchivesDeptDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-07-30
*/
void delete(String[] ids);
/***
* 新增或修改
* @param deptId
* @return com.elink.esua.epdc.dto.ArchivesDeptDTO
* @author qushutong
* @date 2020/7/30 13:31
*/
boolean modifyArchives(Long deptId,String dept);
}

120
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/service/impl/ArchivesDeptServiceImpl.java

@ -0,0 +1,120 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.archivesdept.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.modules.archivesdept.dao.ArchivesDeptDao;
import com.elink.esua.epdc.dto.ArchivesDeptDTO;
import com.elink.esua.epdc.modules.archivesdept.entity.ArchivesDeptEntity;
import com.elink.esua.epdc.modules.archivesdept.redis.ArchivesDeptRedis;
import com.elink.esua.epdc.modules.archivesdept.service.ArchivesDeptService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 档案部门排序表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-07-30
*/
@Service
public class ArchivesDeptServiceImpl extends BaseServiceImpl<ArchivesDeptDao, ArchivesDeptEntity> implements ArchivesDeptService {
@Autowired
private ArchivesDeptRedis archivesDeptRedis;
@Override
public PageData<ArchivesDeptDTO> page(Map<String, Object> params) {
IPage<ArchivesDeptEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, ArchivesDeptDTO.class);
}
@Override
public List<ArchivesDeptDTO> list(Map<String, Object> params) {
List<ArchivesDeptEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ArchivesDeptDTO.class);
}
private QueryWrapper<ArchivesDeptEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
String dept = (String) params.get("dept");
QueryWrapper<ArchivesDeptEntity> wrapper = new QueryWrapper<>();
wrapper.like(StringUtils.isNotBlank(dept), "dept", dept);
wrapper.orderByAsc("DEPT_ORDER");
return wrapper;
}
@Override
public ArchivesDeptDTO get(String id) {
ArchivesDeptEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, ArchivesDeptDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ArchivesDeptDTO dto) {
ArchivesDeptEntity entity = ConvertUtils.sourceToTarget(dto, ArchivesDeptEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ArchivesDeptDTO dto) {
ArchivesDeptEntity entity = ConvertUtils.sourceToTarget(dto, ArchivesDeptEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public boolean modifyArchives(Long deptId,String dept) {
QueryWrapper wrapper = new QueryWrapper();
wrapper.eq("DEPT_ID", deptId);
ArchivesDeptEntity archivesDeptEntity = baseDao.selectOne(wrapper);
if(archivesDeptEntity==null){
// 没有新增一条
ArchivesDeptEntity archivesDept =new ArchivesDeptEntity();
archivesDept.setDept(dept);
archivesDept.setDeptId(deptId);
return insert(archivesDept);
}
return true;
}
}

11
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/archives/ArchivesDao.xml

@ -76,7 +76,16 @@
<select id="selectListArchiveDeptInfo" resultType="com.elink.esua.epdc.dto.result.ArchiveDeptResultDTO"> <select id="selectListArchiveDeptInfo" resultType="com.elink.esua.epdc.dto.result.ArchiveDeptResultDTO">
select DEPT,DEPT_ID from epdc_archives where DEL_FLAG = '0' group by DEPT_ID ORDER BY DEPT LIMIT #{pageIndex},#{pageSize} SELECT
DEPT,
DEPT_ID
FROM
epdc_archives_dept
WHERE
DEL_FLAG = '0'
ORDER BY
DEPT_ORDER ASC
LIMIT #{pageIndex},#{pageSize}
</select> </select>
<select id="selectListArchiveInfo" resultType="com.elink.esua.epdc.dto.result.ArchiveResultDTO"> <select id="selectListArchiveInfo" resultType="com.elink.esua.epdc.dto.result.ArchiveResultDTO">

20
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/archivesdept/ArchivesDeptDao.xml

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.modules.archivesdept.dao.ArchivesDeptDao">
<resultMap type="com.elink.esua.epdc.modules.archivesdept.entity.ArchivesDeptEntity" id="archivesDeptMap">
<result property="id" column="ID"/>
<result property="dept" column="DEPT"/>
<result property="deptOrder" column="DEPT_ORDER"/>
<result property="deptId" column="DEPT_ID"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

6
esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/VolunteerInfoDTO.java

@ -211,4 +211,10 @@ public class VolunteerInfoDTO implements Serializable {
* 志愿者签名 * 志愿者签名
*/ */
private String volunteerSignature; private String volunteerSignature;
/**
* 志愿者排序
*/
private Integer volunteerOrder;
} }

15
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/VolunteerInfoController.java

@ -108,11 +108,20 @@ public class VolunteerInfoController {
public Result volunteerInfoCheck(@RequestBody VolunteerInfoDTO dto) { public Result volunteerInfoCheck(@RequestBody VolunteerInfoDTO dto) {
return volunteerInfoService.volunteerInfoCheck(dto); return volunteerInfoService.volunteerInfoCheck(dto);
} }
/***
* 只能修改排序
* @param formDto
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @author qushutong
* @date 2020/7/29 16:44
*/
@PutMapping @PutMapping
public Result update(@RequestBody VolunteerInfoDTO dto) { public Result update(@RequestBody VolunteerInfoDTO formDto) {
//效验数据 //效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); // ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
VolunteerInfoDTO dto = new VolunteerInfoDTO();
dto.setVolunteerOrder(formDto.getVolunteerOrder());
dto.setId(formDto.getId());
volunteerInfoService.update(dto); volunteerInfoService.update(dto);
return new Result(); return new Result();
} }

5
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/VolunteerInfoEntity.java

@ -148,4 +148,9 @@ public class VolunteerInfoEntity extends DeptScope {
* 志愿者签名 * 志愿者签名
*/ */
private String volunteerSignature; private String volunteerSignature;
/**
* 志愿者排序
*/
private Integer volunteerOrder;
} }

8
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml

@ -54,7 +54,8 @@
u.POINTS points, u.POINTS points,
date_format(v.REGIST_TIME,'%Y.%m.%d %H.%i') registTimeString, date_format(v.REGIST_TIME,'%Y.%m.%d %H.%i') registTimeString,
v.REGIST_TIME registTime, v.REGIST_TIME registTime,
v.AUDIT_STATUS auditStatus v.AUDIT_STATUS auditStatus,
v.VOLUNTEER_ORDER volunteerOrder
FROM FROM
epdc_volunteer_info v epdc_volunteer_info v
left join epdc_user u on v.USER_ID = u.ID and u.del_flag = '0' left join epdc_user u on v.USER_ID = u.ID and u.del_flag = '0'
@ -103,7 +104,8 @@
v.INTRODUCE introduce, v.INTRODUCE introduce,
u.POINTS points, u.POINTS points,
date_format(v.REGIST_TIME,'%Y.%m.%d %H.%i') registTimeString, date_format(v.REGIST_TIME,'%Y.%m.%d %H.%i') registTimeString,
v.REGIST_TIME registTime v.REGIST_TIME registTime,
v.VOLUNTEER_ORDER volunteerOrder
FROM FROM
epdc_volunteer_info v left join epdc_user u on v.USER_ID = u.ID epdc_volunteer_info v left join epdc_user u on v.USER_ID = u.ID
where v.ID = #{id} where v.ID = #{id}
@ -221,7 +223,7 @@
WHERE WHERE
v.DEL_FLAG = 0 v.DEL_FLAG = 0
AND v.AUDIT_STATUS != 2 AND v.AUDIT_STATUS != 2
ORDER BY CONVERT(v.VOLUNTEER_NICKNAME USING gbk) ORDER BY v.VOLUNTEER_ORDER ASC ,CONVERT(v.VOLUNTEER_NICKNAME USING gbk)
LIMIT #{pageIndex},#{pageSize} LIMIT #{pageIndex},#{pageSize}
</select> </select>

Loading…
Cancel
Save