|
|
@@ -2,12 +2,14 @@ package com.uas.platform.b2b.erp.controller;
|
|
|
|
|
|
import com.alibaba.dubbo.common.utils.CollectionUtils;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.uas.platform.b2b.erp.model.SaleTenderErp;
|
|
|
import com.uas.platform.b2b.erp.service.TenderService;
|
|
|
import com.uas.platform.b2b.model.*;
|
|
|
import com.uas.platform.b2b.search.SearchService;
|
|
|
-import com.uas.platform.b2b.service.AttachService;
|
|
|
import com.uas.platform.b2b.service.UserService;
|
|
|
+import com.uas.platform.b2b.service.VendorService;
|
|
|
import com.uas.platform.b2b.support.SystemSession;
|
|
|
+import com.uas.platform.b2b.temporary.model.TenderContactInfo;
|
|
|
import com.uas.platform.core.model.Constant;
|
|
|
import com.uas.platform.core.model.PageParams;
|
|
|
import com.uas.platform.core.util.serializer.FlexJsonUtils;
|
|
|
@@ -48,7 +50,7 @@ public class TenderController {
|
|
|
private UserService userService;
|
|
|
|
|
|
@Autowired
|
|
|
- private AttachService attachService;
|
|
|
+ private VendorService vendorService;
|
|
|
|
|
|
/**
|
|
|
* 作为采购方,发布招标单
|
|
|
@@ -58,44 +60,61 @@ public class TenderController {
|
|
|
@RequestMapping(value = "/publish", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
@Transactional
|
|
|
- public ModelMap publishTender(String tender, String vendorUUs) throws UnsupportedEncodingException {
|
|
|
+ public ModelMap publishTender(String tender, String enInfos, String attaches) throws UnsupportedEncodingException {
|
|
|
tender = URLDecoder.decode(tender, "UTF-8");
|
|
|
PurchaseTender purchaseTender = FlexJsonUtils.fromJson(tender, PurchaseTender.class);
|
|
|
- if (purchaseTender.getIfOpen() == Constant.YES) {
|
|
|
- return tenderService.publishOpen(purchaseTender);
|
|
|
+ if (null != enInfos) {
|
|
|
+ enInfos = URLDecoder.decode(enInfos, "UTF-8");
|
|
|
+ List<TenderContactInfo> contactInfos = FlexJsonUtils.fromJsonArray(enInfos, TenderContactInfo.class);
|
|
|
+ if (null != attaches) {
|
|
|
+ attaches = URLDecoder.decode(attaches, "UTF-8");
|
|
|
+ List<Attach> tenderAttaches = FlexJsonUtils.fromJsonArray(attaches, Attach.class);
|
|
|
+ return tenderService.publishOrSave(purchaseTender, contactInfos, tenderAttaches);
|
|
|
+ } else {
|
|
|
+ return tenderService.publishOrSave(purchaseTender, contactInfos, null);
|
|
|
+ }
|
|
|
+
|
|
|
} else {
|
|
|
- if (null != vendorUUs) {
|
|
|
- vendorUUs = URLDecoder.decode(vendorUUs, "UTF-8");
|
|
|
- List<Long> vendUUs = FlexJsonUtils.fromJsonArray(vendorUUs, Long.class);
|
|
|
- return tenderService.publish(purchaseTender, vendUUs);
|
|
|
+ if (null != attaches) {
|
|
|
+ attaches = URLDecoder.decode(attaches, "UTF-8");
|
|
|
+ List<Attach> tenderAttaches = FlexJsonUtils.fromJsonArray(attaches, Attach.class);
|
|
|
+ return tenderService.publishOrSave(purchaseTender, null, tenderAttaches);
|
|
|
+ } else {
|
|
|
+ return tenderService.publishOrSave(purchaseTender, null, null);
|
|
|
}
|
|
|
}
|
|
|
- ModelMap map = new ModelMap();
|
|
|
- map.put("success", false);
|
|
|
- return map;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 作为采购方,保存招标单
|
|
|
*
|
|
|
* @param tender 招标单
|
|
|
- * @param vendorUUs 所选供应商uu
|
|
|
+ * @param enInfos 所选供应商uu
|
|
|
*/
|
|
|
@RequestMapping(value = "/save", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
@Transactional
|
|
|
- public ModelMap saveTender(String tender, String vendorUUs) throws UnsupportedEncodingException {
|
|
|
+ public ModelMap saveTender(String tender, String enInfos, String attaches) throws UnsupportedEncodingException {
|
|
|
tender = URLDecoder.decode(tender, "UTF-8");
|
|
|
PurchaseTender purchaseTender = FlexJsonUtils.fromJson(tender, PurchaseTender.class);
|
|
|
- if (purchaseTender.getIfOpen() == Constant.YES) {
|
|
|
- return tenderService.saveOpen(purchaseTender);
|
|
|
+ if (null != enInfos) {
|
|
|
+ enInfos = URLDecoder.decode(enInfos, "UTF-8");
|
|
|
+ List<TenderContactInfo> contactInfos = FlexJsonUtils.fromJsonArray(enInfos, TenderContactInfo.class);
|
|
|
+ if (null != attaches) {
|
|
|
+ attaches = URLDecoder.decode(attaches, "UTF-8");
|
|
|
+ List<Attach> saleTenderAttaches = FlexJsonUtils.fromJsonArray(attaches, Attach.class);
|
|
|
+ tenderService.publishOrSave(purchaseTender, contactInfos, saleTenderAttaches);
|
|
|
+ } else {
|
|
|
+ tenderService.publishOrSave(purchaseTender, contactInfos, null);
|
|
|
+ }
|
|
|
+
|
|
|
} else {
|
|
|
- if (null != vendorUUs) {
|
|
|
- vendorUUs = URLDecoder.decode(vendorUUs, "UTF-8");
|
|
|
-// vendorUUs = "[".concat(vendorUUs);
|
|
|
-// vendorUUs = vendorUUs.concat("]");
|
|
|
- List<Long> vendUUs = FlexJsonUtils.fromJsonArray(vendorUUs, Long.class);
|
|
|
- return tenderService.save(purchaseTender, vendUUs);
|
|
|
+ if (null != attaches) {
|
|
|
+ attaches = URLDecoder.decode(attaches, "UTF-8");
|
|
|
+ List<Attach> saleTenderAttaches = FlexJsonUtils.fromJsonArray(attaches, Attach.class);
|
|
|
+ tenderService.publishOrSave(purchaseTender, null, saleTenderAttaches);
|
|
|
+ } else {
|
|
|
+ tenderService.publishOrSave(purchaseTender, null, null);
|
|
|
}
|
|
|
}
|
|
|
ModelMap map = new ModelMap();
|
|
|
@@ -148,6 +167,16 @@ public class TenderController {
|
|
|
return searchService.searchVendorIds(keyword, pageParams);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取供应商联系人
|
|
|
+ * @param venduu 供应商UU
|
|
|
+ *
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/contacts", method = RequestMethod.GET)
|
|
|
+ private List<VendorContact> getContacts(Long venduu) {
|
|
|
+ return vendorService.getContacts(venduu);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 查看招标单详情
|
|
|
*
|
|
|
@@ -188,14 +217,14 @@ public class TenderController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 作为供应商,查看收到的招标单(全部)
|
|
|
+ * 作为供应商,查看收到的投标单(全部)
|
|
|
*
|
|
|
* @param params 分页参数
|
|
|
* @return Spage
|
|
|
*/
|
|
|
@RequestMapping(method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- public SPage<PurchaseTender> getAllTenders(PageParams params, String searchFilter) {
|
|
|
+ public SPage<SaleTenderErp> getAllTenders(PageParams params, String searchFilter) {
|
|
|
JSONObject jsonObject = JSONObject.parseObject(searchFilter);
|
|
|
String keyword = jsonObject.getString("keyword");
|
|
|
com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
|
|
|
@@ -205,23 +234,24 @@ public class TenderController {
|
|
|
return null;
|
|
|
}
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
- sortList.add(new Sort("pt_id", false, Sort.Type.LONG, 1L));
|
|
|
+ sortList.add(new Sort("st_id", false, Sort.Type.LONG, 1L));
|
|
|
pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
- pageParams.getFilters().put("pt_ispublish", Constant.YES);
|
|
|
-// pageParams.getFilters().put("pt_ifopen", Constant.NO); // 现在公开的也在这个列表
|
|
|
- pageParams.getFilters().put("tp_ptid", SystemSession.getUser().getEnterprise().getEnName());
|
|
|
- return searchService.erpSearchPurcTenderIds(keyword, pageParams);
|
|
|
+ HashMap<String, Object> map = new HashMap<>();
|
|
|
+ map.put("st_auditstatus", Constant.YES); // 非已提交状态
|
|
|
+ pageParams.setNotEqualFilters(map);
|
|
|
+ pageParams.getFilters().put("st_venduu", SystemSession.getUser().getEnterprise().getUu()); // 投标单属于本企业
|
|
|
+ return searchService.erpSearchSaleTenderIds(keyword, pageParams);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 作为供应商,查看收到的招标单(已结标)
|
|
|
+ * 作为供应商,查看收到的投标单(已结标)
|
|
|
*
|
|
|
* @param params 分页参数
|
|
|
* @return Sapge
|
|
|
*/
|
|
|
- @RequestMapping(params = RequestState.DONE, method = RequestMethod.GET)
|
|
|
+ @RequestMapping(params = RequestState.END, method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- public SPage<PurchaseTender> getDoneTenders(PageParams params, String searchFilter) {
|
|
|
+ public SPage<SaleTenderErp> getDoneTenders(PageParams params, String searchFilter) {
|
|
|
JSONObject jsonObject = JSONObject.parseObject(searchFilter);
|
|
|
String keyword = jsonObject.getString("keyword");
|
|
|
com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
|
|
|
@@ -231,23 +261,25 @@ public class TenderController {
|
|
|
return null;
|
|
|
}
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
- sortList.add(new Sort("pt_id", false, Sort.Type.LONG, 1L));
|
|
|
+ sortList.add(new Sort("st_id", false, Sort.Type.LONG, 1L));
|
|
|
pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
- pageParams.getFilters().put("tp_ptid", SystemSession.getUser().getEnterprise().getEnName());
|
|
|
- pageParams.getFilters().put("pt_ispublish", Constant.YES);
|
|
|
- pageParams.getFilters().put("pt_result", Constant.YES);
|
|
|
- return searchService.erpSearchPurcTenderIds(keyword, pageParams);
|
|
|
+ HashMap<String, Object> map = new HashMap<>();
|
|
|
+ map.put("st_auditstatus", Constant.YES); // 非已提交状态
|
|
|
+ pageParams.setNotEqualFilters(map);
|
|
|
+ pageParams.getFilters().put("st_venduu", SystemSession.getUser().getEnterprise().getUu()); // 投标单属于本企业
|
|
|
+ pageParams.getFilters().put("st_status", "已结标");
|
|
|
+ return searchService.erpSearchSaleTenderIds(keyword, pageParams);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 作为供应商,查看收到的招标单(待评标)
|
|
|
+ * 作为供应商,查看收到的投标单(已投标)
|
|
|
*
|
|
|
* @param params 分页参数
|
|
|
* @return 招标单Spage
|
|
|
*/
|
|
|
- @RequestMapping(params = RequestState.WAITING, method = RequestMethod.GET)
|
|
|
+ @RequestMapping(params = RequestState.DONE, method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- public SPage<PurchaseTender> getWaitingTenders(PageParams params, String searchFilter) {
|
|
|
+ public SPage<SaleTenderErp> getWaitingTenders(PageParams params, String searchFilter) {
|
|
|
JSONObject jsonObject = JSONObject.parseObject(searchFilter);
|
|
|
String keyword = jsonObject.getString("keyword");
|
|
|
com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
|
|
|
@@ -257,27 +289,26 @@ public class TenderController {
|
|
|
return null;
|
|
|
}
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
- sortList.add(new Sort("pt_id", false, Sort.Type.LONG, 1L));
|
|
|
+ sortList.add(new Sort("st_id", false, Sort.Type.LONG, 1L));
|
|
|
pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
- pageParams.getFilters().put("tp_ptid", SystemSession.getUser().getEnterprise().getEnName());
|
|
|
- pageParams.getFilters().put("pt_ispublish", Constant.YES);
|
|
|
-// pageParams.getFilters().put("pt_ifopen", Constant.NO);
|
|
|
- pageParams.getFilters().put("pt_overdue", Constant.YES);
|
|
|
- pageParams.getFilters().put("pt_result", Constant.NO);
|
|
|
- pageParams.getFilters().put("pt_status", "待评标");
|
|
|
- return searchService.erpSearchPurcTenderIds(keyword, pageParams);
|
|
|
+ HashMap<String, Object> map = new HashMap<>();
|
|
|
+ map.put("st_auditstatus", Constant.YES); // 非已提交状态
|
|
|
+ pageParams.setNotEqualFilters(map);
|
|
|
+ pageParams.getFilters().put("st_venduu", SystemSession.getUser().getEnterprise().getUu()); // 投标单属于本企业
|
|
|
+ pageParams.getFilters().put("st_status", "已投标");
|
|
|
+ return searchService.erpSearchSaleTenderIds(keyword, pageParams);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 作为供应商,查看收到的招标单(待投标)
|
|
|
+ * 作为供应商,查看收到的投标单(待投标)
|
|
|
*
|
|
|
* @param params 分页参数
|
|
|
* @return 招标单Spage
|
|
|
*/
|
|
|
@RequestMapping(params = RequestState.TODO, method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- public SPage<PurchaseTender> getTodoTenders(PageParams params, String searchFilter) {
|
|
|
+ public SPage<SaleTenderErp> getTodoTenders(PageParams params, String searchFilter) {
|
|
|
JSONObject jsonObject = JSONObject.parseObject(searchFilter);
|
|
|
String keyword = jsonObject.getString("keyword");
|
|
|
com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
|
|
|
@@ -287,43 +318,44 @@ public class TenderController {
|
|
|
return null;
|
|
|
}
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
- sortList.add(new Sort("pt_id", false, Sort.Type.LONG, 1L));
|
|
|
+ sortList.add(new Sort("st_id", false, Sort.Type.LONG, 1L));
|
|
|
pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
- pageParams.getFilters().put("tp_ptid", SystemSession.getUser().getEnterprise().getEnName());
|
|
|
- pageParams.getFilters().put("pt_ispublish", Constant.YES);
|
|
|
-// pageParams.getFilters().put("pt_ifopen", Constant.NO);
|
|
|
- pageParams.getFilters().put("pt_overdue", Constant.NO);
|
|
|
- return searchService.erpSearchPurcTenderIds(keyword, pageParams);
|
|
|
+ HashMap<String, Object> map = new HashMap<>();
|
|
|
+ map.put("st_auditstatus", Constant.YES); // 非已提交状态
|
|
|
+ pageParams.setNotEqualFilters(map);
|
|
|
+ pageParams.getFilters().put("st_venduu", SystemSession.getUser().getEnterprise().getUu()); // 投标单属于本企业
|
|
|
+ pageParams.getFilters().put("st_status", "待投标");
|
|
|
+ return searchService.erpSearchSaleTenderIds(keyword, pageParams);
|
|
|
}
|
|
|
|
|
|
|
|
|
- /**
|
|
|
- * 作为供应商,查看收到的招标单(过期)
|
|
|
- *
|
|
|
- * @param params 分页参数
|
|
|
- * @return 招标单Spage
|
|
|
- */
|
|
|
- @RequestMapping(params = RequestState.END, method = RequestMethod.GET)
|
|
|
- @ResponseBody
|
|
|
- public SPage<PurchaseTender> getEndTenders(PageParams params, String searchFilter) {
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(searchFilter);
|
|
|
- String keyword = jsonObject.getString("keyword");
|
|
|
- com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
|
|
|
- // 判断当前用户是否被客户分配
|
|
|
- SearchFilter filter = userService.distribute();
|
|
|
- if (filter != null && filter.getDistribute() == null) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- List<Sort> sortList = new ArrayList<>();
|
|
|
- sortList.add(new Sort("pt_id", false, Sort.Type.LONG, 1L));
|
|
|
- pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
- pageParams.getFilters().put("tp_ptid", SystemSession.getUser().getEnterprise().getEnName());
|
|
|
- pageParams.getFilters().put("pt_ispublish", Constant.YES);
|
|
|
-// pageParams.getFilters().put("pt_ifopen", Constant.NO);
|
|
|
- pageParams.getFilters().put("pt_status", "待投标");
|
|
|
- pageParams.getFilters().put("pt_overdue", Constant.YES);
|
|
|
- return searchService.erpSearchPurcTenderIds(keyword, pageParams);
|
|
|
- }
|
|
|
+// /**
|
|
|
+// * 作为供应商,查看收到的投标单(过期)
|
|
|
+// *
|
|
|
+// * @param params 分页参数
|
|
|
+// * @return 招标单Spage
|
|
|
+// */
|
|
|
+// @RequestMapping(params = RequestState.END, method = RequestMethod.GET)
|
|
|
+// @ResponseBody
|
|
|
+// public SPage<PurchaseTender> getEndTenders(PageParams params, String searchFilter) {
|
|
|
+// JSONObject jsonObject = JSONObject.parseObject(searchFilter);
|
|
|
+// String keyword = jsonObject.getString("keyword");
|
|
|
+// com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
|
|
|
+// // 判断当前用户是否被客户分配
|
|
|
+// SearchFilter filter = userService.distribute();
|
|
|
+// if (filter != null && filter.getDistribute() == null) {
|
|
|
+// return null;
|
|
|
+// }
|
|
|
+// List<Sort> sortList = new ArrayList<>();
|
|
|
+// sortList.add(new Sort("pt_id", false, Sort.Type.LONG, 1L));
|
|
|
+// pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
+// pageParams.getFilters().put("tp_ptid", SystemSession.getUser().getEnterprise().getEnName());
|
|
|
+// pageParams.getFilters().put("pt_ispublish", Constant.YES);
|
|
|
+//// pageParams.getFilters().put("pt_ifopen", Constant.NO);
|
|
|
+// pageParams.getFilters().put("pt_status", "待投标");
|
|
|
+// pageParams.getFilters().put("pt_overdue", Constant.YES);
|
|
|
+// return searchService.erpSearchPurcTenderIds(keyword, pageParams);
|
|
|
+// }
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -391,7 +423,7 @@ public class TenderController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 作为采购方,查看发出的招标单(待评标)
|
|
|
+ * 作为采购方,查看发出的招标单(已结标)
|
|
|
*
|
|
|
* @param params 分页参数
|
|
|
* @return 招标单分页
|
|
|
@@ -399,6 +431,65 @@ public class TenderController {
|
|
|
@RequestMapping(value = "/purc",params = RequestState.DONE, method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
public SPage<PurchaseTender> getMyDoneTenders(PageParams params, String searchFilter) {
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(searchFilter);
|
|
|
+ String keyword = jsonObject.getString("keyword");
|
|
|
+ com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
|
|
|
+ // 当前登录企业作为客户
|
|
|
+ SearchFilter filter = userService.distribute();
|
|
|
+ if (filter != null && filter.getDistribute() == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ buildFilter(filter, pageParams);
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("pt_id", false, Sort.Type.LONG, 1L));
|
|
|
+ pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
+ pageParams.getFilters().put("pt_enuu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
+ pageParams.getFilters().put("pt_ispublish", Constant.YES);
|
|
|
+ pageParams.getFilters().put("pt_status", "已结标");
|
|
|
+ pageParams.getFilters().put("pt_overdue", Constant.YES);
|
|
|
+ pageParams.getFilters().put("pt_result", Constant.YES);
|
|
|
+ return searchService.erpSearchPurcTenderIds(keyword, pageParams);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 作为采购方,查看发出的招标单(流标)
|
|
|
+ *
|
|
|
+ * @param params 分页参数
|
|
|
+ * @return 招标单分页
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/purc",params = RequestState.END, method = RequestMethod.GET)
|
|
|
+ @ResponseBody
|
|
|
+ public SPage<PurchaseTender> getMyEndTenders(PageParams params, String searchFilter) {
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(searchFilter);
|
|
|
+ String keyword = jsonObject.getString("keyword");
|
|
|
+ com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
|
|
|
+ // 当前登录企业作为客户
|
|
|
+ SearchFilter filter = userService.distribute();
|
|
|
+ if (filter != null && filter.getDistribute() == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ buildFilter(filter, pageParams);
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("pt_id", false, Sort.Type.LONG, 1L));
|
|
|
+ pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
+ pageParams.getFilters().put("pt_enuu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
+ pageParams.getFilters().put("pt_ispublish", Constant.YES);
|
|
|
+ pageParams.getFilters().put("pt_status", "流标");
|
|
|
+ pageParams.getFilters().put("pt_overdue", Constant.YES);
|
|
|
+ pageParams.getFilters().put("pt_result", Constant.YES);
|
|
|
+ return searchService.erpSearchPurcTenderIds(keyword, pageParams);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 作为采购方,查看发出的招标单(待评标)
|
|
|
+ *
|
|
|
+ * @param params 分页参数
|
|
|
+ * @return 招标单分页
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/purc",params = "_state=tobid", method = RequestMethod.GET)
|
|
|
+ @ResponseBody
|
|
|
+ public SPage<PurchaseTender> getMyWaitingTenders(PageParams params, String searchFilter) {
|
|
|
JSONObject jsonObject = JSONObject.parseObject(searchFilter);
|
|
|
String keyword = jsonObject.getString("keyword");
|
|
|
com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
|
|
|
@@ -529,20 +620,35 @@ public class TenderController {
|
|
|
@RequestMapping(value = "/publishSaved", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
@Transactional
|
|
|
- public ModelMap publishSavedTender(String tender, String vendorUUs) throws UnsupportedEncodingException {
|
|
|
+ public ModelMap publishSavedTender(String tender, String enInfos, String attaches) throws UnsupportedEncodingException {
|
|
|
tender = URLDecoder.decode(tender, "UTF-8");
|
|
|
PurchaseTender purchaseTender = FlexJsonUtils.fromJson(tender, PurchaseTender.class);
|
|
|
- if (purchaseTender.getIfOpen() == Constant.YES) {
|
|
|
+ if (purchaseTender.getIfOpen() == Constant.YES) { // 开放时进另外的方法
|
|
|
+ if (null != attaches) {
|
|
|
+ attaches = URLDecoder.decode(attaches, "UTF-8");
|
|
|
+ List<Attach> attachList = FlexJsonUtils.fromJsonArray(attaches, Attach.class);
|
|
|
+ return tenderService.publishSavedOpen(purchaseTender, attachList);
|
|
|
+ }
|
|
|
return tenderService.publishSavedOpen(purchaseTender);
|
|
|
} else {
|
|
|
- if (null != vendorUUs) {
|
|
|
- vendorUUs = URLDecoder.decode(vendorUUs, "UTF-8");
|
|
|
- vendorUUs = "[".concat(vendorUUs);
|
|
|
- vendorUUs = vendorUUs.concat("]");
|
|
|
- List<Long> vendUUs = FlexJsonUtils.fromJsonArray(vendorUUs, Long.class);
|
|
|
- return tenderService.publishSaved(purchaseTender, vendUUs);
|
|
|
+ if (null != enInfos) {
|
|
|
+ enInfos = URLDecoder.decode(enInfos, "UTF-8");
|
|
|
+ List<TenderContactInfo> contactInfos = FlexJsonUtils.fromJsonArray(enInfos, TenderContactInfo.class);
|
|
|
+ if (null != attaches) {
|
|
|
+ attaches = URLDecoder.decode(attaches, "UTF-8");
|
|
|
+ List<Attach> attachList = FlexJsonUtils.fromJsonArray(attaches, Attach.class);
|
|
|
+ return tenderService.publishSaved(purchaseTender, contactInfos, attachList);
|
|
|
+ } else {
|
|
|
+ return tenderService.publishSaved(purchaseTender, contactInfos);
|
|
|
+ }
|
|
|
} else {
|
|
|
- return tenderService.publishSaved(purchaseTender, null);
|
|
|
+ if (null != attaches) {
|
|
|
+ attaches = URLDecoder.decode(attaches, "UTF-8");
|
|
|
+ List<Attach> attachList = FlexJsonUtils.fromJsonArray(attaches, Attach.class);
|
|
|
+ return tenderService.publishSaved(purchaseTender, null, attachList);
|
|
|
+ } else {
|
|
|
+ return tenderService.publishSaved(purchaseTender, null);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -551,25 +657,40 @@ public class TenderController {
|
|
|
* 更新在录入单据
|
|
|
*
|
|
|
* @param tender 招标单
|
|
|
- * @param vendorUUs 供应商uu
|
|
|
+ * @param enInfos 供应商uu
|
|
|
*/
|
|
|
@RequestMapping(value = "/updateSaved", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
@Transactional
|
|
|
- public ModelMap updateSavedTender(String tender, String vendorUUs) throws UnsupportedEncodingException {
|
|
|
+ public ModelMap updateSavedTender(String tender, String enInfos, String attaches) throws UnsupportedEncodingException {
|
|
|
tender = URLDecoder.decode(tender, "UTF-8");
|
|
|
PurchaseTender purchaseTender = FlexJsonUtils.fromJson(tender, PurchaseTender.class);
|
|
|
if (purchaseTender.getIfOpen() == Constant.YES) { // 开放时进另外的方法
|
|
|
+ if (null != attaches) {
|
|
|
+ attaches = URLDecoder.decode(attaches, "UTF-8");
|
|
|
+ List<Attach> attachList = FlexJsonUtils.fromJsonArray(attaches, Attach.class);
|
|
|
+ return tenderService.updateSavedOpen(purchaseTender, attachList);
|
|
|
+ }
|
|
|
return tenderService.updateSavedOpen(purchaseTender);
|
|
|
} else {
|
|
|
- if (null != vendorUUs) {
|
|
|
- vendorUUs = URLDecoder.decode(vendorUUs, "UTF-8");
|
|
|
- vendorUUs = "[".concat(vendorUUs);
|
|
|
- vendorUUs = vendorUUs.concat("]");
|
|
|
- List<Long> vendUUs = FlexJsonUtils.fromJsonArray(vendorUUs, Long.class);
|
|
|
- return tenderService.updateSaved(purchaseTender, vendUUs);
|
|
|
+ if (null != enInfos) {
|
|
|
+ enInfos = URLDecoder.decode(enInfos, "UTF-8");
|
|
|
+ List<TenderContactInfo> contactInfos = FlexJsonUtils.fromJsonArray(enInfos, TenderContactInfo.class);
|
|
|
+ if (null != attaches) {
|
|
|
+ attaches = URLDecoder.decode(attaches, "UTF-8");
|
|
|
+ List<Attach> attachList = FlexJsonUtils.fromJsonArray(attaches, Attach.class);
|
|
|
+ return tenderService.updateSaved(purchaseTender, contactInfos, attachList);
|
|
|
+ } else {
|
|
|
+ return tenderService.updateSaved(purchaseTender, contactInfos);
|
|
|
+ }
|
|
|
} else {
|
|
|
- return tenderService.updateSaved(purchaseTender, null);
|
|
|
+ if (null != attaches) {
|
|
|
+ attaches = URLDecoder.decode(attaches, "UTF-8");
|
|
|
+ List<Attach> attachList = FlexJsonUtils.fromJsonArray(attaches, Attach.class);
|
|
|
+ return tenderService.updateSaved(purchaseTender, null, attachList);
|
|
|
+ } else {
|
|
|
+ return tenderService.updateSaved(purchaseTender, null);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -633,8 +754,8 @@ public class TenderController {
|
|
|
* @param id 投标单id
|
|
|
*/
|
|
|
@RequestMapping(value = "/saleTender", method = RequestMethod.GET)
|
|
|
- public ModelMap getSaleTenderDetail(Long id, String venduu) {
|
|
|
- return tenderService.getSaleTenderDetail(id, Long.valueOf(venduu));
|
|
|
+ public ModelMap getSaleTenderDetail(Long id) {
|
|
|
+ return tenderService.getSaleTenderDetail(id);
|
|
|
}
|
|
|
|
|
|
}
|