| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- package com.goafanti.order.controller;
- import javax.servlet.http.HttpServletRequest;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestMethod;
- import org.springframework.web.bind.annotation.RestController;
- import com.goafanti.common.bo.Result;
- import com.goafanti.common.constant.ErrorConstants;
- import com.goafanti.common.controller.CertifyApiController;
- import com.goafanti.order.bo.NewOrderChangeBo;
- import com.goafanti.order.service.OrderChangeService;
- @RestController
- @RequestMapping(value = "/api/admin/orderChange")
- public class OrderChangeApiController extends CertifyApiController {
-
- @Autowired
- private OrderChangeService orderChangeService;
-
-
- /**
- * 新增变更
- */
- @RequestMapping(value = "/addOrderChange", method = RequestMethod.POST)
- public Result addOrderChange(NewOrderChangeBo t){
- Result res = new Result();
- if(null==t.getOrderNo()){
- res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "订单编号"));
- return res;
- }
- if(orderChangeService.checkOderNo(t.getOrderNo())){
- res.getError().add(buildError( "", "订单变更未完成"));
- return res;
- }
- res.setData(orderChangeService.addOrderChange(t));
- return res;
- }
- /**
- * 订单查看变更详情
- */
- @RequestMapping(value = "/orderChangeDetails", method = RequestMethod.GET)
- public Result orderChangeDetails(String orderNo){
- Result res = new Result();
- if(null==orderNo){
- res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "订单编号"));
- return res;
- }
- res.setData(orderChangeService.orderChangeDetails( orderNo));
- return res;
- }
- /**
- * id查看变更详情
- */
- @RequestMapping(value = "/orderChangeDetailsById", method = RequestMethod.GET)
- public Result orderChangeDetailsById(Integer id){
- Result res = new Result();
- if(null==id){
- res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "订单变更编号"));
- return res;
- }
- res.setData(orderChangeService.orderChangeDetailsById( id));
- return res;
- }
- /**
- * 变更修改
- */
- @RequestMapping(value = "/updateOrderChange", method = RequestMethod.POST)
- public Result orderChangeDetails(NewOrderChangeBo t ,Integer changeType){
- Result res = new Result();
- if(null==t.getId()){
- res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "订单变更id"));
- return res;
- }
- if (changeType==null) {
- res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "修改变更类型"));
- return res;
- }
- res.setData(orderChangeService.updateOrderChange(t,changeType));
- return res;
- }
- /**
- * 变更审核
- */
- @RequestMapping(value = "/orderChangeAudit", method = RequestMethod.POST)
- public Result orderChangeAudit(String orderNo,String remarks,Integer status,Integer processState){
- Result res = new Result();
- if(null==orderNo){
- res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "订单编号", "订单编号"));
- return res;
- }
- if(null==status){//2通过 3驳回
- res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "审核结果", "审核结果"));
- return res;
- }
- if(null==remarks){
- res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "审核批示", "审核批示"));
- return res;
- }
- res.setData(orderChangeService.pushOrderChangeAudit( orderNo, remarks, status, processState));
- return res;
- }
- /**
- * 变更日志
- */
- @RequestMapping(value ="/orderChangeLogList",method = RequestMethod.GET)
- public Result orderChangeLogList(String changeId) {
- Result res =new Result();
- if (null==changeId) {
- res.getError().add(buildError("变更id错误", "变更id错误"));
- return res;
- }
- res.data(orderChangeService.selectOrderChangeLogList(changeId));
- return res;
- }
- /**
- * 变更文件上传
- */
- @RequestMapping(value = "/uploadFile", method = RequestMethod.POST)
- public Result uploadRefundOrderFile(HttpServletRequest req,String sign){
- Result res = new Result();
- //order_refund_file
- res.setData(handleFile(res, "/order_change_file/", false, req, sign));
- return res;
- }
- /**
- * 变更列表
- */
- @RequestMapping(value ="/orderChangeList",method = RequestMethod.GET)
- public Result orderChangeList(String userName,Integer processState,Integer timeType,String startTime,String endTime,
- String depId,String salesmanName,Integer complete,Integer pageSize, Integer pageNo) {
- Result res =new Result();
- res.data(orderChangeService.selectOrderChangeList( userName, processState, timeType, startTime, endTime,
- depId, salesmanName, complete,pageSize, pageNo));
- return res;
- }
- }
|