From 5aa407dd55a0a8f37774308743bb0a593bd8da3c Mon Sep 17 00:00:00 2001
From: Administrator <hbal>
Date: 星期一, 12 十二月 2022 14:26:10 +0800
Subject: [PATCH] 增加客户、备注

---
 JavaSource/com/mandi/fendan/mapper/BusinessMapper.java          |   21 +++++++++++++++++++--
 JavaSource/com/mandi/webservice/service/impl/FdXSTDService.java |   32 ++++++++++++++++++++++++++------
 2 files changed, 45 insertions(+), 8 deletions(-)

diff --git a/JavaSource/com/mandi/fendan/mapper/BusinessMapper.java b/JavaSource/com/mandi/fendan/mapper/BusinessMapper.java
index 16953e5..6fc27b9 100644
--- a/JavaSource/com/mandi/fendan/mapper/BusinessMapper.java
+++ b/JavaSource/com/mandi/fendan/mapper/BusinessMapper.java
@@ -22,8 +22,25 @@
 	})
 	public Map<String,Object> existsIssueCardByNos(@Param("bussinessNos") String bussinessNos);
 
-	@Select({"select top 1 bussinessNo from bussinesssheet where cardno=#{cardno} and sstatus='鍦ㄥ姙' order by indx" })
-	public String getBusinessNoByCardNo(@Param("cardno") String cardno);
+	/**
+	 * 鍙栭攢鍞湪鐢ㄥ崱
+	 * @param cardno
+	 * @param numberplates
+	 * @param sdepartNo
+	 * @return
+	 */
+	@Select({"<script>" +
+			"select top 1 bussinessNo from bussinesssheet " +
+			"<where>",
+			"cardno=#{cardno} and sstatus='鍦ㄥ姙' and numberplates = #{numberplates} " ,
+			"<if test=\"sdepartNo!='' and sdepartNo!=null\">",
+			" and sdepartNo=#{sdepartNo}",
+			"</if>",
+//			"and btid=3", //3涓烘垚鍝侀攢鍞�
+			"</where>",
+			" order by indx",
+			"</script>" })
+	public String getBusinessNoByCardNo(@Param("cardno") String cardno,@Param("numberplates") String numberplates,@Param("sdepartNo")String sdepartNo);
 
 	@Deprecated
 	@Select("select top 1 * from bussinesssheet a left join gbusi_type b on a.btid=b.id where b.businesstypeNo=#{btNo} and a.numberplates=#{vehicleID} and a.sstatus=#{sstatus} and a.sdepartNo=#{sdepartNo} ")
diff --git a/JavaSource/com/mandi/webservice/service/impl/FdXSTDService.java b/JavaSource/com/mandi/webservice/service/impl/FdXSTDService.java
index cdbb857..b6226ff 100644
--- a/JavaSource/com/mandi/webservice/service/impl/FdXSTDService.java
+++ b/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());

--
Gitblit v1.9.3