Sfoglia il codice sorgente

解决新冠疫苗的bug。

xiaochan 4 anni fa
parent
commit
83e18d6cc4

+ 1 - 1
src/main/java/thyyxxk/webserver/dao/his/casefrontsheet/HuiZhenShenQingDao.java

@@ -123,7 +123,7 @@ public interface HuiZhenShenQingDao {
     void shanChuYiZhu(@Param("actOrderNo")float actOrderNo);
 
 
-    @Select("select code,name from a_employee_mi where dept_code = #{deptCode} and emp_tit_code = #{hzType}")
+    @Select("select code,name from a_employee_mi where dept_code = #{deptCode} and emp_tit_code = #{hzType} and isnull(del_flag,0)=0")
     List<GetDropdownBox> huiZhenYiSheng(@Param("deptCode") String deptCode,
                                         @Param("hzType") String hzType);
 }

+ 4 - 2
src/main/java/thyyxxk/webserver/dao/his/querydata/CovidVaccinateAppointmentMapper.java

@@ -36,8 +36,8 @@ public interface CovidVaccinateAppointmentMapper {
      * @param dataList 传入 id 和 value
      */
     @Update("<script>" +
+            "<foreach item='item' collection='dataList' >" +
             "update t_covid_vaccinate_threshold_new set " +
-            "<foreach item='item' collection='dataList' separator=','>" +
             "value = #{item.value} where id=#{item.id} " +
             "</foreach>" +
             "</script>")
@@ -135,7 +135,9 @@ public interface CovidVaccinateAppointmentMapper {
      *查看可以预约 新冠疫苗厂家的信息
      * @return 返回一个list的集合
      * */
-    @Select("select code,name from t_covid_vaccinate_factory where enable_flag =1")
+    @Select("select code,a.name ,(b.name) vaccinate_name from t_covid_vaccinate_factory a inner join " +
+            "t_zd_covid_vaccinate b on (a.vaccinate_id = b.id) " +
+            "where a.enable_flag =1 ")
     List<CovidVaccinateFactory> kaiQiYuYueChangJia();
 
     /**

+ 5 - 0
src/main/java/thyyxxk/webserver/entity/querydata/CovidVaccinateFactory.java

@@ -28,6 +28,11 @@ public class CovidVaccinateFactory implements Serializable {
 	 */
 	private Integer vaccinateId;
 
+	/**
+	 * 疫苗名称
+	 */
+	private String vaccinateName;
+
 	/**
 	 * specification
 	 */

+ 14 - 13
src/main/java/thyyxxk/webserver/service/querydata/CovidVaccinateAppointmentService.java

@@ -81,7 +81,7 @@ public class CovidVaccinateAppointmentService {
      * */
     public ResultVo<List<CovidVaccinateThreshold>> queryChangJiaDuiYingDeYuZhi(Integer code) throws ParseException {
         chaRuRiQI(code);
-        log.info("查看疫苗产品编码为:{}的",code);
+        log.info("查看疫苗产品编码为:{},开始时间:{},结束时间:{}",code,DateUtil.getOffsetDate(1),DateUtil.getOffsetDate(7));
         return ResultVoUtil.success(dao.chaKanQiTianYuZhi(code,DateUtil.getOffsetDate(1),DateUtil.getOffsetDate(7)));
     }
 
@@ -94,18 +94,19 @@ public class CovidVaccinateAppointmentService {
         Date maxDate = dao.changJiaYuZhiDoesItExist(code);
         List<Date> dateList = new ArrayList<>();
         int value = dao.chaKanChangJiaMoRenYuZhi(code);
-        Date date = null;
+        Date date;
         for(int i = 1; i<= GET_DATE_SECTION; i++){
            date = SDF.parse(DateUtil.getOffsetDate(i));
-           dateList.add(date);
+            if (maxDate == null){
+                dateList.add(date);
+                log.info("新冠疫苗插入默认设置阈值=》code:{},插入的日期为:{},阈值数:{}", code,DateUtil.formatDatetime(date,DATE_FORMAT),value);
+            }else if (maxDate.getTime()<date.getTime()){
+                dateList.add(date);
+                log.info("新冠疫苗厂家阈值插入=》code:{},添加日期为:{},阈值数:{}", code,DateUtil.formatDatetime(date,DATE_FORMAT),value);
+            }
         }
-        if (maxDate == null){
-            //厂家在创建的时候是 没有日期的 那么就需要 插入全部的数据
-            dao.chaRuMeiYouDeDate(code,dateList,value);
-            log.info("第一次插入新冠疫苗厂家阈值插入=》code:{},插入的日期为:{},阈值数量:{}", code,JSON.toJSONStringWithDateFormat(dateList,DATE_FORMAT),value);
-        }else if (maxDate.getTime()<date.getTime()){
+        if (dateList.size()>0) {
             dao.chaRuMeiYouDeDate(code,dateList,value);
-            log.info("新冠疫苗厂家阈值插入=》code:{},插入的日期为:{},阈值数量:{}", code,JSON.toJSONStringWithDateFormat(dateList,DATE_FORMAT),value);
         }
     }
 
@@ -147,11 +148,11 @@ public class CovidVaccinateAppointmentService {
     public IPage<CovidVaccinateAppointment> getQueryPage(CovidVaccinateAppointment param){
         IPage<CovidVaccinateAppointment> page = new Page<>(param.getCurrentPage(),param.getPageSize());
         QueryWrapper<CovidVaccinateAppointment> qw = new QueryWrapper<>();
-        if (param.getName() != null  && !"".equals(param.getName())){
+        if (StringUtil.notBlank(param.getName())) {
             qw.eq("a.name",param.getName());
         }
-        if (param.getExecuteDate() != null  ){
-            qw.eq("execute_date",DateUtil.formatDatetime(param.getExecuteDate(),"yyyy-MM-dd"));
+        if (param.getExecuteDate() != null) {
+            qw.eq("execute_date",param.getExecuteDate());
         }
         return dao.mybatisPlusQueryXGYM(page,qw);
     }
@@ -217,7 +218,7 @@ public class CovidVaccinateAppointmentService {
      * @param param 修改的字段为 name  enableFlag bookTip 通过id来修改
      * */
     public ResultVo<Boolean> xiuGaiYiMiao(ZdCovidVaccinate param){
-        log.info("修改疫苗=》操作人:{},数据:{}",TokenUtil.getTokenUserId(),JSON.toJSONString(param));
+        log.info("修改疫苗=》操作人:{},数据:{}",TokenUtil.getTokenUserId(),JSON.toJSONStringWithDateFormat(param,DATE_FORMAT));
         dao.xiuGaiYiMiao(param);
         return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION,"疫苗修改成功 \(☆o☆)/");
     }