New file |
| | |
| | | package com.zy.crm.common.model.enums; |
| | | |
| | | public enum RoleType { |
| | | |
| | | boss, |
| | | manager, |
| | | salesman, |
| | | ; |
| | | |
| | | } |
| | |
| | | import com.core.controller.AbstractBaseController; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.crm.system.entity.Dept; |
| | | import com.zy.crm.system.entity.Role; |
| | | import com.zy.crm.system.service.DeptService; |
| | | import com.zy.crm.system.service.RoleService; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.zy.crm.manager.entity.Node; |
| | |
| | | private DeptService deptService; |
| | | @Autowired |
| | | private UserLoginService userLoginService; |
| | | @Autowired |
| | | private RoleService roleService; |
| | | |
| | | protected Long getHostId(){ |
| | | if (getUserId() == 9527) { |
| | |
| | | return getUser().getDeptId(); |
| | | } |
| | | |
| | | protected Role getRole(){ |
| | | Role role = roleService.selectById(getUser().getRoleId()); |
| | | if (null == role) { |
| | | throw new CoolException(BaseRes.DENIED); |
| | | } |
| | | return role; |
| | | } |
| | | |
| | | protected String getComment(Class<?> cls, String fieldName){ |
| | | Field[] fields = Cools.getAllFields(cls); |
| | | for (Field field : fields){ |
| | |
| | | import com.core.common.R; |
| | | import com.core.domain.KeyValueVo; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.crm.common.model.enums.RoleType; |
| | | import com.zy.crm.common.web.BaseController; |
| | | import com.zy.crm.manager.controller.result.FollowerTableVo; |
| | | import com.zy.crm.manager.entity.Cstmr; |
| | |
| | | import com.zy.crm.manager.service.CstmrService; |
| | | import com.zy.crm.manager.service.CstmrTypeService; |
| | | import com.zy.crm.system.entity.Dic; |
| | | import com.zy.crm.system.entity.Role; |
| | | import com.zy.crm.system.entity.User; |
| | | import com.zy.crm.system.service.DicService; |
| | | import com.zy.crm.system.service.UserService; |
| | |
| | | @RequestMapping("/cstmr/all/get/kv") |
| | | @ManagerAuth |
| | | public R getDataKV(@RequestParam(required = false) String condition) { |
| | | User user = getUser(); assert user != null; |
| | | Role role = getRole(); assert role != null; |
| | | Page<Cstmr> page = cstmrService.getPage(new Page<>(1, 30) |
| | | , getHostId() |
| | | , (role.getCode().equals(RoleType.boss.toString()) || role.getCode().equals(RoleType.manager.toString())) ? String.valueOf(user.getDeptId()) : null |
| | | , user.getId() |
| | | , condition); |
| | | List<KeyValueVo> vos = new ArrayList<>(); |
| | | Wrapper<Cstmr> wrapper = new EntityWrapper<Cstmr>().andNew().like("name", condition).or().like("uuid", condition).orderBy("create_time", false); |
| | | cstmrService.selectPage(new Page<>(1, 30), wrapper).getRecords().forEach(item -> vos.add(new KeyValueVo(item.getName(), item.getId()))); |
| | | page.getRecords().forEach(item -> vos.add(new KeyValueVo(item.getName(), item.getId()))); |
| | | return R.ok().add(vos); |
| | | } |
| | | |
| | |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.core.domain.KeyValueVo; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.crm.common.model.enums.RoleType; |
| | | import com.zy.crm.common.web.BaseController; |
| | | import com.zy.crm.manager.controller.result.FollowerTableVo; |
| | | import com.zy.crm.manager.entity.Order; |
| | | import com.zy.crm.manager.entity.OrderFoll; |
| | | import com.zy.crm.manager.service.OrderFollService; |
| | | import com.zy.crm.manager.service.OrderService; |
| | | import com.zy.crm.system.entity.Role; |
| | | import com.zy.crm.system.entity.User; |
| | | import com.zy.crm.system.service.UserService; |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping("/order/all/get/kv") |
| | | @ManagerAuth |
| | | public R getDataKV(@RequestParam(required = false) String condition) { |
| | | User user = getUser(); assert user != null; |
| | | Role role = getRole(); assert role != null; |
| | | Page<Order> page = orderService.getPage(new Page<>(1, 30) |
| | | , getHostId() |
| | | , (role.getCode().equals(RoleType.boss.toString()) || role.getCode().equals(RoleType.manager.toString())) ? String.valueOf(user.getDeptId()) : null |
| | | , user.getId() |
| | | , condition); |
| | | List<KeyValueVo> vos = new ArrayList<>(); |
| | | page.getRecords().forEach(item -> vos.add(new KeyValueVo(item.getName(), item.getId()))); |
| | | return R.ok().add(vos); |
| | | } |
| | | |
| | | /*************************************** 数据相关 ***********************************************/ |
| | | |
| | | /** |
| | |
| | | and ( |
| | | mo.uuid like concat('%',#{condition},'%') |
| | | or mo.name like concat('%',#{condition},'%') |
| | | or mo.tel like concat('%',#{condition},'%') |
| | | or mo.contacts like concat('%',#{condition},'%') |
| | | or mo.remarks like concat('%',#{condition},'%') |
| | | or mo.director like concat('%',#{condition},'%') |
| | | or mo.addr like concat('%',#{condition},'%') |
| | | ) |
| | | </if> |
| | |
| | | ,{field: 'uuid', align: 'center',title: '规划单代号'} |
| | | ,{field: 'appleTime$', align: 'center',title: '申请日期'} |
| | | // ,{field: 'beItem$', align: 'center',title: '立项'} |
| | | ,{field: 'planner', align: 'center',title: '规划员'} |
| | | ,{field: 'planner', align: 'center',title: '规划员', templet:function(d){return emptyShow(d.planner)}} |
| | | // ,{field: 'finishTime$', align: 'center',title: '完成时间'} |
| | | // ,{field: 'form', align: 'center',title: '表单内容'} |
| | | // ,{field: 'change$', align: 'center',title: '更改方案'} |