Procházet zdrojové kódy

添加新代码。

xiaochan před 4 roky
rodič
revize
aba7cc4bf7

+ 5 - 1
src/main/java/thyyxxk/webserver/controller/querydata/CovidVaccinateAppointmentController.java

@@ -98,6 +98,10 @@ public class CovidVaccinateAppointmentController {
         return server.yiJianXiuGaiRiQi(list);
     }
 
-
+    @GetMapping("/kaiQiHuoGuanBiYuYue")
+    public ResultVo<Boolean> kaiQiHuoGuanBiYuYue(@RequestParam("code") Integer code,
+                                                 @RequestParam("enableFlag") Integer enableFlag) {
+        return server.kaiQiHuoGuanBiYuYue(code, enableFlag);
+    }
 }
 

+ 6 - 1
src/main/java/thyyxxk/webserver/dao/his/querydata/CovidVaccinateAppointmentDao.java

@@ -100,7 +100,8 @@ public interface CovidVaccinateAppointmentDao {
      * @param id 对应的疫苗
      * @return 对应的数据
      */
-    @Select("select * from t_covid_vaccinate_factory where vaccinate_id=#{id}")
+    @Select("select *,(b.date) date,(b.value) value,(b.id) id  from t_covid_vaccinate_factory a left join t_covid_vaccinate_threshold_new b on " +
+            "(a.code = b.code and date = convert(char(10),getdate(),120))  where vaccinate_id=#{id}")
     List<CovidVaccinateFactory> chaKanChangJia(@Param("id") Integer id);
 
     /**
@@ -193,4 +194,8 @@ public interface CovidVaccinateAppointmentDao {
                                                     @Param("startTime") String startTime,
                                                     @Param("endTime") String endTime);
 
+    @Update("update t_covid_vaccinate_factory set enable_flag=#{enableFlag} where code = #{code}")
+    void kaiQiHuoGuanBiYuYue(@Param("code") Integer code,
+                             @Param("enableFlag") Integer enableFlag);
+
 }

+ 63 - 51
src/main/java/thyyxxk/webserver/entity/querydata/CovidVaccinateFactory.java

@@ -1,8 +1,10 @@
 package thyyxxk.webserver.entity.querydata;
 
-import java.io.Serializable;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 
+import java.io.Serializable;
 import java.math.BigDecimal;
 import java.util.Date;
 
@@ -12,55 +14,65 @@ import java.util.Date;
 @Data
 public class CovidVaccinateFactory implements Serializable {
 
-	private static final long serialVersionUID =  5933243722775161066L;
-
-	/**
-	 * code
-	 */
-	private Integer code;
-	/**
-	 * 原来的code
-	 */
-	private Integer oldCode;
-
-	/**
-	 * vaccinateId
-	 */
-	private Integer vaccinateId;
-
-	/**
-	 * 疫苗名称
-	 */
-	private String vaccinateName;
-
-	/**
-	 * specification
-	 */
-	private String specification;
-
-	/**
-	 * price
-	 */
-	private BigDecimal price;
-
-	/**
-	 * name
-	 */
-	private String name;
-
-	/**
-	 * enableFlag
-	 */
-	private Integer enableFlag;
-
-	/**
-	 * createDatetime
-	 */
-	private Date createDatetime;
-
-	/**
-	 * 设置每日默认插入的阈值
-	 */
-	private Integer defaultQuantity;
+    private static final long serialVersionUID = 5933243722775161066L;
+
+    /**
+     * code
+     */
+    private Integer code;
+    /**
+     * 原来的code
+     */
+    private Integer oldCode;
+
+    /**
+     * vaccinateId
+     */
+    private Integer vaccinateId;
+
+    /**
+     * 疫苗名称
+     */
+    private String vaccinateName;
+
+    /**
+     * specification
+     */
+    private String specification;
+
+    /**
+     * price
+     */
+    private BigDecimal price;
+
+    /**
+     * name
+     */
+    private String name;
+
+    /**
+     * enableFlag
+     */
+    private Integer enableFlag;
+
+    /**
+     * createDatetime
+     */
+    private Date createDatetime;
+
+    /**
+     * 设置每日默认插入的阈值
+     */
+    private Integer defaultQuantity;
+
+    @TableField(exist = false)
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date date;
+
+    @TableField(exist = false)
+    private Integer value;
+
+    @TableField(exist = false)
+    private Integer id;
 
 }

+ 0 - 2
src/main/java/thyyxxk/webserver/entity/querydata/CovidVaccinateThreshold.java

@@ -2,7 +2,6 @@ package thyyxxk.webserver.entity.querydata;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
-import org.apache.ibatis.annotations.Param;
 
 import java.util.Date;
 
@@ -23,5 +22,4 @@ public class CovidVaccinateThreshold {
     private Integer value;
 
     private Integer code;
-
 }

+ 10 - 2
src/main/java/thyyxxk/webserver/service/querydata/CovidVaccinateAppointmentService.java

@@ -210,7 +210,7 @@ public class CovidVaccinateAppointmentService {
     }
 
     /**
-     * 查询全部的疫苗名称
+     * 查询对应疫苗的全部厂家
      *
      * @param id 对应的疫苗
      * @return 对应的数据
@@ -263,6 +263,14 @@ public class CovidVaccinateAppointmentService {
     public ResultVo<Boolean> yiJianXiuGaiRiQi(List<CovidVaccinateThreshold> list) {
         log.info("修改新冠疫苗厂家阈值 --> 操作人:{},数据:{}", TokenUtil.getTokenUserId(), JSON.toJSONString(list));
         dao.xiuGaiYuZhi(list);
-        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "阈值修改成功 ヽ(”`▽´)ノ");
+        return ResultVoUtil.success();
+    }
+
+    public ResultVo<Boolean> kaiQiHuoGuanBiYuYue(Integer code, Integer enableFlag) {
+        log.info("1-开启、0-关闭厂家为:{} 的预约,操作:{},操作人:{}", code, enableFlag, TokenUtil.getTokenUserId());
+        dao.kaiQiHuoGuanBiYuYue(code, enableFlag);
+        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION,
+                String.format("%s成功", enableFlag == 0 ? "关闭" : "开启"));
+
     }
 }