|
|
|
@ -5,6 +5,7 @@ import cn.chjyj.szwh.bean.OrderGoodsDetail; |
|
|
|
import cn.chjyj.szwh.controller.BaseController; |
|
|
|
import cn.chjyj.szwh.service.OrderGoodsDetailService; |
|
|
|
import cn.chjyj.szwh.service.OrderService; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
@ -90,4 +91,34 @@ public class AdminOrderController extends BaseController { |
|
|
|
jsonObject.put("msg","操作成功"); |
|
|
|
return jsonObject; |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("/orderInfo") |
|
|
|
public JSONObject orderInfo(String batchcode){ |
|
|
|
Order order = orderService.getOrderByBatchcode(batchcode); |
|
|
|
jsonObject.put("code",200); |
|
|
|
jsonObject.put("data",order); |
|
|
|
jsonObject.put("msg","成功"); |
|
|
|
return jsonObject; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 关闭订单 |
|
|
|
* @param batchcode |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@PostMapping("/orderShut") |
|
|
|
public JSONObject orderShut(String batchcode){ |
|
|
|
// 1 删除订单信息
|
|
|
|
int xx = orderService.shutOrder(batchcode); |
|
|
|
// 2 删除订单产品
|
|
|
|
int yy =orderGoodsDetailService.delOrderGoodsByBatchCode(batchcode); |
|
|
|
// 与运算结果
|
|
|
|
if((xx&yy)!=0){ |
|
|
|
jsonObject.put("msg","订单成功关闭"); |
|
|
|
}else{ |
|
|
|
jsonObject.put("msg","订单关闭不成功"); |
|
|
|
} |
|
|
|
jsonObject.put("code",200); |
|
|
|
return jsonObject; |
|
|
|
} |
|
|
|
} |
|
|
|
|