财务报表

This commit is contained in:
amarsoft 2018-09-29 14:45:35 +08:00
parent 08d3e4b67e
commit a47423bfd5
4 changed files with 268 additions and 1 deletions

View File

@ -0,0 +1,81 @@
<%-- <%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/IncludeBegin.jsp"%>
<table><tr heigth="100px">
<td><span>是否借入资金:</span></td><td><select id="col1" name="col1">
<option value ="">------请选择------</option>
<option value ="money01">部分借入</option>
<option value ="money02">全部借入</option>
<option value="money03">自有资金</option>
</select></td>
<td><span>借款银行:</span></td><td><input id="col2" name="col2" value=""/></td>
<td><span>借款合同号:</span></td><td><input id="col3" name="col3" value=""/></td>
</tr>
<tr heigth="100px">
<td><span>借款本金:</span></td><td><input id="col4" name="col4" value=""/></td>
<td><span>借款利率:</span></td><td><input id="col5" name="col5" value=""/></td>
<td></td><td><input type="button" value="保存" onclick="javascrtpt:save()"/>
<input type="button" value="关闭" onclick="javascrtpt:close()"/></td>
</tr>
</table>
</div>
</body>
<script type="text/javascript">
function save(){
var v1=document.getElementById("col1").value;
var v2=document.getElementById("col2").value;
var v3=document.getElementById("col3").value;
var v4=document.getElementById("col4").value;
var v5=document.getElementById("col5").value;
if(v1.){
}
parent.AsDialog.ClosePage(v1+"@"+v2+"@"+v3+"@"+v4+"@"+v5);
}
function close(){
window.close();
}
</script>
<%@ include file="/IncludeEnd.jsp"%> --%>
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_info.jspf"%><%
/*
Author: undefined 2018-05-29
Content: 示例详情页面
History Log:
*/
String sTempletNo = "sourceOfFundsInfoMultiUpdate";//--模板号--
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
/* doTemp.setColTips("", "测试"); */
ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request);
dwTemp.Style = "2";//freeform
//dwTemp.ReadOnly = "-2";//只读模式
dwTemp.genHTMLObjectWindow("");
String sButtons[][] = {
{"true","All","Button","保存","保存所有修改","save()","","","",""},
{"true","All","Button","返回","返回列表","returnList()","","","",""}
};
sButtonPosition = "south";
%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%>
<script type="text/javascript">
function save(){
var ifLoanMoney=getItemValue(0, 0, "if_loan_money");
var loanBank=getItemValue(0, 0, "loan_bank");
var loanContractNo=getItemValue(0, 0, "loan_contract_no");
var loanPrincipal=getItemValue(0, 0, "loan_principal");
var loanRate=getItemValue(0, 0, "loan_rate");
if(ifLoanMoney.length==0&&loanBank.length==0&&loanContractNo.length==0
&&loanPrincipal.length==0&&loanRate.length==0){
AsDebug.showMessage("提示:", "请输入修改信息或返回!");
return;
}else{
parent.AsDialog.ClosePage(ifLoanMoney+"@"+loanBank+"@"+loanContractNo+"@"+loanPrincipal+"@"+loanRate);
}}
function returnList(){
parent.AsDialog.ClosePage();
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>

View File

@ -5,21 +5,58 @@
Content:
History Log:
*/
String userid=CurUser.getUserID();
String department=CurUser.getOrgID();
ASObjectModel doTemp = new ASObjectModel("sourceOfFunds");
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
dwTemp.Style="1"; //--设置为Grid风格--
dwTemp.ReadOnly = "1"; //只读模式
dwTemp.setPageSize(10);
dwTemp.genHTMLObjectWindow("");
dwTemp.MultiSelect = true;
doTemp.setLockCount(2);
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标CSS层叠样式 10、风格
String sButtons[][] = {
{"true","All","Button","新增","新增","newRecord()","","","","btn_icon_add",""},
{"true","","Button","详情","详情","viewAndEdit()","","","","btn_icon_detail",""},
{"true","","Button","删除","删除","if(confirm('确实要删除吗?'))as_delete(0)","","","","btn_icon_delete",""},
{"true","","Button","数据导入","数据导入","importExcel()","","","","btn_icon_import",""},
{"true","","Button","批量修改","批量修改","MultiUpdate()","","","","btn_icon_detail",""},
};
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<script type="text/javascript">
function MultiUpdate(){
var id = getItemValueArray(0,'id');
if(id.length == 0){
AsDebug.showMessage("提示:", "请先选择要修改的数据!");
}else {
id = JSON.stringify(id).replace(/,/g,"@");
AsDialog.PopView("/Tenwa/Core/OfficeTemplate/TemplateManager/BFTemplateTest/uppdateMessage.jsp","",
{width:"850px",height:"170px",title:"批量修改"},function(sparam){
if(sparam.length>0){
updateMessage(sparam,id);
}
reloadSelf();});
}
}
function updateMessage(sparam,ids){
var res=RunJavaMethodTrans("com.tenwa.lease.app.message.UpdateMessageHandler","MultiUpdate","sparam="+sparam+",ids="+ids);
}
function importExcel(){
var importCondition={};//导入配置
importCondition["templateNo"]="7148746b2023454c80f86d16d8ae8c75";//导入的模板编号必填
//增加其他配置参数
importCondition["inputuserid"]="<%=userid%>";;
importCondition["inputorgid"]="<%=department%>";
var sparam=JSON.stringify(importCondition).replace(/,/g,"@");//生成模板的参数据
AsDialog.PopView("/Tenwa/Core/OfficeTemplate/TemplateManager/BFTemplateTest/uploadExcel.jsp","importparam="+sparam,
{width:"500px",height:"40px",title:"上传Excel"},function(){
reloadSelf();});
}
function newRecord(){
var sUrl = "/money/sourceOfFundsInfo.jsp";
AsControl.OpenView(sUrl,'','_self','');

View File

@ -0,0 +1,88 @@
package com.tenwa.officetempalte.importcallback.impl;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
import jbo.com.tenwa.entity.comm.own.LC_SOURCE_OF_FUNDS;
import jbo.sys.CODE_LIBRARY;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.BizObjectManager;
import com.amarsoft.are.jbo.BizObjectQuery;
import com.amarsoft.are.jbo.JBOFactory;
import com.amarsoft.are.jbo.JBOTransaction;
import com.amarsoft.awe.util.Transaction;
import com.amarsoft.context.ASUser;
import com.tenwa.comm.exception.BusinessException;
/**
*
* Author: guoshanglei 2017年5月11日
* Tester:
* Describe:
* History Log:
*/
public class LCsourceOfFundCallBack extends BaseImportExcelCallBack{
//读取数据运行run方法
@Override
public void run(ASUser CurUser, BizObject importObject,
Map<String, String> model, Integer rowIndex, JBOTransaction tx,
Transaction Sqlca) throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd hh:mm:ss");
String FlowUnid = model.get("FlowUnid");//流程编号
String templateNo=model.get("templateNo");//模版编号
String INPUTUSERID = CurUser.getUserID();//获取登记人
String INPUTORGID = CurUser.getOrgID();//获取登记部门
String INPUTTIME = sdf.format(new Date()).toString();//格式化登记时间
String contract_num=importObject.getAttribute("contract_no").toString();
BizObjectManager bom = JBOFactory.getBizObjectManager(LC_SOURCE_OF_FUNDS.CLASS_NAME);
List<BizObject> bolist=bom.createQuery("CONTRACT_NO=:contractno").setParameter("contractno", contract_num).getResultList(false);
if(bolist.size()>0){
throw new BusinessException("合同号为"+contract_num+"的合同信息已存在!");
}
String ifLoanMoneyCode="money03";
String ifLoanMoney=importObject.getAttribute("if_loan_money").toString();
if(ifLoanMoney==null||"".equals(ifLoanMoney)){
}else if(ifLoanMoney.indexOf("部分借入")>=0){
ifLoanMoneyCode="money01";
}else if(ifLoanMoney.indexOf("全部借入")>=0){
ifLoanMoneyCode="money02";
} else {
}
importObject.setAttributeValue("IF_LOAN_MONEY", ifLoanMoneyCode);//设置制造商ID
importObject.setAttributeValue("LOAN_PRINCIPAL", importObject.getAttribute("loan_principal").toString());//设置流程编号
importObject.setAttributeValue("LOAN_RATE", importObject.getAttribute("loan_rate").toString());//设置交易价格
importObject.setAttributeValue("LEASE_ACC_NAME", importObject.getAttribute("lease_acc_name").toString());//初始化登记人
importObject.setAttributeValue("CONTRACT_NO", contract_num);//初始化登记部门
importObject.setAttributeValue("LOAN_BANK", importObject.getAttribute("loan_bank").toString());//初始化登记时间
importObject.setAttributeValue("LOAN_CONTRACT_NO", importObject.getAttribute("loan_contract_no").toString());//初始化登记时间
importObject.setAttributeValue("BUSINESSTYPE", importObject.getAttribute("businesstype").toString());//初始化登记时间
importObject.setAttributeValue("INPUTUSERID",INPUTUSERID );//初始化登记时间
importObject.setAttributeValue("INPUTORGID",INPUTORGID );//初始化登记时间
importObject.setAttributeValue("INPUTTIME", INPUTTIME);//初始化登记时间
}
//数据保存进数据库前runBefor运行
@Override
public void runBefore(ASUser CurUser, Map<String, String> model,List<BizObject> importObjects,
JBOTransaction tx, Transaction Sqlca) throws Exception {
}
//数据保存进数据库后runAfter运行
@Override
public void runAfter(ASUser CurUser, Map<String, String> model,List<BizObject> importObjects,
JBOTransaction tx, Transaction Sqlca) throws Exception {
}
}

View File

@ -0,0 +1,61 @@
package com.tenwa.lease.app.message;
import com.amarsoft.are.jbo.JBOTransaction;
import com.amarsoft.awe.util.SqlObject;
import com.amarsoft.awe.util.Transaction;
public class UpdateMessageHandler {
private String sparam;
private String ids;
public String getIds() {
return ids;
}
public void setIds(String ids) {
this.ids = ids;
}
public String getSparam() {
return sparam;
}
public void setSparam(String sparam) {
this.sparam = sparam;
}
public String MultiUpdate(JBOTransaction tx) throws Exception{
String[] paramArray=sparam.split("@");
String[] keyArray={"if_loan_money","loan_bank","loan_contract_no","loan_principal","loan_rate"};
this.setIds(ids.substring(1, ids.length()-1).replaceAll("\"", ""));
String[] idArray=ids.split("@");
StringBuffer sql=new StringBuffer("update lc_source_of_funds set ");
StringBuffer setSQLStr=new StringBuffer ("");
String setSQL="";
StringBuffer idbuffer=new StringBuffer ("");
for(int i=0;i<paramArray.length;i++){
if(paramArray[i]!=null&&!"".equals(paramArray[i])) {
setSQLStr.append(keyArray[i]+"='"+paramArray[i]+"'"+" @");
}
}
for(int i=0;i<idArray.length;i++){
idbuffer.append("'"+idArray[i]+"'");
if(i!=idArray.length-1)idbuffer.append(",");
}
String idstr=" where id in ("+idbuffer+")";
setSQL=setSQLStr.substring(0, setSQLStr.length()-1).replaceAll("@", ",");
sql.append(setSQL);
sql.append(idstr);
try{
Transaction Sqlca =null;
Sqlca = Transaction.createTransaction(tx);
SqlObject asql = new SqlObject(sql.toString());
Sqlca.executeSQL(asql);
return "true";
}catch(Exception e){
e.printStackTrace();
return "false";
}
}
}