| | |
| | | import com.vincent.rsf.server.manager.entity.AsnOrder; |
| | | import com.vincent.rsf.server.manager.service.AsnOrderService; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | @Api(tags = "ASN入库通知单") |
| | | public class AsnOrderController extends BaseController { |
| | | |
| | | @Autowired |
| | |
| | | @PreAuthorize("hasAuthority('manager:asnOrder:save')") |
| | | @OperationLog("Create ASN单据") |
| | | @PostMapping("/asnOrder/save") |
| | | @ApiOperation("保存") |
| | | public R save(@RequestBody AsnOrder asnOrder) { |
| | | asnOrder.setCreateBy(getLoginUserId()); |
| | | asnOrder.setCreateTime(new Date()); |
| | |
| | | @PreAuthorize("hasAuthority('manager:asnOrder:update')") |
| | | @OperationLog("Update ASN单据") |
| | | @PostMapping("/asnOrder/update") |
| | | @ApiOperation("更新") |
| | | public R update(@RequestBody AsnOrder asnOrder) { |
| | | asnOrder.setUpdateBy(getLoginUserId()); |
| | | asnOrder.setUpdateTime(new Date()); |
| | |
| | | |
| | | @PreAuthorize("hasAuthority('manager:asnOrder:list')") |
| | | @PostMapping("/asnOrder/query") |
| | | @ApiOperation("查询") |
| | | public R query(@RequestParam(required = false) String condition) { |
| | | List<KeyValVo> vos = new ArrayList<>(); |
| | | LambdaQueryWrapper<AsnOrder> wrapper = new LambdaQueryWrapper<>(); |
| | |
| | | |
| | | @PreAuthorize("hasAuthority('manager:asnOrder:list')") |
| | | @PostMapping("/asnOrder/export") |
| | | @ApiOperation("导出") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | ExcelUtil.build(ExcelUtil.create(asnOrderService.list(), AsnOrder.class), response); |
| | | } |
| | | |
| | | /** |
| | | * 质检上报 |
| | | * @param orders |
| | | * @return |
| | | */ |
| | | @PostMapping("/asnOrder/inspect") |
| | | @ApiOperation("质检上报") |
| | | @PreAuthorize("hasAuthority('manager:asnOrder:list')") |
| | | public R notifyInspect(@RequestBody List<AsnOrder> orders) { |
| | | if (orders.isEmpty()) { |
| | | return R.error("上报单据不能为空!!"); |
| | | } |
| | | if (asnOrderService.notifyInspect(orders)) { |
| | | return R.ok("质检上报成功!!"); |
| | | } else { |
| | | return R.error("一键上报失败!!"); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |