|
@@ -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);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|