Bladeren bron

[task-2879]每日安全检查和含氯有效性监测监测时间调整

szjbdgzl 1 jaar geleden
bovenliggende
commit
2cd1b70bbb

+ 8 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/sysdata/services/impl/UpdateDataTableImpl.java

@@ -10,6 +10,7 @@ import com.lc.ibps.base.core.util.BeanUtils;
 import com.lc.ibps.base.core.util.I18nUtil;
 import com.lc.ibps.base.framework.id.UniqueIdUtil;
 import com.lc.ibps.base.framework.table.ICommonDao;
+import com.lc.ibps.base.web.context.ContextUtil;
 import com.lc.ibps.bpmn.api.service.BpmProcInstService;
 import com.lc.ibps.bpmn.provider.BpmInstProvider;
 import com.lc.ibps.cloud.entity.APIPageList;
@@ -32,6 +33,7 @@ import org.springframework.util.DigestUtils;
 import org.springframework.web.bind.annotation.RequestBody;
 
 import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
 import java.util.*;
 
 import static com.lc.ibps.api.base.constants.StateEnum.ERROR;
@@ -147,6 +149,9 @@ public class UpdateDataTableImpl extends GenericProvider implements UpdateDataTa
     //修改方法
     @Override
     public Integer updateDatasContextTable(String tableName, List<Map<String,String>> paramWhere, Map<String, String> paramCond) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        paramCond.put("update_by_", ContextUtil.getCurrentUserId());
+        paramCond.put("update_time_",sdf.format(new Date()));
         return  updateDataTableDao.updateDatasTable(tableName,paramCond,paramWhere);
     }
 
@@ -155,12 +160,15 @@ public class UpdateDataTableImpl extends GenericProvider implements UpdateDataTa
     public Integer updateBatchContextTable(String tableName, List<Map<String, String>> list) {
        Integer integer = 1;
             if (list!=null&&list.size()>0){
+                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                 for (int i = 0; i < list.size(); i++) {
 
                     JSONObject setObj = JSONObject.parseObject(String.valueOf(list.get(i).get("param")));
                     JSONObject whereObj = JSONObject.parseObject(String.valueOf(list.get(i).get("where")));
 
                     if (setObj != null && whereObj != null){
+                        setObj.put("update_by_", ContextUtil.getCurrentUserId());
+                        setObj.put("update_time_",sdf.format(new Date()));
                         StringBuilder wsf = new StringBuilder(" ");
                         StringBuilder psf = new StringBuilder(" ");
                         // set  sql 拼接