From 41df92a5ee14f19e7453cf0674c1537da46be2ca Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期五, 19 四月 2024 15:42:27 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/crm/manager/controller/WeeklyController.java | 321 ++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 269 insertions(+), 52 deletions(-)
diff --git a/src/main/java/com/zy/crm/manager/controller/WeeklyController.java b/src/main/java/com/zy/crm/manager/controller/WeeklyController.java
index 5a13521..c39bd11 100644
--- a/src/main/java/com/zy/crm/manager/controller/WeeklyController.java
+++ b/src/main/java/com/zy/crm/manager/controller/WeeklyController.java
@@ -45,14 +45,28 @@
private WeeklyFollService weeklyFollService;
@Autowired
private SmsCodeService smsCodeService;
+ @Autowired
+ private CstmrService cstmrService;
String PZH = " 鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�� ";
- Integer PBN = 6;
+ Integer PBN = 3;
@RequestMapping(value = "/weekly/{id}/auth")
@ManagerAuth
public R get(@PathVariable("id") String id) {
- return R.ok(weeklyService.selectById(String.valueOf(id)));
+ Weekly weekly = weeklyService.selectById(String.valueOf(id));
+ assert weekly != null;
+ JSONObject resultObj = JSON.parseObject(JSON.toJSONString(weekly));
+ if (!Cools.isEmpty(weekly.getForm())) {
+ JSONObject formObj = JSON.parseObject(weekly.getForm());
+ formObj.forEach(resultObj::putIfAbsent);
+ }
+
+ // 姝ラ鏉$浉鍏�
+ resultObj.put("step", weekly.getSettle().equals(weekly.getSettleSize()) ? 0 : weekly.getSettle() + 1);
+
+ return R.ok().add(resultObj);
+// return R.ok(weeklyService.selectById(String.valueOf(id)));
}
@RequestMapping(value = "/weekly/list/auth")
@@ -71,16 +85,76 @@
return R.ok(weeklyService.selectPage(new Page<>(curr, limit), wrapper));
}
+// private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){
+// for (Map.Entry<String, Object> entry : map.entrySet()){
+// String val = String.valueOf(entry.getValue());
+// if (val.contains(RANGE_TIME_LINK)){
+// String[] dates = val.split(RANGE_TIME_LINK);
+// wrapper.ge(entry.getKey(), DateUtils.convert(dates[0]));
+// wrapper.le(entry.getKey(), DateUtils.convert(dates[1]));
+// } else {
+// wrapper.like(entry.getKey(), val);
+// }
+// }
+// }
+
+ @RequestMapping(value = "/weekly/list/auth2")
+ @ManagerAuth
+ public R list2(@RequestParam(defaultValue = "1")Integer curr,
+ @RequestParam(defaultValue = "10")Integer limit,
+ @RequestParam(required = false)String orderByField,
+ @RequestParam(required = false)String orderByType,
+ @RequestParam(required = false)String condition,
+ @RequestParam Map<String, Object> param) {
+ EntityWrapper<Weekly> wrapper = new EntityWrapper<>();
+ excludeTrash(param);
+ convert(param, wrapper);
+ allLike(Weekly.class, param.keySet(), wrapper, condition);
+ if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
+ return R.ok(weeklyService.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()){
String val = String.valueOf(entry.getValue());
if (val.contains(RANGE_TIME_LINK)){
String[] dates = val.split(RANGE_TIME_LINK);
wrapper.ge(entry.getKey(), DateUtils.convert(dates[0]));
wrapper.le(entry.getKey(), DateUtils.convert(dates[1]));
+ } else if (entry.getKey().equals("dept_id")){
+ if (!val.equals("19")){
+ wrapper.eq(entry.getKey(), val);
+ }
+ } else if (entry.getKey().equals("user_id") && !signDeptId){
+ signUserId = true;
+ wrapper.eq(entry.getKey(), val);
} else {
wrapper.like(entry.getKey(), val);
}
+ }
+ if (!signUserId && !signDeptId){
+ if (getRole().getId()==1){
+ wrapper.or().eq("host_id",getHostId());
+ }else if (getRole().getId()==2){
+ wrapper.eq("dept_id",getDeptId());
+ }else {
+ wrapper.eq("user_id", getUserId());
+ }
+ }
+ if (signHostId){
+ wrapper.or().eq("host_id",getHostId());
}
}
@@ -103,11 +177,27 @@
@RequestMapping(value = "/weekly/delete/auth")
@ManagerAuth
- public R delete(@RequestParam(value="ids[]") Long[] ids){
- for (Long id : ids){
- weeklyService.deleteById(id);
- }
- return R.ok();
+ public R delete(@RequestParam() Long[] ids){
+ try{
+ for (Long id : ids){
+ List<WeeklyDailyReality> weeklyDailyRealities = weeklyDailyRealityService.selectList(new EntityWrapper<WeeklyDailyReality>().eq("weekly_id", id));
+ for (WeeklyDailyReality weeklyDailyReality:weeklyDailyRealities){
+ weeklyDailyRealityService.deleteById(weeklyDailyReality);
+ }
+ List<WeeklyDailyPlan> weeklyDailyPlans = weeklyDailyPlanService.selectList(new EntityWrapper<WeeklyDailyPlan>().eq("weekly_id", id));
+ for (WeeklyDailyPlan weeklyDailyPlan:weeklyDailyPlans){
+ weeklyDailyPlanService.deleteById(weeklyDailyPlan);
+ }
+ List<WeeklyFoll> weeklyFolls = weeklyFollService.selectList(new EntityWrapper<WeeklyFoll>().eq("weekly_id", id));
+ for (WeeklyFoll weeklyFoll:weeklyFolls){
+ weeklyFollService.deleteById(weeklyFoll);
+ }
+ weeklyService.deleteById(id);
+ }
+ }catch (Exception e){
+ throw new CoolException("鍒犻櫎澶辫触锛屽紓甯镐俊鎭細"+e);
+ }
+ return R.ok();
}
@RequestMapping(value = "/weekly/export/auth")
@@ -220,16 +310,33 @@
weekly.setWeeklyNowMonth(TimeCalculatorUtils.WeeklyNowMonthDay(weekly.getStartTime()));
weekly.setWeeklyDayMonth(weekly.getWeeklyMonth()+"鏈堢"+weekly.getWeeklyNowMonth()+"鍛�");
- List<User> userList = new ArrayList<>();
- userList.add(getUser());
User manager = new User();
try {
manager = userService.getDeptManager(getHostId(), getUser().getDeptId()); // 鑾峰彇閮ㄩ棬棰嗗
} catch (Exception e) {
manager = getUser();
}
- userList.add(manager);
- weekly.setDirector(manager.getId());
+ // 鑾峰彇涓氬姟鍛�
+ List<String> initNames = new ArrayList<>();
+ initNames.add("鍒涘缓浜嗗鎵�");
+ initNames.add("涓氬姟鍛樻彁浜�");
+ initNames.add("閮ㄩ棬棰嗗瀹℃牳");
+ List<User> users = new ArrayList<>();
+ users.add(getUser());
+ users.add(getUser());
+ users.add(manager);
+// users.add(getUser());
+ weekly.setSettleMsg(JSON.toJSONString(SettleDto.InItFlowPathTwo(users, initNames, users.size())));
+ weekly.setSettleSize(users.size());
+ weekly.setSettleCurrent(1);
+ if (users.size() > 1) {
+ weekly.setDirector(users.get(1).getId());
+ } else {
+ weekly.setDirector(getUserId());
+ }
+
+
+ weekly.setSettleSize(users.size());
List<Date> dates = TimeCalculatorUtils.WeeklyListDays(dateList);//鑾峰彇鍛ㄤ竴鍒板懆鏃ユ棩鏈�
@@ -261,6 +368,11 @@
try{
weeklyDailyPlanService.insert(weeklyDailyPlan);
+ WeeklyDailyReality weeklyDailyReality = new WeeklyDailyReality();
+ weeklyDailyReality.sync(weeklyDailyPlan);
+ weeklyDailyReality.setWorkContent("");
+ weeklyDailyRealityService.insert(weeklyDailyReality);
+
} catch (Exception e){
log.error("鏂板鏃ヨ鍒掑け璐�"+e);
throw new CoolException("鏂板鏃ヨ鍒掑け璐�");
@@ -268,14 +380,15 @@
}
try{
- insertWeeklyFoll(userList,weekly.getId()); // 鑷姩娣诲姞璺熻繘浜�
+ insertWeeklyFoll(users,weekly.getId()); // 鑷姩娣诲姞璺熻繘浜�
}catch (Exception e){
log.error("鍛ㄦ姤娣诲姞璺熻繘浜哄紓甯革紝寮傚父淇℃伅1锛�"+e);
}
} catch (Exception e){
log.error("鍒涘缓鍛ㄨ鍒掑紓甯革紝寮傚父淇℃伅锛�"+e);
- throw new CoolException("鍒涘缓鍛ㄨ鍒掑け璐�==>"+e);
+ return R.error("鍒涘缓鍛ㄨ鍒掑け璐�==>"+e);
+// throw new CoolException("鍒涘缓鍛ㄨ鍒掑け璐�==>"+e);
}
return R.ok("鍒涘缓鎴愬姛");
@@ -285,10 +398,13 @@
for (User user:userList){
try{
// 鑷姩娣诲姞璺熻繘浜�
- WeeklyFoll weeklyFoll = new WeeklyFoll();
- weeklyFoll.setUserId(user.getId());
- weeklyFoll.setWeeklyId(weeklyId);
- weeklyFollService.insert(weeklyFoll);
+ List<WeeklyFoll> weeklyFolls = weeklyFollService.selectList(new EntityWrapper<WeeklyFoll>().eq("weekly_id", weeklyId).eq("user_id", user.getId()));
+ if (weeklyFolls.size()==0){
+ WeeklyFoll weeklyFoll = new WeeklyFoll();
+ weeklyFoll.setUserId(user.getId());
+ weeklyFoll.setWeeklyId(weeklyId);
+ weeklyFollService.insert(weeklyFoll);
+ }
}catch (Exception e){
log.error("鍛ㄦ姤娣诲姞璺熻繘浜哄紓甯革紝寮傚父淇℃伅2锛�"+e);
continue;
@@ -323,23 +439,21 @@
weekly.setUpdateBy(getUserId());
weekly.setUpdateTime(now);
- List<User> userList = new ArrayList<>();
- userList.add(getUser());
User manager = new User();
try {
manager = userService.getDeptManager(getHostId(), getUser().getDeptId()); // 鑾峰彇閮ㄩ棬棰嗗
} catch (Exception e) {
manager = getUser();
}
- userList.add(manager);
weekly.setDirector(manager.getId());
// 鑾峰彇涓氬姟鍛�
List<String> initNames = new ArrayList<>();
initNames.add("鍒涘缓浜嗗鎵�");
+ initNames.add("涓氬姟鍛樻彁浜�");
initNames.add("閮ㄩ棬棰嗗瀹℃牳");
-// initNames.add("涓氬姟鍛樼‘璁�");
List<User> users = new ArrayList<>();
+ users.add(getUser());
users.add(getUser());
users.add(manager);
// users.add(getUser());
@@ -395,7 +509,8 @@
weeklyService.insert(weekly);
} catch (Exception e) {
log.error("鏂板鍛ㄨ鍒掍富琛ㄥけ璐ワ紝寮傚父淇℃伅锛�"+e);
- throw new CoolException("鏂板鍛ㄨ鍒掍富琛ㄥけ璐�");
+ return R.error("鏂板鍛ㄨ鍒掍富琛ㄥけ璐�");
+// throw new CoolException("鏂板鍛ㄨ鍒掍富琛ㄥけ璐�");
}
List<CstmrUtilsParam> cstmrUtilsParamList = new ArrayList<>();
@@ -421,19 +536,21 @@
weeklyDailyRealityService.insert(weeklyDailyReality);
} catch (Exception e){
log.error("鏂板鏃ヨ鍒掑け璐�"+e);
- throw new CoolException("鏂板鏃ヨ鍒掑け璐�");
+// throw new CoolException("鏂板鏃ヨ鍒掑け璐�");
+ return R.error("鏂板鏃ヨ鍒掑け璐�");
}
}
try{
- insertWeeklyFoll(userList,weekly.getId()); // 鑷姩娣诲姞璺熻繘浜�
+ insertWeeklyFoll(users,weekly.getId()); // 鑷姩娣诲姞璺熻繘浜�
}catch (Exception e){
log.error("鍛ㄦ姤娣诲姞璺熻繘浜哄紓甯革紝寮傚父淇℃伅1锛�"+e);
}
} catch (Exception e){
log.error("鍒涘缓鍛ㄨ鍒掑紓甯革紝寮傚父淇℃伅锛�"+e);
- throw new CoolException("鍒涘缓鍛ㄨ鍒掑け璐�==>"+e);
+// throw new CoolException("鍒涘缓鍛ㄨ鍒掑け璐�==>"+e);
+ return R.error("鍒涘缓鍛ㄨ鍒掑け璐�==>"+e);
}
return R.ok("鍒涘缓鎴愬姛");
@@ -451,13 +568,12 @@
throw new CoolException("鍙傛暟涓虹┖锛歐eeklyDailyPlanList");
} else if (Cools.isEmpty(param.getWeeklyId())){
throw new CoolException("鍙傛暟涓虹┖锛歐eeklyId");
- } else if (Cools.isEmpty(param.getWeeklyType())){
- throw new CoolException("鍙傛暟涓虹┖锛歐eeklyDailyPlanList");
} else if (Cools.isEmpty(param.getType())){
throw new CoolException("鍙傛暟涓虹┖锛歍ype");
- } else if (Cools.isEmpty(param.getWeeklyType())){
- throw new CoolException("鍙傛暟涓虹┖锛歐eekly");
}
+// if (Cools.isEmpty(param.getWeeklyType())){
+// throw new CoolException("鍙傛暟涓虹┖锛歐eekly");
+// }
Date now = new Date();
Weekly weekly = weeklyService.selectById(param.getWeeklyId());
weekly.setUpdateBy(getUserId());
@@ -478,28 +594,40 @@
throw new CoolException("鏇存柊鍛ㄨ鍒掍富琛ㄥけ璐�");
}
- List<CstmrUtilsParam> cstmrUtilsParamList = new ArrayList<>();
+ List<WeeklyDailyPlan> weeklyDailyPlanList = weeklyDailyPlanService.selectList(new EntityWrapper<WeeklyDailyPlan>().eq("weekly_id", weekly.getId()));
+ List<Long> ids = new ArrayList<>();
+ for (WeeklyDailyPlan weeklyDailyPlan: param.getWeeklyDailyPlanList()) {
+ if (!Cools.isEmpty(weeklyDailyPlan.getId())) {
+ ids.add(weeklyDailyPlan.getId());
+ }
+ }
+ try{
+ for (WeeklyDailyPlan weeklyDailyPlan2:weeklyDailyPlanList){
+ if (!ids.contains(weeklyDailyPlan2.getId())){
+ weeklyDailyPlanService.deleteById(weeklyDailyPlan2.getId());
+ }
+ }
+ }catch (Exception e){
+
+ }
for (WeeklyDailyPlan weeklyDailyPlan: param.getWeeklyDailyPlanList()){
WeeklyDailyPlan weeklyDailyPlan1 = new WeeklyDailyPlan();
if (!Cools.isEmpty(weeklyDailyPlan.getId())){
Long weeklyDailyPlanId = weeklyDailyPlan.getId();
weeklyDailyPlan1 = weeklyDailyPlanService.selectById(weeklyDailyPlan.getId());
- if (Cools.isEmpty(weeklyDailyPlan)){
+ if (Cools.isEmpty(weeklyDailyPlan1)){
throw new CoolException("鏇存柊澶辫触锛歩d:"+weeklyDailyPlanId);
}
- if (!Cools.isEmpty(weeklyDailyPlan1.getComment())){
-// weeklyDailyPlan1.setComment(weeklyDailyPlan1.getComment()+";"+weeklyDailyPlan.getComment());
- weeklyDailyPlan1.setComment(weeklyDailyPlan.getComment());
- }else {
- weeklyDailyPlan1.setComment(weeklyDailyPlan.getComment());
- }
+ weeklyDailyPlan1.setComment(weeklyDailyPlan.getComment());
weeklyDailyPlan1.setWorkContent(weeklyDailyPlan.getWorkContent());
weeklyDailyPlan1.setWorkPurpose(weeklyDailyPlan.getWorkPurpose());
+ weeklyDailyPlan1.setWeeklyMatter(weeklyDailyPlan.getWeeklyMatter());
+ weeklyDailyPlan1.setAddr(weeklyDailyPlan.getAddr());
weeklyDailyPlan1.setMemo(weeklyDailyPlan.getMemo());
weeklyDailyPlan1.setUpdateBy(getUserId());
weeklyDailyPlan1.setUpdateTime(now);
if (!Cools.isEmpty(weeklyDailyPlan.getCstmrId())){
- weeklyDailyPlan1.setCstmrId(weeklyDailyPlan1.getCstmrId());
+ weeklyDailyPlan1.setCstmrId(weeklyDailyPlan.getCstmrId());
}
weeklyDailyPlanService.updateById(weeklyDailyPlan1);
@@ -549,13 +677,12 @@
throw new CoolException("鍙傛暟涓虹┖锛歐eeklyDailyRealityList");
} else if (Cools.isEmpty(param.getWeeklyId())){
throw new CoolException("鍙傛暟涓虹┖锛歐eeklyId");
- } else if (Cools.isEmpty(param.getWeeklyType())){
- throw new CoolException("鍙傛暟涓虹┖锛歐eeklyDailyPlanList");
} else if (Cools.isEmpty(param.getType())){
throw new CoolException("鍙傛暟涓虹┖锛歍ype");
- } else if (Cools.isEmpty(param.getWeeklyType())){
- throw new CoolException("鍙傛暟涓虹┖锛歐eekly");
}
+// else if (Cools.isEmpty(param.getWeeklyType())){
+// throw new CoolException("鍙傛暟涓虹┖锛歐eekly");
+// }
Date now = new Date();
Weekly weekly = weeklyService.selectById(param.getWeeklyId());
weekly.setUpdateBy(getUserId());
@@ -576,23 +703,35 @@
throw new CoolException("鏇存柊鍛ㄨ鍒掍富琛ㄥけ璐�");
}
- List<CstmrUtilsParam> cstmrUtilsParamList = new ArrayList<>();
+ List<WeeklyDailyReality> weeklyDailyRealitieList = weeklyDailyRealityService.selectList(new EntityWrapper<WeeklyDailyReality>().eq("weekly_id", weekly.getId()));
+ List<Long> ids = new ArrayList<>();
+ for (WeeklyDailyReality weeklyDailyReality: param.getWeeklyDailyRealityList()) {
+ if (!Cools.isEmpty(weeklyDailyReality.getId())) {
+ ids.add(weeklyDailyReality.getId());
+ }
+ }
+ try{
+ for (WeeklyDailyReality weeklyDailyReality2:weeklyDailyRealitieList){
+ if (!ids.contains(weeklyDailyReality2.getId())){
+ weeklyDailyRealityService.deleteById(weeklyDailyReality2.getId());
+ }
+ }
+ }catch (Exception e){
+
+ }
for (WeeklyDailyReality weeklyDailyReality: param.getWeeklyDailyRealityList()){
WeeklyDailyReality weeklyDailyReality1 = new WeeklyDailyReality();
if (!Cools.isEmpty(weeklyDailyReality.getId())){
- Long weeklyDailyPlanId = weeklyDailyReality.getId();
+ Long weeklyDailyRealityId = weeklyDailyReality.getId();
weeklyDailyReality1 = weeklyDailyRealityService.selectById(weeklyDailyReality.getId());
- if (Cools.isEmpty(weeklyDailyReality)){
- throw new CoolException("鏇存柊澶辫触锛歩d:"+weeklyDailyPlanId);
+ if (Cools.isEmpty(weeklyDailyReality1)){
+ throw new CoolException("鏇存柊澶辫触锛歩d:"+weeklyDailyRealityId);
}
- if (!Cools.isEmpty(weeklyDailyReality1.getComment())){
-// weeklyDailyReality1.setComment(weeklyDailyReality1.getComment()+";"+weeklyDailyReality.getComment());
- weeklyDailyReality1.setComment(weeklyDailyReality.getComment());
- }else {
- weeklyDailyReality1.setComment(weeklyDailyReality.getComment());
- }
+ weeklyDailyReality1.setComment(weeklyDailyReality.getComment());
weeklyDailyReality1.setWorkContent(weeklyDailyReality.getWorkContent());
weeklyDailyReality1.setWorkPurpose(weeklyDailyReality.getWorkPurpose());
+ weeklyDailyReality1.setWeeklyMatter(weeklyDailyReality.getWeeklyMatter());
+ weeklyDailyReality1.setAddr(weeklyDailyReality.getAddr());
weeklyDailyReality1.setMemo(weeklyDailyReality.getMemo());
weeklyDailyReality1.setUpdateBy(getUserId());
weeklyDailyReality1.setUpdateTime(now);
@@ -754,4 +893,82 @@
}
return R.ok("鍥為��鎴愬姛");
}
+
+ @RequestMapping(value = "/weekly/from/add/phone/auth")
+ @ManagerAuth(memo = "鍛ㄨ鍒�/鏃ヨ鍒�/鏃ュ疄闄�")
+ @Transactional
+ public R formAddModifyPhone(@RequestBody WeeklyDomainParam param){
+ try{
+ if (Cools.isEmpty(param)){
+ throw new CoolException("鍙傛暟涓虹┖锛歐eeklyDomainParam");
+ } else if (Cools.isEmpty(param.getWeeklyDailyRealityList()) || param.getWeeklyDailyRealityList().size()==0){
+ throw new CoolException("鍙傛暟涓虹┖锛歐eeklyDailyRealityList");
+ } else if (Cools.isEmpty(param.getWeeklyId())){
+ throw new CoolException("鍙傛暟涓虹┖锛歐eeklyId");
+// } else if (Cools.isEmpty(param.getType())){
+// throw new CoolException("鍙傛暟涓虹┖锛歍ype");
+// } else if (Cools.isEmpty(param.getWeeklyType())){
+// throw new CoolException("鍙傛暟涓虹┖锛歐eekly");
+ }
+ Date now = new Date();
+ Weekly weekly = weeklyService.selectById(param.getWeeklyId());
+ weekly.setUpdateBy(getUserId());
+ weekly.setUpdateTime(now);
+
+
+ List<Date> dateList = new ArrayList<>();//鑾峰彇鍛ㄤ竴涓庡懆鏃ユ棩鏈�
+ dateList = TimeCalculatorUtils.WeeklyMondayAndSundayNow(weekly.getStartTime());
+
+ List<Date> dates = TimeCalculatorUtils.WeeklyListDays(dateList);//鑾峰彇鍛ㄤ竴鍒板懆鏃ユ棩鏈�
+
+ try{
+ weeklyService.updateById(weekly);
+ } catch (Exception e) {
+ log.error("鏇存柊鍛ㄨ鍒掍富琛ㄥけ璐ワ紝寮傚父淇℃伅锛�"+e);
+ throw new CoolException("鏇存柊鍛ㄨ鍒掍富琛ㄥけ璐�");
+ }
+
+ List<CstmrUtilsParam> cstmrUtilsParamList = new ArrayList<>();
+ for (WeeklyDailyReality weeklyDailyReality: param.getWeeklyDailyRealityList()){
+ Cstmr cstmr = null;
+ if (!Cools.isEmpty(weeklyDailyReality.getCstmrName())){
+ cstmr = cstmrService.selectByName(getHostId(), weeklyDailyReality.getCstmrName());
+ if(Cools.isEmpty(cstmr)){
+ throw new CoolException("鏈煡璇㈠埌鐢叉柟鍗曚綅锛�");
+ }else {
+ weeklyDailyReality.setCstmrId(cstmr.getId());
+ }
+ }
+ weeklyDailyReality.setHostId(getHostId());
+ weeklyDailyReality.setDeptId(getDeptId()); // 鎵�灞為儴闂�
+ weeklyDailyReality.setUserId(getUserId()); // 鎵�灞炰汉鍛�
+
+ weeklyDailyReality.setDirector(getUserId()); // 鎵�灞炰汉鍛�
+
+ weeklyDailyReality.setCreateBy(getUserId());
+ weeklyDailyReality.setCreateTime(now);
+ weeklyDailyReality.setUpdateBy(getUserId());
+ weeklyDailyReality.setUpdateTime(now);
+
+ weeklyDailyReality.setStatus(weekly.getStatus());
+
+ weeklyDailyReality.setDailyTime(dates.get(weeklyDailyReality.getWeeklyDay()-1));
+ weeklyDailyReality.setWeeklyId(weekly.getId());
+
+ try{
+ weeklyDailyRealityService.insert(weeklyDailyReality);
+ } catch (Exception e){
+ log.error("鏂板鏃ヨ鍒掑け璐�"+e);
+ throw new CoolException("鏂板鏃ヨ鍒掑け璐�");
+ }
+
+ }
+
+ } catch (Exception e){
+ log.error("鏇存柊鍛ㄨ鍒掑紓甯革紝寮傚父淇℃伅锛�"+e);
+ throw new CoolException("鏇存柊鍛ㄨ鍒掑け璐�==>"+e);
+ }
+
+ return R.ok("鏇存柊鎴愬姛");
+ }
}
--
Gitblit v1.9.1