中扬CRM客户关系管理系统
#
LSH
2023-11-22 0a9160ff7f91d63b5d55a5abee8efe93b68d78dd
src/main/java/com/zy/crm/manager/controller/PriQuoteController.java
@@ -13,6 +13,7 @@
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.*;
@@ -55,6 +56,9 @@
    @Autowired
    private PlanTypeService planTypeService;
    @Autowired
    private SmsCodeService smsCodeService;
    String PZH=" ———————————————————————————————————————————————————————————————————————————————— ";
    @RequestMapping(value = "/priQuote/{id}/auth")
@@ -84,7 +88,7 @@
                  @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);
@@ -124,7 +128,13 @@
            }
        }
        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);
@@ -162,6 +172,8 @@
        priQuote.setUpdateTime(new Date());
        //模板
        priQuote.setTemplate(map.get("template").toString());
        priQuote.setPlanId(priOnline2.getPlanId());
@@ -500,6 +512,9 @@
                    if (!priQuoteService.updateById(priQuote)) {
                        throw new CoolException("审核失败,请联系管理员");
                    }
                    if (!smsCodeService.sendSmsCodeText(planLeader.getMobile(), PhoneCodeTypeParam.ALIYUN_M1ABAC630E)) {
                        return R.ok("审批成功但短信发送失败!");
                    }
                } else {
                    return R.error("抱歉,您没有审核的权限");
@@ -545,6 +560,10 @@
                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:
                // 业务员