From a83c86d3b99fc82f8a7c58d230e8a568bcb51ff9 Mon Sep 17 00:00:00 2001 From: "HUOJIN\\92525" <925258474@qq.com> Date: Tue, 23 Jul 2024 16:28:44 +0800 Subject: [PATCH] no message --- .../repository/PickRepository.java | 4 ++ .../businessdata/rest/PickController.java | 54 +++++++++++-------- .../businessdata/service/PickService.java | 3 ++ .../service/impl/PickServiceImpl.java | 5 ++ .../system/rest/ApiDictController.java | 9 +--- .../main/resources/config/application-dev.yml | 2 +- 6 files changed, 46 insertions(+), 31 deletions(-) diff --git a/youchain-system/src/main/java/com/youchain/businessdata/repository/PickRepository.java b/youchain-system/src/main/java/com/youchain/businessdata/repository/PickRepository.java index d9ee7bb..41ac6f2 100644 --- a/youchain-system/src/main/java/com/youchain/businessdata/repository/PickRepository.java +++ b/youchain-system/src/main/java/com/youchain/businessdata/repository/PickRepository.java @@ -16,6 +16,7 @@ package com.youchain.businessdata.repository; import com.youchain.businessdata.domain.Pick; +import com.youchain.businessdata.domain.PickDetail; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.Query; @@ -37,4 +38,7 @@ public interface PickRepository extends JpaRepository, JpaSpecificat @Query(value = " from Pick p WHERE p.gdCode=:gdCode ") List findByPickGdCode(String gdCode); + + @Query(value = " from PickDetail pd WHERE pd.pick.id=:pickId ") + List queryPickDetail(Long pickId); } diff --git a/youchain-system/src/main/java/com/youchain/businessdata/rest/PickController.java b/youchain-system/src/main/java/com/youchain/businessdata/rest/PickController.java index 5049d15..ccfbff9 100644 --- a/youchain-system/src/main/java/com/youchain/businessdata/rest/PickController.java +++ b/youchain-system/src/main/java/com/youchain/businessdata/rest/PickController.java @@ -1,22 +1,23 @@ /* -* Copyright 2019-2020 Zheng Jie -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright 2019-2020 Zheng Jie + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.youchain.businessdata.rest; import com.youchain.annotation.Log; import com.youchain.businessdata.domain.Pick; +import com.youchain.businessdata.domain.PickDetail; import com.youchain.businessdata.service.PickService; import com.youchain.businessdata.service.dto.PickQueryCriteria; import org.springframework.data.domain.Pageable; @@ -27,14 +28,16 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import io.swagger.annotations.*; + import java.io.IOException; +import java.util.List; import javax.servlet.http.HttpServletResponse; /** -* @website https://eladmin.vip -* @author huojin -* @date 2024-06-11 -**/ + * @author huojin + * @website https://eladmin.vip + * @date 2024-06-11 + **/ @RestController @RequiredArgsConstructor @Api(tags = "pick管理") @@ -54,23 +57,23 @@ public class PickController { @GetMapping @ApiOperation("查询pick") @PreAuthorize("@el.check('pick:list')") - public ResponseEntity queryPick(PickQueryCriteria criteria, Pageable pageable){ - return new ResponseEntity<>(pickService.queryAll(criteria,pageable),HttpStatus.OK); + public ResponseEntity queryPick(PickQueryCriteria criteria, Pageable pageable) { + return new ResponseEntity<>(pickService.queryAll(criteria, pageable), HttpStatus.OK); } @PostMapping @Log("新增pick") @ApiOperation("新增pick") @PreAuthorize("@el.check('pick:add')") - public ResponseEntity createPick(@Validated @RequestBody Pick resources){ - return new ResponseEntity<>(pickService.create(resources),HttpStatus.CREATED); + public ResponseEntity createPick(@Validated @RequestBody Pick resources) { + return new ResponseEntity<>(pickService.create(resources), HttpStatus.CREATED); } @PutMapping @Log("修改pick") @ApiOperation("修改pick") @PreAuthorize("@el.check('pick:edit')") - public ResponseEntity updatePick(@Validated @RequestBody Pick resources){ + public ResponseEntity updatePick(@Validated @RequestBody Pick resources) { pickService.update(resources); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } @@ -83,4 +86,9 @@ public class PickController { pickService.deleteAll(ids); return new ResponseEntity<>(HttpStatus.OK); } + + @GetMapping(value = "/queryPickDetail") + public ResponseEntity queryPickDetail(@RequestParam("pickId") Long pickId) { + return new ResponseEntity<>(pickService.queryPickDetail(pickId), HttpStatus.OK); + } } diff --git a/youchain-system/src/main/java/com/youchain/businessdata/service/PickService.java b/youchain-system/src/main/java/com/youchain/businessdata/service/PickService.java index 940f9cd..87bc0ff 100644 --- a/youchain-system/src/main/java/com/youchain/businessdata/service/PickService.java +++ b/youchain-system/src/main/java/com/youchain/businessdata/service/PickService.java @@ -17,6 +17,7 @@ package com.youchain.businessdata.service; import com.youchain.RequestData.Yclbl; import com.youchain.businessdata.domain.Pick; +import com.youchain.businessdata.domain.PickDetail; import com.youchain.businessdata.service.dto.PickDto; import com.youchain.businessdata.service.dto.PickQueryCriteria; import org.springframework.data.domain.Pageable; @@ -123,4 +124,6 @@ public interface PickService { * @param pick->出库单 */ void materialPick(Pick pick); + + List queryPickDetail(Long pickId); } diff --git a/youchain-system/src/main/java/com/youchain/businessdata/service/impl/PickServiceImpl.java b/youchain-system/src/main/java/com/youchain/businessdata/service/impl/PickServiceImpl.java index 0276b8d..2467839 100644 --- a/youchain-system/src/main/java/com/youchain/businessdata/service/impl/PickServiceImpl.java +++ b/youchain-system/src/main/java/com/youchain/businessdata/service/impl/PickServiceImpl.java @@ -349,5 +349,10 @@ public class PickServiceImpl implements PickService { pickRepository.save(pick); } + @Override + public List queryPickDetail(Long pickId) { + return pickRepository.queryPickDetail(pickId); + } + } diff --git a/youchain-system/src/main/java/com/youchain/modules/system/rest/ApiDictController.java b/youchain-system/src/main/java/com/youchain/modules/system/rest/ApiDictController.java index 4403e3d..96cc484 100644 --- a/youchain-system/src/main/java/com/youchain/modules/system/rest/ApiDictController.java +++ b/youchain-system/src/main/java/com/youchain/modules/system/rest/ApiDictController.java @@ -15,6 +15,7 @@ */ package com.youchain.modules.system.rest; +import com.youchain.annotation.AnonymousAccess; import com.youchain.annotation.Log; import com.youchain.exception.BadRequestException; import com.youchain.modules.system.domain.ApiDict; @@ -49,21 +50,18 @@ public class ApiDictController { @ApiOperation("导出字典数据") @GetMapping(value = "/download") - public void exportDict(HttpServletResponse response, ApiDictQueryCriteria criteria) throws IOException { dictService.download(dictService.queryAll(criteria), response); } @ApiOperation("查询字典") @GetMapping(value = "/all") - public ResponseEntity queryAllDict(){ return new ResponseEntity<>(dictService.queryAll(new ApiDictQueryCriteria()),HttpStatus.OK); } @ApiOperation("查询字典") @GetMapping - public ResponseEntity queryDict(ApiDictQueryCriteria resources, Pageable pageable){ return new ResponseEntity<>(dictService.queryAll(resources,pageable),HttpStatus.OK); } @@ -71,7 +69,6 @@ public class ApiDictController { @Log("新增字典") @ApiOperation("新增字典") @PostMapping - public ResponseEntity createDict(@Validated @RequestBody ApiDict resources){ if (resources.getId() != null) { throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID"); @@ -84,7 +81,6 @@ public class ApiDictController { @Log("修改字典") @ApiOperation("修改字典") @PutMapping - public ResponseEntity updateDict(@Validated(ApiDict.Update.class) @RequestBody ApiDict resources){ dictService.update(resources); dictService.queryAllToSave(); @@ -94,10 +90,9 @@ public class ApiDictController { @Log("删除字典") @ApiOperation("删除字典") @DeleteMapping - public ResponseEntity deleteDict(@RequestBody Set ids){ dictService.delete(ids); dictService.queryAllToSave(); return new ResponseEntity<>(HttpStatus.OK); } -} \ No newline at end of file +} diff --git a/youchain-system/src/main/resources/config/application-dev.yml b/youchain-system/src/main/resources/config/application-dev.yml index 13f56a5..32f3895 100644 --- a/youchain-system/src/main/resources/config/application-dev.yml +++ b/youchain-system/src/main/resources/config/application-dev.yml @@ -33,7 +33,7 @@ spring: validation-query: select 1 # 配置监控统计 webStatFilter: - enabled: true + enabled: false stat-view-servlet: enabled: true url-pattern: /druid/*