中扬CRM客户关系管理系统
#
LSH
2023-11-24 2c7a0b5c9cded118d3c3c46211adf40fe558d67b
src/main/java/com/zy/crm/manager/controller/PlanController.java
@@ -9,6 +9,7 @@
import com.core.common.*;
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.service.OssService;
import com.zy.crm.common.utils.FileSaveExampleUtil;
@@ -205,6 +206,10 @@
            throw new CoolException("保持失败,请重试");
        }
        if (!smsCodeService.sendSmsCodeText(planLeader.getMobile(), PhoneCodeTypeParam.ALIYUN_M1ABAC630E)) {
            return R.ok("创建成功但短信发送失败!");
        }
        return R.ok();
    }
@@ -289,6 +294,9 @@
        hostPlan.setHostPlanId(hostPlanId);
        if (!planService.updateById(hostPlan)) {
            throw new CoolException("更新失败,请重试");
        }
        if (!smsCodeService.sendSmsCodeText(planLeader.getMobile(), PhoneCodeTypeParam.ALIYUN_M1ABAC630E)) {
            return R.ok("创建成功但短信发送失败!");
        }
        return R.ok("保存成功");
    }
@@ -376,7 +384,8 @@
    @RequestMapping(value = "/plan/insert/file/auth")
//    @ManagerAuth
    public R insertFile(@RequestParam("planId") String planId, @RequestParam("filename") String filename, @RequestParam("filesize") Long filesize) {
    public R insertFile(@RequestParam("planId") String planId, @RequestParam("filename") String filename,
                        @RequestParam("filesize") Long filesize,@RequestParam("token") String token) {
        try {
//            InputStream inputStream = file.getInputStream();
//            // 获取文件的内容类型
@@ -385,12 +394,17 @@
////            String url = "http://tjdt.oss-cn-hangzhou.aliyuncs.com/"+file.getOriginalFilename();
//            String[] names = url.split("com/");
//            String name= names[1];
            String nickname = null;
            Long userId = null;
            if (!Cools.isEmpty(token)) {
                User user = getUser(token);
                nickname = user.getNickname();
                userId = user.getId();
            }
            String[] split = planId.split("-");
            int id = Integer.parseInt(split[1]);
            String url = "http://zhongyang-ftpserver.oss-cn-hangzhou.aliyuncs.com/" + filename;
            planService.increasePlanUrl(id, url, filename, filesize);
            planService.increasePlanUrl(id, url, filename, filesize,nickname,userId);
            return R.ok();
        } catch (Exception e) {
            System.out.println(e);
@@ -437,7 +451,8 @@
                String url = planService.selectPlanUrlPlanIdUrl(id2);
                String name = planService.selectPlanUrlPlanIdName(id2);
                Long size = planService.selectPlanUrlPlanIdSize(id2);
                FileSaveExampleUtil.FileDTO dto = new FileSaveExampleUtil.FileDTO(name,size,url);
                String userName = planService.selectPlanUrlPlanIdUserName(id2);
                FileSaveExampleUtil.FileDTO dto = new FileSaveExampleUtil.FileDTO(name,size,url,userName);
                fileDTOS.add(dto);
            }
//            List<FileSaveExampleUtil.FileDTO> fileDTOS = FileSaveExampleUtil.viewFileList(savePath);
@@ -584,11 +599,6 @@
                plan.setUpdateBy(getUserId());
                plan.setUpdateTime(new Date());
                boolean sendSmsCode = smsCodeService.sendSmsCodeText(planner.getMobile());
                if (!sendSmsCode) {
                    System.out.println("短信发送失败!");
                }
                if (!planService.updateById(plan)) {
                    throw new CoolException("审核失败,请联系管理员");
                }
@@ -599,6 +609,10 @@
                planFoll.setUserId(planner.getId());
                if (!planFollService.insert(planFoll)) {
                    throw new CoolException("审核失败,请联系管理员");
                }
                if (!smsCodeService.sendSmsCodeText(planner.getMobile(), PhoneCodeTypeParam.ALIYUN_M6F3C81FE3)) {
                    return R.ok("审核成功但短信发送失败!");
                }
                break;
            case 2:
@@ -645,6 +659,9 @@
                if (!planService.updateById(plan)) {
                    throw new CoolException("审核失败,请联系管理员");
                }
                if (!smsCodeService.sendSmsCodeText(salesman.getMobile(), PhoneCodeTypeParam.ALIYUN_M1ABAC630E)) {
                    return R.ok("审核成功但短信发送失败!");
                }
                break;
            case 3:
@@ -895,7 +912,7 @@
     * excel导入
     */
    @PostMapping(value = "/plan/excel/import/auth")
    @ManagerAuth(memo = "甲方单位Excel导入")
    @ManagerAuth(memo = "客户信息Excel导入")
//    @Transactional
    public R planExcelImport(MultipartFile file) throws IOException {
        InputStream inStream = file.getInputStream();