diff --git a/src_core/com/tenwa/comm/message/controller/BusinessCancelJob.java b/src_core/com/tenwa/comm/message/controller/BusinessCancelJob.java index 026ef24d1..d0b62f664 100644 --- a/src_core/com/tenwa/comm/message/controller/BusinessCancelJob.java +++ b/src_core/com/tenwa/comm/message/controller/BusinessCancelJob.java @@ -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> 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)); } } } diff --git a/src_core/com/tenwa/comm/util/jboutil/SaveBusinessStatus.java b/src_core/com/tenwa/comm/util/jboutil/SaveBusinessStatus.java new file mode 100644 index 000000000..9220c6bf7 --- /dev/null +++ b/src_core/com/tenwa/comm/util/jboutil/SaveBusinessStatus.java @@ -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); + } +}