Administrator
2022-12-12 5aa407dd55a0a8f37774308743bb0a593bd8da3c
JavaSource/com/mandi/webservice/service/impl/FdXSTDService.java
@@ -9,6 +9,7 @@
import javax.annotation.Resource;
import com.mandi.basicconfig.persist.*;
import com.mandi.fendan.util.ConvertTool;
import com.mandi.servlet.file.impl.FileLoadImpl;
import org.apache.commons.lang3.StringUtils;
@@ -22,11 +23,6 @@
import com.google.gson.JsonParser;
import com.mandi.basicconfig.mapper.FdRepertoryNexusMapper;
import com.mandi.basicconfig.mapper.NczsjMapper;
import com.mandi.basicconfig.persist.FdRepertoryNexus;
import com.mandi.basicconfig.persist.Ncck;
import com.mandi.basicconfig.persist.Ncdepart;
import com.mandi.basicconfig.persist.Ncworker;
import com.mandi.basicconfig.persist.Ncywdy;
import com.mandi.common.JSONobj;
import com.mandi.common.Wxhtmethod;
import com.mandi.common.ParamFileter.BigDecimalfiter;
@@ -740,6 +736,13 @@
         return orr;
      }
      String vehicleId=mp.get("numberplates")==null?"":mp.get("numberplates").toString();
      String type = (String)mp.get("type");
      String sdepartNo = null;
      if(type.equals("外来车辆卡")) {
         sdepartNo = (String) mp.get("sdepartNo");
      }
      List<Fd_Bsheet> fd_bList = this.fbper.getListbyVehicleId(vehicleId, Serviceenum.在办);
      if (fd_bList == null||fd_bList.isEmpty()) {
         orr.setCode(1);
@@ -769,7 +772,8 @@
            return orr;
         }
      }
      String businessNo = bsper.getBusinessNoByCardNo(cardID);
      // 改成使用在用卡的卡号、车牌号码、厂区来确认是否有销售的业务单 btid=3 businesstype00002
      String businessNo = bsper.getBusinessNoByCardNo(cardID,vehicleId,sdepartNo);
      if(StringUtils.isBlank(businessNo)) {
         orr.setCode(1);
         orr.setErrmsg("未找到该卡的在办业务单!");
@@ -778,6 +782,7 @@
//      List<Vehicle_XSTD> vxl=this.vhxper.getlistbyVehicleId(vehicleId);
      List<Vehicle_XSTD> vxl= this.vhxper.getlistbyVehicleIdandbsNoGp(vehicleId, businessNo);
      List<Map<String, Object>> datamp=new ArrayList<Map<String, Object>>();
      Map<String,Fd_XSTD> xstdMap = new HashMap(); // 缓存Fd_XSTD,避免多查
      for (Vehicle_XSTD vx : vxl) {
         String tdbh=vx.getXstdNo();
         Fd_XSTD td=this.tdper.getbyTDBH(tdbh);
@@ -801,10 +806,25 @@
         tdm.put("td_tdbh", td.getTd_tdbh());
         tdm.put("td_tdls", td.getTd_tdls());
         tdm.put("td_jylx", td.getTd_jylx());
         Fd_XSTD fd_xstd = xstdMap.get(td.getTd_tdbh());
         if(xstdMap.get(td.getTd_tdbh())==null) { // 保证同一个提单只查一遍
            fd_xstd = tdper.getbyttdbh(td.getTd_tdbh());
         }
         //增加客户名称 备注
         if(StringUtils.isBlank(fd_xstd.getTd_fpbh())){
            Nckh nckh = zsjper.getNckhbyCode(fd_xstd.getTd_khbh());// 客户不存在的特殊情况是不应该存在的,以防万一,加判空。
            tdm.put("td_khmc",nckh!=null?nckh.getName():"");
         }else {
            String name = ConvertTool.covertToCustoms(fd_xstd.getTd_ywdybh());
            tdm.put("td_khmc", name);
         }
         tdm.put("td_bz",fd_xstd.getTd_bz());
         mm.put("td", tdm);
         mm.put("tdmx", tdmxl);
         datamp.add(mm);
      }
      rem.put("cph", vehicleId);
      rem.put("sjmc", fd_b.getDriver());
      rem.put("dh", fd_b.getPhone());