springcloud_k8s_panzhihuazhihuishequ/applets_backstage/src/main/java/com/panzhihua/applets_backstage/api/VaccinesApi.java
@@ -8,10 +8,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -42,5 +39,11 @@ return communityService.addVaccinesByAdmin(vaccinesByAdminDTO); } @ApiOperation(value = "删除疫苗信息") @PostMapping("delete") public R deleteVaccinesByAdmin(@RequestParam("id") Long id) { return communityService.deleteVaccinesByAdmin(id); } } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/vaccines/VaccinesEnrollUserByAppVO.java
@@ -31,6 +31,9 @@ @ApiModelProperty("身份证号码") private String idCard; @ApiModelProperty("性别(1.男 2.女)") private Integer sex; @ApiModelProperty("是否已报名(1.是 2.否)") private Integer isEnroll; springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -2602,4 +2602,12 @@ */ @PostMapping("/vaccines/admin/enroll/list") R getVaccinesEnrollListByAdmin(@RequestBody VaccinesEnrollByAdminDTO vaccinesByAdminDTO); /** * 删除疫苗分类信息 * @param id 疫苗分类id * @return 删除结果 */ @PostMapping("/vaccines/admin/enroll/delete") R deleteVaccinesByAdmin(@RequestParam("id") Long id); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/VaccinesApi.java
@@ -102,4 +102,14 @@ public R getVaccinesEnrollListByAdmin(@RequestBody VaccinesEnrollByAdminDTO vaccinesByAdminDTO) { return comMngVaccinesEnrollRecordService.getVaccinesEnrollListByAdmin(vaccinesByAdminDTO); } /** * 删除疫苗分类信息 * @param id 疫苗分类id * @return 删除结果 */ @PostMapping("/admin/delete") public R deleteVaccinesByAdmin(@RequestParam("id") Long id) { return comMngVaccinesService.deleteVaccinesByAdmin(id); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngVaccinesEnrollRecordDAO.java
@@ -24,11 +24,31 @@ @Select("select cmfi.id as userId,cmfi.name,cmfi.age,cmfi.job,cmfi.phone,cmfi.id_card from com_mng_family_info as cmfi where user_id = #{userId}") List<VaccinesEnrollUserByAppVO> getFamilyUserList(@Param("userId") Long userId); @Select("select su.user_id,su.name,su.nick_name,su.job,su.phone,su.id_card,su.birthday from sys_user as su where user_id = #{userId}") @Select("select su.user_id,su.name,su.nick_name,su.job,su.phone,su.id_card,su.birthday,su.sex from sys_user as su where user_id = #{userId}") VaccinesEnrollUserByAppVO getSysUser(@Param("userId") Long userId); @Select("select cmfi.name,cmfi.age,cmfi.phone,cmfi.id_card from com_mng_family_info as cmfi where id = #{userId}") VaccinesEnrollUserByAppVO getFamilyUser(@Param("userId") Long userId); @Select("<script> " + "select cmver.id,cmv.`name`,cmver.create_at from com_mng_vaccines_enroll_record as cmver" + "select cmver.id,cmver.name,cmver.sex,cmver.age,cmver.phone,cmver.id_card,cmver.create_at from com_mng_vaccines_enroll_record as cmver" + " <where>" + "<if test='vaccinesByAdminDTO.name != null and vaccinesByAdminDTO.name != ""'>" + " and cmver.name like concat('%',#{vaccinesByAdminDTO.name},'%') "+ " </if> " + "<if test='vaccinesByAdminDTO.idCard != null and vaccinesByAdminDTO.idCard != ""'>" + " and cmver.id_card = #{vaccinesByAdminDTO.idCard} "+ " </if> " + "<if test='vaccinesByAdminDTO.phone != null and vaccinesByAdminDTO.phone != ""'>" + " and cmver.phone = #{vaccinesByAdminDTO.phone} "+ " </if> " + "<if test='vaccinesByAdminDTO.startTime != null '>\n" + " AND cmver.create_at <![CDATA[>=]]> #{vaccinesByAdminDTO.startTime} \n" + "</if>" + "<if test='vaccinesByAdminDTO.endTime != null '>\n" + " AND cmver.create_at <![CDATA[<=]]> #{vaccinesByAdminDTO.endTime} " + " </if> \n" + " </where>" + " </script>") IPage<VaccinesEnrollByAdminVO> getVaccinesEnrollListByAdmin(Page page, @Param("vaccinesByAdminDTO") VaccinesEnrollByAdminDTO vaccinesByAdminDTO); springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComMngVaccinesEnrollRecordDO.java
@@ -58,6 +58,31 @@ private Integer familyUserType; /** * 姓名 */ private String name; /** * 年龄 */ private Integer age; /** * 手机号 */ private String phone; /** * 身份证号码 */ private String idCard; /** * 性别(1.男 2.女) */ private Integer sex; /** * 报名类型(1.小程序用户 2.小程序家庭成员) */ public interface familyUserType{ springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngVaccinesService.java
@@ -39,4 +39,11 @@ */ R addVaccinesByAdmin(VaccinesByAdminDTO vaccinesByAdminDTO); /** * 删除疫苗分类信息 * @param id 疫苗分类id * @return 删除结果 */ R deleteVaccinesByAdmin(Long id); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngVaccinesEnrollRecordServiceImpl.java
@@ -102,7 +102,25 @@ //报名疫苗填充对象 ComMngVaccinesEnrollRecordDO vaccinesEnrollRecordDO = new ComMngVaccinesEnrollRecordDO(); if(userByAppDTO.getIsUser().equals(EnrollUserByAppDTO.isUser.yes)){ //如果是自己就查询自己的信息 VaccinesEnrollUserByAppVO enrollUserByAppVO = this.baseMapper.getSysUser(enrollByAppDTO.getUserId()); if(enrollUserByAppVO != null){ vaccinesEnrollRecordDO.setName(enrollUserByAppVO.getName()); vaccinesEnrollRecordDO.setIdCard(enrollUserByAppVO.getIdCard()); vaccinesEnrollRecordDO.setAge(enrollUserByAppVO.getAge()); vaccinesEnrollRecordDO.setPhone(enrollUserByAppVO.getPhone()); vaccinesEnrollRecordDO.setSex(IdCard.sex(enrollUserByAppVO.getIdCard())); } vaccinesEnrollRecordDO.setFamilyUserType(ComMngVaccinesEnrollRecordDO.familyUserType.mini); }else{ VaccinesEnrollUserByAppVO enrollUserByAppVO = this.baseMapper.getFamilyUser(userByAppDTO.getUserId()); if(enrollUserByAppVO != null){ vaccinesEnrollRecordDO.setName(enrollUserByAppVO.getName()); vaccinesEnrollRecordDO.setIdCard(enrollUserByAppVO.getIdCard()); vaccinesEnrollRecordDO.setAge(enrollUserByAppVO.getAge()); vaccinesEnrollRecordDO.setPhone(enrollUserByAppVO.getPhone()); vaccinesEnrollRecordDO.setSex(IdCard.sex(enrollUserByAppVO.getIdCard())); } } vaccinesEnrollRecordDO.setUserId(enrollByAppDTO.getUserId()); vaccinesEnrollRecordDO.setFamilyUserId(userByAppDTO.getUserId()); springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngVaccinesServiceImpl.java
@@ -95,4 +95,23 @@ } } /** * 删除疫苗分类信息 * @param id 疫苗分类id * @return 删除结果 */ @Override public R deleteVaccinesByAdmin(Long id){ ComMngVaccinesDO vaccinesDO = this.baseMapper.selectById(id); if(vaccinesDO == null){ return R.fail("未找到疫苗分类记录"); } if(this.baseMapper.deleteById(id) > 0){ return R.ok(); }else{ return R.fail(); } } }