|
|
@@ -5,7 +5,6 @@ import java.io.InputStream;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
import org.apache.poi.ss.usermodel.Workbook;
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
@@ -24,6 +23,7 @@ import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
import com.alibaba.dubbo.common.utils.CollectionUtils;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.uas.platform.b2b.model.DeputyEnterprise;
|
|
|
import com.uas.platform.b2b.model.DeputyHisVendors;
|
|
|
import com.uas.platform.b2b.model.DeputyLastOrderKeywords;
|
|
|
@@ -43,6 +43,7 @@ import com.uas.platform.b2b.support.UsageBufferedLogger;
|
|
|
import com.uas.platform.core.exception.IllegalOperatorException;
|
|
|
import com.uas.platform.core.logging.BufferedLoggerManager;
|
|
|
import com.uas.platform.core.model.PageParams;
|
|
|
+import com.uas.platform.core.model.Status;
|
|
|
import com.uas.platform.core.web.bind.RequestState;
|
|
|
import com.uas.search.b2b.model.MultiValue;
|
|
|
import com.uas.search.b2b.model.SPage;
|
|
|
@@ -258,6 +259,72 @@ public class DeputyOrderController {
|
|
|
return searchService.searchDeputyOrderCheckIds(keyword, pageParams);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 买家查看代采订单(已下载,审核同意)
|
|
|
+ *
|
|
|
+ * @param params
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/getDeOrder", params = RequestState.AGREED, method = RequestMethod.GET)
|
|
|
+ public SPage<DeputyOrder> getDeOrderAgreed(PageParams params, String keyword) {
|
|
|
+ logger.log("客户代采订单", "查看代采订单(审核同意)");
|
|
|
+ com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
|
|
|
+ // 当前登录企业作为供应商
|
|
|
+ pageParams.getFilters().put("deo_enuu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
+ SearchFilter filter = userService.distribute();
|
|
|
+ if (filter != null && filter.getDistribute() == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ if (filter != null && !CollectionUtils.isEmpty(filter.getDistribute())) {
|
|
|
+ List<Object> list = new ArrayList<>();
|
|
|
+ for (Object object : filter.getDistribute()) {
|
|
|
+ list.add(object);
|
|
|
+ }
|
|
|
+ pageParams.getFilters().put("deo_enuu", new MultiValue(list, true));
|
|
|
+ }
|
|
|
+ pageParams.getFilters().put("deo_entrystatus", "已提交");
|
|
|
+ pageParams.getFilters().put("deo_downloadstatus", "已下载");
|
|
|
+ pageParams.getFilters().put("deo_statuscode", Status.AGREED.value());
|
|
|
+ // 排序条件
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("deo_id", false, Type.LONG, new Long(1)));
|
|
|
+ pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
+ return searchService.searchDeputyOrderCheckIds(keyword, pageParams);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 买家查看代采订单(已下载,审核同意)
|
|
|
+ *
|
|
|
+ * @param params
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/getDeOrder", params = RequestState.REFUSED, method = RequestMethod.GET)
|
|
|
+ public SPage<DeputyOrder> getDeOrderRefused(PageParams params, String keyword) {
|
|
|
+ logger.log("客户代采订单", "查看代采订单(审核不同意)");
|
|
|
+ com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
|
|
|
+ // 当前登录企业作为供应商
|
|
|
+ pageParams.getFilters().put("deo_enuu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
+ SearchFilter filter = userService.distribute();
|
|
|
+ if (filter != null && filter.getDistribute() == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ if (filter != null && !CollectionUtils.isEmpty(filter.getDistribute())) {
|
|
|
+ List<Object> list = new ArrayList<>();
|
|
|
+ for (Object object : filter.getDistribute()) {
|
|
|
+ list.add(object);
|
|
|
+ }
|
|
|
+ pageParams.getFilters().put("deo_enuu", new MultiValue(list, true));
|
|
|
+ }
|
|
|
+ pageParams.getFilters().put("deo_entrystatus", "已提交");
|
|
|
+ pageParams.getFilters().put("deo_downloadstatus", "已下载");
|
|
|
+ pageParams.getFilters().put("deo_statuscode", Status.NOTAGREED.value());
|
|
|
+ // 排序条件
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("deo_id", false, Type.LONG, new Long(1)));
|
|
|
+ pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
+ return searchService.searchDeputyOrderCheckIds(keyword, pageParams);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 查看订单详情
|
|
|
*
|
|
|
@@ -437,9 +504,21 @@ public class DeputyOrderController {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- @RequestMapping(value = "/repetitions",method = RequestMethod.GET)
|
|
|
+ @RequestMapping(value = "/repetitions", method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
public Page<DeputyOrdersLog> getRepetitions(PageParams params, String keyword) {
|
|
|
return deputyOrderService.getRepetitions(params, keyword);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 复制代采订单
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/copyorder/{id}", method = RequestMethod.POST)
|
|
|
+ @ResponseBody
|
|
|
+ public ModelMap copyOrder(@PathVariable("id") Long id) {
|
|
|
+ return deputyOrderService.copyOrder(id);
|
|
|
+ }
|
|
|
}
|