From e706b848e0a32628e869b312bb5d1557d0030dcc Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期三, 10 七月 2024 18:07:31 +0800
Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
---
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intake/IntakeCtrl.java | 53 +++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 47 insertions(+), 6 deletions(-)
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intake/IntakeCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intake/IntakeCtrl.java
index 032631f..455015f 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intake/IntakeCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intake/IntakeCtrl.java
@@ -9,7 +9,9 @@
import com.dy.common.webUtil.ResultCodeMsg;
import com.dy.pipIrrGlobal.pojoPr.PrIntake;
import com.dy.pipIrrGlobal.voPr.VoIntake;
+import com.dy.pipIrrGlobal.voPr.VoOnLineIntake;
import com.dy.pipIrrGlobal.voSe.VoActiveCard;
+import com.dy.pipIrrProject.intake.qo.OnLineIntakesQO;
import com.dy.pipIrrProject.result.ProjectResultCode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
@@ -145,9 +147,11 @@
if (bindingResult != null && bindingResult.hasErrors()) {
return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
}
-
- Date operateTime = new Date();
- po.setOperateDt(operateTime);
+ List<Long> ids = intakeSv.getIntakeIdsByName(po.getName());
+ if (ids.size() > 0) {
+ return BaseResponseUtils.buildFail(ProjectResultCode.INTAKE_NAME_EXIST.getMessage());
+ }
+ po.setOperateDt(new Date());
po.setDeleted((byte)0);
Integer rec = Optional.ofNullable(intakeSv.addIntake(po)).orElse(0);
if (rec == 0) {
@@ -177,13 +181,16 @@
if (bindingResult != null && bindingResult.hasErrors()) {
return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
}
+ List<Long> ids = intakeSv.getIntakeIdByNameExcludeId(po.getId(), po.getName());
+ if (ids.size() > 0){
+ return BaseResponseUtils.buildFail(ProjectResultCode.INTAKE_NAME_EXIST.getMessage());
+ }
int count;
- Date operateTime = new Date();
- po.setOperateDt(operateTime);
+ po.setOperateDt( new Date());
try {
count = this.intakeSv.update(po);
} catch (Exception e) {
- log.error("淇濆瓨鍒嗘按鍙e紓甯�", e);
+ log.error("淇濆瓨鍙栨按鍙e紓甯�", e);
return BaseResponseUtils.buildException(e.getMessage());
}
if (count <= 0) {
@@ -276,4 +283,38 @@
String fileName = URLEncoder.encode(rawFileName, "UTF-8").replaceAll("\\+", "%20");
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
}
+
+ /**
+ * 鑾峰彇鍙栨按鍙e垪琛紙鍦ㄧ嚎鍜屼笉鍦ㄧ嚎锛�
+ * @param qo
+ * @return
+ */
+ @GetMapping(path = "all_intakes")
+ @SsoAop()
+ public BaseResponse<QueryResultVo<List<VoOnLineIntake>>> getAllIntakes(OnLineIntakesQO qo) {
+ try {
+ QueryResultVo<List<VoOnLineIntake>> res = intakeSv.selectOnLineIntakes(qo);
+ return BaseResponseUtils.buildSuccess(res);
+ } catch (Exception e) {
+ log.error("鏌ヨ鍙栨按鍙e紓甯�", e);
+ return BaseResponseUtils.buildException(e.getMessage());
+ }
+ }
+
+ /**
+ * 鏍规嵁鎿嶄綔鍛樿幏鍙栧父鐢ㄥ彇姘村彛锛堝湪绾垮拰涓嶅湪绾匡級
+ * @param operator
+ * @return
+ */
+ @GetMapping(path = "used_intakes")
+ @SsoAop()
+ public BaseResponse<List<VoOnLineIntake>> getUsedIntakes(Long operator) {
+ try {
+ List<VoOnLineIntake> res = intakeSv.getUsedIntakes(operator);
+ return BaseResponseUtils.buildSuccess(res);
+ } catch (Exception e) {
+ log.error("鏌ヨ鍙栨按鍙e紓甯�", e);
+ return BaseResponseUtils.buildException(e.getMessage());
+ }
+ }
}
--
Gitblit v1.8.0