中扬CRM客户关系管理系统
#
luxiaotao1123
2022-11-24 5a9db42037a7f5659fe7aa393e43535083a56d87
src/main/java/com/zy/crm/manager/controller/PlanController.java
@@ -11,6 +11,7 @@
import com.core.common.R;
import com.core.domain.KeyValueVo;
import com.core.exception.CoolException;
import com.zy.crm.common.model.SettleDto;
import com.zy.crm.common.web.BaseController;
import com.zy.crm.manager.controller.result.FollowerTableVo;
import com.zy.crm.manager.entity.Plan;
@@ -59,6 +60,9 @@
            return R.error("当前规划单类型已被禁用");
        }
        resultObj.put("formHtml", planType.getHtml());
        // 步骤条相关
        resultObj.put("step", this.getStepOfSettle(plan.getSettle()));
        return R.ok().add(resultObj);
    }
@@ -115,6 +119,7 @@
        plan.setForm(JSON.toJSONString(param));     // 自定义表单内容
        plan.setSettle(1);  // 1.开始
        plan.setSettleMsg(JSON.toJSONString(SettleDto.init(plan)));
        if (!planService.insert(plan)) {
            throw new CoolException("保持失败,请重试");
@@ -135,6 +140,7 @@
        plan.setUpdateTime(new Date());
        plan.setForm(JSON.toJSONString(param));     // 自定义表单内容
        plan.setSettleMsg(JSON.toJSONString(SettleDto.init(plan)));
        if (!planService.updateById(plan)) {
            throw new CoolException("保持失败,请重试");
@@ -285,4 +291,30 @@
        return R.ok("删除成功");
    }
    /*************************************** 步骤条相关 **********************************************/
    private Integer getStepOfSettle(int settle){
        switch (settle){
            case 1:
            case 2:
                return 2;
            case 3:
            case 4:
                return 3;
            case 5:
            case 6:
                return 4;
            case 7:
                return 0;
            default:
                return 1;
        }
    }
}