JavaSource/com/mandi/fendan/controller/Fd_VehicleController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
JavaSource/com/mandi/fendan/mapper/FdVehicleRemarkMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
JavaSource/com/mandi/fendan/persist/FdVehicleRemark.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
JavaSource/com/mandi/fendan/service/impl/ErpService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebContent/basic/js/vehicleBindMaterials.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebContent/basic/vehicleBindMaterials.xhtml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
JavaSource/com/mandi/fendan/controller/Fd_VehicleController.java
@@ -1,12 +1,16 @@ package com.mandi.fendan.controller; import java.util.HashMap; import java.util.Map; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.mandi.common.Jacksonmethod; import com.mandi.common.RequestParam; import com.mandi.common.SessionMethod; import com.mandi.dao.common.ObjectResult; import com.mandi.dao.common.PageRequest; import com.mandi.dao.common.PageResult; import com.mandi.fendan.mapper.FdVehicleRemarkMapper; import com.mandi.fendan.persist.FdVehicleRemark; import com.mandi.fendan.persist.Fd_Vehicle; import com.mandi.fendan.service.Ifd_vehicleService; import com.mandi.system.persist.Login; import org.apache.commons.lang3.StringUtils; import org.apache.log4j.Logger; import org.springframework.stereotype.Controller; @@ -14,15 +18,11 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import com.mandi.common.Jacksonmethod; import com.mandi.common.RequestParam; import com.mandi.common.SessionMethod; import com.mandi.dao.common.ObjectResult; import com.mandi.dao.common.PageRequest; import com.mandi.dao.common.PageResult; import com.mandi.fendan.persist.Fd_Vehicle; import com.mandi.fendan.service.Ifd_vehicleService; import com.mandi.system.persist.Login; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.HashMap; import java.util.Map; @Controller("fd_vehicle_con") @@ -31,6 +31,51 @@ private Logger log=Logger.getLogger(Fd_VehicleController.class); @Resource private Ifd_vehicleService ivs; @Resource private FdVehicleRemarkMapper fdVehicleRemarkMapper; @RequestMapping(value = "/saveRemark.htm", method = {RequestMethod.POST }) @ResponseBody public void saveRemark(HttpServletRequest r,HttpServletResponse re,String numberplates,String bsNo,String remark){ FdVehicleRemark fdVehicleRemark = new FdVehicleRemark(); fdVehicleRemark.setRemark(remark); fdVehicleRemark.setBusinessNO(bsNo); fdVehicleRemark.setVehicle(numberplates); ObjectResult<Boolean> orr=new ObjectResult<>(); try { FdVehicleRemark fdVehicleRemarkTemp = fdVehicleRemarkMapper.selectByBusinessNo(bsNo); if(fdVehicleRemarkTemp!=null) { int i = fdVehicleRemarkMapper.update(fdVehicleRemark); if (i <= 0) { orr.setCode(1); orr.setErrmsg("æ·»å 失败,请æ£æ¥æ°æ®ï¼"); } }else { fdVehicleRemarkMapper.insert(fdVehicleRemark); } orr.setCode(0); orr.setErrmsg("æ·»å æåï¼"); }catch (Exception e) { log.error(e.getMessage(),e); orr.setCode(1); orr.setErrmsg("æ·»å 失败ï¼è¯·è系管çåï¼"); } SessionMethod.writeresp(re, Jacksonmethod.tojson(orr, false)); } @RequestMapping(value = "/getDetail.htm", method = {RequestMethod.POST }) @ResponseBody public void getDetail(HttpServletRequest r,HttpServletResponse re,String numberplates,String bsNo){ ObjectResult<FdVehicleRemark> orr=new ObjectResult<>(); try { FdVehicleRemark fdVehicleRemark = fdVehicleRemarkMapper.selectByBusinessNo(bsNo); orr.setItem(fdVehicleRemark); }catch (Exception e) { orr.setCode(1); orr.setErrmsg("æ¥è¯¢å¤±è´¥ï¼"); } SessionMethod.writeresp(re, Jacksonmethod.tojson(orr, false)); } @RequestMapping(value = "/saveItem.htm", method = {RequestMethod.POST }) @ResponseBody JavaSource/com/mandi/fendan/mapper/FdVehicleRemarkMapper.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,16 @@ package com.mandi.fendan.mapper; import com.mandi.fendan.persist.FdVehicleRemark; import org.apache.ibatis.annotations.*; public interface FdVehicleRemarkMapper { @Update("update FdVehicleRemark set remark=#{remark},vehicle=#{vehicle} where businessNo =#{businessNO} ") int update(FdVehicleRemark FdVehicleRemark); @Insert("insert into FdVehicleRemark(businessNO,vehicle,remark) values(#{businessNO},#{vehicle},#{remark})") FdVehicleRemark insert(FdVehicleRemark FdVehicleRemark); @Select("select top 1 *from FdVehicleRemark where businessNo=#{businessNO} ") FdVehicleRemark selectByBusinessNo(String businessNO); @Delete("delete from FdVehicleRemark where businessNo=#{businessNo}") int deleteByBusinessNo(@Param("businessNo") String businessNo); } JavaSource/com/mandi/fendan/persist/FdVehicleRemark.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,38 @@ package com.mandi.fendan.persist; import javax.persistence.Entity; import javax.persistence.Table; @Entity @Table(name="fd_vehicle_xstd") public class FdVehicleRemark { String businessNO; String vehicle; String remark; public String getBusinessNO() { return businessNO; } public void setBusinessNO(String businessNO) { this.businessNO = businessNO; } public String getVehicle() { return vehicle; } public void setVehicle(String vehicle) { this.vehicle = vehicle; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } } JavaSource/com/mandi/fendan/service/impl/ErpService.java
@@ -89,6 +89,8 @@ @Resource private SqlSessionFactory sqlSessionFactory; private FdVehicleRemarkMapper fdVehicleRemarkMapper; @Override public ObjectResult<String> tzPrint(Login lg, String bssNo, String ipadd) { ObjectResult<String> orr = new ObjectResult<String>(); @@ -981,7 +983,8 @@ } } // å é¤è½¦è¾ååçå¤æ³¨remark fdVehicleRemarkMapper.deleteByBusinessNo(bsNo); or.setCode(0); or.setItem(true); return or; WebContent/basic/js/vehicleBindMaterials.js
@@ -14,7 +14,8 @@ window.I = { id: $('#_id').val(), bsNo: $('#_bsNo').val(), printBtn: $('#printBtn') printBtn: $('#printBtn'), detailModal: $("#modal"), } var ViewModel = function() { @@ -24,9 +25,13 @@ self.totalJZ = ko.observable(0); self.vehicleLoadweight = ko.observable(0); self.overWeight = ko.observable(0); self.remark = ko.observable(''); self.isAdmin = ko.observable(typeof(parent.G) != 'undefined' ? parent.G.isAdmin : false); self.del = function(item) { delConfirm(item); } self.addRemark = function(item) { I.detailModal.modal('show'); } } @@ -44,6 +49,35 @@ I.printBtn.click(function (e) { e.preventDefault(); newTab(I.numberplates); }); $("#confirmBtn").click(function (e) { e.preventDefault(); saveRemark(); }) $("#clearSortBtn").click(function (e){ e.preventDefault(); I.detailModal.modal('hide'); }) getRemarkDetail(); } function saveRemark() { $.post("/vehicle/saveRemark.htm", {numberplates: I.numberplates, bsNo: I.bsNo, remark: vm.remark()}, function (data, textStatus, jqXHR) { if(data.code == 0) { parent.showErrmsg('ä¿åæåï¼'); }else { swal({title:'',text:data.errmsg,type:'error',confirmButtonText:'ç¡®å®'}); } }); } function getRemarkDetail() { $.post("/vehicle/getDetail.htm", {numberplates: I.numberplates, bsNo: I.bsNo}, function (data, textStatus, jqXHR) { if(data.code == 0) { if(data.item) vm.remark(data.item.remark); }else { swal({title:'',text:data.errmsg,type:'error',confirmButtonText:'ç¡®å®'}); } }); } @@ -120,7 +154,7 @@ function autoHeight() { $('.page-content').css('min-height', $(parent.window).height() - 159); $('.table-responsive').css('height', $(parent.window).height() - 159); $('.table-responsive').css('height', $(parent.window).height() - 239); } function delConfirm(item) { WebContent/basic/vehicleBindMaterials.xhtml
@@ -69,10 +69,13 @@ æ°è¿è¾å ¬å¸ </button> </div> --> <div class="col-xs-11"> <div class="col-xs-10"> <h3 style="margin: 0"><span data-bind="text: decodeURI('#{param.numberplates}')"></span>çå·²é 车ç©èµï¼æ»æ°éï¼<span data-bind="text: list().length"></span>ï¼æ»æ¯éï¼<span data-bind="text: totalMZ"></span>ï¼æ»åéï¼<span data-bind="text: totalJZ"></span>ï¼è½½éï¼<span data-bind="text: vehicleLoadweight"></span>ï¼è¶ éï¼<span data-bind="text: (totalMZ() - vehicleLoadweight()) > 0 ? (totalMZ() - vehicleLoadweight()) : 0"></span>ã</h3> </div> <div class="col-xs-1" style="text-align: right;"> <div class="col-xs-2" style="text-align: right;"> <button class="btn btn-sm btn-info" type="button" id="remark" data-bind="click:addRemark"> å¤æ³¨ </button> <button class="btn btn-sm btn-info" type="button" id="printBtn"> <i class="ace-icon fa fa-print bigger-110"></i> æå° @@ -135,6 +138,27 @@ </tbody> </table> </div> <div class="col-xs-12" style="margin-top: 2px;"> å¤æ³¨ï¼ <div data-bind="text: remark"></div> </div> </div> <div class="modal fade" id="modal"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> <h4 class="modal-title">æ·»å å¤æ³¨</h4> </div> <div class="modal-body" style="overflow: hidden"> å¤æ³¨ï¼<textarea style="width:100%; resize:none;" rows="8" data-bind="value: remark"></textarea> </div> <div class="modal-footer"> <button type="button" class="btn btn-default btn-sm" ddata-dismiss="modal" id="clearSortBtn">åæ¶</button> <button type="button" class="btn btn-primary btn-sm" data-dismiss="modal" id="confirmBtn" >ç¡®å®</button> </div> </div> </div> </div> <div id="dialog-confirm" class="hide"> <div class="alert alert-info bigger-110" id="modalContent"> @@ -142,7 +166,7 @@ </div> </ui:define> <ui:define name="myscript"> <script src="js/vehicleBindMaterials.js?v=#{sessionScope.login_page_vesion}"></script> <script src="js/vehicleBindMaterials.js?v=11222222321"></script> </ui:define> </ui:composition> </html>