|
@@ -472,45 +472,13 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
|
|
|
targetUserList.add(owner);
|
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
|
|
|
if (wxCorpInfo != null) {
|
|
|
- String corpUserString = targetUserList.stream().map(tl -> tl.getCorpwxUserid()).collect(Collectors.joining("|"));
|
|
|
- ExpenseMainType mainType = expenseMainTypeService.getById(sheet.getType());
|
|
|
//推送到企业微信
|
|
|
- JSONObject json=new JSONObject();
|
|
|
- JSONArray dataJson=new JSONArray();
|
|
|
- JSONObject jsonObj=new JSONObject();
|
|
|
- jsonObj.put("key", "报销人");
|
|
|
- jsonObj.put("value",("$userName="+owner.getCorpwxUserid()+"$"));
|
|
|
- JSONObject jsonObj1=new JSONObject();
|
|
|
- jsonObj1.put("key", "填报日期");
|
|
|
- jsonObj1.put("value",sheet.getCreateDate()==null?"":sheet.getCreateDate());
|
|
|
- JSONObject jsonObj2=new JSONObject();
|
|
|
- jsonObj2.put("key", "票据类型");
|
|
|
- jsonObj2.put("value",mainType.getName());
|
|
|
- JSONObject jsonObj3=new JSONObject();
|
|
|
- jsonObj2.put("key", "提示");
|
|
|
- jsonObj2.put("value","请及时填写报销单信息");
|
|
|
- dataJson.add(jsonObj);
|
|
|
- dataJson.add(jsonObj1);
|
|
|
- dataJson.add(jsonObj2);
|
|
|
- dataJson.add(jsonObj3);
|
|
|
- json.put("template_id","tty9TkCAAALUiWvjdoDg_PZf48gwucZA");
|
|
|
- json.put("url","https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://worktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=expense#wechat_redirect");
|
|
|
- json.put("content_item",dataJson);
|
|
|
- wxCorpInfoService.sendWXCorpTemplateMsg(wxCorpInfo,corpUserString, json);
|
|
|
+ StringBuilder stringBuilder = new StringBuilder();
|
|
|
+ stringBuilder.append("$userName="+owner.getCorpwxUserid()+"$")
|
|
|
+ .append(":有票据类型为机械费用的报销单待填写");
|
|
|
+ wxCorpInfoService.sendWXCorpMsg(wxCorpInfo,owner.getCorpwxUserid(), stringBuilder.toString(), "expense",
|
|
|
+ WxCorpInfoServiceImpl.TEXT_CARD_MSG_EXPENSE_UN);
|
|
|
}
|
|
|
-
|
|
|
- List<Information> informationList=new ArrayList<>();
|
|
|
- for (User item : targetUserList) {
|
|
|
- Information information=new Information();
|
|
|
- information.setUserId(item.getId());
|
|
|
- information.setTime(LocalDateTime.now());
|
|
|
- information.setMsg("机械费用报销待报销人填写信息");
|
|
|
- information.setType(3);
|
|
|
- information.setContent(sheet.getCreateDate()+"");
|
|
|
- informationList.add(information);
|
|
|
- }
|
|
|
- informationService.saveBatch(informationList);
|
|
|
-
|
|
|
}
|
|
|
//柘中报销人填写报销单信息,完善填报金额,第一审核人,第二审核人信息,给第一审核人发送信息
|
|
|
if (!isNew&& auditSetting != null && auditSetting.getAuditType() == 2&&sheet.getReviewProcess()==0){
|
|
@@ -521,49 +489,15 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
|
|
|
targetUserList.add(firstChecker);
|
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
|
|
|
if (wxCorpInfo != null) {
|
|
|
- String corpUserString = targetUserList.stream().map(tl -> tl.getCorpwxUserid()).collect(Collectors.joining("|"));
|
|
|
User targetUser = userMapper.selectById(sheet.getOwnerId());
|
|
|
- ExpenseMainType mainType = expenseMainTypeService.getById(sheet.getType());
|
|
|
//推送到企业微信
|
|
|
- JSONObject json=new JSONObject();
|
|
|
- JSONArray dataJson=new JSONArray();
|
|
|
- JSONObject jsonObj=new JSONObject();
|
|
|
- jsonObj.put("key", "报销人");
|
|
|
- jsonObj.put("value",("$userName="+targetUser.getCorpwxUserid()+"$"));
|
|
|
- JSONObject jsonObj1=new JSONObject();
|
|
|
- jsonObj1.put("key", "填报日期");
|
|
|
- jsonObj1.put("value",sheet.getCreateDate());
|
|
|
- JSONObject jsonObj2=new JSONObject();
|
|
|
- jsonObj2.put("key", "票据类型");
|
|
|
- jsonObj2.put("value",mainType.getName());
|
|
|
- JSONObject jsonObj3=new JSONObject();
|
|
|
- jsonObj3.put("key", "金额");
|
|
|
- jsonObj3.put("value",sheet.getTotalAmount());
|
|
|
- JSONObject jsonObj4=new JSONObject();
|
|
|
- jsonObj4.put("key", "备注");
|
|
|
- jsonObj4.put("value",sheet.getRemark()==null?"":sheet.getRemark());
|
|
|
- dataJson.add(jsonObj);
|
|
|
- dataJson.add(jsonObj1);
|
|
|
- dataJson.add(jsonObj2);
|
|
|
- dataJson.add(jsonObj3);
|
|
|
- dataJson.add(jsonObj4);
|
|
|
- json.put("template_id","tty9TkCAAALUiWvjdoDg_PZf48gwucZA");
|
|
|
- json.put("url","https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://worktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=expense#wechat_redirect");
|
|
|
- json.put("content_item",dataJson);
|
|
|
- wxCorpInfoService.sendWXCorpTemplateMsg(wxCorpInfo,corpUserString, json);
|
|
|
- }
|
|
|
+ StringBuilder stringBuilder = new StringBuilder();
|
|
|
+ stringBuilder.append("报销人:").append("$userName="+targetUser.getCorpwxUserid()+"$")
|
|
|
+ .append(",填写了机械费用报销单的信息,请及时审核");
|
|
|
|
|
|
- List<Information> informationList=new ArrayList<>();
|
|
|
- for (User item : targetUserList) {
|
|
|
- Information information=new Information();
|
|
|
- information.setUserId(item.getId());
|
|
|
- information.setTime(LocalDateTime.now());
|
|
|
- information.setMsg("费用报销待审核");
|
|
|
- information.setType(3);
|
|
|
- information.setContent(sheet.getCreateDate()+"");
|
|
|
- informationList.add(information);
|
|
|
+ wxCorpInfoService.sendWXCorpMsg(wxCorpInfo,firstChecker.getCorpwxUserid(), stringBuilder.toString(), "expense",
|
|
|
+ WxCorpInfoServiceImpl.TEXT_CARD_MSG_EXPENSE_NEED);
|
|
|
}
|
|
|
- informationService.saveBatch(informationList);
|
|
|
}
|
|
|
return msg;
|
|
|
}
|
|
@@ -835,7 +769,7 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
|
|
|
User secondChecker = userMapper.selectById(sheet.getSecondCheckerId());
|
|
|
targetUserList.add(secondChecker);
|
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
|
|
|
- if (wxCorpInfo != null) {
|
|
|
+ if (wxCorpInfo != null&&user.getCompanyId()!=Constant.ZHE_ZHONG_COMPANY_ID) {
|
|
|
String corpUserString = targetUserList.stream().map(tl -> tl.getCorpwxUserid()).collect(Collectors.joining("|"));
|
|
|
User targetUser = userMapper.selectById(sheet.getOwnerId());
|
|
|
ExpenseMainType mainType = expenseMainTypeService.getById(sheet.getType());
|
|
@@ -866,19 +800,28 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
|
|
|
json.put("url","https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://worktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=expense#wechat_redirect");
|
|
|
json.put("content_item",dataJson);
|
|
|
wxCorpInfoService.sendWXCorpTemplateMsg(wxCorpInfo,corpUserString, json);
|
|
|
- }
|
|
|
|
|
|
- List<Information> informationList=new ArrayList<>();
|
|
|
- for (User item : targetUserList) {
|
|
|
- Information information=new Information();
|
|
|
- information.setUserId(item.getId());
|
|
|
- information.setTime(LocalDateTime.now());
|
|
|
- information.setMsg("费用报销待审核");
|
|
|
- information.setType(3);
|
|
|
- information.setContent(sheet.getCreateDate()+"");
|
|
|
- informationList.add(information);
|
|
|
+ List<Information> informationList=new ArrayList<>();
|
|
|
+ for (User item : targetUserList) {
|
|
|
+ Information information=new Information();
|
|
|
+ information.setUserId(item.getId());
|
|
|
+ information.setTime(LocalDateTime.now());
|
|
|
+ information.setMsg("费用报销待审核");
|
|
|
+ information.setType(3);
|
|
|
+ information.setContent(sheet.getCreateDate()+"");
|
|
|
+ informationList.add(information);
|
|
|
+ }
|
|
|
+ informationService.saveBatch(informationList);
|
|
|
+ }{
|
|
|
+ User targetUser = userMapper.selectById(sheet.getOwnerId());
|
|
|
+ //推送到企业微信
|
|
|
+ StringBuilder stringBuilder = new StringBuilder();
|
|
|
+ stringBuilder.append("报销人:").append("$userName="+targetUser.getCorpwxUserid()+"$")
|
|
|
+ .append(",填写了机械费用报销单的信息,请及时审核");
|
|
|
+
|
|
|
+ wxCorpInfoService.sendWXCorpMsg(wxCorpInfo,secondChecker.getCorpwxUserid(), stringBuilder.toString(), "expense",
|
|
|
+ WxCorpInfoServiceImpl.TEXT_CARD_MSG_EXPENSE_NEED);
|
|
|
}
|
|
|
- informationService.saveBatch(informationList);
|
|
|
}
|
|
|
else if(sheet.getReviewProcess()!=null&&sheet.getReviewProcess()==1){
|
|
|
sheet.setReviewProcess(2);
|
|
@@ -946,8 +889,11 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
|
|
|
}
|
|
|
stringBuilder.append("的费用报销申请。");
|
|
|
if (sheet.getStatus() == 2) {
|
|
|
- //驳回加原因
|
|
|
- stringBuilder.append("原因: ").append(denyReason);
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isNotEmpty(denyReason))
|
|
|
+ {
|
|
|
+ //驳回加原因
|
|
|
+ stringBuilder.append("原因: ").append(denyReason);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
String ownerId = sheet.getOwnerId();
|