| | |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.yuanchu.mom.service.ConsignmentService; |
| | | |
| | |
| | | }) |
| | | @GetMapping("/selSale") |
| | | public Result selSale(String orderNumber) { |
| | | //只有销售单审核通过之后才能发货 |
| | | Sale sale = saleService.getOne(Wrappers.<Sale>query().eq("order_number", orderNumber)); |
| | | if (ObjectUtils.isEmpty(sale.getType()) || sale.getType() != 1 ) { |
| | | return Result.fail("只有销售单审核通过之后才能发货!"); |
| | | } |
| | | return Result.success(saleService.selSale(orderNumber)); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增成品发货") |
| | | @PostMapping("/addCon") |
| | | public Result addCon(@RequestHeader("token") String token, @RequestBody ConsignmentDto consignmentDto) throws Exception { |
| | | public Result addCon(@RequestHeader("token") String token, @Validated @RequestBody ConsignmentDto consignmentDto) throws Exception { |
| | | Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class); |
| | | return Result.success(consignmentService.addCon(data.get("name").replaceAll("\"", ""), consignmentDto)); |
| | | } |
| | |
| | | return Result.success(map); |
| | | } |
| | | |
| | | @ApiOperation(value = "根据发货id删除") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "发货id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/delCon") |
| | | public Result delCon(Integer id) { |
| | | consignmentService.delCon(id); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "批量删除") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "ids", value = "ids", dataTypeClass = Integer.class, dataType = "List", required = true) |
| | | }) |
| | | @PostMapping("/delAllCon") |
| | | public Result delAllCon(@RequestParam("ids") List<Integer> ids) { |
| | | consignmentService.delAllCon(ids); |
| | | return Result.success(); |
| | | } |
| | | |
| | | } |
| | | |