From bc25523bd723e92e85f3463edca27f0fe18a7a71 Mon Sep 17 00:00:00 2001 From: DESKTOP-LMJ82IJ\Eno <creaycat@gmail.com> Date: 星期日, 13 四月 2025 16:49:19 +0800 Subject: [PATCH] #修改 收货单据界面优化修改 --- rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/QlyInspectController.java | 62 +++++++++++++++++++++++++++++-- 1 files changed, 58 insertions(+), 4 deletions(-) diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/QlyInspectController.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/QlyInspectController.java index 112b6f7..6c9ff33 100644 --- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/QlyInspectController.java +++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/QlyInspectController.java @@ -4,15 +4,22 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.vincent.rsf.framework.common.Cools; import com.vincent.rsf.framework.common.R; +import com.vincent.rsf.framework.exception.CoolException; import com.vincent.rsf.server.common.utils.ExcelUtil; import com.vincent.rsf.server.common.annotation.OperationLog; import com.vincent.rsf.server.common.domain.BaseParam; import com.vincent.rsf.server.common.domain.KeyValVo; import com.vincent.rsf.server.common.domain.PageParam; +import com.vincent.rsf.server.manager.controller.params.IsptOrderParam; +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.*; @@ -20,7 +27,7 @@ import javax.servlet.http.HttpServletResponse; import java.util.*; -@Api(tags = "璐ㄦ") +@Api(tags = "璐ㄦ淇℃伅") @RestController public class QlyInspectController extends BaseController { @@ -33,6 +40,47 @@ BaseParam baseParam = buildParam(map, BaseParam.class); PageParam<QlyInspect, BaseParam> pageParam = new PageParam<>(baseParam, QlyInspect.class); return R.ok().add(qlyInspectService.page(pageParam, pageParam.buildWrapper(true))); + } + + @PostMapping("/qlyInspect/all/save") + @PreAuthorize("'manager:qlyInspect:save'") + @ApiOperation("鍗曟嵁鍙婃槑缁嗕繚瀛�") + public R allSvae(@RequestBody QlyInspectAndItem params) { + if (Objects.isNull(params)) { + return R.error("鍙傛暟涓嶈兘涓虹┖锛侊紒"); + } + return R.ok(qlyInspectService.allSave(params)); + } + + @PostMapping("/qlyInspect/reports") + @ApiOperation("鑾峰彇宸蹭笂鎶ュ崟鎹槑缁�") + @PreAuthorize("hasAuthority('manager:qlyInspect:list')") + public R listByAsnCode(@RequestBody Map<String, Object> map) { + if (Objects.isNull(map)) { + throw new CoolException("鍙傛暟涓嶈兘涓虹┖锛侊紒"); + } + return R.ok(qlyInspectService.listByAsn(map)); + } + + @PostMapping("/qlyInspect/asn/list") + @ApiOperation("鑾峰彇寰呰川妫�鍗�") + @PreAuthorize("hasAuthority('manager:qlyInspect:list')") + public R getUnInspect(@RequestBody Map<String, Object> map) { + if (Objects.isNull(map)) { + return R.error("鍙傛暟涓嶈兘涓虹┖锛侊紒"); + } + return R.ok(qlyInspectService.getUnInspect(map)); + } + + @PostMapping("/qlyInspect/selected") + @ApiOperation("閫夋嫨璐ㄦ鍗曟嵁") + @PreAuthorize("hasAuthority('manager:qlyInspect:update')") + public R selectedOrder(@RequestBody IsptOrderParam param) { + if (Objects.isNull(param)) { + throw new CoolException("鍙傛暟涓嶈兘涓虹┖锛侊紒"); + } + Long loginUserId = getLoginUserId(); + return qlyInspectService.saveSelected(param, loginUserId); } @PreAuthorize("hasAuthority('manager:qlyInspect:list')") @@ -58,10 +106,8 @@ @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); @@ -83,6 +129,13 @@ @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"); } @@ -109,4 +162,5 @@ ExcelUtil.build(ExcelUtil.create(qlyInspectService.list(), QlyInspect.class), response); } + } -- Gitblit v1.9.1