中扬CRM客户关系管理系统
Junjie
2023-11-10 bb71b47a43244e6db57cbc3cd0223bc5a64023d7
Merge remote-tracking branch 'origin/zycrm' into zycrm
17个文件已修改
10个文件已添加
1309 ■■■■ 已修改文件
src/main/java/com/zy/crm/manager/controller/PlanController.java 154 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/manager/controller/PriOnline2Controller.java 204 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/manager/controller/ReimburseOnlineController.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/manager/entity/AllFoll.java 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/manager/entity/Plan.java 134 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/manager/entity/PlanType.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/manager/entity/PriOnline2.java 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/manager/entity/PriOnline2Foll.java 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/manager/entity/ReimburseOnlineDetl.java 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/manager/mapper/AllFollMapper.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/manager/mapper/PriOnline2FollMapper.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/manager/mapper/PriOnline2Mapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/manager/service/AllFollService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/manager/service/PriOnline2FollService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/manager/service/PriOnline2Service.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/manager/service/impl/AllFollServiceImpl.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/manager/service/impl/PriOnline2FollServiceImpl.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/manager/service/impl/PriOnline2ServiceImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/AllFollMapper.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/PlanMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/PriOnline2FollMapper.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/PriOnline2Mapper.xml 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/plan/plan.js 145 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/priOnline2/priOnline.js 148 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/reimburseOnline/reimburseOnline.js 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/plan/plan.html 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/priOnline2/priOnline.html 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/manager/controller/PlanController.java
@@ -6,10 +6,7 @@
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.core.annotations.ManagerAuth;
import com.core.common.BaseRes;
import com.core.common.Cools;
import com.core.common.DateUtils;
import com.core.common.R;
import com.core.common.*;
import com.core.domain.KeyValueVo;
import com.core.exception.CoolException;
import com.zy.crm.common.model.SettleDto;
@@ -118,6 +115,23 @@
        });
    }
    @RequestMapping(value = "/plan/assistantPlan/view/auth")
    @ManagerAuth(memo = "查看副规划申请单")
    @Transactional
    public R assistantPlanView(@RequestParam Long hostPlanId) {
        Plan plan = planService.selectById(hostPlanId);
        if (plan.getAssistantHostSign()==1){
            EntityWrapper<Plan> wrapper = new EntityWrapper<>();
            wrapper.eq("id",plan.getHostPlanId());
            Page<Plan> planPage = planService.selectPage(new Page<>(1, 1), wrapper);
            return R.ok(planPage);
        }
        EntityWrapper<Plan> wrapper = new EntityWrapper<>();
        wrapper.eq("id",plan.getAssistantPlanId());
        Page<Plan> planPage = planService.selectPage(new Page<>(1, 1), wrapper);
        return R.ok(planPage);
    }
    @RequestMapping(value = "/plan/add/auth")
    @ManagerAuth(memo = "添加规划申请单")
    @Transactional
@@ -169,6 +183,11 @@
            manager = getUser();
        }
        PlanType planType = planTypeService.selectById(plan.getPlanType());
        if (planType.getType().equals(2)) {
            plan.setStatus2(0);
        }else {
            plan.setStatus2(10);
        }
        User planLeader = planTypeService.findPlanLeader(planType);
        plan.setSettleMsg(JSON.toJSONString(SettleDto.init(plan, manager, planLeader)));
@@ -187,6 +206,91 @@
        }
        return R.ok();
    }
    @RequestMapping(value = "/plan/assistantPlan/add/auth")
    @ManagerAuth(memo = "添加副规划申请单")
    @Transactional
    public R assistantPlanAdd(@RequestParam Long hostPlanId) {
        Plan hostPlan = planService.selectById(hostPlanId);
        if (hostPlan.getAssistantHostSign()!=0){
            return R.error("此规划单不需要创建副流程");
        }
        PlanType planType2 = planTypeService.selectById(hostPlan.getPlanType());
        if (planType2.getType()!=2){
            return R.error("此规划单不需要创建副流程");
        }
        if (!Cools.isEmpty(hostPlan.getAssistantPlanId()) && hostPlan.getAssistantPlanId()!=0){
            return R.error("此规划单已存在副规划单,id为"+hostPlan.getAssistantPlanId());
        }
        // pre
        Plan plan = new Plan(hostPlan);
        // begin
        Long hostId = getHostId();
        if (planService.selectByUuid(hostId, plan.getUuid()) != null) {
            throw new CoolException("规划单已存在");
        }
        Order order = orderService.selectById(plan.getOrderId());
        if (Cools.isEmpty(order)) {
            throw new CoolException("跟踪项目不存在");
        }
        if (!order.getDirector().equals(getUserId())){
            throw new CoolException("只允许跟踪项目负责人添加所选项目规划申请单");
        }
        Date now = new Date();
        plan.setHostId(hostId);
        plan.setUuid(planService.getUuid(hostId));  // 规划单代号
        plan.setDeptId(getDeptId());               // 所属部门
        plan.setUserId(getUserId());               // 所属人员
        plan.setAppleTime(now);
        plan.setCreateBy(getUserId());
        plan.setCreateTime(now);
        plan.setUpdateBy(getUserId());
        plan.setUpdateTime(now);
        plan.setStatus(0);
        plan.setStatus2(0);
        plan.setStep(1);
        plan.setSettle(1);  // 1.开始
        plan.setAssistantHostSign(1);//副规划单
        User manager = new User();
        try{
            manager = userService.getDeptManager(getHostId(), getUser().getDeptId());        // 获取部门领导
        }catch (Exception e){
            manager = getUser();
        }
        PlanType planType = new PlanType(hostPlan.getHostId(),1);//1:货架
        User planLeader = planTypeService.findPlanLeader(planType);
        plan.setSettleMsg(JSON.toJSONString(SettleDto.init(plan, manager, planLeader)));
        plan.setDirector(planLeader.getId());
        if (!planService.insert(plan)) {
            throw new CoolException("保存失败,请重试");
        }
        plan.setAssistantPlanId(plan.getId());
        plan.setHostPlanId(hostPlanId);
        if (!planService.updateById(plan)) {
            throw new CoolException("更新失败,请重试");
        }
        // 自动添加跟进人
        PlanFoll planFoll = new PlanFoll();
        planFoll.setPlanId(plan.getId());
        planFoll.setUserId(planLeader.getId());
        if (!planFollService.insert(planFoll)) {
            throw new CoolException("保存失败,请重试");
        }
        hostPlan.setAssistantPlanId(plan.getId());
        hostPlan.setHostPlanId(hostPlanId);
        if (!planService.updateById(hostPlan)) {
            throw new CoolException("更新失败,请重试");
        }
        return R.ok("保存成功");
    }
    @RequestMapping(value = "/plan/update/auth")
@@ -249,6 +353,21 @@
             int priOnline2 = priOnline2Service.selectCount(new EntityWrapper<PriOnline2>().eq("item_id", id));
             if (priOnline2!=0){
                 return R.error("存在关联的核价单,禁止删除!!!");
             }
             Plan planA = planService.selectById(id);
             if (planA.getAssistantHostSign()==1){
                 Plan planB = planService.selectById(planA.getHostPlanId());
                 planB.setAssistantPlanId(0L);
                 planB.setHostPlanId(0L);
                 planB.setStatus2(0);
                 planService.updateById(planB);
             }else {
                 if (!Cools.isEmpty(planA.getAssistantPlanId()) && planA.getAssistantPlanId()!=0){
                     Plan planB = planService.selectById(planA.getAssistantPlanId());
                     if (!Cools.isEmpty(planB)){
                         return R.error("存在关联的副规划单,禁止删除!!! 副规划单ID:"+planB.getId());
                     }
                 }
             }
             planService.deleteById(id);
        }
@@ -419,8 +538,7 @@
//                break;
            case 1:
                // 查找规划组长
                PlanType planType = planTypeService.selectById(plan.getPlanType());
                User planLeader = planTypeService.findPlanLeader(planType);
                User planLeader = userService.selectById(plan.getDirector());
                if (Cools.isEmpty(planLeader)) {
                    throw new CoolException("未查找到规划组长,请联系管理员");
                }
@@ -562,6 +680,12 @@
                plan.setUpdateBy(getUserId());
                plan.setUpdateTime(new Date());
                if (plan.getAssistantHostSign()==1){
                    Plan planHost = planService.selectById(plan.getHostPlanId());
                    planHost.setStatus2(1);
                    planService.updateById(planHost);
                }
                if (!planService.updateById(plan)) {
                    throw new CoolException("审核失败,请联系管理员");
                }
@@ -625,6 +749,9 @@
        }
        // 查找规划组长
        PlanType planType = planTypeService.selectById(plan.getPlanType());
        if (plan.getAssistantHostSign()==1){
            planType.setType(1);
        }
        User planLeader = planTypeService.findPlanLeader(planType);
        if (Cools.isEmpty(planLeader)) {
            throw new CoolException("未查找到规划组长,请联系管理员");
@@ -691,6 +818,7 @@
        EntityWrapper<Plan> wrapper = new EntityWrapper<>();
        wrapper.like("name", condition);
        wrapper.eq("status",1);
        wrapper.eq("assistant_host_sign",0);
        List<ProcessPermissions> processPermissionsList = processPermissionsService.selectList(new EntityWrapper<ProcessPermissions>().eq("process_memo", 4).or().eq("process_memo", 5));//2:核价流程
        int type =0;
@@ -725,6 +853,20 @@
            map.put("value", plan.getName());
            result.add(map);
        }
        if (type==1){
            EntityWrapper<Plan> wrapper2 = new EntityWrapper<>();
            wrapper2.like("name", condition);
            wrapper2.eq("status",1);
            wrapper2.eq("assistant_host_sign",1);
            List<Plan> plan2s = planService.selectList(wrapper2);
            for (Plan plan : plan2s){
                Map<String, Object> map = new HashMap<>();
                map.put("id", plan.getId());
//            map.put("value", plan.getName()+"---"+plan.getId());
                map.put("value", plan.getName());
                result.add(map);
            }
        }
        return R.ok(result);
    }
src/main/java/com/zy/crm/manager/controller/PriOnline2Controller.java
@@ -57,6 +57,9 @@
    @Autowired
    private UserService userService;
    @Autowired
    private PriOnline2FollService priOnline2FollService;
    String PZH = " ———————————————————————————————————————————————————————————————————————————————— ";
    @RequestMapping(value = "/priOnline2/{id}/auth")
@@ -86,12 +89,22 @@
                  @RequestParam(defaultValue = "10") Integer limit,
                  @RequestParam(required = false) String orderByField,
                  @RequestParam(required = false) String orderByType,
                  @RequestParam(required = false) String allSwitch,
                  @RequestParam(required = false) String condition,
                  @RequestParam Map<String, Object> param) {
                  @RequestParam Map<String, Object> paramSou) {
        EntityWrapper<PriOnline2> wrapper = new EntityWrapper<>();
        wrapper.setSqlSelect("id,title,create_time as createTime,filepath,settle,settle_size as settleSize,item_id as itemId,order_num as orderNum,template_name as templateName,user_id as userId,dept_id as deptId,status,update_time as updateTime,check_data as checkData,update_user_id as updateUserId,member_id as memberId");
        wrapper.setSqlSelect("id,title,create_time as createTime,assistant_plan_id as assistantPlanId,host_plan_id as hostPlanId,assistant_host_sign as assistantHostSign,filepath,settle,settle_size as settleSize,item_id as itemId,order_num as orderNum,template_name as templateName,user_id as userId,dept_id as deptId,status,update_time as updateTime,check_data as checkData,update_user_id as updateUserId,member_id as memberId");
//        wrapper.in("member_id", getUserRoleBelongsToUserId("allopen"));
        excludeTrash(param);
        excludeTrash(paramSou);
        Map<String, Object> param = convertallSwitch(paramSou);
        if (!Cools.isEmpty(allSwitch)){
            List<PriOnline2> priOnline2List = priOnline2Service.listByAll(getUserId());
            Page<PriOnline2> page1 = new Page<PriOnline2>(curr, limit).setRecords(priOnline2List);
            page1.setTotal(priOnline2Service.listByAllTotal(getUserId()));
            return R.ok(page1);
        }
        convert(param, wrapper);
        allLike(PriOnline2.class, param.keySet(), wrapper, condition);
        wrapper.or().eq("member_id", getUserId());
@@ -101,6 +114,14 @@
        return R.ok(priOnline2Service.selectPage(new Page<>(curr, limit), wrapper));
    }
    private Map<String, Object>  convertallSwitch(Map<String, Object> map) {
        for (Map.Entry<String, Object> entry : map.entrySet()) {
            if (entry.getKey().equals("allSwitch")) {
                map.remove("allSwitch");
            }
        }
        return map;
    }
    private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper) {
        boolean signUserId = false;
        boolean signDeptId = false;
@@ -143,68 +164,68 @@
            wrapper.or().eq("host_id", 1);
        }
    }
    @RequestMapping(value = "/priOnline2/HJ/add/auth")
    @ManagerAuth(memo = "接取集成核价任务")
    public R addHJ(PriOnline2 priOnline2) {
        PriOnline2 priOnline21 = priOnline2Service.selectById(priOnline2.getId());
        if (priOnline21.getSettle()!=1 || !priOnline21.getMemberId().equals(0L)){
            return R.error("此集成核价单状态已改变,请刷新页面重新选择!");
        }
        Date now = new Date();
        priOnline21.setMemberId(getUserId());
//    @RequestMapping(value = "/priOnline2/HJ/add/auth")
//    @ManagerAuth(memo = "接取集成核价任务")
//    public R addHJ(PriOnline2 priOnline2) {
//        PriOnline2 priOnline21 = priOnline2Service.selectById(priOnline2.getId());
//        if (priOnline21.getSettle()!=1 || !priOnline21.getMemberId().equals(0L)){
//            return R.error("此集成核价单状态已改变,请刷新页面重新选择!");
//        }
//        Date now = new Date();
//        priOnline21.setMemberId(getUserId());
//
//
//        List<SettleDto> planDtos = JSON.parseArray(priOnline21.getSettleMsg(), SettleDto.class);
//        List<SettleDto> planDtoList = new ArrayList<>();
//        for (SettleDto dto : planDtos) {
//            if (dto.getStep().equals(2)) {
//                dto.setUserId(getUserId());
//                dto.setUsername(getUser().getNickname());
//                if (Cools.isEmpty(dto.getMsg())) {
//                    dto.setMsg(getUser().getNickname() + "接取核价");
//                } else {
//                    dto.setMsg(dto.getMsg() + PZH + DateUtils.convert(now) + " " + getUser().getNickname() + "接取核价");
//                }
//                dto.setTime(DateUtils.convert(new Date()));
//            }
//            planDtoList.add(dto);
//        }
//        priOnline21.setSettleMsg(JSON.toJSONString(planDtoList));
//        priOnline21.setUpdateUserId(getUserId());
//        priOnline21.setUpdateTime(now);
//        priOnline2Service.updateById(priOnline21);
//        return R.ok("接取成功");
//    }
        List<SettleDto> planDtos = JSON.parseArray(priOnline21.getSettleMsg(), SettleDto.class);
        List<SettleDto> planDtoList = new ArrayList<>();
        for (SettleDto dto : planDtos) {
            if (dto.getStep().equals(2)) {
                dto.setUserId(getUserId());
                dto.setUsername(getUser().getNickname());
                if (Cools.isEmpty(dto.getMsg())) {
                    dto.setMsg(getUser().getNickname() + "接取核价");
                } else {
                    dto.setMsg(dto.getMsg() + PZH + DateUtils.convert(now) + " " + getUser().getNickname() + "接取核价");
                }
                dto.setTime(DateUtils.convert(new Date()));
            }
            planDtoList.add(dto);
        }
        priOnline21.setSettleMsg(JSON.toJSONString(planDtoList));
        priOnline21.setUpdateUserId(getUserId());
        priOnline21.setUpdateTime(now);
        priOnline2Service.updateById(priOnline21);
        return R.ok("接取成功");
    }
    @RequestMapping(value = "/priOnline2/HJ/search/auth")
    @ManagerAuth
    public R priOnline2Search(String condition) {
        EntityWrapper<PriOnline2> wrapper = new EntityWrapper<>();
        wrapper.like("template_name", condition);
        wrapper.eq("member_id",0L);
        List<ProcessPermissions> processPermissionsList = processPermissionsService.selectList(new EntityWrapper<ProcessPermissions>().eq("process_memo", 5));//2:核价流程
        int type =0;
        for (ProcessPermissions processPermissions:processPermissionsList){
            if (getUserId().equals(processPermissions.getUserId())){
                type=1;
                break;
            }
        }
        if (type==0){
            return R.error("你不是核价员,无权接任务");
        }
        List<Map<String, Object>> result = new ArrayList<>();
        List<PriOnline2> priOnline2s = priOnline2Service.selectList(wrapper);
        for (PriOnline2 priOnline2 : priOnline2s){
            Map<String, Object> map = new HashMap<>();
            map.put("id", priOnline2.getId());
            map.put("name", priOnline2.getTemplateName()+" - ID:"+priOnline2.getId());
            result.add(map);
        }
        return R.ok(result);
    }
//    @RequestMapping(value = "/priOnline2/HJ/search/auth")
//    @ManagerAuth
//    public R priOnline2Search(String condition) {
//        EntityWrapper<PriOnline2> wrapper = new EntityWrapper<>();
//        wrapper.like("template_name", condition);
//        wrapper.eq("member_id",0L);
//
//        List<ProcessPermissions> processPermissionsList = processPermissionsService.selectList(new EntityWrapper<ProcessPermissions>().eq("process_memo", 5));//2:核价流程
//        int type =0;
//        for (ProcessPermissions processPermissions:processPermissionsList){
//            if (getUserId().equals(processPermissions.getUserId())){
//                type=1;
//                break;
//            }
//        }
//        if (type==0){
//            return R.error("你不是核价员,无权接任务");
//        }
//        List<Map<String, Object>> result = new ArrayList<>();
//
//        List<PriOnline2> priOnline2s = priOnline2Service.selectList(wrapper);
//        for (PriOnline2 priOnline2 : priOnline2s){
//            Map<String, Object> map = new HashMap<>();
//            map.put("id", priOnline2.getId());
//            map.put("name", priOnline2.getTemplateName()+" - ID:"+priOnline2.getId());
//            result.add(map);
//        }
//        return R.ok(result);
//    }
    @RequestMapping(value = "/priOnline2/add/auth")
@@ -223,6 +244,10 @@
//        Item item = itemService.selectById(priOnline.getItemId());
        Plan plan = planService.selectById(priOnline2.getItemId());
        User userUp = userService.selectById(plan.getUserId());
        priOnline2.setAssistantHostSign(plan.getAssistantHostSign());
        priOnline2.setAssistantPlanId(plan.getAssistantPlanId());
        priOnline2.setHostPlanId(plan.getHostPlanId());
        //业务员
        priOnline2.setUserId(userUp.getId());
@@ -263,17 +288,11 @@
        List<String> initNames = new ArrayList<>();
        initNames.add("接取核价任务");
        initNames.add("完成核价");
        if (planType.getType().equals(2)) {
            initNames.add("完成核价");
        }
//        initNames.add("经理审核");
        initNames.add("业务员确认");
        List<User> users = new ArrayList<>();
        users.add(getUser());
        users.add(getUser());
        if (planType.getType().equals(2)) {
            users.add(new User());
        }
        users.add(userUp);
        priOnline2.setSettleMsg(JSON.toJSONString(SettleDto.InItFlowPath(users, initNames, users.size())));
        priOnline2.setSettleSize(users.size());
@@ -285,12 +304,36 @@
        planService.updateById(plan);
        priOnline2Service.insert(priOnline2);
        // 自动添加跟进人
        for (User user:users){
            List<PriOnline2Foll> priOnline2Folls = priOnline2FollService.selectList(new EntityWrapper<PriOnline2Foll>().eq("pri_online2_id", plan.getId()).eq("user_id", user.getId()));
            if (Cools.isEmpty(priOnline2Folls) || priOnline2Folls.size()==0){
                PriOnline2Foll priOnline2Foll = new PriOnline2Foll();
                priOnline2Foll.setPriOnline2Id(plan.getId());
                priOnline2Foll.setUserId(user.getId());
                if (!priOnline2FollService.insert(priOnline2Foll)) {
                    throw new CoolException("保存失败,请重试");
                }
            }
        }
        if (plan.getAssistantHostSign()==1){
            Plan plan1 = planService.selectById(plan.getHostPlanId());
            plan1.setStatus2(2);
            planService.updateById(plan1);
        }
        return R.ok();
    }
    @RequestMapping(value = "/priOnline2/addOther/auth")
    @ManagerAuth(memo = "另存核价管理")
    public R addOther(@RequestBody Map<String, Object> map) {
        if (true){
            return R.error("禁止!");
        }
        PriOnline2 online = priOnline2Service.selectById(Long.parseLong(map.get("id").toString()));
        PriOnline2 priOnline2 = new PriOnline2();
@@ -441,6 +484,11 @@
                Plan plan = planService.selectById(priOnline2.getItemId());
                plan.setStatus(1);
                planService.updateById(plan);
                if (plan.getAssistantHostSign()==1){
                    Plan planHost = planService.selectById(priOnline2.getHostPlanId());
                    planHost.setStatus2(1);
                    planService.updateById(planHost);
                }
            }
            priOnline2Service.deleteBatchIds(Arrays.asList(ids));
@@ -614,12 +662,28 @@
        if (!priOnline2Service.updateById(priOnline2)) {
            throw new CoolException("确认失败,请联系管理员");
        }
        Plan plan = planService.selectById(priOnline2.getItemId());
        plan.setStatus(3);
        planService.selectById(plan);
        if (user.getId().equals(priOnline2.getUserId())) {
            if (priOnline2.getAssistantHostSign()==0){
            try {
                priQuoteAdd(priOnline2.getId(), plannerId);
            } catch (Exception e) {
                return R.error("自动生成报价单失败");
            }
            }else {
                try {
                    Plan planHost = planService.selectById(priOnline2.getHostPlanId());
                    planHost.setStatus2(3);
                    planService.selectById(planHost);
                } catch (Exception e) {
                    return R.error("更新主表失败");
                }
            }
        }
        return R.ok("审批成功");
src/main/java/com/zy/crm/manager/controller/ReimburseOnlineController.java
@@ -188,16 +188,16 @@
        }
        ProcessPermissions processPermissions3 = processPermissionsService.selectOne(new EntityWrapper<ProcessPermissions>().eq("process_memo", 3).eq("process", param.getCheckData().equals("否")? "3-1" : "3-2"));//3:报销流程
        User president3 = userService.selectById(processPermissions3.getUserId());       // 获取报价流程节点3确认人
        User president3 = userService.selectById(processPermissions3.getUserId());       // 获取流程节点3确认人
        ProcessPermissions processPermissions4 = processPermissionsService.selectOne(new EntityWrapper<ProcessPermissions>().eq("process_memo", 3).eq("process", "4-1"));//3:报销流程
        User president4 = userService.selectById(processPermissions4.getUserId());       // 获取报价流程节点4确认人
        User president4 = userService.selectById(processPermissions4.getUserId());       // 获取流程节点4确认人
        ProcessPermissions processPermissions5 = processPermissionsService.selectOne(new EntityWrapper<ProcessPermissions>().eq("process_memo", 3).eq("process", "5-1"));//3:报销流程
        User president5 = userService.selectById(processPermissions5.getUserId());       // 获取报价流程节点5确认人
        User president5 = userService.selectById(processPermissions5.getUserId());       // 获取流程节点5确认人
        ProcessPermissions processPermissions6 = processPermissionsService.selectOne(new EntityWrapper<ProcessPermissions>().eq("process_memo", 3).eq("process", "6-1"));//3:报销流程
        User president6 = userService.selectById(processPermissions6.getUserId());       // 获取报价流程节点6确认人
        User president6 = userService.selectById(processPermissions6.getUserId());       // 获取流程节点6确认人
        reimburseOnline.setSettleMsg(JSON.toJSONString(SettleDto.initPriQuote(reimburseOnline, manager,president3,president4,president5,president6,getUser())));
        reimburseOnline.setMemberId(manager.getId());
src/main/java/com/zy/crm/manager/entity/AllFoll.java
New file
@@ -0,0 +1,82 @@
package com.zy.crm.manager.entity;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.core.common.Cools;
import com.core.common.SpringUtils;
import com.zy.crm.manager.service.PlanService;
import com.zy.crm.system.entity.User;
import com.zy.crm.system.service.UserService;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
@TableName("man_all_foll")
public class AllFoll implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * ID
     */
    @ApiModelProperty(value= "ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 规划单
     */
    @ApiModelProperty(value= "规划单")
    @TableField("plan_id")
    private Long planId;
    /**
     * 跟进人
     */
    @ApiModelProperty(value= "跟进人")
    @TableField("user_id")
    private Long userId;
    /**
     * memo
     */
    @ApiModelProperty(value= "表类")
    @TableField("memo")
    private Long memo;
    public AllFoll() {}
    public AllFoll(Long planId, Long userId) {
        this.planId = planId;
        this.userId = userId;
    }
//    PlanFoll planFoll = new PlanFoll(
//            null,    // 规划单
//            null    // 跟进人[非空]
//    );
    public String getPlanId$(){
        PlanService service = SpringUtils.getBean(PlanService.class);
        Plan plan = service.selectById(this.planId);
        if (!Cools.isEmpty(plan)){
            return String.valueOf(plan.getName());
        }
        return null;
    }
    public String getUserId$(){
        UserService service = SpringUtils.getBean(UserService.class);
        User user = service.selectById(this.userId);
        if (!Cools.isEmpty(user)){
            return String.valueOf(user.getNickname());
        }
        return null;
    }
}
src/main/java/com/zy/crm/manager/entity/Plan.java
@@ -252,7 +252,58 @@
    @ApiModelProperty(value= "节点负责人")
    private Long director;
    public Plan() {}
    /**
     * 集成项目货架核价状态
     */
    @ApiModelProperty(value = "状态 3: 完成核价 2: 开始核价 1: 等待核价  0: 初始  ")
    private Integer status2;
    /**
     * 节点负责人
     */
    @ApiModelProperty(value = "副planId")
    @TableField("assistant_plan_id")
    private Long assistantPlanId;
    /**
     * 节点负责人
     */
    @ApiModelProperty(value = "主planId")
    @TableField("host_plan_id")
    private Long hostPlanId;
    /**
     * 节点负责人
     */
    @ApiModelProperty(value = "主planId")
    @TableField("assistant_host_sign")
    private Integer assistantHostSign;
    public Plan() {
    }
    public Plan(Plan plan) {
        this.hostId = plan.getHostId();
        this.deptId = plan.getDeptId();
        this.planType = plan.getPlanType();
        this.userId = plan.getUserId();
        this.orderId = plan.getOrderId();
        this.cstmrId = plan.getCstmrId();
        this.name = plan.getName();
        this.planNeed = plan.getPlanNeed();
        this.beItem = plan.getBeItem();
        this.form = plan.getForm();
        this.finishTime = plan.getFinishTime();
        this.change = plan.getChange();
        this.changeTime = plan.getChangeTime();
        this.changeReason = plan.getChangeReason();
        this.planBonus = plan.getPlanBonus();
        this.planLeaderBonus = plan.getPlanLeaderBonus();
        this.files = plan.getFiles();
        this.comment = plan.getComment();
        this.memo = plan.getMemo();
        this.userXmlSelPhone = plan.getUserXmlSelPhone();
    }
    public String getHostId$(){
        HostService service = SpringUtils.getBean(HostService.class);
@@ -298,6 +349,47 @@
            return planType.getType();
        }
        return null;
    }
    public String getStatusAll$(){
        if (this.status2>3 || this.getAssistantHostSign()==1){
            return getStatus$();
        }else {
            return "集成"+getStatus$()+"/"+"货架"+getStatus2$();
        }
    }
    public String getStatus$(){
        if (null == this.status){ return null; }
        switch (this.status){
            case 3:
                return "完成核价";
            case 2:
                return "开始核价";
            case 1:
                return "等待核价";
            case 0:
                return "初始";
            default:
                return String.valueOf(this.status);
        }
    }
    public String getStatus2$(){
        if (null == this.status2){ return null; }
        switch (this.status2){
            case 3:
                return "完成核价";
            case 2:
                return "开始核价";
            case 1:
                return "等待核价";
            case 0:
                return "初始";
            default:
                return String.valueOf(this.status2);
        }
    }
    public String getUserId$(){
@@ -352,7 +444,9 @@
    }
    public String getBeItem$(){
        if (null == this.beItem){ return null; }
        if (null == this.beItem) {
            return null;
        }
        switch (this.beItem){
            case 1:
                return "是";
@@ -360,6 +454,20 @@
                return "否";
            default:
                return String.valueOf(this.beItem);
        }
    }
    public String getAssistantHostSign$() {
        if (null == this.assistantHostSign) {
            return null;
        }
        switch (this.assistantHostSign) {
            case 1:
                return "副流程";
            case 0:
                return "主流程";
            default:
                return String.valueOf(this.assistantHostSign);
        }
    }
@@ -371,7 +479,9 @@
    }
    public String getChange$(){
        if (null == this.change){ return null; }
        if (null == this.change) {
            return null;
        }
        switch (this.change){
            case 1:
                return "是";
@@ -383,7 +493,9 @@
    }
    public String getSettle$(){
        if (null == this.settle){ return null; }
        if (null == this.settle) {
            return null;
        }
        switch (this.settle){
//            case 1:
//                return "等待组长审核";
@@ -418,20 +530,6 @@
            return String.valueOf(user.getNickname());
        }
        return null;
    }
    public String getStatus$(){
        if (null == this.status){ return null; }
        switch (this.status){
            case 2:
                return "开始核价";
            case 1:
                return "等待核价";
            case 0:
                return "未完成";
            default:
                return String.valueOf(this.status);
        }
    }
    public String getCreateBy$(){
src/main/java/com/zy/crm/manager/entity/PlanType.java
@@ -122,6 +122,11 @@
    public PlanType() {}
    public PlanType(Long hostId,Integer type) {
        this.hostId = hostId;
        this.type = type;
    }
    public PlanType(Long hostId,String name,String flag,String formId,String data,Integer status,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) {
        this.hostId = hostId;
        this.name = name;
src/main/java/com/zy/crm/manager/entity/PriOnline2.java
@@ -150,6 +150,47 @@
    @ApiModelProperty(value= "")
    private String form;
    /**
     * 集成项目货架核价状态
     */
    @ApiModelProperty(value = "状态 3: 完成核价 2: 开始核价 1: 等待核价  0: 初始  ")
    private Integer status2;
    /**
     * 节点负责人
     */
    @ApiModelProperty(value = "副planId")
    @TableField("assistant_plan_id")
    private Long assistantPlanId;
    /**
     * 节点负责人
     */
    @ApiModelProperty(value = "主planId")
    @TableField("host_plan_id")
    private Long hostPlanId;
    /**
     * 节点负责人
     */
    @ApiModelProperty(value = "副planId")
    @TableField("assistant_pri_id")
    private Long assistantPriId;
    /**
     * 节点负责人
     */
    @ApiModelProperty(value = "主planId")
    @TableField("host_pri_id")
    private Long hostPriId;
    /**
     * 节点负责人
     */
    @ApiModelProperty(value = "主planId")
    @TableField("assistant_host_sign")
    private Integer assistantHostSign;
    public PriOnline2() {}
    public PriOnline2(String title, String sheetData, Date createTime, String filepath,Integer settle,Integer settleSize) {
@@ -180,6 +221,20 @@
                return "审批通过";
            default:
                return String.valueOf(this.settle);
        }
    }
    public String getAssistantHostSign$() {
        if (null == this.assistantHostSign) {
            return null;
        }
        switch (this.assistantHostSign) {
            case 1:
                return "副流程";
            case 0:
                return "主流程";
            default:
                return String.valueOf(this.assistantHostSign);
        }
    }
@@ -262,15 +317,50 @@
        return null;
    }
    public String getStatusAll$(){
        PlanService planService = SpringUtils.getBean(PlanService.class);
        Plan plan = planService.selectById(this.itemId);
        if (plan.getStatus2()>3 || (!Cools.isEmpty(this.getAssistantHostSign()) && this.getAssistantHostSign()==1)){
            return getStatus$();
        }else {
            return "集成"+getStatus$()+"/"+"货架"+getStatus2$();
        }
    }
    public String getStatus$() {
        if (null == this.status){ return null; }
        switch (this.status){
        PlanService planService = SpringUtils.getBean(PlanService.class);
        Plan plan = planService.selectById(this.itemId);
        if (null == plan.getStatus()){ return null; }
        switch (plan.getStatus()){
            case 3:
                return "完成核价";
            case 2:
                return "开始核价";
            case 1:
                return "已完成";
                return "等待核价";
            case 0:
                return "未完成";
                return "初始";
            default:
                return String.valueOf(this.status);
                return String.valueOf(plan.getStatus());
        }
    }
    public String getStatus2$(){
        PlanService planService = SpringUtils.getBean(PlanService.class);
        Plan plan = planService.selectById(this.itemId);
        if (null == plan.getStatus2()){ return null; }
        switch (plan.getStatus2()){
            case 3:
                return "完成核价";
            case 2:
                return "开始核价";
            case 1:
                return "等待核价";
            case 0:
                return "初始";
            default:
                return String.valueOf(plan.getStatus2());
        }
    }
src/main/java/com/zy/crm/manager/entity/PriOnline2Foll.java
New file
@@ -0,0 +1,75 @@
package com.zy.crm.manager.entity;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.core.common.Cools;
import com.core.common.SpringUtils;
import com.zy.crm.manager.service.PriOnline2Service;
import com.zy.crm.system.entity.User;
import com.zy.crm.system.service.UserService;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
@TableName("man_pri_online2_foll")
public class PriOnline2Foll implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * ID
     */
    @ApiModelProperty(value= "ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 规划单
     */
    @ApiModelProperty(value= "规划单")
    @TableField("pri_online2_id")
    private Long priOnline2Id;
    /**
     * 跟进人
     */
    @ApiModelProperty(value= "跟进人")
    @TableField("user_id")
    private Long userId;
    public PriOnline2Foll() {}
    public PriOnline2Foll(Long priOnline2Id, Long userId) {
        this.priOnline2Id = priOnline2Id;
        this.userId = userId;
    }
//    PlanFoll planFoll = new PlanFoll(
//            null,    // 规划单
//            null    // 跟进人[非空]
//    );
    public String getPriOnline2Id$(){
        PriOnline2Service service = SpringUtils.getBean(PriOnline2Service.class);
        PriOnline2 priOnline2 = service.selectById(this.priOnline2Id);
        if (!Cools.isEmpty(priOnline2)){
            return String.valueOf(priOnline2.getTemplateName());
        }
        return null;
    }
    public String getUserId$(){
        UserService service = SpringUtils.getBean(UserService.class);
        User user = service.selectById(this.userId);
        if (!Cools.isEmpty(user)){
            return String.valueOf(user.getNickname());
        }
        return null;
    }
}
src/main/java/com/zy/crm/manager/entity/ReimburseOnlineDetl.java
@@ -68,70 +68,70 @@
     */
    @ApiModelProperty(value= "税率")
    @TableField("tax_rate")
    private Long taxRate;
    private Double taxRate;
    /**
     * 未税本币金额
     */
    @ApiModelProperty(value= "未税本币金额")
    @TableField("untaxed_amount_in_local_currency")
    private Long untaxedAmountInLocalCurrency;
    private Double untaxedAmountInLocalCurrency;
    /**
     * 未税金额
     */
    @ApiModelProperty(value= "未税金额")
    @TableField("untaxed_amount")
    private Long untaxedAmount;
    private Double untaxedAmount;
    /**
     * 税额
     */
    @ApiModelProperty(value= "税额")
    @TableField("tax_amount")
    private Long taxAmount;
    private Double taxAmount;
    /**
     * 发票金额
     */
    @ApiModelProperty(value= "发票金额")
    @TableField("invoice_value")
    private Long invoiceValue;
    private Double invoiceValue;
    /**
     * 发票本币金额
     */
    @ApiModelProperty(value= "发票本币金额")
    @TableField("invoice_amount_in_local_currency")
    private Long invoiceAmountInLocalCurrency;
    private Double invoiceAmountInLocalCurrency;
    /**
     * 报销比例
     */
    @ApiModelProperty(value= "报销比例")
    @TableField("reimbursement_ratio")
    private Long reimbursementRatio;
    private Double reimbursementRatio;
    /**
     * 报销金额
     */
    @ApiModelProperty(value= "报销金额")
    @TableField("reimbursement_amount")
    private Long reimbursementAmount;
    private Double reimbursementAmount;
    /**
     * 报销本币金额
     */
    @ApiModelProperty(value= "报销本币金额")
    @TableField("reimbursement_amount_in_local_currency")
    private Long reimbursementAmountInLocalCurrency;
    private Double reimbursementAmountInLocalCurrency;
    /**
     * 出纳确认金额
     */
    @ApiModelProperty(value= "出纳确认金额")
    @TableField("cashier_confirmation_amount")
    private Long cashierConfirmationAmount;
    private Double cashierConfirmationAmount;
    /**
     * 出纳币种
@@ -201,7 +201,7 @@
    public ReimburseOnlineDetl() {}
    public ReimburseOnlineDetl(String occupation,Integer expenseType,Integer userId,Integer deptId,Integer hostId,Long orderId,Long taxRate,Long untaxedAmountInLocalCurrency,Long untaxedAmount,Long taxAmount,Long invoiceValue,Long invoiceAmountInLocalCurrency,Long reimbursementRatio,Long reimbursementAmount,Long reimbursementAmountInLocalCurrency,Long cashierConfirmationAmount,Integer cashierCurrency,Date departureTime,Date updateTime,Integer updateUserId,String updateUserName,Date creationTime,Integer creationUserId,String creationUserName,Integer reimburseId) {
    public ReimburseOnlineDetl(String occupation,Integer expenseType,Integer userId,Integer deptId,Integer hostId,Long orderId,Double taxRate,Double untaxedAmountInLocalCurrency,Double untaxedAmount,Double taxAmount,Double invoiceValue,Double invoiceAmountInLocalCurrency,Double reimbursementRatio,Double reimbursementAmount,Double reimbursementAmountInLocalCurrency,Double cashierConfirmationAmount,Integer cashierCurrency,Date departureTime,Date updateTime,Integer updateUserId,String updateUserName,Date creationTime,Integer creationUserId,String creationUserName,Integer reimburseId) {
        this.occupation = occupation;
        this.expenseType = expenseType;
        this.userId = userId;
@@ -231,16 +231,16 @@
    public ReimburseOnlineDetl(Integer reminburseCostTypeId) {
        this.occupation = "";
        this.expenseType = reminburseCostTypeId;
        this.taxRate = (long)0.0;
        this.untaxedAmountInLocalCurrency = (long)0.0;
        this.untaxedAmount = (long)0.0;
        this.taxAmount = (long)0.0;
        this.invoiceValue = (long)0.0;
        this.invoiceAmountInLocalCurrency = (long)0.0;
        this.reimbursementRatio = (long)0.0;
        this.reimbursementAmount = (long)0.0;
        this.reimbursementAmountInLocalCurrency = (long)0.0;
        this.cashierConfirmationAmount = (long)0.0;
        this.taxRate = 0.0;
        this.untaxedAmountInLocalCurrency = 0.0;
        this.untaxedAmount = 0.0;
        this.taxAmount = 0.0;
        this.invoiceValue = 0.0;
        this.invoiceAmountInLocalCurrency = 0.0;
        this.reimbursementRatio = 0.0;
        this.reimbursementAmount = 0.0;
        this.reimbursementAmountInLocalCurrency = 0.0;
        this.cashierConfirmationAmount = 0.0;
    }
@@ -274,4 +274,30 @@
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.creationTime);
    }
    public void setTaxRate(String taxRate){
        String[] splitTaxRate = taxRate.split("%");
        this.taxRate=Double.parseDouble(splitTaxRate[0]);
    }
    public void setTaxRate(Double taxRate){
        this.taxRate=taxRate;
    }
    public String getTaxRate$(){
        return taxRate.toString()+"%";
    }
    public void setReimbursementRatio(String reimbursementRatio){
        String[] splitReimbursementRatio = reimbursementRatio.split("%");
        this.reimbursementRatio=Double.parseDouble(splitReimbursementRatio[0]);
    }
    public void setReimbursementRatio(Double reimbursementRatio){
        this.reimbursementRatio=reimbursementRatio;
    }
    public String getReimbursementRatio$(){
        return reimbursementRatio.toString()+"%";
    }
}
src/main/java/com/zy/crm/manager/mapper/AllFollMapper.java
New file
@@ -0,0 +1,12 @@
package com.zy.crm.manager.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.zy.crm.manager.entity.AllFoll;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
@Mapper
@Repository
public interface AllFollMapper extends BaseMapper<AllFoll> {
}
src/main/java/com/zy/crm/manager/mapper/PriOnline2FollMapper.java
New file
@@ -0,0 +1,12 @@
package com.zy.crm.manager.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.zy.crm.manager.entity.PriOnline2Foll;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
@Mapper
@Repository
public interface PriOnline2FollMapper extends BaseMapper<PriOnline2Foll> {
}
src/main/java/com/zy/crm/manager/mapper/PriOnline2Mapper.java
@@ -15,5 +15,7 @@
public interface PriOnline2Mapper extends BaseMapper<PriOnline2> {
    List<PriOnline2> listByPage(Page<PriOnline2> page, @Param("userIds") ArrayList<Long> userIds , @Param("condition") String condition);
    List<PriOnline2> listByAll( @Param("userId") Long userId );
    Integer listByAllTotal( @Param("userId") Long userId );
}
src/main/java/com/zy/crm/manager/service/AllFollService.java
New file
@@ -0,0 +1,8 @@
package com.zy.crm.manager.service;
import com.baomidou.mybatisplus.service.IService;
import com.zy.crm.manager.entity.AllFoll;
public interface AllFollService extends IService<AllFoll> {
}
src/main/java/com/zy/crm/manager/service/PriOnline2FollService.java
New file
@@ -0,0 +1,8 @@
package com.zy.crm.manager.service;
import com.baomidou.mybatisplus.service.IService;
import com.zy.crm.manager.entity.PriOnline2Foll;
public interface PriOnline2FollService extends IService<PriOnline2Foll> {
}
src/main/java/com/zy/crm/manager/service/PriOnline2Service.java
@@ -5,9 +5,12 @@
import com.zy.crm.manager.entity.PriOnline2;
import java.util.ArrayList;
import java.util.List;
public interface PriOnline2Service extends IService<PriOnline2> {
    Page<PriOnline2> listByPage(Page<PriOnline2> page, ArrayList<Long> userIds , String condition);
    List<PriOnline2> listByAll(Long userId);
    Integer listByAllTotal(Long userId);
}
src/main/java/com/zy/crm/manager/service/impl/AllFollServiceImpl.java
New file
@@ -0,0 +1,12 @@
package com.zy.crm.manager.service.impl;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.zy.crm.manager.entity.AllFoll;
import com.zy.crm.manager.mapper.AllFollMapper;
import com.zy.crm.manager.service.AllFollService;
import org.springframework.stereotype.Service;
@Service("allFollService")
public class AllFollServiceImpl extends ServiceImpl<AllFollMapper, AllFoll> implements AllFollService {
}
src/main/java/com/zy/crm/manager/service/impl/PriOnline2FollServiceImpl.java
New file
@@ -0,0 +1,12 @@
package com.zy.crm.manager.service.impl;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.zy.crm.manager.entity.PriOnline2Foll;
import com.zy.crm.manager.mapper.PriOnline2FollMapper;
import com.zy.crm.manager.service.PriOnline2FollService;
import org.springframework.stereotype.Service;
@Service("priOnline2FollService")
public class PriOnline2FollServiceImpl extends ServiceImpl<PriOnline2FollMapper, PriOnline2Foll> implements PriOnline2FollService {
}
src/main/java/com/zy/crm/manager/service/impl/PriOnline2ServiceImpl.java
@@ -8,6 +8,7 @@
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Service("priOnline2Service")
public class PriOnline2ServiceImpl extends ServiceImpl<PriOnline2Mapper, PriOnline2> implements PriOnline2Service {
@@ -16,4 +17,14 @@
    public Page<PriOnline2> listByPage(Page<PriOnline2> page, ArrayList<Long> userIds, String condition) {
        return page.setRecords(this.baseMapper.listByPage(page, userIds, condition));
    }
    @Override
    public List<PriOnline2> listByAll(Long userId) {
        return this.baseMapper.listByAll(userId);
    }
    @Override
    public Integer listByAllTotal(Long userId) {
        return this.baseMapper.listByAllTotal(userId);
    }
}
src/main/resources/mapper/AllFollMapper.xml
New file
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zy.crm.manager.mapper.AllFollMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.zy.crm.manager.entity.AllFoll">
        <id column="id" property="id" />
        <result column="plan_id" property="planId" />
        <result column="user_id" property="userId" />
    </resultMap>
</mapper>
src/main/resources/mapper/PlanMapper.xml
@@ -36,6 +36,10 @@
        <result column="memo" property="memo" />
        <result column="user_xml_sel_phone" property="userXmlSelPhone" />
        <result column="director" property="director" />
        <result column="status2" property="status2" />
        <result column="assistant_plan_id" property="assistantPlanId" />
        <result column="host_plan_id" property="hostPlanId" />
        <result column="assistant_host_sign" property="assistantHostSign" />
    </resultMap>
src/main/resources/mapper/PriOnline2FollMapper.xml
New file
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zy.crm.manager.mapper.PriOnline2FollMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.zy.crm.manager.entity.PriOnline2Foll">
        <id column="id" property="id" />
        <result column="pri_online2_id" property="priOnline2Id" />
        <result column="user_id" property="userId" />
    </resultMap>
</mapper>
src/main/resources/mapper/PriOnline2Mapper.xml
@@ -19,6 +19,11 @@
        <result column="check_data" property="checkData" />
        <result column="settle" property="settle" />
        <result column="settle_size" property="settleSize" />
        <result column="assistant_plan_id" property="assistantPlanId" />
        <result column="host_plan_id" property="hostPlanId" />
        <result column="assistant_pri_id" property="assistantPriId" />
        <result column="host_pri_id" property="hostPriId" />
        <result column="assistant_host_sign" property="assistantHostSign" />
    </resultMap>
    <!-- 查询结果不包含excel数据data,以免结果集过大 -->
@@ -36,6 +41,14 @@
        <result column="update_time" property="updateTime" />
        <result column="settle" property="settle" />
        <result column="settle_size" property="settleSize" />
        <result column="assistant_plan_id" property="assistantPlanId" />
        <result column="host_plan_id" property="hostPlanId" />
        <result column="assistant_host_sign" property="assistantHostSign" />
        <result column="assistant_plan_id" property="assistantPlanId" />
        <result column="host_plan_id" property="hostPlanId" />
        <result column="assistant_pri_id" property="assistantPriId" />
        <result column="host_pri_id" property="hostPriId" />
        <result column="assistant_host_sign" property="assistantHostSign" />
    </resultMap>
    <select id="listByPage" resultMap="NoDataResultMap">
@@ -62,4 +75,36 @@
        ORDER BY id DESC
    </select>
    <select id="listByAll" resultMap="NoDataResultMap">
        SELECT
        *
        FROM man_pri_online2 mp
        WHERE 1=1
        and
            mp.id in
            (
            select
            pri_online2_id
            from man_pri_online2_foll
            where 1=1
            and user_id = #{userId}
            )
        ORDER BY id DESC
    </select>
    <select id="listByAllTotal" resultType="java.lang.Integer">
        SELECT
        count (1)
        FROM man_pri_online2 mp
        WHERE 1=1
        and
            mp.id in
            (
            select
            pri_online2_id
            from man_pri_online2_foll
            where 1=1
            and user_id = #{userId}
            )
    </select>
</mapper>
src/main/webapp/static/js/plan/plan.js
@@ -139,7 +139,7 @@
        skin: 'line',
        cols: [[
            {type: 'checkbox'}
            // ,{field: 'id', align: 'center',title: 'ID'}
            ,{field: 'id', align: 'center',title: 'ID'}
            // ,{field: 'hostId$', align: 'center',title: '所属商户'}
            ,{field: 'userId$', align: 'left',title: '业务员',hide: false, width: 100}
            ,{field: 'planType$', align: 'left',title: '业务类型', width: 150,hide: false}
@@ -196,12 +196,17 @@
            ,{field: 'settle$', align: 'center',title: '进度', width: 150}
            // ,{field: 'settleMsg', align: 'center',title: '审核进度'}
            // ,{field: 'comment', align: 'center',title: '评论'}
            ,{field: 'status$', align: 'center',title: '状态'}
            ,{field: 'statusAll$', align: 'center',title: '状态'}
            ,{field: 'createTime$', align: 'left',title: '添加日期', width: 160, hide: true}
            ,{field: 'updateBy$', align: 'left',title: '修改人', width: 100}
            ,{field: 'updateTime$', align: 'left',title: '修改时间', hide: true}
            ,{field: 'memo', align: 'left',title: '注释', hide: true}
            ,{field: 'center', align: 'left',title: '关联流程', toolbar: '#tbLook', minWidth: 160, hide: false}
            ,{field: 'assistantHostSign$', align: 'left',title: '主副标记', hide: false}
            ,{field: 'assistantHostSign', align: 'left',title: '主副标记', hide: true}
            ,{field: 'hostPlanId', align: 'left',title: '主ID', hide: true}
            ,{field: 'assistantPlanId', align: 'left',title: '副ID', hide: true}
            // ,{field: 'assistantPlanIdSignType', align: 'left',title: '集成货架标志', hide: true}
            ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width: 340}
        ]],
        request: {
@@ -597,6 +602,9 @@
                    approvalEnd(data.id);
                });
                break;
            case 'assistantPlan':
                assistantPlan(data);
                break;
            case 'edit':
                showEditModel(data);
                break;
@@ -604,18 +612,22 @@
                del([data.id]);
                break;
            case "uploadLink":
                var planIdSign = data.id;
                if (data.assistantHostSign==1){
                    planIdSign = data.hostPlanId;
                }
                // 打开弹窗
                // 构建带参数的内容
                layer.open({
                    type: 1,
                    title: '上传文件-'+data.id,
                    title: '上传文件-'+planIdSign,
                    content: $('#myModal')
                });
                // 获取路径下的文件列表,使用 jQuery 的 ajax 方法
                $.ajax({
                    url: '/plan/view/file/auth',
                    data:{
                        planId:data.id
                        planId:planIdSign
                    },
                    success: function(response) {
                        if (response.code==200){
@@ -648,6 +660,99 @@
                    },
                    error: function() {
                        console.log('Failed to get file list.');
                    }
                });
                break;
            case "look":
                var $a = $(obj.tr).find('a[lay-event="look"]');
                var offset = $a.offset();
                var top2 = offset.top;
                var left = offset.left;
                layer.open({
                    type: 1,
                    title: false,
                    area: '2100px',
                    offset: [top2 + 'px', (left - 1430 + $a.outerWidth()) + 'px'],
                    shade: .01,
                    shadeClose: true,
                    fixed: false,
                    content: '<table id="lookSSXMTable" lay-filter="lookSSXMTable"></table>',
                    success: function (layero) {
                        table.render({
                            elem: '#lookSSXMTable',
                            headers: {token: localStorage.getItem('token')},
                            url: baseUrl+'/plan/assistantPlan/view/auth',
                            where: {
                                hostPlanId: data.id
                            },
                            page: true,
                            cellMinWidth: 100,
                            cols: [[
                                {field: 'id', align: 'center',title: 'ID'}
                                ,{field: 'userId$', align: 'left',title: '业务员',hide: false, width: 100}
                                ,{field: 'planType$', align: 'left',title: '业务类型', width: 150,hide: false}
                                ,{
                                    field: 'name',
                                    align: 'left',
                                    title: '售前规划申请单名称',
                                    width: 220,
                                    style: 'cursor:pointer',
                                    event: 'more',
                                    hide: false
                                }
                                ,{field: 'uuid', align: 'left',title: '规划单号', width: 100,hide: false}
                                ,{
                                    field: 'planNeed$',
                                    align: 'left',
                                    title: '所需',
                                    templet:function(d){
                                        return emptyShow(d.planNeed$)
                                    },
                                    hide: false
                                }
                                ,{field: 'deptId$', align: 'left',title: '所属部门',hide: true}
                                ,{field: 'planner$', align: 'left',title: '规划员',hide: false, width: 100}
                                ,{
                                    field: 'orderId$',
                                    align: 'left',
                                    title: '跟踪项目',
                                    width: 220,
                                    style: 'cursor:pointer',
                                    event: 'orderMore',hide: false
                                }
                                ,{field: 'appleTime$', align: 'left',title: '申请日期', hide: false}
                                ,{field: 'settle$', align: 'center',title: '进度', width: 150}
                                ,{field: 'statusAll$', align: 'center',title: '状态'}
                                ,{field: 'createTime$', align: 'left',title: '添加日期', width: 160, hide: true}
                                ,{field: 'updateBy$', align: 'left',title: '修改人', width: 100}
                                ,{field: 'updateTime$', align: 'left',title: '修改时间', hide: true}
                                ,{field: 'memo', align: 'left',title: '注释', hide: true}
                                ,{field: 'assistantHostSign', align: 'left',title: '主副标记', hide: true}
                                ,{field: 'hostPlanId', align: 'left',title: '主ID', hide: true}
                                ,{field: 'assistantPlanId', align: 'left',title: '副ID', hide: true}
                                ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width: 340}
                            ]],
                            request: {
                                pageName: 'curr',
                                pageSize: 'limit'
                            },
                            parseData: function (res) {
                                console.log(res)
                                return {
                                    'code': res.code,
                                    'msg': res.msg,
                                    'count': res.data.total,
                                    'data': res.data.records
                                }
                            },
                            response: {
                                statusCode: 200
                            },
                            done: function () {
                                $(layero).find('.layui-table-view').css('margin', '0');
                            },
                            size: ''
                        });
                    }
                });
                break;
@@ -811,6 +916,36 @@
        });
    }
    /* 新建 */
    function assistantPlan(data) {
        layer.confirm('确定要新建货架规划审批吗?', {
            skin: 'layui-layer-admin',
            shade: .1
        }, function (i) {
            layer.close(i);
            var loadIndex = layer.load(2);
            $.ajax({
                url: baseUrl+"/plan/assistantPlan/add/auth",
                headers: {'token': localStorage.getItem('token')},
                data: {
                    hostPlanId: data.id
                },
                method: 'POST',
                success: function (res) {
                    layer.close(loadIndex);
                    if (res.code === 200){
                        layer.msg(res.msg, {icon: 1});
                        tableReload();
                    } else if (res.code === 403){
                        top.location.href = baseUrl+"/";
                    } else {
                        layer.msg(res.msg, {icon: 2});
                    }
                }
            })
        });
    }
    /* 删除 */
    function del(ids) {
        layer.confirm('确定要删除选中数据吗?', {
src/main/webapp/static/js/priOnline2/priOnline.js
@@ -29,13 +29,14 @@
    // 树形图
    var organizationTree;
    window.loadTree = function (condition) {
    window.loadTree = function (condition,allSwitch) {
        var loadIndex = layer.load(2);
        $.ajax({
            url: baseUrl + "/dept/user/tree/auth",
            headers: {'token': localStorage.getItem('token')},
            data: {
                'condition': condition
                'condition': condition,
                'allSwitch': allSwitch
            },
            method: 'POST',
            success: function (res) {
@@ -104,7 +105,7 @@
                hide: false
            }
            , {field: 'itemId', align: 'center', title: '规划单号', hide: true}
            , {field: 'status$', align: 'center', title: '状态', hide: false}
            , {field: 'statusAll$', align: 'center',title: '状态'}
            // ,{field: 'memberId$', align: 'center',title: ''}
            , {
                field: 'settle$',
@@ -121,6 +122,10 @@
            , {field: 'createTime$', align: 'center', title: '创建时间', hide: true}
            , {field: 'updateUserId$', align: 'center', title: '更新人员', hide: false}
            , {field: 'updateTime$', align: 'center', title: '更新时间', hide: false}
            ,{field: 'assistantHostSign$', align: 'left',title: '主副标记', hide: false}
            ,{field: 'assistantHostSign', align: 'left',title: '主副标记', hide: true}
            ,{field: 'hostPlanId', align: 'left',title: '主ID', hide: true}
            ,{field: 'assistantPlanId', align: 'left',title: '副ID', hide: true}
            , {fixed: 'right', title: '操作', align: 'center', toolbar: '#operate', width: 350}
        ]],
        request: {
@@ -375,7 +380,7 @@
                    console.log(data)
                    layer.close(i);
                    // 指定模板
                    if ((data.settle === 1 && data.settleSize===3) || (data.settle===2 && data.settleSize===4)) {
                    if (((data.settle === 1 && data.settleSize===3) || (data.settle===2 && data.settleSize===4)) && data.assistantHostSign==0) {
                        admin.open({
                            type: 1,
                            area: '300px',
@@ -600,17 +605,20 @@
            case "uploadLink":
                // 打开弹窗
                // 构建带参数的内容
                console.log(data)
                var planIdSign = data.id;
                if (data.assistantHostSign==1){
                    planIdSign = data.hostPlanId;
                }
                layer.open({
                    type: 1,
                    title: '上传文件-'+data.itemId,
                    title: '上传文件-'+planIdSign,
                    content: $('#myModal')
                });
                // 获取路径下的文件列表,使用 jQuery 的 ajax 方法
                $.ajax({
                    url: '/plan/view/file/auth',
                    data:{
                        planId:data.itemId
                        planId:planIdSign
                    },
                    success: function(response) {
                        if (response.code==200){
@@ -695,41 +703,41 @@
        });
    }
    /* 弹窗 - 新增、修改 */
    function showEditModel2(mData) {
        admin.open({
            type: 1,
            area: '800px',
            title: '接取' + '核价',
            content: $('#editDialogHJ').html(),
            success: function (layero, dIndex) {
                let loadNameXml = loadNameXmlSel()
                form.val('detailHJ', mData);
                form.on('submit(editSubmitHJ)', function (data) {
                    data.field.id = loadNameXml.getValue()[0] ? loadNameXml.getValue()[0].id : null;
                    $.ajax({
                        url: baseUrl+"/priOnline2/HJ/add/auth",
                        headers: {'token': localStorage.getItem('token')},
                        data: data.field,
                        method: 'POST',
                        success: function (res) {
                            if (res.code === 200){
                                layer.close(dIndex);
                                layer.msg(res.msg, {icon: 1});
                                tableReload()
                            } else if (res.code === 403){
                                top.location.href = baseUrl+"/";
                            }else {
                                layer.msg(res.msg, {icon: 2});
                            }
                        }
                    })
                });
                $(layero).children('.layui-layer-content').css('overflow', 'visible');
                layui.form.render('select');
            }
        });
    }
    // /* 弹窗 - 新增、修改 */
    // function showEditModel2(mData) {
    //     admin.open({
    //         type: 1,
    //         area: '800px',
    //         title: '接取' + '核价',
    //         content: $('#editDialogHJ').html(),
    //         success: function (layero, dIndex) {
    //             let loadNameXml = loadNameXmlSel()
    //             form.val('detailHJ', mData);
    //             form.on('submit(editSubmitHJ)', function (data) {
    //                 data.field.id = loadNameXml.getValue()[0] ? loadNameXml.getValue()[0].id : null;
    //                 $.ajax({
    //                     url: baseUrl+"/priOnline2/HJ/add/auth",
    //                     headers: {'token': localStorage.getItem('token')},
    //                     data: data.field,
    //                     method: 'POST',
    //                     success: function (res) {
    //                         if (res.code === 200){
    //                             layer.close(dIndex);
    //                             layer.msg(res.msg, {icon: 1});
    //                             tableReload()
    //                         } else if (res.code === 403){
    //                             top.location.href = baseUrl+"/";
    //                         }else {
    //                             layer.msg(res.msg, {icon: 2});
    //                         }
    //                     }
    //                 })
    //             });
    //             $(layero).children('.layui-layer-content').css('overflow', 'visible');
    //             layui.form.render('select');
    //         }
    //     });
    // }
    //更新form
    function showEditForm(mData) {
@@ -824,34 +832,34 @@
        })
    }
    window.loadNameXmlSel = function () {
        return xmSelect.render({
            el: '#nameXmlSel',
            autoRow: true,
            filterable: true,
            remoteSearch: true,
            clickClose: true,
            radio: true,
            remoteMethod: function (val, cb, show) {
                $.ajax({
                    url: baseUrl + "/priOnline2/HJ/search/auth",
                    headers: {'token': localStorage.getItem('token')},
                    data: {
                        condition: val
                    },
                    method: 'POST',
                    success: function (res) {
                        if (res.code === 200) {
                            cb(res.data)
                        } else {
                            cb([]);
                            layer.msg(res.msg, {icon: 2});
                        }
                    }
                });
            }
        });
    }
    // window.loadNameXmlSel = function () {
    //     return xmSelect.render({
    //         el: '#nameXmlSel',
    //         autoRow: true,
    //         filterable: true,
    //         remoteSearch: true,
    //         clickClose: true,
    //         radio: true,
    //         remoteMethod: function (val, cb, show) {
    //             $.ajax({
    //                 url: baseUrl + "/priOnline2/HJ/search/auth",
    //                 headers: {'token': localStorage.getItem('token')},
    //                 data: {
    //                     condition: val
    //                 },
    //                 method: 'POST',
    //                 success: function (res) {
    //                     if (res.code === 200) {
    //                         cb(res.data)
    //                     } else {
    //                         cb([]);
    //                         layer.msg(res.msg, {icon: 2});
    //                     }
    //                 }
    //             });
    //         }
    //     });
    // }
});
src/main/webapp/static/js/reimburseOnline/reimburseOnline.js
@@ -330,18 +330,18 @@
                                {field: 'occupation', title: '事由', width: 200},
                                // {field: 'expenseType', title: '费用类型', width: 100},
                                {field: 'expenseType$', title: '费用类型', width: 100},
                                {field: 'taxRate', title: '税率', width: 60},
                                {field: 'taxRate$', title: '税率', width: 60},
                                {field: 'untaxedAmountInLocalCurrency', title: '未税本币金额', style: 'color: blue;font-weight: bold', edit: true, minWidth: 110, width: 110},
                                {field: 'untaxedAmount', title: '未税金额', width: 100},
                                {field: 'taxAmount', title: '税额', width: 60},
                                {field: 'invoiceValue', title: '发票金额',  style: 'color: blue;font-weight: bold', edit: true, minWidth: 110, width: 110},
                                {field: 'invoiceAmountInLocalCurrency', title: '发票本币金额',  style: 'color: blue;font-weight: bold', edit: true, minWidth: 110, width: 110},
                                {field: 'reimbursementRatio', title: '报销比例', width: 100},
                                {field: 'reimbursementRatio$', title: '报销比例', width: 100},
                                {field: 'reimbursementAmount', title: '报销金额', width: 100},
                                {field: 'reimbursementAmountInLocalCurrency', title: '报销本币金额', width: 120},
                                {field: 'cashierConfirmationAmount', title: '出纳确认金额', width: 120},
                                {field: 'cashierCurrency', title: '出纳币种', width: 100},
                                {field: 'departureTime', title: '出发日期', width: 100},
                                // {field: 'cashierCurrency', title: '出纳币种', width: 100},
                                // {field: 'departureTime', title: '出发日期', width: 100},
                                {field: 'cashierConfirmationAmount', title: '出纳确认金额', width: 120},
                                {field: 'userId', title: '列支人员', width: 120},
                                {field: 'deptId', title: '列支部门', width: 120},
@@ -467,8 +467,8 @@
                        {field: 'reimbursementAmount', title: '报销金额', width: 100, edit: true},
                        {field: 'reimbursementAmountInLocalCurrency', title: '报销本币金额', width: 120, edit: true},
                        {field: 'cashierConfirmationAmount', title: '出纳确认金额', width: 120, edit: true},
                        {field: 'cashierCurrency', title: '出纳币种', width: 100, edit: true},
                        {field: 'departureTime', title: '出发日期', width: 100},
                        // {field: 'cashierCurrency', title: '出纳币种', width: 100, edit: true},
                        // {field: 'departureTime', title: '出发日期', width: 100},
                        {field: 'cashierConfirmationAmount', title: '出纳确认金额', width: 120, edit: true},
                        {field: 'userId', title: '列支人员', width: 120},
                        {field: 'deptId', title: '列支部门', width: 120},
src/main/webapp/views/plan/plan.html
@@ -106,6 +106,15 @@
    </div>
</div>
<!-- 表格操作列 -->
<script type="text/html" id="tbLook">
    <span class="layui-text">
        <a href="javascript:;" lay-event="look">
            <i class="layui-icon" style="font-size: 12px;">&#xe61a;</i> 查看关联流程
        </a>
    </span>
</script>
<div id="myModal"  style="display: none;">
    <div style="padding: 10px">
        <div class="layui-upload">
@@ -144,6 +153,9 @@
        <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">修改</a>
        <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">删除</a>
    {{# } }}
    {{# if (d.assistantHostSign == 0 && d.assistantPlanId==0) { }}
        <a class="layui-btn layui-btn-xs btn-edit" lay-event="assistantPlan">创建货架规划任务</a>
    {{# } }}
</script>
src/main/webapp/views/priOnline2/priOnline.html
@@ -45,10 +45,15 @@
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <div class="layui-input-inline">
                            <input class="layui-input" type="text" name="condition" placeholder="请输入" autocomplete="off"
                                   style="border-color: #e1e1e1">
                        </div>
                        <label class="layui-form-label">ALL:</label>
                        <div class="layui-input-inline" style="text-align: left">
                            <input id="allSwitch" name="allSwitch" class="layui-input" type="checkBox" lay-skin="primary" lay-filter='detailCheckbox'>
                        </div>
                    </div>
                    <div class="layui-inline">&emsp;
@@ -66,7 +71,7 @@
<script type="text/html" id="toolbar">
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-sm" lay-event="addBlank">新增核价</button>
        <button class="layui-btn layui-btn-sm" lay-event="addBlank2">接取集成核价任务</button>
<!--        <button class="layui-btn layui-btn-sm" lay-event="addBlank2">接取集成核价任务</button>-->
        <button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="deleteData">删除</button>
    </div>
</script>