From 6811e9638b85f0eb3971aa95ae9373954c7a3a9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=81=92?= <3226558941@qq.com> Date: Tue, 10 Oct 2023 11:19:27 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E5=B1=85=E4=BD=8F=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=A7=BB=E6=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../communityinfo/CommunityController.java | 122 +++++++++ .../domain/communityinfo/CommunityInfo.java | 93 +++++++ .../dto/community/CommunityInfoDTO.java | 23 ++ .../communityinfo/CommunityInfoMapper.java | 56 +++++ .../communityinfo/ICommunityInfoService.java | 72 ++++++ .../impl/CommunityInfoServiceImpl.java | 171 +++++++++++++ .../manage/vo/community/CommunityInfoVO.java | 30 +++ .../communityinfo/CommunityInfoMapper.xml | 234 ++++++++++++++++++ 8 files changed, 801 insertions(+) create mode 100644 xinelu-nurse-manage/src/main/java/com/xinelu/manage/controller/communityinfo/CommunityController.java create mode 100644 xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/communityinfo/CommunityInfo.java create mode 100644 xinelu-nurse-manage/src/main/java/com/xinelu/manage/dto/community/CommunityInfoDTO.java create mode 100644 xinelu-nurse-manage/src/main/java/com/xinelu/manage/mapper/communityinfo/CommunityInfoMapper.java create mode 100644 xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/communityinfo/ICommunityInfoService.java create mode 100644 xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/communityinfo/impl/CommunityInfoServiceImpl.java create mode 100644 xinelu-nurse-manage/src/main/java/com/xinelu/manage/vo/community/CommunityInfoVO.java create mode 100644 xinelu-nurse-manage/src/main/resources/mapper/manage/communityinfo/CommunityInfoMapper.xml diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/controller/communityinfo/CommunityController.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/controller/communityinfo/CommunityController.java new file mode 100644 index 0000000..296c344 --- /dev/null +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/controller/communityinfo/CommunityController.java @@ -0,0 +1,122 @@ +package com.xinelu.manage.controller.communityinfo; + +import com.xinelu.common.annotation.Log; +import com.xinelu.common.core.controller.BaseController; +import com.xinelu.common.core.domain.AjaxResult; +import com.xinelu.common.core.page.TableDataInfo; +import com.xinelu.common.custominterface.Insert; +import com.xinelu.common.custominterface.Update; +import com.xinelu.common.enums.BusinessType; +import com.xinelu.common.utils.poi.ExcelUtil; +import com.xinelu.manage.domain.communityinfo.CommunityInfo; +import com.xinelu.manage.dto.community.CommunityInfoDTO; +import com.xinelu.manage.service.communityinfo.ICommunityInfoService; +import com.xinelu.manage.vo.community.CommunityInfoVO; +import org.springframework.security.access.prepost.PreAuthorize; + +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Objects; + +/** + * 居住社区信息Controller + * + * @author xinyilu + * @date 2022-09-13 + */ +@RestController +@RequestMapping("/system/communityInfo") +public class CommunityController extends BaseController { + @Resource + private ICommunityInfoService communityInfoService; + + /** + * 查询居住社区信息列表 + */ + @PreAuthorize("@ss.hasPermi('system:communityInfo:list')") + @GetMapping("/list") + public TableDataInfo list(CommunityInfoVO communityInfo) { + startPage(); + List list = communityInfoService.selectCommunityInfoList(communityInfo); + return getDataTable(list); + } + + /** + * 导出居住社区信息列表 + */ + @PreAuthorize("@ss.hasPermi('system:communityInfo:export')") + @Log(title = "居住社区信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, CommunityInfoVO communityInfo) { + List list = communityInfoService.selectCommunityInfoList(communityInfo); + ExcelUtil util = new ExcelUtil<>(CommunityInfoVO.class); + util.exportExcel(response, list, "居住社区信息数据"); + } + + /** + * 获取居住社区信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:communityInfo:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return AjaxResult.success(communityInfoService.selectCommunityInfoById(id)); + } + + /** + * 新增居住社区信息 + */ + @PreAuthorize("@ss.hasPermi('system:communityInfo:add')") + @Log(title = "居住社区信息", businessType = BusinessType.INSERT) + @PostMapping(value = "/add") + public AjaxResult add(@Validated(Insert.class) @RequestBody CommunityInfoDTO communityInfo) throws Exception { + return communityInfoService.insertCommunityInfoList(communityInfo.getCommunityInfoList()); + } + + /** + * 修改居住社区信息 + */ + @PreAuthorize("@ss.hasPermi('system:communityInfo:edit')") + @Log(title = "居住社区信息", businessType = BusinessType.UPDATE) + @PostMapping(value = "/edit") + public AjaxResult edit(@Validated(Update.class) @RequestBody CommunityInfo communityInfo) throws Exception { + return communityInfoService.updateCommunityInfo(communityInfo); + } + + /** + * 删除居住社区信息 + */ + @PreAuthorize("@ss.hasPermi('system:communityInfo:remove')") + @Log(title = "居住社区信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(communityInfoService.deleteCommunityInfoByIds(ids)); + } + + /** + * 查询省级区域信息信息 + * + * @return 省级区域信息集合 + */ + @GetMapping("/getFirstLevelInfo") + public AjaxResult getFirstLevelInfo() { + return communityInfoService.getProvinceAreaInfo(); + } + + /** + * 根据父级id + * + * @param parentId 父级id + * @return 所属下级区域信息集合 + */ + @GetMapping("/getSecondaryLevelInfo") + public AjaxResult getSecondaryLevelInfo(Long parentId) { + if (Objects.isNull(parentId)) { + return AjaxResult.error("上级区域id不能为空"); + } + return communityInfoService.getSubordinateAreaInfo(parentId); + } +} \ No newline at end of file diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/communityinfo/CommunityInfo.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/communityinfo/CommunityInfo.java new file mode 100644 index 0000000..0ee0cd4 --- /dev/null +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/communityinfo/CommunityInfo.java @@ -0,0 +1,93 @@ +package com.xinelu.manage.domain.communityinfo; + +import com.xinelu.common.annotation.Excel; +import com.xinelu.common.core.domain.BaseDomain; +import com.xinelu.common.custominterface.Insert; +import com.xinelu.common.custominterface.Update; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * 居住社区信息对象 community_info + * + * @author xinyilu + * @date 2022-09-13 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "居住社区信息对象", description = "community_info") +public class CommunityInfo extends BaseDomain implements Serializable { + private static final long serialVersionUID = -1144563330958336472L; + /** + * 主键id + */ + @NotNull(message = "居住社区id不能为空", groups = {Update.class}) + private Long id; + + /** + * 所属区域编码 + */ + @NotNull(message = "所属区域编码不能为空", groups = {Insert.class, Update.class}) + @ApiModelProperty(value = "所属区域编码") + @Excel(name = "所属区域编码") + private String areaCode; + + /** + * 社区编码 + */ + @ApiModelProperty(value = "社区编码") + @Excel(name = "社区编码") + private String communityCode; + + /** + * 社区名称 + */ + @NotBlank(message = "社区名称", groups = {Insert.class, Update.class}) + @ApiModelProperty(value = "社区名称") + @Excel(name = "社区名称") + private String communityName; + + /** + * 社区经度 + */ + + @ApiModelProperty(value = "社区经度") + @Excel(name = "社区经度") + private String communityLongitude; + + /** + * 社区纬度 + */ + @ApiModelProperty(value = "社区纬度") + @Excel(name = "社区纬度") + private String communityLatitude; + + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("areaCode", getAreaCode()) + .append("communityCode", getCommunityCode()) + .append("communityName", getCommunityName()) + .append("communityLongitude", getCommunityLongitude()) + .append("communityLatitude", getCommunityLatitude()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} \ No newline at end of file diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/dto/community/CommunityInfoDTO.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/dto/community/CommunityInfoDTO.java new file mode 100644 index 0000000..06a1297 --- /dev/null +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/dto/community/CommunityInfoDTO.java @@ -0,0 +1,23 @@ +package com.xinelu.manage.dto.community; + +import com.xinelu.manage.domain.communityinfo.CommunityInfo; +import lombok.Data; + +import javax.validation.Valid; +import java.io.Serializable; +import java.util.List; + +/** + * @Description 居住社区接收集合 + * @Author zhangheng + * @Date 2022-09-09 + */ +@Data +public class CommunityInfoDTO implements Serializable { + private static final long serialVersionUID = -8215685222114894288L; + /** + * 信息集合 + */ + @Valid + private List communityInfoList; +} \ No newline at end of file diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/mapper/communityinfo/CommunityInfoMapper.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/mapper/communityinfo/CommunityInfoMapper.java new file mode 100644 index 0000000..3dda8e0 --- /dev/null +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/mapper/communityinfo/CommunityInfoMapper.java @@ -0,0 +1,56 @@ +package com.xinelu.manage.mapper.communityinfo; + + +import com.xinelu.manage.domain.communityinfo.CommunityInfo; +import com.xinelu.manage.vo.community.CommunityInfoVO; + +import java.util.List; + + +/** + * 居住社区信息Mapper接口 + * + * @author xinyilu + * @date 2022-09-13 + */ +public interface CommunityInfoMapper { + /** + * 查询居住社区信息 + * + * @param id 居住社区信息主键 + * @return 居住社区信息 + */ + CommunityInfoVO selectCommunityInfoById(Long id); + + /** + * 查询居住社区信息列表 + * + * @param communityInfo 居住社区信息 + * @return 居住社区信息集合 + */ + List selectCommunityInfoList(CommunityInfoVO communityInfo); + + /** + * 新增居住社区信息 + * + * @param communityInfo 居住社区信息 + * @return 结果 + */ + int insertCommunityInfoList(List communityInfo); + + /** + * 修改居住社区信息 + * + * @param communityInfo 居住社区信息 + * @return 结果 + */ + int updateCommunityInfo(CommunityInfo communityInfo); + + /** + * 批量删除居住社区信息 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + int deleteCommunityInfoByIds(Long[] ids); +} \ No newline at end of file diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/communityinfo/ICommunityInfoService.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/communityinfo/ICommunityInfoService.java new file mode 100644 index 0000000..ebbb89e --- /dev/null +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/communityinfo/ICommunityInfoService.java @@ -0,0 +1,72 @@ +package com.xinelu.manage.service.communityinfo; + + +import com.xinelu.common.core.domain.AjaxResult; +import com.xinelu.manage.domain.communityinfo.CommunityInfo; +import com.xinelu.manage.vo.community.CommunityInfoVO; + +import java.util.List; + + +/** + * 居住社区信息Service接口 + * + * @author xinyilu + * @date 2022-09-13 + */ +public interface ICommunityInfoService { + /** + * 查询居住社区信息 + * + * @param id 居住社区信息主键 + * @return 居住社区信息 + */ + CommunityInfoVO selectCommunityInfoById(Long id); + + /** + * 查询居住社区信息列表 + * + * @param communityInfo 居住社区信息 + * @return 居住社区信息集合 + */ + List selectCommunityInfoList(CommunityInfoVO communityInfo); + + /** + * 新增居住社区信息 + * + * @param communityInfo 居住社区信息 + * @return 结果 + */ + AjaxResult insertCommunityInfoList(List communityInfo) throws Exception; + + /** + * 修改居住社区信息 + * + * @param communityInfo 居住社区信息 + * @return 结果 + */ + AjaxResult updateCommunityInfo(CommunityInfo communityInfo) throws Exception; + + /** + * 批量删除居住社区信息 + * + * @param ids 需要删除的居住社区信息主键集合 + * @return 结果 + */ + int deleteCommunityInfoByIds(Long[] ids); + + /** + * 查询省级区域信息信息 + * + * @return 省级区域信息集合 + */ + AjaxResult getProvinceAreaInfo(); + + /** + * 根据父id查询其下属区域信息 + * + * @param parentId 父级区域id + * @return 下属区域信息集合 + */ + AjaxResult getSubordinateAreaInfo(Long parentId); +} \ No newline at end of file diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/communityinfo/impl/CommunityInfoServiceImpl.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/communityinfo/impl/CommunityInfoServiceImpl.java new file mode 100644 index 0000000..d85e030 --- /dev/null +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/communityinfo/impl/CommunityInfoServiceImpl.java @@ -0,0 +1,171 @@ +package com.xinelu.manage.service.communityinfo.impl; + + +import com.xinelu.common.constant.Constants; +import com.xinelu.common.core.domain.AjaxResult; +import com.xinelu.common.exception.ServiceException; +import com.xinelu.common.utils.SecurityUtils; +import com.xinelu.common.utils.codes.GenerateSystemCodeUtil; +import com.xinelu.manage.domain.communityinfo.CommunityInfo; +import com.xinelu.manage.domain.sysarea.SysArea; +import com.xinelu.manage.mapper.communityinfo.CommunityInfoMapper; +import com.xinelu.manage.mapper.sysarea.SysAreaMapper; +import com.xinelu.manage.service.communityinfo.ICommunityInfoService; +import com.xinelu.manage.vo.community.CommunityInfoVO; +import com.xinelu.manage.vo.sysarea.SysAreaVO; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.compress.utils.Lists; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * 居住社区信息Service业务层处理 + * + * @author xinyilu + * @date 2022-09-13 + */ +@Service +public class CommunityInfoServiceImpl implements ICommunityInfoService { + + @Resource + private CommunityInfoMapper communityInfoMapper; + + @Resource + private SysAreaMapper sysAreaMapper; + + @Resource + private GenerateSystemCodeUtil generateSystemCodeUtil; + + /** + * 查询居住社区信息 + * + * @param id 居住社区信息主键 + * @return 居住社区信息 + */ + @Override + public CommunityInfoVO selectCommunityInfoById(Long id) { + return communityInfoMapper.selectCommunityInfoById(id); + } + + /** + * 查询居住社区信息列表 + * + * @param communityInfo 居住社区信息 + * @return 居住社区信息 + */ + @Override + public List selectCommunityInfoList(CommunityInfoVO communityInfo) { + List communityInfoVOS = communityInfoMapper.selectCommunityInfoList(communityInfo); + List areaCodeList = communityInfoVOS + .stream().filter(Objects::nonNull) + .map(CommunityInfoVO::getAreaCode) + .filter(StringUtils::isNotBlank).distinct().collect(Collectors.toList()); + + if (CollectionUtils.isEmpty(areaCodeList)) { + return communityInfoVOS; + } + // 获取本护理站的区域信息 + List nurseStationAreaByList = sysAreaMapper.getNurseStationAreaByList(areaCodeList); + if (CollectionUtils.isEmpty(nurseStationAreaByList)) { + return communityInfoVOS; + } + //以护理站id进行分组将标签配置信息转为Map集合 + Map> nurseStationAreaMap = nurseStationAreaByList.stream() + .filter(Objects::nonNull) + .filter(item -> Objects.nonNull(item.getStreetCode())) + .collect(Collectors.groupingBy(SysAreaVO::getStreetCode)); + communityInfoVOS.forEach(item -> + item.setSysAreaVOList(nurseStationAreaMap.getOrDefault(Objects.isNull(item.getAreaCode()) ? 0L : item.getAreaCode(), Lists.newArrayList()))); + return communityInfoVOS; + } + + /** + * 新增居住社区信息 + * + * @param communityInfo 居住社区信息 + * @return 结果 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public AjaxResult insertCommunityInfoList(List communityInfo) throws Exception { + if (CollectionUtils.isEmpty(communityInfo)) { + return AjaxResult.error("请添加数据"); + } + //插如数据 + for (CommunityInfo community : communityInfo) { + community.setCreateTime(LocalDateTime.now()); + community.setCreateBy(SecurityUtils.getUsername()); + //编号生成 + community.setCommunityCode(Constants.COMMUNITY_CODE + + generateSystemCodeUtil.generateSystemCode(Constants.COMMUNITY_CODE)); + } + //批量新增 + int infoList = communityInfoMapper.insertCommunityInfoList(communityInfo); + if (infoList <= 0) { + throw new ServiceException("新增居住社区信息失败,请联系管理员!"); + } + return AjaxResult.success(); + } + + /** + * 修改居住社区信息 + * + * @param communityInfo 居住社区信息 + * @return 结果 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public AjaxResult updateCommunityInfo(CommunityInfo communityInfo) throws Exception { + communityInfo.setUpdateTime(LocalDateTime.now()); + communityInfo.setUpdateBy(SecurityUtils.getUsername()); + int updateCommunityInfo = communityInfoMapper.updateCommunityInfo(communityInfo); + if (updateCommunityInfo <= 0) { + throw new ServiceException("修改居住社区信息失败,请联系管理员!"); + } + return AjaxResult.success(); + } + + /** + * 批量删除居住社区信息 + * + * @param ids 需要删除的居住社区信息主键 + * @return 结果 + */ + @Override + public int deleteCommunityInfoByIds(Long[] ids) { + return communityInfoMapper.deleteCommunityInfoByIds(ids); + } + + /** + * 查询省级区域信息信息 + * + * @return 省级区域信息集合 + */ + @Override + public AjaxResult getProvinceAreaInfo() { + SysArea area = new SysArea(); + area.setAreaLevel(1); + return AjaxResult.success(sysAreaMapper.selectSysAreaList(area)); + } + + /** + * 根据父id查询其下属区域信息 + * + * @param parentId 父级区域id + * @return 下属区域信息集合 + */ + @Override + public AjaxResult getSubordinateAreaInfo(Long parentId) { + SysArea area = new SysArea(); + area.setParentId(parentId); + return AjaxResult.success(sysAreaMapper.selectSysAreaList(area)); + } +} \ No newline at end of file diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/vo/community/CommunityInfoVO.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/vo/community/CommunityInfoVO.java new file mode 100644 index 0000000..6d7a476 --- /dev/null +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/vo/community/CommunityInfoVO.java @@ -0,0 +1,30 @@ +package com.xinelu.manage.vo.community; + +import com.xinelu.manage.domain.communityinfo.CommunityInfo; +import com.xinelu.manage.vo.sysarea.SysAreaVO; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 居住社区传输实体类 + * @Author zhangheng + * @Date 2022-09-09 + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class CommunityInfoVO extends CommunityInfo implements Serializable { + private static final long serialVersionUID = -236808776108105744L; + /** + * 区域名称 + */ + private String areaName; + + /** + * 护理站区域集合 + */ + List sysAreaVOList; + +} \ No newline at end of file diff --git a/xinelu-nurse-manage/src/main/resources/mapper/manage/communityinfo/CommunityInfoMapper.xml b/xinelu-nurse-manage/src/main/resources/mapper/manage/communityinfo/CommunityInfoMapper.xml new file mode 100644 index 0000000..d3eb0a7 --- /dev/null +++ b/xinelu-nurse-manage/src/main/resources/mapper/manage/communityinfo/CommunityInfoMapper.xml @@ -0,0 +1,234 @@ + + + + + + + + + + + + + + + + + + + select id, + area_code, + community_code, + community_name, + community_longitude, + community_latitude, + create_by, + create_time, + update_by, + update_time + from community_info + + + + + + + + insert into community_info + + area_code, + + community_code, + + community_name, + + community_longitude, + + community_latitude, + + create_by, + + create_time, + + update_by, + + update_time, + + + + #{areaCode}, + + #{communityCode}, + + #{communityName}, + + #{communityLongitude}, + + #{communityLatitude}, + + #{createBy}, + + #{createTime}, + + #{updateBy}, + + #{updateTime}, + + + + + + update community_info + + area_code = + #{areaCode}, + + community_code = + #{communityCode}, + + community_name = + #{communityName}, + + community_longitude = + #{communityLongitude}, + + community_latitude = + #{communityLatitude}, + + create_by = + #{createBy}, + + create_time = + #{createTime}, + + update_by = + #{updateBy}, + + update_time = + #{updateTime}, + + + where id = #{id} + + + + delete + from community_info + where id = #{id} + + + + delete from community_info where id in + + #{id} + + + + + + + + + insert into community_info + ( + area_code, + community_code, + community_name, + community_longitude, + community_latitude, + create_by, + create_time + ) + VALUE + + ( + #{item.areaCode}, + #{item.communityCode}, + #{item.communityName}, + #{item.communityLongitude}, + #{item.communityLatitude}, + #{item.createBy}, + #{item.createTime} + ) + + + \ No newline at end of file From 4789e33f2a46efdb48030b19f1f5f8289aed8c9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=81=92?= <3226558941@qq.com> Date: Tue, 10 Oct 2023 11:40:01 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E5=AD=97=E6=AE=B5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xinelu/common/constant/Constants.java | 2 +- .../NearbyNursingStationVO.java | 2 +- .../NearbyNursingStationMapper.xml | 4 +-- .../domain/nursestation/NurseStation.java | 2 +- .../dto/nursestation/NurseStationDTO.java | 1 + .../nursestation/NurseStationMapper.java | 4 +-- .../impl/NurseStationServiceImpl.java | 2 +- .../nursestation/NurseStationSysUserVO.java | 2 +- .../manage/goodsInfo/GoodsInfoMapper.xml | 2 +- .../nursestation/NurseStationMapper.xml | 28 +++++++++---------- 10 files changed, 25 insertions(+), 24 deletions(-) diff --git a/xinelu-common/src/main/java/com/xinelu/common/constant/Constants.java b/xinelu-common/src/main/java/com/xinelu/common/constant/Constants.java index a15b82e..616ba50 100644 --- a/xinelu-common/src/main/java/com/xinelu/common/constant/Constants.java +++ b/xinelu-common/src/main/java/com/xinelu/common/constant/Constants.java @@ -227,7 +227,7 @@ public class Constants { /** * 护理站简介附近图片路径上传 */ - public static final String NURSE_STATION_INTRODUCE_TYPE = "stationIntroducePcitureUrl"; + public static final String NURSE_STATION_INTRODUCE_TYPE = "stationIntroducePictureUrl"; /** * 护理站项目图片路径上传 diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/vo/nearbynursingstation/NearbyNursingStationVO.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/vo/nearbynursingstation/NearbyNursingStationVO.java index 72d2310..64bf893 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/vo/nearbynursingstation/NearbyNursingStationVO.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/vo/nearbynursingstation/NearbyNursingStationVO.java @@ -101,7 +101,7 @@ public class NearbyNursingStationVO implements Serializable { /** * 护理站图片路径2 */ - private String stationIntroducePcitureUrl; + private String stationIntroducePictureUrl; /** * 排序 diff --git a/xinelu-nurse-applet/src/main/resources/mapper/applet/nearbynursingstation/NearbyNursingStationMapper.xml b/xinelu-nurse-applet/src/main/resources/mapper/applet/nearbynursingstation/NearbyNursingStationMapper.xml index a4bdfee..0aa0a5d 100644 --- a/xinelu-nurse-applet/src/main/resources/mapper/applet/nearbynursingstation/NearbyNursingStationMapper.xml +++ b/xinelu-nurse-applet/src/main/resources/mapper/applet/nearbynursingstation/NearbyNursingStationMapper.xml @@ -37,7 +37,7 @@ - + @@ -262,7 +262,7 @@ IFNULL(ns.duty_person, '') duty_person, IFNULL(ns.duty_phone, '') duty_phone, IFNULL(ns.station_picture_url, '') station_picture_url, - IFNULL(ns.station_introduce_pciture_url, '') station_introduce_pciture_url, + IFNULL(ns.station_introduce_picture_url, '') station_introduce_picture_url, ns.sort, ns.nurse_grade, ns.opening_hours_describe, diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/nursestation/NurseStation.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/nursestation/NurseStation.java index 0728b04..3de81f7 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/nursestation/NurseStation.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/nursestation/NurseStation.java @@ -226,7 +226,7 @@ public class NurseStation extends BaseDomain implements Serializable { .append("dutyPerson", getDutyPerson()) .append("dutyPhone", getDutyPhone()) .append("stationPictureUrl", getStationPictureUrl()) - .append("stationIntroducePcitureUrl", getStationIntroducePictureUrl()) + .append("stationIntroducePictureUrl", getStationIntroducePictureUrl()) .append("sort", getSort()) .append("createBy", getCreateBy()) .append("createTime", getCreateTime()) diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/dto/nursestation/NurseStationDTO.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/dto/nursestation/NurseStationDTO.java index 2a6e335..169ccf0 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/dto/nursestation/NurseStationDTO.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/dto/nursestation/NurseStationDTO.java @@ -23,6 +23,7 @@ public class NurseStationDTO extends NurseStation implements Serializable { * 护理站的id **/ private Long nurseStationId; + /** * 护理站标签信息表id集合 **/ diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/mapper/nursestation/NurseStationMapper.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/mapper/nursestation/NurseStationMapper.java index 6931220..79bec62 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/mapper/nursestation/NurseStationMapper.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/mapper/nursestation/NurseStationMapper.java @@ -104,10 +104,10 @@ public interface NurseStationMapper { * 修改护理站简介图片路径 * * @param nurseStationCode 护理站编号 - * @param stationIntroducePcitureUrl 护理站图片路径 + * @param stationIntroducePictureUrl 护理站图片路径 * @return int **/ - int updateNurseStationIntroduceByHead(@Param("nurseStationCode") String nurseStationCode, @Param("stationIntroducePcitureUrl") String stationIntroducePcitureUrl); + int updateNurseStationIntroduceByHead(@Param("nurseStationCode") String nurseStationCode, @Param("stationIntroducePictureUrl") String stationIntroducePictureUrl); /** diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/nursestation/impl/NurseStationServiceImpl.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/nursestation/impl/NurseStationServiceImpl.java index 6d7c473..a65e47f 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/nursestation/impl/NurseStationServiceImpl.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/nursestation/impl/NurseStationServiceImpl.java @@ -303,7 +303,7 @@ public class NurseStationServiceImpl implements INurseStationService { //获取护理站图片地址 List stationPictureUrlList = nurseStationIds.stream().filter(Objects::nonNull).filter(item -> StringUtils.isNotBlank(item.getStationPictureUrl())).map(NurseStationSysUserVO::getStationPictureUrl).distinct().collect(Collectors.toList()); //获取护理站简介图片地址 - List stationIntroducePictureUrlList = nurseStationIds.stream().filter(Objects::nonNull).filter(item -> StringUtils.isNotBlank(item.getStationIntroducePcitureUrl())).map(NurseStationSysUserVO::getStationIntroducePcitureUrl).distinct().collect(Collectors.toList()); + List stationIntroducePictureUrlList = nurseStationIds.stream().filter(Objects::nonNull).filter(item -> StringUtils.isNotBlank(item.getStationIntroducePictureUrl())).map(NurseStationSysUserVO::getStationIntroducePictureUrl).distinct().collect(Collectors.toList()); //获取护理站富文本的内容 List nurseStationAgencyIntroduceList = nurseStationIds.stream().filter(Objects::nonNull).filter(item -> StringUtils.isNotBlank(item.getAgencyIntroduce())).map(NurseStationSysUserVO::getAgencyIntroduce).distinct().collect(Collectors.toList()); // 删除护理站信息 diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/vo/nursestation/NurseStationSysUserVO.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/vo/nursestation/NurseStationSysUserVO.java index fda82b9..234ec78 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/vo/nursestation/NurseStationSysUserVO.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/vo/nursestation/NurseStationSysUserVO.java @@ -41,7 +41,7 @@ public class NurseStationSysUserVO implements Serializable { /** * 护理站简介图片路径 */ - private String stationIntroducePcitureUrl; + private String stationIntroducePictureUrl; /** * 护理站简介 diff --git a/xinelu-nurse-manage/src/main/resources/mapper/manage/goodsInfo/GoodsInfoMapper.xml b/xinelu-nurse-manage/src/main/resources/mapper/manage/goodsInfo/GoodsInfoMapper.xml index c40aaae..7194f58 100644 --- a/xinelu-nurse-manage/src/main/resources/mapper/manage/goodsInfo/GoodsInfoMapper.xml +++ b/xinelu-nurse-manage/src/main/resources/mapper/manage/goodsInfo/GoodsInfoMapper.xml @@ -520,7 +520,7 @@ duty_person, duty_phone, station_picture_url, - station_introduce_pciture_url, + station_introduce_picture_url, sort, create_by, create_time, diff --git a/xinelu-nurse-manage/src/main/resources/mapper/manage/nursestation/NurseStationMapper.xml b/xinelu-nurse-manage/src/main/resources/mapper/manage/nursestation/NurseStationMapper.xml index ca4ff94..8243e2a 100644 --- a/xinelu-nurse-manage/src/main/resources/mapper/manage/nursestation/NurseStationMapper.xml +++ b/xinelu-nurse-manage/src/main/resources/mapper/manage/nursestation/NurseStationMapper.xml @@ -52,7 +52,7 @@ - + @@ -108,7 +108,7 @@ duty_person, duty_phone, station_picture_url, - station_introduce_pciture_url, + station_introduce_picture_url, sort, create_by, create_time, @@ -173,8 +173,8 @@ and station_picture_url = #{stationPictureUrl} - - and station_introduce_pciture_url = #{stationIntroducePcitureUrl} + + and station_introduce_picture_url = #{stationIntroducePictureUrl} and sort = #{sort} @@ -270,7 +270,7 @@ ns.duty_person, ns.duty_phone, ns.station_picture_url, - ns.station_introduce_pciture_url, + ns.station_introduce_picture_url, ns.sort, ns.create_by, ns.create_time, @@ -334,7 +334,7 @@ station_picture_url, - station_introduce_pciture_url, + station_introduce_picture_url, sort, @@ -390,7 +390,7 @@ #{stationPictureUrl}, - #{stationIntroducePcitureUrl}, + #{stationIntroducePictureUrl}, #{sort}, @@ -464,8 +464,8 @@ station_picture_url = #{stationPictureUrl}, - station_introduce_pciture_url = - #{stationIntroducePcitureUrl}, + station_introduce_picture_url = + #{stationIntroducePictureUrl}, sort = #{sort}, @@ -535,7 +535,7 @@ update nurse_station - set station_introduce_pciture_url = #{stationIntroducePcitureUrl} + set station_introduce_picture_url = #{stationIntroducePictureUrl} where nurse_station_code = #{nurseStationCode} @@ -586,7 +586,7 @@ duty_person, duty_phone, station_picture_url, - station_introduce_pciture_url, + station_introduce_picture_url, sort, create_by, create_time, @@ -617,7 +617,7 @@ duty_person, duty_phone, station_picture_url, - station_introduce_pciture_url, + station_introduce_picture_url, sort, create_by, create_time, @@ -640,7 +640,7 @@ #{NurseStation.dutyPerson}, #{NurseStation.dutyPhone}, #{NurseStation.stationPictureUrl}, - #{NurseStation.stationIntroducePcitureUrl}, + #{NurseStation.stationIntroducePictureUrl}, #{NurseStation.sort}, #{NurseStation.createBy}, #{NurseStation.createTime}, @@ -769,7 +769,7 @@ ns.nurse_station_name, ns.agency_introduce, ns.station_picture_url, - ns.station_introduce_pciture_url + ns.station_introduce_picture_url FROM nurse_station ns From 0c21bd9e3a017fd7eb616689cfc6f1295b19e097 Mon Sep 17 00:00:00 2001 From: haown <454902499@qq.com> Date: Tue, 10 Oct 2023 14:09:04 +0800 Subject: [PATCH 3/7] =?UTF-8?q?update=3D=3D=3D>:=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=8E=92=E7=8F=AD=E6=9F=A5=E8=AF=A2=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppletSchedulePlanController.java | 2 +- .../VideoConsultationController.java | 4 ++-- .../SchedulePlanDetail.java | 19 +++++++++++++++++++ .../SchedulePlanDetailMapper.xml | 9 +++++++++ 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletscheduleplandetail/AppletSchedulePlanController.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletscheduleplandetail/AppletSchedulePlanController.java index 6454333..176c43e 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletscheduleplandetail/AppletSchedulePlanController.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletscheduleplandetail/AppletSchedulePlanController.java @@ -25,7 +25,7 @@ public class AppletSchedulePlanController extends BaseController { @Resource private ISchedulePlanDetailService planDetailService; - @ApiOperation("通过排班计划查询明细") + @ApiOperation("查询医生排班明细") @GetMapping("/getList") public R> getList(SchedulePlanDetail planDetail) { List list = planDetailService.getList(planDetail); diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/videoconsultation/VideoConsultationController.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/videoconsultation/VideoConsultationController.java index 2558bb3..3cb2071 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/videoconsultation/VideoConsultationController.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/videoconsultation/VideoConsultationController.java @@ -33,7 +33,7 @@ import org.springframework.web.bind.annotation.RestController; public class VideoConsultationController { @Value("${trtc.sdkappid}") - private String sdkappid; + private Long sdkappid; @Value("${trtc.secretid}") private String secretid; @Value("${trtc.secretkey}") @@ -44,7 +44,7 @@ public class VideoConsultationController { @ApiOperation("获取userSig") @GetMapping("getUserSig/{userId}") public R getUserSig(@PathVariable String userId) { - TLSSigAPIv2 sigAPIv2 = new TLSSigAPIv2(1600003294, "6b8b57a7eedb92b6646d1c81bd68681ab924e53b52069cd20b0f53c8e3801a18"); + TLSSigAPIv2 sigAPIv2 = new TLSSigAPIv2(sdkappid, secretkey); String userSig = sigAPIv2.genUserSig(userId, 36000); return R.ok(userSig); } diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/scheduleplandetail/SchedulePlanDetail.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/scheduleplandetail/SchedulePlanDetail.java index 75435b0..76e47d3 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/scheduleplandetail/SchedulePlanDetail.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/scheduleplandetail/SchedulePlanDetail.java @@ -1,16 +1,20 @@ package com.xinelu.manage.domain.scheduleplandetail; import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import java.time.LocalDate; import java.time.LocalTime; import lombok.Data; +import org.springframework.data.annotation.Transient; /** * 医生排班计划明细表 * @TableName schedule_plan_detail */ @Data +@ApiModel("医生排班计划明细表") public class SchedulePlanDetail implements Serializable { /** * 主键 @@ -20,46 +24,61 @@ public class SchedulePlanDetail implements Serializable { /** * 排班计划主键 */ + @ApiModelProperty("排班计划主键") private Long schedulePlanId; /** * 医生主键 */ + @ApiModelProperty("医生主键") private Long doctorId; /** * 医生姓名 */ + @ApiModelProperty("医生姓名") private String doctorName; /** * 排班日期 */ + @ApiModelProperty("排班日期") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") private LocalDate scheduleDate; /** * 开始时间 */ + @ApiModelProperty("开始时间") @JsonFormat(timezone = "GMT+8", pattern = "HH:mm") private LocalTime scheduleStartTime; /** * 结束时间 */ + @ApiModelProperty("结束时间") @JsonFormat(timezone = "GMT+8", pattern = "HH:mm") private LocalTime scheduleEndTime; /** * 预约状态(0:未预约,1:已预约) */ + @ApiModelProperty("预约状态(0:未预约,1:已预约)") private String applyState; /** * 启用状态(0启用 1停用) */ + @ApiModelProperty("启用状态(0:可预约 1:不可预约)") private String status; + /** + * 是否查询当前时间之后的时间 + */ + @ApiModelProperty("是否查询当前时间之后的时间,0:否,1:是") + @Transient + private Integer after; + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/xinelu-nurse-manage/src/main/resources/mapper/manage/scheduleplandetail/SchedulePlanDetailMapper.xml b/xinelu-nurse-manage/src/main/resources/mapper/manage/scheduleplandetail/SchedulePlanDetailMapper.xml index e3e858b..692b2b7 100644 --- a/xinelu-nurse-manage/src/main/resources/mapper/manage/scheduleplandetail/SchedulePlanDetailMapper.xml +++ b/xinelu-nurse-manage/src/main/resources/mapper/manage/scheduleplandetail/SchedulePlanDetailMapper.xml @@ -136,6 +136,15 @@ and schedule_date = #{scheduleDate,jdbcType=DATE} + + and DATE_FORMAT(schedule_start_time, '%H%i') <= DATE_FORMAT(#{scheduleStartTime}, '%H%i') + + + and DATE_FORMAT(schedule_end_time, '%H%i') >= DATE_FORMAT(#{scheduleEndTime}, '%H%i') + + + and DATE_FORMAT(schedule_end_time, '%H%i') < DATE_FORMAT(now(), '%H%i') + From 9a50b807b8536bd802cfb12061d4b5c74cf7e40e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=81=92?= <3226558941@qq.com> Date: Tue, 10 Oct 2023 14:48:35 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E5=AD=97=E6=AE=B5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/manage/nursestationitem/NurseStationItemMapper.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xinelu-nurse-manage/src/main/resources/mapper/manage/nursestationitem/NurseStationItemMapper.xml b/xinelu-nurse-manage/src/main/resources/mapper/manage/nursestationitem/NurseStationItemMapper.xml index a3b7813..c22ca2c 100644 --- a/xinelu-nurse-manage/src/main/resources/mapper/manage/nursestationitem/NurseStationItemMapper.xml +++ b/xinelu-nurse-manage/src/main/resources/mapper/manage/nursestationitem/NurseStationItemMapper.xml @@ -135,10 +135,9 @@ + select + count(1) + from patient_disease_info + + + patient_id = #{patientId} + + + + + + delete + from patient_disease_info + where patient_id = #{patientId} + + + + + + + + and order_evaluate_id = #{orderEvaluateId} + + + and evaluate_picture_url = #{evaluatePictureUrl} + + + + + + + + insert into order_evaluate_picture_info + + order_evaluate_id, + + evaluate_picture_url, + + create_by, + + create_time, + + update_by, + + update_time, + + + + #{orderEvaluateId}, + + #{evaluatePictureUrl}, + + #{createBy}, + + #{createTime}, + + #{updateBy}, + + #{updateTime}, + + + + + + update order_evaluate_picture_info + + order_evaluate_id = + #{orderEvaluateId}, + + evaluate_picture_url = + #{evaluatePictureUrl}, + + create_by = + #{createBy}, + + create_time = + #{createTime}, + + update_by = + #{updateBy}, + + update_time = + #{updateTime}, + + + where id = #{id} + + + + delete + from order_evaluate_picture_info + where id = #{id} + + + + delete from order_evaluate_picture_info where id in + + #{id} + + + \ No newline at end of file From b2451f91e9ca08212b73e7883a4a4776f44ddf69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=81=92?= <3226558941@qq.com> Date: Wed, 11 Oct 2023 11:26:05 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=AB=AF=E5=AF=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E4=B8=8A=E4=BC=A0=E4=BB=A3=E7=A0=81=E7=A7=BB?= =?UTF-8?q?=E6=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/common/CommonController.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/xinelu-admin/src/main/java/com/xinelu/web/controller/common/CommonController.java b/xinelu-admin/src/main/java/com/xinelu/web/controller/common/CommonController.java index 9cc6a93..ae2a4c1 100644 --- a/xinelu-admin/src/main/java/com/xinelu/web/controller/common/CommonController.java +++ b/xinelu-admin/src/main/java/com/xinelu/web/controller/common/CommonController.java @@ -6,6 +6,7 @@ import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.utils.StringUtils; import com.xinelu.common.utils.file.FileUploadUtils; import com.xinelu.common.utils.file.FileUtils; +import com.xinelu.common.utils.file.MimeTypeUtils; import com.xinelu.framework.config.ServerConfig; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -19,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; +import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.ArrayList; @@ -37,6 +39,8 @@ public class CommonController { @Autowired private ServerConfig serverConfig; + @Resource + private XinELuConfig xinELuConfig; private static final String FILE_DELIMETER = ","; @@ -147,4 +151,23 @@ public class CommonController { log.error("下载文件失败", e); } } + + /** + * 通用管理端富文本上传请求(单个) + */ + @PostMapping("/richTextPictureUrl") + public AjaxResult richTextPictureUrl(MultipartFile file) throws Exception { + // 上传文件路径 + String filePath = XinELuConfig.getProfile() + xinELuConfig.getRichTextPictureUrl(); + // 上传并返回新文件名称 + String fileName = FileUploadUtils.uploadNurseStationPath(filePath, file, MimeTypeUtils.IMAGE_EXTENSION); + //拼接路径 + String url = serverConfig.getUrl() + fileName; + AjaxResult ajax = AjaxResult.success(); + ajax.put("url", url); + ajax.put("fileName", fileName); + ajax.put("newFileName", FileUtils.getName(fileName)); + ajax.put("originalFilename", file.getOriginalFilename()); + return ajax; + } } From 9247d993a91e3c3d2495da01a78a7a9f921c7a72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=81=92?= <3226558941@qq.com> Date: Wed, 11 Oct 2023 11:38:32 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NurseAppLoginController.java | 27 -- .../nurseapplogin/NurseAppLoginService.java | 8 - .../impl/NurseAppLoginServiceImpl.java | 317 ------------------ 3 files changed, 352 deletions(-) diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/nurseapplogin/NurseAppLoginController.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/nurseapplogin/NurseAppLoginController.java index 80e996a..57e073d 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/nurseapplogin/NurseAppLoginController.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/nurseapplogin/NurseAppLoginController.java @@ -32,36 +32,9 @@ import java.util.Objects; @RequestMapping("/nurseApp/login") public class NurseAppLoginController extends BaseController { - @Resource - private RegexUtil regexUtil; @Resource private NurseAppLoginService nurseAppLoginService; - - /** - * 完善用户信息-App和微信小程序共用 - * - * @param appletUserInfoDTO 用户信息 - * @return 结果 - */ - @MobileRequestAuthorization - @PostMapping("/appInformation") - public AjaxResult information(@RequestBody @Validated(Insert.class) AppletUserInfoDTO appletUserInfoDTO, BindingResult bindingResult) { - if (bindingResult.hasErrors()) { - throw new ServiceException(bindingResult.getAllErrors().get(0).getDefaultMessage()); - } - if (Objects.isNull(appletUserInfoDTO.getPatientId())) { - return AjaxResult.error("当前用户信息不存在,无法完善信息!"); - } - if (StringUtils.isBlank(appletUserInfoDTO.getPhone())) { - return AjaxResult.error("请输入手机号!"); - } - if (StringUtils.isBlank(appletUserInfoDTO.getHomeLatitude()) && StringUtils.isBlank(appletUserInfoDTO.getHomeLongitude())) { - return AjaxResult.error("请输入位置信息!"); - } - return nurseAppLoginService.appInformation(appletUserInfoDTO); - } - /** * 查询护理人列表信息(会员小程序和App共用) * diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/nurseapplogin/NurseAppLoginService.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/nurseapplogin/NurseAppLoginService.java index 1c3bfa9..d0e8947 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/nurseapplogin/NurseAppLoginService.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/nurseapplogin/NurseAppLoginService.java @@ -14,14 +14,6 @@ import java.util.List; */ public interface NurseAppLoginService { - /** - * 完善用户信息-App和微信小程序共用 - * - * @param appletUserInfoDTO 信息 - * @return 结果 - */ - AjaxResult appInformation(AppletUserInfoDTO appletUserInfoDTO); - /** * 查询护理人列表信息 * diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/nurseapplogin/impl/NurseAppLoginServiceImpl.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/nurseapplogin/impl/NurseAppLoginServiceImpl.java index abfd9f4..18f1336 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/nurseapplogin/impl/NurseAppLoginServiceImpl.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/nurseapplogin/impl/NurseAppLoginServiceImpl.java @@ -78,95 +78,11 @@ public class NurseAppLoginServiceImpl implements NurseAppLoginService { @Resource private AppletLoginMapper appletLoginMapper; @Resource - private GenerateSystemCodeUtil generateSystemCodeUtil; - @Resource - private PatientInfoMapper patientInfoMapper; - @Resource - private PatientDiseaseInfoMapper patientDiseaseInfoMapper; - @Resource - private ReceiveAddressInfoMapper receiveAddressInfoMapper; - @Resource - private RegexUtil regexUtil; - @Resource private SysAreaMapper sysAreaMapper; @Resource private AppointmentTimeUtil appointmentTimeUtil; @Resource private SysConfigMapper sysConfigMapper; - @Resource - private PatientCouponReceiveMapper patientCouponReceiveMapper; - @Resource - private CouponMapper couponMapper; - @Resource - private SystemSettingsInfoMapper systemSettingsInfoMapper; - @Resource - private PatientIntegralChangeMapper patientIntegralChangeMapper; - @Resource - private PatientCenterMapper patientCenterMapper; - @Resource - private AppletChatConfig appletChatConfig; - @Resource - private SubscribeMessageRecordMapper subscribeMessageRecordMapper; - @Resource - private MessagePushService messagePushService; - - - /** - * 完善用户信息-App和微信小程序共用 - * - * @param appletUserInfoDTO 输入参数 - * @return 结果 - */ - @Transactional(rollbackFor = Exception.class) - @Override - public AjaxResult appInformation(AppletUserInfoDTO appletUserInfoDTO) { - //校验手机号 - boolean regexPhone = regexUtil.regexPhone(StringUtils.isBlank(appletUserInfoDTO.getPhone()) ? "" : appletUserInfoDTO.getPhone()); - if (BooleanUtils.isFalse(regexPhone)) { - return AjaxResult.error("您输入的手机号不正确,请重新输入!"); - } - //校验身份证号 - boolean cardNo = regexUtil.regexCardNo(StringUtils.isBlank(appletUserInfoDTO.getCardNo()) ? "" : appletUserInfoDTO.getCardNo()); - if (BooleanUtils.isFalse(cardNo)) { - return AjaxResult.error("您输入的身份证号不正确,请重新输入!"); - } - //修改护理人主表信息 - PatientInfo patient = patientInfoMapper.getPatientInfoById(appletUserInfoDTO.getPatientId()); - if (Objects.isNull(patient)) { - return AjaxResult.error("当前用户信息不存在,请先注册或登录!"); - } - if (StringUtils.isBlank(patient.getPatientCode())) { - appletUserInfoDTO.setPatientCode(Constants.PATIENT_PREFIX + generateSystemCodeUtil.generatePatientCode(Constants.PATIENT_PREFIX)); - } - this.updatePatientInfo(appletUserInfoDTO); - //新增会员疾病信息 - this.insertPatientDiseaseInfo(appletUserInfoDTO, appletUserInfoDTO.getPatientId()); - //新增收货人地址信息 - this.insertReceiveAddress(appletUserInfoDTO); - //判断是否是第一次完善,如果是则发放新人优惠券信息 - PatientCouponReceiveInfoVO receiveInfoVO = null; - if (Objects.isNull(patient.getLoginFlag())) { - receiveInfoVO = issueCoupons(patient, appletUserInfoDTO); - } - //删除原有头像信息 - if (StringUtils.isNotBlank(appletUserInfoDTO.getHeadPictureUrl()) && StringUtils.isNotBlank(patient.getHeadPictureUrl()) - && !patient.getHeadPictureUrl().equals(appletUserInfoDTO.getHeadPictureUrl())) { - this.deleteHeadPicture(StringUtils.isBlank(patient.getHeadPictureUrl()) ? "" : patient.getHeadPictureUrl()); - } - if (Objects.isNull(receiveInfoVO) || Objects.isNull(receiveInfoVO.getCouponId())) { - return AjaxResult.success(); - } - //查询微信小程序订阅消息记录表该会员是否已订阅 - SubscribeMessageRecord subscribeMessageRecord = subscribeMessageRecordMapper.selectSubscribeMessageRecordByPatientId(null, patient.getOpenid(), appletChatConfig.getCouponReceiveTemplateId()); - boolean subscribeMessage = Objects.nonNull(subscribeMessageRecord) - && StringUtils.isNotBlank(subscribeMessageRecord.getSubscribeStatus()) - && SubscribeStatusEnum.ACCEPT.getInfo().equals(subscribeMessageRecord.getSubscribeStatus()); - if (BooleanUtils.isTrue(subscribeMessage)) { - //完善用户信息领取优惠券异步发送信息 - messagePushService.messageCouponReceiveThread(subscribeMessageRecord, receiveInfoVO); - } - return AjaxResult.success(); - } /** * 查询护理人列表信息 @@ -312,237 +228,4 @@ public class NurseAppLoginServiceImpl implements NurseAppLoginService { } return nurseAppLoginMapper.selectAppointmentOrderDetailsByPatientId(patientId, orderStatus); } - - /** - * 修改会员信息 - * - * @param appletUserInfoDTO 输入参数 - */ - private void updatePatientInfo(AppletUserInfoDTO appletUserInfoDTO) { - PatientInfo patientInfo = new PatientInfo(); - appletUserInfoDTO.setUpdateTime(LocalDateTime.now()); - BeanUtils.copyProperties(appletUserInfoDTO, patientInfo); - patientInfo.setId(appletUserInfoDTO.getPatientId()); - patientInfo.setLoginFlag(new AtomicInteger(1).intValue()); - patientInfo.setUpdateTime(LocalDateTime.now()); - if (CollectionUtils.isNotEmpty(appletUserInfoDTO.getNurseTypeIdList())) { - String serviceIds = appletUserInfoDTO.getNurseTypeIdList().stream().map(String::valueOf).collect(Collectors.joining(",")); - patientInfo.setServiceIds(serviceIds); - } - //查询省份证号数量,根据数量判断是否为主账号 - int cardNoCount = nurseAppLoginMapper.getCardNoCount(appletUserInfoDTO.getCardNo()); - patientInfo.setPrimaryAccountFlag(cardNoCount == 0 ? 0 : 1); - if (StringUtils.isNotBlank(appletUserInfoDTO.getSource())) { - patientInfo.setSource(appletUserInfoDTO.getSource()); - } - if (Objects.nonNull(appletUserInfoDTO.getInvitationPatientId())) { - patientInfo.setInvitationPatientId(appletUserInfoDTO.getInvitationPatientId()); - } - if (StringUtils.isNotBlank(appletUserInfoDTO.getSex())) { - patientInfo.setSex(appletUserInfoDTO.getSex()); - } - if (Objects.nonNull(appletUserInfoDTO.getBirthDate())) { - patientInfo.setBirthDate(appletUserInfoDTO.getBirthDate()); - } - //修改 - int updatePatientInfoCount = patientInfoMapper.updatePatientInfo(patientInfo); - if (updatePatientInfoCount <= 0) { - throw new ServiceException("完善信息失败,请联系管理员!"); - } - //判断是否是通过邀请好友方式进行完善的,赠送邀请请人积分以及记录积分变更记录 - if (StringUtils.isNotBlank(appletUserInfoDTO.getSource()) && PatientSourceEnum.FRIEND_INVITATION.getInfo().equals(appletUserInfoDTO.getSource())) { - if (Objects.isNull(appletUserInfoDTO.getInvitationPatientId())) { - return; - } - //查询邀请人信息 - PatientInfoVO invitationPatientInfo = patientInfoMapper.getPatientInfoById(appletUserInfoDTO.getInvitationPatientId()); - if (Objects.isNull(invitationPatientInfo)) { - return; - } - SystemSettingsInfo settingsInfo = systemSettingsInfoMapper.getSystemSettingsInfoByType(SettingsTypeEnum.INVITE_FRIENDS.getInfo()); - //赠送积分值 - int changeIntegral = 0; - if (Objects.nonNull(settingsInfo) && Objects.nonNull(settingsInfo.getIntegralCount())) { - changeIntegral = settingsInfo.getIntegralCount(); - } - patientCenterMapper.updatePatientIntegral(invitationPatientInfo.getId(), changeIntegral); - //邀请人账户原始积分值 - int originalIntegral = Objects.isNull(invitationPatientInfo.getIntegral()) ? 0 : invitationPatientInfo.getIntegral(); - this.insertPatientIntegral(invitationPatientInfo.getId(), originalIntegral, changeIntegral); - } - } - - /** - * 新增会员疾病信息 - * - * @param appletUserInfoDTO 输入参数 - * @param patientId 被护理人Id - */ - private void insertPatientDiseaseInfo(AppletUserInfoDTO appletUserInfoDTO, Long patientId) { - //设置护理人疾病关系表信息 - if (CollectionUtils.isNotEmpty(appletUserInfoDTO.getDiseaseInfoList())) { - //剔除疾病名称重复的信息 - List otherDiseaseList = appletUserInfoDTO.getDiseaseInfoList().stream().filter(item -> Objects.isNull(item.getDiseaseId())).collect(Collectors.toList()); - List dictDiseaseList = appletUserInfoDTO.getDiseaseInfoList().stream().filter(item -> Objects.nonNull(item.getDiseaseId())).collect(Collectors.toList()); - List dataListTwo = otherDiseaseList.stream() - .filter(item -> StringUtils.isNotBlank(item.getDiseaseName())) - .filter(otherInfo -> !dictDiseaseList.stream().map(PatientDiseaseInfo::getDiseaseName).filter(StringUtils::isNotBlank).collect(Collectors.toList()).contains(otherInfo.getDiseaseName())).collect(Collectors.toList()); - if (CollectionUtils.isNotEmpty(dataListTwo)) { - dictDiseaseList.addAll(dataListTwo); - } - //根据id查询疾病信息表 - int diseaseInfoCount = nurseAppLoginMapper.selectPatientDiseaseInfo(patientId); - if (diseaseInfoCount > 0) { - long deletePatientDiseaseCount = nurseAppLoginMapper.deletePatientDiseaseInfo(patientId); - if (deletePatientDiseaseCount <= 0) { - log.warn("删除patient_disease_info信息失败,会员id:[{}]", patientId); - throw new ServiceException("完善信息失败,请联系管理员!"); - } - } - for (PatientDiseaseInfo patientDiseaseInfo : dictDiseaseList) { - patientDiseaseInfo.setPatientId(patientId); - patientDiseaseInfo.setDiseaseId(Objects.isNull(patientDiseaseInfo.getDiseaseId()) ? null : patientDiseaseInfo.getDiseaseId()); - patientDiseaseInfo.setDiseaseName(patientDiseaseInfo.getDiseaseName()); - patientDiseaseInfo.setCreateTime(LocalDateTime.now()); - } - //新增护理人疾病关系表信息 - int insertBatchCount = patientDiseaseInfoMapper.insertBatchPatientDiseaseInfo(dictDiseaseList); - if (insertBatchCount <= 0) { - log.info("新增护理人疾病关系表信息失败,输入参数[{}]", appletUserInfoDTO.getDiseaseInfoList()); - throw new ServiceException("完善信息失败,请联系管理员!"); - } - } - } - - /** - * 新增收货人地址信息 - * - * @param appletUserInfoDTO 输入参数 - */ - private void insertReceiveAddress(AppletUserInfoDTO appletUserInfoDTO) { - //判断当前收货地址信息是否存在 - int receiveCount = receiveAddressInfoMapper.getReceiveAddressInfo(appletUserInfoDTO.getPatientId(), appletUserInfoDTO.getPatientName(), appletUserInfoDTO.getPhone(), appletUserInfoDTO.getAddress()); - if (receiveCount > 0) { - return; - } - //添加收货人地址信息 - ReceiveAddressInfo receiveAddressInfo = new ReceiveAddressInfo(); - receiveAddressInfo.setReceiveAddress(appletUserInfoDTO.getAddress()); - receiveAddressInfo.setReceivePhone(appletUserInfoDTO.getPhone()); - receiveAddressInfo.setAreaCode(appletUserInfoDTO.getAreaCode()); - receiveAddressInfo.setPatientId(appletUserInfoDTO.getPatientId()); - receiveAddressInfo.setReceiveName(appletUserInfoDTO.getPatientName()); - int insertReceiveAddressInfo = receiveAddressInfoMapper.insertReceiveAddressInfo(receiveAddressInfo); - if (insertReceiveAddressInfo <= 0) { - throw new ServiceException("修改收货人地址信息失败,请联系管理员!"); - } - } - - /** - * 发放优惠券方法胡 - * - * @param patient 会员信息 - */ - public PatientCouponReceiveInfoVO issueCoupons(PatientInfo patient, AppletUserInfoDTO appletUserInfoDTO) { - PatientCouponReceiveInfoVO receiveInfoVO = new PatientCouponReceiveInfoVO(); - //查询新人福利的优惠券列表信息 - Coupon coupon = new Coupon(); - Long patientId = patient.getId(); - coupon.setReceiveType(CouponReceiveTypeEnum.NEW_PEOPLE_WELFARE.getInfo()); - List couponList = couponMapper.selectCouponList(coupon); - if (CollectionUtils.isEmpty(couponList)) { - return receiveInfoVO; - } - //组装优惠券信息 - List couponReceiveList = Lists.newArrayList(); - for (Coupon couponInfo : couponList) { - if (Objects.isNull(couponInfo.getId())) { - continue; - } - PatientCouponReceive couponReceive = new PatientCouponReceive(); - couponReceive.setPatientId(patientId); - couponReceive.setCouponId(couponInfo.getId()); - couponReceive.setReceiveSource(CouponReceiveTypeEnum.NEW_PEOPLE_WELFARE.getInfo()); - if (Objects.nonNull(appletUserInfoDTO.getCouponId()) && couponInfo.getId().equals(appletUserInfoDTO.getCouponId())) { - couponReceive.setUseStatus(CouponUseStatusEnum.NOT_USED.getInfo()); - couponReceive.setExpirationStartTime(LocalDateTime.now()); - couponReceive.setExpirationEndTime(LocalDate.now().plusDays(Objects.isNull(couponInfo.getCouponReductionDays()) ? 0 : couponInfo.getCouponReductionDays()).atTime(23, 59, 59)); - couponReceive.setReceiveTime(LocalDateTime.now()); - } else { - couponReceive.setUseStatus(CouponUseStatusEnum.WAIT_RECEIVE.getInfo()); - couponReceive.setExpirationStartTime(null); - couponReceive.setExpirationEndTime(null); - couponReceive.setReceiveTime(null); - } - couponReceive.setCouponReductionDays(Objects.isNull(couponInfo.getCouponReductionDays()) ? 0 : couponInfo.getCouponReductionDays()); - couponReceive.setCreateTime(LocalDateTime.now()); - couponReceive.setCouponTitle(StringUtils.isBlank(couponInfo.getCouponTitle()) ? "" : couponInfo.getCouponTitle()); - couponReceive.setCouponPrice(Objects.isNull(couponInfo.getCouponPrice()) ? BigDecimal.ZERO : couponInfo.getCouponPrice()); - couponReceive.setCouponConsumePrice(Objects.isNull(couponInfo.getCouponConsumePrice()) ? BigDecimal.ZERO : couponInfo.getCouponConsumePrice()); - couponReceive.setCouponDescription(StringUtils.isBlank(couponInfo.getCouponDescription()) ? "" : couponInfo.getCouponDescription()); - couponReceiveList.add(couponReceive); - } - if (CollectionUtils.isNotEmpty(couponReceiveList)) { - int insertCount = patientCouponReceiveMapper.insertBatchPatientReceive(couponReceiveList); - if (insertCount <= 0) { - log.error("完善用户信息接口-新人送券执行失败,输入参数[{}]", couponReceiveList); - throw new ServiceException("完善用户信息失败,请联系管理员!"); - } - } - //把要发放的优惠券数据塞入发送消息实体中 - Coupon couponMessagePush = couponList.stream().filter(Objects::nonNull) - .filter(couponInfo -> (Objects.nonNull(appletUserInfoDTO.getCouponId()) && couponInfo.getId().equals(appletUserInfoDTO.getCouponId()))) - .findFirst().orElse(new Coupon()); - BeanUtils.copyProperties(couponMessagePush, receiveInfoVO); - receiveInfoVO.setReceiveTime(LocalDateTime.now()); - receiveInfoVO.setCouponId(Objects.isNull(couponMessagePush.getId()) ? null : couponMessagePush.getId()); - receiveInfoVO.setCouponType(CouponTypeEnum.FULL_REDUCTION_COUPON.getInfo()); - return receiveInfoVO; - } - - - /** - * 删除个人头像图片 - * - * @param pictureUrl 图片路径 - */ - private void deleteHeadPicture(String pictureUrl) { - if (StringUtils.isBlank(pictureUrl)) { - return; - } - String picture = XinELuConfig.getProfile() + pictureUrl.replaceAll("/profile", ""); - File checkReportNameFile = new File(picture); - if (checkReportNameFile.exists()) { - //文件名称已存在,删除文件 - boolean delete = checkReportNameFile.delete(); - if (BooleanUtils.isFalse(delete)) { - throw new ServiceException("图片文件删除失败!"); - } - } - } - - - /** - * 生成积分积分信息 - * - * @param invitationPatientId 邀请人id - * @param originalIntegral 原始账户积分 - * @param changeIntegral 赠送变更积分 - */ - private void insertPatientIntegral(Long invitationPatientId, int originalIntegral, int changeIntegral) { - PatientIntegralChange integralChange = new PatientIntegralChange(); - integralChange.setPatientId(invitationPatientId); - integralChange.setOriginalIntegral(originalIntegral); - integralChange.setChangeIntegral(changeIntegral); - integralChange.setChangeTime(LocalDateTime.now()); - integralChange.setChangeType(IntegralChangeType.FRIEND_INVITATION.getInfo()); - integralChange.setChangeRemark("邀请好友赠送积分"); - integralChange.setChangeIntegralChannel(OrderChannelEnum.WECHAT_APPLET.getInfo()); - integralChange.setCreateTime(LocalDateTime.now()); - int insertCount = patientIntegralChangeMapper.insertPatientIntegralChange(integralChange); - if (insertCount <= 0) { - log.error("邀请好友-生成积分变更记录表信息失败,积分变更信息:{}", integralChange); - throw new ServiceException("完善用户信息失败,请联系管理员!"); - } - } } \ No newline at end of file