| | |
| | | import com.vincent.rsf.server.manager.controller.params.QlyInspectAndItem; |
| | | import com.vincent.rsf.server.manager.entity.QlyInspect; |
| | | import com.vincent.rsf.server.manager.service.QlyInspectService; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import com.vincent.rsf.server.system.utils.SerialRuleUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | return R.ok(qlyInspectService.listByAsn(map)); |
| | | } |
| | | |
| | | @GetMapping("/qlyInspect/asn/list") |
| | | @PostMapping("/qlyInspect/asn/list") |
| | | @ApiOperation("获取待质检单") |
| | | @PreAuthorize("hasAuthority('manager:qlyInspect:list')") |
| | | public R getUnInspect() { |
| | | return R.ok(qlyInspectService.getUnInspect()); |
| | | public R getUnInspect(@RequestBody Map<String, Object> map) { |
| | | if (Objects.isNull(map)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | return R.ok(qlyInspectService.getUnInspect(map)); |
| | | } |
| | | |
| | | @PostMapping("/qlyInspect/reports") |
| | | @PostMapping("/qlyInspect/selected") |
| | | @ApiOperation("选择质检单据") |
| | | @PreAuthorize("hasAuthority('manager:qlyInspect:update')") |
| | | public R selectedOrder(IsptOrderParam param) { |
| | | public R selectedOrder(@RequestBody IsptOrderParam param) { |
| | | if (Objects.isNull(param)) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | return qlyInspectService.saveSelected(param); |
| | | Long loginUserId = getLoginUserId(); |
| | | return qlyInspectService.saveSelected(param, loginUserId); |
| | | } |
| | | |
| | | |
| | | @PreAuthorize("hasAuthority('manager:qlyInspect:list')") |
| | | @PostMapping("/qlyInspect/list") |
| | |
| | | @PostMapping("/qlyInspect/save") |
| | | public R save(@RequestBody QlyInspect qlyInspect) { |
| | | qlyInspect.setCreateBy(getLoginUserId()); |
| | | qlyInspect.setCreateTime(new Date()); |
| | | qlyInspect.setUpdateBy(getLoginUserId()); |
| | | qlyInspect.setUpdateTime(new Date()); |
| | | if (!qlyInspectService.save(qlyInspect)) { |
| | | if (!qlyInspectService.qlySave(qlyInspect)) { |
| | | return R.error("Save Fail"); |
| | | } |
| | | return R.ok("Save Success").add(qlyInspect); |
| | |
| | | @OperationLog("Delete 质检信息") |
| | | @PostMapping("/qlyInspect/remove/{ids}") |
| | | public R remove(@PathVariable Long[] ids) { |
| | | if (Objects.isNull(ids) || ids.length < 1) { |
| | | return R.error("能数不能为空!!"); |
| | | } |
| | | List<QlyInspect> qlyInspects = qlyInspectService.list(new LambdaQueryWrapper<QlyInspect>().in(QlyInspect::getId, ids)); |
| | | if (!qlyInspects.isEmpty()) { |
| | | return R.error("有明细列表存在!!"); |
| | | } |
| | | if (!qlyInspectService.removeByIds(Arrays.asList(ids))) { |
| | | return R.error("Delete Fail"); |
| | | } |