Browse Source

疫苗接种点,核酸检测点 pc 管理

master
wanggongfeng 3 years ago
parent
commit
d4d92ec092
  1. 1
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java
  2. 10
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java
  3. 34
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/OrgListTreeResultDTO.java
  4. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java
  5. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java
  6. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
  7. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java
  8. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
  9. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
  10. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  11. 25
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  12. 6
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcPointVaccinesInoculationDTO.java
  13. 46
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MapInfoFormDTO.java
  14. 63
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SendPointNoticeFormDTO.java
  15. 82
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MapInfoResultDTO.java
  16. 34
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/SendPointNoticeResultDTO.java
  17. 28
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNoticeController.java
  18. 47
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcPointAppController.java
  19. 26
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcPointNucleicMonitoringController.java
  20. 76
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcPointVaccinesInoculationController.java
  21. 18
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcPointNucleicMonitoringDao.java
  22. 30
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcPointVaccinesInoculationDao.java
  23. 12
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
  24. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcPointVaccinesInoculationEntity.java
  25. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcPointVaccinesInoculationExcel.java
  26. 71
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcPointVaccinesInoculationImportExcel.java
  27. 50
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/error/PointVaccinesInoculationErrorModel.java
  28. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java
  29. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java
  30. 13
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java
  31. 33
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcPointAppService.java
  32. 19
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcPointNucleicMonitoringService.java
  33. 34
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcPointVaccinesInoculationService.java
  34. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java
  35. 92
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java
  36. 88
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcPointAppServiceImpl.java
  37. 23
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcPointNucleicMonitoringServiceImpl.java
  38. 285
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcPointVaccinesInoculationServiceImpl.java
  39. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  40. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/ic_point_nucleic_monitoring.xlsx
  41. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/ic_point_vaccines_inoculation.xlsx
  42. 60
      epmet-user/epmet-user-server/src/main/resources/mapper/IcPointNucleicMonitoringDao.xml
  43. 74
      epmet-user/epmet-user-server/src/main/resources/mapper/IcPointVaccinesInoculationDao.xml
  44. 12
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

1
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java

@ -20,6 +20,7 @@ public interface ImportTaskConstants {
String BIZ_TYPE_ATTENTION_TRIP_REPORT = "attention_vaccination";
String BIZ_TYPE_IC_PARTY_MEMBER = "ic_party_member";
String IC_POINT_NUCLEIC_MONITORING = "ic_point_nucleic_monitoring";
String IC_POINT_VACCINES_INOCULATION = "ic_point_vaccines_inoculation";
/**
* 核酸检测
*/

10
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java

@ -169,6 +169,16 @@ public interface UserMessageTypeConstant {
*/
String ANTIEPIDEMIC="antiepidemic";
/**
* 核酸检测点通知
*/
String NUCLEIC="nucleic";
/**
* 疫苗接种点通知
*/
String VACCINES="vaccines";
/**
* 发布党建声音

34
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/OrgListTreeResultDTO.java

@ -0,0 +1,34 @@
package com.epmet.dto.result;
import com.epmet.commons.tools.utils.NodeTree;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class OrgListTreeResultDTO extends NodeTree implements Serializable {
private static final long serialVersionUID = -1993037593855768962L;
/**
* 父id
*/
private String pid;
/**
* 名字
*/
private String label;
/**
*
*/
private String value;
}

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java

@ -467,6 +467,18 @@ public class AgencyController {
return new Result<List<CommunityListResultDTO>>().ok(agencyService.getCommunityList(tokenDto));
}
/**
* Desc: 查询工作人员所属组织下的所有街道社区
*
* @param tokenDto
* @author wgf
* @date 2022/6/23 09:13
*/
@PostMapping("getOrgTreeListByCustomerId")
public Result<List<OrgListTreeResultDTO>> getOrgTreeListByCustomerId(@LoginUser TokenDto tokenDto) {
return new Result<List<OrgListTreeResultDTO>>().ok(agencyService.getOrgTreeListByCustomerId(tokenDto));
}
/**
* 通讯录树状结构
*

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java

@ -475,5 +475,17 @@ public class CustomerAgencyController {
return customerAgencyService.getCommunityInfo(orgName);
}
/**
* @param userId
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.CommunityInfoResultDTO>
* @Author wgf
* @Description 根据用户ID查询所属组织信息
* @Date 2022/6/21 22:41
**/
@GetMapping("getCommunityInfoByUserId/{userId}")
public Result<CommunityInfoResultDTO> getCommunityInfoByUserId(@PathVariable("userId") String userId) {
return customerAgencyService.getCommunityInfoByUserId(userId);
}
}

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java

@ -331,6 +331,8 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
*/
List<PartyOrgTreeResultDTO> getOrgTreeByUserAndType(OrgTreeByUserAndTypeFormDTO formDto);
List<OrgListTreeResultDTO> getOrgTreeListByCustomerId(@Param("customerId") String customerId);
/**
* 通讯录树
*
@ -346,5 +348,7 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
List<String> getDelAgencyIdList(@Param("agencyId") String agencyId);
CommunityInfoResultDTO getCommunityInfo(@Param("orgName") String orgName);
CommunityInfoResultDTO getCommunityInfoByUserId(@Param("userId") String userId);
}

11
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java

@ -150,6 +150,15 @@ public interface AgencyService {
*/
List<CommunityListResultDTO> getCommunityList(TokenDto tokenDto);
/**
* Desc: 查询工作人员所属组织下的所有街道社区
*
* @param tokenDto
* @author wgf
* @date 2022/6/23 09:13
*/
List<OrgListTreeResultDTO> getOrgTreeListByCustomerId(TokenDto tokenDto);
/**
* 通讯录树状结构
*
@ -160,4 +169,4 @@ public interface AgencyService {
* @date 2022/5/16 10:43
*/
List<AgencyAddressBookTreeResultDTO> getAddressTree(String name, String customerId);
}
}

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java

@ -327,4 +327,13 @@ public interface CustomerAgencyService extends BaseService<CustomerAgencyEntity>
* @Date 2022/6/21 22:41
**/
Result<CommunityInfoResultDTO> getCommunityInfo(String orgName);
/**
* @param userId
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.CommunityInfoResultDTO>
* @Author wgf
* @Description 根据用户ID查询所属组织信息
* @Date 2022/6/21 22:41
**/
Result<CommunityInfoResultDTO> getCommunityInfoByUserId(String userId);
}

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java

@ -870,6 +870,15 @@ public class AgencyServiceImpl implements AgencyService {
return customerAgencyDao.getCommunityList(tokenDto.getCustomerId(), agencyId);
}
@Override
public List<OrgListTreeResultDTO> getOrgTreeListByCustomerId(TokenDto tokenDto) {
if (null == tokenDto.getCustomerId()) {
throw new EpmetException("未查询到工作人员信息");
}
List<OrgListTreeResultDTO> list = customerAgencyDao.getOrgTreeListByCustomerId(tokenDto.getCustomerId());
return NodeTreeUtils.build(list);
}
/**
* 通讯录树
*

7
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java

@ -1573,4 +1573,11 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
return new Result<CommunityInfoResultDTO>().ok(communityInfoResultDTO);
}
@Override
public Result<CommunityInfoResultDTO> getCommunityInfoByUserId(String userId) {
CommunityInfoResultDTO communityInfoResultDTO = baseDao.getCommunityInfoByUserId(userId);
return new Result<CommunityInfoResultDTO>().ok(communityInfoResultDTO);
}
}

25
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

@ -756,6 +756,16 @@
AND CUSTOMER_ID = #{customerId}
AND CONCAT(PIDS,':',ID) LIKE CONCAT('%',#{agencyId},'%')
</select>
<select id="getOrgTreeListByCustomerId" resultType="com.epmet.dto.result.OrgListTreeResultDTO">
select
ID,
PID,
ID as value,
ORGANIZATION_NAME as label
from customer_agency
where DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
</select>
<select id="getAddressTree" resultType="com.epmet.dto.result.AgencyAddressBookTreeResultDTO">
SELECT
a.id,
@ -893,4 +903,19 @@
limit 1
</select>
<select id="getCommunityInfoByUserId" resultType="com.epmet.dto.result.CommunityInfoResultDTO">
select
ca.ID as deptId,
ctf.CUSTOMER_ID,
ca.PID,
ca.PIDS,
ca.ORGANIZATION_NAME as deptName
from customer_staff_agency ctf
left join customer_agency ca on ca.ID = ctf.AGENCY_ID and ca.DEL_FLAG = 0
where ctf.DEL_FLAG = 0
and ca.LEVEL = 'community'
and ctf.USER_ID = #{userId}
limit 1
</select>
</mapper>

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

@ -79,7 +79,7 @@ public class IcPointVaccinesInoculationDTO implements Serializable {
/**
* 暂无疫苗12
*/
private Integer noAvailableVaccines;
private String noAvailableVaccines;
/**
* 咨询电话
@ -102,7 +102,7 @@ public class IcPointVaccinesInoculationDTO implements Serializable {
private String latitude;
/**
*
*
*/
private Integer delFlag;
@ -131,4 +131,4 @@ public class IcPointVaccinesInoculationDTO implements Serializable {
*/
private Date updatedTime;
}
}

46
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MapInfoFormDTO.java

@ -0,0 +1,46 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
/**
* 获取地图信息入参
*
* @author wgf
* @since v1.0.0 2022-06-20
*/
@Data
public class MapInfoFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 地点类型1核酸检测点 2疫苗接种点
*/
@NotBlank(message = "地点类型不能为空")
private String type;
/**
* 经度
*/
@NotBlank(message = "经度不能为空")
private String longitude;
/**
* 纬度
*/
@NotBlank(message = "纬度不能为空")
private String latitude;
/**
* 地点名称
*/
private String name;
}

63
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SendPointNoticeFormDTO.java

@ -0,0 +1,63 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;
/**
* @Description
* @Author wgf
* @Date 2022/3/28 14:14
*/
@NoArgsConstructor
@Data
public class SendPointNoticeFormDTO implements Serializable {
private static final long serialVersionUID = 4800907725063604885L;
private String customerId;
private String staffId;
/**
* 用户列表
*/
private List<UserListBean> userList;
/**
* 通知渠道通知渠道 0小程序通知1短信通知
*/
@NotEmpty(message = "请选择通知渠道", groups = CustomerClientShowGroup.class)
private List<String> channel;
/**
* 通知来源 0 行程上报1 疫苗接种2 核酸检测,3核酸检测点4疫苗接种点
*/
@NotEmpty(message = "通知来源不能为空", groups = CustomerClientShowGroup.class)
private String origin;
/**
* 通知内容
*/
@Size(min = 1, max = 500, message = "通知内容不超过500字", groups = CustomerClientShowGroup.class)
private String content;
/**
* 组织名
*/
private String orgName;
@NoArgsConstructor
@Data
public static class UserListBean {
/**
* 用户ID
*/
private String userId;
/**
* 手机号
*/
private String mobile;
/**
* 身份证
*/
private String idCard;
}
}

82
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MapInfoResultDTO.java

@ -0,0 +1,82 @@
package com.epmet.dto.result;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 获取地图信息返参
*
* @author wgf
* @since v1.0.0 2022-06-20
*/
@Data
public class MapInfoResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 时间随机数标识
*/
private Integer markerId;
/**
* 疫苗接种点名称
*/
private String name;
/**
* 距离当前位置千米数
*/
private String km;
/**
* 暂无疫苗12
*/
private String noAvailableVaccines;
/**
* 距离11公里以内33公里以内55公里以内995公里以外
*/
private String kmNum;
/**
* 日期
*/
private String date;
/**
* 上午时间
*/
private String moTime;
/**
* 下午时间
*/
private String afTime;
/**
* 电话
*/
private String mobile;
/**
* 地址
*/
private String address;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
}

34
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/SendPointNoticeResultDTO.java

@ -0,0 +1,34 @@
package com.epmet.dto.result;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;
/**
* @Description
* @Author wgf
* @Date 2022/3/28 14:14
*/
@Data
public class SendPointNoticeResultDTO implements Serializable {
private static final long serialVersionUID = 4800907725063604885L;
/**
* 用户ID
*/
private String userId;
/**
* 手机号
*/
private String mobile;
/**
* 身份证
*/
private String idCard;
}

28
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNoticeController.java

@ -4,6 +4,7 @@ import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
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.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
@ -14,10 +15,16 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.IcNoticeDTO;
import com.epmet.dto.form.IcNoticeFormDTO;
import com.epmet.dto.form.SendNoticeFormDTO;
import com.epmet.dto.form.SendPointNoticeFormDTO;
import com.epmet.dto.result.CommunityInfoResultDTO;
import com.epmet.feign.GovOrgFeignClient;
import com.epmet.service.IcNoticeService;
import com.epmet.service.IcResiUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 防疫通知
@ -32,6 +39,12 @@ public class IcNoticeController {
@Autowired
private IcNoticeService icNoticeService;
@Autowired
private GovOrgFeignClient govOrgFeignClient;
@Autowired
private IcResiUserService icResiUserService;
@RequestMapping("page")
public Result<PageData<IcNoticeDTO>> page(@LoginUser TokenDto tokenDto, @RequestBody IcNoticeFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
@ -80,4 +93,19 @@ public class IcNoticeController {
return new Result();
}
@PostMapping("sendPointNotice")
public Result sendPointNotice(@LoginUser TokenDto tokenDto, @RequestBody SendPointNoticeFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, CustomerClientShowGroup.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
// 查询用户列表
Result<CommunityInfoResultDTO> communityInfoResultDTOResult = govOrgFeignClient.getCommunityInfoByUserId(tokenDto.getUserId());
// 能点击发送按钮的人肯定有社区ID
String communityId = communityInfoResultDTOResult.getData().getDeptId();
List<SendPointNoticeFormDTO.UserListBean> userList = icResiUserService.getUserListByCommunityId(communityId);
formDTO.setUserList(userList);
icNoticeService.sendPointNotice(formDTO);
return new Result();
}
}

47
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcPointAppController.java

@ -0,0 +1,47 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.form.MapInfoFormDTO;
import com.epmet.dto.result.MapInfoResultDTO;
import com.epmet.service.IcPointAppService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 核酸监测点
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-20
*/
@RestController
@RequestMapping("appPoint")
@Slf4j
public class IcPointAppController {
@Autowired
private IcPointAppService icPointAppService;
/**
* 根据地点类型获取地图数据
* @param formDTO
* @return
*/
@PostMapping("getMapInfoByPointType")
public Result<List<MapInfoResultDTO>> getMapInfoByPointType(@RequestBody MapInfoFormDTO formDTO){
// 效验数据
ValidatorUtils.validateEntity(formDTO, AddGroup.class, DefaultGroup.class);
return icPointAppService.getMapInfoByPointType(formDTO);
}
}

26
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcPointNucleicMonitoringController.java

@ -18,9 +18,11 @@ import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dto.IcPointNucleicMonitoringDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.result.CommunityInfoResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.excel.IcPointNucleicMonitoringExcel;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.GovOrgFeignClient;
import com.epmet.service.IcPointNucleicMonitoringService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FilenameUtils;
@ -52,9 +54,13 @@ public class IcPointNucleicMonitoringController {
@Autowired
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
@Autowired
private GovOrgFeignClient govOrgFeignClient;
@RequestMapping("page")
public Result<PageData<IcPointNucleicMonitoringDTO>> page(@RequestParam Map<String, Object> params){
PageData<IcPointNucleicMonitoringDTO> page = icPointNucleicMonitoringService.page(params);
// PageData<IcPointNucleicMonitoringDTO> page = icPointNucleicMonitoringService.page(params);
PageData<IcPointNucleicMonitoringDTO> page = icPointNucleicMonitoringService.getPhrasePage(params);
return new Result<PageData<IcPointNucleicMonitoringDTO>>().ok(page);
}
@ -65,7 +71,7 @@ public class IcPointNucleicMonitoringController {
}
@NoRepeatSubmit
@PostMapping("save")
@PostMapping
public Result save(@RequestBody IcPointNucleicMonitoringDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
@ -74,7 +80,7 @@ public class IcPointNucleicMonitoringController {
}
@NoRepeatSubmit
@PutMapping("update")
@PutMapping
public Result update(@RequestBody IcPointNucleicMonitoringDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
@ -96,6 +102,16 @@ public class IcPointNucleicMonitoringController {
ExcelUtils.exportExcelToTarget(response, null, list, IcPointNucleicMonitoringExcel.class);
}
/**
* 获取发送通知按钮显示隐藏状态
* @param tokenDto
* @return
*/
@PostMapping("getShowType")
public Result getShowType(@LoginUser TokenDto tokenDto){
return govOrgFeignClient.getCommunityInfoByUserId(tokenDto.getUserId());
}
/**
* Desc: 核酸检测点导入
@ -103,8 +119,8 @@ public class IcPointNucleicMonitoringController {
* @author wgf
* @date 2022/6/21 13:40
*/
@PostMapping("pointNucleicMonitoringImport")
public Result pointNucleicMonitoringImport(@LoginUser TokenDto tokenDto, @RequestParam("file") MultipartFile file){
@PostMapping("pointImport")
public Result pointImport(@LoginUser TokenDto tokenDto, @RequestParam("file") MultipartFile file){
if (file.isEmpty()) {
throw new EpmetException("请上传文件");
}

76
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcPointVaccinesInoculationController.java

@ -1,7 +1,12 @@
package com.epmet.controller;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelPoiUtils;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
@ -9,13 +14,22 @@ import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dto.IcPointVaccinesInoculationDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.excel.IcPointVaccinesInoculationExcel;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.service.IcPointVaccinesInoculationService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FilenameUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -28,14 +42,19 @@ import java.util.Map;
*/
@RestController
@RequestMapping("icPointVaccinesInoculation")
@Slf4j
public class IcPointVaccinesInoculationController {
@Autowired
private IcPointVaccinesInoculationService icPointVaccinesInoculationService;
@Autowired
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
@RequestMapping("page")
public Result<PageData<IcPointVaccinesInoculationDTO>> page(@RequestParam Map<String, Object> params){
PageData<IcPointVaccinesInoculationDTO> page = icPointVaccinesInoculationService.page(params);
// PageData<IcPointVaccinesInoculationDTO> page = icPointVaccinesInoculationService.page(params);
PageData<IcPointVaccinesInoculationDTO> page = icPointVaccinesInoculationService.getPhrasePage(params);
return new Result<PageData<IcPointVaccinesInoculationDTO>>().ok(page);
}
@ -46,7 +65,7 @@ public class IcPointVaccinesInoculationController {
}
@NoRepeatSubmit
@PostMapping("save")
@PostMapping()
public Result save(@RequestBody IcPointVaccinesInoculationDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
@ -55,7 +74,7 @@ public class IcPointVaccinesInoculationController {
}
@NoRepeatSubmit
@PutMapping("update")
@PutMapping()
public Result update(@RequestBody IcPointVaccinesInoculationDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
@ -77,6 +96,57 @@ public class IcPointVaccinesInoculationController {
ExcelUtils.exportExcelToTarget(response, null, list, IcPointVaccinesInoculationExcel.class);
}
/**
* Desc: 疫苗接种点导入
* @param
* @author wgf
* @date 2022/6/21 13:40
*/
@PostMapping("pointImport")
public Result pointImport(@LoginUser TokenDto tokenDto, @RequestParam("file") MultipartFile file){
if (file.isEmpty()) {
throw new EpmetException("请上传文件");
}
// 校验文件类型
String extension = FilenameUtils.getExtension(file.getOriginalFilename());
if (!"xls".equals(extension) && !"xlsx".equals(extension)) {
throw new EpmetException("文件类型不匹配");
}
ImportTaskCommonFormDTO importTaskForm = new ImportTaskCommonFormDTO();
importTaskForm.setOriginFileName(file.getOriginalFilename());
importTaskForm.setOperatorId(tokenDto.getUserId());
importTaskForm.setBizType(ImportTaskConstants.IC_POINT_VACCINES_INOCULATION);
Result<ImportTaskCommonResultDTO> result = commonServiceOpenFeignClient.createImportTask(importTaskForm);
if (!result.success()) {
throw new EpmetException(9999,"存在进行中的导入");
}
InputStream inputStream = null;
try {
inputStream = file.getInputStream();
}catch (Exception e){
ImportTaskCommonFormDTO input = new ImportTaskCommonFormDTO();
input.setOperatorId(tokenDto.getUserId());
input.setTaskId(result.getData().getTaskId());
input.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL);
commonServiceOpenFeignClient.finishImportTask(input);
log.error("读取文件失败");
}
icPointVaccinesInoculationService.importFile(tokenDto,inputStream,result.getData().getTaskId());
return new Result();
}
/**
* 导出模板
* @param response
* @throws Exception
*/
@PostMapping("exporttemplate")
public void exportTemplate( HttpServletResponse response) throws Exception {
TemplateExportParams templatePath = new TemplateExportParams("excel/ic_point_vaccines_inoculation.xlsx");
ExcelPoiUtils.exportExcel(templatePath ,new HashMap<>(),"疫苗接种点录入表",response);
}
}

18
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcPointNucleicMonitoringDao.java

@ -1,10 +1,14 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IcPointNucleicMonitoringDTO;
import com.epmet.dto.form.MapInfoFormDTO;
import com.epmet.dto.result.MapInfoResultDTO;
import com.epmet.entity.IcPointNucleicMonitoringEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
* 核酸监测点
@ -21,4 +25,18 @@ public interface IcPointNucleicMonitoringDao extends BaseDao<IcPointNucleicMonit
*/
List<String> getAllAddressName();
/**
* 条件查询
* @param params
* @return
*/
List<IcPointNucleicMonitoringDTO> getPhrasePage(Map<String, Object> params);
/**
* 获取地图信息
* @param formDTO
* @return
*/
List<MapInfoResultDTO> getMapInfoList(MapInfoFormDTO formDTO);
}

30
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcPointVaccinesInoculationDao.java

@ -1,9 +1,15 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IcPointVaccinesInoculationDTO;
import com.epmet.dto.form.MapInfoFormDTO;
import com.epmet.dto.result.MapInfoResultDTO;
import com.epmet.entity.IcPointVaccinesInoculationEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
* 疫苗接种点
*
@ -12,5 +18,25 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface IcPointVaccinesInoculationDao extends BaseDao<IcPointVaccinesInoculationEntity> {
}
/**
* 获取所有地点名称
* @return
*/
List<String> getAllAddressName();
/**
* 条件查询
* @param params
* @return
*/
List<IcPointVaccinesInoculationDTO> getPhrasePage(Map<String, Object> params);
/**
* 获取地图信息
* @param formDTO
* @return
*/
List<MapInfoResultDTO> getMapInfoList(MapInfoFormDTO formDTO);
}

12
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java

@ -22,10 +22,7 @@ import com.epmet.commons.tools.dto.result.OptionDataResultDTO;
import com.epmet.dto.IcResiUserConfirmDTO;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.IcVolunteerPolyDTO;
import com.epmet.dto.form.EpidemicPreventionFormDTO;
import com.epmet.dto.form.MoveOutMemberFormDTO;
import com.epmet.dto.form.RentTenantDataFormDTO;
import com.epmet.dto.form.ResiUserQueryValueDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.IcResiUserEntity;
import org.apache.ibatis.annotations.MapKey;
@ -370,4 +367,11 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
* @return com.epmet.entity.IcResiUserEntity
*/
IcResiUserEntity selectResiUserEntityByIdCard(@Param("idCard") String idCard,@Param("customerId") String customerId);
/**
* 通过社区ID获取所属人员
* @param communityId
* @return
*/
List<SendPointNoticeResultDTO> getUserListByCommunityId(@Param("communityId") String communityId);
}

2
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcPointVaccinesInoculationEntity.java

@ -79,7 +79,7 @@ public class IcPointVaccinesInoculationEntity extends BaseEpmetEntity {
/**
* 暂无疫苗12
*/
private Integer noAvailableVaccines;
private String noAvailableVaccines;
/**
* 咨询电话

4
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcPointVaccinesInoculationExcel.java

@ -51,7 +51,7 @@ public class IcPointVaccinesInoculationExcel {
private String afEndTime;
@Excel(name = "暂无疫苗(1:是;2:否)")
private Integer noAvailableVaccines;
private String noAvailableVaccines;
@Excel(name = "咨询电话")
private String mobile;
@ -84,4 +84,4 @@ public class IcPointVaccinesInoculationExcel {
private Date updatedTime;
}
}

71
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcPointVaccinesInoculationImportExcel.java

@ -0,0 +1,71 @@
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelIgnore;
import lombok.Data;
/**
* 疫苗接种点
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-20
*/
@Data
public class IcPointVaccinesInoculationImportExcel {
// @Excel(name = "所属组织名称")
// private String orgName;
@Excel(name = "疫苗接种点名称")
private String name;
@Excel(name = "接种日期")
private String inoculationDate;
@Excel(name = "接种上午开始时间")
private String moStartTime;
@Excel(name = "接种上午结束时间")
private String moEndTime;
@Excel(name = "接种下午开始时间")
private String afStartTime;
@Excel(name = "接种下午结束时间")
private String afEndTime;
@Excel(name = "暂无疫苗", replace = {"否_1","是_2"})
private String noAvailableVaccines;
@Excel(name = "咨询电话")
private String mobile;
@Excel(name = "接种点地址")
private String address;
@ExcelIgnore
private Boolean addStatus = false;
@ExcelIgnore
private Integer num;
/**
* 所属组织ID
*/
// @ExcelIgnore
// private String orgId;
/**
* 组织ID上级
*/
// @ExcelIgnore
// private String pid;
/**
* 组织ID所有上级
*/
// @ExcelIgnore
// private String pids;
}

50
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/error/PointVaccinesInoculationErrorModel.java

@ -0,0 +1,50 @@
package com.epmet.excel.error;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
/**
* @Author wgf
* @DateTime 2022/6/21 16:57
* @DESC
*/
@Data
public class PointVaccinesInoculationErrorModel {
@Excel(name = "行号",width = 10)
private Integer num;
// @Excel(name = "所属组织名称",width = 30)
// private String orgName;
@Excel(name = "核酸监测点名称",width = 30)
private String name;
@Excel(name = "接种日期",width = 30)
private String inoculationDate;
@Excel(name = "接种上午开始时间",width = 30)
private String moStartTime;
@Excel(name = "接种上午结束时间",width = 30)
private String moEndTime;
@Excel(name = "接种下午开始时间",width = 30)
private String afStartTime;
@Excel(name = "接种下午结束时间",width = 30)
private String afEndTime;
@Excel(name = "暂无疫苗",width = 20, replace = {"否_1","是_2"})
private String noAvailableVaccines;
@Excel(name = "电话",width = 30)
private String mobile;
@Excel(name = "监测点地址",width = 40)
private String address;
@Excel(name = "错误信息", width = 200)
private String errorMsg;
}

10
epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java

@ -74,4 +74,14 @@ public interface GovOrgFeignClient {
@GetMapping("/gov/org/customeragency/getCommunityInfo/{orgName}")
Result<CommunityInfoResultDTO> getCommunityInfo(@PathVariable("orgName") String orgName);
/**
* @param userId
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.CommunityInfoResultDTO>
* @Author wgf
* @Description 根据社区名称查询所属组织信息
* @Date 2020/4/26 23:16
**/
@GetMapping("/gov/org/customeragency/getCommunityInfoByUserId/{userId}")
Result<CommunityInfoResultDTO> getCommunityInfoByUserId(@PathVariable("userId") String userId);
}

5
epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java

@ -45,4 +45,9 @@ public class GovOrgFeignClientFallBack implements GovOrgFeignClient {
public Result<CommunityInfoResultDTO> getCommunityInfo(String orgName) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getCommunityInfo",orgName);
}
@Override
public Result<CommunityInfoResultDTO> getCommunityInfoByUserId(String userId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getCommunityInfoByUserId",userId);
}
}

13
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java

@ -5,6 +5,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcNoticeDTO;
import com.epmet.dto.form.IcNoticeFormDTO;
import com.epmet.dto.form.SendNoticeFormDTO;
import com.epmet.dto.form.SendPointNoticeFormDTO;
import com.epmet.entity.IcNoticeEntity;
import java.util.Date;
@ -89,6 +90,16 @@ public interface IcNoticeService extends BaseService<IcNoticeEntity> {
*/
void sendNotice(SendNoticeFormDTO formDTO);
/**
* 发送通知(疫苗核酸地点)
*
* @Param formDTO
* @Return
* @Author wgf
* @Date 2022/6/23 14:19
*/
void sendPointNotice(SendPointNoticeFormDTO formDTO);
/**
* 获取人员最新一条通知
* @Param idCard
@ -104,4 +115,4 @@ public interface IcNoticeService extends BaseService<IcNoticeEntity> {
* @return
*/
Map<String, Date> getUserLatestNoticeTime(String customerId,List<String> idCardSet);
}
}

33
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcPointAppService.java

@ -0,0 +1,33 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.IcPointNucleicMonitoringDTO;
import com.epmet.dto.form.MapInfoFormDTO;
import com.epmet.dto.result.MapInfoResultDTO;
import com.epmet.entity.IcPointNucleicMonitoringEntity;
import org.springframework.web.bind.annotation.RequestBody;
import java.io.InputStream;
import java.util.List;
import java.util.Map;
/**
* 地图信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-20
*/
public interface IcPointAppService {
/**
* 根据地点类型获取地图数据
* @param formDTO
* @return
*/
Result<List<MapInfoResultDTO>> getMapInfoByPointType(MapInfoFormDTO formDTO);
}

19
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcPointNucleicMonitoringService.java

@ -4,6 +4,8 @@ import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.IcPointNucleicMonitoringDTO;
import com.epmet.dto.form.MapInfoFormDTO;
import com.epmet.dto.result.MapInfoResultDTO;
import com.epmet.entity.IcPointNucleicMonitoringEntity;
import java.io.InputStream;
@ -28,6 +30,13 @@ public interface IcPointNucleicMonitoringService extends BaseService<IcPointNucl
*/
PageData<IcPointNucleicMonitoringDTO> page(Map<String, Object> params);
/**
* 分页条件查询
* @param params
* @return
*/
PageData<IcPointNucleicMonitoringDTO> getPhrasePage(Map<String, Object> params);
/**
* 默认查询
*
@ -86,4 +95,14 @@ public interface IcPointNucleicMonitoringService extends BaseService<IcPointNucl
* @date 2022/3/29 15:35
*/
void importFile(TokenDto tokenDto, InputStream inputStream, String taskId);
/**
* 获取地图信息
*
* @param formDTO
* @return java.util.List<MapInfoResultDTO>
* @author wgf
* @date 2022-06-20
*/
List<MapInfoResultDTO> getMapInfoList(MapInfoFormDTO formDTO);
}

34
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcPointVaccinesInoculationService.java

@ -2,9 +2,13 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.IcPointVaccinesInoculationDTO;
import com.epmet.dto.form.MapInfoFormDTO;
import com.epmet.dto.result.MapInfoResultDTO;
import com.epmet.entity.IcPointVaccinesInoculationEntity;
import java.io.InputStream;
import java.util.List;
import java.util.Map;
@ -26,6 +30,13 @@ public interface IcPointVaccinesInoculationService extends BaseService<IcPointVa
*/
PageData<IcPointVaccinesInoculationDTO> page(Map<String, Object> params);
/**
* 分页条件查询
* @param params
* @return
*/
PageData<IcPointVaccinesInoculationDTO> getPhrasePage(Map<String, Object> params);
/**
* 默认查询
*
@ -75,4 +86,25 @@ public interface IcPointVaccinesInoculationService extends BaseService<IcPointVa
* @date 2022-06-20
*/
void delete(String[] ids);
}
/**
* Desc: 疫苗接种点导入
* @param tokenDto
* @param inputStream
* @author zxc
* @date 2022/3/29 15:35
*/
void importFile(TokenDto tokenDto, InputStream inputStream, String taskId);
/**
* 获取地图信息
*
* @param formDTO
* @return java.util.List<MapInfoResultDTO>
* @author wgf
* @date 2022-06-20
*/
List<MapInfoResultDTO> getMapInfoList(MapInfoFormDTO formDTO);
}

7
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java

@ -436,4 +436,11 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
* @Date 2022/6/16 15:30
*/
List<String> getUserId(String icResiUserId);
/**
* 根据社区ID获取该社区下的所有用户
* @param communityId
* @return
*/
List<SendPointNoticeFormDTO.UserListBean> getUserListByCommunityId(String communityId);
}

92
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java

@ -16,10 +16,7 @@ import com.epmet.constant.UserMessageTypeConstant;
import com.epmet.dao.IcNoticeDao;
import com.epmet.dto.IcNoticeDTO;
import com.epmet.dto.UserBaseInfoDTO;
import com.epmet.dto.form.IcNoticeFormDTO;
import com.epmet.dto.form.ProjectSendMsgFormDTO;
import com.epmet.dto.form.SendNoticeFormDTO;
import com.epmet.dto.form.UserMessageFormDTO;
import com.epmet.dto.form.*;
import com.epmet.entity.IcNoticeEntity;
import com.epmet.feign.MessageFeignClient;
import com.epmet.service.IcNoticeService;
@ -197,6 +194,91 @@ public class IcNoticeServiceImpl extends BaseServiceImpl<IcNoticeDao, IcNoticeEn
//TODO 发送短信
}
/**
* 发送通知
*
* @param formDTO
* @Param formDTO
* @Return
* @Author wgf
* @Date 2022/6/23 14:19
*/
@Override
public void sendPointNotice(SendPointNoticeFormDTO formDTO) {
String orgName = "";
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if (null != staffInfo) {
orgName = staffInfo.getAgencyName();
}
//保存消息
String channel = StringUtils.join(formDTO.getChannel(), StrConstant.COMMA);
String finalOrgName = orgName;
List<SendPointNoticeFormDTO.UserListBean> userBeanList = formDTO.getUserList().stream().collect(Collectors.collectingAndThen(
Collectors.toCollection(() -> new TreeSet<>(
Comparator.comparing( SendPointNoticeFormDTO.UserListBean::getIdCard))), ArrayList::new));
List<IcNoticeEntity> entityList = userBeanList.stream().map(item -> {
IcNoticeEntity entity = new IcNoticeEntity();
entity.setCustomerId(formDTO.getCustomerId());
entity.setChannel(channel);
entity.setContent(formDTO.getContent());
entity.setOrigin(formDTO.getOrigin());
entity.setUserId(item.getUserId());
entity.setMobile(item.getMobile());
entity.setIdCard(item.getIdCard());
entity.setOrgName(finalOrgName);
return entity;
}).collect(Collectors.toList());
insertBatch(entityList);
//通知
List<UserMessageFormDTO> msgList = new ArrayList<>();
//短信消息
List<ProjectSendMsgFormDTO> smsList = new ArrayList<>();
entityList.forEach(item -> {
if (StringUtils.isNotBlank(item.getIdCard())) {
//根据身份证获取居民ID
List<UserBaseInfoDTO> userList = userBaseInfoService.getCommonIdNumUser(item.getCustomerId(), item.getIdCard());
if (CollectionUtils.isNotEmpty(userList)) {
userList.forEach(user -> {
UserMessageFormDTO messageFormDTO = new UserMessageFormDTO();
messageFormDTO.setCustomerId(item.getCustomerId());
messageFormDTO.setApp(AppClientConstant.APP_GOV);
messageFormDTO.setGridId(StrConstant.STAR);
messageFormDTO.setUserId(user.getUserId());
messageFormDTO.setTitle("您有一条通知消息!");
messageFormDTO.setMessageContent(item.getContent());
messageFormDTO.setReadFlag(Constant.UNREAD);
if("3".equals(formDTO.getOrigin())){
// 核酸检测点
messageFormDTO.setMessageType(UserMessageTypeConstant.NUCLEIC);
}else{
// 疫苗接种点
messageFormDTO.setMessageType(UserMessageTypeConstant.VACCINES);
}
messageFormDTO.setTargetId(item.getId());
msgList.add(messageFormDTO);
});
}
}
//TODO 短信消息
if (StringUtils.isNotBlank(item.getMobile())) {
ProjectSendMsgFormDTO sms = new ProjectSendMsgFormDTO();
sms.setCustomerId(item.getCustomerId());
sms.setMobile(item.getMobile());
sms.setAliyunTemplateCode(SmsTemplateConstant.PROJECT_OVERDUE);
sms.setParameterKey("send_msg");
smsList.add(sms);
}
});
//发送小程序消息
Result result = messageFeignClient.saveUserMessageList(msgList);
if (!result.success()) {
log.error("发送小程序消息失败" + JSON.toJSONString(result));
}
//TODO 发送短信
}
/**
* 获取人员最新一条通知
*
@ -244,4 +326,4 @@ public class IcNoticeServiceImpl extends BaseServiceImpl<IcNoticeDao, IcNoticeEn
return map;
}
}
}

88
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcPointAppServiceImpl.java

@ -0,0 +1,88 @@
package com.epmet.service.impl;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
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.utils.ConvertUtils;
import com.epmet.commons.tools.utils.ExcelPoiUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcPointVaccinesInoculationDao;
import com.epmet.dto.IcPointVaccinesInoculationDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.form.MapInfoFormDTO;
import com.epmet.dto.result.MapInfoResultDTO;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.entity.IcPointVaccinesInoculationEntity;
import com.epmet.excel.IcPointVaccinesInoculationImportExcel;
import com.epmet.excel.error.PointVaccinesInoculationErrorModel;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.GovOrgFeignClient;
import com.epmet.feign.OssFeignClient;
import com.epmet.redis.IcPointVaccinesInoculationRedis;
import com.epmet.service.IcPointAppService;
import com.epmet.service.IcPointNucleicMonitoringService;
import com.epmet.service.IcPointVaccinesInoculationService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.ContentType;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.*;
import java.util.stream.Collectors;
/**
* 地图信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-20
*/
@Service
@Slf4j
public class IcPointAppServiceImpl implements IcPointAppService {
@Autowired
private IcPointNucleicMonitoringService icPointNucleicMonitoringService;
@Autowired
private IcPointVaccinesInoculationService icPointVaccinesInoculationService;
@Override
public Result<List<MapInfoResultDTO>> getMapInfoByPointType(MapInfoFormDTO formDTO) {
List<MapInfoResultDTO> mapInfoResultDTO = new ArrayList<MapInfoResultDTO>();
// 地点类型(1:核酸检测点; 2:疫苗接种点)
if("1".equals(formDTO.getType())){
// 核酸检测点地图数据
mapInfoResultDTO = icPointNucleicMonitoringService.getMapInfoList(formDTO);
}else if("2".equals(formDTO.getType())){
// 疫苗接种点地图数据
mapInfoResultDTO = icPointVaccinesInoculationService.getMapInfoList(formDTO);
}
return new Result<List<MapInfoResultDTO>>().ok(mapInfoResultDTO);
}
}

23
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcPointNucleicMonitoringServiceImpl.java

@ -22,7 +22,9 @@ import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcPointNucleicMonitoringDao;
import com.epmet.dto.IcPointNucleicMonitoringDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.form.MapInfoFormDTO;
import com.epmet.dto.result.CommunityInfoResultDTO;
import com.epmet.dto.result.MapInfoResultDTO;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.entity.IcEpidemicSpecialAttentionEntity;
import com.epmet.entity.IcPointNucleicMonitoringEntity;
@ -85,6 +87,18 @@ public class IcPointNucleicMonitoringServiceImpl extends BaseServiceImpl<IcPoint
return getPageData(page, IcPointNucleicMonitoringDTO.class);
}
/**
* 条件查询
* @param params
* @return
*/
@Override
public PageData<IcPointNucleicMonitoringDTO> getPhrasePage(Map<String, Object> params) {
IPage<IcPointNucleicMonitoringDTO> page = getPage(params);
List<IcPointNucleicMonitoringDTO> list = baseDao.getPhrasePage(params);
return new PageData<>(list, page.getTotal());
}
@Override
public List<IcPointNucleicMonitoringDTO> list(Map<String, Object> params) {
List<IcPointNucleicMonitoringEntity> entityList = baseDao.selectList(getWrapper(params));
@ -229,7 +243,7 @@ public class IcPointNucleicMonitoringServiceImpl extends BaseServiceImpl<IcPoint
insertBatch(entities);
}
if (CollectionUtils.isNotEmpty(errorInfo)){
String url = importOssUpload(errorInfo, EpidemicSpecialAttentionErrorModel.class);
String url = importOssUpload(errorInfo, PointNucleicMonitoringErrorModel.class);
closeTask(taskId,tokenDto.getUserId(), ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL,url);
}else {
closeTask(taskId,tokenDto.getUserId(),ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS,"");
@ -320,4 +334,11 @@ public class IcPointNucleicMonitoringServiceImpl extends BaseServiceImpl<IcPoint
}
@Override
public List<MapInfoResultDTO> getMapInfoList(MapInfoFormDTO formDTO) {
List<MapInfoResultDTO> list = baseDao.getMapInfoList(formDTO);
return list;
}
}

285
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcPointVaccinesInoculationServiceImpl.java

@ -1,24 +1,57 @@
package com.epmet.service.impl;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
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.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.ExcelPoiUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcPointVaccinesInoculationDao;
import com.epmet.dto.IcPointVaccinesInoculationDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.form.MapInfoFormDTO;
import com.epmet.dto.result.CommunityInfoResultDTO;
import com.epmet.dto.result.MapInfoResultDTO;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.entity.IcPointVaccinesInoculationEntity;
import com.epmet.excel.IcPointVaccinesInoculationImportExcel;
import com.epmet.excel.error.PointVaccinesInoculationErrorModel;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.GovOrgFeignClient;
import com.epmet.feign.OssFeignClient;
import com.epmet.redis.IcPointVaccinesInoculationRedis;
import com.epmet.service.IcPointVaccinesInoculationService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.ContentType;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.*;
import java.util.stream.Collectors;
/**
* 疫苗接种点
@ -27,11 +60,21 @@ import java.util.Map;
* @since v1.0.0 2022-06-20
*/
@Service
@Slf4j
public class IcPointVaccinesInoculationServiceImpl extends BaseServiceImpl<IcPointVaccinesInoculationDao, IcPointVaccinesInoculationEntity> implements IcPointVaccinesInoculationService {
@Autowired
private IcPointVaccinesInoculationRedis icPointVaccinesInoculationRedis;
@Autowired
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
@Autowired
private OssFeignClient ossFeignClient;
@Autowired
private GovOrgFeignClient govOrgFeignClient;
@Override
public PageData<IcPointVaccinesInoculationDTO> page(Map<String, Object> params) {
IPage<IcPointVaccinesInoculationEntity> page = baseDao.selectPage(
@ -41,6 +84,18 @@ public class IcPointVaccinesInoculationServiceImpl extends BaseServiceImpl<IcPoi
return getPageData(page, IcPointVaccinesInoculationDTO.class);
}
/**
* 条件查询
* @param params
* @return
*/
@Override
public PageData<IcPointVaccinesInoculationDTO> getPhrasePage(Map<String, Object> params) {
IPage<IcPointVaccinesInoculationDTO> page = getPage(params);
List<IcPointVaccinesInoculationDTO> list = baseDao.getPhrasePage(params);
return new PageData<>(list, page.getTotal());
}
@Override
public List<IcPointVaccinesInoculationDTO> list(Map<String, Object> params) {
List<IcPointVaccinesInoculationEntity> entityList = baseDao.selectList(getWrapper(params));
@ -84,4 +139,226 @@ public class IcPointVaccinesInoculationServiceImpl extends BaseServiceImpl<IcPoi
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}
/**
* Desc: 核酸检测点导入
* @param tokenDto
* @param inputStream
* @param taskId
* @author wgf
* @date 2022/3/29 15:35
*/
@Override
@Async
public void importFile(TokenDto tokenDto, InputStream inputStream, String taskId) {
List<PointVaccinesInoculationErrorModel> errorInfo = new ArrayList<>();
try {
List<IcPointVaccinesInoculationImportExcel> list = ExcelPoiUtils.importExcel(inputStream, 0,1,IcPointVaccinesInoculationImportExcel.class);
if (CollectionUtils.isEmpty(list)){
closeTask(taskId,tokenDto.getUserId(), ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL,"");
return;
}
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
if (null == staffInfo){
throw new EpmetException("未查询到工作人员信息"+tokenDto.getUserId());
}
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId());
if (null == agencyInfo){
throw new EpmetException("未查询到组织信息"+staffInfo.getAgencyId());
}
// 获取所有地点名称
List<String> addressList = baseDao.getAllAddressName();
for (int i = 0; i < list.size(); i++) {
list.get(i).setNum(i+1);
// if (StringUtils.isBlank(list.get(i).getOrgName()) && !list.get(i).getAddStatus()){
// errorInfo.add(getErrorInfo(list.get(i), "所属组织名称不能为空",i+1));
// list.get(i).setAddStatus(true);
// continue;
// }
if (StringUtils.isBlank(list.get(i).getName()) && !list.get(i).getAddStatus()){
errorInfo.add(getErrorInfo(list.get(i), "核酸监测点名称不能为空",i+1));
list.get(i).setAddStatus(true);
continue;
}
if (StringUtils.isBlank(list.get(i).getInoculationDate()) && !list.get(i).getAddStatus()){
errorInfo.add(getErrorInfo(list.get(i), "接种日期不能为空",i+1));
list.get(i).setAddStatus(true);
continue;
}
if (StringUtils.isBlank(list.get(i).getMoStartTime()) && !list.get(i).getAddStatus()){
errorInfo.add(getErrorInfo(list.get(i), "接种上午开始时间不能为空",i+1));
list.get(i).setAddStatus(true);
continue;
}
if (StringUtils.isBlank(list.get(i).getMoEndTime()) && !list.get(i).getAddStatus()){
errorInfo.add(getErrorInfo(list.get(i), "接种上午结束时间不能为空",i+1));
list.get(i).setAddStatus(true);
continue;
}
if (StringUtils.isBlank(list.get(i).getAfStartTime()) && !list.get(i).getAddStatus()){
errorInfo.add(getErrorInfo(list.get(i), "接种下午开始时间不能为空",i+1));
list.get(i).setAddStatus(true);
continue;
}
if (StringUtils.isBlank(list.get(i).getAfEndTime()) && !list.get(i).getAddStatus()){
errorInfo.add(getErrorInfo(list.get(i), "接种下午结束时间不能为空",i+1));
list.get(i).setAddStatus(true);
continue;
}
if (list.get(i).getNoAvailableVaccines() == null && !list.get(i).getAddStatus()){
errorInfo.add(getErrorInfo(list.get(i), "暂无疫苗不能为空",i+1));
list.get(i).setAddStatus(true);
continue;
}
if (StringUtils.isBlank(list.get(i).getMobile()) && !list.get(i).getAddStatus()){
errorInfo.add(getErrorInfo(list.get(i), "咨询电话不能为空",i+1));
list.get(i).setAddStatus(true);
continue;
}
if (StringUtils.isBlank(list.get(i).getAddress()) && !list.get(i).getAddStatus()){
errorInfo.add(getErrorInfo(list.get(i), "监测点地址不能为空",i+1));
list.get(i).setAddStatus(true);
continue;
}
// 校验数据库是否存在该地点名称
if (addressList.contains(list.get(i).getName()) && !list.get(i).getAddStatus()){
errorInfo.add(getErrorInfo(list.get(i), "核酸监测点名称已存在",i+1));
list.get(i).setAddStatus(true);
continue;
}
// 校验所属组织通过名称能否匹配到ID
// Result<CommunityInfoResultDTO> resultDTOResult = govOrgFeignClient.getCommunityInfo(list.get(i).getOrgName());
// CommunityInfoResultDTO communityInfoResultDTO = resultDTOResult.getData();
// if(communityInfoResultDTO == null && !list.get(i).getAddStatus()){
// errorInfo.add(getErrorInfo(list.get(i), "所属组织匹配失败",i+1));
// list.get(i).setAddStatus(true);
// continue;
// }else{
// list.get(i).setOrgId(communityInfoResultDTO.getDeptId());
// list.get(i).setPid(communityInfoResultDTO.getPid());
// list.get(i).setPids(communityInfoResultDTO.getPids());
// }
}
if (list.size() > errorInfo.size()){
Map<String, Long> groupByName = list.stream().collect(Collectors.groupingBy(IcPointVaccinesInoculationImportExcel::getName, Collectors.counting()));
groupByName.forEach((name,count) -> {
if (Integer.valueOf(count.toString()).compareTo(1) != 0){
for (IcPointVaccinesInoculationImportExcel i : list) {
if (name.equals(i.getName()) && !i.getAddStatus()){
errorInfo.add(getErrorInfo(i,"数据重复",i.getNum()));
i.setAddStatus(true);
}
}
}
});
}
Map<Boolean, List<IcPointVaccinesInoculationImportExcel>> groupByStatus = list.stream().collect(Collectors.groupingBy(IcPointVaccinesInoculationImportExcel::getAddStatus));
List<IcPointVaccinesInoculationImportExcel> needInsert = groupByStatus.get(false);
if (CollectionUtils.isNotEmpty(needInsert)){
List<IcPointVaccinesInoculationEntity> entities = ConvertUtils.sourceToTarget(needInsert, IcPointVaccinesInoculationEntity.class);
entities.forEach(e -> {
// 设置客户ID
e.setCustomerId(tokenDto.getCustomerId());
});
insertBatch(entities);
}
if (CollectionUtils.isNotEmpty(errorInfo)){
String url = importOssUpload(errorInfo, PointVaccinesInoculationErrorModel.class);
closeTask(taskId,tokenDto.getUserId(), ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL,url);
}else {
closeTask(taskId,tokenDto.getUserId(),ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS,"");
}
}catch (Exception e){
log.error(e.getMessage());
closeTask(taskId,tokenDto.getUserId(),ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL,"");
}
}
/**
* Desc: 关闭任务
* @param taskId
* @param userId
* @param status
* @param url
* @author wgf
* @date 2022/3/30 09:05
*/
public void closeTask(String taskId,String userId,String status,String url){
ImportTaskCommonFormDTO input = new ImportTaskCommonFormDTO();
input.setOperatorId(userId);
input.setTaskId(taskId);
input.setProcessStatus(status);
input.setResultDescFilePath(url);
commonServiceOpenFeignClient.finishImportTask(input);
}
/**
* Desc: 构造错误信息
* @param dto
* @param info
* @param num
* @author wgf
* @date 2022/3/29 17:17
*/
public PointVaccinesInoculationErrorModel getErrorInfo(IcPointVaccinesInoculationImportExcel dto, String info, Integer num){
PointVaccinesInoculationErrorModel result = ConvertUtils.sourceToTarget(dto, PointVaccinesInoculationErrorModel.class);
result.setErrorMsg(info);
result.setNum(num);
return result;
}
/**
* Desc: 文件上传并返回url
* @param errorRows
* @param tClass
* @author zxc
* @date 2022/3/30 09:16
*/
public <T> String importOssUpload(Collection<?> errorRows, Class<T> tClass) throws IOException {
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams("导入失败的数据列表","导入失败的数据列表"),
tClass, errorRows);
// 文件名
String resultDescFileName = UUID.randomUUID().toString().concat(".xls");
FileItemFactory factory = new DiskFileItemFactory(16, null);
FileItem fileItem = factory.createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), true, resultDescFileName);
OutputStream os = fileItem.getOutputStream();
Result<UploadImgResultDTO> uploadResult = null;
try {
workbook.write(os);
uploadResult = ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem));
} catch (Exception e) {
String errormsg = ExceptionUtils.getErrorStackTrace(e);
log.error("上传错误描述文件:{}", errormsg);
} finally {
try {
os.close();
} catch (IOException e) {
String errormsg = ExceptionUtils.getErrorStackTrace(e);
log.error("上传错误描述文件关闭输出流:{}", errormsg);
}
try {
fileItem.delete();
} catch (Exception e) {
String errormsg = ExceptionUtils.getErrorStackTrace(e);
log.error("上传错误描述文件删除临时文件:{}", errormsg);
}
}
if (uploadResult == null || !uploadResult.success()) {
log.error("调用OSS上传结果描述文件失败");
return null;
}
return uploadResult.getData().getUrl();
}
@Override
public List<MapInfoResultDTO> getMapInfoList(MapInfoFormDTO formDTO) {
List<MapInfoResultDTO> list = baseDao.getMapInfoList(formDTO);
return list;
}
}

7
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -2631,4 +2631,11 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
public List<String> getAllUserIds(String idCard, String customerId) {
return baseDao.getAllUserIds(idCard, customerId);
}
@Override
public List<SendPointNoticeFormDTO.UserListBean> getUserListByCommunityId(String communityId) {
List<SendPointNoticeResultDTO> userList = baseDao.getUserListByCommunityId(communityId);
List<SendPointNoticeFormDTO.UserListBean> list = ConvertUtils.sourceToTarget(userList,SendPointNoticeFormDTO.UserListBean.class);
return list;
}
}

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

Binary file not shown.

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

Binary file not shown.

60
epmet-user/epmet-user-server/src/main/resources/mapper/IcPointNucleicMonitoringDao.xml

@ -31,5 +31,65 @@
where DEL_FLAG = 0
</select>
<select id="getPhrasePage" resultType="com.epmet.dto.IcPointNucleicMonitoringDTO">
select
ID,
CUSTOMER_ID,
ORG_ID,
ORG_NAME,
PID,
PIDS,
NAME,
SERVE_TIME,
MOBILE,
ADDRESS,
LONGITUDE,
LATITUDE,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
from ic_point_nucleic_monitoring
where DEL_FLAG = 0
<if test="name != null and name != ''">
and NAME like CONCAT('%' ,#{name}, '%')
</if>
<if test="mobile != null and mobile != ''">
and MOBILE like CONCAT('%', #{mobile}, '%')
</if>
<if test="orgId != null and orgId != ''">
and (ORG_ID = #{orgId} or FIND_IN_SET(#{orgId},PIDS))
</if>
order by CREATED_TIME desc
</select>
<select id="getMapInfoList" parameterType="com.epmet.dto.form.MapInfoFormDTO"
resultType="com.epmet.dto.result.MapInfoResultDTO">
select
UNIX_TIMESTAMP(now()) + FLOOR( 100 + RAND() * 1000) as markerId,
NAME,
round((st_distance_sphere(point(#{longitude},#{latitude}), point(LONGITUDE, LATITUDE))) / 1000 ,1) as km,
(case when round((st_distance_sphere(point(#{longitude},#{latitude}), point(LONGITUDE, LATITUDE))) / 1000 ,1) &lt;= 1 then '1'
when round((st_distance_sphere(point(#{longitude},#{latitude}), point(LONGITUDE, LATITUDE))) / 1000 ,1) &lt;= 3 then '3'
when round((st_distance_sphere(point(#{longitude},#{latitude}), point(LONGITUDE, LATITUDE))) / 1000 ,1) &lt;= 5 then '5'
else '99' end ) as kmNum,
SERVE_TIME as date,
MOBILE,
ADDRESS,
LONGITUDE,
LATITUDE
from ic_point_nucleic_monitoring
where DEL_FLAG = 0
<if test="name != null and name != ''">
and NAME like CONCAT('%' ,#{name}, '%')
</if>
and LONGITUDE is not null
and LATITUDE is not null
order by (st_distance_sphere(point(#{longitude},#{latitude}), point(LONGITUDE, LATITUDE)))
</select>
</mapper>

74
epmet-user/epmet-user-server/src/main/resources/mapper/IcPointVaccinesInoculationDao.xml

@ -29,5 +29,77 @@
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="getAllAddressName" resultType="java.lang.String">
select
NAME
from ic_point_vaccines_inoculation
where DEL_FLAG = 0
</select>
</mapper>
<select id="getPhrasePage" resultType="com.epmet.dto.IcPointVaccinesInoculationDTO">
select
ID,
CUSTOMER_ID,
ORG_ID,
ORG_NAME,
PID,
PIDS,
NAME,
INOCULATION_DATE,
MO_START_TIME,
MO_END_TIME,
AF_START_TIME,
AF_END_TIME,
(case NO_AVAILABLE_VACCINES when '1' then '是' when '2' then '否' else '' end ) as NO_AVAILABLE_VACCINES,
MOBILE,
ADDRESS,
LONGITUDE,
LATITUDE,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
from ic_point_vaccines_inoculation
where DEL_FLAG = 0
<if test="name != null and name != ''">
and NAME like CONCAT('%' ,#{name}, '%')
</if>
<if test="mobile != null and mobile != ''">
and MOBILE like CONCAT('%', #{mobile}, '%')
</if>
order by CREATED_TIME desc
</select>
<select id="getMapInfoList" parameterType="com.epmet.dto.form.MapInfoFormDTO"
resultType="com.epmet.dto.result.MapInfoResultDTO">
select
UNIX_TIMESTAMP(now()) + FLOOR( 100 + RAND() * 1000) as markerId,
NAME,
round((st_distance_sphere(point(#{longitude},#{latitude}), point(LONGITUDE, LATITUDE))) / 1000 ,1) as km,
(case when round((st_distance_sphere(point(#{longitude},#{latitude}), point(LONGITUDE, LATITUDE))) / 1000 ,1) &lt;= 1 then '1'
when round((st_distance_sphere(point(#{longitude},#{latitude}), point(LONGITUDE, LATITUDE))) / 1000 ,1) &lt;= 3 then '3'
when round((st_distance_sphere(point(#{longitude},#{latitude}), point(LONGITUDE, LATITUDE))) / 1000 ,1) &lt;= 5 then '5'
else '99' end ) as kmNum,
INOCULATION_DATE as date,
CONCAT('上午:',MO_START_TIME,'-',MO_END_TIME) as moTime,
CONCAT('下午:',AF_START_TIME,'-',AF_END_TIME) as afTime,
NO_AVAILABLE_VACCINES,
MOBILE,
ADDRESS,
LONGITUDE,
LATITUDE
from ic_point_vaccines_inoculation
where DEL_FLAG = 0
<if test="name != null and name != ''">
and NAME like CONCAT('%' ,#{name}, '%')
</if>
and LONGITUDE is not null
and LATITUDE is not null
order by (st_distance_sphere(point(#{longitude},#{latitude}), point(LONGITUDE, LATITUDE)))
</select>
</mapper>

12
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

@ -1132,4 +1132,16 @@
AND customer_id = #{customerId}
AND DEL_FLAG = '0'
</select>
<select id="getUserListByCommunityId" resultType="com.epmet.dto.result.SendPointNoticeResultDTO">
select
ru.ID_CARD,
ru.MOBILE,
ub.USER_ID
from ic_resi_user ru
left join user_base_info ub on ub.ID_NUM = ru.ID_CARD and ub.DEL_FLAG = 0
where ru.DEL_FLAG = 0
and ub.USER_ID is not null
and ru.AGENCY_ID = #{communityId}
</select>
</mapper>

Loading…
Cancel
Save