Bladeren bron

[bug-2353]培训通知定时任务改成接口调用

szjbdgzl 1 jaar geleden
bovenliggende
commit
98a763bc7b

+ 6 - 5
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/business/service/impl/AuditServiceImpl.java

@@ -36,7 +36,8 @@ public class AuditServiceImpl implements AuditService {
 
         String sql = "select p.id_,p.bian_zhi_ren_,e.name_,p.bian_zhi_bu_men_,d.name_ as dept_name_,p.pei_xun_nei_rong_,p.shi_fou_guo_shen_," +
                 "date_format(p.pei_xun_shi_jian_,'%%Y-%%m-%%d') pei_xun_shi_jian_,date_format(p.pei_xun_jie_shu_s,'%%Y-%%m-%%d')  " +
-                " pei_xun_jie_shu_s,p.pei_xun_ren_yuan_,p.pei_xun_di_dian_,p.pei_xun_lao_shi_,p.di_dian_ from t_rypxcjb p " +
+                " pei_xun_jie_shu_s,p.pei_xun_ren_yuan_,p.pei_xun_di_dian_,p.pei_xun_lao_shi_,p.di_dian_," +
+                "IF(pei_xun_shi_jian_<=DATE_FORMAT(date_add(now(), interval 1 week),'%%Y-%%m-%%d'),'1','0') as type_ from t_rypxcjb p " +
                 "left join ibps_party_employee e on e.id_=p.bian_zhi_ren_ " +
                 "left join ibps_party_position d on d.id_=p.bian_zhi_bu_men_ " +
                 "where p.id_ in(%s)";
@@ -53,6 +54,10 @@ public class AuditServiceImpl implements AuditService {
                 String starDate = train.get("pei_xun_shi_jian_").toString();
                 String peiXunNeiRong = train.get("pei_xun_nei_rong_").toString();
 
+                if (train.get("shi_fou_guo_shen_").equals("未发布") && train.get("type_").equals("1")){
+                    commonDao.execute("update t_rypxcjb set shi_fou_guo_shen_='未开始' where id_= '"+id+"'");
+                }
+
                 // 信息不全,发消息提醒  否则发公告
                 if (BeanUtils.isEmpty(train.get("pei_xun_jie_shu_s")) || BeanUtils.isEmpty(train.get("pei_xun_ren_yuan_"))
                         || BeanUtils.isEmpty(train.get("pei_xun_lao_shi_")) || BeanUtils.isEmpty(train.get("pei_xun_di_dian_"))){
@@ -102,10 +107,6 @@ public class AuditServiceImpl implements AuditService {
                     newsPo.setUserName(userName);
                     newsPo.setType(didian);
                     newsMgrService.save(newsPo);
-
-                    if (train.get("shi_fou_guo_shen_").equals("未发布")){
-                        commonDao.execute("update t_rypxcjb set shi_fou_guo_shen_='未开始' where id_= '"+id+"'");
-                    }
                 }
             }
         }