From 96118de3ac74f5468cf5d4ac73d6ea3bec1da010 Mon Sep 17 00:00:00 2001
From: shiyunteng <shiyunteng@example.com>
Date: 星期五, 20 十一月 2026 14:36:25 +0800
Subject: [PATCH] feat:新增销售指标 产品板块 重点工作 专项业务 产品收入和合同统计修改功能 feat:承兑新增承兑编号字段 feat:客商主数据更新名称 专项业务去年同月字段 机动车销售发票地址字段及判断 feat:银行流水更新客户id feat:机动车销售发票新增税务及代码字段 feat:流水更新按钮参数 feat:检索新增标的物运维按钮

---
 platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/BankStatementServiceImpl.java |  169 ++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 133 insertions(+), 36 deletions(-)

diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/BankStatementServiceImpl.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/BankStatementServiceImpl.java
index 91a2cb4..d04cef0 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/BankStatementServiceImpl.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/BankStatementServiceImpl.java
@@ -18,10 +18,12 @@
 import com.by4cloud.platformx.business.dto.BankStatementUpdateDTO;
 import com.by4cloud.platformx.business.dto.BipQueryDTO;
 import com.by4cloud.platformx.business.dto.PaymentConfirmAddDTO;
+import com.by4cloud.platformx.business.dto.SyncPaymentRecepitDTO;
 import com.by4cloud.platformx.business.entity.*;
 import com.by4cloud.platformx.business.mapper.*;
 import com.by4cloud.platformx.business.service.BankStatementService;
 import com.by4cloud.platformx.business.service.PaymentConfirmService;
+import com.by4cloud.platformx.business.vo.CustInfoVo;
 import com.by4cloud.platformx.business.vo.ReceiveBipVo;
 import com.by4cloud.platformx.business.vo.ReceiveItemVo;
 import com.by4cloud.platformx.business.vo.StatementContractVo;
@@ -76,6 +78,27 @@
 	@Value("${erp.sgb}")
 	private String sgbErp;
 
+	@Value("${dept.smj}")
+	private String smj;
+
+	@Value("${dept.smjsc}")
+	private String smjsc;
+
+	@Value("${dept.smjzt}")
+	private String smjzt;
+
+	@Value("${dept.smjhw}")
+	private String smjhw;
+
+	@Value("${dept.jxc}")
+	private String jxc;
+
+	@Value("${dept.tfgs}")
+	private String tfgs;
+
+	@Value("${dept.ymj}")
+	private String ymj;
+
 	@Override
 	public R edit(BankStatementUpdateDTO updateDTO) {
 		BankStatement statement = baseMapper.selectById(updateDTO.getId());
@@ -108,7 +131,7 @@
 			addDTO.setBusGuestId(statement.getBusGuestId() + "");
 			addDTO.setConfirmTime(statement.getTranDate());
 			addDTO.setContractNo(contract.getContractNo());
-			addDTO.setInOrOut(statement.getDcFlag());
+			addDTO.setInOrOut("1");
 			addDTO.setTransationAmount(statementContractDTO.getToPaidAmount());
 			addDTO.setBankSeqNo(statement.getBankSeqNo());
 			paymentConfirmService.add(addDTO);
@@ -120,16 +143,7 @@
 			pushCollectionSgb(statement, updateDTO.getContractCollectionList());
 		}
 
-//		//鍒ゆ柇鏄惁鍐呴儴鍗曚綅
-//		CustInfoVo custInfoVo = bipViewMapper.selectBaseInfoByCustName(statement.getPayBankAccName());
-//		if (ObjUtil.isNull(custInfoVo)){
-//			return R.ok();
-//		}
-//		//bip鎺ㄩ��
-//		if (bipFlag&&custInfoVo.getCustCode().equals("01")) {
-//			return pushSaveCollection(statement, updateDTO.getContractCollectionList());
-//		}
-//		log.info("鍐呴儴寰�鏉ユ敹娆惧崟锛屽鎴峰悕绉帮細{},瀹㈡埛绫诲瀷锛歿},涓嶇敤淇濆瓨鏀舵鍗�",custInfoVo.getCustName(),custInfoVo.getCustclass());
+
 		return R.ok();
 	}
 
@@ -140,30 +154,29 @@
 
 //		HttpResponse resp = HttpUtil.createPost(sgbErp + "/apilink/arclose/create?corpsecret=12345678&appserver=appserver1&accountid=888&tradeid="
 //				+ IdUtil.fastUUID())
-//				.header("Content-Type","application/x-www-form-urlencoded")
-//				.body(URLEncodeUtil.encode(request.toJSONString(), StandardCharsets.UTF_8))
+//				.form("",request.toJSONString())
 //				.timeout(30000)
 //				// 鎸囧畾缂栫爜鏍煎紡
 //				.charset(StandardCharsets.UTF_8)
 //				.execute();
 
-			log.info("宸ヤ笟娉垫敹娆惧叆鍙�:{}", "=" +request.toJSONString());
-			OkHttpClient client = new OkHttpClient().newBuilder()
-					.build();
-			MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
-			RequestBody body = RequestBody.create(mediaType, "=" + request.toJSONString());
-			Request req = new Request.Builder()
-					.url(sgbErp + "/apilink/arclose/create?corpsecret=12345678&appserver=appserver1&accountid=888&tradeid=" + IdUtil.fastUUID())
-					.method("POST", body)
-					.addHeader("Content-Type", "application/x-www-form-urlencoded")
-					.build();
-			String result = "";
-			try (Response response = client.newCall(req).execute()){
-				if (response.isSuccessful()) {
-					// 浠呰皟鐢ㄤ竴娆tring()锛岀粨鏋滃瓨鍏ュ彉閲忓鐢紝鍚庣画鎵�鏈夐�昏緫鐩存帴璇诲彇璇ュ彉閲�
-					result = response.body().string();
-					// 涓氬姟閫昏緫鐩存帴浣跨敤result锛岀姝㈠啀娆¤皟鐢╮esponse.body().string()
-				}
+		log.info("宸ヤ笟娉垫敹娆惧叆鍙�:{}", "=" + request.toJSONString());
+		OkHttpClient client = new OkHttpClient().newBuilder()
+				.build();
+		MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
+		RequestBody body = RequestBody.create(mediaType, "=" + request.toJSONString());
+		Request req = new Request.Builder()
+				.url(sgbErp + "/apilink/arclose/create?corpsecret=12345678&appserver=appserver1&accountid=888&tradeid=" + IdUtil.fastUUID())
+				.method("POST", body)
+				.addHeader("Content-Type", "application/x-www-form-urlencoded")
+				.build();
+		String result = "";
+		try (Response response = client.newCall(req).execute()) {
+			if (response.isSuccessful()) {
+				// 浠呰皟鐢ㄤ竴娆tring()锛岀粨鏋滃瓨鍏ュ彉閲忓鐢紝鍚庣画鎵�鏈夐�昏緫鐩存帴璇诲彇璇ュ彉閲�
+				result = response.body().string();
+				// 涓氬姟閫昏緫鐩存帴浣跨敤result锛岀姝㈠啀娆¤皟鐢╮esponse.body().string()
+			}
 			log.info("宸ヤ笟娉垫敹娆惧洖鍙傦細{}", result);
 			saveErpRequestRecord("sgb", "/apilink/arclose/create", request.toJSONString(), result);
 			JSONObject respJson = JSONObject.parseObject(result);
@@ -205,7 +218,7 @@
 		djt.put("cBankAccount", statement.getReceiveBankAccAcc());//鏈柟閾惰璐﹀彿
 		djt.put("cBank", statement.getPayBankAccName());//鏈柟閾惰璐﹀彿
 		djt.put("cContractType", "161");
-		if (CollUtil.size(contractCollectionList)==1) {
+		if (CollUtil.size(contractCollectionList) == 1) {
 			Contract contractHeader = contractMapper.selectById(contractCollectionList.get(0).getId());
 			djt.put("cContractID", contractHeader.getErpContractNo());
 		}
@@ -221,7 +234,7 @@
 			djti.put("cPersonCode", "00164");//涓氬姟鍛樼紪鐮�
 			djti.put("cConID", contract.getErpContractNo());//鍚堝悓缂栫爜
 			djti.put("娆鹃」绫诲瀷", "搴旀敹娆�");
-			djti.put("cConType","闀囨睙甯�");
+			djti.put("cConType", "闀囨睙甯�");
 			array.add(djti);
 		});
 
@@ -279,11 +292,13 @@
 		data.put("exchangeRate", "1");//姹囩巼
 		data.put("exchangeRateDate", DateUtil.now());//姹囩巼鏃堕棿
 		data.put("objectType", "1");
-		data.put("customerCode", customer.getBipCode());//瀹㈡埛缂栫爜
+		data.put("customerCode", bipVo.getKh());//瀹㈡埛缂栫爜
 		data.put("financeOrgCode", dept.getBipCode());//寮�绁ㄧ粍缁囩紪鐮�
 		data.put("orgCode", dept.getBipCode());//涓氬姟缁勭粐缂栫爜
-		data.put("bustypeCode", "ar_colsale");// TODO 浜ゆ槗绫诲瀷缂栫爜 鏆備及榛樿ZGYSFP锛岃澶囬粯璁BYXGLXT鏆傛椂涓嶈兘鐢�
+		data.put("bustypeCode", bipVo.getJylx());// TODO 浜ゆ槗绫诲瀷缂栫爜 YS-YSKD//棰勬敹娆惧崟  ZJSKD 鐩存帴鏀舵鍗� 鏀舵鍗� ar_coloth 鍏朵粬鏀舵 鏀舵鍗� ar_colsale 鍏朵粬鏀舵 鏀舵鍗�
 		data.put("oriCurrencyCode", "CNY");//甯佺
+		data.put("settleModeCode",bipVo.getJsfs());//缁撶畻鏂瑰紡
+		data.put("staffCode",bipVo.getYwy());//涓氬姟鍛�
 		data.put("srcBillType", "38");
 		data.put("srcBillNo", statement.getBankSeqNo());
 		data.put("_status", "Insert");
@@ -298,11 +313,17 @@
 		item.put("expenseItemCode", bipVo.getItemList().get(0).getJjsx());//缁忔祹浜嬮」
 		item.put("remarks", bipVo.getItemList().get(0).getZy());//鎽樿
 		JSONObject freeChId = new JSONObject();
+
+		freeChId.put("YSYF14", bipVo.getItemList().get(0).getKxlx());//娆鹃」绫诲瀷 1 棰勬敹娆� 2 搴旀敹娆�
+		freeChId.put("YSYF33", bipVo.getItemList().get(0).getFphm());//鍙戠エ鍙风爜
 		freeChId.put("GX08", bipVo.getItemList().get(0).getHsdy());//鏍哥畻鍗曞厓
-		freeChId.put("YSYF14", "1");//娆鹃」绫诲瀷 1 棰勬敹娆� 2 搴旀敹娆�
 		freeChId.put("JT04", bipVo.getItemList().get(0).getHsjylx());//鏍哥畻浜ゆ槗绫诲瀷 0101 闆嗗洟澶栭儴 01020301 涓夌骇鍒嗗瓙鍏徃闂� 01020302 涓夌骇鍒嗗叕鍙镐笌瀛愬瓙鍏徃涔嬮棿
 		freeChId.put("JT06", bipVo.getItemList().get(0).getKxmx());//娆鹃」鏄庣粏
 		freeChId.put("JT12", bipVo.getItemList().get(0).getCpwlfl());//浜у搧鐗╂枡鍒嗙被
+		freeChId.put("JT32", bipVo.getItemList().get(0).getZyys());//浣滀笟瑕佺礌
+		freeChId.put("zzbkfl", bipVo.getItemList().get(0).getBkfl());//鏉垮潡鍒嗙被
+		freeChId.put("YSZJX01A",bipVo.getItemList().get(0).getXzjysxma());//鏂拌祫閲戦绠楅」鐩瓵
+		freeChId.put("YSZJX11","鏄�");//鏄惁璧勯噾棰勭畻鎺у埗
 
 		item.put("freeChId", freeChId);
 
@@ -311,6 +332,7 @@
 		data.put("bodyItem", bodyItem);
 		JSONObject datafreeChId = new JSONObject();
 		datafreeChId.put("YSYF_SFZY", bipVo.getSfzy());//鏄惁涓昏惀
+		datafreeChId.put("fk_035", bipVo.getSffz());//鏄惁鍏ヨ礋鍊虹鐩�
 		datafreeChId.put("fk_038", bipVo.getPzzdr());//鍑瘉鍒跺崟浜�
 		datafreeChId.put("YSYF_08", bipVo.getSfnbwl());//鏄惁鍐呴儴寰�鏉�
 		datafreeChId.put("YSYF24", bipVo.getSfjyjs());//鏄惁绠�鏄撹绋�
@@ -632,7 +654,7 @@
 		}
 		bipVo.setYwy(SecurityUtils.getUser().getNickname());
 		bipVo.setPzzdr(SecurityUtils.getUser().getNickname());
-		bipVo.setJylx("ZBYXGLXT");
+		bipVo.setJylx("YS-YSKD");
 		bipVo.setWldxlx("1");
 		bipVo.setKh(customer.getCreditCode());
 		bipVo.setBz("CNY");
@@ -643,6 +665,7 @@
 		bipVo.setDjfx("1");
 		List<ReceiveItemVo> list = new ArrayList<>();
 		ReceiveItemVo itemVo = new ReceiveItemVo();
+		itemVo.setKxlx("1");
 		itemVo.setConfirmAmount(bankStatementItem.getConfirmAmount());
 		list.add(itemVo);
 		bipVo.setItemList(list);
@@ -660,6 +683,80 @@
 		item.setBipParam(updateDTO.getBipParam());
 		bankStatementItemMapper.updateById(item);
 		BankStatement statement = baseMapper.selectById(item.getStatetId());
+
+		//鍒ゆ柇鏄惁鍐呴儴鍗曚綅
+		CustInfoVo custInfoVo = bipViewMapper.selectBaseInfoByCustName(statement.getPayBankAccName());
+		if (ObjUtil.isNotNull(custInfoVo) && custInfoVo.getCustCode().equals("01")) {
+			log.info("鍐呴儴寰�鏉ユ敹娆惧崟锛屽鎴峰悕绉帮細{},瀹㈡埛绫诲瀷锛歿},涓嶇敤淇濆瓨鏀舵鍗�", custInfoVo.getCustName(), custInfoVo.getCustclass());
+			return R.failed("鍐呴儴寰�鏉ユ敹娆惧崟,涓嶇敤鎺ㄩ�丅IP");
+		}
+
 		return pushSaveCollection(statement, item);
 	}
+
+	@Override
+	public R pullBankData(SyncPaymentRecepitDTO queryDTO) {
+		if (StrUtil.isBlank(queryDTO.getStartDate())||StrUtil.isBlank(queryDTO.getEndDate())){
+			return R.failed("璇烽�夋嫨浜ゆ槗鏃堕棿鑼冨洿");
+		}
+		if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) ||
+				StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) {
+			queryDTO.setBipCode("10860");
+		}
+		if ( StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) ) {
+			queryDTO.setBipCode("1086005");
+		}
+		if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)) {
+			queryDTO.setBipCode("10860");
+		}
+		if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", sgb)) {
+			queryDTO.setBipCode("10802 ");
+		}
+		if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", ymj)) {
+			queryDTO.setBipCode("10668");
+		}
+		if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", tfgs)) {
+			queryDTO.setBipCode("10861");
+		}
+		if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", jxc)) {
+			queryDTO.setBipCode("10801");
+		}
+		return paymentConfirmService.syncPaymentRecepit(queryDTO);
+	}
+
+	@Override
+	public R updById(Long id) {
+		BankStatement statement = baseMapper.selectById(id);
+		if (ObjUtil.isNull(statement)){
+			return R.failed("娴佹按鏁版嵁寮傚父");
+		}
+
+
+
+		if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) {
+			List<String> smjList = new ArrayList<>();
+			smjList.add(smj);
+			smjList.add(smjhw);
+			BusinessCustomer customer = businessCustomerMapper.selectOne(Wrappers.<BusinessCustomer>lambdaQuery()
+					.eq(BusinessCustomer::getCompanyName,statement.getPayBankAccName())
+					.in(BusinessCustomer::getCompId,smjList)
+					.last("limit 1"));
+			if (ObjUtil.isNull(customer)){
+				return R.failed("瀹㈡埛淇℃伅鏌ヨ澶辫触");
+			}
+			statement.setBusGuestId(customer.getId());
+			baseMapper.updateById(statement);
+			return R.ok();
+		}
+		BusinessCustomer customer = businessCustomerMapper.selectOne(Wrappers.<BusinessCustomer>lambdaQuery()
+				.eq(BusinessCustomer::getCompanyName,statement.getPayBankAccName())
+				.eq(BusinessCustomer::getCompId,SecurityUtils.getUser().getCompId())
+				.last("limit 1"));
+		if (ObjUtil.isNull(customer)){
+			return R.failed("瀹㈡埛淇℃伅鏌ヨ澶辫触");
+		}
+		statement.setBusGuestId(customer.getId());
+		baseMapper.updateById(statement);
+		return R.ok();
+	}
 }
\ No newline at end of file

--
Gitblit v1.9.1