From c6e9227208dc46f2f46f046fea0b21bea398a16c Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期六, 07 十月 2023 09:40:15 +0800
Subject: [PATCH] #报销相关
---
src/main/java/com/zy/crm/manager/controller/PlanController.java | 30 +++++++++++++++++++-----------
1 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/src/main/java/com/zy/crm/manager/controller/PlanController.java b/src/main/java/com/zy/crm/manager/controller/PlanController.java
index 0ba45fb..c9f790d 100644
--- a/src/main/java/com/zy/crm/manager/controller/PlanController.java
+++ b/src/main/java/com/zy/crm/manager/controller/PlanController.java
@@ -12,11 +12,9 @@
import com.core.common.R;
import com.core.domain.KeyValueVo;
import com.core.exception.CoolException;
-import com.zy.crm.common.entity.RouteCollectCountType;
import com.zy.crm.common.model.SettleDto;
import com.zy.crm.common.service.OssService;
import com.zy.crm.common.utils.FileSaveExampleUtil;
-import com.zy.crm.common.utils.SetOfUtils;
import com.zy.crm.common.web.BaseController;
import com.zy.crm.manager.controller.result.FollowerTableVo;
import com.zy.crm.manager.entity.*;
@@ -33,20 +31,11 @@
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
-import org.springframework.core.io.Resource;
-import org.springframework.core.io.FileSystemResource;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
import javax.servlet.http.HttpServletResponse;
-import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
-
-import static java.util.stream.Collectors.toList;
@RestController
public class PlanController extends BaseController {
@@ -61,6 +50,10 @@
private OssService ossService;
@Autowired
private PriOnline2Service priOnline2Service;
+ @Autowired
+ private OrderService orderService;
+ @Autowired
+ private SmsCodeService smsCodeService;
@GetMapping(value = "/plan/{id}/auth")
@ManagerAuth
@@ -124,6 +117,16 @@
if (planService.selectByUuid(hostId, plan.getUuid()) != null) {
throw new CoolException("瑙勫垝鍗曞凡瀛樺湪");
}
+
+ Order order = orderService.selectById(plan.getOrderId());
+ if (Cools.isEmpty(order)) {
+ throw new CoolException("璺熻釜椤圭洰涓嶅瓨鍦�");
+ }
+
+ if (!order.getDirector().equals(getUserId())){
+ throw new CoolException("鍙厑璁歌窡韪」鐩礋璐d汉娣诲姞鎵�閫夐」鐩鍒掔敵璇峰崟");
+ }
+
Date now = new Date();
plan.setHostId(hostId);
plan.setUuid(planService.getUuid(hostId)); // 瑙勫垝鍗曚唬鍙�
@@ -431,6 +434,11 @@
plan.setUpdateBy(getUserId());
plan.setUpdateTime(new Date());
+ boolean sendSmsCode = smsCodeService.sendSmsCodeText(planner.getMobile());
+ if (!sendSmsCode) {
+ System.out.println("鐭俊鍙戦�佸け璐ワ紒");
+ }
+
if (!planService.updateById(plan)) {
throw new CoolException("瀹℃牳澶辫触锛岃鑱旂郴绠$悊鍛�");
}
--
Gitblit v1.9.1