From 9ce4bb2b6bd1378ba7b0bd6681d22cb37a5e1452 Mon Sep 17 00:00:00 2001
From: Administrator <hbal>
Date: 星期四, 15 十二月 2022 15:45:47 +0800
Subject: [PATCH] 空客户不配车

---
 JavaSource/com/mandi/fendan/controller/Fd_bsheetTaskCon.java   |    5 +++++
 JavaSource/com/mandi/fendan/service/impl/ErpService.java       |   11 +++++++++--
 JavaSource/com/mandi/fendan/controller/Fd_businessCon.java     |    6 ++++++
 JavaSource/com/mandi/fendan/service/impl/Fd_BsheetService.java |   20 ++++++++++++++++++++
 4 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/JavaSource/com/mandi/fendan/controller/Fd_bsheetTaskCon.java b/JavaSource/com/mandi/fendan/controller/Fd_bsheetTaskCon.java
index 9815e1b..d63e9a9 100644
--- a/JavaSource/com/mandi/fendan/controller/Fd_bsheetTaskCon.java
+++ b/JavaSource/com/mandi/fendan/controller/Fd_bsheetTaskCon.java
@@ -8,6 +8,8 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import com.mandi.springmvc.logs.OpLogs;
+import com.mandi.system.persist.ModuleEnum;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -80,6 +82,7 @@
 	 */
 	@RequestMapping(value="/changeVehicle.htm",method={RequestMethod.POST})
 	@ResponseBody
+	@OpLogs(name="鎹㈣溅",module = ModuleEnum.涓氬姟妯″潡)
 	public String changeVehicle(HttpServletRequest r,HttpServletResponse re){
 		String bsNo=RequestParam.getSqlString(r, "bussinessNo");
 		String vehicleInfo=RequestParam.getString(r, "vehicle");
@@ -105,6 +108,7 @@
 	 */
 	@RequestMapping(value="/delItem.htm",method={RequestMethod.POST})
 	@ResponseBody
+	@OpLogs(name="鍙栨秷娲捐溅",module = ModuleEnum.涓氬姟妯″潡)
 	public String delXSFD(HttpServletRequest r,HttpServletResponse re){
 		String bsNo=RequestParam.getSqlString(r, "bussinessNo");
 		Login lg=SessionMethod.getlogin(r.getSession());
@@ -314,6 +318,7 @@
 	 */
 	@RequestMapping(value="/delbypch.htm",method={RequestMethod.POST})
 	@ResponseBody
+	@OpLogs(name="鎵规鍙峰彇娑堥厤杞�", module = ModuleEnum.涓氬姟妯″潡)
 	public String delbypc(HttpServletRequest r,HttpServletResponse re){
 		String tdno =RequestParam.getSqlString(r, "tdno");//鎻愬崟缂栧彿
 		String pch =RequestParam.getSqlString(r, "pch");//鎵规鍙�
diff --git a/JavaSource/com/mandi/fendan/controller/Fd_businessCon.java b/JavaSource/com/mandi/fendan/controller/Fd_businessCon.java
index 7d77d4a..efbd90b 100644
--- a/JavaSource/com/mandi/fendan/controller/Fd_businessCon.java
+++ b/JavaSource/com/mandi/fendan/controller/Fd_businessCon.java
@@ -308,6 +308,7 @@
 	 */
 	@RequestMapping(value="/doBindByList.htm",method={RequestMethod.POST})
 	@ResponseBody
+	@OpLogs(name="鏁村崟閰嶈溅",module = ModuleEnum.涓氬姟妯″潡)
 	public String doBindByList(HttpServletRequest r,HttpServletResponse re){
 		String list=RequestParam.getString(r, "list");
 		String vehicle=RequestParam.getString(r, "vehicle");
@@ -331,6 +332,7 @@
 	 * @param re
 	 * @return
 	 */
+	@OpLogs(name="鏁村崟鍙栨秷閰嶈溅",module = ModuleEnum.涓氬姟妯″潡)
 	@RequestMapping(value="/doUnbindByList.htm",method={RequestMethod.POST})
 	@ResponseBody
 	public String doUnbindByList(HttpServletRequest r,HttpServletResponse re){
@@ -357,6 +359,7 @@
 	 */
 	@RequestMapping(value="/doUnbind.htm",method={RequestMethod.POST})
 	@ResponseBody
+	@OpLogs(name="鏄庣粏鍙栨秷閰嶈溅", module = ModuleEnum.涓氬姟妯″潡)
 	public String doUnbind(HttpServletRequest r,HttpServletResponse re){
 		String list=RequestParam.getString(r, "list");//[{"tdls":,"tdfl":}]
 		String tdbh=RequestParam.getSqlString(r, "tdbh");//鎻愬崟缂栧彿
@@ -383,6 +386,7 @@
 	 */
 	@RequestMapping(value="/doBind.htm",method={RequestMethod.POST})
 	@ResponseBody
+	@OpLogs(name="鍒嗗崟閰嶈溅",module = ModuleEnum.涓氬姟妯″潡)
 	public String doBind(HttpServletRequest r,HttpServletResponse re){
 		String list=RequestParam.getString(r, "list");//[{"tdls":,"tdfl":}]
 		String vehicle=RequestParam.getString(r, "vehicle");//[{"tdls":,"tdfl":}]
@@ -414,6 +418,7 @@
 	 */
 	@RequestMapping(value="/closexstd.htm",method={RequestMethod.POST})
 	@ResponseBody
+	@OpLogs(name="鍏抽棴鍒嗗崟",module = ModuleEnum.涓氬姟妯″潡)
 	public String closeXstd(HttpServletRequest r,HttpServletResponse re){
 		String vehicleId=RequestParam.getSqlString(r, "vehicleId")==null?"":RequestParam.getSqlString(r, "vehicleId").trim();
 		String driver=RequestParam.getSqlString(r, "driver")==null?"":RequestParam.getSqlString(r, "driver").trim();
@@ -440,6 +445,7 @@
 	 */
 	@RequestMapping(value="/openxstd.htm",method={RequestMethod.POST})
 	@ResponseBody
+	@OpLogs(name="鎵撳紑鍒嗗崟",module = ModuleEnum.涓氬姟妯″潡)
 	public String openXSTD(HttpServletRequest r,HttpServletResponse re){
 		String xstdNo=RequestParam.getSqlString(r, "tdNo");//鎻愬崟缂栧彿
 		Login lg=SessionMethod.getlogin(r.getSession());
diff --git a/JavaSource/com/mandi/fendan/service/impl/ErpService.java b/JavaSource/com/mandi/fendan/service/impl/ErpService.java
index 408fc8e..cf311e3 100644
--- a/JavaSource/com/mandi/fendan/service/impl/ErpService.java
+++ b/JavaSource/com/mandi/fendan/service/impl/ErpService.java
@@ -5,6 +5,7 @@
 import com.google.gson.JsonObject;
 import com.google.gson.JsonParser;
 import com.mandi.basicconfig.penum.PrefixEnum;
+import com.mandi.basicconfig.persist.Nckh;
 import com.mandi.common.*;
 import com.mandi.common.ParamFileter.Fileoperation;
 import com.mandi.common.ParamFileter.RegexCheck;
@@ -19,7 +20,9 @@
 import com.mandi.fendan.util.ConvertTool;
 import com.mandi.fendan.util.FdtoNc;
 import com.mandi.fendan.util.persist.*;
+import com.mandi.springmvc.logs.OpLogs;
 import com.mandi.system.persist.Login;
+import com.mandi.system.persist.ModuleEnum;
 import com.mandi.system.persist.UserType;
 import org.apache.commons.beanutils.BeanUtils;
 import org.apache.commons.collections.map.HashedMap;
@@ -793,6 +796,7 @@
 	}
 
 	@Override
+	@Transactional
 	public ObjectResult<Boolean> delFdsheet(Login lg, String bsNo) throws Exception{
 		ObjectResult<Boolean> or = new ObjectResult<Boolean>();
 		if (lg == null) {
@@ -1059,8 +1063,6 @@
 				return orr;
 			}
 		}
-
-
 		JsonParser jp = new JsonParser();
 		Fd_Vehicle fdv1 = new Fd_Vehicle();
 		// 妫�鏌ヨ溅杈嗕俊鎭�
@@ -1154,6 +1156,11 @@
 				}
 				if (StringUtils.isBlank(Rcompany)) {
 					Map<String, Object> mm = this.dqper.getKH(td.getTd_khbh());
+					if(mm == null || mm.size() == 0) { // 瀹㈡埛蹇呴』瀛樺湪锛屽惁鍒欐棤娉曞垎鍗�
+						orr.setCode(1);
+						orr.setErrmsg("璇ユ彁鍗曞鎴蜂笉瀛樺湪锛岃妫�鏌ユ暟鎹紒");
+						return orr;
+					}
 					//
 					/*
 					* 1銆佸璐告湁鍙戠エ缂栧彿锛屽唴璐告病鏈夊彂绁ㄧ紪鍙�
diff --git a/JavaSource/com/mandi/fendan/service/impl/Fd_BsheetService.java b/JavaSource/com/mandi/fendan/service/impl/Fd_BsheetService.java
index 354ae78..c9a715c 100644
--- a/JavaSource/com/mandi/fendan/service/impl/Fd_BsheetService.java
+++ b/JavaSource/com/mandi/fendan/service/impl/Fd_BsheetService.java
@@ -9,9 +9,15 @@
 
 import javax.annotation.Resource;
 
+import com.mandi.basicconfig.mapper.NczsjMapper;
+import com.mandi.basicconfig.persist.Nckh;
 import com.mandi.fendan.mapper.*;
 import com.mandi.fendan.util.ConvertTool;
+import com.mandi.servlet.file.impl.FileLoadImpl;
+import com.mandi.springmvc.logs.OpLogs;
+import com.mandi.system.persist.ModuleEnum;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.log4j.Logger;
 import org.apache.poi.ss.usermodel.charts.ScatterChartSeries;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -50,6 +56,7 @@
 
 @Service
 public class Fd_BsheetService implements Ifd_bsheetService {
+	private Logger log= Logger.getLogger(Fd_BsheetService.class);
 
 	@Resource
 	private Fd_BsheetMapper bsper;
@@ -75,6 +82,9 @@
 	private Fd_YKTMapper yktmper;
 	@Resource
 	private FdMxWlgsMapper fdMxWlgsMapper;
+
+	@Resource
+	private NczsjMapper zsjper;
 
 	@Override
 	@Transactional(rollbackFor=Exception.class)
@@ -122,6 +132,15 @@
 			orr.setCode(1);
 			orr.setErrmsg("璇ユ彁鍗曞凡缁忓垎鍗曞畬鎴愶紝涓嶈兘鍒嗗崟锛�");
 			return orr;
+		}
+		// 鍒ゆ柇鏄惁瀛樺湪瀹㈡埛
+		if(StringUtils.isBlank(xstd.getTd_fpbh())){
+			Nckh nckh = zsjper.getNckhbyCode(xstd.getTd_khbh());// 瀹㈡埛涓嶅瓨鍦ㄧ殑鐗规畩鎯呭喌鏄笉搴旇瀛樺湪鐨勶紝浠ラ槻涓囦竴锛屽姞鍒ょ┖銆�
+			if(nckh == null) {
+				orr.setCode(1);
+				orr.setErrmsg("璇ユ彁鍗曞鎴蜂笉瀛樺湪锛岃妫�鏌ユ暟鎹紒");
+				return orr;
+			}
 		}
 		//閫佽揣
 		if(xstd.getTd_ztbz()==2){
@@ -435,6 +454,7 @@
 				}
 			}
 		}catch(Exception e){
+			e.printStackTrace();
 			if(saveBT){
 				JsonObject jo=new JsonObject();
 				jo.addProperty("bussinessNo", bbsNo);

--
Gitblit v1.9.3