|
|
@@ -1,15 +1,21 @@
|
|
|
package com.uas.platform.b2b.publicapi.controller;
|
|
|
|
|
|
+import com.uas.platform.b2b.dao.CommonDao;
|
|
|
+import com.uas.platform.b2b.erp.model.VendorInfo;
|
|
|
import com.uas.platform.b2b.publicapi.service.ApCheckApiService;
|
|
|
+import com.uas.platform.b2b.service.PurchaseApCheckService;
|
|
|
import com.uas.platform.b2b.task.ApCheckTask;
|
|
|
import org.apache.log4j.Logger;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.ui.ModelMap;
|
|
|
+import org.springframework.util.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
/**
|
|
|
* 对账单 API
|
|
|
*
|
|
|
@@ -26,6 +32,12 @@ public class ApCheckApiController {
|
|
|
@Autowired
|
|
|
ApCheckTask apCheckTask;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private CommonDao commonDao;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private PurchaseApCheckService apCheckService;
|
|
|
+
|
|
|
/**
|
|
|
* 日志
|
|
|
*/
|
|
|
@@ -79,9 +91,14 @@ public class ApCheckApiController {
|
|
|
* @return 执行时间
|
|
|
*/
|
|
|
@RequestMapping(value = "/updateApCheck", method = RequestMethod.GET)
|
|
|
- public String updateApCheck() {
|
|
|
+ public String updateApCheck(String enUU) {
|
|
|
Long start = System.currentTimeMillis();
|
|
|
- apCheckTask.updateCount();
|
|
|
+ if (StringUtils.isEmpty(enUU)) {
|
|
|
+ apCheckTask.updateCount();
|
|
|
+ } else {
|
|
|
+ List<VendorInfo> vendorList = commonDao.query("select ve_id id,ve_myenuu custuu,ve_vendenuu venduu from `purc$vendors` where ve_vendenuu in (?) or ve_myenuu in (?)", VendorInfo.class, enUU, enUU);
|
|
|
+ apCheckService.updateCheckByVendorInfo(vendorList);
|
|
|
+ }
|
|
|
return "cost: " + (System.currentTimeMillis() - start);
|
|
|
}
|
|
|
}
|