From 9dfc64b4c99218a82ab56549908a11281e804c18 Mon Sep 17 00:00:00 2001
From: liuxm <liuxm_a@163.com>
Date: 星期四, 23 五月 2024 17:18:30 +0800
Subject: [PATCH] 品检添加排序;用户,工站,产品,列表中添加二维码;修改下载链接
---
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/proLine/ProLineCtrl.java | 43 +++++++++++++++++++++++++++++++------------
1 files changed, 31 insertions(+), 12 deletions(-)
diff --git a/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/proLine/ProLineCtrl.java b/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/proLine/ProLineCtrl.java
index 7aab925..f319e04 100644
--- a/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/proLine/ProLineCtrl.java
+++ b/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/proLine/ProLineCtrl.java
@@ -37,18 +37,25 @@
* @return
*/
@PostMapping(path="save")
- @SsoPowerAop(power = "10300001")
+ @SsoPowerAop(power = "10300005")
@Log("淇濆瓨鐢熶骇绾�")
- public BaseResponse<PltProductionLine> save(@RequestBody @Valid PltProductionLine line,BindingResult bindingResult){
+ public BaseResponse<Boolean> save(@RequestBody @Valid PltProductionLine line,BindingResult bindingResult){
+ int count;
try {
if (bindingResult != null && bindingResult.hasErrors()) {
return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
}
+ line.disabled = false;
line.deleted = false;
- return BaseResponseUtils.buildSuccess(sv.save(line));
+ count = sv.save(line);
}catch (Exception e){
log.error("淇濆瓨鐢熶骇绾垮紓甯�", e);
return BaseResponseUtils.buildException(e.getMessage());
+ }
+ if (count <= 0) {
+ return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�");
+ } else {
+ return BaseResponseUtils.buildSuccess(true);
}
}
@@ -60,17 +67,23 @@
* @return
*/
@PostMapping(path="update")
- @SsoPowerAop(power = "10300001")
+ @SsoPowerAop(power = "10300005")
@Log("鏇存柊鐢熶骇绾�")
- public BaseResponse<PltProductionLine> update(@RequestBody @Valid PltProductionLine line,BindingResult bindingResult){
+ public BaseResponse<Boolean> update(@RequestBody @Valid PltProductionLine line,BindingResult bindingResult){
+ int count;
try {
if (bindingResult != null && bindingResult.hasErrors()) {
return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
}
- return BaseResponseUtils.buildSuccess(sv.update(line));
+ count = sv.update(line);
}catch (Exception e){
log.error("鏇存柊鐢熶骇绾垮紓甯�", e);
return BaseResponseUtils.buildException(e.getMessage());
+ }
+ if (count <= 0) {
+ return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�");
+ } else {
+ return BaseResponseUtils.buildSuccess(true);
}
}
@@ -80,14 +93,20 @@
* @return
*/
@GetMapping(path="delete")
- @SsoPowerAop(power = "10300001")
+ @SsoPowerAop(power = "10300005")
@Log("鍒犻櫎鐢熶骇绾�")
- public BaseResponse<PltProductionLine> delete(String id){
+ public BaseResponse<Boolean> delete(String id){
+ int count;
try {
- return BaseResponseUtils.buildSuccess(sv.delete(Long.parseLong(id)));
+ count = sv.delete(Long.parseLong(id));
}catch (Exception e){
log.error("鍒犻櫎鐢熶骇绾垮紓甯�", e);
return BaseResponseUtils.buildException(e.getMessage());
+ }
+ if (count <= 0) {
+ return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�");
+ } else {
+ return BaseResponseUtils.buildSuccess(true);
}
}
@@ -98,7 +117,7 @@
* @return
*/
@GetMapping(path="one")
- @SsoPowerAop(power = "10300000") //鐧诲綍涓庢潈闄愬悓鏃堕獙璇�
+ @SsoPowerAop(power = "10300004") //鐧诲綍涓庢潈闄愬悓鏃堕獙璇�
@Log("鏍规嵁ID鏌ヨ鐢熶骇绾�")
public BaseResponse<PltProductionLine> one(String id){
try{
@@ -116,7 +135,7 @@
* @return
*/
@PostMapping(path="some")
- @SsoPowerAop(power = "10300000")
+ @SsoPowerAop(power = "10300004")
@Log("鍒嗛〉鏌ヨ鐢熶骇绾�")
public BaseResponse<QueryResultVo<List<PltProductionLine>>> some(@RequestBody QueryVo vo){
try {
@@ -133,7 +152,7 @@
* @return
*/
@GetMapping(path="all")
- @SsoPowerAop(power = "10300000")
+ @SsoPowerAop(power = "10300004")
@Log("鏌ヨ鎵�鏈夌敓浜х嚎")
public BaseResponse<List<PltProductionLine>> all(){
try {
--
Gitblit v1.8.0