|
@@ -0,0 +1,57 @@
|
|
|
|
+package com.zskk.task;
|
|
|
|
+
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
|
+import java.util.Date;
|
|
|
|
+import java.util.List;
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.jfinal.kit.PropKit;
|
|
|
|
+import com.jfinal.plugin.activerecord.Db;
|
|
|
|
+import com.jfinal.plugin.activerecord.Record;
|
|
|
|
+import com.jfinal.plugin.cron4j.ITask;
|
|
|
|
+import com.zskk.service.DataService;
|
|
|
|
+import com.zskk.service.ServiceFactory;
|
|
|
|
+import com.zskk.service.ThreadPoolService;
|
|
|
|
+
|
|
|
|
+public class TJPayTask implements ITask {
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ // TODO Auto-generated method stub
|
|
|
|
+ DataService dService = ServiceFactory.getService(DataService.class);
|
|
|
|
+ List<Record> records = Db.use("connected").find("select * from(select * from zlhis.paylist_1 where ISFEE=1 and STUDYUID is not null order by PAYTIME desc)where rownum<50");
|
|
|
|
+ for (Record record : records) {
|
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
|
+ jsonObject.put("institution_id", PropKit.get("institution_id"));
|
|
|
|
+ jsonObject.put("patient_num", record.getStr("STUDYUID"));
|
|
|
|
+ jsonObject.put("ins_type", "2");
|
|
|
|
+ JSONObject pJsonObject = new JSONObject();
|
|
|
|
+ pJsonObject.put("params", jsonObject.toJSONString());
|
|
|
|
+ ThreadPoolService tService = ServiceFactory.getService(ThreadPoolService.class);
|
|
|
|
+ tService.execute(() -> {
|
|
|
|
+ dService.fee(pJsonObject);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void stop() {
|
|
|
|
+ // TODO Auto-generated method stub
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 日期字符串格式转换
|
|
|
|
+ * @param dateStr
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ private String parseStringToDate() {
|
|
|
|
+
|
|
|
|
+ Date date = new Date();
|
|
|
|
+ String timeString = null;
|
|
|
|
+ SimpleDateFormat sdf2= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
+ timeString = sdf2.format(date);
|
|
|
|
+ return timeString;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+}
|