Merge branch 'jc' of http://s16s652780.51mypc.cn:49896/r/zhba_management_w_bf into jc
31 files modified
3 files added
| | |
| | | @ExcelProperty("是否制证") |
| | | private String userType; |
| | | |
| | | /** |
| | | * 制证时间 |
| | | */ |
| | | @ColumnWidth(10) |
| | | @ExcelProperty("制证时间") |
| | | private String userPaperTime; |
| | | |
| | | |
| | | } |
| | |
| | | ELT(sar.audit_status,"待审核","审核通过","审核不通过") auditStatus, |
| | | sar.audit_time auditTime, |
| | | sar.audit_detail auditDetail, |
| | | if(bu.user_type=6,"是","否") userType |
| | | if(bu.user_type=6,"是","否") userType, |
| | | DATE_FORMAT(bu.paper_time,'%Y-%m-%d') as userPaperTime |
| | | FROM |
| | | sys_accreditation_records sar |
| | | left join |
| | |
| | | 1=1 |
| | | and bu.status = 1 |
| | | and bu.is_deleted = 0 |
| | | <if test="accreditationRecords.userPaperTime != null and accreditationRecords.userPaperTime !=''"> |
| | | AND DATE_FORMAT(bu.paper_time,'%Y-%m-%d') = #{accreditationRecords.userPaperTime} |
| | | </if> |
| | | <if test="accreditationRecords.deptName!=null and accreditationRecords.deptName!=''"> |
| | | and bt.dept_name like concat('%', #{accreditationRecords.deptName},'%') |
| | | </if> |
| | |
| | | */ |
| | | package org.springblade.modules.dispatcher.controller; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import lombok.AllArgsConstructor; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.apache.commons.codec.Charsets; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springblade.common.excel.RowWriteHandler; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.dispatcher.entity.DispatcherUnit; |
| | | import org.springblade.modules.dispatcher.excel.DispatcherExcel; |
| | | import org.springblade.modules.dispatcher.excel.DispatcherImporter; |
| | | import org.springblade.modules.dispatcher.excel.DispatcherUnitExcel; |
| | | import org.springblade.modules.dispatcher.excel.DispatcherUnitImporter; |
| | | import org.springblade.modules.dispatcher.service.IDispatcherUnitService; |
| | | import org.springblade.modules.dispatcher.vo.DispatcherStatistics; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.excel.UserCertificateExcel; |
| | | import org.springblade.modules.system.service.IUserService; |
| | | import org.springblade.modules.system.service.MyAsyncService; |
| | | import org.springblade.modules.system.vo.UserVO; |
| | |
| | | import org.springblade.modules.dispatcher.vo.DispatcherVO; |
| | | import org.springblade.modules.dispatcher.service.IDispatcherService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | |
| | | |
| | | //修改 |
| | | status = dispatcherService.updateById(dispatcher); |
| | | if (status) { |
| | | //内网同步 |
| | | String s1 = |
| | | "update blade_user set dispatch = " + "'" + user.getDispatch() + "'" + |
| | | " " + "where id = " + "'" + user.getId() + "';" + |
| | | "update sys_dispatcher set dispatcherTime = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcher.getDispatchertime()) + "'" + |
| | | ",dispatcherAddress = " + "'" + dispatcher.getDispatcheraddress() + "'" + |
| | | ",dispatcher_unit_id = " + "'" + dispatcher.getDispatcherUnitId() + "'" + |
| | | ",user_ids = " + "'" + dispatcher.getUserIds() + "'" + |
| | | ",end_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcher.getEndTime()) + "'" + |
| | | ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(dispatcher.getUpdateTime()) + "'" + |
| | | ",dept_id = " + "'" + dispatcher.getDeptId() + "'" + |
| | | ",jurisdiction = " + "'" + dispatcher.getJurisdiction() + "'" + |
| | | " " + "where id = " + "'" + dispatcher.getId() + "';" + |
| | | "update blade_user set dispatch = " + "'" + user1.getDispatch() + "'" + |
| | | " " + "where id = " + "'" + user1.getId() + "'"; |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.dataSync(s1); |
| | | } |
| | | } else { |
| | | //没有修改保安员,只修改了派遣时间等信息 |
| | | //修改 |
| | | status = dispatcherService.updateById(dispatcher); |
| | | if (status) { |
| | | //内网同步 |
| | | String s1 = |
| | | "update sys_dispatcher set dispatcherTime = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcher.getDispatchertime()) + "'" + |
| | | ",dispatcherAddress = " + "'" + dispatcher.getDispatcheraddress() + "'" + |
| | | ",dispatcher_unit_id = " + "'" + dispatcher.getDispatcherUnitId() + "'" + |
| | | ",user_ids = " + "'" + dispatcher.getUserIds() + "'" + |
| | | ",end_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcher.getEndTime()) + "'" + |
| | | ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(dispatcher.getUpdateTime()) + "'" + |
| | | ",dept_id = " + "'" + dispatcher.getDeptId() + "'" + |
| | | ",jurisdiction = " + "'" + dispatcher.getJurisdiction() + "'" + |
| | | " " + "where id = " + "'" + dispatcher.getId() + "'"; |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.dataSync(s1); |
| | | } |
| | | } |
| | | } |
| | | return R.status(status); |
| | |
| | | return R.data(list); |
| | | } |
| | | |
| | | /** |
| | | * 导入派遣数据 |
| | | * |
| | | * @param isCovered 1 覆盖 0不覆盖 |
| | | * @return |
| | | */ |
| | | @PostMapping("import-dispatcher") |
| | | public R importDispatcherUnit(MultipartFile file, Integer isCovered) { |
| | | DispatcherImporter dispatcherImporter = new DispatcherImporter(dispatcherService, false); |
| | | ExcelUtil.save(file, dispatcherImporter, DispatcherExcel.class); |
| | | return R.success("操作成功"); |
| | | } |
| | | |
| | | /** |
| | | * 导出模板 |
| | | */ |
| | | @GetMapping("export-template") |
| | | @ApiOperation(value = "导出模板") |
| | | public void exportUser(HttpServletResponse response) throws ParseException, IOException { |
| | | List<DispatcherExcel> list = new ArrayList<>(); |
| | | |
| | | DispatcherExcel dispatcher = new DispatcherExcel(); |
| | | dispatcher.setDispatcherUnitId("****公司"); |
| | | dispatcher.setDeptId("****保安服务公司"); |
| | | dispatcher.setUserIds("张三"); |
| | | dispatcher.setCardid("360XXX19XXXXXX****"); |
| | | dispatcher.setDispatcherTime(new SimpleDateFormat("yyyy/MM/dd").parse("2024/10/10")); |
| | | dispatcher.setEndTime(new SimpleDateFormat("yyyy/MM/dd").parse("2025/10/10")); |
| | | dispatcher.setDispatcherAddress("*****"); |
| | | list.add(dispatcher); |
| | | |
| | | DispatcherExcel dispatcher2 = new DispatcherExcel(); |
| | | dispatcher2.setDispatcherUnitId("****公司"); |
| | | dispatcher2.setDeptId("****保安服务公司"); |
| | | dispatcher2.setUserIds("张三"); |
| | | dispatcher2.setCardid("360XXX19XXXXXX****"); |
| | | dispatcher2.setDispatcherTime(new SimpleDateFormat("yyyy/MM/dd").parse("2024/10/10")); |
| | | dispatcher2.setEndTime(new SimpleDateFormat("yyyy/MM/dd").parse("2025/10/10")); |
| | | dispatcher2.setDispatcherAddress("*****"); |
| | | list.add(dispatcher2); |
| | | |
| | | |
| | | |
| | | // ExcelUtil.export(response, "派遣数据导入模板" + DateUtil.time(), "派遣单位数据表", list, DispatcherExcel.class); |
| | | |
| | | String fileName = null; |
| | | try { |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding(org.apache.commons.codec.Charsets.UTF_8.name()); |
| | | fileName = URLEncoder.encode("派遣数据导入模板" + DateUtil.time(), Charsets.UTF_8.name()); |
| | | response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); |
| | | //修改单元格格式为文本格式 |
| | | EasyExcel.write(response.getOutputStream(), DispatcherExcel.class).sheet("派遣数据表").registerWriteHandler(new RowWriteHandler()).doWrite(list); |
| | | } catch (Throwable var6) { |
| | | throw var6; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | dispatcherUnit.setCreateTime(new Date()); |
| | | //新增 |
| | | status = dispatcherUnitService.save(dispatcherUnit); |
| | | if (status) { |
| | | //数据同步 |
| | | String s1 = |
| | | "insert into sys_dispatcher_unit(id,name,dept_id,linkman,phone,jurisdiction,create_time,start_time,end_time," + |
| | | "serve_type,security_linkman,cell,num,district) " + |
| | | "values(" + "'" + dispatcherUnit.getId() + "'" + "," + |
| | | "'" + dispatcherUnit.getName() + "'" + "," + |
| | | "'" + dispatcherUnit.getDeptId() + "'" + "," + |
| | | "'" + dispatcherUnit.getLinkman() + "'" + "," + |
| | | "'" + dispatcherUnit.getPhone() + "'" + "," + |
| | | "'" + dispatcherUnit.getJurisdiction() + "'" + "," + |
| | | "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(dispatcherUnit.getCreateTime()) + "'" + "," + |
| | | "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcherUnit.getStartTime()) + "'" + "," + |
| | | "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcherUnit.getEndTime()) + "'" + "," + |
| | | "'" + dispatcherUnit.getServeType() + "'" + "," + |
| | | "'" + dispatcherUnit.getSecurityLinkman() + "'" + "," + |
| | | "'" + dispatcherUnit.getCell() + "'" + "," + |
| | | "'" + dispatcherUnit.getNum() + "'" + "," + |
| | | "'" + dispatcherUnit.getDistrict() + "'" + ")"; |
| | | myAsyncService.dataSync(s1); |
| | | } |
| | | } else { |
| | | //修改 |
| | | status = dispatcherUnitService.updateById(dispatcherUnit); |
| | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String endTime = sdf.format(date); |
| | | dispatcherService.updateEndtime(endTime, ids); |
| | | if (status) { |
| | | //内网同步 |
| | | String s1 = |
| | | "update sys_dispatcher_unit set name = " + "'" + dispatcherUnit.getName() + "'" + |
| | | ",dept_id = " + "'" + dispatcherUnit.getDeptId() + "'" + |
| | | ",linkman = " + "'" + dispatcherUnit.getLinkman() + "'" + |
| | | ",phone = " + "'" + dispatcherUnit.getPhone() + "'" + |
| | | ",jurisdiction = " + "'" + dispatcherUnit.getJurisdiction() + "'" + |
| | | ",start_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcherUnit.getStartTime()) + "'" + |
| | | ",end_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcherUnit.getEndTime()) + "'" + |
| | | ",serve_type = " + "'" + dispatcherUnit.getServeType() + "'" + |
| | | ",security_linkman = " + "'" + dispatcherUnit.getSecurityLinkman() + "'" + |
| | | ",cell = " + "'" + dispatcherUnit.getCell() + "'" + |
| | | ",num = " + "'" + dispatcherUnit.getNum() + "'" + |
| | | ",district = " + "'" + dispatcherUnit.getDistrict() + "'" + |
| | | " " + "where id = " + "'" + dispatcherUnit.getId() + "'"; |
| | | myAsyncService.dataSync(s1); |
| | | //内网同步派遣记录修改合同时间 |
| | | String s2 = |
| | | "update sys_dispatcher set end_time = " + "'" + endTime + "'" + " " + "where dispatcher_unit_id = " + "'" + ids + "'"; |
| | | myAsyncService.dataSync(s2); |
| | | } |
| | | } |
| | | return R.status(status); |
| | | } |
| | |
| | | DispatcherUnitExcel unitExcel = new DispatcherUnitExcel(); |
| | | unitExcel.setDeptName("****保安服务公司"); |
| | | unitExcel.setName("****公司"); |
| | | unitExcel.setAddress("*********"); |
| | | unitExcel.setLongitude("112.85857823133"); |
| | | unitExcel.setLatitude("35.496284586473"); |
| | | unitExcel.setLinkman("张三"); |
| | | unitExcel.setPhone("13112341234"); |
| | | unitExcel.setStartTime(new SimpleDateFormat("yyyy/MM/dd").parse("2020/5/1")); |
| | |
| | | DispatcherUnitExcel unitExcel1 = new DispatcherUnitExcel(); |
| | | unitExcel1.setDeptName("****保安服务公司"); |
| | | unitExcel1.setName("****公司"); |
| | | unitExcel1.setAddress("*********"); |
| | | unitExcel1.setLongitude("112.85857823133"); |
| | | unitExcel1.setLatitude("35.496284586473"); |
| | | unitExcel1.setLinkman("李四"); |
| | | unitExcel1.setPhone("13112341234"); |
| | | unitExcel1.setStartTime(new SimpleDateFormat("yyyy/MM/dd").parse("2020/10/10")); |
| | |
| | | ExcelUtil.export(response, "派遣单位数据导入模板" + DateUtil.time(), "派遣单位数据表", list, DispatcherUnitExcel.class); |
| | | } |
| | | |
| | | /** |
| | | * 获取所有派遣单位 |
| | | * @param dispatcherUnit |
| | | * @return |
| | | */ |
| | | @GetMapping("getAll") |
| | | public R getAll(DispatcherUnitVO dispatcherUnit){ |
| | | List<DispatcherUnitVO> list = dispatcherUnitService.getAll(dispatcherUnit); |
| | | return R.data(list); |
| | | } |
| | | |
| | | } |
| | |
| | | /** |
| | | * 区 (暂时用作派遣单位类型使用,学校,医院等) |
| | | */ |
| | | private Integer district; |
| | | private String district; |
| | | |
| | | /** |
| | | * 详细地址 |
| | |
| | | */ |
| | | private Integer num; |
| | | |
| | | //经度 |
| | | private String longitude; |
| | | |
| | | //纬度 |
| | | private String latitude; |
| | | |
| | | //行业 |
| | | private String profession; |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.dispatcher.excel; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.format.DateTimeFormat; |
| | | import com.alibaba.excel.annotation.write.style.ColumnWidth; |
| | | import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
| | | import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ColumnWidth(25) |
| | | @HeadRowHeight(20) |
| | | @ContentRowHeight(18) |
| | | public class DispatcherExcel implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | //派遣单位名称 |
| | | @ExcelProperty("派遣单位名称*") |
| | | private String dispatcherUnitId; |
| | | |
| | | //派遣单位名称 |
| | | @ExcelProperty("企业名称*") |
| | | private String deptId; |
| | | |
| | | //派遣单位名称 |
| | | @ExcelProperty("保安员*") |
| | | private String userIds; |
| | | |
| | | //派遣单位名称 |
| | | @ExcelProperty("身份证号*") |
| | | private String cardid; |
| | | |
| | | //派遣单位名称 |
| | | @ExcelProperty("开始时间*") |
| | | @DateTimeFormat("yyyy/MM/dd") |
| | | private Date dispatcherTime; |
| | | |
| | | //派遣单位名称 |
| | | @ExcelProperty("结束时间*") |
| | | @DateTimeFormat("yyyy/MM/dd") |
| | | private Date endTime; |
| | | |
| | | //派遣单位名称 |
| | | @ExcelProperty("派遣地址*") |
| | | private String dispatcherAddress; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.dispatcher.excel; |
| | | |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springblade.core.excel.support.ExcelImporter; |
| | | import org.springblade.modules.dispatcher.service.IDispatcherService; |
| | | import org.springblade.modules.dispatcher.service.IDispatcherUnitService; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 派遣单位导入类 |
| | | * |
| | | * @author zhongrj |
| | | * @since 2021-08-23 |
| | | */ |
| | | @RequiredArgsConstructor |
| | | public class DispatcherImporter implements ExcelImporter<DispatcherExcel> { |
| | | |
| | | private final IDispatcherService service; |
| | | private final Boolean isCovered; |
| | | |
| | | @Override |
| | | public void save(List<DispatcherExcel> data) { |
| | | service.importDispatcherUnit(data, isCovered); |
| | | } |
| | | } |
| | |
| | | import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
| | | import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
| | | import lombok.Data; |
| | | import org.springblade.common.excel.ExcelDictConverter; |
| | | import org.springblade.common.excel.ExcelDictItem; |
| | | import org.springblade.common.excel.ExcelDictItemLabel; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | @ColumnWidth(25) |
| | | // @ColumnWidth(25) |
| | | @ExcelProperty("企业名称*") |
| | | private String deptName; |
| | | |
| | | |
| | | @ColumnWidth(25) |
| | | @ExcelProperty("服务对象名称*") |
| | | // @ColumnWidth(25) |
| | | @ExcelProperty("派遣单位名称*") |
| | | private String name; |
| | | |
| | | @ExcelProperty("派遣单位地址*") |
| | | private String address; |
| | | |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("服务对象联系人*") |
| | | |
| | | |
| | | @ExcelProperty("经度") |
| | | private String longitude; |
| | | |
| | | @ExcelProperty("纬度") |
| | | private String latitude; |
| | | |
| | | @ExcelProperty("派遣单位所属辖区") |
| | | private String jurisdiction; |
| | | |
| | | @ExcelProperty(value = "派遣单位类型*",converter = ExcelDictConverter.class) |
| | | @ExcelDictItemLabel(type = "dispatcherUnitType") |
| | | @ExcelDictItem(type = "dispatcherUnitType") |
| | | private String district; |
| | | |
| | | @ExcelProperty(value = "派遣单位行业*",converter = ExcelDictConverter.class) |
| | | @ExcelDictItemLabel(type = "dispatchProfession") |
| | | @ExcelDictItem(type = "dispatchProfession") |
| | | private String profession; |
| | | |
| | | // @ColumnWidth(20) |
| | | @ExcelProperty("派遣单位联系人*") |
| | | private String linkman; |
| | | |
| | | |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("服务对象联系电话*") |
| | | // @ColumnWidth(20) |
| | | @ExcelProperty("派遣单位联系电话*") |
| | | private String phone; |
| | | |
| | | |
| | | @ColumnWidth(20) |
| | | // @ColumnWidth(20) |
| | | @ExcelProperty("合同开始时间*") |
| | | @DateTimeFormat("yyyy/MM/dd") |
| | | private Date startTime; |
| | | |
| | | |
| | | @ColumnWidth(20) |
| | | // @ColumnWidth(20) |
| | | @ExcelProperty("合同结束时间*") |
| | | @DateTimeFormat("yyyy/MM/dd") |
| | | private Date endTime; |
| | | |
| | | @ColumnWidth(20) |
| | | // @ColumnWidth(20) |
| | | @ExcelProperty("保安服务类型") |
| | | private String serveType; |
| | | |
| | | @ColumnWidth(20) |
| | | // @ColumnWidth(20) |
| | | @ExcelProperty("负责人*") |
| | | private String securityLinkman; |
| | | |
| | | @ColumnWidth(20) |
| | | // @ColumnWidth(20) |
| | | @ExcelProperty("负责人联系电话*") |
| | | private String cell; |
| | | |
| | | @ColumnWidth(20) |
| | | // @ColumnWidth(20) |
| | | @ExcelProperty("派遣保安员数*") |
| | | private Integer num; |
| | | |
| | |
| | | import com.baomidou.mybatisplus.annotation.SqlParser; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.modules.dispatcher.entity.Dispatcher; |
| | | import org.springblade.modules.dispatcher.entity.DispatcherUnit; |
| | | import org.springblade.modules.dispatcher.vo.DispatcherStatistics; |
| | | import org.springblade.modules.dispatcher.vo.DispatcherUnitVO; |
| | | import org.springblade.modules.dispatcher.vo.DispatcherVO; |
| | |
| | | void updateEndtime(String endTime,String disId); |
| | | |
| | | List<DispatcherStatistics> getDispatcherStatisticsList(@Param("statistics") DispatcherStatistics dispatcherStatistics); |
| | | |
| | | /** |
| | | * 派遣单位名称 |
| | | * @param dispatchUnitName |
| | | * @return |
| | | */ |
| | | DispatcherUnit selectDispatcherUnitExist(@Param("dispatchUnitName") String dispatchUnitName); |
| | | } |
| | |
| | | sdu.name |
| | | |
| | | </select> |
| | | <select id="selectDispatcherUnitExist" |
| | | resultType="org.springblade.modules.dispatcher.entity.DispatcherUnit"> |
| | | |
| | | SELECT * FROM sys_dispatcher_unit WHERE name = #{dispatchUnitName} limit 1 |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | */ |
| | | List<DispatcherUnitVO> selectDispatcherUnitPage(IPage page, @Param("dispatcherUnit") DispatcherUnitVO dispatcherUnit); |
| | | |
| | | |
| | | List<DispatcherUnitVO> getAll( @Param("dispatcherUnit")DispatcherUnitVO dispatcherUnit); |
| | | |
| | | /** |
| | | * 派遣公司信息详情 |
| | | * @param dispatcherUnit 派遣信息对象 |
| | |
| | | * @return |
| | | */ |
| | | List<DispatcherUnitVO> selectDispatcherUnitPageTree(@Param("dispatcherUnit")DispatcherUnitVO dispatcher); |
| | | |
| | | } |
| | |
| | | sys_jurisdiction sj |
| | | on |
| | | sj.id = sdu.jurisdiction |
| | | LEFT JOIN blade_dict_biz bdb ON bdb.dict_key = sdu.profession and bdb.is_deleted = 0 |
| | | WHERE |
| | | 1=1 |
| | | and bdb.code = 'dispatchProfession' |
| | | <if test="dispatcherUnit.profession != null and dispatcherUnit.profession !=''"> |
| | | and sdu.profession in |
| | | <foreach collection="dispatcherUnit.profession.split(',')" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="dispatcherUnit.deptName!=null and dispatcherUnit.deptName!=''"> |
| | | and bt.dept_name like concat('%', #{dispatcherUnit.deptName},'%') |
| | | </if> |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getAll" resultType="org.springblade.modules.dispatcher.vo.DispatcherUnitVO"> |
| | | select |
| | | sdu.*,bt.dept_name deptName,sj.dept_name jurisdictionName,bdb.dict_value as professionName |
| | | from |
| | | sys_dispatcher_unit sdu |
| | | LEFT JOIN |
| | | blade_dept bt |
| | | ON |
| | | sdu.dept_id = bt.id |
| | | left join |
| | | sys_jurisdiction sj |
| | | on |
| | | sj.id = sdu.jurisdiction |
| | | LEFT JOIN blade_dict_biz bdb ON bdb.dict_key = sdu.profession and bdb.is_deleted = 0 |
| | | WHERE |
| | | 1=1 |
| | | and bdb.code = 'dispatchProfession' |
| | | <if test="dispatcherUnit.profession != null and dispatcherUnit.profession !=''"> |
| | | and sdu.profession in |
| | | <foreach collection="dispatcherUnit.profession.split(',')" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="dispatcherUnit.deptName!=null and dispatcherUnit.deptName!=''"> |
| | | and bt.dept_name like concat('%', #{dispatcherUnit.deptName},'%') |
| | | </if> |
| | | <if test="dispatcherUnit.name!=null and dispatcherUnit.name!=''"> |
| | | and sdu.name like concat('%', #{dispatcherUnit.name},'%') |
| | | </if> |
| | | <if test="dispatcherUnit.linkman!=null and dispatcherUnit.linkman!=''"> |
| | | and sdu.linkman like concat('%', #{dispatcherUnit.linkman},'%') |
| | | </if> |
| | | <if test="dispatcherUnit.phone!=null and dispatcherUnit.phone!=''"> |
| | | and sdu.phone like concat('%', #{dispatcherUnit.phone},'%') |
| | | </if> |
| | | <if test="dispatcherUnit.province!=null"> |
| | | and sdu.province = #{dispatcherUnit.province} |
| | | </if> |
| | | <if test="dispatcherUnit.city!=null"> |
| | | and sdu.city = #{dispatcherUnit.city} |
| | | </if> |
| | | <if test="dispatcherUnit.jurisdiction!=null and dispatcherUnit.jurisdiction!='' and dispatcherUnit.jurisdiction!='1372091709474910209'"> |
| | | and (sj.id = #{dispatcherUnit.jurisdiction} or sj.parent_id = #{dispatcherUnit.jurisdiction}) |
| | | </if> |
| | | <if test="dispatcherUnit.deptId!=null and dispatcherUnit.deptId!=''"> |
| | | and sdu.dept_id in |
| | | ( |
| | | select id from blade_dept where id = #{dispatcherUnit.deptId} |
| | | union |
| | | SELECT |
| | | id |
| | | 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 := #{dispatcherUnit.deptId} ) t2 |
| | | ) t3 |
| | | WHERE |
| | | ischild != 0 |
| | | ) |
| | | </if> |
| | | <if test="dispatcherUnit.district!=null"> |
| | | and sdu.district = #{dispatcherUnit.district} |
| | | </if> |
| | | <if test="dispatcherUnit.beginTime!=null or dispatcherUnit.overTime!=null"> |
| | | <if test="dispatcherUnit.beginTime!='' or dispatcherUnit.overTime!=''"> |
| | | and sdu.end_time <= #{dispatcherUnit.overTime} and sdu.end_time >= #{dispatcherUnit.beginTime} |
| | | or ( sdu.start_time <= #{dispatcherUnit.overTime} and sdu.start_time >= #{dispatcherUnit.beginTime}) |
| | | </if> |
| | | </if> |
| | | <if test="dispatcherUnit.isExpire==1"> |
| | | and sdu.start_time <= now() |
| | | and sdu.end_time > now() |
| | | </if> |
| | | <if test="dispatcherUnit.isExpire==2"> |
| | | and sdu.end_time <= now() |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | <!--自定义树--> |
| | | <select id="selectDispatcherUnitPageTree" resultType="org.springblade.modules.dispatcher.vo.DispatcherUnitVO"> |
| | | select |
| | |
| | | package org.springblade.modules.dispatcher.service; |
| | | |
| | | import org.springblade.modules.dispatcher.entity.Dispatcher; |
| | | import org.springblade.modules.dispatcher.excel.DispatcherExcel; |
| | | import org.springblade.modules.dispatcher.vo.DispatcherStatistics; |
| | | import org.springblade.modules.dispatcher.vo.DispatcherUnitVO; |
| | | import org.springblade.modules.dispatcher.vo.DispatcherVO; |
| | |
| | | void updateEndtime(String endTime,String disId); |
| | | |
| | | List<DispatcherStatistics> getDispatcherStatisticsList(DispatcherStatistics dispatcherStatistics); |
| | | |
| | | void importDispatcherUnit(List<DispatcherExcel> data, Boolean isCovered); |
| | | } |
| | |
| | | */ |
| | | IPage<DispatcherUnitVO> selectDispatcherUnitPage(IPage<DispatcherUnitVO> page, DispatcherUnitVO dispatcher); |
| | | |
| | | |
| | | List<DispatcherUnitVO> getAll(DispatcherUnitVO dispatcherUnit); |
| | | |
| | | /** |
| | | * 派遣公司信息详情 |
| | | * @param dispatcherUnit 派遣信息对象 |
| | |
| | | * @param isCovered |
| | | */ |
| | | void importDispatcherUnit(List<DispatcherUnitExcel> data, Boolean isCovered); |
| | | |
| | | } |
| | |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.modules.dispatcher.entity.Dispatcher; |
| | | import org.springblade.modules.dispatcher.entity.DispatcherUnit; |
| | | import org.springblade.modules.dispatcher.excel.DispatcherExcel; |
| | | import org.springblade.modules.dispatcher.vo.DispatcherStatistics; |
| | | import org.springblade.modules.dispatcher.vo.DispatcherUnitVO; |
| | | import org.springblade.modules.dispatcher.vo.DispatcherVO; |
| | |
| | | import org.springblade.modules.dispatcher.service.IDispatcherService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.service.IUserDeptService; |
| | | import org.springblade.modules.system.service.IUserService; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public class DispatcherServiceImpl extends ServiceImpl<DispatcherMapper, Dispatcher> implements IDispatcherService { |
| | | |
| | | private final IUserService userService; |
| | | private final IUserDeptService userDeptService; |
| | | |
| | | @Override |
| | | public IPage<DispatcherVO> selectDispatcherPage(IPage<DispatcherVO> page, DispatcherVO dispatcher) { |
| | |
| | | public List<DispatcherStatistics> getDispatcherStatisticsList(DispatcherStatistics dispatcherStatistics) { |
| | | return baseMapper.getDispatcherStatisticsList(dispatcherStatistics); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void importDispatcherUnit(List<DispatcherExcel> data, Boolean isCovered) { |
| | | //派遣数据导入 |
| | | data.forEach(dispatcherExcel -> { |
| | | Dispatcher dispatcher = new Dispatcher(); |
| | | |
| | | //派遣单位 |
| | | if (dispatcherExcel.getDispatcherUnitId() != null && dispatcherExcel.getDispatcherUnitId() != ""){ |
| | | |
| | | //在派遣表中查是否有这个派遣单位 |
| | | DispatcherUnit dispatcherUnit = baseMapper.selectDispatcherUnitExist(dispatcherExcel.getDispatcherUnitId()); |
| | | if (dispatcherUnit != null){ |
| | | dispatcher.setDispatcherUnitId(dispatcherUnit.getId().toString()); |
| | | }else{ |
| | | return; |
| | | } |
| | | } |
| | | |
| | | //企业名称 |
| | | if (dispatcherExcel.getDeptId() != null && dispatcherExcel.getDeptId() != "") { |
| | | String deptId = userDeptService.selectIn(dispatcherExcel.getDeptId()); |
| | | dispatcher.setDeptId(Long.parseLong(deptId)); |
| | | } |
| | | |
| | | //保安员(根据身份证号获取userId,存入表中) |
| | | if (dispatcherExcel.getCardid() != null && dispatcherExcel.getCardid() != "" && dispatcherExcel.getUserIds() != null && dispatcherExcel.getUserIds() != ""){ |
| | | |
| | | User userInfoByIdCardNo = userService.getUserInfoByIdCardNo(dispatcherExcel.getCardid()); |
| | | if (userInfoByIdCardNo!=null){ |
| | | |
| | | //0派遣,1未派遣 |
| | | if (userInfoByIdCardNo.getDispatch().equals("1")){ |
| | | dispatcher.setUserIds(userInfoByIdCardNo.getId().toString()); |
| | | }else{ |
| | | return; |
| | | } |
| | | }else{ |
| | | return; |
| | | } |
| | | } |
| | | |
| | | dispatcher.setDispatchertime(dispatcherExcel.getDispatcherTime()); |
| | | dispatcher.setEndTime(dispatcherExcel.getEndTime()); |
| | | dispatcher.setDispatcheraddress(dispatcherExcel.getDispatcherAddress()); |
| | | |
| | | dispatcher.setCreateTime(new Date()); |
| | | dispatcher.setStatus(0); |
| | | save(dispatcher); |
| | | |
| | | //更新用户表 |
| | | User user = new User(); |
| | | user.setId(Long.parseLong(dispatcher.getUserIds())); |
| | | user.setDispatch("0"); |
| | | userService.updateById(user); |
| | | }); |
| | | } |
| | | } |
| | |
| | | import org.springblade.modules.dispatcher.service.IDispatcherUnitService; |
| | | import org.springblade.modules.dispatcher.vo.DispatcherUnitVO; |
| | | import org.springblade.modules.dispatcher.vo.DispatcherVO; |
| | | import org.springblade.modules.jurisdiction.service.JurisdictionService; |
| | | import org.springblade.modules.system.service.IUserDeptService; |
| | | import org.springblade.modules.system.service.MyAsyncService; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private final IDispatcherService dispatcherService; |
| | | |
| | | private final IUserDeptService userDeptService; |
| | | private final MyAsyncService myAsyncService; |
| | | private final JurisdictionService jurisdictionService; |
| | | |
| | | @Override |
| | | public IPage<DispatcherUnitVO> selectDispatcherUnitPage(IPage<DispatcherUnitVO> page, DispatcherUnitVO dispatcherUnitVO) { |
| | |
| | | dispatcherUnitVO1.setSnum(dispatcherService.getDispatcherCount(dispatcherUnitVO1)); |
| | | }); |
| | | return page.setRecords(dispatcherUnitVOS); |
| | | } |
| | | |
| | | @Override |
| | | public List<DispatcherUnitVO> getAll(DispatcherUnitVO dispatcherUnit) { |
| | | List<DispatcherUnitVO> dispatcherUnitVOS = baseMapper.getAll(dispatcherUnit); |
| | | dispatcherUnitVOS.forEach(dispatcherUnitVO1 -> { |
| | | //查询派遣记录条数 |
| | | dispatcherUnitVO1.setSnum(dispatcherService.getDispatcherCount(dispatcherUnitVO1)); |
| | | }); |
| | | return dispatcherUnitVOS; |
| | | } |
| | | |
| | | /** |
| | |
| | | dispatcherUnit.setDeptId(Long.parseLong(deptId)); |
| | | } |
| | | |
| | | if (dispatcherUnitExcel.getJurisdiction() != null && dispatcherUnitExcel.getJurisdiction() != ""){ |
| | | String jurisdiction = jurisdictionService.selectIn(dispatcherUnitExcel.getJurisdiction()); |
| | | dispatcherUnit.setJurisdiction(jurisdiction); |
| | | } |
| | | |
| | | if (dispatcherUnitExcel.getName() != null && dispatcherUnitExcel.getName() != "") { |
| | | //仅中文 |
| | | // String chinese = "^[\\u4E00-\\u9FA5\\uF900-\\uFA2D]+$"; |
| | |
| | | if (dispatcherUnitExcel.getNum() != null) { |
| | | dispatcherUnit.setNum(dispatcherUnitExcel.getNum()); |
| | | } |
| | | |
| | | if (dispatcherUnitExcel.getProfession() != null && dispatcherUnitExcel.getProfession() != ""){ |
| | | dispatcherUnit.setProfession(dispatcherUnitExcel.getProfession()); |
| | | } |
| | | |
| | | if (dispatcherUnitExcel.getDistrict() != null && dispatcherUnitExcel.getDistrict() != ""){ |
| | | dispatcherUnit.setDistrict(dispatcherUnitExcel.getDistrict()); |
| | | } |
| | | |
| | | dispatcherUnit.setLongitude(dispatcherUnitExcel.getLongitude()); |
| | | dispatcherUnit.setLatitude(dispatcherUnitExcel.getLatitude()); |
| | | dispatcherUnit.setAddress(dispatcherUnitExcel.getAddress()); |
| | | |
| | | dispatcherUnit.setStartTime(dispatcherUnitExcel.getStartTime()); |
| | | dispatcherUnit.setEndTime(dispatcherUnitExcel.getEndTime()); |
| | |
| | | |
| | | //新增 |
| | | this.save(dispatcherUnit); |
| | | |
| | | //数据同步 |
| | | String s1 = |
| | | "insert into sys_dispatcher_unit(id,name,dept_id,linkman,phone,create_time,start_time,end_time," + |
| | | "serve_type,security_linkman,cell,num,district) " + |
| | | "values(" + "'" + dispatcherUnit.getId() + "'" + "," + |
| | | "'" + dispatcherUnit.getName() + "'" + "," + |
| | | "'" + dispatcherUnit.getDeptId() + "'" + "," + |
| | | "'" + dispatcherUnit.getLinkman() + "'" + "," + |
| | | "'" + dispatcherUnit.getPhone() + "'" + "," + |
| | | "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(dispatcherUnit.getCreateTime()) + "'" + "," + |
| | | "'" + new SimpleDateFormat("yyyy/MM/dd").format(dispatcherUnit.getStartTime()) + "'" + "," + |
| | | "'" + new SimpleDateFormat("yyyy/MM/dd").format(dispatcherUnit.getEndTime()) + "'" + "," + |
| | | "'" + dispatcherUnit.getServeType() + "'" + "," + |
| | | "'" + dispatcherUnit.getSecurityLinkman() + "'" + "," + |
| | | "'" + dispatcherUnit.getCell() + "'" + "," + |
| | | "'" + dispatcherUnit.getNum() + "'" + "," + |
| | | "'" + dispatcherUnit.getDistrict() + "'" + ")"; |
| | | myAsyncService.dataSync(s1); |
| | | }); |
| | | } |
| | | } |
| | |
| | | * 是否到期 |
| | | */ |
| | | private Integer isExpire; |
| | | |
| | | private String professionName; |
| | | } |
| | |
| | | @MapKey(value = "id") |
| | | @SqlParser(filter=true) |
| | | Map<Long, TreeNode> jurisdictionLazyTree(); |
| | | |
| | | String selectIn(String jurisdiction); |
| | | } |
| | |
| | | <select id="selJur" resultType="java.lang.String"> |
| | | SELECT id FROM sys_jurisdiction WHERE dept_name=#{deptname} |
| | | </select> |
| | | <select id="selectIn" resultType="java.lang.String"> |
| | | SELECT id FROM sys_jurisdiction WHERE dept_name=#{deptname} and is_deleted =0 |
| | | </select> |
| | | </mapper> |
| | |
| | | * @return |
| | | */ |
| | | List<TreeNode> jurisdictionLazyTree(); |
| | | |
| | | String selectIn(String jurisdiction); |
| | | } |
| | |
| | | }); |
| | | return tree; |
| | | } |
| | | |
| | | @Override |
| | | public String selectIn(String jurisdiction) { |
| | | return baseMapper.selectIn(jurisdiction); |
| | | } |
| | | } |
| | |
| | | @ApiOperation(value = "删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | CacheUtil.clear(SYS_CACHE); |
| | | List<String> list = Arrays.asList(ids.split(",")); |
| | | list.forEach(id -> { |
| | | //内网同步 |
| | | String s1 = "update blade_dept set is_deleted = 1 where id = " + "'" + id + "'"; |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.dataSync(s1); |
| | | }); |
| | | return R.status(deptService.removeDept(ids)); |
| | | } |
| | | |
| | |
| | | return R.status(userWxService.removeUser(ids)); |
| | | } |
| | | |
| | | /** |
| | | * 导出用户 |
| | | */ |
| | | @GetMapping("export-user") |
| | | @ApiOperationSupport(order = 13) |
| | | @ApiOperation(value = "导出用户", notes = "传入user") |
| | | public void exportUser(@ApiIgnore @RequestParam Map<String, Object> user, BladeUser bladeUser, HttpServletResponse response) { |
| | | List<UserWxExcel> list = userWxService.exportUser(user); |
| | | ExcelUtil.export(response, "小程序用户数据" + DateUtil.time(), "用户数据表", list, UserWxExcel.class); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.system.excel; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.write.style.ColumnWidth; |
| | | import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
| | | import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * UserExcel |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Data |
| | | @ColumnWidth(25) |
| | | @HeadRowHeight(20) |
| | | @ContentRowHeight(18) |
| | | public class UserWxExcel implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ExcelProperty("企业名称*") |
| | | private String deptId; |
| | | |
| | | // @ColumnWidth(15) |
| | | // @ExcelProperty("警号*") |
| | | // private String code; |
| | | |
| | | @ColumnWidth(10) |
| | | @ExcelProperty("姓名*") |
| | | private String realName; |
| | | |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("联系电话") |
| | | private String phone; |
| | | |
| | | @ExcelProperty("身份证号*") |
| | | private String cardid; |
| | | |
| | | |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | List<String> selectIn(); |
| | | List<Map<Object,String>> selectCount(String name); |
| | | List<Map<Object,String>> getCount(String name); |
| | | List<Map<Object,String>> selectId(String id); |
| | | Map<Object,Integer> selectHold(String deptid); |
| | | |
| | |
| | | </select> |
| | | |
| | | <!--统计单位类型数量--> |
| | | <select id="selectCount" resultType="java.util.HashMap"> |
| | | <select id="getCount" resultType="java.util.HashMap"> |
| | | SELECT dept.id as jurisdiction, dept.dept_name AS title |
| | | FROM blade_dept dept |
| | | WHERE dept.dept_name like concat(concat('%', #{name}), '%') |
| | |
| | | <result column="soil" property="soil"/> |
| | | <result column="reason_for_leav" property="reasonForLeav"/> |
| | | <result column="accreditationStatus" property="accreditationStatus"/> |
| | | <result column="ancestors" property="ancestors"/> |
| | | </resultMap> |
| | | |
| | | <!--带坐标--> |
| | |
| | | bud.unit_name, |
| | | bud.permanent_residence_address as registered, |
| | | bd.dept_name, |
| | | bd.ancestors, |
| | | CASE WHEN sar.audit_status is not null THEN sar.audit_status ELSE -1 END AS accreditationStatus |
| | | from |
| | | blade_user bu |
| | |
| | | |
| | | <!--通过 身份证号查询用户信息--> |
| | | <select id="getUserInfoByIdCardNo" resultType="org.springblade.modules.system.entity.User"> |
| | | SELECT id, name, real_name RealName,securitynumber,dept_id |
| | | SELECT id, name, real_name RealName,securitynumber,dept_id,dispatch |
| | | FROM blade_user |
| | | where 1=1 |
| | | and is_deleted = 0 |
| | |
| | | <if test="user.jurisdiction!=null and user.jurisdiction != ''"> |
| | | and bu.jurisdiction = #{user.jurisdiction} |
| | | </if> |
| | | <if test="user.unitName!=null and user.unitName != ''"> |
| | | and bud.unit_name like concat('%', #{user.unitName},'%') |
| | | </if> |
| | | <!-- <if test="user.unitName!=null and user.unitName != ''">--> |
| | | <!-- and bud.unit_name like concat('%', #{user.unitName},'%')--> |
| | | <!-- </if>--> |
| | | <if test="user.securitynumber!=null and user.securitynumber != ''"> |
| | | and bu.securitynumber = #{user.securitynumber} |
| | | </if> |
| | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.entity.UserWx; |
| | | import org.springblade.modules.system.excel.UserExcel; |
| | | import org.springblade.modules.system.excel.UserWxExcel; |
| | | import org.springblade.modules.system.vo.UserVO; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface UserWxMapper extends BaseMapper<UserWx> { |
| | | UserWx getUserWx(String tenantId, String account, String password); |
| | |
| | | List<String> getDeptName(@Param("deptId") String deptId); |
| | | |
| | | UserVO getUserDetailById(Long id); |
| | | |
| | | List<UserWxExcel> exportUser(@Param("obj") Map<String, Object> param); |
| | | } |
| | |
| | | where bu.is_deleted = 0 |
| | | and bu.id = #{id} |
| | | </select> |
| | | <select id="exportUser" resultType="org.springblade.modules.system.excel.UserWxExcel"> |
| | | SELECT |
| | | bu.id, |
| | | bd.dept_name AS deptId, |
| | | bu.real_name, |
| | | bu.phone, |
| | | bu.cardid |
| | | FROM |
| | | blade_user_wx bu |
| | | LEFT JOIN blade_dept bd ON bu.dept_id = bd.id |
| | | where bu.is_deleted = 0 |
| | | <if test="obj.account != null and obj.account != ''"> |
| | | AND bu.account LIKE CONCAT('%',#{obj.account},'%') |
| | | </if> |
| | | <if test="obj.realName != null and obj.realName != ''"> |
| | | AND bu.real_name LIKE CONCAT('%',#{obj.realName},'%') |
| | | </if> |
| | | <if test="obj.deptId != null and obj.deptId != ''"> |
| | | AND bu.dept_id = #{obj.deptId} |
| | | </if> |
| | | <if test="obj.cardid != null and obj.cardid != ''"> |
| | | and bu.cardid like concat('%', #{obj.cardid},'%') |
| | | </if> |
| | | ORDER BY bu.id desc |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | import org.springblade.core.mp.base.BaseService; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.entity.UserWx; |
| | | import org.springblade.modules.system.excel.UserExcel; |
| | | import org.springblade.modules.system.excel.UserWxExcel; |
| | | import org.springblade.modules.system.vo.UserVO; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface IUserWxService extends BaseService<UserWx> { |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | boolean removeUser(String userIds); |
| | | |
| | | List<UserWxExcel> exportUser(Map<String, Object> user); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public List<Map<Object,String>> selectCount(String name) { |
| | | return baseMapper.selectCount(name); |
| | | return baseMapper.getCount(name); |
| | | } |
| | | |
| | | @Override |
| | |
| | | //机构名称拼接 |
| | | userVOS.forEach(userVO -> { |
| | | if (null!=userVO.getDeptId()) { |
| | | String deptIds = ""; |
| | | if (userVO.getAncestors() != null){ |
| | | deptIds = userVO.getAncestors()+","+userVO.getDeptId(); |
| | | }else{ |
| | | deptIds = userVO.getDeptId(); |
| | | } |
| | | |
| | | List<String> deptNameList = SysCache.getDeptNames(deptIds); |
| | | |
| | | userVO.setFullDeptName(getFullDeptName(deptNameList)); |
| | | |
| | | List<String> list = baseMapper.getDeptName(userVO.getDeptId()); |
| | | if (list.size() > 1) { |
| | | if (null != list.get(1) && list.get(1) != "") { |
| | |
| | | if (list.size() == 1) { |
| | | userVO.setDeptName(list.get(0)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | }); |
| | | return page.setRecords(userVOS); |
| | | } |
| | | } |
| | | |
| | | private String getFullDeptName(List<String> deptNameList) { |
| | | String fullDeptName = ""; |
| | | if (deptNameList != null){ |
| | | if (deptNameList.size()>1){ |
| | | //多级 |
| | | if (StringUtil.isNotBlank(deptNameList.get(0))){ |
| | | //本市保安公司 xxx xxx xxx |
| | | String first = deptNameList.get(0); |
| | | if (first.equals("本市保安公司") || first.equals("保安培训学校") || first.equals("自招保安单位") || first.equals("武装押运公司") || first.equals("分公司") || first.equals("其他")){ |
| | | deptNameList.remove(0); |
| | | fullDeptName = StringUtil.join(deptNameList,","); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return fullDeptName; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<UserVO> selectUserPage(IPage<UserVO> page, User user, Long deptId, String tenantId) { |
| | | List<Long> deptIdList = SysCache.getDeptChildIds(deptId); |
| | |
| | | import org.springblade.modules.system.entity.Role; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.entity.UserWx; |
| | | import org.springblade.modules.system.excel.UserExcel; |
| | | import org.springblade.modules.system.excel.UserWxExcel; |
| | | import org.springblade.modules.system.mapper.UserWxMapper; |
| | | import org.springblade.modules.system.service.IRoleService; |
| | | import org.springblade.modules.system.service.IUserWxService; |
| | |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | @AllArgsConstructor |
| | |
| | | } |
| | | return deleteLogic(Func.toLongList(userIds)); |
| | | } |
| | | |
| | | @Override |
| | | public List<UserWxExcel> exportUser(Map<String, Object> param) { |
| | | List<UserWxExcel> userList = baseMapper.exportUser(param); |
| | | return userList; |
| | | } |
| | | } |
| | |
| | | |
| | | //证书申请状态 |
| | | private String accreditationStatus; |
| | | |
| | | //机构父级 |
| | | private String ancestors; |
| | | |
| | | //完整的机构 |
| | | private String fullDeptName; |
| | | } |