gsxxx

添加人员的json
{  'number': '0000000100000021',  'jobNumber': 'jobNumber',  'foreignCode': 'foreignCode',  'name': 'byq',  'gender': 1,  'phone': '123456789',  'organizationCode': '00000001',  'organizationName': '中级六月',  'departmentCode': '000000010002',  'departmentName': '研发部',  'workStatus': 1,  'idNumber': '410822199108111511',  'birthday': '2019-12-31',  'email': '247636225@qq.com',  'hiredate': '2019-12-31',  'politicsStatus': 1,  'sort': 1,'officePhone': '0371-55551111','positionCode': '55551111','positionName':'开发岗位','postCode': '55551111','postName':'岗位'}

 

SELECT staff.*,photo.photo_url
FROM uidc_personnel_staff staff
INNER JOIN uidc_personnel_staff_photo photo
ON staff.number=photo.staff_number
WHERE staff.is_current=1
AND photo.is_current=1
AND staff.phone LIKE '123456789'
or staff.`name` LIKE '%by'
or staff.job_number =

AND staff.number='0000000100001011'


INSERT INTO `uid_uidc`.`uidc_personnel_staff` ( `number`, `foreign_code`, `job_number`, `name`, `gender`, `id_number`, `birthday`, `phone`, `office_phone`, `email`, `organization_code`, `organization_name`, `department_code`, `department_name`, `position_code`, `position_name`, `post_code`, `post_name`, `hiredate`, `politics_status`, `work_status`, `smartcard_number`, `version`, `is_current`, `extend`, `sort`, `is_delete`, `field_check`, `create_time`, `create_number`, `update_time`, `update_number`) VALUES ( '0000000100000007', 'foreignCode', 'jobNumber', 'demoData', '1', 'demoData', '2019-12-31', '123456789', NULL, 'demoData', 'demoData', 'demoData', '000000010004', 'demoData', NULL, NULL, NULL, NULL, '2019-12-31', '1', '1', NULL, '1', '2', NULL, '1', '0', 'adsfasdfad', '2020-02-16 17:08:37', NULL, '2020-02-16 17:08:37', NULL);

UPDATE `uid_uidc`.`uidc_personnel_staff_photo` SET `staff_number`='00000000100000001', `photo_url`=NULL, `is_current`='1', `is_delete`='0', `extend`=NULL, `create_time`='2020-02-18 23:40:00', `update_time`='2020-02-18 23:40:00', `update_number`=NULL
WHERE staff_number ='00000000100000001'
AND is_current = 1

 

 

企业开发

{'name':'国机集团','uscc':'U456461321','districtCode':'0391','districtName':'郑州市','address':'河南省郑州市金水区省胸科医院','industryCode':'010','industryName':'建筑','establishmentDate':'2010-01-22','category':'123456123','businessType':'0002','businessState':'0003','parentOrganizationCode':'-1','sort':20}

 //递归获取fullpath

/**
     * 获取FullPath的中间步骤
     * @param code 企业编号
     * @param sb 初始化参数
     * @return 待逆序的sb
     */
    private StringBuilder doFullPath(String code, StringBuilder sb) {
        Organization organization = organizationExtMapper.queryOrganizationByCode(code);
        if(("-1").equals(organization.getParentOrganizationCode())){//结束循环
            sb.append(organization.getCode());
            return sb;
        }else{
            sb.append(organization.getCode()+"/");
            return doFullPath(organization.getParentOrganizationCode(),sb);
        }
    }
 /* if("-1".equals(parentCode)){//以后可能有用
            return code;
        }else{
            String[] codes = doFullPath(parentCode, new StringBuilder()).toString().split("/");
            String res = "";
            for(int i=codes.length-1;i>=0;i--){
                res+=codes[i]+"/";
            }
            return  res.substring(0,res.length()-1)+"/"+code;
        }*/

 

{'name': '后端开发','description': '我是描述','positionCategoryCode': '0002','sort': '3'}

{'name': '技术类','description': '我是描述','parentCode':'-1','sort': 1}

{'name': '董事长','description': '我是职位描述','sort': '3'}


{'name':'飞机','code':'123456','desc':'我是描述','sort': 1,'isTree':'1','parentCode':'5e58d58530ca921468b532d0'}

 

 树套树

 /**
     *  递归添加子节点
     * @param id 给哪个子节点添加
     * @param rootList 所有的节点
     * @return 除主节点的所有节点
     */
    public  List<OrganizationTreeNodeDto> getChildNodes1(String id, List<OrganizationTreeNodeDto> rootList) {
        List<OrganizationTreeNodeDto> childList = new ArrayList<>();

        //在这里加入部门
       /* OrganizationTreeNodeDto dept = new OrganizationTreeNodeDto();
        dept.setName("企业本部");
        List<OrganizationTreeNodeDto> depts = queryBuildDeptTree(id);
        if(!CollectionUtils.isEmpty(depts)){
            dept.setChildren(depts);
        }
        childList.add(dept);//放入一个部门树*/
       // childList.addAll(new ArrayList<OrganizationTreeNodeDto>());//这里放的是一个列表而不是一个对象
       // for (OrganizationTreeNodeDto organization : rootList) {
        for(int i=0;i<rootList.size();i++){
            OrganizationTreeNodeDto organization = rootList.get(i);
            if (org.apache.commons.lang3.StringUtils.isNotBlank(organization.getParentCode())) {
                if (id.equals(organization.getParentCode())) {
                    childList.add(organization);
                }
            }
        }
        if (childList.size() == 0) {
            return null;
        }
        List<OrganizationTreeNodeDto> tmp = queryBuildDeptTree(id);
        tmp.addAll(childList);
        childList = tmp;
        for(int i=queryBuildDeptTree(id).size();i<childList.size();i++){
            childList.get(i).setChildren(getChildNodes1(childList.get(i).getCode(), rootList));
        }
        return childList;
    }

 

posted on 2020-02-15 20:54  biyangqiang  阅读(229)  评论(0编辑  收藏  举报

导航