| | |
| | | import com.core.common.R; |
| | | import com.core.domain.KeyValueVo; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.crm.common.entity.PhoneCodeTypeParam; |
| | | import com.zy.crm.common.model.SettleDto; |
| | | import com.zy.crm.common.web.BaseController; |
| | | import com.zy.crm.manager.entity.*; |
| | |
| | | @Autowired |
| | | private PlanTypeService planTypeService; |
| | | |
| | | @Autowired |
| | | private SmsCodeService smsCodeService; |
| | | |
| | | String PZH=" ———————————————————————————————————————————————————————————————————————————————— "; |
| | | |
| | | @RequestMapping(value = "/priQuote/{id}/auth") |
| | |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<PriQuote> wrapper = new EntityWrapper<>(); |
| | | wrapper.setSqlSelect("id,title,create_time as createTime,filepath,item_id as itemId,order_num as orderNum,template_name as templateName,sheet_data as sheetData,user_id as userId,dept_id as deptId,settle,settle_msg as settleMsg,form,update_user_id as updateUserId,update_time as updateTime,in_order_num as inOrderNum,member_id as memberId,template"); |
| | | wrapper.setSqlSelect("id,title,create_time as createTime,plan_id as planId,filepath,item_id as itemId,order_num as orderNum,template_name as templateName,sheet_data as sheetData,user_id as userId,dept_id as deptId,settle,settle_msg as settleMsg,form,update_user_id as updateUserId,update_time as updateTime,in_order_num as inOrderNum,member_id as memberId,template"); |
| | | // wrapper.in("member_id", getUserRoleBelongsToUserId()); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | |
| | | } |
| | | } |
| | | 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); |
| | |
| | | priQuote.setUpdateTime(new Date()); |
| | | //模板 |
| | | priQuote.setTemplate(map.get("template").toString()); |
| | | |
| | | priQuote.setPlanId(priOnline2.getPlanId()); |
| | | |
| | | |
| | | |
| | |
| | | if (!priQuoteService.updateById(priQuote)) { |
| | | throw new CoolException("审核失败,请联系管理员"); |
| | | } |
| | | if (!smsCodeService.sendSmsCodeText(planLeader.getMobile(), PhoneCodeTypeParam.ALIYUN_M1ABAC630E)) { |
| | | return R.ok("审批成功但短信发送失败!"); |
| | | } |
| | | |
| | | } else { |
| | | return R.error("抱歉,您没有审核的权限"); |
| | |
| | | if (!priQuoteService.updateById(priQuote)) { |
| | | throw new CoolException("审核失败,请联系管理员"); |
| | | } |
| | | User phoneUser = userService.selectById(priQuote.getUserId()); |
| | | if (!smsCodeService.sendSmsCodeText(phoneUser.getMobile(), PhoneCodeTypeParam.ALIYUN_M1ABAC630E)) { |
| | | return R.ok("审批成功但短信发送失败!"); |
| | | } |
| | | break; |
| | | case 3: |
| | | // 业务员 |