中扬CRM客户关系管理系统
#
lsh
2024-04-16 799c3039676eb62d64b4757bcda704376f8916de
#
6个文件已修改
1个文件已添加
90 ■■■■ 已修改文件
src/main/java/com/zy/crm/common/utils/Synchro.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/manager/controller/WeeklyController.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/manager/controller/WeeklyCostTypesController.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/manager/entity/WeeklyDailyReality.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/cstmr/cstmr.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/cstmr/cstmr2.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/weekly/weekly.js 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/common/utils/Synchro.java
New file
@@ -0,0 +1,38 @@
package com.zy.crm.common.utils;
import com.core.exception.CoolException;
import java.beans.BeanInfo;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Method;
/**
 * Created by vincent on 2022/4/1
 */
public class Synchro {
    public static void Copy(Object source, Object dest) {
        try {
            BeanInfo sourceBean = Introspector.getBeanInfo(source.getClass(),Object.class);
            PropertyDescriptor[] sourceProperty = sourceBean.getPropertyDescriptors();
            BeanInfo destBean = Introspector.getBeanInfo(dest.getClass(),Object.class);
            PropertyDescriptor[] destProperty = destBean.getPropertyDescriptors();
            for (PropertyDescriptor propertyDescriptor : sourceProperty) {
                for (PropertyDescriptor descriptor : destProperty) {
                    if (propertyDescriptor.getName().equals(descriptor.getName()) && propertyDescriptor.getPropertyType() == descriptor.getPropertyType()) {
                        Method readMethod = propertyDescriptor.getReadMethod();
                        Method writeMethod = descriptor.getWriteMethod();
                        if (null != writeMethod && null != readMethod) {
                            writeMethod.invoke(dest, readMethod.invoke(source));
                        }
                    }
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
            throw new CoolException("属性复制失败:" + e.getMessage());
        }
    }
}
src/main/java/com/zy/crm/manager/controller/WeeklyController.java
@@ -308,6 +308,10 @@
                try{
                    weeklyDailyPlanService.insert(weeklyDailyPlan);
                    WeeklyDailyReality weeklyDailyReality = new WeeklyDailyReality();
                    weeklyDailyReality.sync(weeklyDailyPlan);
                    weeklyDailyRealityService.insert(weeklyDailyReality);
                } catch (Exception e){
                    log.error("新增日计划失败"+e);
                    throw new CoolException("新增日计划失败");
@@ -322,7 +326,8 @@
        } catch (Exception e){
            log.error("创建周计划异常,异常信息:"+e);
            throw new CoolException("创建周计划失败==>"+e);
            return R.error("创建周计划失败==>"+e);
//            throw new CoolException("创建周计划失败==>"+e);
        }
        return R.ok("创建成功");
@@ -443,7 +448,8 @@
                weeklyService.insert(weekly);
            } catch (Exception e) {
                log.error("新增周计划主表失败,异常信息:"+e);
                throw new CoolException("新增周计划主表失败");
                return R.error("新增周计划主表失败");
//                throw new CoolException("新增周计划主表失败");
            }
            List<CstmrUtilsParam> cstmrUtilsParamList = new ArrayList<>();
@@ -469,7 +475,8 @@
                    weeklyDailyRealityService.insert(weeklyDailyReality);
                } catch (Exception e){
                    log.error("新增日计划失败"+e);
                    throw new CoolException("新增日计划失败");
//                    throw new CoolException("新增日计划失败");
                    return R.error("新增日计划失败");
                }
            }
@@ -481,7 +488,8 @@
        } catch (Exception e){
            log.error("创建周计划异常,异常信息:"+e);
            throw new CoolException("创建周计划失败==>"+e);
//            throw new CoolException("创建周计划失败==>"+e);
            return R.error("创建周计划失败==>"+e);
        }
        return R.ok("创建成功");
@@ -568,6 +576,9 @@
                    try{
                        weeklyDailyPlanService.insert(weeklyDailyPlan);
                        WeeklyDailyReality weeklyDailyReality = new WeeklyDailyReality();
                        weeklyDailyReality.sync(weeklyDailyPlan);
                        weeklyDailyRealityService.insert(weeklyDailyReality);
                    } catch (Exception e){
                        log.error("新增日计划失败"+e);
                        throw new CoolException("新增日计划失败");
src/main/java/com/zy/crm/manager/controller/WeeklyCostTypesController.java
@@ -7,12 +7,12 @@
import com.baomidou.mybatisplus.plugins.Page;
import com.core.common.DateUtils;
import com.zy.crm.manager.entity.*;
import com.zy.crm.manager.entity.result.KeyValueVo;
import com.zy.crm.manager.service.WeeklyCostTypesService;
import com.core.annotations.ManagerAuth;
import com.core.common.BaseRes;
import com.core.common.Cools;
import com.core.common.R;
import com.core.domain.KeyValueVo;
import com.zy.crm.common.web.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -155,10 +155,10 @@
        List<WeeklyCostTypes> weeklyCostTypesList = weeklyCostTypesService.selectPage(new Page<>(1, 30), wrapper).getRecords();
        List<com.zy.crm.manager.entity.result.KeyValueVo> valueVos = new ArrayList<>();
        for (WeeklyCostTypes weeklyCostTypes : weeklyCostTypesList) {
            com.zy.crm.manager.entity.result.KeyValueVo vo = new com.zy.crm.manager.entity.result.KeyValueVo();
            vo.setName(weeklyCostTypes.getTypeName());
            vo.setValue(weeklyCostTypes.getId());
            valueVos.add(vo);
            KeyValueVo keyValueVo = new KeyValueVo();
            keyValueVo.setName(weeklyCostTypes.getTypeName());
            keyValueVo.setValue(weeklyCostTypes.getId());
            valueVos.add(keyValueVo);
        }
        return R.ok().add(valueVos);
    }
src/main/java/com/zy/crm/manager/entity/WeeklyDailyReality.java
@@ -5,6 +5,7 @@
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.annotations.TableField;
import com.zy.crm.common.utils.Synchro;
import com.zy.crm.manager.service.CstmrService;
import com.zy.crm.manager.service.WeeklyCostTypesService;
import com.zy.crm.system.entity.*;
@@ -424,5 +425,8 @@
        return null;
    }
    public void sync(Object source) {
        Synchro.Copy(source, this);
    }
}
src/main/webapp/static/js/cstmr/cstmr.js
@@ -288,7 +288,7 @@
                                ,{field: 'dailyTime$',width : 120, align: 'center',title: '日期'}
                                ,{field: 'workContent', align: 'center', title: '工作内容及目的', edit:false}
                                // ,{field: 'workPurpose', title: '工作目的', edit:false}
                                ,{field: 'comment', title: '评论', edit:false}
                                // ,{field: 'comment', title: '评论', edit:false}
                                ,{field: 'weeklyMatter', title: '需协助事项',  edit:false}
                                // ,{field: 'dailyTime$', align: 'center',title: '日报日期'}
                                // ,{field: 'settleMsg', align: 'center',title: '审核进度'}
src/main/webapp/static/js/cstmr/cstmr2.js
@@ -301,7 +301,7 @@
                                ,{field: 'dailyTime$',width : 120, align: 'center',title: '日期'}
                                ,{field: 'workContent', align: 'center', title: '工作内容及目的', edit:false}
                                // ,{field: 'workPurpose', title: '工作目的', edit:false}
                                ,{field: 'comment', title: '评论', edit:false}
                                // ,{field: 'comment', title: '评论', edit:false}
                                ,{field: 'weeklyMatter', title: '需协助事项',  edit:false}
                                // ,{field: 'dailyTime$', align: 'center',title: '日报日期'}
                                // ,{field: 'settleMsg', align: 'center',title: '审核进度'}
src/main/webapp/static/js/weekly/weekly.js
@@ -644,7 +644,8 @@
                    },
                    done: function (res, curr, count) {
                        $(".layui-table-cell").css('overflow', 'visible');//解决layui数据表格中嵌套下拉框显示问题
                        $(".laytable-cell-2-0-7").css('color', 'rgba(0, 0, 0, 0)');
                        $(".laytable-cell-2-0-5").css('color', 'rgba(0, 0, 0, 0)');
                        $(".layui-layer-setwin").css('display', 'none');
                        $(layero).find('.layui-table-view').css('margin', '0');
                        var options = this;
@@ -936,7 +937,11 @@
                        }
                    })
                    location.reload();
                    return false;
                });
                $('#cancelBtn').on('click', function () {
                    location.reload();
                });
                // 明细表格
                var xxDataList = [];
@@ -954,7 +959,7 @@
                        // ,{field: 'workPurpose', title: '工作目的', style: 'color: blue;font-weight: bold', edit:true}
                        ,{field: 'addr', title: '地址', style: 'color: blue;font-weight: bold', edit:true}
                        // ,{field: 'comment', title: '评论', style: 'color: blue;font-weight: bold', edit:false}
                        ,{field: 'weeklyMatter', title: '需协助事项', style: 'color: blue;font-weight: bold', edit:true}
                        // ,{field: 'weeklyMatter', title: '需协助事项', style: 'color: blue;font-weight: bold', edit:true}
                        // ,{field: 'dailyTime$', align: 'center',title: '日报日期'}
                        // ,{field: 'settleMsg', align: 'center',title: '审核进度'}
                        // ,{field: 'director', align: 'center',title: '负责人'}
@@ -974,7 +979,8 @@
                    },
                    done: function (res, curr, count) {
                        $(".layui-table-cell").css('overflow', 'visible');//解决layui数据表格中嵌套下拉框显示问题
                        $(".laytable-cell-2-0-6").css('color', 'rgba(0, 0, 0, 0)');
                        $(".laytable-cell-2-0-4").css('color', 'rgba(0, 0, 0, 0)');
                        $(".layui-layer-setwin").css('display', 'none');
                        $(layero).find('.layui-table-view').css('margin', '0');
                        var options = this;
@@ -1130,6 +1136,9 @@
                        title: (exp ? '修改' : '添加') + '明细',
                        content: $('#matEditDialog').html(),
                        success: function (layero, dIndex) {
                            if (!exp){
                                indexDelSign = 1;
                            }
                            // 回显数据
                            form.val('matEditForm', exp);
                            // 表单提交事件