修改BUG
This commit is contained in:
parent
693a63246a
commit
4ebeb449c3
@ -220,7 +220,7 @@
|
||||
contractIds = contractIds.substring(1);
|
||||
var result = RunJavaMethodTrans("com.tenwa.flow.fund.fundcollection.FundIncomeMethod","delTemp","contractIds="+contractIds+",flowunid=<%=flowunid%>,userId=<%=CurUser.getUserID()%>,orgId=<%=CurUser.getOrgID()%>,status=cancel");
|
||||
if("SUCCESS" == result){
|
||||
as_delete(0);
|
||||
as_delete(0,'updateTemp()');
|
||||
AsDebug.showMessage("提示","操作成功!","","",true);
|
||||
reloadSelf();
|
||||
}else{
|
||||
@ -229,7 +229,15 @@
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function updateTemp(){
|
||||
var rows = getCheckedRows(0);
|
||||
var contractIds = "";
|
||||
for(var i in rows){
|
||||
contractIds += "@"+getItemValue(0,i,"ID");
|
||||
}
|
||||
contractIds = contractIds.substring(1);
|
||||
RunJavaMethodTrans("com.tenwa.flow.fund.fundcollection.FundIncomeMethod","updateTemp","contractIds="+contractIds+",flowunid=<%=flowunid%>,userId=<%=CurUser.getUserID()%>,orgId=<%=CurUser.getOrgID()%>,status=cancel");
|
||||
}
|
||||
function setColRequired(){
|
||||
if("<%=rightType%>" != "ReadOnly"){
|
||||
for(var i=0;i<DZ[0][2].length;i++){
|
||||
|
||||
@ -237,11 +237,11 @@ public class CreateTransactionExecutor implements Transaction {
|
||||
sql +=" from lc_rent_plan cfrp" ;
|
||||
sql +=" where cfrp.payment_number='" + paymentNumber + "'" ;
|
||||
sql +=" union all " ;
|
||||
sql +=" select fundplan.project_id,fundplan.project_plan_number,fundplan.contract_id,fundplan.contract_plan_number,fundplan.payment_number,fundplan.plan_date,case when fundplan.pay_type='pay_type_in'then fundplan.plan_money else 0 end flowin, ";
|
||||
sql +=" case when fundplan.pay_type='pay_type_in'then concat(tdd.itemname,':',fundplan.plan_money) else ''end, " ;
|
||||
sql +=" case when fundplan.pay_type='pay_type_out'then fundplan.plan_money else 0 end flowout, " ;
|
||||
sql +=" case when fundplan.pay_type='pay_type_out' then concat(tdd.itemname,':',fundplan.plan_money) else ''end flowoutdetail, " ;
|
||||
sql +=" case when fundplan.pay_type='pay_type_in' then fundplan.plan_money else -fundplan.plan_money end cleanfow " ;
|
||||
sql +=" select fundplan.project_id,fundplan.project_plan_number,fundplan.contract_id,fundplan.contract_plan_number,fundplan.payment_number,fundplan.plan_date,if(fundplan.pay_type='pay_type_in',fundplan.plan_money,0)flowin, ";
|
||||
sql +=" if(fundplan.pay_type='pay_type_in',concat(tdd.itemname,':',format(fundplan.plan_money,2)),''), " ;
|
||||
sql +=" if(fundplan.pay_type='pay_type_out',fundplan.plan_money,0)flowout, " ;
|
||||
sql +=" if(fundplan.pay_type='pay_type_out',concat(tdd.itemname,':',format(fundplan.plan_money,2)),'')flowoutdetail, " ;
|
||||
sql +=" if(fundplan.pay_type='pay_type_in',fundplan.plan_money,-fundplan.plan_money) cleanfow " ;
|
||||
sql +=" from lc_fund_plan fundplan " ;
|
||||
sql +=" left join code_library tdd on fundplan.fee_type = tdd.itemno " ;
|
||||
sql +=" where fundplan.payment_number='" + paymentNumber + "'";
|
||||
|
||||
@ -189,6 +189,38 @@ public class FundIncomeMethod {
|
||||
}
|
||||
return "SUCCESS";
|
||||
}
|
||||
public String updateTemp(JBOTransaction tx) throws JBOException {
|
||||
try {
|
||||
Transaction sqlTran = Transaction.createTransaction(tx);
|
||||
ASResultSet rs = sqlTran.getResultSet(new SqlObject("select count(1) contract_count,IFNULL(sum(fact_money),0) total_money from lc_fund_income_temp where flowunid='"+flowunid+"' and pay_status='apply_pass' group by flowunid"));
|
||||
if(rs.next()){
|
||||
BigDecimal totalMoney = new BigDecimal(rs.getString("total_money"));
|
||||
int contractCount = Integer.parseInt(rs.getString("contract_count"));
|
||||
SqlObject so = new SqlObject("update lb_actual_payment_info_temp set contract_count='"+contractCount+"',total_money='"+totalMoney+"',updateuserid='"+userId+"',updateorgid='"+orgId+"',updatetime='"+StringFunction.getTodayNow().replaceAll(":", "@")+"' where flowunid='"+flowunid+"'");
|
||||
so.setDebugSql(so.getDebugSql().replaceAll("@", ":"));
|
||||
so.setOriginalSql(so.getOriginalSql().replaceAll("@", ":"));
|
||||
so.setRunSql(so.getRunSql().replaceAll("@", ":"));
|
||||
sqlTran.executeSQL(so);
|
||||
so = new SqlObject("update flow_bussiness_object set proj_name=CONCAT(substr(proj_name,1,instr(proj_name,'实际付款')-1),'实际付款,金额为:"+totalMoney+"') where flow_unid='"+flowunid+"'");
|
||||
sqlTran.executeSQL(so);
|
||||
}else{
|
||||
BigDecimal totalMoney = new BigDecimal("0");
|
||||
int contractCount = 0;
|
||||
SqlObject so = new SqlObject("update lb_actual_payment_info_temp set contract_count='"+contractCount+"',total_money='"+totalMoney+"',updateuserid='"+userId+"',updateorgid='"+orgId+"',updatetime='"+StringFunction.getTodayNow().replaceAll(":", "@")+"' where flowunid='"+flowunid+"'");
|
||||
so.setDebugSql(so.getDebugSql().replaceAll("@", ":"));
|
||||
so.setOriginalSql(so.getOriginalSql().replaceAll("@", ":"));
|
||||
so.setRunSql(so.getRunSql().replaceAll("@", ":"));
|
||||
sqlTran.executeSQL(so);
|
||||
so = new SqlObject("update flow_bussiness_object set proj_name=CONCAT(substr(proj_name,1,instr(proj_name,'实际付款')-1),'实际付款,金额为:"+totalMoney+"') where flow_unid='"+flowunid+"'");
|
||||
sqlTran.executeSQL(so);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
tx.rollback();
|
||||
return "ERROR";
|
||||
}
|
||||
return "SUCCESS";
|
||||
}
|
||||
public String setFundDataToFundIncome(JBOTransaction tx) throws JBOException{
|
||||
try{
|
||||
boolean flag = false;
|
||||
@ -367,4 +399,29 @@ public class FundIncomeMethod {
|
||||
}
|
||||
return "SUCCESS";
|
||||
}
|
||||
public String updateFundIncomeStatus(JBOTransaction tx) throws JBOException{//target
|
||||
try{
|
||||
for(String contractId : contractIds.split("@")){
|
||||
JBOFactory.getBizObjectManager(LC_FUND_INCOME_TEMP.CLASS_NAME,tx).createQuery("update O set "+("cancel".equals(status)?"pay_status='apply_return'":"pay_status=null")+" where flowunid='"+flowunid+"' and contract_id='"+contractId+"'").executeUpdate();
|
||||
}
|
||||
Transaction sqlTran = Transaction.createTransaction(tx);
|
||||
ASResultSet rs = sqlTran.getResultSet(new SqlObject("select count(1) contract_count,IFNULL(sum(fact_money),0) total_money from lc_fund_income_temp where flowunid='"+flowunid+"' and pay_status<>'apply_return' group by flowunid"));
|
||||
if(rs.next()){
|
||||
BigDecimal totalMoney = new BigDecimal(rs.getString("total_money"));
|
||||
int contractCount = Integer.parseInt(rs.getString("contract_count"));
|
||||
SqlObject so = new SqlObject("update lb_actual_payment_info_temp set contract_count='"+contractCount+"',total_money='"+totalMoney+"',updateuserid='"+userId+"',updateorgid='"+orgId+"',updatetime='"+StringFunction.getTodayNow().replaceAll(":", "@")+"' where flowunid='"+flowunid+"'");
|
||||
so.setDebugSql(so.getDebugSql().replaceAll("@", ":"));
|
||||
so.setOriginalSql(so.getOriginalSql().replaceAll("@", ":"));
|
||||
so.setRunSql(so.getRunSql().replaceAll("@", ":"));
|
||||
sqlTran.executeSQL(so);
|
||||
so = new SqlObject("update flow_bussiness_object set proj_name=CONCAT(substr(proj_name,1,instr(proj_name,'实际付款')-1),'实际付款,金额为:"+totalMoney+"') where flow_unid='"+flowunid+"'");
|
||||
sqlTran.executeSQL(so);
|
||||
}
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
tx.rollback();
|
||||
return "ERROR";
|
||||
}
|
||||
return "SUCCESS";
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,6 +39,9 @@ public class LBCustomerAccountTempToFormalBusiness extends BaseBussiness{
|
||||
fromCondtion.clear();
|
||||
fromCondtion.put("flowunid",this.getAttribute("FlowUnid").toString());
|
||||
fromCondtion.put("Partner_", "Y");
|
||||
toCondtion.clear();
|
||||
toCondtion.put("PROJECT_ID",this.getAttribute("ProjectId").toString());
|
||||
toCondtion.put("Partner_", "Y");
|
||||
DataOperatorUtil.copyJBOSet(CUSTOMER_FAMILY_TEMP.CLASS_NAME, fromCondtion,CUSTOMER_FAMILY.CLASS_NAME, toCondtion, otherProperty,null, Sqlca);
|
||||
/* String contract_id="";
|
||||
Map<String,String> fromCondtion = new HashMap<String, String>();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user