添加定时业务撤销入项目进度日志表

This commit is contained in:
jianghongdong 2018-08-09 10:30:04 +08:00
parent b34ab27d37
commit bfc5e49a3d
2 changed files with 49 additions and 8 deletions

View File

@ -1,13 +1,8 @@
package com.tenwa.comm.message.controller;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import jbo.com.tenwa.entity.comm.message.BT_BUSSINESS_MESSAGE_CONFIG;
import jbo.com.tenwa.lease.comm.LB_BUSINESS_OVERDATE;
import jbo.com.tenwa.lease.comm.LB_CANCLE_INFO;
import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO;
@ -23,6 +18,8 @@ import com.amarsoft.are.jbo.JBOTransaction;
import com.amarsoft.are.util.StringFunction;
import com.base.util.QuartzUtil;
import com.tenwa.comm.util.jboutil.DataOperatorUtil;
import com.tenwa.comm.util.jboutil.SaveBusinessStatus;
import com.tenwa.lease.app.quartzmession.JobInitUserName;
/**
* 对业务审批结束后超过指定时间未合同制作的业务合同进行
* 业务撤销操作
@ -30,7 +27,7 @@ import com.tenwa.comm.util.jboutil.DataOperatorUtil;
*
*/
public class BusinessCancelJob implements Job {
private JobInitUserName jboName;
private String overDate;
@Override
public void execute(JobExecutionContext arg0) throws JobExecutionException {
@ -38,7 +35,9 @@ public class BusinessCancelJob implements Job {
String startime = StringFunction.getTodayNow();
try {
tx= JBOFactory.createJBOTransaction();
this.executeMessage(tx);
this.executeMessage(tx,arg0);
//入项目进度日志
tx.commit();
QuartzUtil.insertLog(startime,"com.tenwa.comm.message.controller.BusinessCancelJob", "success", "成功");
} catch (Exception e) {
@ -81,7 +80,7 @@ public class BusinessCancelJob implements Job {
}
return null;
}
public void executeMessage( JBOTransaction tx ) throws Exception{
public void executeMessage( JBOTransaction tx ,JobExecutionContext arg0) throws Exception{
List<Map<String,String>> ds=this.loadMessageNo(tx);
BizObjectManager lpibom = JBOFactory.getBizObjectManager(LB_PROJECT_INFO.CLASS_NAME, tx);
BizObjectManager lcibom = JBOFactory.getBizObjectManager(LB_CANCLE_INFO.CLASS_NAME, tx);
@ -99,6 +98,7 @@ public class BusinessCancelJob implements Job {
lcibo.setAttributeValue(LB_CANCLE_INFO.PROJECT_ID,map.get("ID"));
// lcibo.setAttributeValue(LB_CANCLE_INFO.CANCLE_TYPE,"");
lcibom.saveObject(lcibo);
SaveBusinessStatus.saveByProjectId(map.get("ID"), tx, "62", jboName.getUserId(arg0, tx));
}
}
}

View File

@ -0,0 +1,41 @@
package com.tenwa.comm.util.jboutil;
import jbo.com.tenwa.lease.carbrand.BUSINESS_STATUS;
import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.BizObjectManager;
import com.amarsoft.are.jbo.JBOException;
import com.amarsoft.are.jbo.JBOFactory;
import com.amarsoft.are.jbo.JBOTransaction;
import com.amarsoft.are.util.StringFunction;
import com.amarsoft.context.ASUser;
/**
* 入项目进度日志
* 方法类
* @author jianghd
*
*/
public class SaveBusinessStatus {
/**
* @param projectId
* @param tx
* @param statusCode 状态码
* @param userid
* @throws JBOException
*/
public static void saveByProjectId(String projectId ,JBOTransaction tx ,String statusCode,String userid) throws JBOException{
BizObject lpibo = JBOFactory.getBizObjectManager(LB_PROJECT_INFO.CLASS_NAME).createQuery("ID=:ID").setParameter("ID", projectId).getSingleResult(false);
String cn = lpibo.getAttribute(LB_PROJECT_INFO.PROJECT_NO).getString();
ASUser user = new ASUser(userid);
BizObjectManager bsbom = JBOFactory.getBizObjectManager(BUSINESS_STATUS.CLASS_NAME, tx);
BizObject bsbo = bsbom.newObject();
bsbo.setAttributeValue(BUSINESS_STATUS.contract_number, cn);
bsbo.setAttributeValue(BUSINESS_STATUS.business_status, statusCode);
bsbo.setAttributeValue(BUSINESS_STATUS.inputuserid, userid);
bsbo.setAttributeValue(BUSINESS_STATUS.inputorgid, user.getOrgID());
bsbo.setAttributeValue(BUSINESS_STATUS.inputtime, StringFunction.getTodayNow());
bsbom.saveObject(bsbo);
}
}