lighter 1 год назад
Родитель
Сommit
98992eb471

+ 3 - 7
src/main/java/thyyxxk/webserver/controller/singlepage/LotteryController.java

@@ -34,14 +34,10 @@ public class LotteryController {
 
     @PassToken
     @PostMapping("/chooseWinner")
-    public ResultVo<LotteryUser> chooseWinner(@RequestBody StartLotteryRequest request) {
-        String designated = request.getCode() + "-" + request.getRound();
-        LotteryUser user = dao.selectDesignatedLotteryUser(designated);
+    public ResultVo<LotteryUser> chooseWinner() {
+        LotteryUser user = dao.selectRandomLotteryUser();
         if (null == user) {
-            user = dao.selectRandomLotteryUser();
-            if (null == user) {
-                return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "所以人都已中奖,无法进行下一轮抽奖。");
-            }
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "所以人都已中奖,无法进行下一轮抽奖。");
         }
         return ResultVoUtil.success(user);
     }

+ 3 - 3
src/main/java/thyyxxk/webserver/dao/his/inpatient/ChargeListDao.java

@@ -25,12 +25,12 @@ public interface ChargeListDao {
             "gender=(case when sex='1' then '男' when sex='2' then '女' else '未知' end), " +
             "rtrim(admiss_dept) as dept,admiss_date as admdate,med_type as medtype, " +
             "admiss_date as begndate,isnull(dis_date,getdate()) as enddate, " +
-            "balance=(select ((select isnull(sum(t.depo_amount),0) from zy_deposit_file t where t.inpatient_no=a.inpatient_no " +
-            "and t.admiss_times=a.admiss_times and t.status in (1,2)) + " +
+            "balance=(select ((select isnull(sum(t.depo_amount),0) from zy_deposit_file t " +
+            "where t.inpatient_no=a.inpatient_no and t.admiss_times=a.admiss_times and t.status in (1,2)) + " +
             "(select sum(e.fund_pay_sumamt) from zy_ledger_file e where e.inpatient_no=#{patNo} and e.admiss_times=#{times}) - " +
             "(select isnull(sum(t.charge_fee),0) from zy_detail_charge t where t.inpatient_no=a.inpatient_no " +
             "and t.admiss_times=a.admiss_times))),a.total_charge as totalCost " +
-            "from ${table} a where a.inpatient_no=#{patNo} and a.admiss_times=#{times}")
+            "from ${table} a where a.inpatient_no=#{patNo} and a.admiss_times=#{times} ")
     BriefPatInfo selectBriefPatInfo(String patNo, int times, String table);
 
     @Select("execute zy_receive_drug #{patNo},#{times},#{patNo},'0';" +

+ 1 - 5
src/main/java/thyyxxk/webserver/dao/his/singlepage/LotteryDao.java

@@ -12,11 +12,7 @@ public interface LotteryDao {
     @Select("select * from t_lottery_user where won=-1 ")
     List<LotteryUser> selectLotteryUsers();
 
-    @Select("select * from t_lottery_user where designated=#{designated}")
-    LotteryUser selectDesignatedLotteryUser(String designated);
-
-    @Select("select top(1) * from t_lottery_user " +
-            "where won=-1 and designated is null order by newid()")
+    @Select("select top(1) * from t_lottery_user where won=-1 order by newid()")
     LotteryUser selectRandomLotteryUser();
 
     @Update("update t_lottery_user set won=#{lotteryCode},won_time=getdate() " +

+ 0 - 1
src/main/java/thyyxxk/webserver/entity/singlepage/lottery/LotteryUser.java

@@ -11,7 +11,6 @@ public class LotteryUser {
     private Integer won;
     private String wonName;
     private Date wonTime;
-    private String designated;
 
     public String getWonName() {
         switch (won) {