|
|
@@ -7,9 +7,8 @@ import java.util.List;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.domain.Sort.Direction;
|
|
|
-import org.springframework.http.HttpStatus;
|
|
|
-import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
+import org.springframework.ui.ModelMap;
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
@@ -26,6 +25,7 @@ import com.uas.platform.b2b.service.PurchaseNoticeService;
|
|
|
import com.uas.platform.b2b.support.JxlsExcelView;
|
|
|
import com.uas.platform.b2b.support.SystemSession;
|
|
|
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.Constant;
|
|
|
import com.uas.platform.core.model.PageInfo;
|
|
|
@@ -178,11 +178,17 @@ public class SaleNoticeController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/{noticeId}", method = RequestMethod.POST)
|
|
|
- public ResponseEntity<String> send(@PathVariable("noticeId") Long noticeId, @RequestBody String json) {
|
|
|
+ @ResponseBody
|
|
|
+ public ModelMap send(@PathVariable("noticeId") Long noticeId, @RequestBody String json) {
|
|
|
+ ModelMap map = new ModelMap();
|
|
|
SaleSend send = FlexJsonUtils.fromJson(json, SaleSend.class);
|
|
|
- purchaseNoticeService.send(noticeId, send);
|
|
|
- logger.log("客户送货提醒", "给单个客户送货提醒填写数量并确认发货", send.sendDescription(), null, noticeId);
|
|
|
- return new ResponseEntity<String>(HttpStatus.OK);
|
|
|
+ send = purchaseNoticeService.send(noticeId, send);
|
|
|
+ if (send != null) {
|
|
|
+ logger.log("客户送货提醒", "给单个客户送货提醒填写数量并确认发货", send.sendDescription(), null, noticeId);
|
|
|
+ map.put("id", send.getId());
|
|
|
+ return map;
|
|
|
+ } else
|
|
|
+ throw new IllegalOperatorException("程序错误");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -193,12 +199,17 @@ public class SaleNoticeController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/sendByBatch", method = RequestMethod.POST)
|
|
|
- public ResponseEntity<String> sendByBatch(@RequestBody String json) {
|
|
|
+ @ResponseBody
|
|
|
+ public ModelMap sendByBatch(@RequestBody String json) {
|
|
|
+ ModelMap map = new ModelMap();
|
|
|
SaleSend send = FlexJsonUtils.fromJson(json, SaleSend.class);
|
|
|
send = purchaseNoticeService.send(send);
|
|
|
- if (send != null)
|
|
|
+ if (send != null) {
|
|
|
logger.log("客户送货提醒", "给同一客户多个送货提醒填写数量并确认发货", send.sendDescription(), null, send.getId());
|
|
|
- return new ResponseEntity<String>(HttpStatus.OK);
|
|
|
+ map.put("id", send.getId());
|
|
|
+ return map;
|
|
|
+ } else
|
|
|
+ throw new IllegalOperatorException("程序错误");
|
|
|
}
|
|
|
|
|
|
/**
|