杰信项目第三天知识点(工作表模板+动态生成目录+动态生成重名文件+购销合同增删改查)

1.工作表模板使用方法:

//获取模板文件,路径为存放模板文件的路径
HSSFWorkbook wb = new HSSFWorkbook( new FileInputStream(rootpath+"/make/xlsprint/tFACTORY.xls"));

2.动态生成目录代码:
先获取服务器跟目录:

//获得服务器根目录
			String rootpath = ServletActionContext.getRequest().getRealPath("/");


再用UtilFuns类中的sysDate方法获取返回的当前日期值,再在根路径下的web下创建临时文件夹tmp,这个dir表示的就是              //D:\apache-tomcat-7.0.40\webapps\ROOT\/web/tmp/2013-12-25/

 String dir = rootpath+"/web/tmp/"+ UtilFuns.sysDate() + "/";

  static public String sysDate(){
    String s = "";
    java.util.Date date=new java.util.Date();
    SimpleDateFormat dformat=new SimpleDateFormat("yyyy-MM-dd");
    s = dformat.format(date);
    return s;
  }


//new一个路径为dir的文件对象
	File file = new File(dir);
	if(!file.exists()){			//不存在时,才创建目录
		file.mkdirs();			//创建多级目录,只要前面的目录不存在,自动创建。
	}


String xlsFile = fu.newFile(dir, "factory.xls");

//目录下已经有同名文件,则文件重命名,增加文件序号,工具类方法只返回文件名

	public String newFile(String sPath, String sFile){
		String newFileName = new String();
		String withoutExt = new String();
		File curFile = new File(sPath + "\\" + sFile);
		if (curFile.exists()) {
			for(int counter = 1; curFile.exists(); counter++){
				withoutExt = this.getNameWithoutExtension(curFile.getName());
				if(withoutExt.endsWith(counter-1 + ")")){
					withoutExt = withoutExt.substring(0,withoutExt.indexOf("("));		//idea
				}
                newFileName = withoutExt + "(" + counter + ")" + "." + getFileExt(curFile.getName());
                curFile = new File(sPath + "\\" + newFileName);
            }
		}else{
			newFileName = curFile.getName();
		}
		return newFileName;
	}



最后一步,获取到了最重要的完整路径:

FileOutputStream fOut = new FileOutputStream(new File(dir + xlsFile));
//将之前第281行创建的路径和第287行返回的文件名组成了完整的文件路径


以下是使用poi模板做导出的完整代码!

public void export() throws IOException{
			 //创建一个老师提供的工具类对象 
			FileUtil fu = new FileUtil();
			//获得服务器根目录
			String rootpath = ServletActionContext.getRequest().getRealPath("/");
			//先用UtilFuns类中的sysDate方法获取返回的当前日期值,再在根路径下的web下创建临时文件夹tmp,这个dir表示的就是D:\apache-tomcat-7.0.40\webapps\ROOT\/web/tmp/2013-12-25/
			String dir = rootpath+"/web/tmp/"+ UtilFuns.sysDate() + "/";
			//new一个路径为dir的文件对象
			File file = new File(dir);
			if(!file.exists()){			//不存在时,才创建目录
				file.mkdirs();			//创建多级目录,只要前面的目录不存在,自动创建。
			}
			String xlsFile = fu.newFile(dir, "factory.xls");		
			//目录下已经有同名文件,则文件重命名,增加文件序号,工具类方法只返回文件名
			//获取模板文件,路径为存放模板文件的路径
			HSSFWorkbook wb = new HSSFWorkbook( new FileInputStream(rootpath+"/make/xlsprint/tFACTORY.xls"));	
			//获取第一个工作表
			HSSFSheet sheet = wb.getSheetAt(0);
			HSSFRow nRow = null;							//创建行对象	值从0开始
			HSSFCell nCell = null;							//创建单元格对象	值从0开始
			int rowNo = 0;									//行号
			short colNo = 0;								//列号
			rowNo++;
			rowNo++;
			FileOutputStream fOut = new FileOutputStream(new File(dir + xlsFile));
			//将之前第281行创建的路径和第287行返回的文件名组成了完整的文件路径
			FactoryDAO oDao = (FactoryDAO) this.getDao("daoFactory");
			List<Factory> dataList = oDao.find("from Factory o where o.state=1");
			for (Factory f : dataList) {
				//每次完成一次循环就把行号下移一次
				nRow = sheet.createRow(rowNo++);
				
				nCell = nRow.createCell(colNo++);
				nCell.setCellValue(f.getFullName());
				/**
				 * 这里是将文字样式与内容绑定
				 */
				nCell.setCellStyle(this.text(wb));
				
				nCell = nRow.createCell(colNo++);
				nCell.setCellValue(f.getFactoryName());
				nCell.setCellStyle(this.text(wb));
				
				nCell = nRow.createCell(colNo++);
				nCell.setCellValue(f.getContractor());
				nCell.setCellStyle(this.text(wb));
				
				nCell = nRow.createCell(colNo++);
				nCell.setCellValue(f.getPhone());
				nCell.setCellStyle(this.text(wb));
				
				nCell = nRow.createCell(colNo++);
				nCell.setCellValue(f.getMobile());
				nCell.setCellStyle(this.text(wb));
				
				nCell = nRow.createCell(colNo++);
				nCell.setCellValue(f.getInspector());
				nCell.setCellStyle(this.text(wb));
				
				nCell = nRow.createCell(colNo++);
				nCell.setCellValue(f.getCnote());
				nCell.setCellStyle(this.text(wb));
				//每次循环结束将列号重新置0,不然会超出excel范围
				colNo=0;
				
			}
			
			wb.write(fOut);//将工作簿对象写入输出流
			fOut.flush();//刷新缓冲区
			fOut.close();//关闭输出流
		}


注意hbm.xml里面如何描述一对多以及多对一的关系:
1.购销合同表:里面有一个一对多的关系

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC 
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
   
<hibernate-mapping package="cn.itcast.entity">
	<class name="Contract" table="CONTRACT_C">
		<id name="id" type="string" column="CONTRACT_ID">
			<generator class="uuid"></generator>
		</id>
		<property name="offeror" column="OFFEROR" type="string" />
		<property name="contractNo" column="CONTRACT_NO" type="string" />
		<property name="signingDate" column="SIGNING_DATE" type="timestamp"/>
		<property name="inputBy" column="INPUT_BY" type="string" />
		<property name="checkBy" column="CHECK_BY" type="string" />
		<property name="inspector" column="INSPECTOR" type="string" />
		<property name="totalAmount" column="TOTAL_AMOUNT" type="big_decimal" />
		
		<property name="crequest" column="REQUEST" type="string" />
		<property name="customName" column="CUSTOM_NAME" type="string"/>
		<property name="shipTime" column="SHIP_TIME" type="timestamp"/>
		<property name="importNum" column="IMPORT_NUM" type="integer" />
		<property name="deliveryPeriod" column="DELIVERY_PERIOD" type="timestamp"/>
		<property name="remark" column="REMARK" type="string" />
		<property name="tradeTerms" column="TRADE_TERMS" type="string" />
		<property name="printStyle" column="PRINT_STYLE" type="string" />
		
		<property name="oldState" column="OLD_STATE" type="integer"/>
		<property name="state" column="STATE" type="integer"/>
		<property name="outState" column="OUT_STATE" type="integer"/>
				
		<property name="createBy" type="string" column="CREATE_BY"/>
		<property name="createDept" type="string" column="CREATE_DEPT"/>
		<property name="createTime" type="timestamp" column="CREATE_TIME"/>

		<!-- Associations -->
		<set name="contractProducts" inverse="true" cascade="all" lazy="false" order-by="ORDER_NO">
			<key>
				<column name="CONTRACT_ID" />
			</key>
			<one-to-many class="cn.itcast.entity.ContractProduct" />
		</set>
	</class>
</hibernate-mapping>


2.货物表,里面有两个多对一和一个一对多

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC 
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping package="cn.itcast.entity">
	<class name="ContractProduct" table="CONTRACT_PRODUCT_C">

		<id name="id" type="string" column="CONTRACT_PRODUCT_ID" length="40">
			<generator class="uuid" />
		</id>
		
		<property name="productName" column="PRODUCT_NAME" type="string" />
		<property name="productNo" column="PRODUCT_NO" type="string" />
		<property name="productImage" column="PRODUCT_IMAGE" type="string" />
		<property name="productDesc" column="PRODUCT_DESC" type="string" />
		<property name="loadingRate" column="LOADING_RATE" type="string" />
		
		<property name="packingUnit" column="PACKING_UNIT" type="string" />
		<property name="cnumber" column="CNUMBER" type="integer" />
		<property name="outNumber" column="OUT_NUMBER" type="integer" />
		<property name="finished" type="boolean" column="FINISHED"/>
		
		<property name="grossWeight" column="GROSS_WEIGHT" type="big_decimal" />
		<property name="netWeight" column="NET_WEIGHT" type="big_decimal" />
		
		<property name="sizeLength" column="SIZE_LENGTH" type="big_decimal" />
		<property name="sizeWidth" column="SIZE_WIDTH" type="big_decimal" />
		<property name="sizeHeight" column="SIZE_HEIGHT" type="big_decimal" />
		
		<property name="productRequest" column="PRODUCT_REQUEST" type="string" />
		<property name="price" column="PRICE" type="big_decimal" />
		<property name="amount" column="AMOUNT" type="big_decimal" />
		
		<property name="cunit" column="CUNIT" type="string" />
		<property name="boxNum" column="BOX_NUM" type="integer" />
		<property name="exPrice" column="EX_PRICE" type="big_decimal" />
		<property name="exUnit" column="EX_UNIT" type="string" />
		<property name="noTax" column="NO_TAX" type="big_decimal" />
		<property name="tax" column="TAX" type="big_decimal" />
		<property name="costPrice" column="COST_PRICE" type="big_decimal" />
		<property name="costTax" column="COST_TAX" type="big_decimal" />
		<property name="orderNo" column="ORDER_NO" type="integer" />
		
		<property name="accessories" type="boolean" column="ACCESSORIES"/>
		
		<!-- Associations -->
		<many-to-one name="factory" class="cn.itcast.entity.Factory" lazy="false">
			<column name="FACTORY_ID" length="40" />
		</many-to-one>
		<many-to-one name="contract" class="cn.itcast.entity.Contract" lazy="false">
			<column name="CONTRACT_ID" length="40" />
		</many-to-one>

		<set name="extCproducts" inverse="true" cascade="all" lazy="false" order-by="ORDER_NO">
			<key>
				<column name="CONTRACT_PRODUCT_ID" />
			</key>
			<one-to-many class="cn.itcast.entity.ExtCproduct" />
		</set>		

	</class>
</hibernate-mapping>


3.货物的附件表:里面有两个多对一关系

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC 
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping package="cn.itcast.entity">
	<class name="ExtCproduct" table="EXT_CPRODUCT_C">

		<id name="id" type="string" column="EXT_CPRODUCT_ID" length="40">
			<generator class="uuid" />
		</id>
		
		<property name="ctype" column="CTYPE" type="integer" />
		<property name="typeName" type="string"  formula="(select c.NAME from SYS_CODE_B c where c.ORDER_NO=CTYPE and c.PARENT_ID='0104')" insert="false" update="false"  />
		
		<property name="productName" column="PRODUCT_NAME" type="string" />
		<property name="productNo" column="PRODUCT_NO" type="string" />
		<property name="productImage" column="PRODUCT_IMAGE" type="string" />
		<property name="productDesc" column="PRODUCT_DESC" type="string" />
		<property name="loadingRate" column="LOADING_RATE" type="string" />
		
		<property name="packingUnit" column="PACKING_UNIT" type="string" />
		<property name="cnumber" column="CNUMBER" type="integer" />
		<property name="outNumber" column="OUT_NUMBER" type="integer" />
		<property name="finished" type="boolean" column="FINISHED"/>
		
		<property name="grossWeight" column="GROSS_WEIGHT" type="big_decimal" />
		<property name="netWeight" column="NET_WEIGHT" type="big_decimal" />
		
		<property name="sizeLength" column="SIZE_LENGTH" type="big_decimal" />
		<property name="sizeWidth" column="SIZE_WIDTH" type="big_decimal" />
		<property name="sizeHeight" column="SIZE_HEIGHT" type="big_decimal" />
		
		<property name="productRequest" column="PRODUCT_REQUEST" type="string" />
		<property name="price" column="PRICE" type="big_decimal" />
		<property name="amount" column="AMOUNT" type="big_decimal" />
		
		<property name="cunit" column="CUNIT" type="string" />
		<property name="boxNum" column="BOX_NUM" type="integer" />
		<property name="exPrice" column="EX_PRICE" type="big_decimal" />
		<property name="exUnit" column="EX_UNIT" type="string" />
		<property name="noTax" column="NO_TAX" type="big_decimal" />
		<property name="tax" column="TAX" type="big_decimal" />
		<property name="costPrice" column="COST_PRICE" type="big_decimal" />
		<property name="costTax" column="COST_TAX" type="big_decimal" />
		<property name="orderNo" column="ORDER_NO" type="integer" />
		
		<property name="accessories" type="boolean" column="ACCESSORIES"/>
		
		<!-- Associations -->
		<many-to-one name="factory" class="cn.itcast.entity.Factory" lazy="false">
			<column name="FACTORY_ID" length="40" />
		</many-to-one>
		<many-to-one name="contractProduct" class="cn.itcast.entity.ContractProduct" lazy="false">
			<column name="CONTRACT_PRODUCT_ID" length="40" />
		</many-to-one>

	</class>
</hibernate-mapping>


接下来是写dao层,和生产厂商的代码一样,然后是action层,别的都一样,就是新增的方法不一样

//保存 新增修改
	public String save(){
		ContractDAO oDao = (ContractDAO) this.getDao("daoContract");
		//初始化
		if(UtilFuns.isEmpty(model.getId())){
			model.setState(0);			//0草稿1已上报
		}
		
		oDao.saveOrUpdate(model);
		
		return list();			//转向列表
	}

判断的原因是,新增和修改的方法都在一个方法中了,如果判断到模型驱动里面的id是空的,那表示是新增,否则是修改。
如何获取模型驱动的id?在页面的表单属性上添加一个隐藏域即可。
注意!!!不要忘记创建strust的include文件,更不要忘记在struts中包含他,不要忘记在spring容器中添加dao层的注入!
下面是最麻烦的地方!jsp页面!!!
先改这边:

<li id="view"><a href="#" οnclick="formSubmit('/contract/contractAction_toview','_self');this.blur();">查看</a></li>
<li id="new"><a href="#" οnclick="formSubmit('/contract/contractAction_tocreate','_self');this.blur();">新建</a></li>
<li id="update"><a href="#" οnclick="formSubmit('/contract/contractAction_toupdate','_self');this.blur();">修改</a></li>
<li id="delete"><a href="#" οnclick="formSubmit('/contract/contractAction_delete','_self');this.blur();">删除</a></li>


 改表格内容:
这是改jContractList.jsp的内容

<table id="ec_table"  border="0"  cellspacing="0"  cellpadding="0"  class="tableRegion"  width="98%" >
		<thead>
		<tr>
			<td class="tableHeader"><input type="checkbox" name="selid" οnclick="checkAll('id',this)"/></td>
			<td class="tableHeader">序号</td>
			<td class="tableHeader">客户名称</td>
			<td class="tableHeader">收购方</td>
			<td class="tableHeader">合同号</td>
			<td class="tableHeader">制单人</td>
			<td class="tableHeader">审单人</td>
			<td class="tableHeader">验货员</td>
			<td class="tableHeader">交期</td>
			<td class="tableHeader">船期</td>
			<td class="tableHeader">签单日期</td>
			<td class="tableHeader">总金额</td>
			<td class="tableHeader">状态</td>
		</tr>
		</thead>
		<tbody class="tableBody" >
		
		<s:iterator value="#dataList" var="dl" status="lineNo">
		<tr class="odd"  οnmοuseοver="this.className='highlight'"  οnmοuseοut="this.className='odd'" >
			<!--这是批处理的选中框-->
			<td><input type="checkbox" name="id" value="${id}"/></td>
			<td><s:property value="#lineNo.index+1"/></td>
			<td>${customName}</td>
			<td>${offeror}</td>
			<td><a href="contractAction_toview?id=${id}">${contractNo}</a></td>
			<td>${inputBy}</td>
			<td>${checkBy}</td>
			<td>${inspector}</td>
			<!--这是将时间格式显示为如2013-12-13的格式,取消精确到时分秒-->
			<td><s:date name="deliveryPeriod" format="yyyy-MM-dd" /></td>
			<td><s:date name="shipTime" format="yyyy-MM-dd" /></td>
			<td><s:date name="signingDate" format="yyyy-MM-dd" /></td>
			<td>${totalAmount}</td>
			<td>
			<!--这是做一个判断,如果页面从数据库查询的状态是1,就是已上报,如果是0就是草稿-->
				<s:if test="state==1">已上报</s:if>
				<s:if test="state==0">草稿</s:if>
			</td>
		</tr>
		</s:iterator>
		
		</tbody>
	</table>


这是新增购销合同中的内容jContractCreate.jsp

<table class="commonTable" cellspacing="1">
	        <tr>
	            <td class="columnTitle">打印版式:</td>
	            <td class="tableContentAuto">
		<!--这是一个单选框,可以选择是想在一个页面显示两个货物还是一个货物,因为客户有需求,同一个厂家的合同上最多只能显示两个货物,最少一个-->
	            	<input type="radio" name="printStyle" value="1" class="input"/>一款
	            	<input type="radio" name="printStyle" value="2" checked="checked" class="input"/>两款
	            </td>
	        </tr> 		
	        <tr>
	            <td class="columnTitle">客户名称:</td>
	            <td class="tableContent"><input type="text" name="customName"/></td>
	            <td class="columnTitle">收购方:</td>
	            <td class="tableContent"><input type="text" name="offeror"/></td>
	        </tr>
	        <tr>
	            <td class="columnTitle">合同号:</td>
	            <td class="tableContent"><input type="text" name="contractNo"/></td>
	            <td class="columnTitle">签单日期:</td>
	            <td class="tableContent">
		<!--这里用到了一个用js写的日期插件,格式如2013-12-13,并且只读,点击出发事件-->
		<input type="text" style="width:90px;" name="signingDate" value="" readonly
		οnclick="WdatePicker({el:this,isShowOthers:true,dateFmt:'yyyy-MM-dd'});"/>
				</td>
	        </tr>
	        <tr>
	            <td class="columnTitle">制单人:</td>
	            <td class="tableContent"><input type="text" name="inputBy"/></td>
	            <td class="columnTitle">审单人:</td>
	            <td class="tableContent"><input type="text" name="checkBy"/></td>
	        </tr>	        
	        <tr>
	            <td class="columnTitle">验货员:</td>
	            <td class="tableContent"><input type="text" name="inspector"/></td>
	            <td class="columnTitle">总金额:</td>
	            <td class="tableContent"><input type="text" name="totalAmount"/></td>
	        </tr>
	        <tr>
	            <td class="columnTitle">船期:</td>
	            <td class="tableContent">
		<!--这里用到了一个用js写的日期插件,格式如2013-12-13,并且只读,点击出发事件-->
		<input type="text" style="width:90px;" name="shipTime" value="" readonly
		 οnclick="WdatePicker({el:this,isShowOthers:true,dateFmt:'yyyy-MM-dd'});"/>
				</td>	            
	            <td class="columnTitle">重要程度:</td>
	            <td class="tableContentAuto">
		<!--这里也是一个单选框,用来选择重要程度,与业务需求相关-->
	            	<input type="radio" name="importNum" value="1" class="input"/>★
	            	<input type="radio" name="importNum" value="2" class="input"/>★★
	            <input type="radio" name="importNum" value="3" checked="checked" class="input"/>★★★
	            </td>
	        </tr> 
	        <tr>
	            <td class="columnTitle">交货期限:</td>
	            <td class="tableContent">
		<!--这里用到了一个用js写的日期插件,格式如2013-12-13,并且只读,点击出发事件-->
			<input type="text" style="width:90px;" name="deliveryPeriod" value="" readonly
			        οnclick="WdatePicker({el:this,isShowOthers:true,dateFmt:'yyyy-MM-dd'});"/>
				</td>		            
	            <td class="columnTitle">贸易条款:</td>
	            <td class="tableContent"><input type="text" name="tradeTerms"/></td>
	        </tr> 
	        <tr>
	            <td class="columnTitle">要求:</td>
 <td class="tableContentAuto" colspan="3"><textarea name="crequest" style="height:100px;"></textarea></td>
	        </tr>	        
		</table>


下面是修改购销合同:jContractUpdate.jsp

<table class="commonTable" cellspacing="1">
	        <tr>
	            <td class="columnTitle">打印版式:</td>
	            <td class="tableContentAuto">
		<!--获取数据库中的值,如果为1,则value=1的变为选中状态-->
	            	<input type="radio" name="printStyle" value="1" <s:if test="printStyle==1"> checked="checked"</s:if> class="input"/>一款
	            	<input type="radio" name="printStyle" value="2" <s:if test="printStyle==2"> checked="checked"</s:if> class="input"/>两款
	            </td>
	        </tr> 		
	        <tr>
	            <td class="columnTitle">客户名称:</td>
	            <td class="tableContent"><input type="text" name="customName" value="${customName}"/></td>
	            <td class="columnTitle">收购方:</td>
	            <td class="tableContent"><input type="text" name="offeror" value="${offeror}"/></td>
	        </tr>
	        <tr>
	            <td class="columnTitle">合同号:</td>
	            <td class="tableContent"><input type="text" name="contractNo" value="${contractNo}"/></td>
	            <td class="columnTitle">签单日期:</td>
	            <td class="tableContent">
		<!--日期则将数据库查出来的日期格式化成如2013-12-13,然后绑定日期的js方法,单击触发-->
							<input type="text" style="width:90px;" name="signingDate" value="<s:date name="signingDate" format="yyyy-MM-dd"/>" readonly
					             οnclick="WdatePicker({el:this,isShowOthers:true,dateFmt:'yyyy-MM-dd'});"/>
				</td>
	        </tr>
	        <tr>
	            <td class="columnTitle">制单人:</td>
	            <td class="tableContent"><input type="text" name="inputBy" value="${inputBy}"/></td>
	            <td class="columnTitle">审单人:</td>
	            <td class="tableContent"><input type="text" name="checkBy" value="${checkBy}"/></td>
	        </tr>	        
	        <tr>
	            <td class="columnTitle">验货员:</td>
	            <td class="tableContent"><input type="text" name="inspector" value="${inspector}"/></td>
	            <td class="columnTitle">总金额:</td>
	            <td class="tableContent"><input type="text" name="totalAmount" value="${totalAmount}"/></td>
	        </tr>
	        <tr>
	            <td class="columnTitle">船期:</td>
	            <td class="tableContent">
			<!--日期则将数据库查出来的日期格式化成如2013-12-13,然后绑定日期的js方法,单击触发-->
							<input type="text" style="width:90px;" name="shipTime" value="<s:date name="shipTime" format="yyyy-MM-dd"/>" readonly
					             οnclick="WdatePicker({el:this,isShowOthers:true,dateFmt:'yyyy-MM-dd'});"/>
				</td>	            
	            <td class="columnTitle">重要程度:</td>
	            <td class="tableContentAuto">
		<!--获取数据库中的值,如果为1,则value=1的变为选中状态-->
	            	<input type="radio" name="importNum" value="1" class="input" <s:if test="importNum==1"> checked="checked"</s:if>/>★
	            	<input type="radio" name="importNum" value="2" class="input" <s:if test="importNum==2"> checked="checked"</s:if>/>★★
	            	<input type="radio" name="importNum" value="3" class="input" <s:if test="importNum==3"> checked="checked"</s:if>/>★★★
	            </td>
	        </tr> 
	        <tr>
	            <td class="columnTitle">交货期限:</td>
	            <td class="tableContent">
		<!--日期则将数据库查出来的日期格式化成如2013-12-13,然后绑定日期的js方法,单击触发-->
							<input type="text" style="width:90px;" name="deliveryPeriod" value="<s:date name="deliveryPeriod" format="yyyy-MM-dd"/>" readonly
					             οnclick="WdatePicker({el:this,isShowOthers:true,dateFmt:'yyyy-MM-dd'});"/>
				</td>		            
	            <td class="columnTitle">贸易条款:</td>
	            <td class="tableContent"><input type="text" name="tradeTerms" value="${tradeTerms}"/></td>
	        </tr> 
	        <tr>
	            <td class="columnTitle">要求:</td>
	            <td class="tableContentAuto" colspan="3"><textarea name="crequest" style="height:100px;">${crequest}</textarea></td>
	        </tr>	        
		</table>


最后一个 查看jContractView.jsp

<table class="commonTable" cellspacing="1">
	        <tr>
	            <td class="columnTitle">客户名称:</td>
	            <td class="tableContent">${customName}</td>
	            <td class="columnTitle">收购方:</td>
	            <td class="tableContent">${offeror}</td>
	        </tr>
	        <tr>
	            <td class="columnTitle">合同号:</td>
	            <td class="tableContent">${contractNo}</td>
	            <td class="columnTitle">签单日期:</td>
			<!--由于只是查看,只做日期的格式化,无js事件-->
	            <td class="tableContent"><s:date name="signingDate" format="yyyy-MM-dd"/></td>
	        </tr>
	        <tr>
	            <td class="columnTitle">制单人:</td>
	            <td class="tableContent">${inputBy}</td>
	            <td class="columnTitle">审单人:</td>
	            <td class="tableContent">${checkBy}</td>
	        </tr>	        
	        <tr>
	            <td class="columnTitle">验货员:</td>
	            <td class="tableContent">${inspector}</td>
	            <td class="columnTitle">总金额:</td>
	            <td class="tableContent">${totalAmount}</td>
	        </tr>
	        <tr>
	            <td class="columnTitle">船期:</td>
		<!--由于只是查看,只做日期的格式化,无js事件-->
	            <td class="tableContent"><s:date name="shipTime" format="yyyy-MM-dd"/></td>	            
	            <td class="columnTitle">重要程度:</td>
	            <td class="tableContentAuto">
			<!--从服务器获取import的数据,等于几就显示几颗星星-->
	            	<s:if test="importNum==1">★</s:if>
	            	<s:if test="importNum==2">★★</s:if>
	            	<s:if test="importNum==3">★★★</s:if>
	            </td>
	        </tr> 
	        <tr>
	            <td class="columnTitle">交货期限:</td>
		<!--由于只是查看,只做日期的格式化,无js事件-->
	            <td class="tableContent"><s:date name="deliveryPeriod" format="yyyy-MM-dd"/></td>		            
	            <td class="columnTitle">贸易条款:</td>
	            <td class="tableContent">${tradeTerms}</td>
	        </tr> 
	        <tr>
	            <td class="columnTitle">要求:</td>
	            <td class="tableContentAuto" colspan="3"><pre>${crequest}</pre></td>
	        </tr>	        
		</table>











评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值