From bf2fbd9f3e90dd2ef508c5944ae63491397b42ae Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期六, 04 十一月 2023 10:35:26 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/crm/manager/controller/PriOnline2Controller.java | 431 ++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 402 insertions(+), 29 deletions(-)
diff --git a/src/main/java/com/zy/crm/manager/controller/PriOnline2Controller.java b/src/main/java/com/zy/crm/manager/controller/PriOnline2Controller.java
index f6d9471..478a3a3 100644
--- a/src/main/java/com/zy/crm/manager/controller/PriOnline2Controller.java
+++ b/src/main/java/com/zy/crm/manager/controller/PriOnline2Controller.java
@@ -1,5 +1,6 @@
package com.zy.crm.manager.controller;
+import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
@@ -10,13 +11,13 @@
import com.core.common.DateUtils;
import com.core.common.R;
import com.core.domain.KeyValueVo;
+import com.core.exception.CoolException;
+import com.zy.crm.common.model.SettleDto;
import com.zy.crm.common.web.BaseController;
-import com.zy.crm.manager.entity.Plan;
-import com.zy.crm.manager.entity.Pri;
-import com.zy.crm.manager.entity.PriOnline2;
-import com.zy.crm.manager.service.PlanService;
-import com.zy.crm.manager.service.PriOnline2Service;
-import com.zy.crm.manager.service.PriService;
+import com.zy.crm.manager.entity.*;
+import com.zy.crm.manager.service.*;
+import com.zy.crm.system.entity.User;
+import com.zy.crm.system.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ClassPathResource;
import org.springframework.util.ClassUtils;
@@ -40,10 +41,32 @@
@Autowired
private PlanService planService;
+ @Autowired
+ private PlanTypeService planTypeService;
+
+ @Autowired
+ private ProcessPermissionsService processPermissionsService;
+
+ @Autowired
+ private PriQuoteService priQuoteService;
+
+ @Autowired
+ private CstmrService cstmrService;
+
+ @Autowired
+ private UserService userService;
+
+ String PZH=" 鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�� ";
+
@RequestMapping(value = "/priOnline2/{id}/auth")
@ManagerAuth
public R get(@PathVariable("id") String id) {
- return R.ok(priOnline2Service.selectById(String.valueOf(id)));
+ PriOnline2 priOnline2 = priOnline2Service.selectById(String.valueOf(id));
+ assert priOnline2 != null;
+ JSONObject resultObj = JSON.parseObject(JSON.toJSONString(priOnline2));
+ // 姝ラ鏉$浉鍏�
+ resultObj.put("step", priOnline2.getSettle() == 3 ? 0 : priOnline2.getSettle() + 1);
+ return R.ok().add(resultObj);
}
@RequestMapping(value = "/priOnline2/viewCheck/{id}/auth")
@@ -65,22 +88,26 @@
@RequestParam(required = false)String condition,
@RequestParam Map<String, Object> param){
EntityWrapper<PriOnline2> wrapper = new EntityWrapper<>();
- wrapper.setSqlSelect("id,title,create_time as createTime,filepath,item_id as itemId,order_num as orderNum,template_name as templateName,user_id as userId,dept_id as deptId,status,update_time as updateTime,check_data as checkData,update_user_id as updateUserId,member_id as memberId");
- wrapper.in("member_id", getUserRoleBelongsToUserId("allopen"));
+ wrapper.setSqlSelect("id,title,create_time as createTime,filepath,settle,item_id as itemId,order_num as orderNum,template_name as templateName,user_id as userId,dept_id as deptId,status,update_time as updateTime,check_data as checkData,update_user_id as updateUserId,member_id as memberId");
+// wrapper.in("member_id", getUserRoleBelongsToUserId("allopen"));
excludeTrash(param);
convert(param, wrapper);
allLike(PriOnline2.class, param.keySet(), wrapper, condition);
+ wrapper.or().eq("member_id",getUserId());
if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
return R.ok(priOnline2Service.selectPage(new Page<>(curr, limit), wrapper));
}
private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){
- Long deptId = getDeptId();
boolean signUserId = false;
boolean signDeptId = false;
+ boolean signHostId = false;
for (Map.Entry<String, Object> entry : map.entrySet()){
if (entry.getKey().equals("dept_id")){
signDeptId = true;
+ if (String.valueOf(entry.getValue()).equals("19")){
+ signHostId = true;
+ }
}
}
for (Map.Entry<String, Object> entry : map.entrySet()){
@@ -101,7 +128,16 @@
}
}
if (!signUserId && !signDeptId){
- wrapper.eq("user_id", getUserId());
+ if (getRole().getId()==1){
+ wrapper.or().eq("host_id",1);
+ }else if (getRole().getId()==2){
+ wrapper.eq("dept_id",getDeptId());
+ }else {
+ wrapper.eq("user_id", getUserId());
+ }
+ }
+ if (signHostId){
+ wrapper.or().eq("host_id",1);
}
}
@@ -111,29 +147,63 @@
PriOnline2 priOnline2 = new PriOnline2();
priOnline2.setCreateTime(new Date());
priOnline2.setTitle(map.get("title").toString());
- priOnline2.setTemplateName(map.get("title").toString());
+// priOnline2.setTemplateName(map.get("title").toString());
priOnline2.setSheetData(map.get("sheetData").toString());
priOnline2.setItemId(Long.parseLong(map.get("itemId").toString()));
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
priOnline2.setOrderNum(format.format(new Date()));
- //鍒涘缓浜哄憳
- priOnline2.setUserId(getUserId());
- //鍒涘缓浜哄憳閮ㄩ棬
- priOnline2.setDeptId(getDeptId());
- //鏇存柊鏃堕棿
- priOnline2.setUpdateTime(new Date());
- //鏇存柊浜哄憳
- priOnline2.setUpdateUserId(getUserId());
- //鐘舵�侊紝鏈畬鎴�
- priOnline2.setStatus(0);
+
//涓氬姟鍛�
// Item item = itemService.selectById(priOnline.getItemId());
Plan plan = planService.selectById(priOnline2.getItemId());
- priOnline2.setMemberId(plan.getUserId());
+ User userUp = userService.selectById(plan.getUserId());
+ //涓氬姟鍛�
+ priOnline2.setUserId(userUp.getId());
+ //涓氬姟鍛橀儴闂�
+ priOnline2.setDeptId(userUp.getDeptId());
+ //鏇存柊浜哄憳
+ priOnline2.setUpdateUserId(getUserId());
+ //鏇存柊鏃堕棿
+ priOnline2.setUpdateTime(new Date());
+
+ //鐘舵�侊紝鏈畬鎴�
+ priOnline2.setStatus(0);
+
+ if (plan.getStatus()!=1){
+ return R.error("姝よ鍒掑崟鐘舵�佹敼鍙橈紝璇峰埛鏂伴〉闈㈤噸鏂伴�夋嫨锛�");
+ }
+ priOnline2.setMemberId(getUserId());
+
+ Cstmr cstmr = cstmrService.selectById(plan.getCstmrId());
+ priOnline2.setTemplateName(cstmr.getName()); //鐢叉柟鍗曚綅鍚嶇О
+
+ priOnline2.setSettle(0);
+
+// User manager = new User();
+// try{
+// manager = userService.getDeptManager(getHostId(), getUser().getDeptId()); // 鑾峰彇閮ㄩ棬棰嗗
+// }catch (Exception e){
+// manager = getUser();
+// }
+
+// String node="2-";
+// PlanType planType = planTypeService.selectById(plan.getPlanType());
+// node = node+planType.getType();
+// ProcessPermissions processPermissions = processPermissionsService.selectOne(new EntityWrapper<ProcessPermissions>().eq("process_memo", 5).eq("process", node));//2锛氭牳浠锋祦绋�
+// User manager = userService.selectById(processPermissions.getUserId()); // 鑾峰彇鏍镐环娴佺▼鑺傜偣2纭浜�
+
+ // 鑾峰彇涓氬姟鍛�
+ List<String> initNames = new ArrayList<>();
+ initNames.add("鎺ュ彇鏍镐环浠诲姟");
+ initNames.add("瀹屾垚鏍镐环");
+// initNames.add("缁忕悊瀹℃牳");
+ initNames.add("涓氬姟鍛樼‘璁�");
+ priOnline2.setSettleMsg(JSON.toJSONString(SettleDto.initSalesPricingPriOnline2(getUser(),userUp,initNames,2)));
//璁剧疆椤圭洰娴佺▼
plan.setStep(2);
+ plan.setStatus(2);
planService.updateById(plan);
priOnline2Service.insert(priOnline2);
@@ -274,11 +344,32 @@
@RequestMapping(value = "/priOnline2/delete/auth")
@ManagerAuth(memo = "鍒犻櫎鏍镐环绠$悊")
public R delete(Long[] ids){
- if (Cools.isEmpty(ids)){
- return R.error();
+ try{
+ if (Cools.isEmpty(ids) || ids.length==0){
+ return R.error();
+ }
+ for (Long id : ids){
+ int priQuote= priQuoteService.selectCount(new EntityWrapper<PriQuote>().eq("pri_online_id", id));
+ if (priQuote!=0){
+ return R.error("瀛樺湪鍏宠仈鐨勬姤浠峰崟锛岀姝㈠垹闄わ紒锛侊紒");
+ }
+// int priSales = priSalesService.selectCount(new EntityWrapper<PriSales>().eq("pri_online2_id", id));
+// if (priSales!=0){
+// return R.error("瀛樺湪鍏宠仈鐨勪骇鍝佽垂鐢ㄦ槑缁嗭紝绂佹鍒犻櫎锛侊紒锛�");
+// }
+ }
+ for (Long id : ids) {
+ PriOnline2 priOnline2 = priOnline2Service.selectById(id);
+ Plan plan = planService.selectById(priOnline2.getItemId());
+ plan.setStatus(1);
+ planService.updateById(plan);
+ }
+
+ priOnline2Service.deleteBatchIds(Arrays.asList(ids));
+ return R.ok();
+ }catch (Exception e){
+ return R.error(e.getMessage());
}
- priOnline2Service.deleteBatchIds(Arrays.asList(ids));
- return R.ok();
}
@RequestMapping(value = "/priOnline2/export/auth")
@@ -297,13 +388,34 @@
public R query(String condition) {
EntityWrapper<PriOnline2> wrapper = new EntityWrapper<>();
wrapper.like("order_num", condition);
- wrapper.in("member_id", getUserRoleBelongsToUserId("allopen"));
+ wrapper.in("user_id", getUserRoleBelongsToUserId("allopen"));
Page<PriOnline2> page = priOnline2Service.selectPage(new Page<>(0, 10), wrapper);
List<Map<String, Object>> result = new ArrayList<>();
for (PriOnline2 priOnline2 : page.getRecords()){
Map<String, Object> map = new HashMap<>();
map.put("id", priOnline2.getId());
- map.put("value", priOnline2.getOrderNum() + "/" + priOnline2.getPlanId$() + "/" + priOnline2.getMemberId$());
+// map.put("value", priOnline2.getOrderNum() + "/" + priOnline2.getPlanId$() + "/" + priOnline2.getMemberId$());
+ map.put("value", priOnline2.getOrderNum() + "/" + priOnline2.getTemplateName());
+ result.add(map);
+ }
+ return R.ok(result);
+ }
+
+ @RequestMapping(value = "/priOnline2Query2/auth")
+ @ManagerAuth
+ public R query2(String condition) {
+ EntityWrapper<PriOnline2> wrapper = new EntityWrapper<>();
+ wrapper.like("order_num", condition);
+ wrapper.in("user_id", getUserRoleBelongsToUserId("allopen"));
+ Page<PriOnline2> page = priOnline2Service.selectPage(new Page<>(0, 10), wrapper);
+ List<Map<String, Object>> result = new ArrayList<>();
+ for (PriOnline2 priOnline2 : page.getRecords()){
+ Map<String, Object> map = new HashMap<>();
+ map.put("id", priOnline2.getId());
+// map.put("value", priOnline2.getOrderNum() + "/" + priOnline2.getPlanId$() + "/" + priOnline2.getMemberId$());
+// map.put("value", priOnline2.getOrderNum() + "/" + priOnline2.getTemplateName());
+ map.put("value", priOnline2.getOrderNum() + "/" + priOnline2.getPlanId$() + "/" + priOnline2.getUser$() + "/" + priOnline2.getTemplateName());
+
result.add(map);
}
return R.ok(result);
@@ -328,4 +440,265 @@
return R.ok().add(vos);
}
+ @PostMapping(value = "/priOnline2/approvalEnd/auth")
+ @ManagerAuth(memo = "鎷掔粷鐢宠鍗�")
+ public R approvalEnd(@RequestParam Long priOnlineId,
+ @RequestParam(required = false) Long plannerId) {
+ PriOnline2 priOnline2 = priOnline2Service.selectById(priOnlineId);
+ Date now = new Date();
+ Long memberId = priOnline2.getMemberId();
+ User member = userService.selectById(memberId);
+ if (!member.getId().equals(getUserId())){
+ return R.error("鎶辨瓑锛屾偍娌℃湁瀹℃牳鐨勬潈闄�");
+ }
+ List<SettleDto> planDtos = JSON.parseArray(priOnline2.getSettleMsg(), SettleDto.class);
+ List<SettleDto> planDtoList = new ArrayList<>();
+ boolean sign = true;
+ for (SettleDto dto : planDtos) {
+ if (dto.getStep().equals(1)){
+ priOnline2.setMemberId(dto.getUserId());
+ }
+ if (sign && dto.getUserId().equals(memberId) && priOnline2.getSettle()+1==dto.getStep()){
+ if (Cools.isEmpty(dto.getMsg())){
+ dto.setMsg(DateUtils.convert(now)+" "+member.getNickname()+"鍥為��瀹℃壒");
+ }else {
+ dto.setMsg(dto.getMsg()+PZH+DateUtils.convert(now)+" "+member.getNickname()+"鍥為��瀹℃壒");
+ }
+ sign = false;
+ }
+ if (sign){
+ dto.setMsg(dto.getMsg()+PZH+DateUtils.convert(now)+" "+member.getNickname()+"鍥為��瀹℃壒");
+ }
+
+ planDtoList.add(dto);
+ }
+ priOnline2.setStatus(0);
+ priOnline2.setSettle(0);
+ priOnline2.setUpdateUserId(getUserId());
+ priOnline2.setUpdateTime(now);
+
+ priOnline2.setSettleMsg(JSON.toJSONString(planDtoList));
+ priOnline2Service.updateById(priOnline2);
+ return R.ok("鍥為��鎴愬姛");
+ }
+
+ @PostMapping(value = "/priOnline2/approval/auth")
+ @ManagerAuth
+ public R approvalBusinessTrip(@RequestParam Long priOnlineId,
+ @RequestParam(required = false) Long plannerId){
+ PriOnline2 priOnline2 = priOnline2Service.selectById(priOnlineId);
+ assert priOnline2 != null;
+ Date now = new Date();
+ switch (priOnline2.getSettle()) {
+ case 0:
+ // 鏈儴闂ㄧ粡鐞嗗鏍� 鑺傜偣璐熻矗浜�
+ User user = userService.selectById(priOnline2.getMemberId());
+
+ Plan plan1 = planService.selectById(priOnline2.getItemId());
+// PlanType planType1 = planTypeService.selectById(plan1.getPlanType());
+//
+// ProcessPermissions processPermissions1 = processPermissionsService.selectOne(new EntityWrapper<ProcessPermissions>().eq("process_memo", 5).eq("process", "2-"+planType1.getType()));//2锛氭牳浠锋祦绋�
+// User manager1 = userService.selectById(processPermissions1.getUserId()); // 鑾峰彇鎶ヤ环娴佺▼鑺傜偣2纭浜�
+
+ if (Cools.isEmpty(getUser())) {
+ return R.error("鎶辨瓑锛屾偍娌℃湁鎻愪氦鐨勬潈闄�");
+ }
+ if (!getUserId().equals(user.getId())) {
+ return R.error("鎶辨瓑锛屾偍娌℃湁鎻愪氦鐨勬潈闄�");
+ }
+ // 淇敼 settle 姝ラ鏁版嵁
+ List<SettleDto> list1 = JSON.parseArray(priOnline2.getSettleMsg(), SettleDto.class);
+ for (SettleDto dto : list1) {
+ switch (dto.getStep()) {
+ case 0:
+ dto.setCurr(Boolean.FALSE);
+ break;
+ case 1:
+ dto.setCurr(Boolean.TRUE);
+ if (Cools.isEmpty(dto.getMsg())){
+ dto.setMsg(user.getNickname() + "鎻愪氦瀹屾垚");
+ }else {
+ dto.setMsg(dto.getMsg()+PZH+DateUtils.convert(new Date())+" " + user.getNickname() + "鎻愪氦瀹屾垚");
+ }
+ dto.setTime(DateUtils.convert(now));
+ break;
+ default:
+ break;
+ }
+ }
+ priOnline2.setSettleMsg(JSON.toJSONString(list1));
+ // 淇敼瑙勫垝鍗曠姸鎬�
+ priOnline2.setSettle(1);
+ priOnline2.setUpdateUserId(getUserId());
+ priOnline2.setUpdateTime(now);
+ priOnline2.setMemberId(plan1.getUserId());
+
+ if (!priOnline2Service.updateById(priOnline2)) {
+ throw new CoolException("鎻愪氦澶辫触锛岃鑱旂郴绠$悊鍛�");
+ }
+ break;
+// case 1:
+// // 鏈儴闂ㄧ粡鐞嗗鏍� 鑺傜偣璐熻矗浜�
+// Plan plan = planService.selectById(priOnline2.getItemId());
+// PlanType planType = planTypeService.selectById(plan.getPlanType());
+//
+// ProcessPermissions processPermissions = processPermissionsService.selectOne(new EntityWrapper<ProcessPermissions>().eq("process_memo", 5).eq("process", "2-"+planType.getType()));//2锛氭姤浠锋祦绋�
+// User manager = userService.selectById(processPermissions.getUserId()); // 鑾峰彇鎶ヤ环娴佺▼鑺傜偣2纭浜�
+//
+//// User manager = new User();
+//// try{
+//// manager = userService.getDeptManager(getHostId(), getUser().getDeptId()); // 鑾峰彇閮ㄩ棬棰嗗
+//// }catch (Exception e){
+//// manager = user;
+//// }
+// if (manager.getId().equals(getUserId())) {
+//
+// // 淇敼 settle 姝ラ鏁版嵁
+// List<SettleDto> list = JSON.parseArray(priOnline2.getSettleMsg(), SettleDto.class);
+// for (SettleDto dto : list) {
+// switch (dto.getStep()) {
+// case 1:
+// dto.setCurr(Boolean.FALSE);
+// break;
+// case 2:
+// dto.setCurr(Boolean.TRUE);
+// if (Cools.isEmpty(dto.getMsg())){
+// dto.setMsg(manager.getNickname() + "瀹℃壒閫氳繃");
+// }else {
+// dto.setMsg(dto.getMsg()+PZH+DateUtils.convert(new Date())+" " + manager.getNickname() + "瀹℃壒閫氳繃");
+// }
+// dto.setTime(DateUtils.convert(now));
+// break;
+// default:
+// break;
+// }
+// }
+// priOnline2.setSettleMsg(JSON.toJSONString(list));
+//
+// // 淇敼瑙勫垝鍗曠姸鎬�
+// priOnline2.setSettle(2); // 鐢宠閫氳繃
+// priOnline2.setUpdateTime(now);
+// priOnline2.setUpdateUserId(getUserId());
+// priOnline2.setMemberId(plan.getUserId());
+// if (!priOnline2Service.updateById(priOnline2)) {
+// throw new CoolException("瀹℃牳澶辫触锛岃鑱旂郴绠$悊鍛�");
+// }
+// } else {
+// return R.error("鎶辨瓑锛屾偍娌℃湁瀹℃牳鐨勬潈闄愶紒锛侊紒");
+// }
+// break;
+ case 1:
+ // 涓氬姟鍛�
+ User salesman0 = userService.selectById(priOnline2.getUserId());
+ if (!getUserId().equals(salesman0.getId())) {
+ return R.error("鎶辨瓑锛屾偍鏃犻渶纭锛侊紒锛�");
+ }
+ // 淇敼 settle 姝ラ鏁版嵁
+ List<SettleDto> list2 = JSON.parseArray(priOnline2.getSettleMsg(), SettleDto.class);
+ for (SettleDto dto : list2) {
+ switch (dto.getStep()) {
+ case 1:
+ dto.setCurr(Boolean.TRUE);
+ break;
+ case 2:
+ dto.setCurr(Boolean.TRUE);
+ if (Cools.isEmpty(dto.getMsg())){
+ dto.setMsg("涓氬姟鍛�" + salesman0.getNickname() + "瀹℃壒閫氳繃");
+ }else {
+ dto.setMsg(dto.getMsg()+PZH+DateUtils.convert(new Date())+" "+"涓氬姟鍛�" + salesman0.getNickname() + "瀹℃壒閫氳繃");
+ }
+ dto.setTime(DateUtils.convert(new Date()));
+ break;
+ default:
+ break;
+ }
+ }
+ priOnline2.setSettleMsg(JSON.toJSONString(list2));
+ // 淇敼瑙勫垝鍗曠姸鎬�
+ priOnline2.setSettle(2); // 瀹℃壒閫氳繃
+ priOnline2.setStatus(1);
+ priOnline2.setUpdateTime(new Date());
+ priOnline2.setUpdateUserId(getUserId());
+
+ if (!priOnline2Service.updateById(priOnline2)) {
+ throw new CoolException("纭澶辫触锛岃鑱旂郴绠$悊鍛�");
+ }
+ try{
+ priQuoteAdd(priOnline2.getId(),plannerId);
+ }catch (Exception e){
+ return R.error("鑷姩鐢熸垚鎶ヤ环鍗曞け璐�");
+ }
+ break;
+ default:
+ return R.error();
+ }
+ return R.ok("瀹℃壒鎴愬姛");
+ }
+
+ public void priQuoteAdd(Long priOnlineId,Long priType){
+ Pri pri = null;
+ if (priType==1L){
+ pri = priService.selectById(114);
+ }else {
+ pri = priService.selectById(115);
+ }
+
+ PriOnline2 priOnline2 = priOnline2Service.selectById(priOnlineId);
+
+ PriQuote priQuote = new PriQuote();
+ priQuote.setCreateTime(new Date());
+ priQuote.setTitle(pri.getTitle());
+ priQuote.setTemplateName(priOnline2.getTemplateName());
+ priQuote.setSheetData(pri.getSheetData());
+ priQuote.setPriOnlineId(priOnlineId);
+ priQuote.setItemId(priOnline2.getItemId());
+ priQuote.setOrderNum(priOnline2.getOrderNum());
+ SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
+ priQuote.setInOrderNum(format.format(new Date()));
+ //涓氬姟鍛�
+ Plan plan = planService.selectById(priQuote.getItemId());
+ User userUp = userService.selectById(plan.getUserId());
+ //涓氬姟鍛�
+ priQuote.setUserId(userUp.getId());
+ //鏇存柊浜哄憳
+ priQuote.setUpdateUserId(getUserId());
+ //鎵�灞為儴闂�
+ priQuote.setDeptId(userUp.getDeptId());
+ //鏇存柊鏃堕棿
+ priQuote.setUpdateTime(new Date());
+ //妯℃澘
+ Integer i = priType == 1L ? 1 : 2;
+ priQuote.setTemplate(i.toString());
+
+ //璁剧疆椤圭洰娴佺▼
+ plan.setStep(3);
+
+// priQuote.setForm(JSON.toJSONString(map)); // 鑷畾涔夎〃鍗曞唴瀹�
+ priQuote.setSettle(1); // 1.寮�濮�
+ User manager = new User();
+ try{
+ manager = userService.getDeptManager(getHostId(), getUser().getDeptId()); // 鑾峰彇閮ㄩ棬棰嗗
+ }catch (Exception e){
+ manager = getUser();
+ }
+ priQuote.setMemberId(manager.getId());
+
+ ProcessPermissions processPermissions = processPermissionsService.selectOne(new EntityWrapper<ProcessPermissions>().eq("process_memo", 2).eq("process", "3-1"));//2锛氭姤浠锋祦绋�
+ User president = userService.selectById(processPermissions.getUserId()); // 鑾峰彇鎶ヤ环娴佺▼鑺傜偣3-1纭浜�
+ priQuote.setSettleMsg(JSON.toJSONString(SettleDto.initPriQuote(plan, manager,president,getUser())));
+
+ planService.updateById(plan);
+
+ priQuoteService.insert(priQuote);
+ }
+
+ @PostMapping(value = "/priOnline2/priQuoteAdd/list/auth")
+ @ManagerAuth
+ public R priOnline2priQuoteAdd(@RequestParam Long planId){
+ List<KeyValueVo> vos = new ArrayList<>();
+ vos.add(new KeyValueVo("鎶ヤ环妯℃澘1", 1L));
+ vos.add(new KeyValueVo("鎶ヤ环妯℃澘2", 2L));
+ return R.ok().add(vos);
+ }
+
}
--
Gitblit v1.9.1