|
@@ -0,0 +1,39 @@
|
|
|
|
|
+package service;
|
|
|
|
|
+
|
|
|
|
|
+import common.ServiceController;
|
|
|
|
|
+import common.YosException;
|
|
|
|
|
+import common.data.Row;
|
|
|
|
|
+import common.data.Rows;
|
|
|
|
|
+import common.data.SQLFactory;
|
|
|
|
|
+import common.data.UpdateSQL;
|
|
|
|
|
+
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
|
+
|
|
|
|
|
+public class AutoPublishNoticeService extends ServiceController {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void serviceRun() throws YosException {
|
|
|
|
|
+
|
|
|
|
|
+ String username = "admin";
|
|
|
|
|
+ String userid = "1";
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ Rows rows = dbConnect.runSqlQuery("SELECT * from sat_notice WHERE status='新建' and publishdate<=CURRENT_TIME");
|
|
|
|
|
+
|
|
|
|
|
+ ArrayList<String> sqlList = new ArrayList<>();
|
|
|
|
|
+ for (Row row : rows) {
|
|
|
|
|
+ UpdateSQL updateSQL = SQLFactory.createUpdateSQL(dbConnect, "sat_notice");
|
|
|
|
|
+ updateSQL.setValue("status", "发布");
|
|
|
|
|
+ updateSQL.setValue("changeby", username);
|
|
|
|
|
+ updateSQL.setValue("changeuserid", userid);
|
|
|
|
|
+ updateSQL.setValue("checkby", username);
|
|
|
|
|
+ updateSQL.setValue("checkdate", getDateTime_Str());
|
|
|
|
|
+ updateSQL.setUniqueid(row.getLong("sat_noticeid"));
|
|
|
|
|
+ updateSQL.setSiteid(row.getString("siteid"));
|
|
|
|
|
+ sqlList.add(updateSQL.getSQL());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (sqlList.size() > 0) {
|
|
|
|
|
+ dbConnect.runSqlUpdate(sqlList);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+}
|