hjg
2023-11-17 3780c5e65b05bf23020810798babc6d20311fa79
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