Last time we completed the export business-purchase contract query and report, but there are many things are not perfect, we gradually completed our exports to the remaining business.
We have to solve one of the problems: we in the purchase and Sale contract query interface Click "Escalation" will be directly reported to the export report, if the user is only delayed or test, this is a bit too hasty, we need to add some restrictions to ensure the correctness of the operation.
And one more thing is that our master information is not complete.
Gross weight, net weight, length and width higher information we have not filled out, we should all add. We can only add it in the modification.
So we add the method of modification:
Look back at our previous export shipments. The modified statement has been configured in the Mapper mapping file:
<update id= "Update" parametertype= "Cn.hpu.jk.domain.Export" >update export_c<set><if test= "inputdate ! = NULL "> Input_date=#{inputdate},</if><if test=" Contractids! = null "> Contract_ids=#{contractids}, </if><if test= "Customercontract! = null" > Customer_contract=#{customercontract},</if><if test= "Lcno! = null" > Lcno=#{lcno},</if><if test= "Consignee! = null" > consignee=#{consignee},</if>< If test= "Marks! = null" > Marks=#{marks},</if><if test= "Remark! = NULL" > remark=#{remark},</if> <if test= "Shipmentport! = null" > Shipment_port=#{shipmentport},</if><if test= "DestinationPort! = null" > destination_port=#{destinationport},</if><if test= "Transportmode! = null" > transport_mode=#{ Transportmode},</if><if test= "Pricecondition! = null" > price_condition=#{pricecondition},</if> <if test= "Grossweight! = null" > Gross_weight=#{grossweight},</if><if teSt= "Netweight! = null" > Net_weight=#{netweight},</if><if test= "Measurement! = NULL" > measurement=#{ Measurement},</if></set>where export_id=#{id}</update>
Then the DAO layer and service layer were also written the method last time, below we add the modified method directly in the controller layer:
Turn to modify interface @requestmapping ("/cargo/export/toupdate.action") Public String toupdate (string Id,model Model) {export obj= Exportservice.get (ID); Model.addattribute ("obj", obj); return "/cargo/export/jexportupdate.jsp";} Modify @requestmapping ("/cargo/export/update.action") Public String Update (export export) {exportservice.update ( Export); return "Redirect:/cargo/export/list.action";}
Then we have a modified button on the main interface of export shipping:
<ul><li id= "View" ><a href= "#" onclick= "Formsubmit (' toview.action ', ' _self '); This.blur ();" > View </a></li><li id= "Update" ><a href= "#" onclick= "Formsubmit (' toupdate.action ', ' _self '); This.blur (); " > Modify </a></li><li id= "Delete" ><a href= "#" onclick= "Formsubmit (' delete.action ', ' _self '); This.blur (); " > Delete </a></li><li id= "new" ><a href= "#" onclick= "Formsubmit (' submit.action ', ' _self '); This.blur (); " > Report </a></li><li id= "new" ><a href= "#" onclick= "Formsubmit (' cancel.action ', ' _self '); This.blur (); " > Cancel </a></li></ul>
Next, write our modified JSP page:
<%@ page language= "java" pageencoding= "UTF-8"%><%@ include file= ". /.. /base.jsp "%><%@ taglib uri=" http://java.sun.com/jsp/jstl/fmt "prefix=" FMT "%>
As for total gross weight, total net weight, volume when we submitted the changes to the total goods and accessories to calculate the way, there is no need for users to enter, so the modification interface does not have these fields.
Then we test it out:
Click Edit:
Go to the Modify interface:
Fill in the Modification information:
After submission, the modification succeeds!
You can see that the status is not yet, we have just reported that the export shipping information is "Draft" status, so we added in the previous service Insert method:
Export.setstate (0);//default is draft status
Then the "escalation" and "draft" between the switch we have done before, here will not repeat.
Because we have to complete the "sub-shipment", that is, I do not have a certain export shipping items under the goods shipped, I will be in batches of the shipment, a contract can be carried out several times. For example: There is a cargo of 1000 pieces, this newspaper shipped only 800 pieces, the next time in the transport of 200 pieces.
In general, most of a contract once reported, only in special cases have a number of contracts once reported, a contract several times, but this function must have.
Therefore, our amendment is not only the export of information to change the news, but also to the shipment of goods under the revised information, modify the goods under the shipping information, users can only modify the quantity of goods, and only minor changes. If it has been reported in sub-shipments, it only shows the remaining value = The total number of goods in the contract-the actual number of shipments.
We used to have one before. Change of goods information is very inconvenient, we want to achieve bulk modification this time, we want to modify the quantity of goods (achieve sub-shipment), and modify the new 7 fields.
How to add a batch modification script, please see the next summary: Export shipping changes + shipping goods volume Display-Batch modify control 2
Reprint Please specify source: http://blog.csdn.net/acmman/article/details/49019401
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
"Springmvc+mybatis project" Jie Xin Business-32. Export Shipping change + shipping Volume Display-batch modify control 1