|
|
@@ -2,6 +2,7 @@ package com.uas.platform.b2b.erp.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.uas.platform.b2b.core.util.URLDecoderUtils;
|
|
|
import com.uas.platform.b2b.erp.model.SaleTenderErp;
|
|
|
import com.uas.platform.b2b.erp.service.TenderService;
|
|
|
import com.uas.platform.b2b.model.*;
|
|
|
@@ -30,7 +31,6 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import java.io.UnsupportedEncodingException;
|
|
|
-import java.net.URLDecoder;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
@@ -65,13 +65,13 @@ public class TenderController {
|
|
|
@ResponseBody
|
|
|
@Transactional
|
|
|
public ModelMap publishTender(String tender, String enInfos, String attaches) throws UnsupportedEncodingException {
|
|
|
- tender = URLDecoder.decode(tender, "UTF-8");
|
|
|
+ tender = URLDecoderUtils.decode(tender, "UTF-8");
|
|
|
PurchaseTender purchaseTender = FlexJsonUtils.fromJson(tender, PurchaseTender.class);
|
|
|
if (null != enInfos) {
|
|
|
- enInfos = URLDecoder.decode(enInfos, "UTF-8");
|
|
|
+ enInfos = URLDecoderUtils.decode(enInfos, "UTF-8");
|
|
|
List<TenderContactInfo> contactInfos = FlexJsonUtils.fromJsonArray(enInfos, TenderContactInfo.class);
|
|
|
if (null != attaches) {
|
|
|
- attaches = URLDecoder.decode(attaches, "UTF-8");
|
|
|
+ attaches = URLDecoderUtils.decode(attaches, "UTF-8");
|
|
|
List<Attach> tenderAttaches = FlexJsonUtils.fromJsonArray(attaches, Attach.class);
|
|
|
return tenderService.publishOrSave(purchaseTender, contactInfos, tenderAttaches);
|
|
|
} else {
|
|
|
@@ -80,7 +80,7 @@ public class TenderController {
|
|
|
|
|
|
} else {
|
|
|
if (null != attaches) {
|
|
|
- attaches = URLDecoder.decode(attaches, "UTF-8");
|
|
|
+ attaches = URLDecoderUtils.decode(attaches, "UTF-8");
|
|
|
List<Attach> tenderAttaches = FlexJsonUtils.fromJsonArray(attaches, Attach.class);
|
|
|
return tenderService.publishOrSave(purchaseTender, null, tenderAttaches);
|
|
|
} else {
|
|
|
@@ -99,13 +99,13 @@ public class TenderController {
|
|
|
@ResponseBody
|
|
|
@Transactional
|
|
|
public ModelMap saveTender(String tender, String enInfos, String attaches) throws UnsupportedEncodingException {
|
|
|
- tender = URLDecoder.decode(tender, "UTF-8");
|
|
|
+ tender = URLDecoderUtils.decode(tender, "UTF-8");
|
|
|
PurchaseTender purchaseTender = FlexJsonUtils.fromJson(tender, PurchaseTender.class);
|
|
|
if (null != enInfos) {
|
|
|
- enInfos = URLDecoder.decode(enInfos, "UTF-8");
|
|
|
+ enInfos = URLDecoderUtils.decode(enInfos, "UTF-8");
|
|
|
List<TenderContactInfo> contactInfos = FlexJsonUtils.fromJsonArray(enInfos, TenderContactInfo.class);
|
|
|
if (null != attaches) {
|
|
|
- attaches = URLDecoder.decode(attaches, "UTF-8");
|
|
|
+ attaches = URLDecoderUtils.decode(attaches, "UTF-8");
|
|
|
List<Attach> saleTenderAttaches = FlexJsonUtils.fromJsonArray(attaches, Attach.class);
|
|
|
return tenderService.publishOrSave(purchaseTender, contactInfos, saleTenderAttaches);
|
|
|
} else {
|
|
|
@@ -114,7 +114,7 @@ public class TenderController {
|
|
|
|
|
|
} else {
|
|
|
if (null != attaches) {
|
|
|
- attaches = URLDecoder.decode(attaches, "UTF-8");
|
|
|
+ attaches = URLDecoderUtils.decode(attaches, "UTF-8");
|
|
|
List<Attach> saleTenderAttaches = FlexJsonUtils.fromJsonArray(attaches, Attach.class);
|
|
|
return tenderService.publishOrSave(purchaseTender, null, saleTenderAttaches);
|
|
|
} else {
|
|
|
@@ -134,11 +134,11 @@ public class TenderController {
|
|
|
public ModelMap replyTender(String saleTender, String attaches) throws UnsupportedEncodingException {
|
|
|
SaleTender saleTender1 = new SaleTender();
|
|
|
if (null != saleTender && !"".equals(saleTender)) {
|
|
|
- saleTender = URLDecoder.decode(saleTender, "UTF-8");
|
|
|
+ saleTender = URLDecoderUtils.decode(saleTender, "UTF-8");
|
|
|
saleTender1 = FlexJsonUtils.fromJson(saleTender, SaleTender.class);
|
|
|
}
|
|
|
if (null != attaches && !"".equals(attaches)) {
|
|
|
- attaches = URLDecoder.decode(attaches, "UTF-8");
|
|
|
+ attaches = URLDecoderUtils.decode(attaches, "UTF-8");
|
|
|
List<Attach> saleTenderAttaches = FlexJsonUtils.fromJsonArray(attaches, Attach.class);
|
|
|
return tenderService.reply(saleTender1, saleTenderAttaches);
|
|
|
}
|
|
|
@@ -180,7 +180,7 @@ public class TenderController {
|
|
|
*/
|
|
|
@RequestMapping(value = "/addcontact", method = RequestMethod.POST)
|
|
|
public ModelMap savecontact(String contact) throws UnsupportedEncodingException {
|
|
|
- contact = URLDecoder.decode(contact, "UTF-8");
|
|
|
+ contact = URLDecoderUtils.decode(contact, "UTF-8");
|
|
|
VendorContact vendor = JSON.parseObject(contact, VendorContact.class);
|
|
|
vendorService.saveContact(vendor);
|
|
|
ModelMap map = new ModelMap();
|
|
|
@@ -223,7 +223,7 @@ public class TenderController {
|
|
|
@RequestMapping(value = "/decide", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
public ModelMap decideTender(String saleTenderItems) throws UnsupportedEncodingException {
|
|
|
- saleTenderItems = URLDecoder.decode(saleTenderItems, "UTF-8");
|
|
|
+ saleTenderItems = URLDecoderUtils.decode(saleTenderItems, "UTF-8");
|
|
|
List<SaleTenderItem> tenderItems = FlexJsonUtils.fromJsonArray(saleTenderItems, SaleTenderItem.class);
|
|
|
return tenderService.decide(tenderItems);
|
|
|
}
|
|
|
@@ -633,21 +633,21 @@ public class TenderController {
|
|
|
@ResponseBody
|
|
|
@Transactional
|
|
|
public ModelMap publishSavedTender(String tender, String enInfos, String attaches) throws UnsupportedEncodingException {
|
|
|
- tender = URLDecoder.decode(tender, "UTF-8");
|
|
|
+ tender = URLDecoderUtils.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");
|
|
|
+ attaches = URLDecoderUtils.decode(attaches, "UTF-8");
|
|
|
List<Attach> attachList = FlexJsonUtils.fromJsonArray(attaches, Attach.class);
|
|
|
return tenderService.publishSavedOpen(purchaseTender, attachList);
|
|
|
}
|
|
|
return tenderService.publishSavedOpen(purchaseTender);
|
|
|
} else {
|
|
|
if (null != enInfos) {
|
|
|
- enInfos = URLDecoder.decode(enInfos, "UTF-8");
|
|
|
+ enInfos = URLDecoderUtils.decode(enInfos, "UTF-8");
|
|
|
List<TenderContactInfo> contactInfos = FlexJsonUtils.fromJsonArray(enInfos, TenderContactInfo.class);
|
|
|
if (null != attaches) {
|
|
|
- attaches = URLDecoder.decode(attaches, "UTF-8");
|
|
|
+ attaches = URLDecoderUtils.decode(attaches, "UTF-8");
|
|
|
List<Attach> attachList = FlexJsonUtils.fromJsonArray(attaches, Attach.class);
|
|
|
return tenderService.publishSaved(purchaseTender, contactInfos, attachList);
|
|
|
} else {
|
|
|
@@ -655,7 +655,7 @@ public class TenderController {
|
|
|
}
|
|
|
} else {
|
|
|
if (null != attaches) {
|
|
|
- attaches = URLDecoder.decode(attaches, "UTF-8");
|
|
|
+ attaches = URLDecoderUtils.decode(attaches, "UTF-8");
|
|
|
List<Attach> attachList = FlexJsonUtils.fromJsonArray(attaches, Attach.class);
|
|
|
return tenderService.publishSaved(purchaseTender, null, attachList);
|
|
|
} else {
|
|
|
@@ -675,21 +675,21 @@ public class TenderController {
|
|
|
@ResponseBody
|
|
|
@Transactional
|
|
|
public ModelMap updateSavedTender(String tender, String enInfos, String attaches) throws UnsupportedEncodingException {
|
|
|
- tender = URLDecoder.decode(tender, "UTF-8");
|
|
|
+ tender = URLDecoderUtils.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");
|
|
|
+ attaches = URLDecoderUtils.decode(attaches, "UTF-8");
|
|
|
List<Attach> attachList = FlexJsonUtils.fromJsonArray(attaches, Attach.class);
|
|
|
return tenderService.updateSavedOpen(purchaseTender, attachList);
|
|
|
}
|
|
|
return tenderService.updateSavedOpen(purchaseTender);
|
|
|
} else {
|
|
|
if (null != enInfos) {
|
|
|
- enInfos = URLDecoder.decode(enInfos, "UTF-8");
|
|
|
+ enInfos = URLDecoderUtils.decode(enInfos, "UTF-8");
|
|
|
List<TenderContactInfo> contactInfos = FlexJsonUtils.fromJsonArray(enInfos, TenderContactInfo.class);
|
|
|
if (null != attaches) {
|
|
|
- attaches = URLDecoder.decode(attaches, "UTF-8");
|
|
|
+ attaches = URLDecoderUtils.decode(attaches, "UTF-8");
|
|
|
List<Attach> attachList = FlexJsonUtils.fromJsonArray(attaches, Attach.class);
|
|
|
return tenderService.updateSaved(purchaseTender, contactInfos, attachList);
|
|
|
} else {
|
|
|
@@ -697,7 +697,7 @@ public class TenderController {
|
|
|
}
|
|
|
} else {
|
|
|
if (null != attaches) {
|
|
|
- attaches = URLDecoder.decode(attaches, "UTF-8");
|
|
|
+ attaches = URLDecoderUtils.decode(attaches, "UTF-8");
|
|
|
List<Attach> attachList = FlexJsonUtils.fromJsonArray(attaches, Attach.class);
|
|
|
return tenderService.updateSaved(purchaseTender, null, attachList);
|
|
|
} else {
|
|
|
@@ -807,7 +807,7 @@ public class TenderController {
|
|
|
*/
|
|
|
@RequestMapping(value = "/decide/all", method = RequestMethod.POST)
|
|
|
public ModelMap decideTenderAll (String data) throws UnsupportedEncodingException {
|
|
|
- data = URLDecoder.decode(data, "UTF-8");
|
|
|
+ data = URLDecoderUtils.decode(data, "UTF-8");
|
|
|
List<DecideTender> decideTenders = FlexJsonUtils.fromJsonArray(data, DecideTender.class);
|
|
|
return tenderService.decideTenderAll(decideTenders);
|
|
|
}
|
|
|
@@ -842,7 +842,7 @@ public class TenderController {
|
|
|
*/
|
|
|
@RequestMapping(value = "/question/answer/save", method = RequestMethod.POST)
|
|
|
public ModelMap saveQuestionAnswer(String data) throws UnsupportedEncodingException {
|
|
|
- data = URLDecoder.decode(data, "UTF-8");
|
|
|
+ data = URLDecoderUtils.decode(data, "UTF-8");
|
|
|
PurchaseTenderAnswer answer = FlexJsonUtils.fromJson(data, PurchaseTenderAnswer.class);
|
|
|
return tenderService.saveQuestionAnswer(answer);
|
|
|
}
|