Commit a5ddd042f0c11989921c9bb18b53ec4cda7d910e
Exists in
master
and in
1 other branch
Merge remote-tracking branch 'origin/master'
Showing 10 changed files
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/Permissions2.java
- platform-biz-service/src/main/resources/mainOrm/master/Permissions2.xml
- platform-biz-service/src/main/resources/mainOrm/slave/Permissions2.xml
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PremaritalCheckupController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ResidentArchivesRegionController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ResidentsArchiveController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PremaritalCheckupFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ResidentsArchiveFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ResidentsFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/FunvCommonUtil.java
platform-biz-service/src/main/java/com/lyms/platform/permission/model/Permissions2.java
View file @
a5ddd04
| ... | ... | @@ -15,6 +15,15 @@ |
| 15 | 15 | private String createUser; |
| 16 | 16 | private Integer enable; |
| 17 | 17 | private String extra_data; |
| 18 | + private Integer weight; | |
| 19 | + | |
| 20 | + public Integer getWeight() { | |
| 21 | + return weight; | |
| 22 | + } | |
| 23 | + | |
| 24 | + public void setWeight(Integer weight) { | |
| 25 | + this.weight = weight; | |
| 26 | + } | |
| 18 | 27 | |
| 19 | 28 | public String getExtra_data() { |
| 20 | 29 | return extra_data; |
platform-biz-service/src/main/resources/mainOrm/master/Permissions2.xml
View file @
a5ddd04
| ... | ... | @@ -14,6 +14,7 @@ |
| 14 | 14 | <result column="create_user" property="createUser" jdbcType="VARCHAR" /> |
| 15 | 15 | <result column="enable" property="enable" jdbcType="INTEGER" /> |
| 16 | 16 | <result column="extra_data" property="extra_data" jdbcType="VARCHAR" /> |
| 17 | + <result column="weight" property="weight" jdbcType="INTEGER" /> | |
| 17 | 18 | </resultMap> |
| 18 | 19 | |
| 19 | 20 | |
| ... | ... | @@ -65,7 +66,7 @@ |
| 65 | 66 | |
| 66 | 67 | |
| 67 | 68 | <select id="getPermissions2" resultMap="Permissions2ResultMap" parameterType="java.lang.Integer"> |
| 68 | - select id,name,uri,type,puri,icon,yn,create_date,create_user,enable,extra_data | |
| 69 | + select id,name,uri,type,puri,icon,yn,create_date,create_user,enable,extra_data,weight | |
| 69 | 70 | from permissions2 where id = #{id,jdbcType=INTEGER} |
| 70 | 71 | </select> |
| 71 | 72 | |
| ... | ... | @@ -120,7 +121,7 @@ |
| 120 | 121 | |
| 121 | 122 | |
| 122 | 123 | <select id="queryPermissions2" resultMap="Permissions2ResultMap" parameterType="com.lyms.platform.permission.model.Permissions2Query"> |
| 123 | - select id,name,uri,type,puri,icon,yn,create_date,create_user,enable,extra_data | |
| 124 | + select id,name,uri,type,puri,icon,yn,create_date,create_user,enable,extra_data,weight | |
| 124 | 125 | from permissions2 |
| 125 | 126 | <include refid="Permissions2Condition" /> |
| 126 | 127 | <include refid="orderAndLimit" /> |
platform-biz-service/src/main/resources/mainOrm/slave/Permissions2.xml
View file @
a5ddd04
| ... | ... | @@ -14,6 +14,7 @@ |
| 14 | 14 | <result column="create_user" property="createUser" jdbcType="VARCHAR" /> |
| 15 | 15 | <result column="enable" property="enable" jdbcType="INTEGER" /> |
| 16 | 16 | <result column="extra_data" property="extra_data" jdbcType="VARCHAR" /> |
| 17 | + <result column="weight" property="weight" jdbcType="INTEGER" /> | |
| 17 | 18 | </resultMap> |
| 18 | 19 | |
| 19 | 20 | |
| ... | ... | @@ -64,7 +65,7 @@ |
| 64 | 65 | |
| 65 | 66 | |
| 66 | 67 | <select id="getPermissions2" resultMap="Permissions2ResultMap" parameterType="java.lang.Integer"> |
| 67 | - select id,name,uri,type,puri,icon,yn,create_date,create_user,enable,extra_data | |
| 68 | + select id,name,uri,type,puri,icon,yn,create_date,create_user,enable,extra_data,weight | |
| 68 | 69 | from permissions2 where id = #{id,jdbcType=INTEGER} |
| 69 | 70 | </select> |
| 70 | 71 | |
| ... | ... | @@ -119,7 +120,7 @@ |
| 119 | 120 | |
| 120 | 121 | |
| 121 | 122 | <select id="queryPermissions2" resultMap="Permissions2ResultMap" parameterType="com.lyms.platform.permission.model.Permissions2Query"> |
| 122 | - select id,name,uri,type,puri,icon,yn,create_date,create_user,enable,extra_data | |
| 123 | + select id,name,uri,type,puri,icon,yn,create_date,create_user,enable,extra_data,weight | |
| 123 | 124 | from permissions2 |
| 124 | 125 | <include refid="Permissions2Condition" /> |
| 125 | 126 | <include refid="orderAndLimit" /> |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PremaritalCheckupController.java
View file @
a5ddd04
| ... | ... | @@ -103,6 +103,20 @@ |
| 103 | 103 | premaritalCheckupFacade.premaritalCheckupExport(queryRequest,loginState.getId(),response); |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | + /** | |
| 107 | + * 删除婚前检查记录 | |
| 108 | + * @param id | |
| 109 | + * @param request | |
| 110 | + * @return | |
| 111 | + */ | |
| 112 | + @RequestMapping(value = "/deletePremaritalCheckup", method = RequestMethod.DELETE) | |
| 113 | + @ResponseBody | |
| 114 | + @TokenRequired | |
| 115 | + public BaseResponse deletePremaritalCheckup(@RequestParam("id") String id, | |
| 116 | + HttpServletRequest request) { | |
| 117 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 118 | + return premaritalCheckupFacade.deletePremaritalCheckup(id,loginState.getId()); | |
| 119 | + } | |
| 106 | 120 | |
| 107 | 121 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ResidentArchivesRegionController.java
View file @
a5ddd04
| ... | ... | @@ -13,6 +13,7 @@ |
| 13 | 13 | import org.springframework.web.bind.annotation.ResponseBody; |
| 14 | 14 | |
| 15 | 15 | import javax.servlet.http.HttpServletRequest; |
| 16 | +import javax.servlet.http.HttpServletResponse; | |
| 16 | 17 | import javax.validation.Valid; |
| 17 | 18 | |
| 18 | 19 | /** |
| 19 | 20 | |
| ... | ... | @@ -37,10 +38,29 @@ |
| 37 | 38 | @RequestMapping(value = "/regionalWomenList", method = RequestMethod.GET) |
| 38 | 39 | @ResponseBody |
| 39 | 40 | @TokenRequired |
| 40 | - public BaseResponse queryAllResidents(@Valid ResidentsArchiveQueryRequest queryRequest,HttpServletRequest request) { | |
| 41 | + public BaseResponse queryAllResidents(@Valid ResidentsArchiveQueryRequest queryRequest, | |
| 42 | + HttpServletRequest request) { | |
| 41 | 43 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
| 42 | 44 | return residentsFacade.queryResidentsArchives(queryRequest,loginState.getId()); |
| 43 | 45 | } |
| 46 | + | |
| 47 | + | |
| 48 | + /** | |
| 49 | + * 妇女健康档案管理数据导出接口 | |
| 50 | + * @param queryRequest | |
| 51 | + * @param request | |
| 52 | + * @param response | |
| 53 | + */ | |
| 54 | + @RequestMapping(value = "/regionalWomenExport", method = RequestMethod.GET) | |
| 55 | + @ResponseBody | |
| 56 | + @TokenRequired | |
| 57 | + public void regionalResidentsExport(@Valid ResidentsArchiveQueryRequest queryRequest, | |
| 58 | + HttpServletRequest request, | |
| 59 | + HttpServletResponse response) { | |
| 60 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 61 | + residentsFacade.regionaResidentsExport(queryRequest,loginState.getId(),response); | |
| 62 | + } | |
| 63 | + | |
| 44 | 64 | |
| 45 | 65 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ResidentsArchiveController.java
View file @
a5ddd04
| ... | ... | @@ -55,7 +55,7 @@ |
| 55 | 55 | param.setVcCardNo(vcCardNo); |
| 56 | 56 | param.setCertificateTypeId(certificateTypeId); |
| 57 | 57 | param.setCardNo(cardNo); |
| 58 | - return residentsArchiveFacade.queryResidentsArchive(param,loginState.getId()); | |
| 58 | + return residentsArchiveFacade.queryResidentsArchive(param , loginState.getId()); | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
| ... | ... | @@ -169,6 +169,20 @@ |
| 169 | 169 | return residentsArchiveFacade.womenGuildSms(womenGuideSmsRequest, loginState.getId()); |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | + /** | |
| 173 | + * 删除单条居民建档 | |
| 174 | + * @param id | |
| 175 | + * @param request | |
| 176 | + * @return | |
| 177 | + */ | |
| 178 | + @RequestMapping(value = "/deleteResidentsArchive", method = RequestMethod.DELETE) | |
| 179 | + @ResponseBody | |
| 180 | + @TokenRequired | |
| 181 | + public BaseResponse deleteArchive(@RequestParam("id") String id, | |
| 182 | + HttpServletRequest request) { | |
| 183 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 184 | + return residentsArchiveFacade.deleteArchive(id,loginState.getId()); | |
| 185 | + } | |
| 172 | 186 | |
| 173 | 187 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PremaritalCheckupFacade.java
View file @
a5ddd04
| ... | ... | @@ -3,7 +3,6 @@ |
| 3 | 3 | import com.lyms.platform.biz.service.BasicConfigService; |
| 4 | 4 | import com.lyms.platform.biz.service.PremaritalCheckupService; |
| 5 | 5 | import com.lyms.platform.biz.service.ResidentsArchiveService; |
| 6 | -import com.lyms.platform.common.base.PageInfo; | |
| 7 | 6 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 8 | 7 | import com.lyms.platform.common.enums.MedicalAdviceEnum; |
| 9 | 8 | import com.lyms.platform.common.enums.PhysiologyStatusEnum; |
| ... | ... | @@ -30,7 +29,6 @@ |
| 30 | 29 | import org.apache.commons.collections.CollectionUtils; |
| 31 | 30 | import org.apache.commons.lang.StringUtils; |
| 32 | 31 | import org.springframework.beans.factory.annotation.Autowired; |
| 33 | -import org.springframework.data.domain.Sort; | |
| 34 | 32 | import org.springframework.stereotype.Component; |
| 35 | 33 | |
| 36 | 34 | import javax.servlet.http.HttpServletResponse; |
| ... | ... | @@ -348,6 +346,7 @@ |
| 348 | 346 | /** |
| 349 | 347 | * 婚前检查管理 |
| 350 | 348 | * @param request |
| 349 | + * @param userId | |
| 351 | 350 | * @return |
| 352 | 351 | */ |
| 353 | 352 | public BaseListResponse queryPremaritalCheckup(PremaritalCheckupQueryRequest request,Integer userId) { |
| ... | ... | @@ -697,7 +696,36 @@ |
| 697 | 696 | return id; |
| 698 | 697 | } |
| 699 | 698 | |
| 700 | - //婚前检查导出 | |
| 699 | + /** | |
| 700 | + * 删除一条婚前检查记录 | |
| 701 | + * @param id | |
| 702 | + * @param userId | |
| 703 | + * @return | |
| 704 | + */ | |
| 705 | + public BaseResponse deletePremaritalCheckup(String id,Integer userId){ | |
| 706 | + BaseResponse br = new BaseResponse(); | |
| 707 | + if (StringUtils.isEmpty(id)){ | |
| 708 | + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 709 | + br.setErrormsg("id为空"); | |
| 710 | + return br; | |
| 711 | + } | |
| 712 | + | |
| 713 | + PremaritalCheckup premaritalCheckup = premaritalCheckupService.getPremaritalCheckup(id); | |
| 714 | + if (premaritalCheckup!=null){ | |
| 715 | + premaritalCheckup.setYn(YnEnums.NO.getId()); | |
| 716 | + premaritalCheckup.setModified(new Date()); | |
| 717 | + premaritalCheckupService.updatePremaritalCheckup(premaritalCheckup,id); | |
| 718 | + } | |
| 719 | + return br.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); | |
| 720 | + } | |
| 721 | + | |
| 722 | + | |
| 723 | + /** | |
| 724 | + * 婚前检查导出 | |
| 725 | + * @param request | |
| 726 | + * @param userId | |
| 727 | + * @param response | |
| 728 | + */ | |
| 701 | 729 | public void premaritalCheckupExport(PremaritalCheckupQueryRequest request,Integer userId, |
| 702 | 730 | HttpServletResponse response){ |
| 703 | 731 | OutputStream out = null; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ResidentsArchiveFacade.java
View file @
a5ddd04
| ... | ... | @@ -618,16 +618,16 @@ |
| 618 | 618 | Map<String,Object> map = new HashMap<>(); |
| 619 | 619 | map.put("username",data.getUsername()); |
| 620 | 620 | map.put("sex","女"); |
| 621 | - map.put("birthday",getBirthday(DateUtil.getyyyy_MM_dd(data.getBirthday()))); | |
| 622 | - map.put("countryId",getBaseicConfigByid(data.getCountryId())); | |
| 623 | - map.put("nationId",getBaseicConfigByid(data.getNationId())); | |
| 624 | - map.put("marriageId",getBaseicConfigByid(data.getMarriageId())); | |
| 625 | - map.put("certificateTypeId",getBaseicConfigByid(data.getCertificateTypeId())); | |
| 621 | + map.put("birthday", FunvCommonUtil.getBirthday(DateUtil.getyyyy_MM_dd(data.getBirthday()))); | |
| 622 | + map.put("countryId",FunvCommonUtil.getBaseicConfigByid(data.getCountryId(), basicConfigService)); | |
| 623 | + map.put("nationId",FunvCommonUtil.getBaseicConfigByid(data.getNationId(), basicConfigService)); | |
| 624 | + map.put("marriageId",FunvCommonUtil.getBaseicConfigByid(data.getMarriageId(), basicConfigService)); | |
| 625 | + map.put("certificateTypeId",FunvCommonUtil.getBaseicConfigByid(data.getCertificateTypeId(), basicConfigService)); | |
| 626 | 626 | map.put("certificateNum",data.getCertificateNum()); |
| 627 | - map.put("censusTypeId",getBaseicConfigByid(data.getCensusTypeId())); | |
| 628 | - map.put("liveTypeId",getBaseicConfigByid(data.getLiveTypeId())); | |
| 629 | - map.put("levelTypeId",getBaseicConfigByid(data.getLevelTypeId())); | |
| 630 | - map.put("professionTypeId", getBaseicConfigByid(data.getProfessionTypeId())); | |
| 627 | + map.put("censusTypeId",FunvCommonUtil.getBaseicConfigByid(data.getCensusTypeId(), basicConfigService)); | |
| 628 | + map.put("liveTypeId",FunvCommonUtil.getBaseicConfigByid(data.getLiveTypeId(), basicConfigService)); | |
| 629 | + map.put("levelTypeId",FunvCommonUtil.getBaseicConfigByid(data.getLevelTypeId(), basicConfigService)); | |
| 630 | + map.put("professionTypeId", FunvCommonUtil.getBaseicConfigByid(data.getProfessionTypeId(), basicConfigService)); | |
| 631 | 631 | if (StringUtils.isNotEmpty(data.getHospitalId())){ |
| 632 | 632 | Organization organization = organizationService.getOrganization(Integer.valueOf(data.getHospitalId())); |
| 633 | 633 | if (organization != null && organization.getYn()==YnEnums.YES.getId()){ |
| ... | ... | @@ -653,7 +653,7 @@ |
| 653 | 653 | map.put("vcCardNo", data.getVcCardNo()); |
| 654 | 654 | |
| 655 | 655 | map.put("buildDoctor", data.getBuildDoctor()); |
| 656 | - map.put("buildDay", data.getBuildDay()); | |
| 656 | + map.put("buildDay", DateUtil.getyyyy_MM_dd(data.getBuildDay())); | |
| 657 | 657 | list.add(map); |
| 658 | 658 | } |
| 659 | 659 | } |
| ... | ... | @@ -694,29 +694,6 @@ |
| 694 | 694 | } |
| 695 | 695 | } |
| 696 | 696 | |
| 697 | - //获取生日 | |
| 698 | - public String getBirthday(String b){ | |
| 699 | - if (b!=null){ | |
| 700 | - String year = b.substring(0,4); | |
| 701 | - String mouth = b.substring(5,7); | |
| 702 | - String day = b.substring(8,10); | |
| 703 | - return year + "年" + mouth + "月" + day + "日"; | |
| 704 | - } | |
| 705 | - return null; | |
| 706 | - } | |
| 707 | - | |
| 708 | - //获取基础基础名称 | |
| 709 | - public String getBaseicConfigByid(String id) { | |
| 710 | - | |
| 711 | - if (StringUtils.isNotEmpty(id)){ | |
| 712 | - BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(id); | |
| 713 | - if (basicConfig!=null && basicConfig.getYn()!=YnEnums.NO.getId()){ | |
| 714 | - return basicConfig.getName(); | |
| 715 | - } | |
| 716 | - } | |
| 717 | - return ""; | |
| 718 | - } | |
| 719 | - | |
| 720 | 697 | /** |
| 721 | 698 | * 发送妇女指导短信 |
| 722 | 699 | * @param request |
| ... | ... | @@ -795,6 +772,24 @@ |
| 795 | 772 | } |
| 796 | 773 | } |
| 797 | 774 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
| 775 | + } | |
| 776 | + | |
| 777 | + | |
| 778 | + public BaseResponse deleteArchive(String id,Integer userId){ | |
| 779 | + BaseResponse br = new BaseResponse(); | |
| 780 | + if (StringUtils.isEmpty(id)){ | |
| 781 | + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 782 | + br.setErrormsg("id为空"); | |
| 783 | + return br; | |
| 784 | + } | |
| 785 | + | |
| 786 | + ResidentsArchiveModel resident = residentsArchiveService.getResident(id); | |
| 787 | + if (resident!=null){ | |
| 788 | + resident.setYn(YnEnums.NO.getId()); | |
| 789 | + resident.setModified(new Date()); | |
| 790 | + residentsArchiveService.updateResident(resident,id); | |
| 791 | + } | |
| 792 | + return br.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); | |
| 798 | 793 | } |
| 799 | 794 | |
| 800 | 795 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ResidentsFacade.java
View file @
a5ddd04
| ... | ... | @@ -7,8 +7,11 @@ |
| 7 | 7 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 8 | 8 | import com.lyms.platform.common.result.BaseResponse; |
| 9 | 9 | import com.lyms.platform.common.utils.DateUtil; |
| 10 | +import com.lyms.platform.common.utils.ExcelUtil; | |
| 11 | +import com.lyms.platform.common.utils.SystemConfig; | |
| 10 | 12 | import com.lyms.platform.operate.web.request.ResidentsArchiveQueryRequest; |
| 11 | 13 | import com.lyms.platform.operate.web.utils.CommonsHelper; |
| 14 | +import com.lyms.platform.operate.web.utils.FunvCommonUtil; | |
| 12 | 15 | import com.lyms.platform.permission.model.Organization; |
| 13 | 16 | import com.lyms.platform.permission.model.OrganizationQuery; |
| 14 | 17 | import com.lyms.platform.permission.service.OrganizationService; |
| ... | ... | @@ -25,6 +28,8 @@ |
| 25 | 28 | import org.springframework.beans.factory.annotation.Autowired; |
| 26 | 29 | import org.springframework.stereotype.Component; |
| 27 | 30 | |
| 31 | +import javax.servlet.http.HttpServletResponse; | |
| 32 | +import java.io.OutputStream; | |
| 28 | 33 | import java.util.*; |
| 29 | 34 | |
| 30 | 35 | /** |
| ... | ... | @@ -68,6 +73,7 @@ |
| 68 | 73 | query.setLimit(request.getLimit()); |
| 69 | 74 | query.setNeed("y"); |
| 70 | 75 | query.setYn(YnEnums.YES.getId()); |
| 76 | + query.setSex(SystemConfig.WOMAN_ID); | |
| 71 | 77 | |
| 72 | 78 | //出生日期范围查询 |
| 73 | 79 | if(StringUtils.isNotEmpty(request.getBirthday())){ |
| ... | ... | @@ -242,6 +248,197 @@ |
| 242 | 248 | } |
| 243 | 249 | return num; |
| 244 | 250 | } |
| 251 | + | |
| 252 | + //数据导出接口 | |
| 253 | + public void regionaResidentsExport(ResidentsArchiveQueryRequest request,Integer userId,HttpServletResponse response){ | |
| 254 | + | |
| 255 | + OutputStream out = null; | |
| 256 | + | |
| 257 | + try { | |
| 258 | + ResidentsArchiveQuery query = new ResidentsArchiveQuery(); | |
| 259 | + query.setPage(request.getPage()); | |
| 260 | + query.setLimit(request.getLimit()); | |
| 261 | + query.setNeed("y"); | |
| 262 | + query.setYn(YnEnums.YES.getId()); | |
| 263 | + //只查女性 | |
| 264 | + query.setSex(SystemConfig.WOMAN_ID); | |
| 265 | + //出生日期范围查询 | |
| 266 | + if(StringUtils.isNotEmpty(request.getBirthday())){ | |
| 267 | + String[] dates = request.getBirthday().split(" - "); | |
| 268 | + query.setBirthdayStart(DateUtil.parseYMD(dates[0])); | |
| 269 | + if(dates.length>=2){ | |
| 270 | + Date date= DateUtil.parseYMD(dates[1]); | |
| 271 | + if(null!=date){ | |
| 272 | + long d = date.getTime() + 86398000; | |
| 273 | + date = new Date(d); | |
| 274 | + } | |
| 275 | + query.setBirthdayEnd(date); | |
| 276 | + } | |
| 277 | + } | |
| 278 | + //年龄范围查询 | |
| 279 | + if (StringUtils.isNotEmpty(request.getAge())){ | |
| 280 | + String[] ages = request.getAge().split(" - "); | |
| 281 | + query.setAgeMin(Integer.parseInt(ages[0])); | |
| 282 | + if (ages.length>=2){ | |
| 283 | + Integer ageMax = Integer.parseInt(ages[1]); | |
| 284 | + query.setAgeMax(ageMax); | |
| 285 | + } | |
| 286 | + } | |
| 287 | + //户籍地 | |
| 288 | + query.setProvinceRegisterId(request.getProvinceRegisterId()); | |
| 289 | + query.setCityRegisterId(request.getCityRegisterId()); | |
| 290 | + query.setAreaRegisterId(request.getAreaRegisterId()); | |
| 291 | + //居住地 | |
| 292 | + query.setProvinceId(request.getProvinceId()); | |
| 293 | + query.setCityId(request.getCityId()); | |
| 294 | + query.setAreaId(request.getAreaId()); | |
| 295 | + | |
| 296 | + List<Organization> organizationList = null; | |
| 297 | + | |
| 298 | + //建档机构 | |
| 299 | + List<String> hospitalList = null; | |
| 300 | + if (userId!=null){ | |
| 301 | + hospitalList = new ArrayList<>(); | |
| 302 | + String hospital = autoMatchFacade.getHospitalId(userId); | |
| 303 | + if(null!=hospital){ | |
| 304 | + //当前用户本院 | |
| 305 | + hospitalList.add(hospital); | |
| 306 | + } | |
| 307 | + //查询用户是否有区域权限 | |
| 308 | + DataPermissionsModelQuery dataPermissionsModelQuery = new DataPermissionsModelQuery(); | |
| 309 | + dataPermissionsModelQuery.setUserId(userId); | |
| 310 | + List<DataPermissionsModel> permissionsModels = dataPermissionService.queryPermission(dataPermissionsModelQuery); | |
| 311 | + if (CollectionUtils.isNotEmpty(permissionsModels)) { | |
| 312 | + Set<String> set = permissionsModels.get(0).getData().keySet(); | |
| 313 | + Iterator<String> it = set.iterator(); | |
| 314 | + while (it.hasNext()) { | |
| 315 | + String id = it.next(); | |
| 316 | + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(id) && !hospitalList.contains(id)) { | |
| 317 | + hospitalList.add(id); | |
| 318 | + } | |
| 319 | + } | |
| 320 | + } | |
| 321 | + //指定医院 | |
| 322 | + if (StringUtils.isNotEmpty(request.getHospitalId())){ | |
| 323 | + List<String> orgId = new ArrayList<>(); | |
| 324 | + orgId.add(request.getHospitalId()); | |
| 325 | + hospitalList.retainAll(orgId); | |
| 326 | + } | |
| 327 | + //省市区筛选机构 | |
| 328 | + if (StringUtils.isNotEmpty(request.getBuildProvinceId()) || StringUtils.isNotEmpty(request.getBuildCityId()) || | |
| 329 | + StringUtils.isNotEmpty(request.getBuildAreaId())){ | |
| 330 | + OrganizationQuery organizationQuery = new OrganizationQuery(); | |
| 331 | + organizationQuery.setYn(YnEnums.YES.getId()); | |
| 332 | + organizationQuery.setProvinceId(request.getBuildProvinceId()); | |
| 333 | + organizationQuery.setCityId(request.getBuildCityId()); | |
| 334 | + organizationQuery.setAreaId(request.getBuildAreaId()); | |
| 335 | + organizationList = new ArrayList<>(); | |
| 336 | + organizationList = organizationService.queryHospitals(organizationQuery); | |
| 337 | + } | |
| 338 | + if (organizationList!=null){ | |
| 339 | + List<String> orgId = new ArrayList<>(); | |
| 340 | + if (CollectionUtils.isNotEmpty(organizationList)) { | |
| 341 | + for (Organization org : organizationList) { | |
| 342 | + if (null != org.getId()) { | |
| 343 | + orgId.add(org.getId() + ""); | |
| 344 | + } | |
| 345 | + } | |
| 346 | + } | |
| 347 | + hospitalList.retainAll(orgId); | |
| 348 | + } | |
| 349 | + query.setHospitalIds(hospitalList); | |
| 350 | + } | |
| 351 | + | |
| 352 | + List<Map<String,Object>> list = new ArrayList<>(); | |
| 353 | + | |
| 354 | + List<ResidentsArchiveModel> archiveModelList = residentsArchiveService.queryResident(query); | |
| 355 | + if (CollectionUtils.isNotEmpty(archiveModelList)){ | |
| 356 | + for (ResidentsArchiveModel data : archiveModelList){ | |
| 357 | + Map<String,Object> map = new HashMap<>(); | |
| 358 | + map.put("username",data.getUsername()); | |
| 359 | + map.put("sex","女"); | |
| 360 | + map.put("birthday", FunvCommonUtil.getBirthday(DateUtil.getyyyy_MM_dd(data.getBirthday()))); | |
| 361 | + map.put("countryId",FunvCommonUtil.getBaseicConfigByid(data.getCountryId(),basicConfigService)); | |
| 362 | + map.put("nationId",FunvCommonUtil.getBaseicConfigByid(data.getNationId(),basicConfigService)); | |
| 363 | + map.put("marriageId",FunvCommonUtil.getBaseicConfigByid(data.getMarriageId(),basicConfigService)); | |
| 364 | + map.put("certificateTypeId",FunvCommonUtil.getBaseicConfigByid(data.getCertificateTypeId(),basicConfigService)); | |
| 365 | + map.put("certificateNum",data.getCertificateNum()); | |
| 366 | + map.put("censusTypeId",FunvCommonUtil.getBaseicConfigByid(data.getCensusTypeId(),basicConfigService)); | |
| 367 | + map.put("liveTypeId",FunvCommonUtil.getBaseicConfigByid(data.getLiveTypeId(),basicConfigService)); | |
| 368 | + map.put("levelTypeId",FunvCommonUtil.getBaseicConfigByid(data.getLevelTypeId(),basicConfigService)); | |
| 369 | + map.put("professionTypeId", FunvCommonUtil.getBaseicConfigByid(data.getProfessionTypeId(),basicConfigService)); | |
| 370 | + if (StringUtils.isNotEmpty(data.getHospitalId())){ | |
| 371 | + Organization organization = organizationService.getOrganization(Integer.valueOf(data.getHospitalId())); | |
| 372 | + if (organization != null && organization.getYn()==YnEnums.YES.getId()){ | |
| 373 | + map.put("hospital", organization.getName()); | |
| 374 | + } | |
| 375 | + } | |
| 376 | + map.put("age",data.getAge()); | |
| 377 | + map.put("phone",data.getPhone()); | |
| 378 | + map.put("workUnit",data.getWorkUnit()); | |
| 379 | + map.put("residence",CommonsHelper.getResidence(data.getProvinceId(), data.getCityId(), | |
| 380 | + data.getAreaId(), data.getStreetId(), data.getAddress(), basicConfigService)); | |
| 381 | + map.put("residenceRegister",CommonsHelper.getResidence(data.getProvinceRegisterId(), data.getCityRegisterId(), | |
| 382 | + data.getAreaRegisterId(), data.getStreetRegisterId(), | |
| 383 | + data.getAddressRegister(), basicConfigService)); | |
| 384 | + | |
| 385 | + //病史 | |
| 386 | + | |
| 387 | + map.put("vcCardNo", data.getVcCardNo()); | |
| 388 | + map.put("buildDoctor", data.getBuildDoctor()); | |
| 389 | + map.put("buildDay", DateUtil.getyyyy_MM_dd(data.getBuildDay())); | |
| 390 | + //孕次 | |
| 391 | + map.put("mod",referMod(data.getHospitalId(),data.getCertificateNum())); | |
| 392 | + list.add(map); | |
| 393 | + } | |
| 394 | + } | |
| 395 | + out = response.getOutputStream(); | |
| 396 | + Map<String, String> cnames = new LinkedHashMap<>(); | |
| 397 | + cnames.put("username","姓名"); | |
| 398 | + cnames.put("sex","性别"); | |
| 399 | + cnames.put("birthday","出生日期"); | |
| 400 | + cnames.put("countryId","国籍"); | |
| 401 | + cnames.put("nationId","民族"); | |
| 402 | + cnames.put("marriageId","婚姻状况"); | |
| 403 | + cnames.put("certificateTypeId","证件类型"); | |
| 404 | + cnames.put("certificateNum","证件号"); | |
| 405 | + cnames.put("censusTypeId","户籍类型"); | |
| 406 | + cnames.put("liveTypeId","居住类别"); | |
| 407 | + cnames.put("levelTypeId","文化程度"); | |
| 408 | + cnames.put("professionTypeId","职业类别"); | |
| 409 | + cnames.put("hospital","建档医院"); | |
| 410 | + cnames.put("age","年龄"); | |
| 411 | + cnames.put("phone","联系方式"); | |
| 412 | + cnames.put("workUnit","工作单位"); | |
| 413 | + cnames.put("residence","居住地"); | |
| 414 | + cnames.put("residenceRegister","户籍地址"); | |
| 415 | + /*cnames.put("pastHistory","既往史"); | |
| 416 | + cnames.put("familyHistory","家族史"); | |
| 417 | + cnames.put("personalHistory","个人史"); | |
| 418 | + cnames.put("ywgmHistory","药物过敏史"); | |
| 419 | + cnames.put("presentHistory","现病史");*/ | |
| 420 | + cnames.put("vcCardNo","就诊卡号"); | |
| 421 | + cnames.put("buildDoctor","建档人"); | |
| 422 | + cnames.put("buildDay","建档日期"); | |
| 423 | + cnames.put("mod","记录孕次"); | |
| 424 | + response.setContentType("application/octet-stream"); | |
| 425 | + response.setHeader("Content-Disposition", "attachment;fileName=" + "qyfy.xls"); | |
| 426 | + ExcelUtil.toExcel(out, list, cnames); | |
| 427 | + }catch (Exception e){ | |
| 428 | + e.printStackTrace(); | |
| 429 | + } | |
| 430 | + | |
| 431 | + } | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 245 | 442 | |
| 246 | 443 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/FunvCommonUtil.java
View file @
a5ddd04
| 1 | 1 | package com.lyms.platform.operate.web.utils; |
| 2 | 2 | |
| 3 | +import com.lyms.platform.biz.service.BasicConfigService; | |
| 4 | +import com.lyms.platform.common.enums.YnEnums; | |
| 5 | +import com.lyms.platform.pojo.BasicConfig; | |
| 3 | 6 | import org.apache.commons.lang.StringUtils; |
| 4 | 7 | |
| 5 | 8 | import java.util.HashMap; |
| ... | ... | @@ -19,7 +22,11 @@ |
| 19 | 22 | public static String YES = "是"; |
| 20 | 23 | public static String NO = "否"; |
| 21 | 24 | |
| 22 | - //返回中间四位数为*号的手机号 | |
| 25 | + /** | |
| 26 | + * 返回中间四位数为*号的手机号 | |
| 27 | + * @param phone | |
| 28 | + * @return | |
| 29 | + */ | |
| 23 | 30 | public static String getXingPhone(String phone){ |
| 24 | 31 | if (StringUtils.isNotEmpty(phone)){ |
| 25 | 32 | String a = phone.substring(0,3)+"****"+phone.substring(7,11); |
| 26 | 33 | |
| ... | ... | @@ -78,8 +85,39 @@ |
| 78 | 85 | return ""; |
| 79 | 86 | } |
| 80 | 87 | |
| 81 | -/* private static final Map<String, String> content = new HashMap<>(); | |
| 88 | + /** | |
| 89 | + * 获取生日(****年**月**日) | |
| 90 | + * @param b | |
| 91 | + * @return | |
| 92 | + */ | |
| 93 | + public static String getBirthday(String b){ | |
| 94 | + if (b!=null){ | |
| 95 | + String year = b.substring(0,4); | |
| 96 | + String mouth = b.substring(5,7); | |
| 97 | + String day = b.substring(8,10); | |
| 98 | + return year + "年" + mouth + "月" + day + "日"; | |
| 99 | + } | |
| 100 | + return null; | |
| 101 | + } | |
| 82 | 102 | |
| 103 | + /** | |
| 104 | + * 获取基础基础名称 | |
| 105 | + * @param id 基础类型ID | |
| 106 | + * @param basicConfigService | |
| 107 | + * @return | |
| 108 | + */ | |
| 109 | + public static String getBaseicConfigByid(String id,BasicConfigService basicConfigService) { | |
| 110 | + if (StringUtils.isNotEmpty(id)){ | |
| 111 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(id); | |
| 112 | + if (basicConfig!=null && basicConfig.getYn()!= YnEnums.NO.getId()){ | |
| 113 | + return basicConfig.getName(); | |
| 114 | + } | |
| 115 | + } | |
| 116 | + return ""; | |
| 117 | + } | |
| 118 | + | |
| 119 | + private static final Map<String, String> content = new HashMap<>(); | |
| 120 | + | |
| 83 | 121 | static { |
| 84 | 122 | content.put("ycxjbs", "遗传性疾病史"); |
| 85 | 123 | content.put("jsjbs", "精神疾病史"); |
| 86 | 124 | |
| 87 | 125 | |
| ... | ... | @@ -104,9 +142,17 @@ |
| 104 | 142 | content.put("qmsgm", "青霉素过敏"); |
| 105 | 143 | content.put("xfmsgm", "先锋霉素过敏"); |
| 106 | 144 | content.put("halywgm", "磺胺类药物过敏"); |
| 107 | - }*/ | |
| 145 | + } | |
| 108 | 146 | |
| 147 | + public static String findName(Map map){ | |
| 148 | + StringBuilder sb = new StringBuilder(); | |
| 109 | 149 | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + return ""; | |
| 155 | + } | |
| 110 | 156 | |
| 111 | 157 | |
| 112 | 158 | } |