批量刷新绩效图关联关系
This commit is contained in:
parent
39f6c38261
commit
b9ca541124
Binary file not shown.
@ -0,0 +1,67 @@
|
||||
package com.actionsoft.apps.coe.pal.batch.job;
|
||||
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.dao.PALRepository;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.model.impl.PALRepositoryModelImpl;
|
||||
import com.actionsoft.bpms.commons.database.RowMap;
|
||||
import com.actionsoft.bpms.schedule.IJob;
|
||||
import com.actionsoft.bpms.util.DBSql;
|
||||
import com.actionsoft.sdk.local.SDK;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import jodd.util.StringUtil;
|
||||
import org.docx4j.wml.P;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
|
||||
import javax.swing.tree.RowMapper;
|
||||
import java.sql.Connection;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class batchUpdateSort implements IJob {
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
PALRepository dao = new PALRepository();
|
||||
Connection open = DBSql.open();
|
||||
List<RowMap> rowMaps=DBSql.getMaps("SELECT ID,PLNAME FROM APP_ACT_COE_PAL_REPOSITORY");
|
||||
int b = 0;
|
||||
for(int i=0;i<rowMaps.size();i++){
|
||||
String plid=rowMaps.get(i).getString("ID");
|
||||
String plname=rowMaps.get(i).getString("PLNAME")+"绩效图";
|
||||
RowMap rowMap1=DBSql.getMap(open,"SELECT ID,EXT2,PLNAME FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLNAME=? AND PLMETHODID='control.kpi'", new Object[] {plname});
|
||||
if(rowMap1!=null){
|
||||
if(StringUtil.isEmpty(rowMap1.getString("EXT2"))){
|
||||
List<String> processList = new ArrayList<>();
|
||||
processList.add(0, "control.kpi");
|
||||
processList.add(1, plid);
|
||||
try {
|
||||
String str1 = "UPDATE APP_ACT_COE_PAL_REPOSITORY SET EXT2 ='"+processList.toString()+"' WHERE ID=" +"'"+rowMap1.getString("ID")+"' AND PLMETHODID='control.kpi'";
|
||||
|
||||
|
||||
int update = DBSql.update(open, str1);
|
||||
if (update > 0) {
|
||||
SDK.getLogAPI().consoleInfo("[成功]刷新绩效图EXT2字段内容,绩效图[" + rowMap1.getString("PLNAME") + "][" + rowMap1.getString("ID") + "],改为[" + processList.toString() + "]");
|
||||
b++;
|
||||
} else {
|
||||
SDK.getLogAPI().consoleErr("[失败]刷新绩效图EXT2字段内容,绩效图[" + rowMap1.getString("PLNAME") + "][" + rowMap1.getString("ID") + "],改为[" + processList.toString() + "]");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
SDK.getLogAPI().consoleErr("[失败]刷新绩效图EXT2字段内容,绩效图[" + rowMap1.getString("PLNAME") + "][" +rowMap1.getString("ID") + "],改为[" + processList.toString() + "],错误信息:" + e.getMessage());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
SDK.getLogAPI().consoleInfo("[完成]刷新绩效图图EXT2字段内容,总共更新[" + b + "]条");
|
||||
if (b > 0) {
|
||||
PALRepositoryCache.getCache().reload();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user