1. 许可证信息新增
2. 工商表信息新增
3. 保安公司tree 接口修改
4. 管理人实体修改
5. 保安,公司相关接口修改
14 files modified
14 files added
| New file |
| | |
| | | package org.springblade.modules.business.controller; |
| | | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.business.entity.Business; |
| | | import org.springblade.modules.business.service.BusinessService; |
| | | import org.springblade.modules.business.vo.BusinessVo; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * @author zhongrj |
| | | * @time 2021-12-25 |
| | | * @desc 工商信息控制层 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/business") |
| | | public class BusinessController { |
| | | |
| | | private final BusinessService businessService; |
| | | |
| | | |
| | | // /** |
| | | // * 自定义分页 |
| | | // * @param query page,size |
| | | // * @param business 工商信息信息对象 |
| | | // */ |
| | | // @GetMapping("/page") |
| | | // public R<IPage<SecurityPaperVo>> page(SecurityPaperVo business, Query query) { |
| | | // IPage<SecurityPaperVo> pages = businessService.selectSecurityPaperPage(Condition.getPage(query), business); |
| | | // return R.data(pages); |
| | | // } |
| | | |
| | | /** |
| | | * 新增 |
| | | * @param business 工商信息信息对象 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperation(value = "新增", notes = "传入business") |
| | | public R save(@RequestBody Business business){ |
| | | return R.data(businessService.save(business)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param business 工商信息信息对象 |
| | | */ |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody Business business){ |
| | | return R.status(businessService.updateById(business)); |
| | | } |
| | | |
| | | /** |
| | | * 新增或修改 |
| | | * @param business 工商信息信息对象 |
| | | */ |
| | | @PostMapping("/submit") |
| | | public R submit(@RequestBody Business business){ |
| | | if (null==business.getId()){ |
| | | businessService.save(business); |
| | | }else { |
| | | businessService.updateById(business); |
| | | } |
| | | return R.data(business); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param ids 工商信息信息ids 数组 |
| | | */ |
| | | @PostMapping("/remove") |
| | | public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { |
| | | return R.status(businessService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | * @param business 工商信息信息对象 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperation(value = "详情", notes = "传入business") |
| | | public R<Business> detail(Business business) { |
| | | Business detail = businessService.getOne(Condition.getQueryWrapper(business)); |
| | | return R.data(detail); |
| | | } |
| | | |
| | | /** |
| | | * 详情(包含分公司工商信息) |
| | | * @param business 工商信息信息对象 |
| | | */ |
| | | @GetMapping("/getBusinessInfo") |
| | | public R<BusinessVo> getBusinessInfo(Business business) { |
| | | return R.data(businessService.getBusinessInfo(business)); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.business.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 工商信息实体类 |
| | | * @author zhongrj |
| | | * @time 2021-12-25 |
| | | */ |
| | | @Data |
| | | @TableName("sys_business") |
| | | public class Business implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 工商信息主键id,非自增 |
| | | */ |
| | | @TableId(value = "id",type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | |
| | | /** |
| | | * 统一社会信用代码 |
| | | */ |
| | | @TableField("social_credit_code") |
| | | private String socialCreditCode; |
| | | |
| | | /** |
| | | * 注册时间 |
| | | */ |
| | | @TableField("register_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date registerTime; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 注册资本 |
| | | */ |
| | | private String capital; |
| | | |
| | | /** |
| | | * 经营范围 |
| | | */ |
| | | @TableField("business_scope") |
| | | private String businessScope; |
| | | |
| | | |
| | | /** |
| | | * 营业执照url |
| | | */ |
| | | private String trading; |
| | | |
| | | /** |
| | | * 公司id |
| | | */ |
| | | @TableField("dept_id") |
| | | private String deptId; |
| | | |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.business.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.modules.business.entity.Business; |
| | | import org.springblade.modules.business.vo.BusinessVo; |
| | | |
| | | |
| | | /** |
| | | * 工商信息Mapper 接口 |
| | | * @author zhongrj |
| | | */ |
| | | public interface BusinessMapper extends BaseMapper<Business> { |
| | | |
| | | /** |
| | | * 详情(包含分公司工商信息) |
| | | * @param business 工商信息信息对象 |
| | | */ |
| | | BusinessVo getBusinessInfo(@Param("business") Business business); |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.springblade.modules.business.mapper.BusinessMapper"> |
| | | |
| | | <!--工商信息详情--> |
| | | <select id="getBusinessInfo" resultType="org.springblade.modules.business.vo.BusinessVo"> |
| | | select |
| | | sb.*, |
| | | si.establishTime establishtime, |
| | | si.registeredCapital registeredcapital, |
| | | si.creditCode creditcode, |
| | | si.business, |
| | | si.business_License businessLicense |
| | | from |
| | | sys_business sb |
| | | right join |
| | | sys_information si |
| | | on |
| | | sb.dept_id = si.departmentid |
| | | where si.departmentid = #{business.deptId} |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package org.springblade.modules.business.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.modules.business.entity.Business; |
| | | import org.springblade.modules.business.vo.BusinessVo; |
| | | |
| | | /** |
| | | * 工商信息服务类 |
| | | * @author zhongrj |
| | | */ |
| | | public interface BusinessService extends IService<Business> { |
| | | |
| | | /** |
| | | * 详情(包含分公司工商信息) |
| | | * @param business 工商信息信息对象 |
| | | */ |
| | | BusinessVo getBusinessInfo(Business business); |
| | | } |
| New file |
| | |
| | | |
| | | package org.springblade.modules.business.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.modules.business.entity.Business; |
| | | import org.springblade.modules.business.mapper.BusinessMapper; |
| | | import org.springblade.modules.business.service.BusinessService; |
| | | import org.springblade.modules.business.vo.BusinessVo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * 保安员证管理服务实现类 |
| | | * @author zhongrj |
| | | * @since 2021-12-25 |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class BusinessServiceImpl extends ServiceImpl<BusinessMapper, Business> implements BusinessService { |
| | | /** |
| | | * 详情(包含分公司工商信息) |
| | | * @param business 工商信息信息对象 |
| | | */ |
| | | @Override |
| | | public BusinessVo getBusinessInfo(Business business) { |
| | | return baseMapper.getBusinessInfo(business); |
| | | } |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.business.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.springblade.modules.business.entity.Business; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 工商信息vo |
| | | * @author zhongrj |
| | | * @since 2021-12-25 |
| | | */ |
| | | @Data |
| | | public class BusinessVo extends Business implements Serializable { |
| | | |
| | | /** |
| | | * 分公司统一社会信用代码 |
| | | */ |
| | | private String creditcode; |
| | | |
| | | /** |
| | | * 分公司成立日期 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date establishtime; |
| | | |
| | | |
| | | /** |
| | | * 分公司注册资本 |
| | | */ |
| | | private String registeredcapital; |
| | | |
| | | /** |
| | | * 分公司经营范围 |
| | | */ |
| | | private String business; |
| | | |
| | | /** |
| | | * 分公司营业执照 url |
| | | */ |
| | | private String businessLicense; |
| | | |
| | | } |
| | |
| | | IPage maps = informationService.selectBxc(Condition.getPage(query), jurisdiction,type); |
| | | return R.data(maps); |
| | | } |
| | | |
| | | /** |
| | | * 获取部门信息() |
| | | * @param information |
| | | * @return |
| | | */ |
| | | @GetMapping("/getInformationDetails") |
| | | public R getInformationDetails(InformationVO information) { |
| | | return R.data(informationService.getInformationDetails(information)); |
| | | } |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | List<ExportInformationExcel> exportBusinessStatis(String jurisdiction, String deptid, String stats, String startTime, String endTime); |
| | | |
| | | /** |
| | | * 查询公司所有的父级 |
| | | * @param information |
| | | * @return |
| | | */ |
| | | List<String> getDeptDetails(@Param("information") InformationVO information); |
| | | |
| | | /** |
| | | * 根据部门id 查询公司信息 |
| | | * @param s |
| | | * @return |
| | | */ |
| | | InformationVO getInformationDetails(@Param("deptId") String deptId); |
| | | } |
| | |
| | | i.*, |
| | | IFNULL(A.znum ,0) as znum, |
| | | IFNULL(B.cnum ,0) as cnum, |
| | | IFNULL(C.pnum ,0) as pnum |
| | | IFNULL(C.pnum ,0) as pnum, |
| | | sj.dept_name jurisdictionName |
| | | FROM |
| | | sys_information i |
| | | LEFT JOIN |
| | |
| | | and is_deleted = 0 |
| | | and role_id = '1412226235153731586' |
| | | AND status=1 |
| | | AND dispatch=0 |
| | | AND dispatch='0' |
| | | GROUP BY dept_id |
| | | ) C |
| | | ON C.dept_id = i.departmentid |
| | |
| | | bu.`status` = 1 |
| | | AND bu.is_deleted = 0 |
| | | AND bu.role_id = '1412226235153731586' |
| | | AND bu.dispatch = 0 |
| | | AND bu.dispatch = '0' |
| | | GROUP BY |
| | | bu.dept_id |
| | | ) C ON C.dept_id = A.departmentid |
| | |
| | | role_id = '1412226235153731586' |
| | | AND is_deleted = 0 |
| | | AND STATUS = 1 |
| | | AND dispatch = 0 |
| | | AND dispatch = '0' |
| | | GROUP BY |
| | | dept_id, |
| | | jurisdiction |
| | |
| | | jurisdiction |
| | | FROM blade_user |
| | | WHERE role_id = '1412226235153731586' and status=1 |
| | | AND dispatch = 0 |
| | | AND dispatch = '0' |
| | | GROUP BY dept_id, |
| | | jurisdiction |
| | | ) D ON A.departmentid = D.dept_id |
| | |
| | | and status = 1 |
| | | and is_deleted = 0 |
| | | and role_id = "1412226235153731586" |
| | | and dispatch = 0 |
| | | and dispatch = '0' |
| | | GROUP BY |
| | | dept_id |
| | | ) F |
| | |
| | | FROM |
| | | blade_user |
| | | WHERE |
| | | dispatch = 0 |
| | | dispatch = '0' |
| | | AND role_id = '1412226235153731586' |
| | | AND `status` = 1 |
| | | AND is_deleted = 0 |
| | |
| | | FROM |
| | | blade_user |
| | | WHERE |
| | | dispatch = 0 |
| | | dispatch = '0' |
| | | AND role_id = '1412226235153731586' |
| | | AND `status` = 1 |
| | | AND is_deleted = 0 |
| | |
| | | and bu.hold = 1 |
| | | </if> |
| | | <if test="type==2"> |
| | | and bu.dispatch = 0 |
| | | and bu.dispatch = '0' |
| | | </if> |
| | | <if test="type==3"> |
| | | and bu.soil = 0 |
| | |
| | | role_alias = "安保人员" |
| | | AND bu.is_deleted = 0 |
| | | AND bu.`status` = 1 |
| | | AND bu.dispatch = 0 |
| | | AND bu.dispatch = '0' |
| | | GROUP BY |
| | | dept_id |
| | | ) b ON a.dept_id = b.dept_id |
| | |
| | | and bu.hold = 1 |
| | | </if> |
| | | <if test="type==2"> |
| | | and bu.dispatch = 0 |
| | | and bu.dispatch = '0' |
| | | </if> |
| | | <if test="type==3"> |
| | | and bu.soil = 0 |
| | |
| | | and role_id = '1412226235153731586' |
| | | and is_deleted = 0 |
| | | AND status=1 |
| | | AND dispatch=0 |
| | | AND dispatch='0' |
| | | and dept_id in |
| | | ( |
| | | SELECT |
| | |
| | | ) |
| | | </select> |
| | | |
| | | <!--查询单位的审查异常人数--> |
| | | <!--查询单位的社保缴纳人数--> |
| | | <select id="selectInformationUnitJnsbNumCount" resultType="java.lang.Integer"> |
| | | SELECT COUNT(*) FROM blade_user |
| | | WHERE |
| | |
| | | bu.`status` = 1 |
| | | AND bu.is_deleted = 0 |
| | | AND bu.role_id = '1412226235153731586' |
| | | AND bu.dispatch = 0 |
| | | AND bu.dispatch = '0' |
| | | GROUP BY |
| | | bu.dept_id |
| | | ) C ON C.dept_id = A.departmentid |
| | |
| | | and status = 1 |
| | | and is_deleted = 0 |
| | | and role_id = "1412226235153731586" |
| | | and dispatch = 0 |
| | | and dispatch = '0' |
| | | GROUP BY |
| | | dept_id |
| | | ) F |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <!--更具部门id 查询所有的父级部门id包含本身--> |
| | | <select id="getDeptDetails" resultType="java.lang.String"> |
| | | SELECT |
| | | T1._id |
| | | FROM |
| | | ( |
| | | SELECT |
| | | @r AS _id, |
| | | ( SELECT @r := parent_id FROM blade_dept WHERE id = _id ) AS parent_id, |
| | | @l := @l + 1 AS lvl |
| | | FROM |
| | | ( SELECT @r := #{information.departmentid}, @l := 0 ) vars, |
| | | blade_dept h |
| | | ) T1 |
| | | where T1._id!=0 |
| | | AND T1._id != 1413470343230877697 |
| | | AND T1._id != 1418458374477549569 |
| | | AND T1._id != 1420222768149966850 |
| | | AND T1._id != 1425366663452196865 |
| | | order by T1._id |
| | | </select> |
| | | |
| | | <!--根据部门id 查询公司信息--> |
| | | <select id="getInformationDetails" resultType="org.springblade.modules.information.vo.InformationVO"> |
| | | select si.*,sj.dept_name jurisdictionName from sys_information si |
| | | left join sys_jurisdiction sj on sj.id = si.jurisdiction |
| | | where si.departmentid = #{deptId} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | * @return |
| | | */ |
| | | List<ExportInformationExcel> exportBusinessStatis(String jurisdiction, String deptid, String stats, String startTime, String endTime); |
| | | |
| | | |
| | | /** |
| | | * 获取部门信息() |
| | | * @param information |
| | | * @return |
| | | */ |
| | | Object getInformationDetails(InformationVO information); |
| | | |
| | | } |
| | |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取部门信息() |
| | | * @param information |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Object getInformationDetails(InformationVO information) { |
| | | //根据部门id 查询部门信息(如果有总公司,则遍历出总公司来) |
| | | List<String> deptIdList = baseMapper.getDeptDetails(information); |
| | | //取第一个查询部门信息 |
| | | InformationVO informationVO = baseMapper.getInformationDetails(deptIdList.get(0)); |
| | | //返回 |
| | | return informationVO; |
| | | } |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.licence.controller; |
| | | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.licence.entity.LicencePaper; |
| | | import org.springblade.modules.licence.service.LicencePaperService; |
| | | import org.springblade.modules.licence.vo.LicencePaperVo; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author zhongrj |
| | | * @time 2021-12-27 |
| | | * @desc 许可证控制层 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/licencePaper") |
| | | public class LicencePaperController { |
| | | |
| | | private final LicencePaperService licencePaperService; |
| | | |
| | | |
| | | // /** |
| | | // * 自定义分页 |
| | | // * @param query page,size |
| | | // * @param licencePaper 许可证信息对象 |
| | | // */ |
| | | // @GetMapping("/page") |
| | | // public R<IPage<SecurityPaperVo>> page(SecurityPaperVo licencePaper, Query query) { |
| | | // IPage<SecurityPaperVo> pages = licencePaperService.selectSecurityPaperPage(Condition.getPage(query), licencePaper); |
| | | // return R.data(pages); |
| | | // } |
| | | |
| | | /** |
| | | * 新增 |
| | | * @param licencePaper 许可证信息对象 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperation(value = "新增", notes = "传入licencePaper") |
| | | public R save(@RequestBody LicencePaper licencePaper){ |
| | | return R.data(licencePaperService.save(licencePaper)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param licencePaper 许可证信息对象 |
| | | */ |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody LicencePaper licencePaper){ |
| | | return R.status(licencePaperService.updateById(licencePaper)); |
| | | } |
| | | |
| | | /** |
| | | * 新增或修改 |
| | | * @param licencePaper 许可证信息对象 |
| | | */ |
| | | @PostMapping("/submit") |
| | | public R submit(@RequestBody LicencePaper licencePaper){ |
| | | if (null==licencePaper.getId()){ |
| | | licencePaper.setCreateTime(new Date()); |
| | | licencePaper.setUpdateTime(new Date()); |
| | | licencePaperService.save(licencePaper); |
| | | }else { |
| | | licencePaper.setUpdateTime(new Date()); |
| | | licencePaperService.updateById(licencePaper); |
| | | } |
| | | return R.data(licencePaper); |
| | | } |
| | | |
| | | /** |
| | | * 新增或修改(分公司和总公司许可证信息) |
| | | * @param licencePaper 许可证信息对象 |
| | | */ |
| | | @PostMapping("/submitGroup") |
| | | public R submitGroup(@RequestBody LicencePaperVo licencePaper){ |
| | | if (null==licencePaper.getId()){ |
| | | //总公司许可证信息新增 |
| | | licencePaper.setCreateTime(new Date()); |
| | | licencePaper.setUpdateTime(new Date()); |
| | | //新增 |
| | | licencePaperService.save(licencePaper); |
| | | |
| | | //分公司许可证信息新增 |
| | | LicencePaper paper = new LicencePaper(); |
| | | //相同信息 |
| | | paper.setType(licencePaper.getType()); |
| | | paper.setUpdateTime(new Date()); |
| | | paper.setCreateTime(new Date()); |
| | | paper.setCreateUser(licencePaper.getCreateUser()); |
| | | paper.setUpdateUser(licencePaper.getUpdateUser()); |
| | | paper.setDeptId(licencePaper.getDeptId()); |
| | | //其他信息 |
| | | paper.setParentId(licencePaper.getId()); |
| | | paper.setUnitName(licencePaper.getUnitNames()); |
| | | paper.setAddress(licencePaper.getAddresss()); |
| | | paper.setApprovalNumber(licencePaper.getApprovalNumbers()); |
| | | paper.setCode(licencePaper.getCodes()); |
| | | paper.setContent(licencePaper.getContents()); |
| | | paper.setUrl(licencePaper.getUrls()); |
| | | paper.setLegalPeople(licencePaper.getLegalPeoples()); |
| | | paper.setLicenceIssuingUnit(licencePaper.getLicenceIssuingUnits()); |
| | | paper.setLicenceIssuingTime(licencePaper.getLicenceIssuingTimes()); |
| | | paper.setRegisterCapital(licencePaper.getRegisterCapitals()); |
| | | //新增 |
| | | licencePaperService.save(paper); |
| | | }else { |
| | | //总公司信息修改 |
| | | licencePaper.setUpdateTime(new Date()); |
| | | //修改 |
| | | licencePaperService.updateById(licencePaper); |
| | | |
| | | //分公司许可证信息修改 |
| | | LicencePaper paper = new LicencePaper(); |
| | | //相同信息 |
| | | paper.setUpdateTime(new Date()); |
| | | paper.setId(licencePaper.getSid()); |
| | | //其他信息 |
| | | paper.setUnitName(licencePaper.getUnitNames()); |
| | | paper.setAddress(licencePaper.getAddresss()); |
| | | paper.setApprovalNumber(licencePaper.getApprovalNumbers()); |
| | | paper.setCode(licencePaper.getCodes()); |
| | | paper.setContent(licencePaper.getContents()); |
| | | paper.setUrl(licencePaper.getUrls()); |
| | | paper.setLegalPeople(licencePaper.getLegalPeoples()); |
| | | paper.setLicenceIssuingUnit(licencePaper.getLicenceIssuingUnits()); |
| | | paper.setLicenceIssuingTime(licencePaper.getLicenceIssuingTimes()); |
| | | paper.setRegisterCapital(licencePaper.getRegisterCapitals()); |
| | | //修改 |
| | | licencePaperService.updateById(paper); |
| | | } |
| | | return R.data(licencePaper); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param ids 许可证信息ids 数组 |
| | | */ |
| | | @PostMapping("/remove") |
| | | public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { |
| | | return R.status(licencePaperService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | * @param licencePaper 许可证信息对象 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperation(value = "详情", notes = "传入licencePaper") |
| | | public R<LicencePaper> detail(LicencePaper licencePaper) { |
| | | LicencePaper detail = licencePaperService.getOne(Condition.getQueryWrapper(licencePaper)); |
| | | return R.data(detail); |
| | | } |
| | | |
| | | /** |
| | | * 查询分公司的许可证信息(包含总公司) |
| | | * @param licencePaper 许可证信息对象 |
| | | */ |
| | | @GetMapping("/getLicenceInfos") |
| | | public R getLicenceInfos(LicencePaper licencePaper) { |
| | | return R.data(licencePaperService.getLicenceInfos(licencePaper)); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.licence.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 许可证信息实体类 |
| | | * @author zhongrj |
| | | * @time 2021-12-27 |
| | | */ |
| | | @Data |
| | | @TableName("sys_licence_paper") |
| | | public class LicencePaper implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 许可证信息主键id,非自增 |
| | | */ |
| | | @TableId(value = "id",type = IdType.ASSIGN_ID) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 许可证类型 |
| | | */ |
| | | private Integer type; |
| | | |
| | | |
| | | /** |
| | | * 单位名称 |
| | | */ |
| | | @TableField("unit_name") |
| | | private String unitName; |
| | | |
| | | |
| | | /** |
| | | * 住所 |
| | | */ |
| | | private String address; |
| | | |
| | | /** |
| | | * 法定代表人 |
| | | */ |
| | | @TableField("legal_people") |
| | | private String legalPeople; |
| | | |
| | | /** |
| | | * 经营范围,培训内容 |
| | | */ |
| | | private String content; |
| | | |
| | | /** |
| | | * 批准文号 |
| | | */ |
| | | @TableField("approval_number") |
| | | private String approvalNumber; |
| | | |
| | | /** |
| | | * 发证机关 |
| | | */ |
| | | @TableField("licence_issuing_unit") |
| | | private String licenceIssuingUnit; |
| | | |
| | | /** |
| | | * 注册资本 |
| | | */ |
| | | @TableField("register_capital") |
| | | private String registerCapital; |
| | | |
| | | /** |
| | | * 证件编号 |
| | | */ |
| | | private String code; |
| | | |
| | | /** |
| | | * 发证时间 |
| | | */ |
| | | @TableField("licence_issuing_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date licenceIssuingTime; |
| | | |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | @TableField("create_user") |
| | | private Long createUser; |
| | | |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField("create_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | |
| | | /** |
| | | * 更新人 |
| | | */ |
| | | @TableField("update_user") |
| | | private Long updateUser; |
| | | |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @TableField("update_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 公司id |
| | | */ |
| | | @TableField("dept_id") |
| | | private String deptId; |
| | | |
| | | /** |
| | | * 营业执照url |
| | | */ |
| | | private String url; |
| | | |
| | | /** |
| | | * 父(总)公司许可证id |
| | | */ |
| | | @TableField("parent_id") |
| | | private Long parentId; |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.licence.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.modules.licence.entity.LicencePaper; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * 许可证Mapper 接口 |
| | | * @author zhongrj |
| | | */ |
| | | public interface LicencePaperMapper extends BaseMapper<LicencePaper> { |
| | | /** |
| | | * 根据deptId查询 许可证信息 |
| | | * @param licencePaper |
| | | * @return |
| | | */ |
| | | List<LicencePaper> getLicenceListByDeptId(@Param("licencePaper") LicencePaper licencePaper); |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.springblade.modules.licence.mapper.LicencePaperMapper"> |
| | | |
| | | <!--根据deptId查询 许可证信息--> |
| | | <select id="getLicenceListByDeptId" resultType="org.springblade.modules.licence.entity.LicencePaper"> |
| | | select * from sys_licence_paper where dept_id = #{licencePaper.deptId} order by id desc |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package org.springblade.modules.licence.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.modules.licence.entity.LicencePaper; |
| | | import org.springblade.modules.licence.vo.LicencePaperVo; |
| | | |
| | | /** |
| | | * 许可证服务类 |
| | | * @author zhongrj |
| | | */ |
| | | public interface LicencePaperService extends IService<LicencePaper> { |
| | | |
| | | /** |
| | | * 查询分公司的许可证信息(包含总公司) |
| | | * @param licencePaper 许可证信息对象 |
| | | */ |
| | | LicencePaperVo getLicenceInfos(LicencePaper licencePaper); |
| | | } |
| New file |
| | |
| | | |
| | | package org.springblade.modules.licence.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.modules.licence.entity.LicencePaper; |
| | | import org.springblade.modules.licence.mapper.LicencePaperMapper; |
| | | import org.springblade.modules.licence.service.LicencePaperService; |
| | | import org.springblade.modules.licence.vo.LicencePaperVo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 许可证服务实现类 |
| | | * @author zhongrj |
| | | * @since 2021-12-27 |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class LicencePaperServiceImpl extends ServiceImpl<LicencePaperMapper, LicencePaper> implements LicencePaperService { |
| | | /** |
| | | * 查询分公司的许可证信息(包含总公司) |
| | | * @param licencePaper 许可证信息对象 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public LicencePaperVo getLicenceInfos(LicencePaper licencePaper) { |
| | | |
| | | List<LicencePaper> list = baseMapper.getLicenceListByDeptId(licencePaper); |
| | | if (list.size()>0){ |
| | | LicencePaperVo paper = new LicencePaperVo(); |
| | | if (list.size()==1){ |
| | | LicencePaper licencePaper1 = list.get(0); |
| | | paper.setId(licencePaper1.getId()); |
| | | paper.setUnitName(licencePaper1.getUnitName()); |
| | | paper.setAddress(licencePaper1.getAddress()); |
| | | paper.setApprovalNumber(licencePaper1.getApprovalNumber()); |
| | | paper.setCode(licencePaper1.getCode()); |
| | | paper.setContent(licencePaper1.getContent()); |
| | | paper.setUrl(licencePaper1.getUrl()); |
| | | paper.setLegalPeople(licencePaper1.getLegalPeople()); |
| | | paper.setLicenceIssuingUnit(licencePaper1.getLicenceIssuingUnit()); |
| | | paper.setLicenceIssuingTime(licencePaper1.getLicenceIssuingTime()); |
| | | paper.setRegisterCapital(licencePaper1.getRegisterCapital()); |
| | | } |
| | | |
| | | if (list.size()==2) { |
| | | //数据封装 |
| | | LicencePaper licencePaper2 = list.get(1); |
| | | paper.setId(licencePaper2.getId()); |
| | | paper.setUnitName(licencePaper2.getUnitName()); |
| | | paper.setAddress(licencePaper2.getAddress()); |
| | | paper.setApprovalNumber(licencePaper2.getApprovalNumber()); |
| | | paper.setCode(licencePaper2.getCode()); |
| | | paper.setContent(licencePaper2.getContent()); |
| | | paper.setUrl(licencePaper2.getUrl()); |
| | | paper.setLegalPeople(licencePaper2.getLegalPeople()); |
| | | paper.setLicenceIssuingUnit(licencePaper2.getLicenceIssuingUnit()); |
| | | paper.setLicenceIssuingTime(licencePaper2.getLicenceIssuingTime()); |
| | | paper.setRegisterCapital(licencePaper2.getRegisterCapital()); |
| | | //分公司许可证信息封装 |
| | | LicencePaper licencePaper1 = list.get(0); |
| | | paper.setSid(licencePaper1.getId()); |
| | | paper.setUnitNames(licencePaper1.getUnitName()); |
| | | paper.setAddresss(licencePaper1.getAddress()); |
| | | paper.setApprovalNumbers(licencePaper1.getApprovalNumber()); |
| | | paper.setCodes(licencePaper1.getCode()); |
| | | paper.setContents(licencePaper1.getContent()); |
| | | paper.setUrls(licencePaper1.getUrl()); |
| | | paper.setLegalPeoples(licencePaper1.getLegalPeople()); |
| | | paper.setLicenceIssuingUnits(licencePaper1.getLicenceIssuingUnit()); |
| | | paper.setLicenceIssuingTimes(licencePaper1.getLicenceIssuingTime()); |
| | | paper.setRegisterCapitals(licencePaper1.getRegisterCapital()); |
| | | } |
| | | //返回数据 |
| | | return paper; |
| | | } |
| | | return null; |
| | | } |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.licence.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.springblade.modules.licence.entity.LicencePaper; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 许可证信息vo |
| | | * @author zhongrj |
| | | * @since 2021-12-27 |
| | | */ |
| | | @Data |
| | | public class LicencePaperVo extends LicencePaper implements Serializable { |
| | | |
| | | /** |
| | | * 分公司许可证id |
| | | */ |
| | | private Long sid; |
| | | |
| | | /** |
| | | * 单位名称 |
| | | */ |
| | | private String unitNames; |
| | | |
| | | |
| | | /** |
| | | * 住所 |
| | | */ |
| | | private String addresss; |
| | | |
| | | /** |
| | | * 法定代表人 |
| | | */ |
| | | private String legalPeoples; |
| | | |
| | | /** |
| | | * 经营范围,培训内容 |
| | | */ |
| | | private String contents; |
| | | |
| | | /** |
| | | * 批准文号 |
| | | */ |
| | | private String approvalNumbers; |
| | | |
| | | /** |
| | | * 发证机关 |
| | | */ |
| | | private String licenceIssuingUnits; |
| | | |
| | | /** |
| | | * 注册资本 |
| | | */ |
| | | private String registerCapitals; |
| | | |
| | | /** |
| | | * 证件编号 |
| | | */ |
| | | private String codes; |
| | | |
| | | /** |
| | | * 发证时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date licenceIssuingTimes; |
| | | |
| | | /** |
| | | * 营业执照url |
| | | */ |
| | | private String urls; |
| | | } |
| | |
| | | @ApiModelProperty(value = "公司id") |
| | | @TableField("dept_id") |
| | | private String deptId; |
| | | |
| | | /** |
| | | * 学历 |
| | | */ |
| | | private Integer education; |
| | | |
| | | /** |
| | | * 证书 url |
| | | */ |
| | | private String paper; |
| | | } |
| | |
| | | */ |
| | | @GetMapping("/security_lazy-tree") |
| | | @ApiOperation(value = "懒加载树形结构", notes = "树形结构") |
| | | public R<List<DeptVO>> securityLazyTree(String jurisdiction, Long parentId) { |
| | | List<DeptVO> tree = deptService.securityLazyTree(jurisdiction,parentId); |
| | | public R<List<DeptVO>> securityLazyTree(String jurisdiction, Long parentId,Long deptId) { |
| | | List<DeptVO> tree = deptService.securityLazyTree(jurisdiction,parentId,deptId); |
| | | return R.data(tree); |
| | | } |
| | | } |
| | |
| | | Map<Long, TreeNodes> lazyTreeUsersPublicSecuritys(@Param("type") Integer type, |
| | | @Param("deptId") Long deptId, |
| | | @Param("jurisdiction")String jurisdiction); |
| | | |
| | | /** |
| | | * 查询所有的保安公司机构信息 |
| | | * @return |
| | | */ |
| | | List<DeptVO> securityDeptUnitList(@Param("parentId")Long parentId, |
| | | @Param("deptId")Long deptId); |
| | | } |
| | |
| | | </select> |
| | | |
| | | <!--保安公司树--> |
| | | <!-- <select id="securityLazyTree" resultMap="treeNodeResultMap">--> |
| | | <!-- (--> |
| | | <!-- SELECT--> |
| | | <!-- id,--> |
| | | <!-- parent_id,--> |
| | | <!-- dept_name AS title,--> |
| | | <!-- id AS "value",--> |
| | | <!-- id AS "key",--> |
| | | <!-- 0 AS "has_children"--> |
| | | <!-- FROM--> |
| | | <!-- blade_dept--> |
| | | <!-- where is_deleted = 0--> |
| | | <!-- and--> |
| | | <!-- (id = 1413470343230877697--> |
| | | <!-- or id = 1425366663452196865--> |
| | | <!-- or id = 1418458374477549569--> |
| | | <!-- or id = 1420222768149966850--> |
| | | <!-- or id = 1426354978959691778)--> |
| | | <!-- )--> |
| | | <!-- union--> |
| | | <!-- (--> |
| | | <!-- SELECT--> |
| | | <!-- DISTINCT--> |
| | | <!-- dept.id,--> |
| | | <!-- dept.parent_id,--> |
| | | <!-- dept.dept_name AS title,--> |
| | | <!-- dept.id AS "value",--> |
| | | <!-- dept.id AS "key",--> |
| | | <!-- (--> |
| | | <!-- SELECT--> |
| | | <!-- CASE WHEN count(1) > 0 THEN 1 ELSE 0 END--> |
| | | <!-- FROM--> |
| | | <!-- blade_dept--> |
| | | <!-- WHERE--> |
| | | <!-- parent_id = dept.id and is_deleted = 0--> |
| | | <!-- ) AS "has_children"--> |
| | | <!-- FROM--> |
| | | <!-- blade_dept dept--> |
| | | <!-- left join--> |
| | | <!-- sys_information si--> |
| | | <!-- on--> |
| | | <!-- si.departmentid = dept.id--> |
| | | <!-- left join--> |
| | | <!-- sys_jurisdiction sj--> |
| | | <!-- on--> |
| | | <!-- sj.id = si.jurisdiction--> |
| | | <!-- WHERE--> |
| | | <!-- 1=1--> |
| | | <!-- and si.stats !=3--> |
| | | <!-- AND dept.is_deleted = 0--> |
| | | <!-- <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'">--> |
| | | <!-- and (sj.id = #{jurisdiction} or sj.parent_id = #{jurisdiction})--> |
| | | <!-- </if>--> |
| | | <!-- )--> |
| | | <!-- </select>--> |
| | | |
| | | <!--查询保安公司列表,保安员管理--> |
| | | <select id="securityLazyTree" resultMap="treeNodeResultMap"> |
| | | ( |
| | | SELECT |
| | | id, |
| | | parent_id, |
| | | dept_name AS title, |
| | | id AS "value", |
| | | id AS "key", |
| | | 0 AS "has_children" |
| | | FROM |
| | | blade_dept |
| | | where is_deleted = 0 |
| | | and |
| | | (id = 1413470343230877697 |
| | | or id = 1425366663452196865 |
| | | or id = 1418458374477549569 |
| | | or id = 1420222768149966850 |
| | | or id = 1426354978959691778) |
| | | ) |
| | | union |
| | | ( |
| | | SELECT |
| | | DISTINCT |
| | | dept.id, |
| | |
| | | sys_jurisdiction sj |
| | | on |
| | | sj.id = si.jurisdiction |
| | | WHERE |
| | | 1=1 |
| | | and si.stats !=3 |
| | | where |
| | | dept.dept_category != 0 |
| | | AND dept.is_deleted = 0 |
| | | and dept.id!= 1420222961377357825 |
| | | and dept.parent_id!= 1420222961377357825 |
| | | and dept.id!= 1418458374477549569 |
| | | and dept.parent_id!= 1418458374477549569 |
| | | and dept.id!= 1426355050199945218 |
| | | <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> |
| | | and (sj.id = #{jurisdiction} or sj.parent_id = #{jurisdiction}) |
| | | union |
| | | ( |
| | | SELECT |
| | | id, |
| | | parent_id, |
| | | dept_name AS title, |
| | | id AS "value", |
| | | id AS "key", |
| | | 0 AS "has_children" |
| | | FROM |
| | | blade_dept |
| | | where is_deleted = 0 |
| | | and |
| | | (id = 1413470343230877697 |
| | | or id = 1425366663452196865 |
| | | or id = 1420222768149966850 |
| | | or id = 1426354978959691778) |
| | | ) |
| | | </if> |
| | | </select> |
| | | |
| | | <!--查询所有的保安公司机构及子级信息--> |
| | | <select id="securityDeptUnitList" resultMap="treeNodeResultMap"> |
| | | ( |
| | | SELECT |
| | | id, |
| | | parent_id, |
| | | dept_name AS title, |
| | | id AS "value", |
| | | id AS "key", |
| | | 0 AS "has_children" |
| | | FROM |
| | | blade_dept |
| | | where id = #{deptId} |
| | | ) |
| | | union |
| | | ( |
| | | SELECT |
| | | dept.id, |
| | | dept.parent_id, |
| | | dept.dept_name AS title, |
| | | dept.id AS "value", |
| | | dept.id AS "key", |
| | | ( |
| | | SELECT |
| | | CASE WHEN count(1) > 0 THEN 1 ELSE 0 END |
| | | FROM |
| | | blade_dept |
| | | WHERE |
| | | parent_id = dept.id |
| | | ) AS "has_children" |
| | | FROM |
| | | ( |
| | | SELECT |
| | | id,parent_id,dept_name |
| | | FROM |
| | | ( |
| | | SELECT |
| | | t1.id,t1.parent_id,t1.dept_name, |
| | | IF |
| | | ( find_in_set( parent_id, @pids ) > 0, @pids := concat( @pids, ',', id ), 0 ) AS ischild |
| | | FROM |
| | | ( SELECT id, parent_id,dept_name FROM blade_dept t ORDER BY parent_id, id ) t1, |
| | | ( SELECT @pids := #{deptId} ) t2 |
| | | ) t3 |
| | | WHERE |
| | | ischild != 0 |
| | | ) |
| | | dept |
| | | where 1=1 |
| | | ) |
| | | </select> |
| | | </mapper> |
| | |
| | | * @return |
| | | */ |
| | | List selectPeo(@Param("user") UserVO user); |
| | | |
| | | /** |
| | | * 查询当前部门名称及父级部门名称 |
| | | * @param deptId 部门名称 |
| | | * @return |
| | | */ |
| | | @SqlParser(filter = true) |
| | | List<String> getDeptName(@Param("deptId") String deptId); |
| | | } |
| | |
| | | <select id="selectUserPages" resultMap="userResultMaps"> |
| | | select |
| | | bu.*, |
| | | ifnull(DATE_FORMAT(NOW(), '%Y') - SUBSTRING( bu.cardid,7,4),0) age, |
| | | ifnull(TIMESTAMPDIFF(YEAR, SUBSTRING(bu.cardid, 7, 8), CURDATE()),0) AS age, |
| | | p.score |
| | | from |
| | | blade_user bu |
| | |
| | | <select id="selectUserPageSecurity" resultMap="userResultMaps"> |
| | | select |
| | | bu.*, |
| | | ifnull(DATE_FORMAT(NOW(), '%Y') - SUBSTRING( bu.cardid,7,4),0) age, |
| | | ifnull(TIMESTAMPDIFF(YEAR, SUBSTRING(bu.cardid, 7, 8), CURDATE()),0) AS age, |
| | | bd.dept_name as deptName |
| | | from |
| | | blade_user bu |
| | |
| | | <!--根据保安员编码查询保安信息--> |
| | | <select id="getUserInfoBySecurityNumber" resultType="org.springblade.modules.system.vo.UserVO"> |
| | | select bu.*, |
| | | ifnull(DATE_FORMAT(NOW(), '%Y') - SUBSTRING(cardid, 7, 4), 0) age, |
| | | bd.dept_name deptName |
| | | ifnull(TIMESTAMPDIFF(YEAR, SUBSTRING(bu.cardid, 7, 8), CURDATE()),0) AS age, |
| | | bd.dept_name deptName |
| | | from blade_user bu |
| | | left join |
| | | blade_dept bd |
| | | on |
| | | bu.dept_id = bd.id |
| | | where securitynumber = #{securityNumber} |
| | | and bu.status = 1 |
| | | and bu.is_deleted = 0 |
| | | </select> |
| | | |
| | | <!--保安员列表--> |
| | |
| | | bd.dept_name as deptName, |
| | | if(bu.sex=1,'男','女') sex, |
| | | bu.cardid, |
| | | ifnull(DATE_FORMAT(NOW(), '%Y') - SUBSTRING( bu.cardid,7,4),0) age, |
| | | ifnull(TIMESTAMPDIFF(YEAR, SUBSTRING(bu.cardid, 7, 8), CURDATE()),0) AS age, |
| | | bu.phone, |
| | | if(bu.examination_type=1,'异常','正常') examinationType, |
| | | bu.examination_mx examinationMx, |
| | |
| | | <select id="selectPeo" resultType="java.util.HashMap"> |
| | | select |
| | | bu.*, |
| | | ifnull(DATE_FORMAT(NOW(), '%Y') - SUBSTRING( bu.cardid,7,4),0) age, |
| | | ifnull(TIMESTAMPDIFF(YEAR, SUBSTRING(bu.cardid, 7, 8), CURDATE()),0) AS age, |
| | | bd.dept_name as deptName |
| | | from |
| | | blade_user bu |
| | |
| | | <if test="user.type!=null"> |
| | | and bu.equipment_code is not null |
| | | </if> |
| | | </select> |
| | | |
| | | <!--查询当前部门名称及父级部门名称--> |
| | | <select id="getDeptName" resultType="java.lang.String"> |
| | | (select dept_name from blade_dept where id = #{deptId} and 1=1) |
| | | union |
| | | ( |
| | | select dept_name from blade_dept where id = (select parent_id from blade_dept where id= #{deptId} and 1=1) |
| | | ) |
| | | </select> |
| | | </mapper> |
| | |
| | | List<Map<Object,String>> selectId(String id); |
| | | List<Map<String, Object>> selectHold(String deptid); |
| | | List<String> selectIn(); |
| | | List<DeptVO> securityLazyTree(String jurisdiction, Long parentId); |
| | | List<DeptVO> securityLazyTree(String jurisdiction, Long parentId,Long deptId); |
| | | |
| | | /** |
| | | * 懒加载获取部门树形结构(包含用户数据) |
| | |
| | | * 懒加载获取部门树形结构,不包含顶级管理员公安局 |
| | | */ |
| | | @Override |
| | | public List<DeptVO> securityLazyTree(String jurisdiction, Long parentId) { |
| | | public List<DeptVO> securityLazyTree(String jurisdiction, Long parentId,Long deptId) { |
| | | //如果传了deptId |
| | | if (null!=deptId){ |
| | | //递归查询 |
| | | // recursionDeptInfo(deptVOS, list); |
| | | //tree 组装并返回 |
| | | return ForestNodeMerger.merge(baseMapper.securityDeptUnitList(null,deptId)); |
| | | } |
| | | return ForestNodeMerger.merge(baseMapper.securityLazyTree(jurisdiction, parentId)); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public IPage<UserVO> selectUserPageSecurity(IPage<UserVO> page, UserVO user) { |
| | | return page.setRecords(baseMapper.selectUserPageSecurity(page, user)); |
| | | List<UserVO> userVOS = baseMapper.selectUserPageSecurity(page, user); |
| | | //机构名称拼接 |
| | | userVOS.forEach(userVO -> { |
| | | if (null!=userVO.getDeptId()) { |
| | | List<String> list = baseMapper.getDeptName(userVO.getDeptId()); |
| | | if (list.size() > 1) { |
| | | if (null != list.get(1) && list.get(1) != "") { |
| | | String s = list.get(1).toString(); |
| | | if (s.equals("本市保安公司") || s.equals("保安培训学校") || s.equals("自招保安单位") || s.equals("武装押运公司") || s.equals("分公司") || s.equals("其他")){ |
| | | userVO.setDeptName(list.get(0)); |
| | | } |
| | | else { |
| | | userVO.setDeptName(list.get(1) + "," + list.get(0)); |
| | | } |
| | | } else { |
| | | userVO.setDeptName(list.get(0)); |
| | | } |
| | | } |
| | | if (list.size() == 1) { |
| | | userVO.setDeptName(list.get(0)); |
| | | } |
| | | } |
| | | }); |
| | | return page.setRecords(userVOS); |
| | | } |
| | | |
| | | /** |