| | |
| | | map.put("title", dept.getName()); |
| | | map.put("id", dept.getId()); |
| | | map.put("spread", true); |
| | | map.put("key", "dept_id"); |
| | | // map.put("icon", "layui-icon layui-icon-star-fill"); |
| | | List<Map<String, Object>> childrens = new ArrayList<>(); |
| | | map.put("children", childrens); |
| | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("title", user.getNickname()); |
| | | map.put("id", user.getId()); |
| | | map.put("key", "user_id"); |
| | | map.put("icon", "layui-icon layui-icon-friends"); |
| | | list.add(map); |
| | | } |
| | |
| | | map.put("title", dept.getName()); |
| | | map.put("id", dept.getId()); |
| | | map.put("spread", true); |
| | | map.put("key", "dept_id"); |
| | | // map.put("icon", "layui-icon layui-icon-star-fill"); |
| | | List<Map<String, Object>> childrens = new ArrayList<>(); |
| | | map.put("children", childrens); |
| | |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} else { |
| | | wrapper.orderBy("create_time", false); |
| | | } |
| | | return R.ok(cstmrService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | if (!Cools.isEmpty(param.get("dept_id"))) { |
| | | return R.ok(cstmrService.getPage(new Page<>(curr, limit) |
| | | , getHostId() |
| | | , String.valueOf(param.get("dept_id")) |
| | | , param.get("condition")) |
| | | ); |
| | | } else { |
| | | return R.ok(cstmrService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | |
| | | package com.zy.crm.manager.mapper; |
| | | |
| | | import com.zy.crm.manager.entity.Cstmr; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.zy.crm.manager.entity.Cstmr; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | @Repository |
| | |
| | | |
| | | Cstmr selectCstmrByNewestUuid(@Param("hostId") Long hostId); |
| | | |
| | | List<Cstmr> listByPage(Page page, @Param("hostId")Long hostId, @Param("deptId") String deptId, @Param("condition") Object condition); |
| | | |
| | | } |
| | |
| | | package com.zy.crm.manager.service; |
| | | |
| | | import com.zy.crm.manager.entity.Cstmr; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.crm.manager.entity.Cstmr; |
| | | |
| | | public interface CstmrService extends IService<Cstmr> { |
| | | |
| | |
| | | |
| | | String getNextUuid(Long hostId); |
| | | |
| | | Page<Cstmr> getPage(Page page, Long hostId, String deptId, Object condition); |
| | | |
| | | } |
| | |
| | | package com.zy.crm.manager.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.zy.crm.manager.mapper.CstmrMapper; |
| | | import com.zy.crm.manager.entity.Cstmr; |
| | | import com.zy.crm.manager.service.CstmrService; |
| | |
| | | return zerofill(String.valueOf(Integer.parseInt(cstmr.getUuid()) + 1), 4); |
| | | } |
| | | |
| | | @Override |
| | | public Page<Cstmr> getPage(Page page, Long hostId, String deptId, Object condition) { |
| | | return page.setRecords(baseMapper.listByPage(page, hostId, deptId, condition)); |
| | | } |
| | | |
| | | |
| | | public static String zerofill(String msg, Integer count){ |
| | | if (msg.length() == count){ |
| | |
| | | url: jdbc:sqlserver://47.97.1.152:51433;databasename=zy_crm |
| | | username: sa |
| | | password: Zoneyung@zy56$ |
| | | # url: jdbc:sqlserver://localhost:1433;databasename=zy_crm |
| | | # username: sa |
| | | # password: sa@123 |
| | | mvc: |
| | | static-path-pattern: /** |
| | | redis: |
| | |
| | | mapper-locations: classpath:mapper/*.xml |
| | | # global-config: |
| | | # field-strategy: 0 |
| | | # configuration: |
| | | # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | |
| | | logging: |
| | | path: /stock/out/@pom.build.finalName@/logs |
| | |
| | | order by uuid + 0 desc |
| | | </select> |
| | | |
| | | <select id="listByPage" resultMap="BaseResultMap"> |
| | | SELECT |
| | | mc.* |
| | | FROM man_cstmr mc |
| | | LEFT JOIN sys_dept sd ON mc.dept_id = sd.id |
| | | WHERE 1=1 |
| | | AND (CHARINDEX(','+#{deptId}+',', ','+sd.path+',') > 0 OR sd.id = #{deptId}) |
| | | <if test="hostId != null and hostId != ''"> |
| | | and mc.host_id = #{hostId} |
| | | </if> |
| | | <if test="condition != null and condition != ''"> |
| | | and mc.name like concat('%',#{condition},'%') |
| | | </if> |
| | | ORDER BY mc.create_time DESC |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | var organizationTree; |
| | | var selObj; |
| | | window.loadTree = function(condition){ |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/dept/user/tree/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | organizationTree = tree.render({ |
| | | elem: '#organizationTree', |
| | |
| | | onlyIconControl: true, |
| | | data: res.data, |
| | | click: function (obj) { |
| | | console.log(obj) |
| | | selObj = obj; |
| | | $('#organizationTree').find('.ew-tree-click').removeClass('ew-tree-click'); |
| | | $(obj.elem).children('.layui-tree-entry').addClass('ew-tree-click'); |
| | | tableIns.reload({ |
| | | where: {dept_id: obj.data.id}, |
| | | where: {[obj.data.key]: obj.data.id}, |
| | | page: {curr: 1} |
| | | }); |
| | | } |
| | |
| | | page: true, |
| | | limit: 15, |
| | | limits: [15, 30, 50, 100, 200, 500], |
| | | cellMinWidth: 100, |
| | | // cellMinWidth: 100, |
| | | height: 'full-148', |
| | | // size: 'sm', |
| | | skin: 'line', |