New file |
| | |
| | | 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()); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | try{ |
| | | weeklyDailyPlanService.insert(weeklyDailyPlan); |
| | | WeeklyDailyReality weeklyDailyReality = new WeeklyDailyReality(); |
| | | weeklyDailyReality.sync(weeklyDailyPlan); |
| | | weeklyDailyRealityService.insert(weeklyDailyReality); |
| | | |
| | | } catch (Exception e){ |
| | | log.error("新增日计划失败"+e); |
| | | throw new CoolException("新增日计划失败"); |
| | |
| | | |
| | | } catch (Exception e){ |
| | | log.error("创建周计划异常,异常信息:"+e); |
| | | throw new CoolException("创建周计划失败==>"+e); |
| | | return R.error("创建周计划失败==>"+e); |
| | | // throw new CoolException("创建周计划失败==>"+e); |
| | | } |
| | | |
| | | return R.ok("创建成功"); |
| | |
| | | weeklyService.insert(weekly); |
| | | } catch (Exception e) { |
| | | log.error("新增周计划主表失败,异常信息:"+e); |
| | | throw new CoolException("新增周计划主表失败"); |
| | | return R.error("新增周计划主表失败"); |
| | | // throw new CoolException("新增周计划主表失败"); |
| | | } |
| | | |
| | | List<CstmrUtilsParam> cstmrUtilsParamList = new ArrayList<>(); |
| | |
| | | weeklyDailyRealityService.insert(weeklyDailyReality); |
| | | } catch (Exception e){ |
| | | log.error("新增日计划失败"+e); |
| | | throw new CoolException("新增日计划失败"); |
| | | // throw new CoolException("新增日计划失败"); |
| | | return R.error("新增日计划失败"); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | } catch (Exception e){ |
| | | log.error("创建周计划异常,异常信息:"+e); |
| | | throw new CoolException("创建周计划失败==>"+e); |
| | | // throw new CoolException("创建周计划失败==>"+e); |
| | | return R.error("创建周计划失败==>"+e); |
| | | } |
| | | |
| | | return R.ok("创建成功"); |
| | |
| | | |
| | | try{ |
| | | weeklyDailyPlanService.insert(weeklyDailyPlan); |
| | | WeeklyDailyReality weeklyDailyReality = new WeeklyDailyReality(); |
| | | weeklyDailyReality.sync(weeklyDailyPlan); |
| | | weeklyDailyRealityService.insert(weeklyDailyReality); |
| | | } catch (Exception e){ |
| | | log.error("新增日计划失败"+e); |
| | | throw new CoolException("新增日计划失败"); |
| | |
| | | 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.*; |
| | |
| | | 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); |
| | | } |
| | |
| | | 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.*; |
| | |
| | | return null; |
| | | } |
| | | |
| | | public void sync(Object source) { |
| | | Synchro.Copy(source, this); |
| | | } |
| | | |
| | | } |
| | |
| | | ,{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: '审核进度'} |
| | |
| | | ,{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: '审核进度'} |
| | |
| | | }, |
| | | 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; |
| | |
| | | } |
| | | }) |
| | | location.reload(); |
| | | |
| | | return false; |
| | | }); |
| | | $('#cancelBtn').on('click', function () { |
| | | location.reload(); |
| | | }); |
| | | // 明细表格 |
| | | var xxDataList = []; |
| | |
| | | // ,{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: '负责人'} |
| | |
| | | }, |
| | | 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; |
| | |
| | | title: (exp ? '修改' : '添加') + '明细', |
| | | content: $('#matEditDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | if (!exp){ |
| | | indexDelSign = 1; |
| | | } |
| | | // 回显数据 |
| | | form.val('matEditForm', exp); |
| | | // 表单提交事件 |