forked from luyan/epmet-cloud-lingshan
Browse Source
# Conflicts: # epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java # epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java # epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java # epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java # epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xmlmaster
57 changed files with 3476 additions and 11 deletions
@ -0,0 +1,41 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description 社区所属组织基本信息 |
|||
* @Author wgf |
|||
* @Date 2020/4/26 22:35 |
|||
*/ |
|||
@Data |
|||
public class CommunityInfoResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 4360690752084258055L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 社区组织ID |
|||
*/ |
|||
private String deptId; |
|||
|
|||
/** |
|||
* 社区名称 |
|||
*/ |
|||
private String deptName; |
|||
|
|||
/** |
|||
* 网格的上级组织 |
|||
*/ |
|||
private String pid; |
|||
|
|||
/** |
|||
* 网格的所有上级组织 |
|||
*/ |
|||
private String pids; |
|||
} |
|||
|
|||
@ -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; |
|||
|
|||
} |
|||
@ -0,0 +1,109 @@ |
|||
package com.epmet.dto; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 核酸监测点 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-06-20 |
|||
*/ |
|||
@Data |
|||
public class IcPointNucleicMonitoringDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* ID |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 所属组织ID |
|||
*/ |
|||
private String orgId; |
|||
|
|||
/** |
|||
* 所属组织名称 |
|||
*/ |
|||
private String orgName; |
|||
|
|||
/** |
|||
* 组织ID上级 |
|||
*/ |
|||
private String pid; |
|||
|
|||
/** |
|||
* 组织ID所有上级 |
|||
*/ |
|||
private String pids; |
|||
|
|||
/** |
|||
* 核酸监测点名称 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 服务时间 |
|||
*/ |
|||
private String serveTime; |
|||
|
|||
/** |
|||
* 咨询电话 |
|||
*/ |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 监测点地址 |
|||
*/ |
|||
private String address; |
|||
|
|||
/** |
|||
* 经度 |
|||
*/ |
|||
private String longitude; |
|||
|
|||
/** |
|||
* 纬度 |
|||
*/ |
|||
private String latitude; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private Integer delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
|||
@ -0,0 +1,134 @@ |
|||
package com.epmet.dto; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 疫苗接种点 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-06-20 |
|||
*/ |
|||
@Data |
|||
public class IcPointVaccinesInoculationDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* ID |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 所属组织ID |
|||
*/ |
|||
private String orgId; |
|||
|
|||
/** |
|||
* 所属组织名称 |
|||
*/ |
|||
private String orgName; |
|||
|
|||
/** |
|||
* 组织ID上级 |
|||
*/ |
|||
private String pid; |
|||
|
|||
/** |
|||
* 组织ID所有上级 |
|||
*/ |
|||
private String pids; |
|||
|
|||
/** |
|||
* 疫苗接种点名称 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 接种日期 |
|||
*/ |
|||
private String inoculationDate; |
|||
|
|||
/** |
|||
* 接种上午开始时间 |
|||
*/ |
|||
private String moStartTime; |
|||
|
|||
/** |
|||
* 接种上午结束时间 |
|||
*/ |
|||
private String moEndTime; |
|||
|
|||
/** |
|||
* 接种下午开始时间 |
|||
*/ |
|||
private String afStartTime; |
|||
|
|||
/** |
|||
* 接种下午结束时间 |
|||
*/ |
|||
private String afEndTime; |
|||
|
|||
/** |
|||
* 暂无疫苗(1:是;2:否) |
|||
*/ |
|||
private String noAvailableVaccines; |
|||
|
|||
/** |
|||
* 咨询电话 |
|||
*/ |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 接种点地址 |
|||
*/ |
|||
private String address; |
|||
|
|||
/** |
|||
* 经度 |
|||
*/ |
|||
private String longitude; |
|||
|
|||
/** |
|||
* 纬度 |
|||
*/ |
|||
private String latitude; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private Integer delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
|||
@ -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; |
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,32 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* 所属部门 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-06-20 |
|||
*/ |
|||
@Data |
|||
public class OrgInfoPointFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 所属组织名称 |
|||
*/ |
|||
private String orgName; |
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import com.epmet.commons.tools.dto.form.PageFormDTO; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2022/3/28 10:30 |
|||
* @DESC |
|||
*/ |
|||
@Data |
|||
public class PointHSYMFormDTO extends PageFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -498378993902522370L; |
|||
|
|||
/** |
|||
* 手机号 |
|||
*/ |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 地点名称 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* user所属组织ID |
|||
*/ |
|||
private String orgId; |
|||
} |
|||
@ -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; |
|||
} |
|||
} |
|||
@ -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; |
|||
|
|||
/** |
|||
* 暂无疫苗(1:是;2:否) |
|||
*/ |
|||
private String noAvailableVaccines; |
|||
|
|||
/** |
|||
* 距离(1:1公里以内;3:3公里以内;5:5公里以内;99:5公里以外) |
|||
*/ |
|||
private String kmNum; |
|||
|
|||
/** |
|||
* 日期 |
|||
*/ |
|||
private String date; |
|||
|
|||
/** |
|||
* 上午时间 |
|||
*/ |
|||
private String moTime; |
|||
|
|||
/** |
|||
* 下午时间 |
|||
*/ |
|||
private String afTime; |
|||
|
|||
/** |
|||
* 电话 |
|||
*/ |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 地址 |
|||
*/ |
|||
private String address; |
|||
|
|||
/** |
|||
* 经度 |
|||
*/ |
|||
private String longitude; |
|||
|
|||
/** |
|||
* 纬度 |
|||
*/ |
|||
private String latitude; |
|||
|
|||
|
|||
|
|||
} |
|||
@ -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; |
|||
} |
|||
@ -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); |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,196 @@ |
|||
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.constant.NumConstant; |
|||
import com.epmet.commons.tools.dto.form.PageFormDTO; |
|||
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; |
|||
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.dao.IcPointNucleicMonitoringDao; |
|||
import com.epmet.dto.IcPointNucleicMonitoringDTO; |
|||
import com.epmet.dto.form.ImportTaskCommonFormDTO; |
|||
import com.epmet.dto.form.PointHSYMFormDTO; |
|||
import com.epmet.dto.form.VaccinationListFormDTO; |
|||
import com.epmet.dto.result.CommunityInfoResultDTO; |
|||
import com.epmet.dto.result.ImportTaskCommonResultDTO; |
|||
import com.epmet.excel.IcPointNucleicMonitoringExcel; |
|||
import com.epmet.excel.NatExportExcel; |
|||
import com.epmet.excel.VaccinationExportExcel; |
|||
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; |
|||
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; |
|||
|
|||
|
|||
/** |
|||
* 核酸监测点 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-06-20 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("icPointNucleicMonitoring") |
|||
@Slf4j |
|||
public class IcPointNucleicMonitoringController { |
|||
|
|||
@Autowired |
|||
private IcPointNucleicMonitoringService icPointNucleicMonitoringService; |
|||
|
|||
@Autowired |
|||
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; |
|||
|
|||
@Autowired |
|||
private GovOrgFeignClient govOrgFeignClient; |
|||
|
|||
@Autowired |
|||
private IcPointNucleicMonitoringDao icPointNucleicMonitoringDao; |
|||
|
|||
@RequestMapping("page") |
|||
public Result<PageData<IcPointNucleicMonitoringDTO>> page(@RequestParam Map<String, Object> params){ |
|||
// PageData<IcPointNucleicMonitoringDTO> page = icPointNucleicMonitoringService.page(params);
|
|||
PageData<IcPointNucleicMonitoringDTO> page = icPointNucleicMonitoringService.getPhrasePage(params); |
|||
return new Result<PageData<IcPointNucleicMonitoringDTO>>().ok(page); |
|||
} |
|||
|
|||
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) |
|||
public Result<IcPointNucleicMonitoringDTO> get(@PathVariable("id") String id){ |
|||
IcPointNucleicMonitoringDTO data = icPointNucleicMonitoringService.get(id); |
|||
return new Result<IcPointNucleicMonitoringDTO>().ok(data); |
|||
} |
|||
|
|||
@NoRepeatSubmit |
|||
@PostMapping |
|||
public Result save(@RequestBody IcPointNucleicMonitoringDTO dto, @LoginUser TokenDto tokenDto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
dto.setCustomerId(tokenDto.getCustomerId()); |
|||
icPointNucleicMonitoringService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@NoRepeatSubmit |
|||
@PutMapping |
|||
public Result update(@RequestBody IcPointNucleicMonitoringDTO dto, @LoginUser TokenDto tokenDto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
dto.setCustomerId(tokenDto.getCustomerId()); |
|||
icPointNucleicMonitoringService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PostMapping("delete") |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
icPointNucleicMonitoringService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
@GetMapping("export") |
|||
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<IcPointNucleicMonitoringDTO> list = icPointNucleicMonitoringDao.getPhrasePage(params); |
|||
ExcelUtils.exportExcelToTarget(response, null, list, IcPointNucleicMonitoringExcel.class); |
|||
} |
|||
|
|||
/** |
|||
* Desc: 【核酸检测点】导出 |
|||
* @param response |
|||
* @param formDTO |
|||
* @param tokenDto |
|||
* @author wgf |
|||
* @date 2022/6/24 13:57 |
|||
*/ |
|||
@PostMapping("point-export") |
|||
public void vaccinationExport(HttpServletResponse response, @RequestBody PointHSYMFormDTO formDTO, @LoginUser TokenDto tokenDto) throws Exception { |
|||
ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); |
|||
List<IcPointNucleicMonitoringDTO> list = icPointNucleicMonitoringDao.getPhrasePageByDTO(formDTO); |
|||
ExcelUtils.exportExcelToTarget(response, null, list, IcPointNucleicMonitoringExcel.class); |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 获取【发送通知】按钮显示隐藏状态 |
|||
* @param tokenDto |
|||
* @return |
|||
*/ |
|||
@PostMapping("getShowType") |
|||
public Result getShowType(@LoginUser TokenDto tokenDto){ |
|||
return govOrgFeignClient.getCommunityInfoByUserId(tokenDto.getUserId()); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 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_NUCLEIC_MONITORING); |
|||
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("读取文件失败"); |
|||
} |
|||
icPointNucleicMonitoringService.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_nucleic_monitoring.xlsx"); |
|||
ExcelPoiUtils.exportExcel(templatePath ,new HashMap<>(),"核酸检测点录入表",response); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,176 @@ |
|||
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.dto.form.PageFormDTO; |
|||
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; |
|||
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.dao.IcPointVaccinesInoculationDao; |
|||
import com.epmet.dto.IcPointNucleicMonitoringDTO; |
|||
import com.epmet.dto.IcPointVaccinesInoculationDTO; |
|||
import com.epmet.dto.form.ImportTaskCommonFormDTO; |
|||
import com.epmet.dto.form.PointHSYMFormDTO; |
|||
import com.epmet.dto.result.ImportTaskCommonResultDTO; |
|||
import com.epmet.excel.IcPointNucleicMonitoringExcel; |
|||
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; |
|||
|
|||
|
|||
/** |
|||
* 疫苗接种点 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-06-20 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("icPointVaccinesInoculation") |
|||
@Slf4j |
|||
public class IcPointVaccinesInoculationController { |
|||
|
|||
@Autowired |
|||
private IcPointVaccinesInoculationService icPointVaccinesInoculationService; |
|||
|
|||
@Autowired |
|||
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; |
|||
|
|||
@Autowired |
|||
private IcPointVaccinesInoculationDao icPointVaccinesInoculationDao; |
|||
|
|||
@RequestMapping("page") |
|||
public Result<PageData<IcPointVaccinesInoculationDTO>> page(@RequestParam Map<String, Object> params){ |
|||
// PageData<IcPointVaccinesInoculationDTO> page = icPointVaccinesInoculationService.page(params);
|
|||
PageData<IcPointVaccinesInoculationDTO> page = icPointVaccinesInoculationService.getPhrasePage(params); |
|||
return new Result<PageData<IcPointVaccinesInoculationDTO>>().ok(page); |
|||
} |
|||
|
|||
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) |
|||
public Result<IcPointVaccinesInoculationDTO> get(@PathVariable("id") String id){ |
|||
IcPointVaccinesInoculationDTO data = icPointVaccinesInoculationService.get(id); |
|||
return new Result<IcPointVaccinesInoculationDTO>().ok(data); |
|||
} |
|||
|
|||
@NoRepeatSubmit |
|||
@PostMapping() |
|||
public Result save(@RequestBody IcPointVaccinesInoculationDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
icPointVaccinesInoculationService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@NoRepeatSubmit |
|||
@PutMapping() |
|||
public Result update(@RequestBody IcPointVaccinesInoculationDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
icPointVaccinesInoculationService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PostMapping("delete") |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
icPointVaccinesInoculationService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
@GetMapping("export") |
|||
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<IcPointVaccinesInoculationDTO> list = icPointVaccinesInoculationService.list(params); |
|||
ExcelUtils.exportExcelToTarget(response, null, list, IcPointVaccinesInoculationExcel.class); |
|||
} |
|||
|
|||
/** |
|||
* Desc: 【疫苗接种点】导出 |
|||
* @param response |
|||
* @param formDTO |
|||
* @param tokenDto |
|||
* @author wgf |
|||
* @date 2022/6/24 13:57 |
|||
*/ |
|||
@PostMapping("point-export") |
|||
public void vaccinationExport(HttpServletResponse response, @RequestBody PointHSYMFormDTO formDTO, @LoginUser TokenDto tokenDto) throws Exception { |
|||
ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); |
|||
List<IcPointVaccinesInoculationDTO> list = icPointVaccinesInoculationDao.getPhrasePageByDTO(formDTO); |
|||
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); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,52 @@ |
|||
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.form.PointHSYMFormDTO; |
|||
import com.epmet.dto.result.MapInfoResultDTO; |
|||
import com.epmet.entity.IcPointNucleicMonitoringEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 核酸监测点 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-06-20 |
|||
*/ |
|||
@Mapper |
|||
public interface IcPointNucleicMonitoringDao extends BaseDao<IcPointNucleicMonitoringEntity> { |
|||
|
|||
/** |
|||
* 获取所有地点名称 |
|||
* @return |
|||
*/ |
|||
List<String> getAllAddressName(); |
|||
List<String> getAllAddressNameNoCurrent(@Param("id") String id); |
|||
|
|||
/** |
|||
* 条件查询 |
|||
* @param params |
|||
* @return |
|||
*/ |
|||
List<IcPointNucleicMonitoringDTO> getPhrasePage(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 条件查询 |
|||
* @param formDTO |
|||
* @return |
|||
*/ |
|||
List<IcPointNucleicMonitoringDTO> getPhrasePageByDTO(PointHSYMFormDTO formDTO); |
|||
|
|||
/** |
|||
* 获取地图信息 |
|||
* @param formDTO |
|||
* @return |
|||
*/ |
|||
List<MapInfoResultDTO> getMapInfoList(MapInfoFormDTO formDTO); |
|||
|
|||
} |
|||
@ -0,0 +1,50 @@ |
|||
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.form.PointHSYMFormDTO; |
|||
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; |
|||
|
|||
/** |
|||
* 疫苗接种点 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-06-20 |
|||
*/ |
|||
@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<IcPointVaccinesInoculationDTO> getPhrasePageByDTO(PointHSYMFormDTO formDTO); |
|||
|
|||
/** |
|||
* 获取地图信息 |
|||
* @param formDTO |
|||
* @return |
|||
*/ |
|||
List<MapInfoResultDTO> getMapInfoList(MapInfoFormDTO formDTO); |
|||
|
|||
} |
|||
@ -0,0 +1,79 @@ |
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 核酸监测点 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-06-20 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("ic_point_nucleic_monitoring") |
|||
public class IcPointNucleicMonitoringEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 所属组织ID |
|||
*/ |
|||
private String orgId; |
|||
|
|||
/** |
|||
* 所属组织名称 |
|||
*/ |
|||
private String orgName; |
|||
|
|||
/** |
|||
* 组织ID上级 |
|||
*/ |
|||
private String pid; |
|||
|
|||
/** |
|||
* 组织ID所有上级 |
|||
*/ |
|||
private String pids; |
|||
|
|||
/** |
|||
* 核酸监测点名称 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 服务时间 |
|||
*/ |
|||
private String serveTime; |
|||
|
|||
/** |
|||
* 咨询电话 |
|||
*/ |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 监测点地址 |
|||
*/ |
|||
private String address; |
|||
|
|||
/** |
|||
* 经度 |
|||
*/ |
|||
private String longitude; |
|||
|
|||
/** |
|||
* 纬度 |
|||
*/ |
|||
private String latitude; |
|||
|
|||
} |
|||
@ -0,0 +1,104 @@ |
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 疫苗接种点 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-06-20 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("ic_point_vaccines_inoculation") |
|||
public class IcPointVaccinesInoculationEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 所属组织ID |
|||
*/ |
|||
private String orgId; |
|||
|
|||
/** |
|||
* 所属组织名称 |
|||
*/ |
|||
private String orgName; |
|||
|
|||
/** |
|||
* 组织ID上级 |
|||
*/ |
|||
private String pid; |
|||
|
|||
/** |
|||
* 组织ID所有上级 |
|||
*/ |
|||
private String pids; |
|||
|
|||
/** |
|||
* 疫苗接种点名称 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 接种日期 |
|||
*/ |
|||
private String inoculationDate; |
|||
|
|||
/** |
|||
* 接种上午开始时间 |
|||
*/ |
|||
private String moStartTime; |
|||
|
|||
/** |
|||
* 接种上午结束时间 |
|||
*/ |
|||
private String moEndTime; |
|||
|
|||
/** |
|||
* 接种下午开始时间 |
|||
*/ |
|||
private String afStartTime; |
|||
|
|||
/** |
|||
* 接种下午结束时间 |
|||
*/ |
|||
private String afEndTime; |
|||
|
|||
/** |
|||
* 暂无疫苗(1:是;2:否) |
|||
*/ |
|||
private String noAvailableVaccines; |
|||
|
|||
/** |
|||
* 咨询电话 |
|||
*/ |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 接种点地址 |
|||
*/ |
|||
private String address; |
|||
|
|||
/** |
|||
* 经度 |
|||
*/ |
|||
private String longitude; |
|||
|
|||
/** |
|||
* 纬度 |
|||
*/ |
|||
private String latitude; |
|||
|
|||
} |
|||
@ -0,0 +1,35 @@ |
|||
package com.epmet.excel; |
|||
|
|||
import cn.afterturn.easypoi.excel.annotation.Excel; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 核酸监测点 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-06-20 |
|||
*/ |
|||
@Data |
|||
public class IcPointNucleicMonitoringExcel { |
|||
|
|||
@Excel(name = "所属组织名称") |
|||
private String orgName; |
|||
|
|||
@Excel(name = "核酸监测点名称") |
|||
private String name; |
|||
|
|||
@Excel(name = "服务时间") |
|||
private String serveTime; |
|||
|
|||
@Excel(name = "咨询电话") |
|||
private String mobile; |
|||
|
|||
@Excel(name = "监测点地址") |
|||
private String address; |
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,58 @@ |
|||
package com.epmet.excel; |
|||
|
|||
import cn.afterturn.easypoi.excel.annotation.Excel; |
|||
import cn.afterturn.easypoi.excel.annotation.ExcelIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 核酸监测点 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-06-20 |
|||
*/ |
|||
@Data |
|||
public class IcPointNucleicMonitoringImportExcel { |
|||
|
|||
@Excel(name = "所属组织名称") |
|||
private String orgName; |
|||
|
|||
@Excel(name = "核酸监测点名称") |
|||
private String name; |
|||
|
|||
@Excel(name = "服务时间") |
|||
private String serveTime; |
|||
|
|||
@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; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,47 @@ |
|||
package com.epmet.excel; |
|||
|
|||
import cn.afterturn.easypoi.excel.annotation.Excel; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 疫苗接种点 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-06-20 |
|||
*/ |
|||
@Data |
|||
public class IcPointVaccinesInoculationExcel { |
|||
|
|||
@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; |
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -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;
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,35 @@ |
|||
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 PointNucleicMonitoringErrorModel { |
|||
|
|||
@Excel(name = "行号",width = 10) |
|||
private Integer num; |
|||
|
|||
@Excel(name = "所属组织名称",width = 30) |
|||
private String orgName; |
|||
|
|||
@Excel(name = "核酸监测点名称",width = 30) |
|||
private String name; |
|||
|
|||
@Excel(name = "服务时间",width = 20) |
|||
private String serveTime; |
|||
|
|||
@Excel(name = "电话",width = 30) |
|||
private String mobile; |
|||
|
|||
@Excel(name = "监测点地址",width = 40) |
|||
private String address; |
|||
|
|||
@Excel(name = "错误信息", width = 200) |
|||
private String errorMsg; |
|||
|
|||
} |
|||
@ -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; |
|||
|
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
package com.epmet.redis; |
|||
|
|||
import com.epmet.commons.tools.redis.RedisUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 核酸监测点 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-06-20 |
|||
*/ |
|||
@Component |
|||
public class IcPointNucleicMonitoringRedis { |
|||
@Autowired |
|||
private RedisUtils redisUtils; |
|||
|
|||
public void delete(Object[] ids) { |
|||
|
|||
} |
|||
|
|||
public void set(){ |
|||
|
|||
} |
|||
|
|||
public String get(String id){ |
|||
return null; |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
package com.epmet.redis; |
|||
|
|||
import com.epmet.commons.tools.redis.RedisUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 疫苗接种点 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-06-20 |
|||
*/ |
|||
@Component |
|||
public class IcPointVaccinesInoculationRedis { |
|||
@Autowired |
|||
private RedisUtils redisUtils; |
|||
|
|||
public void delete(Object[] ids) { |
|||
|
|||
} |
|||
|
|||
public void set(){ |
|||
|
|||
} |
|||
|
|||
public String get(String id){ |
|||
return null; |
|||
} |
|||
|
|||
} |
|||
@ -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); |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,108 @@ |
|||
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.IcPointNucleicMonitoringDTO; |
|||
import com.epmet.dto.form.MapInfoFormDTO; |
|||
import com.epmet.dto.result.MapInfoResultDTO; |
|||
import com.epmet.entity.IcPointNucleicMonitoringEntity; |
|||
|
|||
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 IcPointNucleicMonitoringService extends BaseService<IcPointNucleicMonitoringEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<IcPointNucleicMonitoringDTO> |
|||
* @author generator |
|||
* @date 2022-06-20 |
|||
*/ |
|||
PageData<IcPointNucleicMonitoringDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 分页条件查询 |
|||
* @param params |
|||
* @return |
|||
*/ |
|||
PageData<IcPointNucleicMonitoringDTO> getPhrasePage(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<IcPointNucleicMonitoringDTO> |
|||
* @author generator |
|||
* @date 2022-06-20 |
|||
*/ |
|||
List<IcPointNucleicMonitoringDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return IcPointNucleicMonitoringDTO |
|||
* @author generator |
|||
* @date 2022-06-20 |
|||
*/ |
|||
IcPointNucleicMonitoringDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-06-20 |
|||
*/ |
|||
void save(IcPointNucleicMonitoringDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-06-20 |
|||
*/ |
|||
void update(IcPointNucleicMonitoringDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @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); |
|||
} |
|||
@ -0,0 +1,110 @@ |
|||
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; |
|||
|
|||
/** |
|||
* 疫苗接种点 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-06-20 |
|||
*/ |
|||
public interface IcPointVaccinesInoculationService extends BaseService<IcPointVaccinesInoculationEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<IcPointVaccinesInoculationDTO> |
|||
* @author generator |
|||
* @date 2022-06-20 |
|||
*/ |
|||
PageData<IcPointVaccinesInoculationDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 分页条件查询 |
|||
* @param params |
|||
* @return |
|||
*/ |
|||
PageData<IcPointVaccinesInoculationDTO> getPhrasePage(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<IcPointVaccinesInoculationDTO> |
|||
* @author generator |
|||
* @date 2022-06-20 |
|||
*/ |
|||
List<IcPointVaccinesInoculationDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return IcPointVaccinesInoculationDTO |
|||
* @author generator |
|||
* @date 2022-06-20 |
|||
*/ |
|||
IcPointVaccinesInoculationDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-06-20 |
|||
*/ |
|||
void save(IcPointVaccinesInoculationDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-06-20 |
|||
*/ |
|||
void update(IcPointVaccinesInoculationDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @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); |
|||
|
|||
|
|||
} |
|||
@ -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); |
|||
} |
|||
} |
|||
@ -0,0 +1,377 @@ |
|||
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.NumConstant; |
|||
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.exception.RenException; |
|||
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.IcPointNucleicMonitoringDao; |
|||
import com.epmet.dto.IcPointNucleicMonitoringDTO; |
|||
import com.epmet.dto.form.ImportTaskCommonFormDTO; |
|||
import com.epmet.dto.form.MapInfoFormDTO; |
|||
import com.epmet.dto.form.OrgInfoPointFormDTO; |
|||
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; |
|||
import com.epmet.excel.IcPointNucleicMonitoringImportExcel; |
|||
import com.epmet.excel.error.EpidemicSpecialAttentionErrorModel; |
|||
import com.epmet.excel.error.PointNucleicMonitoringErrorModel; |
|||
import com.epmet.feign.EpmetCommonServiceOpenFeignClient; |
|||
import com.epmet.feign.GovOrgFeignClient; |
|||
import com.epmet.feign.OssFeignClient; |
|||
import com.epmet.redis.IcPointNucleicMonitoringRedis; |
|||
import com.epmet.service.IcPointNucleicMonitoringService; |
|||
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 IcPointNucleicMonitoringServiceImpl extends BaseServiceImpl<IcPointNucleicMonitoringDao, IcPointNucleicMonitoringEntity> implements IcPointNucleicMonitoringService { |
|||
|
|||
@Autowired |
|||
private IcPointNucleicMonitoringRedis icPointNucleicMonitoringRedis; |
|||
|
|||
@Autowired |
|||
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; |
|||
|
|||
@Autowired |
|||
private OssFeignClient ossFeignClient; |
|||
|
|||
@Autowired |
|||
private GovOrgFeignClient govOrgFeignClient; |
|||
|
|||
@Override |
|||
public PageData<IcPointNucleicMonitoringDTO> page(Map<String, Object> params) { |
|||
IPage<IcPointNucleicMonitoringEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
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)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, IcPointNucleicMonitoringDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<IcPointNucleicMonitoringEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<IcPointNucleicMonitoringEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public IcPointNucleicMonitoringDTO get(String id) { |
|||
IcPointNucleicMonitoringEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, IcPointNucleicMonitoringDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(IcPointNucleicMonitoringDTO dto) { |
|||
// 获取所有地点名称
|
|||
List<String> addressList = baseDao.getAllAddressName(); |
|||
// 校验数据库是否存在该地点名称
|
|||
if (addressList.contains(dto.getName())){ |
|||
throw new RenException("该监测点名称已存在,请重新输入"); |
|||
} |
|||
if(StringUtils.isNotBlank(dto.getOrgName())){ |
|||
// 赋值pid pids
|
|||
OrgInfoPointFormDTO formDTO = ConvertUtils.sourceToTarget(dto, OrgInfoPointFormDTO.class); |
|||
Result<CommunityInfoResultDTO> resultDTOResult = govOrgFeignClient.getCommunityInfo(formDTO); |
|||
CommunityInfoResultDTO communityInfoResultDTO = resultDTOResult.getData(); |
|||
dto.setPid(communityInfoResultDTO.getPid()); |
|||
dto.setPids(communityInfoResultDTO.getPids()); |
|||
} |
|||
IcPointNucleicMonitoringEntity entity = ConvertUtils.sourceToTarget(dto, IcPointNucleicMonitoringEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(IcPointNucleicMonitoringDTO dto) { |
|||
// 获取所有地点名称
|
|||
List<String> addressList = baseDao.getAllAddressNameNoCurrent(dto.getId()); |
|||
// 校验数据库是否存在该地点名称
|
|||
if (addressList.contains(dto.getName())){ |
|||
throw new RenException("该监测点名称已存在,请重新输入"); |
|||
} |
|||
if(StringUtils.isNotBlank(dto.getOrgName())){ |
|||
// 赋值pid pids
|
|||
OrgInfoPointFormDTO formDTO = ConvertUtils.sourceToTarget(dto, OrgInfoPointFormDTO.class); |
|||
Result<CommunityInfoResultDTO> resultDTOResult = govOrgFeignClient.getCommunityInfo(formDTO); |
|||
CommunityInfoResultDTO communityInfoResultDTO = resultDTOResult.getData(); |
|||
dto.setPid(communityInfoResultDTO.getPid()); |
|||
dto.setPids(communityInfoResultDTO.getPids()); |
|||
} |
|||
IcPointNucleicMonitoringEntity entity = ConvertUtils.sourceToTarget(dto, IcPointNucleicMonitoringEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
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<PointNucleicMonitoringErrorModel> errorInfo = new ArrayList<>(); |
|||
|
|||
try { |
|||
List<IcPointNucleicMonitoringImportExcel> list = ExcelPoiUtils.importExcel(inputStream, 0,1,IcPointNucleicMonitoringImportExcel.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).getServeTime()) && !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
|
|||
OrgInfoPointFormDTO formDTO = new OrgInfoPointFormDTO(); |
|||
formDTO.setOrgName(list.get(i).getOrgName()); |
|||
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|||
Result<CommunityInfoResultDTO> resultDTOResult = govOrgFeignClient.getCommunityInfo(formDTO); |
|||
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(IcPointNucleicMonitoringImportExcel::getName, Collectors.counting())); |
|||
groupByName.forEach((name,count) -> { |
|||
if (Integer.valueOf(count.toString()).compareTo(1) != 0){ |
|||
for (IcPointNucleicMonitoringImportExcel i : list) { |
|||
if (name.equals(i.getName()) && !i.getAddStatus()){ |
|||
errorInfo.add(getErrorInfo(i,"数据重复",i.getNum())); |
|||
i.setAddStatus(true); |
|||
} |
|||
} |
|||
} |
|||
}); |
|||
} |
|||
Map<Boolean, List<IcPointNucleicMonitoringImportExcel>> groupByStatus = list.stream().collect(Collectors.groupingBy(IcPointNucleicMonitoringImportExcel::getAddStatus)); |
|||
List<IcPointNucleicMonitoringImportExcel> needInsert = groupByStatus.get(false); |
|||
if (CollectionUtils.isNotEmpty(needInsert)){ |
|||
List<IcPointNucleicMonitoringEntity> entities = ConvertUtils.sourceToTarget(needInsert, IcPointNucleicMonitoringEntity.class); |
|||
entities.forEach(e -> { |
|||
// 设置客户ID
|
|||
e.setCustomerId(tokenDto.getCustomerId()); |
|||
}); |
|||
insertBatch(entities); |
|||
} |
|||
if (CollectionUtils.isNotEmpty(errorInfo)){ |
|||
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,""); |
|||
} |
|||
}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 PointNucleicMonitoringErrorModel getErrorInfo(IcPointNucleicMonitoringImportExcel dto, String info, Integer num){ |
|||
PointNucleicMonitoringErrorModel result = ConvertUtils.sourceToTarget(dto, PointNucleicMonitoringErrorModel.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; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,376 @@ |
|||
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.exception.RenException; |
|||
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.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 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( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
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)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, IcPointVaccinesInoculationDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<IcPointVaccinesInoculationEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<IcPointVaccinesInoculationEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public IcPointVaccinesInoculationDTO get(String id) { |
|||
IcPointVaccinesInoculationEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, IcPointVaccinesInoculationDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(IcPointVaccinesInoculationDTO dto) { |
|||
// 获取所有地点名称
|
|||
List<String> addressList = baseDao.getAllAddressName(); |
|||
// 校验数据库是否存在该地点名称
|
|||
if (addressList.contains(dto.getName())){ |
|||
throw new RenException("该接种点名称已存在,请重新输入"); |
|||
} |
|||
IcPointVaccinesInoculationEntity entity = ConvertUtils.sourceToTarget(dto, IcPointVaccinesInoculationEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(IcPointVaccinesInoculationDTO dto) { |
|||
IcPointVaccinesInoculationEntity entity = ConvertUtils.sourceToTarget(dto, IcPointVaccinesInoculationEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
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 (list.get(i).getNoAvailableVaccines() == null && !list.get(i).getAddStatus()){ |
|||
errorInfo.add(getErrorInfo(list.get(i), "暂无疫苗不能为空",i+1)); |
|||
list.get(i).setAddStatus(true); |
|||
continue; |
|||
}else{ |
|||
// 暂无疫苗为否,才校验日期
|
|||
if("2".equals(list.get(i).getNoAvailableVaccines())){ |
|||
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 (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; |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,48 @@ |
|||
CREATE TABLE `ic_point_nucleic_monitoring` ( |
|||
`ID` varchar(64) NOT NULL COMMENT 'ID', |
|||
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', |
|||
`ORG_ID` varchar(64) NOT NULL COMMENT '所属组织ID', |
|||
`ORG_NAME` varchar(255) NOT NULL COMMENT '所属组织名称', |
|||
`PID` varchar(64) NOT NULL COMMENT '组织ID上级', |
|||
`PIDS` varchar(255) NOT NULL COMMENT '组织ID所有上级', |
|||
`NAME` varchar(255) NOT NULL COMMENT '核酸监测点名称', |
|||
`SERVE_TIME` varchar(64) NOT NULL COMMENT '服务时间', |
|||
`MOBILE` varchar(11) NOT NULL COMMENT '咨询电话', |
|||
`ADDRESS` varchar(255) NOT NULL COMMENT '监测点地址', |
|||
`LONGITUDE` varchar(64) DEFAULT NULL COMMENT '经度', |
|||
`LATITUDE` varchar(64) DEFAULT NULL COMMENT '纬度', |
|||
`DEL_FLAG` int(11) NOT NULL, |
|||
`REVISION` int(11) NOT NULL COMMENT '乐观锁', |
|||
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', |
|||
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间', |
|||
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', |
|||
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', |
|||
PRIMARY KEY (`ID`) |
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='核酸监测点'; |
|||
|
|||
CREATE TABLE `ic_point_vaccines_inoculation` ( |
|||
`ID` varchar(64) NOT NULL COMMENT 'ID', |
|||
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', |
|||
`ORG_ID` varchar(64) DEFAULT NULL COMMENT '所属组织ID', |
|||
`ORG_NAME` varchar(255) DEFAULT NULL COMMENT '所属组织名称', |
|||
`PID` varchar(64) DEFAULT NULL COMMENT '组织ID上级', |
|||
`PIDS` varchar(255) DEFAULT NULL COMMENT '组织ID所有上级', |
|||
`NAME` varchar(255) NOT NULL COMMENT '疫苗接种点名称', |
|||
`INOCULATION_DATE` varchar(64) NOT NULL COMMENT '接种日期', |
|||
`MO_START_TIME` varchar(64) NOT NULL COMMENT '接种上午开始时间', |
|||
`MO_END_TIME` varchar(64) NOT NULL COMMENT '接种上午结束时间', |
|||
`AF_START_TIME` varchar(64) NOT NULL COMMENT '接种下午开始时间', |
|||
`AF_END_TIME` varchar(64) NOT NULL COMMENT '接种下午结束时间', |
|||
`NO_AVAILABLE_VACCINES` char(1) NOT NULL COMMENT '暂无疫苗(1:是;2:否)', |
|||
`MOBILE` varchar(11) NOT NULL COMMENT '咨询电话', |
|||
`ADDRESS` varchar(255) NOT NULL COMMENT '接种点地址', |
|||
`LONGITUDE` varchar(64) DEFAULT NULL COMMENT '经度', |
|||
`LATITUDE` varchar(64) DEFAULT NULL COMMENT '纬度', |
|||
`DEL_FLAG` int(11) NOT NULL, |
|||
`REVISION` int(11) NOT NULL COMMENT '乐观锁', |
|||
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', |
|||
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间', |
|||
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', |
|||
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', |
|||
PRIMARY KEY (`ID`) |
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='疫苗接种点'; |
|||
@ -0,0 +1,2 @@ |
|||
ALTER TABLE ic_point_nucleic_monitoring MODIFY COLUMN MOBILE varchar(50) NOT NULL COMMENT '咨询电话'; |
|||
ALTER TABLE ic_point_vaccines_inoculation MODIFY COLUMN MOBILE varchar(50) NOT NULL COMMENT '咨询电话'; |
|||
@ -0,0 +1,5 @@ |
|||
ALTER TABLE ic_point_vaccines_inoculation MODIFY COLUMN INOCULATION_DATE varchar(64) COMMENT '接种日期'; |
|||
ALTER TABLE ic_point_vaccines_inoculation MODIFY COLUMN MO_START_TIME varchar(64) COMMENT '接种上午开始时间'; |
|||
ALTER TABLE ic_point_vaccines_inoculation MODIFY COLUMN MO_END_TIME varchar(64) COMMENT '接种上午结束时间'; |
|||
ALTER TABLE ic_point_vaccines_inoculation MODIFY COLUMN AF_START_TIME varchar(64) COMMENT '接种下午开始时间'; |
|||
ALTER TABLE ic_point_vaccines_inoculation MODIFY COLUMN AF_END_TIME varchar(64) COMMENT '接种下午结束时间'; |
|||
Binary file not shown.
Binary file not shown.
@ -0,0 +1,137 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.IcPointNucleicMonitoringDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.IcPointNucleicMonitoringEntity" id="icPointNucleicMonitoringMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="orgId" column="ORG_ID"/> |
|||
<result property="orgName" column="ORG_NAME"/> |
|||
<result property="pid" column="PID"/> |
|||
<result property="pids" column="PIDS"/> |
|||
<result property="name" column="NAME"/> |
|||
<result property="serveTime" column="SERVE_TIME"/> |
|||
<result property="mobile" column="MOBILE"/> |
|||
<result property="address" column="ADDRESS"/> |
|||
<result property="longitude" column="LONGITUDE"/> |
|||
<result property="latitude" column="LATITUDE"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
<select id="getAllAddressName" resultType="java.lang.String"> |
|||
select |
|||
NAME |
|||
from ic_point_nucleic_monitoring |
|||
where DEL_FLAG = 0 |
|||
</select> |
|||
|
|||
<select id="getAllAddressNameNoCurrent" resultType="java.lang.String"> |
|||
select |
|||
NAME |
|||
from ic_point_nucleic_monitoring |
|||
where DEL_FLAG = 0 |
|||
and ID != #{id} |
|||
</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 PIDS like CONCAT('%',#{orgId},'%')) |
|||
</if> |
|||
order by CREATED_TIME desc |
|||
</select> |
|||
|
|||
<select id="getPhrasePageByDTO" resultType="com.epmet.dto.IcPointNucleicMonitoringDTO" parameterType="com.epmet.dto.form.PointHSYMFormDTO"> |
|||
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 PIDS like CONCAT('%',#{orgId},'%')) |
|||
</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) <= 1 then '1' |
|||
when round((st_distance_sphere(point(#{longitude},#{latitude}), point(LONGITUDE, LATITUDE))) / 1000 ,1) <= 3 then '3' |
|||
when round((st_distance_sphere(point(#{longitude},#{latitude}), point(LONGITUDE, LATITUDE))) / 1000 ,1) <= 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> |
|||
@ -0,0 +1,141 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.IcPointVaccinesInoculationDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.IcPointVaccinesInoculationEntity" id="icPointVaccinesInoculationMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="orgId" column="ORG_ID"/> |
|||
<result property="orgName" column="ORG_NAME"/> |
|||
<result property="pid" column="PID"/> |
|||
<result property="pids" column="PIDS"/> |
|||
<result property="name" column="NAME"/> |
|||
<result property="inoculationDate" column="INOCULATION_DATE"/> |
|||
<result property="moStartTime" column="MO_START_TIME"/> |
|||
<result property="moEndTime" column="MO_END_TIME"/> |
|||
<result property="afStartTime" column="AF_START_TIME"/> |
|||
<result property="afEndTime" column="AF_END_TIME"/> |
|||
<result property="noAvailableVaccines" column="NO_AVAILABLE_VACCINES"/> |
|||
<result property="mobile" column="MOBILE"/> |
|||
<result property="address" column="ADDRESS"/> |
|||
<result property="longitude" column="LONGITUDE"/> |
|||
<result property="latitude" column="LATITUDE"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
<select id="getAllAddressName" resultType="java.lang.String"> |
|||
select |
|||
NAME |
|||
from ic_point_vaccines_inoculation |
|||
where DEL_FLAG = 0 |
|||
</select> |
|||
|
|||
<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="getPhrasePageByDTO" resultType="com.epmet.dto.IcPointVaccinesInoculationDTO" parameterType="com.epmet.dto.form.PointHSYMFormDTO"> |
|||
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) <= 1 then '1' |
|||
when round((st_distance_sphere(point(#{longitude},#{latitude}), point(LONGITUDE, LATITUDE))) / 1000 ,1) <= 3 then '3' |
|||
when round((st_distance_sphere(point(#{longitude},#{latitude}), point(LONGITUDE, LATITUDE))) / 1000 ,1) <= 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> |
|||
Loading…
Reference in new issue