Browse Source

增加设置启用b2b对账功能

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@7353 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
hejq 9 years ago
parent
commit
ee84f8b46f

+ 26 - 1
src/main/java/com/uas/platform/b2b/erp/controller/VendorRateController.java

@@ -36,7 +36,7 @@ public class VendorRateController {
 	 */
 	 */
 	@RequestMapping(value = "/rate", method = RequestMethod.POST)
 	@RequestMapping(value = "/rate", method = RequestMethod.POST)
 	@ResponseBody
 	@ResponseBody
-	public void onApCheckSuccess(@RequestParam("data") String data) throws UnsupportedEncodingException {
+	public void uploadVendorRate(@RequestParam("data") String data) throws UnsupportedEncodingException {
 		String jsonStr = URLDecoder.decode(data, "UTF-8");
 		String jsonStr = URLDecoder.decode(data, "UTF-8");
 		List<VendorRate> rates = JSONArray.parseArray(jsonStr, VendorRate.class);
 		List<VendorRate> rates = JSONArray.parseArray(jsonStr, VendorRate.class);
 		logger.log("供应商", "更改供应商税率", rates.size());
 		logger.log("供应商", "更改供应商税率", rates.size());
@@ -58,4 +58,29 @@ public class VendorRateController {
 			}
 			}
 		}
 		}
 	}
 	}
+
+	/**
+	 * 判断是否启用b2b对账功能
+	 * 
+	 * @param data
+	 * @throws UnsupportedEncodingException
+	 */
+	@RequestMapping(value = "/apcheck", method = RequestMethod.POST)
+	@ResponseBody
+	public void uploadB2BApcheck(@RequestParam("data") String data) throws UnsupportedEncodingException {
+		String jsonStr = URLDecoder.decode(data, "UTF-8");
+		List<VendorRate> rates = JSONArray.parseArray(jsonStr, VendorRate.class);
+		logger.log("供应商资料", "设置是否启用平台对账功能", rates.size());
+		if (!CollectionUtils.isEmpty(rates)) {
+			for (VendorRate rate : rates) {
+				List<Vendor> vendors = vendorDao.findByMyEnUUAndVendUU(rate.getCustuu(), rate.getVenduu());
+				if (!CollectionUtils.isEmpty(vendors)) {
+					for (Vendor vendor : vendors) {
+						vendor.setApcheck(rate.getApcheck());
+						vendorDao.save(vendor);
+					}
+				}
+			}
+		}
+	}
 }
 }