Browse Source

Merge remote-tracking branch 'origin/房屋tree_yzm'

dev
yinzuomei 3 years ago
parent
commit
de0340f18b
  1. 3
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java
  2. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  3. 6
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java
  4. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitDTO.java
  5. 7
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivityFormDTO.java
  6. 7
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitFormDTO.java
  7. 88
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java
  8. 93
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java
  9. 36
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityExcel.java
  10. 41
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitExcel.java
  11. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java
  12. 6
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
  13. BIN
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/icpartyactivity_import_tem.xlsx
  14. BIN
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/icpartyunit_impoort_tem.xlsx
  15. 14
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/ChangeWelfareDTO.java
  16. 6
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java
  17. 4
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcTripReportFormDTO.java
  18. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java
  19. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/ChangeWelfareEntity.java
  20. 18
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/ChangeWelfareExcel.java
  21. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/ChangeWelfareImportExcel.java
  22. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/ChangeWelfareService.java
  23. 35
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/ChangeWelfareServiceImpl.java
  24. 17
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java
  25. 4
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.94__pli_change_welfare.sql
  26. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/pli_change_welfare.xlsx
  27. 16
      epmet-user/epmet-user-server/src/main/resources/mapper/ChangeWelfareDao.xml

3
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java

@ -88,11 +88,12 @@ public class CustomerStaffRedis {
private static CustomerStaffInfoCache reloadStaffCache(String staffId, String key) {
Result<CustomerStaffInfoCache> staffResult = customerStaffRedis.commonAggFeignClient.getStaffInfo(staffId);
if (staffResult == null || !staffResult.success()) {
log.error("/data/aggregator/epmetuser/getStaffInfo/{staffId} 异常 staffId: ",staffId);
throw new RenException("获取工作人员信息失败");
}
CustomerStaffInfoCache resultData = staffResult.getData();
if (resultData == null) {
log.warn("getStaffInfo staff is null,staffId:{}", staffId);
log.error("getStaffInfo staff is null,staffId:{}", staffId);
return null;
}

4
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java

@ -9,7 +9,6 @@ import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.form.IdAndNameDTO;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.OrgTypeEnum;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
@ -56,9 +55,9 @@ import com.epmet.dataaggre.service.opercustomize.CustomerFootBarService;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.UserBaseInfoDTO;
import com.epmet.dto.form.DetailByTypeFormDTO;
import com.epmet.dto.form.GetStaffExistRoleFormDTO;
import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.dto.result.DetailByTypeResultDTO;
import com.epmet.dto.form.GetStaffExistRoleFormDTO;
import com.epmet.dto.result.NewUserRoleResultDTO;
import com.epmet.dto.result.StaffRoleResultDTO;
import com.epmet.feign.EpmetMessageOpenFeignClient;
@ -638,6 +637,7 @@ public class EpmetUserServiceImpl implements EpmetUserService {
.eq(CustomerStaffEntity::getDelFlag,NumConstant.ZERO_STR);
CustomerStaffEntity staffEntity = customerStaffDao.selectOne(queryWrapper);
if (null == staffEntity) {
log.error(String.format("customer_staff is null staffId:%s",staffId));
return null;
}
CustomerStaffResultDTO result = ConvertUtils.sourceToTarget(staffEntity, CustomerStaffResultDTO.class);

6
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java

@ -179,5 +179,9 @@ public class IcPartyActivityDTO implements Serializable {
*/
@JsonIgnore
private Date updatedTime;
/**
* actId不为空小程序
* 为空管理平台
*/
private String originName;
}

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitDTO.java

@ -86,6 +86,11 @@ public class IcPartyUnitDTO implements Serializable {
*/
private List<String> serviceMatterNameList;
/**
* 服务事项名称多个按照中文顿号隔开
*/
private String serviceMatterName;
/**
* 联系人
*/

7
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivityFormDTO.java

@ -1,5 +1,6 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
@ -15,7 +16,7 @@ import java.util.Date;
*/
@NoArgsConstructor
@Data
public class PartyActivityFormDTO implements Serializable {
public class PartyActivityFormDTO extends PageFormDTO implements Serializable {
private static final long serialVersionUID = -2510068555703677L;
@NotBlank(message = "组织Id不能为空" )
private String agencyId;
@ -27,7 +28,7 @@ public class PartyActivityFormDTO implements Serializable {
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date endTime;
private String serviceMatter;
private Integer pageNo;
private Integer pageSize;
// private Integer pageNo;
// private Integer pageSize;
private String customerId;
}

7
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitFormDTO.java

@ -1,5 +1,6 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import lombok.NoArgsConstructor;
@ -12,7 +13,7 @@ import java.io.Serializable;
*/
@NoArgsConstructor
@Data
public class PartyUnitFormDTO implements Serializable {
public class PartyUnitFormDTO extends PageFormDTO implements Serializable {
private static final long serialVersionUID = 1256798619648265622L;
private String customerId;
@ -22,8 +23,8 @@ public class PartyUnitFormDTO implements Serializable {
private String type;
private String contact;
private String contactMobile;
private Integer pageNo;
private Integer pageSize;
// private Integer pageNo;
// private Integer pageSize;
/**
* 工作端当前登录人员

88
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java

@ -17,15 +17,21 @@
package com.epmet.controller;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
@ -41,18 +47,21 @@ import com.epmet.service.IcPartyActivityService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.Date;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
/**
@ -111,23 +120,36 @@ public class IcPartyActivityController {
}
@PostMapping("export")
public void export(@RequestBody PartyActivityFormDTO formDTO, HttpServletResponse response) throws Exception {
List<IcPartyActivityDTO> list = icPartyActivityService.list(formDTO);
List<IcPartyActivityExcel> excelList = new ArrayList<>();
AtomicInteger i = new AtomicInteger(1);
if (CollectionUtils.isNotEmpty(list)) {
excelList = list.stream().map(item -> {
IcPartyActivityExcel excel = new IcPartyActivityExcel();
excel.setIndex(i.getAndIncrement());
excel.setUnitName(item.getUnitName());
excel.setTitle(item.getTitle());
excel.setAddress(item.getAddress());
excel.setPeopleCount(item.getPeopleCount());
excel.setActivityTime(DateUtils.format(item.getActivityTime(), DateUtils.DATE_TIME_PATTERN));
return excel;
}).collect(Collectors.toList());
}
ExcelUtils.exportExcelToTarget(response, null, excelList, IcPartyActivityExcel.class);
public void export(@LoginUser TokenDto tokenDto, @RequestBody PartyActivityFormDTO formDTO, HttpServletResponse response) throws Exception {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setIsPage(false);
ExcelWriter excelWriter = null;
formDTO.setPageSize(NumConstant.TEN_THOUSAND);
int pageNo = formDTO.getPageNo();
try {
// 这里 需要指定写用哪个class去写
String today= DateUtils.format(new Date(),DateUtils.DATE_PATTERN_MMDD);
String fileName = "联建活动".concat(today);
excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcPartyActivityExcel.class).build();
WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build();
PageData<IcPartyActivityDTO> data = null;
List<IcPartyActivityExcel> list = null;
do {
data = icPartyActivityService.search(formDTO);
list = ConvertUtils.sourceToTarget(data.getList(), IcPartyActivityExcel.class);
formDTO.setPageNo(++pageNo);
excelWriter.write(list, writeSheet);
} while (CollectionUtils.isNotEmpty(data.getList()) && data.getList().size() == formDTO.getPageSize());
} catch (Exception e) {
log.error("export exception", e);
} finally {
// 千万别忘记finish 会帮忙关闭流
if (excelWriter != null) {
excelWriter.finish();
}
}
}
/**
@ -214,4 +236,30 @@ public class IcPartyActivityController {
PageData<IcPartyActivityDTO> page = icPartyActivityService.getActivityList(tokenDto, formDTO);
return new Result<PageData<IcPartyActivityDTO>>().ok(page);
}
/**
* 下载联建活动导入模板
* @param response
* @throws IOException
*/
@RequestMapping(value = "import-template-download", method = {RequestMethod.GET, RequestMethod.POST})
public void downloadTemplate(HttpServletResponse response) throws IOException {
response.setCharacterEncoding("UTF-8");
response.addHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, "Content-Disposition");
//response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.ms-excel");
response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("联建活动导入模板", "UTF-8") + ".xlsx");
InputStream is = this.getClass().getClassLoader().getResourceAsStream("templates/icpartyactivity_import_tem.xlsx");
try {
ServletOutputStream os = response.getOutputStream();
IOUtils.copy(is, os);
} finally {
if (is != null) {
is.close();
}
}
}
}

93
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java

@ -1,16 +1,24 @@
package com.epmet.controller;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.OptionDataResultDTO;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
@ -27,19 +35,23 @@ import com.epmet.service.IcPartyUnitService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.nio.file.Path;
import java.util.ArrayList;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.Date;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
@ -59,11 +71,6 @@ public class IcPartyUnitController {
@Resource
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
/**
* 联建单位上传临时目录
*/
private Path IC_PARTY_UNIT_UPLOAD_DIR;
/**
* 联建单位-列表查询
@ -117,25 +124,38 @@ public class IcPartyUnitController {
@PostMapping("export")
public void export(@LoginUser TokenDto tokenDto, @RequestBody PartyUnitFormDTO formDTO, HttpServletResponse response) throws Exception {
formDTO.setCustomerId(tokenDto.getCustomerId());
List<IcPartyUnitDTO> list = icPartyUnitService.list(formDTO);
List<IcPartyUnitExcel> excelList = new ArrayList<>();
AtomicInteger i = new AtomicInteger(1);
if (CollectionUtils.isNotEmpty(list)) {
excelList = list.stream().map(item -> {
IcPartyUnitExcel excel = new IcPartyUnitExcel();
excel.setIndex(i.getAndIncrement());
excel.setUnitName(item.getUnitName());
excel.setContact(item.getContact());
excel.setContactMobile(item.getContactMobile());
excel.setType(item.getType());
excel.setMemberCount(item.getMemberCount());
excel.setRemark(item.getRemark());
excel.setSatisfaction(item.getSatisfaction());
excel.setServiceMatter(String.join(String.valueOf((char) 10), item.getServiceMatterList()));
return excel;
formDTO.setIsPage(false);
formDTO.setCurrentStaffId(tokenDto.getUserId());
ExcelWriter excelWriter = null;
formDTO.setPageSize(NumConstant.TEN_THOUSAND);
int pageNo = formDTO.getPageNo();
try {
// 这里 需要指定写用哪个class去写
String today= DateUtils.format(new Date(),DateUtils.DATE_PATTERN_MMDD);
String fileName = "联建单位".concat(today);
excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcPartyUnitExcel.class).build();
WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build();
PageData<IcPartyUnitDTO> data = null;
List<IcPartyUnitExcel> list = null;
do {
data = icPartyUnitService.search(formDTO);
data.getList().stream().map(item -> {
item.setServiceMatterName(StringUtils.join(item.getServiceMatterList(), StrConstant.COMMA_ZH));
return item;
}).collect(Collectors.toList());
list = ConvertUtils.sourceToTarget(data.getList(), IcPartyUnitExcel.class);
formDTO.setPageNo(++pageNo);
excelWriter.write(list, writeSheet);
} while (CollectionUtils.isNotEmpty(data.getList()) && data.getList().size() == formDTO.getPageSize());
} catch (Exception e) {
log.error("export exception", e);
} finally {
// 千万别忘记finish 会帮忙关闭流
if (excelWriter != null) {
excelWriter.finish();
}
}
ExcelUtils.exportExcelToTarget(response, null, excelList, IcPartyUnitExcel.class);
}
/**
@ -330,4 +350,27 @@ public class IcPartyUnitController {
return new Result();
}
/**
* 下载联建单位导入模板
* @param response
* @throws IOException
*/
@RequestMapping(value = "import-template-download", method = {RequestMethod.GET, RequestMethod.POST})
public void downloadTemplate(HttpServletResponse response) throws IOException {
response.setCharacterEncoding("UTF-8");
response.addHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, "Content-Disposition");
//response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.ms-excel");
response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("联建单位导入模板", "UTF-8") + ".xlsx");
InputStream is = this.getClass().getClassLoader().getResourceAsStream("templates/icpartyunit_impoort_tem.xlsx");
try {
ServletOutputStream os = response.getOutputStream();
IOUtils.copy(is, os);
} finally {
if (is != null) {
is.close();
}
}
}
}

36
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityExcel.java

@ -17,9 +17,13 @@
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
/**
* 联建活动
*
@ -28,23 +32,31 @@ import lombok.Data;
*/
@Data
public class IcPartyActivityExcel {
@Excel(name = "序号")
private Integer index;
@Excel(name = "单位名称")
@ColumnWidth(20)
@ExcelProperty(value = "单位名称")
private String unitName;
@Excel(name = "活动标题")
@ColumnWidth(25)
@ExcelProperty(value = "活动标题")
private String title;
@Excel(name = "活动地址")
@ColumnWidth(35)
@ExcelProperty(value = "活动地址")
private String address;
@Excel(name = "服务人数")
@ColumnWidth(15)
@ExcelProperty(value = "服务人数")
private Integer peopleCount;
@Excel(name = "活动时间")
private String activityTime;
@ColumnWidth(20)
@ExcelProperty(value = "活动时间")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date activityTime;
/**
* actId不为空小程序
* 为空管理平台
*/
@ColumnWidth(20)
@ExcelProperty(value = "来源")
private String originName;
}

41
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitExcel.java

@ -17,7 +17,8 @@
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
/**
@ -29,30 +30,42 @@ import lombok.Data;
@Data
public class IcPartyUnitExcel {
@Excel(name = "序号")
private Integer index;
@Excel(name = "单位名称")
@ColumnWidth(30)
@ExcelProperty(value = "单位名称")
private String unitName;
@Excel(name = "分类")
private String type;
@ColumnWidth(25)
@ExcelProperty(value = "所属组织")
private String agencyName;
@ColumnWidth(25)
@ExcelProperty(value = "分类")
private String typeName;
@Excel(name = "服务事项")
private String serviceMatter;
/**
* 服务事项名称多个按照中文顿号隔开
*/
@ColumnWidth(100)
@ExcelProperty(value = "服务事项")
private String serviceMatterName;
@Excel(name = "联系人")
@ColumnWidth(16)
@ExcelProperty(value = "联系人")
private String contact;
@Excel(name = "联系电话")
@ColumnWidth(16)
@ExcelProperty(value = "联系电话")
private String contactMobile;
@Excel(name = "在职党员")
@ColumnWidth(18)
@ExcelProperty(value = "在职党员数")
private Integer memberCount;
@Excel(name = "群众满意度")
@ColumnWidth(18)
@ExcelProperty(value = "群众满意度")
private String satisfaction;
@Excel(name = "备注")
@ColumnWidth(100)
@ExcelProperty(value = "备注")
private String remark;
}

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java

@ -151,6 +151,11 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
dto.setServiceMatterNameList(serviceMatterNameList);
dto.setServiceMatterName(StringUtils.join(serviceMatterNameList, StrConstant.COMMA));
}
if(StringUtils.isNotBlank(dto.getActId())){
dto.setOriginName("小程序");
}else{
dto.setOriginName("管理平台");
}
});
}

6
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java

@ -145,6 +145,8 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
//获取单位积分
Map<String, Integer> pointMap = icUserDemandRecService.getServicePoint(formDTO.getCustomerId(), UserDemandConstant.PARTY_UNIT);
dtoList.forEach(item -> {
item.setTypeName(unitTypeMap.getData().get(item.getType()));
//这是错误的,应该是赋值type,遗留bug, 先不改了....
item.setType(unitTypeMap.getData().get(item.getType()));
if (StringUtils.isNotBlank(item.getServiceMatter())) {
List<String> matters = Arrays.asList(item.getServiceMatter().split(StrConstant.COMMA));
@ -183,6 +185,8 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
//获取单位积分
Map<String, Integer> pointMap = icUserDemandRecService.getServicePoint(formDTO.getCustomerId(), UserDemandConstant.PARTY_UNIT);
dtoList.forEach(item -> {
item.setTypeName(unitTypeMap.getData().get(item.getType()));
//这是错误的,应该是赋值type,遗留bug, 先不改了....
item.setType(unitTypeMap.getData().get(item.getType()));
if (StringUtils.isNotBlank(item.getServiceMatter())) {
List<String> matters = Arrays.asList(item.getServiceMatter().split(StrConstant.COMMA));
@ -217,6 +221,8 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
//获取分类名称字典
Result<Map<String, String>> typeDictMapRes=epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode());
Map<String, String> typeDictMap = typeDictMapRes.success() && MapUtils.isNotEmpty(typeDictMapRes.getData()) ? typeDictMapRes.getData() : new HashMap<>();
dto.setTypeName(MapUtils.isNotEmpty(typeDictMap) && typeDictMap.containsKey(dto.getType()) ? typeDictMap.get(dto.getType()) : StrConstant.EPMETY_STR);
//这是错误的,应该是赋值type,遗留bug, 先不改了....
dto.setType(MapUtils.isNotEmpty(typeDictMap) && typeDictMap.containsKey(dto.getType()) ? typeDictMap.get(dto.getType()) : StrConstant.EPMETY_STR);
// 服务事项
if(CollectionUtils.isNotEmpty(dto.getServiceMatterList())){

BIN
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/icpartyactivity_import_tem.xlsx

Binary file not shown.

BIN
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/icpartyunit_impoort_tem.xlsx

Binary file not shown.

14
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/ChangeWelfareDTO.java

@ -1,6 +1,8 @@
package com.epmet.dto;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import java.io.Serializable;
import java.util.Date;
@ -16,7 +18,7 @@ import java.util.Date;
public class ChangeWelfareDTO implements Serializable {
private static final long serialVersionUID = 1L;
public interface AddUserShowGroup extends CustomerClientShowGroup {}
/**
* 主键
*/
@ -116,4 +118,14 @@ public class ChangeWelfareDTO implements Serializable {
* 是否享受福利1是 0否 空是
*/
private String isWelfare;
/**
* 福利发放标识1已发放0未发放
*/
private Integer grantFlag;
/**
* 福利类别
*/
@Length(max = 100,message = "福利类别最多输入100字",groups = AddUserShowGroup.class)
private String categoryName;
}

6
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java

@ -5,7 +5,6 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
@ -110,6 +109,9 @@ public class AddIcNatFormDTO implements Serializable {
private String customerId;
private String staffId;
private String client;
/**
* 政府端:gov居民端:resi运营端:oper
*/
private String app;
}

4
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcTripReportFormDTO.java

@ -183,7 +183,7 @@ public class IcTripReportFormDTO implements Serializable {
/**
* 交通方式来源字典表(traffic_type)
*/
@NotBlank(message = "返回方式不能为空", groups = {PcAddRequired.class, ResiUserRequired.class})
// @NotBlank(message = "返回方式不能为空", groups = {PcAddRequired.class, ResiUserRequired.class})
private String trafficType;
/**
* 其他返回方式交通方式为其他时此列需要有值
@ -192,7 +192,7 @@ public class IcTripReportFormDTO implements Serializable {
/**
* 来源地详细信息 source_address字段的说明
*/
@NotBlank(message = "来自地区不能为空", groups = {PcAddRequired.class, ResiUserRequired.class})
// @NotBlank(message = "来自地区不能为空", groups = {PcAddRequired.class, ResiUserRequired.class})
private String sourceDetailAddress;
/**
* 疫苗接种针次 (0针 1针 2针 3针)小寨子

3
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java

@ -92,7 +92,8 @@ public class IcNatController implements ResultDataResolver {
ValidatorUtils.validateEntity(formDTO, AddIcNatFormDTO.Nat.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
formDTO.setClient(tokenDto.getClient());
// formDTO.setClient(tokenDto.getClient());
formDTO.setApp(tokenDto.getApp());
icNucleinService.add(formDTO);
return new Result();
}

8
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/ChangeWelfareEntity.java

@ -72,6 +72,14 @@ public class ChangeWelfareEntity extends BaseEpmetEntity {
* 移除原因
*/
private String removeReason;
/**
* 福利发放标识1已发放0未发放
*/
private Integer grantFlag;
/**
* 福利类别
*/
private String categoryName;
/**
* 客户ID

18
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/ChangeWelfareExcel.java

@ -21,13 +21,13 @@ public class ChangeWelfareExcel {
// @Excel(name = "epmet网格ID")
// private String gridId;
@Excel(name = "姓名")
@Excel(name = "姓名",width = 20)
private String name;
@Excel(name = "证件号")
@Excel(name = "证件号",width = 20)
private String idCard;
@Excel(name = "手机号")
@Excel(name = "手机号",width = 20)
private String mobile;
@Excel(name = "性别",replace = { "男_1", "女_0", "女_2", " _null"} )
@ -36,8 +36,18 @@ public class ChangeWelfareExcel {
// @Excel(name = "类型")
// private String type;
//
@Excel(name = "加入时间")
@Excel(name = "加入时间",width = 25)
private String joinDate;
/**
* 福利发放标识1已发放0未发放
*/
@Excel(name = "福利发放",replace = { "已发放_1", "未发放_0", "_null"},width = 20)
private Integer grantFlag;
/**
* 福利类别
*/
@Excel(name = "福利类别",width = 120)
private String categoryName;
//
// @Excel(name = "加入原因")
// private String joinReason;

10
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/ChangeWelfareImportExcel.java

@ -33,6 +33,16 @@ public class ChangeWelfareImportExcel {
// @Excel(name = "客户ID")
// private String customerId;
/**
* 福利发放标识1已发放0未发放
*/
@Excel(name = "福利发放",replace = { "已发放_1", "未发放_0", "_null"})
private Integer grantFlag;
/**
* 福利类别
*/
@Excel(name = "福利类别")
private String categoryName;
@ExcelIgnore
private Boolean addStatus = false;

2
epmet-user/epmet-user-server/src/main/java/com/epmet/service/ChangeWelfareService.java

@ -21,7 +21,7 @@ import java.util.Map;
public interface ChangeWelfareService extends BaseService<ChangeWelfareEntity> {
/**
* 默认分页
* 福利人员管理-分页查询
*
* @param params
* @return PageData<ChangeWelfareDTO>

35
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/ChangeWelfareServiceImpl.java

@ -16,10 +16,7 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.ExcelPoiUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.*;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
@ -38,7 +35,6 @@ import com.epmet.entity.ChangeWelfareEntity;
import com.epmet.excel.ChangeWelfareImportExcel;
import com.epmet.excel.error.ChangeWelfareErrorExcel;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.GovOrgFeignClient;
import com.epmet.feign.OssFeignClient;
import com.epmet.redis.ChangeWelfareRedis;
import com.epmet.service.ChangeWelfareService;
@ -88,12 +84,15 @@ public class ChangeWelfareServiceImpl extends BaseServiceImpl<ChangeWelfareDao,
@Autowired
private OssFeignClient ossFeignClient;
@Autowired
private GovOrgFeignClient govOrgFeignClient;
@Autowired
private IcResiUserDao icResiUserDao;
/**
* 福利人员管理-分页查询
*
* @param params
* @return
*/
@Override
public PageData<ChangeWelfareDTO> page(Map<String, Object> params) {
params.put("customerId", loginUserUtil.getLoginUserCustomerId());
@ -137,6 +136,12 @@ public class ChangeWelfareServiceImpl extends BaseServiceImpl<ChangeWelfareDao,
return ConvertUtils.sourceToTarget(entity, ChangeWelfareDTO.class);
}
/**
* 新增福利人员
*
* @param dto
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public Result save(ChangeWelfareDTO dto) {
@ -147,7 +152,7 @@ public class ChangeWelfareServiceImpl extends BaseServiceImpl<ChangeWelfareDao,
formDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId());
ValidatorUtils.validateEntity(formDTO, UpdateGroup.class, DefaultGroup.class);
RentTenantDataResultDTO result = icResiUserServiceImpl.getRentResiUserInfo(formDTO);
// 入参里的idCard、mobile加密的,这里重新赋值了
dto.setIdCard(result.getIdCard());
dto.setMobile(result.getMobile());
dto.setGridId(result.getGridId());
@ -163,6 +168,11 @@ public class ChangeWelfareServiceImpl extends BaseServiceImpl<ChangeWelfareDao,
return new Result();
}
/**
* 修改福利人员
*
* @param dto
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ChangeWelfareDTO dto) {
@ -177,12 +187,19 @@ public class ChangeWelfareServiceImpl extends BaseServiceImpl<ChangeWelfareDao,
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* 移除福利人员
*
* @param dto
* @return
*/
@Override
public Result removeWelfare(ChangeWelfareDTO dto) {
if (StringUtils.isBlank(dto.getId())) {
return new Result().error("id不可为空");
}
dto.setRemoveDate(DateUtils.format(new Date()));
dto.setUpdatedBy(EpmetRequestHolder.getLoginUserId());
baseDao.removeWelfare(dto);
return new Result().ok("移除成功");
}

17
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java

@ -119,7 +119,7 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
if (null != icNatDTO && icNatDTO.getNatResult().equals(formDTO.getNatResult())) {
throw new RenException(EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getCode(), EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getMsg());
} else if (null != icNatDTO && !icNatDTO.getNatResult().equals(formDTO.getNatResult())) {
if ("wxmp".equals(formDTO.getClient())) {
if (AppClientConstant.APP_RESI.equals(formDTO.getApp())) {
throw new RenException(EpmetErrorCode.RESI_IC_NAT.getCode(), EpmetErrorCode.RESI_IC_NAT.getMsg());
}
throw new RenException(EpmetErrorCode.IC_NAT.getCode(), EpmetErrorCode.IC_NAT.getMsg());
@ -129,10 +129,6 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
if (null == agencyInfo) {
throw new RenException(String.format("获取组织缓存信息失败%s", formDTO.getAgencyId()));
}
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if (null == staffInfo){
throw new EpmetException(String.format("获取工作人员信息失败%s", formDTO.getStaffId()));
}
ResiAndLocalResiResultDTO resiCount = icResiUserDao.getResiCount(formDTO.getAgencyId(), formDTO.getIdCard(), formDTO.getCustomerId());
//2.新增核酸基础信息数据
IcNatEntity entity = ConvertUtils.sourceToTarget(formDTO, IcNatEntity.class);
@ -146,8 +142,19 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
IcNatRelationEntity relationEntity = ConvertUtils.sourceToTarget(formDTO, IcNatRelationEntity.class);
relationEntity.setIcNatId(entity.getId());
relationEntity.setIsLocalResiUser(resiCount.getIsLocal() == NumConstant.ZERO ? NumConstant.ZERO_STR : NumConstant.ONE_STR);
if(AppClientConstant.APP_GOV.equals(formDTO.getApp())){
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if (null == staffInfo){
log.error(String.format("获取工作人员信息失败%s", formDTO.getStaffId()));
throw new EpmetException(String.format("获取工作人员信息失败%s", formDTO.getStaffId()));
}
relationEntity.setAgencyId(staffInfo.getAgencyId());
relationEntity.setPids(StringUtils.isNotBlank(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyPIds() + ":" + staffInfo.getAgencyId() : staffInfo.getAgencyId());
}else{
relationEntity.setAgencyId(formDTO.getAgencyId());
AgencyInfoCache agencyInfoCache=CustomerOrgRedis.getAgencyInfo(formDTO.getAgencyId());
relationEntity.setPids(StringUtils.isNotBlank(agencyInfoCache.getPids()) ? agencyInfoCache.getPids() + ":" + formDTO.getAgencyId() : formDTO.getAgencyId());
}
icNatRelationDao.insert(relationEntity);
//3.新增通知表信息

4
epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.94__pli_change_welfare.sql

@ -0,0 +1,4 @@
ALTER TABLE pli_change_welfare ADD COLUMN GRANT_FLAG TINYINT ( 1 ) DEFAULT 0
COMMENT '福利发放标识:1:已发放;0:未发放' AFTER REMOVE_REASON;
ALTER TABLE pli_change_welfare ADD COLUMN CATEGORY_NAME VARCHAR(255) DEFAULT ''
COMMENT '福利类别' AFTER GRANT_FLAG;

BIN
epmet-user/epmet-user-server/src/main/resources/excel/pli_change_welfare.xlsx

Binary file not shown.

16
epmet-user/epmet-user-server/src/main/resources/mapper/ChangeWelfareDao.xml

@ -40,7 +40,9 @@
w.REMOVE_DATE,
w.REMOVE_REASON,
w.CREATED_TIME,
w.UPDATED_TIME
w.UPDATED_TIME,
w.GRANT_FLAG,
w.CATEGORY_NAME
FROM
pli_change_welfare w
LEFT JOIN ic_resi_user u ON u.ID_CARD = w.ID_CARD and u.DEL_FLAG = '0'
@ -68,6 +70,12 @@
<if test="endTime != null and endTime != ''">
AND w.JOIN_DATE &lt;= #{endTime}
</if>
<if test="categoryName != null and categoryName != ''">
AND w.CATEGORY_NAME like concat('%',#{categoryName},'%')
</if>
<if test="grantFlag != null">
AND w.GRANT_FLAG = #{grantFlag}
</if>
order by w.CREATED_TIME desc
</select>
@ -76,12 +84,14 @@
where ID_CARD=#{idCard}
and del_flag='0'
</select>
<!-- 移除福利人员 -->
<update id="removeWelfare">
update pli_change_welfare
set REMOVE_DATE=#{removeDate},
REMOVE_REASON=#{removeReason},
del_flag='1'
del_flag='1',
UPDATED_BY = #{updatedBy},
UPDATED_TIME = #{removeDate}
where del_flag='0'
<if test="id != null and id != ''">
AND ID = #{id}

Loading…
Cancel
Save