liusheng
2 天以前 8a8a94d9a6de7d1d1a5720ce1f36d7b5bc6d7702
代码提交
已修改7个文件
2956 ■■■■ 文件已修改
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceDonatebaseinfoController.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceDonationwitnessController.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/resources/template/人体器官潜在捐献者登记表.ftl 2720 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/mapper/ServiceDonatebaseinfoMapper.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/service/IServiceDonatebaseinfoService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceDonatebaseinfoServiceImpl.java 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/resources/mapper/project/ServiceDonatebaseinfoMapper.xml 136 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceDonatebaseinfoController.java
@@ -60,9 +60,6 @@
    private IServiceExternalpersonService serviceExternalpersonService;
    @Autowired
    private ServerConfig serverConfig;
    @Autowired
    private SysDeptMapper sysDeptMapper;
@@ -82,8 +79,19 @@
    public TableDataInfo list(ServiceDonatebaseinfo serviceDonatebaseinfo) {
        log.info("潜在捐献信息列表:{}", serviceDonatebaseinfo);
        startPage();
        //List<ServiceDonatebaseinfo> list = serviceDonatebaseinfoService.queryList(serviceDonatebaseinfo);
        List<ServiceDonatebaseinfo> list = serviceDonatebaseinfoService.selectServiceDonatebaseinfoList(serviceDonatebaseinfo);
        return getDataTable(list);
    }
    /**
     * æŸ¥è¯¢æ½œåœ¨æçŒ®æ‚£è€…信息列表不与base_organization关联
     */
    @ApiOperation("潜在捐献患者信息列表")
    //// @PreAuthorize("@ss.hasPermi('project:donatebaseinfo:list')")
    @GetMapping("/getpatname")
    public TableDataInfo getPatName(ServiceDonatebaseinfo serviceDonatebaseinfo) {
        log.info("潜在捐献患者信息列表:{}", serviceDonatebaseinfo);
        List<ServiceDonatebaseinfo> list = serviceDonatebaseinfoService.getPatName(serviceDonatebaseinfo);
        return getDataTable(list);
    }
@@ -165,19 +173,6 @@
        log.info("新增潜在捐献信息:{}", serviceDonatebaseinfo);
        SysUser user = SecurityUtils.getLoginUser().getUser();
//        String bh = "";
//        bh = serviceDonatebaseinfoService.getDonateNumber(serviceDonatebaseinfo);
//        if (bh == "") {
//            return AjaxResult.error("新增时生成的编号为空,创建失败!");
//        } else {
//            ServiceDonatebaseinfo serviceDonatebaseinfo1 = new ServiceDonatebaseinfo();
//            serviceDonatebaseinfo1.setDonorno(bh);
//            List<ServiceDonatebaseinfo> listrecord = serviceDonatebaseinfoService.queryList(serviceDonatebaseinfo1);
//            if (listrecord.size() > 0) {
//                return AjaxResult.error("新增时生成的编号" + bh + "已存在,无法保存!");
//            }
//
//        }
        String idcardno = serviceDonatebaseinfo.getIdcardno();
        ServiceDonatebaseinfo serviceDonatebaseinfo2 = new ServiceDonatebaseinfo();
        serviceDonatebaseinfo2.setIdcardno(idcardno);
@@ -886,6 +881,11 @@
            dataMap.put("YJXZGX", "其他");
        }
        //信息来源
        if (serviceDonatebaseinfo.getInfosources().contains("红十字会")) {
            dataMap.put("HSZH2", (char) 8730);  // å‹¾é€‰ç¬¦å·
        } else {
            dataMap.put("HSZH2", "□");  // æ–¹æ¡†ç¬¦å·
        }
        if (serviceDonatebaseinfo.getInfosources().contains("医疗机构")) {
            dataMap.put("YLJG", (char) 8730);
            if (serviceDonatebaseinfo.getInfosources().contains("家属")) {
@@ -973,6 +973,20 @@
        dataMap.put("BGR", serviceDonatebaseinfo.getReportername() == null ? "" : serviceDonatebaseinfo.getReportername());
        dataMap.put("BGRDH", serviceDonatebaseinfo.getReporterphone() == null ? "" : serviceDonatebaseinfo.getReporterphone());
        //获取报告时间
        String bgrq = null;
        if (serviceDonatebaseinfo.getReporttime() != null) {
            Date reportTime = serviceDonatebaseinfo.getReporttime();
            LocalDate localDate = reportTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
            int year = localDate.getYear();
            int month = localDate.getMonthValue(); // ç›´æŽ¥èŽ·å–æœˆä»½å€¼ï¼ˆ1-12)
            int day = localDate.getDayOfMonth();
            bgrq = year + "å¹´" + month + "月" + day + "日";
        }
        dataMap.put("BGRQ", bgrq);
    }
    @ApiOperation("获取状态获取计数")
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceDonationwitnessController.java
@@ -130,17 +130,13 @@
    @PostMapping("/add")
    @RepeatSubmit
    public AjaxResult add(@RequestBody ServiceDonationwitness serviceDonationwitness) {
        log.info("新增捐献见证id为:{},infoId为:{}", serviceDonationwitness.getId(), serviceDonationwitness.getInfoid());
        ServiceDonationwitness sd=new ServiceDonationwitness();
        sd.setInfoid(serviceDonationwitness.getInfoid());
        sd.setDel_flag(0);
        List<ServiceDonationwitness> serviceDonationwitnesses = serviceDonationwitnessService.selectServiceDonationwitnessList(sd);
        boolean save = serviceDonationwitnessService.save(serviceDonationwitness);
        log.info("新增捐献见证是否成功:{},id为:{},infoId为:{}", save, serviceDonationwitness.getId(), serviceDonationwitness.getInfoid());
//        if (save) {
//            //生成“捐献者编号”
//            ServiceDonatebaseinfo serviceDonatebaseinfo = serviceDonatebaseinfoService.getById(serviceDonationwitness.getInfoid());
//            log.info("serviceDonatebaseinfo的信息为{}", serviceDonatebaseinfo);
//            String donorno = serviceDonatebaseinfoService.getDonateNumber(serviceDonatebaseinfo);
//            log.info("生成的捐献者编号为:{}", donorno);
//            serviceDonatebaseinfo.setDonorno(donorno);
//            serviceDonatebaseinfoService.updateById(serviceDonatebaseinfo);
//        }
        return AjaxResult.success(serviceDonationwitness);
    }
ruoyi-admin/src/main/resources/template/ÈËÌåÆ÷¹ÙDZÔÚ¾èÏ×ÕߵǼDZí.ftl
ÎļþÌ«´ó
ruoyi-project/src/main/java/com/ruoyi/project/mapper/ServiceDonatebaseinfoMapper.java
@@ -26,6 +26,7 @@
     * @return æçŒ®åŸºç¡€é›†åˆ
     */
    public List<ServiceDonatebaseinfo> selectServiceDonatebaseinfoList(ServiceDonatebaseinfo serviceDonatebaseinfo);
    public List<ServiceDonatebaseinfo> getPatName(ServiceDonatebaseinfo serviceDonatebaseinfo);
    String getDonateNumberById(Long id);
ruoyi-project/src/main/java/com/ruoyi/project/service/IServiceDonatebaseinfoService.java
@@ -36,6 +36,8 @@
    String updateS1S2S3S4(Long id);
    List<ServiceDonatebaseinfo> selectServiceDonatebaseinfoList(ServiceDonatebaseinfo serviceDonatebaseinfo);
    List<ServiceDonatebaseinfo> getPatName(ServiceDonatebaseinfo serviceDonatebaseinfo);
    List<ServiceDonatebaseinfo> listForSearch(ServiceDonatebaseinfo serviceDonatebaseinfo);
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceDonatebaseinfoServiceImpl.java
@@ -237,14 +237,6 @@
        }
        List<ServiceDonatebaseinfo> serviceDonatebaseinfos = serviceDonatebaseinfoMapper.selectServiceDonatebaseinfoList(serviceDonatebaseinfo);
        for (ServiceDonatebaseinfo serviceDonatebaseinfo1 : serviceDonatebaseinfos) {
            //这里不能再通过当前时间算年龄了,患者可能已经死亡了
//            if (serviceDonatebaseinfo1.getBirthday() != null) {
//                Map<String, String> map = CalculateDateUtils.calculateAge(serviceDonatebaseinfo1.getBirthday().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(), LocalDate.now());
//                serviceDonatebaseinfo1.setAge(org.apache.commons.lang3.ObjectUtils.isNotEmpty(map.get("age")) ? Long.valueOf(map.get("age")) : null);
//                serviceDonatebaseinfo1.setAgeunit(map.get("ageUnit"));
//                serviceDonatebaseinfo1.setAge2(org.apache.commons.lang3.ObjectUtils.isNotEmpty(map.get("age2")) ? Long.valueOf(map.get("age2")) : null);
//                serviceDonatebaseinfo1.setAgeunit2(map.get("ageUnit2"));
//            }
            //先给个年龄默认值(因为age是数字类型,不能放横杠,所以就所横扛放到单位上)
            serviceDonatebaseinfo1.setAgeunit("-");
            serviceDonatebaseinfo1.setAge(null);
@@ -275,6 +267,33 @@
    }
    @Override
    public List<ServiceDonatebaseinfo> getPatName(ServiceDonatebaseinfo serviceDonatebaseinfo) {
        SysUser user = SecurityUtils.getLoginUser().getUser();
        List<SysRole> l = user.getRoles();
        int b = 0;
        for (SysRole r : l) {
            if (r.getRoleId().longValue() == 3) {
                b = 1;
            }
            if (r.getRoleId().longValue() == 13) {
                b = 2;
            }
        }
        if (b == 1) {
            log.info("user.getUserName()的值为 ---- ï¼š{}", user.getUserName());
            serviceDonatebaseinfo.setReporterno(user.getUserName());
        }
        if (b == 2) {
            serviceDonatebaseinfo.setDeptid(user.getDeptId());
        }
        List<ServiceDonatebaseinfo> serviceDonatebaseinfos = serviceDonatebaseinfoMapper.getPatName(serviceDonatebaseinfo);
        return serviceDonatebaseinfos;
    }
    @Override
    public List<ServiceDonatebaseinfo> listForSearch(ServiceDonatebaseinfo serviceDonatebaseinfo) {
        SysUser user = SecurityUtils.getLoginUser().getUser();
        List<SysRole> l = user.getRoles();
ruoyi-project/src/main/resources/mapper/project/ServiceDonatebaseinfoMapper.xml
@@ -93,6 +93,14 @@
                 LEFT JOIN `base_organization`
                           ON `base_organization`.`OrganizationID` = `service_donatebaseinfo`.`TreatmentHospitalNo`
    </sql>
    <sql id="queryServiceDonatebaseinfoVo">
        select *
        from service_donatebaseinfo
    </sql>
    <update id="updateDonateNumber">
        update service_donatebaseinfo
        set DonorNo = #{updateNumber}
@@ -227,6 +235,134 @@
        order by ReportTime desc
    </select>
    <select id="getPatName" parameterType="com.ruoyi.project.domain.ServiceDonatebaseinfo"
            resultMap="ServiceDonatebaseinfoResult">
        <include refid="queryServiceDonatebaseinfoVo"/>
        <where>
            service_donatebaseinfo.del_flag = 0
            <if test="name != null  and name != ''">and Name like concat('%', #{name}, '%')</if>
            <if test="sex != null ">and Sex = #{sex}</if>
            <if test="idcardtype != null ">and IDCardType = #{idcardtype}</if>
            <if test="idcardno != null  and idcardno != ''">and IDCardNo = #{idcardno}</if>
            <if test="age != null ">and Age = #{age}</if>
            <if test="ageunit != null  and ageunit != ''">and AgeUnit = #{ageunit}</if>
            <if test="birthday != null  and birthday != ''">and Birthday = #{birthday}</if>
            <if test="phone != null  and phone != ''">and Phone = #{phone}</if>
            <if test="residenceaddress != null  and residenceaddress != ''">and ResidenceAddress = #{residenceaddress}
            </if>
            <if test="residenceprovince != null  and residenceprovince != ''">and ResidenceProvince =
                #{residenceprovince}
            </if>
            <if test="terminationCase != null">and termination_case =
                #{terminationCase}
            </if>
            <if test="residenceprovincename != null  and residenceprovincename != ''">and ResidenceProvinceName like
                concat('%', #{residenceprovincename}, '%')
            </if>
            <if test="residencecity != null  and residencecity != ''">and ResidenceCity = #{residencecity}</if>
            <if test="residencecityname != null  and residencecityname != ''">and ResidenceCityName like concat('%',
                #{residencecityname}, '%')
            </if>
            <if test="residencetown != null  and residencetown != ''">and ResidenceTown = #{residencetown}</if>
            <if test="residencetownname != null  and residencetownname != ''">and ResidenceTownName like concat('%',
                #{residencetownname}, '%')
            </if>
            <if test="residencecommunity != null  and residencecommunity != ''">and ResidenceCommunity =
                #{residencecommunity}
            </if>
            <if test="residencecommunityname != null  and residencecommunityname != ''">and ResidenceCommunityName like
                concat('%', #{residencecommunityname}, '%')
            </if>
            <if test="residencecountycode != null  and residencecountycode != ''">and ResidenceCountyCode =
                #{residencecountycode}
            </if>
            <if test="residencecountyname != null  and residencecountyname != ''">and ResidenceCountyName like
                concat('%', #{residencecountyname}, '%')
            </if>
            <if test="registeraddress != null  and registeraddress != ''">and RegisterAddress = #{registeraddress}</if>
            <if test="registerprovince != null  and registerprovince != ''">and RegisterProvince = #{registerprovince}
            </if>
            <if test="registerprovincename != null  and registerprovincename != ''">and RegisterProvinceName like
                concat('%', #{registerprovincename}, '%')
            </if>
            <if test="registercity != null  and registercity != ''">and RegisterCity = #{registercity}</if>
            <if test="registercityname != null  and registercityname != ''">and RegisterCityName like concat('%',
                #{registercityname}, '%')
            </if>
            <if test="registertown != null  and registertown != ''">and RegisterTown = #{registertown}</if>
            <if test="registertownname != null  and registertownname != ''">and RegisterTownName like concat('%',
                #{registertownname}, '%')
            </if>
            <if test="registercommunity != null  and registercommunity != ''">and RegisterCommunity =
                #{registercommunity}
            </if>
            <if test="registercommunityname != null  and registercommunityname != ''">and RegisterCommunityName like
                concat('%', #{registercommunityname}, '%')
            </if>
            <if test="registercountycode != null  and registercountycode != ''">and RegisterCountyCode =
                #{registercountycode}
            </if>
            <if test="registercountyname != null  and registercountyname != ''">and RegisterCountyName like concat('%',
                #{registercountyname}, '%')
            </if>
            <if test="recordstate != null and recordstate != ''">and RecordState = #{recordstate}</if>
            <if test="treatmenthospitalno != null  and treatmenthospitalno != ''">and TreatmentHospitalNo =
                #{treatmenthospitalno}
            </if>
            <if test="treatmenthospitalname != null  and treatmenthospitalname != ''">and TreatmentHospitalName like
                concat('%', #{treatmenthospitalname}, '%')
            </if>
            <!--            <if test="treatmentdeptno != null  and treatmentdeptno != ''"> and TreatmentDeptNo = #{treatmentdeptno}</if>-->
            <if test="treatmentdeptname != null  and treatmentdeptname != ''">and TreatmentDeptName like concat('%',
                #{treatmentdeptname}, '%')
            </if>
            <if test="diagnosisno != null  and diagnosisno != ''">and DiagnosisNo = #{diagnosisno}</if>
            <if test="diagnosisname != null  and diagnosisname != ''">and DiagnosisName like concat('%',
                #{diagnosisname}, '%')
            </if>
            <if test="bloodtype != null  and bloodtype != ''">and BloodType = #{bloodtype}</if>
            <if test="inpatientno != null  and inpatientno != ''">and InpatientNo = #{inpatientno}</if>
            <if test="donorno != null  and donorno != ''">and DonorNo like concat('%', #{donorno}, '%')</if>
            <if test="donationcategory != null  and donationcategory != ''">and DonationCategory = #{donationcategory}
            </if>
            <if test="illnessoverview != null  and illnessoverview != ''">and IllnessOverview = #{illnessoverview}</if>
            <if test="kinship != null  and kinship != ''">and Kinship = #{kinship}</if>
            <if test="selfwill != null ">and SelfWill = #{selfwill}</if>
            <if test="kinshipwill != null ">and KinshipWill = #{kinshipwill}</if>
            <if test="infosources != null  and infosources != ''">and InfoSources = #{infosources}</if>
            <if test="redorganno != null  and redorganno != ''">and RedOrganNo = #{redorganno}</if>
            <if test="redorganname != null  and redorganname != ''">and RedOrganName like concat('%', #{redorganname},
                '%')
            </if>
            <if test="contactperson != null  and contactperson != ''">and ContactPerson = #{contactperson}</if>
            <if test="contactnumber != null  and contactnumber != ''">and ContactNumber = #{contactnumber}</if>
            <if test="contacttime != null  and contacttime != ''">and ContactTime = #{contacttime}</if>
            <if test="reporterno != null  and reporterno != ''">and ReporterNo = #{reporterno}</if>
            <if test="reportername != null  and reportername != ''">and ReporterName like concat('%', #{reportername},
                '%')
            </if>
            <if test="reporterphone != null  and reporterphone != ''">and ReporterPhone = #{reporterphone}</if>
            <if test="reporttime != null ">and ReportTime = #{reporttime}</if>
            <if test="infoname != null ">and infoName = #{infoname}</if>
            <if test="infophone != null ">and infoPhone = #{infophone}</if>
            <if test="createBy != null ">and `service_donatebaseinfo`.create_by = #{createBy}</if>
            <if test="starttime != null ">and donatetime >= #{starttime}</if>
            <if test="endtime != null ">and donatetime &lt;= #{endtime}</if>
            <if test="nativeplace != null  and nativeplace != ''">and NativePlace = #{nativeplace}</if>
            <if test="city != null and city != ''">and `base_organization`.`City` = #{city}</if>
            <if test="deptid != null ">and deptid = #{deptid}</if>
            <if test="deptname != null ">and deptname = #{deptname}</if>
            <if test="leaderno != null ">and leaderno = #{leaderno}</if>
            <if test="leadername != null ">and leadername = #{leadername}</if>
            <if test="businessarea != null ">and businessarea = #{businessarea}</if>
            <if test="donatetime != null ">and donatetime = #{donatetime}</if>
            <if test="donateno != null ">and donateno = #{donateno}</if>
            <if test="workflow != null ">and workflow = #{workflow}</if>
        </where>
        order by ReportTime desc
    </select>
    <select id="getDonateNumberById" resultType="java.lang.String">
        select DonorNo