This commit is contained in:
2025-07-01 17:54:58 +08:00
commit 57dcd609e2
5136 changed files with 346184 additions and 0 deletions

51
zhwl-business/pom.xml Normal file
View File

@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>zhwl</artifactId>
<groupId>com.zhwl</groupId>
<version>3.8.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>zhwl-business</artifactId>
<packaging>pom</packaging>
<modules>
<module>zhwl-guide</module>
<module>zhwl-message</module>
<module>zhwl-notice</module>
<module>zhwl-payment</module>
<module>zhwl-printset</module>
<module>zhwl-report</module>
<module>zhwl-scenic</module>
<module>zhwl-statistics</module>
<module>zhwl-ticket</module>
<module>zhwl-ticket-order</module>
<module>zhwl-user</module>
<module>zhwl-check-point</module>
<module>zhwl-resident</module>
<module>zhwl-base</module>
<module>zhwl-customer</module>
<module>zhwl-eatery</module>
<module>zhwl-sales-point</module>
<module>zhwl-prepaid-card</module>
<module>zhwl-hotel-homestay</module>
<module>zhwl-hotel-homestay-order</module>
<module>zhwl-store</module>
<module>zhwl-coupon</module>
<module>zhwl-vip</module>
<module>zhwl-express</module>
<module>zhwl-points-mall</module>
</modules>
<dependencies>
<dependency>
<groupId>com.zhwl</groupId>
<artifactId>zhwl-common</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.zhwl</groupId>
<artifactId>zhwl-business</artifactId>
<version>3.8.7</version>
</parent>
<artifactId>zhwl-base</artifactId>
<description>业务代码公共模块</description>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.zhwl</groupId>
<artifactId>zhwl-framework</artifactId>
<version>3.8.7</version>
</dependency>
<dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>wx-java-miniapp-spring-boot-starter</artifactId>
<version>${weixin.java.version}</version>
</dependency>
<dependency>
<groupId>com.zhwl</groupId>
<artifactId>zhwl-scenic</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,21 @@
package com.zhwl.base.constant;
/**
* 通用常量信息
*
* @author ruoyi
*/
public class Constants {
/**
* 员工卡状态-未绑定
*/
public static final Integer ZDY_EMPLOYEE_CARD_NO = 0;
/**
* 员工卡状态-已绑定
*/
public static final Integer ZDY_EMPLOYEE_CARD_YES = 1;
}

View File

@@ -0,0 +1,27 @@
package com.zhwl.base.constant;
/**
* 通用常量信息
*
* @author song_xiaowei
*/
public class WxBaseInfoConstants {
WxBaseInfoConstants() {
}
/**
* 获取小程序基本信息
*/
public static final String URL_GET_ACCOUNT_BASIC_INFO = "https://api.weixin.qq.com/cgi-bin/account/getaccountbasicinfo";
/**
* 获取小程序备案状态
*/
public static final String URL_GET_ICP_ENTRANCE_INFO = "https://api.weixin.qq.com/wxa/icp/get_icp_entrance_info";
/**
* 获取小程序已设置的所有类目
*/
public static final String URL_GET_CATEGORY = "https://api.weixin.qq.com/cgi-bin/wxopen/getcategory";
}

View File

@@ -0,0 +1,111 @@
package com.zhwl.base.controller;
import java.util.List;
import java.util.Objects;
import javax.servlet.http.HttpServletResponse;
import com.zhwl.common.utils.SecurityUtils;
import lombok.AllArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zhwl.common.annotation.Log;
import com.zhwl.common.core.controller.BaseController;
import com.zhwl.common.core.domain.AjaxResult;
import com.zhwl.common.enums.BusinessType;
import com.zhwl.base.domain.ZdyBaseCompany;
import com.zhwl.base.service.IZdyBaseCompanyService;
import com.zhwl.common.utils.poi.ExcelUtil;
import com.zhwl.common.core.page.TableDataInfo;
/**
* 系统基础模块-公司管理
*
* @author wangxing
* @date 2024-07-29
*/
@RestController
@AllArgsConstructor
@RequestMapping("/base/baseCompany")
public class ZdyBaseCompanyController extends BaseController {
private final IZdyBaseCompanyService zdyBaseCompanyService;
/**
* 查询系统基础模块-公司管理列表
*/
@PreAuthorize("@ss.hasPermi('base:baseCompany:list')")
@GetMapping("/list")
public TableDataInfo list(ZdyBaseCompany zdyBaseCompany) {
startPage();
Long deptId = SecurityUtils.getDeptId();
if(Objects.nonNull(deptId)){
zdyBaseCompany.setDeptId(deptId);
}
List<ZdyBaseCompany> list = zdyBaseCompanyService.selectZdyBaseCompanyList(zdyBaseCompany);
return getDataTable(list);
}
/**
* 导出系统基础模块-公司管理列表
*/
@PreAuthorize("@ss.hasPermi('base:baseCompany:export')")
@Log(title = "系统基础模块-公司管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ZdyBaseCompany zdyBaseCompany) {
List<ZdyBaseCompany> list = zdyBaseCompanyService.selectZdyBaseCompanyList(zdyBaseCompany);
ExcelUtil<ZdyBaseCompany> util = new ExcelUtil<ZdyBaseCompany>(ZdyBaseCompany.class);
util.exportExcel(response, list, "系统基础模块-公司管理数据");
}
/**
* 获取系统基础模块-公司管理详细信息
*/
@PreAuthorize("@ss.hasPermi('base:baseCompany:query')")
@GetMapping(value = {"/", "/{id}"})
public AjaxResult getInfo(@PathVariable(value = "id", required = false)Long id) {
if(Objects.isNull(id)){
if(Objects.isNull(SecurityUtils.getDeptId())){
return success(zdyBaseCompanyService.selectZdyBaseCompanyById(1L));
}
return success(zdyBaseCompanyService.selectZdyBaseCompanyByDeptId(SecurityUtils.getDeptId()));
}
return success(zdyBaseCompanyService.selectZdyBaseCompanyById(id));
}
/**
* 新增系统基础模块-公司管理
*/
@PreAuthorize("@ss.hasPermi('base:baseCompany:add')")
@Log(title = "系统基础模块-公司管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ZdyBaseCompany zdyBaseCompany) {
return toAjax(zdyBaseCompanyService.insertZdyBaseCompany(zdyBaseCompany));
}
/**
* 修改系统基础模块-公司管理
*/
@PreAuthorize("@ss.hasPermi('base:baseCompany:edit')")
@Log(title = "系统基础模块-公司管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ZdyBaseCompany zdyBaseCompany) {
return toAjax(zdyBaseCompanyService.updateZdyBaseCompany(zdyBaseCompany));
}
/**
* 删除系统基础模块-公司管理
*/
@PreAuthorize("@ss.hasPermi('base:baseCompany:remove')")
@Log(title = "系统基础模块-公司管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(zdyBaseCompanyService.deleteZdyBaseCompanyByIds(ids));
}
}

View File

@@ -0,0 +1,110 @@
package com.zhwl.base.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.zhwl.base.constant.Constants;
import lombok.AllArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zhwl.common.annotation.Log;
import com.zhwl.common.core.controller.BaseController;
import com.zhwl.common.core.domain.AjaxResult;
import com.zhwl.common.enums.BusinessType;
import com.zhwl.base.domain.ZdyBaseEmployeeCard;
import com.zhwl.base.service.IZdyBaseEmployeeCardService;
import com.zhwl.common.utils.poi.ExcelUtil;
import com.zhwl.common.core.page.TableDataInfo;
/**
* 系统基础模块-员工卡管理
*
* @author wangxing
* @date 2024-07-30
*/
@RestController
@AllArgsConstructor
@RequestMapping("/base/baseEmployeeCard")
public class ZdyBaseEmployeeCardController extends BaseController {
private final IZdyBaseEmployeeCardService zdyBaseEmployeeCardService;
/**
* 查询系统基础模块-员工卡管理列表
*/
@PreAuthorize("@ss.hasPermi('base:baseEmployeeCard:list')")
@GetMapping("/list")
public TableDataInfo list(ZdyBaseEmployeeCard zdyBaseEmployeeCard) {
startPage();
List<ZdyBaseEmployeeCard> list = zdyBaseEmployeeCardService.selectZdyBaseEmployeeCardList(zdyBaseEmployeeCard);
return getDataTable(list);
}
/**
* 导出系统基础模块-员工卡管理列表
*/
@PreAuthorize("@ss.hasPermi('base:baseEmployeeCard:export')")
@Log(title = "系统基础模块-员工卡管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ZdyBaseEmployeeCard zdyBaseEmployeeCard) {
List<ZdyBaseEmployeeCard> list = zdyBaseEmployeeCardService.selectZdyBaseEmployeeCardList(zdyBaseEmployeeCard);
ExcelUtil<ZdyBaseEmployeeCard> util = new ExcelUtil<ZdyBaseEmployeeCard>(ZdyBaseEmployeeCard.class);
util.exportExcel(response, list, "系统基础模块-员工卡管理数据");
}
/**
* 获取系统基础模块-员工卡管理详细信息
*/
@PreAuthorize("@ss.hasPermi('base:baseEmployeeCard:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(zdyBaseEmployeeCardService.selectZdyBaseEmployeeCardById(id));
}
/**
* 新增系统基础模块-员工卡管理
*/
@PreAuthorize("@ss.hasPermi('base:baseEmployeeCard:add')")
@Log(title = "系统基础模块-员工卡管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ZdyBaseEmployeeCard zdyBaseEmployeeCard) {
return toAjax(zdyBaseEmployeeCardService.insertZdyBaseEmployeeCard(zdyBaseEmployeeCard));
}
/**
* 修改系统基础模块-员工卡管理
*/
@PreAuthorize("@ss.hasPermi('base:baseEmployeeCard:edit')")
@Log(title = "系统基础模块-员工卡管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ZdyBaseEmployeeCard zdyBaseEmployeeCard) {
return toAjax(zdyBaseEmployeeCardService.updateZdyBaseEmployeeCard(zdyBaseEmployeeCard));
}
/**
* 删除系统基础模块-员工卡管理
*/
@PreAuthorize("@ss.hasPermi('base:baseEmployeeCard:remove')")
@Log(title = "系统基础模块-员工卡管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(zdyBaseEmployeeCardService.deleteZdyBaseEmployeeCardByIds(ids));
}
/**
* 查询系统基础模块-员工卡管理列表-不分页
*/
@GetMapping("/employeeCardList")
public AjaxResult employeeCardList(ZdyBaseEmployeeCard zdyBaseEmployeeCard) {
zdyBaseEmployeeCard.setCardStatus(Constants.ZDY_EMPLOYEE_CARD_NO);
List<ZdyBaseEmployeeCard> list = zdyBaseEmployeeCardService.selectZdyBaseEmployeeCardList(zdyBaseEmployeeCard);
return AjaxResult.success(list);
}
}

View File

@@ -0,0 +1,99 @@
package com.zhwl.base.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import lombok.AllArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zhwl.common.annotation.Log;
import com.zhwl.common.core.controller.BaseController;
import com.zhwl.common.core.domain.AjaxResult;
import com.zhwl.common.enums.BusinessType;
import com.zhwl.base.domain.ZdyBaseEmployeeCardLog;
import com.zhwl.base.service.IZdyBaseEmployeeCardLogService;
import com.zhwl.common.utils.poi.ExcelUtil;
import com.zhwl.common.core.page.TableDataInfo;
/**
* 系统基础模块-员工卡绑定日志管理
*
* @author wangxing
* @date 2024-07-31
*/
@RestController
@AllArgsConstructor
@RequestMapping("/base/employeeCardLog")
public class ZdyBaseEmployeeCardLogController extends BaseController {
private final IZdyBaseEmployeeCardLogService zdyBaseEmployeeCardLogService;
/**
* 查询系统基础模块-员工卡绑定日志管理列表
*/
@PreAuthorize("@ss.hasPermi('base:employeeCardLog:list')")
@GetMapping("/list")
public TableDataInfo list(ZdyBaseEmployeeCardLog zdyBaseEmployeeCardLog) {
startPage();
List<ZdyBaseEmployeeCardLog> list = zdyBaseEmployeeCardLogService.selectZdyBaseEmployeeCardLogList(zdyBaseEmployeeCardLog);
return getDataTable(list);
}
/**
* 导出系统基础模块-员工卡绑定日志管理列表
*/
@PreAuthorize("@ss.hasPermi('base:employeeCardLog:export')")
@Log(title = "系统基础模块-员工卡绑定日志管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ZdyBaseEmployeeCardLog zdyBaseEmployeeCardLog) {
List<ZdyBaseEmployeeCardLog> list = zdyBaseEmployeeCardLogService.selectZdyBaseEmployeeCardLogList(zdyBaseEmployeeCardLog);
ExcelUtil<ZdyBaseEmployeeCardLog> util = new ExcelUtil<ZdyBaseEmployeeCardLog>(ZdyBaseEmployeeCardLog.class);
util.exportExcel(response, list, "系统基础模块-员工卡绑定日志管理数据");
}
/**
* 获取系统基础模块-员工卡绑定日志管理详细信息
*/
@PreAuthorize("@ss.hasPermi('base:employeeCardLog:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(zdyBaseEmployeeCardLogService.selectZdyBaseEmployeeCardLogById(id));
}
/**
* 新增系统基础模块-员工卡绑定日志管理
*/
@PreAuthorize("@ss.hasPermi('base:employeeCardLog:add')")
@Log(title = "系统基础模块-员工卡绑定日志管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ZdyBaseEmployeeCardLog zdyBaseEmployeeCardLog) {
return toAjax(zdyBaseEmployeeCardLogService.insertZdyBaseEmployeeCardLog(zdyBaseEmployeeCardLog));
}
/**
* 修改系统基础模块-员工卡绑定日志管理
*/
@PreAuthorize("@ss.hasPermi('base:employeeCardLog:edit')")
@Log(title = "系统基础模块-员工卡绑定日志管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ZdyBaseEmployeeCardLog zdyBaseEmployeeCardLog) {
return toAjax(zdyBaseEmployeeCardLogService.updateZdyBaseEmployeeCardLog(zdyBaseEmployeeCardLog));
}
/**
* 删除系统基础模块-员工卡绑定日志管理
*/
@PreAuthorize("@ss.hasPermi('base:employeeCardLog:remove')")
@Log(title = "系统基础模块-员工卡绑定日志管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(zdyBaseEmployeeCardLogService.deleteZdyBaseEmployeeCardLogByIds(ids));
}
}

View File

@@ -0,0 +1,169 @@
package com.zhwl.base.controller;
import com.zhwl.base.domain.BaseEmployeeTemplate;
import com.zhwl.base.domain.ZdyBaseEmployee;
import com.zhwl.base.domain.ZdyEmployeeCardGraph;
import com.zhwl.base.service.IZdyBaseEmployeeService;
import com.zhwl.common.annotation.Log;
import com.zhwl.common.annotation.ZdyDeptId;
import com.zhwl.common.core.controller.BaseController;
import com.zhwl.common.core.domain.AjaxResult;
import com.zhwl.common.core.domain.entity.SysUser;
import com.zhwl.common.core.page.TableDataInfo;
import com.zhwl.common.enums.BusinessType;
import com.zhwl.common.utils.SecurityUtils;
import com.zhwl.common.utils.poi.ExcelUtil;
import lombok.AllArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
/**
* 系统基础模块-员工管理
*
* @author wangxing
* @date 2024-07-29
*/
@RestController
@AllArgsConstructor
@RequestMapping("/base/baseEmployee")
public class ZdyBaseEmployeeController extends BaseController {
private final IZdyBaseEmployeeService zdyBaseEmployeeService;
/**
* 查询系统基础模块-员工管理列表
*/
@PreAuthorize("@ss.hasPermi('base:baseEmployee:list')")
@GetMapping("/list")
public TableDataInfo list(ZdyBaseEmployee zdyBaseEmployee) {
startPage();
List<ZdyBaseEmployee> list = zdyBaseEmployeeService.selectZdyBaseEmployeeList(zdyBaseEmployee);
return getDataTable(list);
}
/**
* 导出系统基础模块-员工管理列表
*/
@PreAuthorize("@ss.hasPermi('base:baseEmployee:export')")
@Log(title = "系统基础模块-员工管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ZdyBaseEmployee zdyBaseEmployee) {
List<ZdyBaseEmployee> list = zdyBaseEmployeeService.selectZdyBaseEmployeeList(zdyBaseEmployee);
ExcelUtil<ZdyBaseEmployee> util = new ExcelUtil<ZdyBaseEmployee>(ZdyBaseEmployee.class);
util.exportExcel(response, list, "系统基础模块-员工管理数据");
}
/**
* 获取系统基础模块-员工管理详细信息
*/
@PreAuthorize("@ss.hasPermi('base:baseEmployee:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(zdyBaseEmployeeService.selectZdyBaseEmployeeById(id));
}
/**
* 新增系统基础模块-员工管理
*/
@PreAuthorize("@ss.hasPermi('base:baseEmployee:add')")
@Log(title = "系统基础模块-员工管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ZdyBaseEmployee zdyBaseEmployee) {
SysUser user = SecurityUtils.getLoginUser().getUser();
Long companyId = user.getCompanyId();
if(Objects.isNull(companyId)){
companyId = 1L;
}
zdyBaseEmployee.setCompanyId(companyId);
zdyBaseEmployee.setDeptId(user.getDeptId());
return toAjax(zdyBaseEmployeeService.insertZdyBaseEmployee(zdyBaseEmployee));
}
/**
* 修改系统基础模块-员工管理
*/
@PreAuthorize("@ss.hasPermi('base:baseEmployee:edit')")
@Log(title = "系统基础模块-员工管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ZdyBaseEmployee zdyBaseEmployee) {
return toAjax(zdyBaseEmployeeService.updateZdyBaseEmployee(zdyBaseEmployee));
}
/**
* 删除系统基础模块-员工管理
*/
@PreAuthorize("@ss.hasPermi('base:baseEmployee:remove')")
@Log(title = "系统基础模块-员工管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(zdyBaseEmployeeService.deleteZdyBaseEmployeeByIds(ids));
}
/**
* 修改系统基础模块-员工启用/禁用
*/
@PreAuthorize("@ss.hasPermi('base:baseEmployee:edit')")
@Log(title = "系统基础模块-员工管理", businessType = BusinessType.UPDATE)
@PutMapping("/checkEmployee")
public AjaxResult checkEmployee(@RequestBody ZdyBaseEmployee zdyBaseEmployee) {
return toAjax(zdyBaseEmployeeService.checkEmployee(zdyBaseEmployee));
}
/**
* 下载员工模板
*/
@PreAuthorize("@ss.hasPermi('base:baseEmployee:download')")
@PostMapping("/download/baseEmployee/template")
public void downloadEmployeeTemplate(HttpServletResponse response) {
ExcelUtil<BaseEmployeeTemplate> util = new ExcelUtil<>(BaseEmployeeTemplate.class);
util.exportExcel(response, Collections.emptyList(), "员工模板");
}
/**
* 导入员工信息
*/
@PreAuthorize("@ss.hasPermi('base:baseEmployee:import')")
@PostMapping("/import/baseEmployee/data")
public AjaxResult importEmployeeData(MultipartFile file) throws Exception {
ExcelUtil<BaseEmployeeTemplate> util = new ExcelUtil<>(BaseEmployeeTemplate.class);
List<BaseEmployeeTemplate> employeeList = util.importExcel(file.getInputStream());
SysUser user = SecurityUtils.getLoginUser().getUser();
Long companyId = user.getCompanyId();
if(Objects.isNull(companyId)){
companyId = 1L;
}
for (BaseEmployeeTemplate e:employeeList) {
e.setCompanyId(companyId);
}
List<BaseEmployeeTemplate> list = zdyBaseEmployeeService.importData(employeeList);
return success(list);
}
/**
* 员工刷卡明细
*/
@ZdyDeptId
@GetMapping("/getEmployeeCardList")
public TableDataInfo getEmployeeCardList(ZdyEmployeeCardGraph zdyEmployeeCardGraph) {
startPage();
List<ZdyEmployeeCardGraph> list = zdyBaseEmployeeService.getEmployeeCardList(zdyEmployeeCardGraph);
return getDataTable(list);
}
/**
* 员工入园刷卡统计
*
* @description 手动分页默认每页10条
*/
@ZdyDeptId
@GetMapping("/getEmployeeEntryList")
public TableDataInfo getEmployeeEntryList(ZdyEmployeeCardGraph zdyEmployeeCardGraph, @RequestParam(defaultValue = "1") int pageNum, @RequestParam(defaultValue = "10") int pageSize) {
return zdyBaseEmployeeService.getEmployeeEntryList(zdyEmployeeCardGraph, pageNum, pageSize);
}
}

View File

@@ -0,0 +1,109 @@
package com.zhwl.base.controller;
import java.util.List;
import java.util.Objects;
import javax.servlet.http.HttpServletResponse;
import com.zhwl.common.core.domain.entity.SysUser;
import com.zhwl.common.utils.SecurityUtils;
import lombok.AllArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zhwl.common.annotation.Log;
import com.zhwl.common.core.controller.BaseController;
import com.zhwl.common.core.domain.AjaxResult;
import com.zhwl.common.enums.BusinessType;
import com.zhwl.base.domain.ZdyBaseOnlinePlatform;
import com.zhwl.base.service.IZdyBaseOnlinePlatformService;
import com.zhwl.common.utils.poi.ExcelUtil;
import com.zhwl.common.core.page.TableDataInfo;
/**
* 系统基础模块-线上平台管理
*
* @author wangxing
* @date 2024-07-29
*/
@RestController
@AllArgsConstructor
@RequestMapping("/base/basePlatform")
public class ZdyBaseOnlinePlatformController extends BaseController {
private final IZdyBaseOnlinePlatformService zdyBaseOnlinePlatformService;
/**
* 查询系统基础模块-线上平台管理列表
*/
@PreAuthorize("@ss.hasPermi('base:basePlatform:list')")
@GetMapping("/list")
public TableDataInfo list(ZdyBaseOnlinePlatform zdyBaseOnlinePlatform) {
startPage();
SysUser user = SecurityUtils.getLoginUser().getUser();
if(Objects.nonNull(user.getScenicId())){
zdyBaseOnlinePlatform.setScenicId(user.getScenicId());
}
List<ZdyBaseOnlinePlatform> list = zdyBaseOnlinePlatformService.selectZdyBaseOnlinePlatformList(zdyBaseOnlinePlatform);
return getDataTable(list);
}
/**
* 导出系统基础模块-线上平台管理列表
*/
@PreAuthorize("@ss.hasPermi('base:basePlatform:export')")
@Log(title = "系统基础模块-线上平台管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ZdyBaseOnlinePlatform zdyBaseOnlinePlatform) {
List<ZdyBaseOnlinePlatform> list = zdyBaseOnlinePlatformService.selectZdyBaseOnlinePlatformList(zdyBaseOnlinePlatform);
ExcelUtil<ZdyBaseOnlinePlatform> util = new ExcelUtil<ZdyBaseOnlinePlatform>(ZdyBaseOnlinePlatform.class);
util.exportExcel(response, list, "系统基础模块-线上平台管理数据");
}
/**
* 获取系统基础模块-线上平台管理详细信息
*/
@PreAuthorize("@ss.hasPermi('base:basePlatform:query')")
@GetMapping(value = {"/", "/{id}"})
public AjaxResult getInfo(@PathVariable(value = "id", required = false)Long id) {
if(Objects.isNull(id)){
id = 1L;
}
return success(zdyBaseOnlinePlatformService.selectZdyBaseOnlinePlatformById(id));
}
/**
* 新增系统基础模块-线上平台管理
*/
@PreAuthorize("@ss.hasPermi('base:basePlatform:add')")
@Log(title = "系统基础模块-线上平台管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ZdyBaseOnlinePlatform zdyBaseOnlinePlatform) {
return toAjax(zdyBaseOnlinePlatformService.insertZdyBaseOnlinePlatform(zdyBaseOnlinePlatform));
}
/**
* 修改系统基础模块-线上平台管理
*/
@PreAuthorize("@ss.hasPermi('base:basePlatform:edit')")
@Log(title = "系统基础模块-线上平台管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ZdyBaseOnlinePlatform zdyBaseOnlinePlatform) {
return toAjax(zdyBaseOnlinePlatformService.updateZdyBaseOnlinePlatform(zdyBaseOnlinePlatform));
}
/**
* 删除系统基础模块-线上平台管理
*/
@PreAuthorize("@ss.hasPermi('base:basePlatform:remove')")
@Log(title = "系统基础模块-线上平台管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(zdyBaseOnlinePlatformService.deleteZdyBaseOnlinePlatformByIds(ids));
}
}

View File

@@ -0,0 +1,119 @@
package com.zhwl.base.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.zhwl.common.config.RuoYiConfig;
import com.zhwl.common.core.domain.model.LoginUser;
import com.zhwl.common.utils.file.FileUploadUtils;
import com.zhwl.common.utils.file.FileUtils;
import com.zhwl.common.utils.file.MimeTypeUtils;
import com.zhwl.framework.config.ServerConfig;
import lombok.AllArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.zhwl.common.annotation.Log;
import com.zhwl.common.core.controller.BaseController;
import com.zhwl.common.core.domain.AjaxResult;
import com.zhwl.common.enums.BusinessType;
import com.zhwl.base.domain.ZdyBasePackage;
import com.zhwl.base.service.IZdyBasePackageService;
import com.zhwl.common.utils.poi.ExcelUtil;
import com.zhwl.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/**
* 系统基础模块-更新包管理
*
* @author wangxing
* @date 2024-07-29
*/
@RestController
@AllArgsConstructor
@RequestMapping("/base/basePackage")
public class ZdyBasePackageController extends BaseController {
private final IZdyBasePackageService zdyBasePackageService;
private final ServerConfig serverConfig;
/**
* 查询系统基础模块-更新包管理列表
*/
@PreAuthorize("@ss.hasPermi('base:basePackage:list')")
@GetMapping("/list")
public TableDataInfo list(ZdyBasePackage zdyBasePackage) {
startPage();
List<ZdyBasePackage> list = zdyBasePackageService.selectZdyBasePackageList(zdyBasePackage);
return getDataTable(list);
}
/**
* 导出系统基础模块-更新包管理列表
*/
@PreAuthorize("@ss.hasPermi('base:basePackage:export')")
@Log(title = "系统基础模块-更新包管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ZdyBasePackage zdyBasePackage) {
List<ZdyBasePackage> list = zdyBasePackageService.selectZdyBasePackageList(zdyBasePackage);
ExcelUtil<ZdyBasePackage> util = new ExcelUtil<ZdyBasePackage>(ZdyBasePackage.class);
util.exportExcel(response, list, "系统基础模块-更新包管理数据");
}
/**
* 获取系统基础模块-更新包管理详细信息
*/
@PreAuthorize("@ss.hasPermi('base:basePackage:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(zdyBasePackageService.selectZdyBasePackageById(id));
}
/**
* 新增系统基础模块-更新包管理
*/
@PreAuthorize("@ss.hasPermi('base:basePackage:add')")
@Log(title = "系统基础模块-更新包管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ZdyBasePackage zdyBasePackage) {
return toAjax(zdyBasePackageService.insertZdyBasePackage(zdyBasePackage));
}
/**
* 修改系统基础模块-更新包管理
*/
@PreAuthorize("@ss.hasPermi('base:basePackage:edit')")
@Log(title = "系统基础模块-更新包管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ZdyBasePackage zdyBasePackage) {
return toAjax(zdyBasePackageService.updateZdyBasePackage(zdyBasePackage));
}
/**
* 删除系统基础模块-更新包管理
*/
@PreAuthorize("@ss.hasPermi('base:basePackage:remove')")
@Log(title = "系统基础模块-更新包管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(zdyBasePackageService.deleteZdyBasePackageByIds(ids));
}
/**
* apk上传
*/
@PostMapping("/uploadApk")
public AjaxResult uploadApk(MultipartFile file) throws Exception {
if (!file.isEmpty()) {
String fileName = FileUploadUtils.uploadNoDate(RuoYiConfig.getApkPath(), file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
String url = serverConfig.getUrl() + fileName;
AjaxResult ajax = AjaxResult.success();
ajax.put("url", url);
ajax.put("fileName", fileName);
ajax.put("newFileName", FileUtils.getName(fileName));
ajax.put("originalFilename", file.getOriginalFilename());
return ajax;
}
return error("apk上传异常请联系管理员");
}
}

View File

@@ -0,0 +1,148 @@
package com.zhwl.base.controller;
import com.zhwl.base.constant.Constants;
import com.zhwl.base.domain.ZdyHolidayVacations;
import com.zhwl.base.enums.HolidayVacationEnum;
import com.zhwl.base.service.IZdyHolidayVacationsService;
import com.zhwl.common.annotation.Log;
import com.zhwl.common.core.controller.BaseController;
import com.zhwl.common.core.domain.AjaxResult;
import com.zhwl.common.core.domain.entity.SysDictData;
import com.zhwl.common.core.page.TableDataInfo;
import com.zhwl.common.enums.BusinessType;
import com.zhwl.common.enums.DictTypeEnum;
import com.zhwl.common.utils.DateUtils;
import com.zhwl.common.utils.DictUtils;
import com.zhwl.common.utils.poi.ExcelUtil;
import lombok.AllArgsConstructor;
import org.checkerframework.checker.units.qual.A;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
/**
* 节假日管理Controller
*
* @author wangxing
* @date 2024-08-20
*/
@AllArgsConstructor
@RestController
@RequestMapping("/base/vacations")
public class ZdyHolidayVacationsController extends BaseController {
private final IZdyHolidayVacationsService zdyHolidayVacationsService;
/**
* 查询节假日管理列表
*/
@PreAuthorize("@ss.hasPermi('base:vacations:list')")
@GetMapping("/list")
public TableDataInfo list(ZdyHolidayVacations zdyHolidayVacations) {
startPage();
List<ZdyHolidayVacations> list = zdyHolidayVacationsService.selectZdyHolidayVacationsList(zdyHolidayVacations);
return getDataTable(list);
}
/**
* 导出节假日管理列表
*/
@PreAuthorize("@ss.hasPermi('base:vacations:export')")
@Log(title = "节假日管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ZdyHolidayVacations zdyHolidayVacations) {
List<ZdyHolidayVacations> list = zdyHolidayVacationsService.selectZdyHolidayVacationsList(zdyHolidayVacations);
ExcelUtil<ZdyHolidayVacations> util = new ExcelUtil<ZdyHolidayVacations>(ZdyHolidayVacations.class);
util.exportExcel(response, list, "节假日管理数据");
}
/**
* 获取节假日管理详细信息
*/
@PreAuthorize("@ss.hasPermi('base:vacations:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(zdyHolidayVacationsService.selectZdyHolidayVacationsById(id));
}
/**
* 新增节假日管理
*/
@PreAuthorize("@ss.hasPermi('base:vacations:add')")
@Log(title = "节假日管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ZdyHolidayVacations zdyHolidayVacations) {
return toAjax(zdyHolidayVacationsService.insertZdyHolidayVacations(zdyHolidayVacations));
}
/**
* 修改节假日管理
*/
@PreAuthorize("@ss.hasPermi('base:vacations:edit')")
@Log(title = "节假日管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ZdyHolidayVacations zdyHolidayVacations) {
return toAjax(zdyHolidayVacationsService.updateZdyHolidayVacations(zdyHolidayVacations));
}
/**
* 删除节假日管理
*/
@PreAuthorize("@ss.hasPermi('base:vacations:remove')")
@Log(title = "节假日管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(zdyHolidayVacationsService.deleteZdyHolidayVacationsByIds(ids));
}
/**
* 同步节假日信息
*/
@PreAuthorize("@ss.hasPermi('base:vacations:sync')")
@GetMapping(value = "/syncHolidayVacations")
public AjaxResult syncHolidayVacations(String year) {
zdyHolidayVacationsService.syncHolidayVacations(year);
return success();
}
/**
* 查询法定节假日管理列表
*/
// @PreAuthorize("@ss.hasPermi('base:vacations:list')")
@GetMapping("/holidayList")
public AjaxResult holidayList(ZdyHolidayVacations zdyHolidayVacations) {
//特殊节假日
List<ZdyHolidayVacations> list = new ArrayList<>();
List<SysDictData> dictCache = DictUtils.getDictCache(DictTypeEnum.HOLIDAY_TYPE);
dictCache.forEach(d -> {
ZdyHolidayVacations holiday = new ZdyHolidayVacations();
holiday.setHolidayName(d.getDictLabel());
holiday.setHolidayDict(d.getDictValue());
holiday.setHolidayType(HolidayVacationEnum.getHolidayVacationTypeByName(d.getDictLabel()));
list.add(holiday);
});
return AjaxResult.success(list);
}
/**
* 查询特殊节假日管理列表
*/
@GetMapping("/specialHolidayList")
public AjaxResult specialHolidayList(ZdyHolidayVacations zdyHolidayVacations) {
//特殊节假日
zdyHolidayVacations.setHolidayType("3");
zdyHolidayVacations.setNowDate(DateUtils.getNowDate());
List<ZdyHolidayVacations> list = zdyHolidayVacationsService.selectZdyHolidayVacationsList(zdyHolidayVacations);
return AjaxResult.success(list);
}
/**
* 获取指定年份的节假日列表
*/
@GetMapping("/holidayList/{year}")
public AjaxResult holidayListByYear(@PathVariable("year") Integer year, ZdyHolidayVacations zdyHolidayVacations) {
List<ZdyHolidayVacations> list = zdyHolidayVacationsService.holidayListByYear(year, zdyHolidayVacations);
return AjaxResult.success(list);
}
}

View File

@@ -0,0 +1,138 @@
package com.zhwl.base.controller;
import cn.hutool.core.util.RandomUtil;
import com.zhwl.base.service.IZdyBaseUserService;
import com.zhwl.common.core.controller.BaseController;
import com.zhwl.common.core.domain.AjaxResult;
import com.zhwl.common.core.domain.entity.SysDept;
import com.zhwl.common.core.domain.entity.SysRole;
import com.zhwl.common.core.domain.model.LoginUser;
import com.zhwl.common.utils.SecurityUtils;
import com.zhwl.common.utils.StringUtils;
import com.zhwl.framework.web.service.SysPermissionService;
import com.zhwl.framework.web.service.TokenService;
import com.zhwl.system.domain.dto.BaseUserDTO;
import com.zhwl.system.service.ISysDeptService;
import com.zhwl.system.service.ISysRoleService;
import com.zhwl.system.service.ISysUserService;
import lombok.AllArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import static com.zhwl.common.constant.UserConstants.DATA_SCOPE_DEPT_AND_CHILD;
/**
* 系统基础模块-员工管理
*
* @author wangxing
* @date 2024-07-29
*/
@RestController
@AllArgsConstructor
@RequestMapping("/base/baseCommon")
public class ZdySysCommonController extends BaseController {
private final IZdyBaseUserService zdyBaseuserService;
private final ISysRoleService roleService;
private final ISysDeptService deptService;
private final TokenService tokenService;
private final SysPermissionService permissionService;
private final ISysUserService userService;
/**
* 新增系统基础模块-公司管理
*/
@PreAuthorize("@ss.hasPermi('system:user:add')")
@PostMapping("/addUser")
public AjaxResult addUser(@RequestBody BaseUserDTO baseUserDTO) {
zdyBaseuserService.addUser(baseUserDTO);
return AjaxResult.success();
}
/**
* 添加岗位管理
*/
@PreAuthorize("@ss.hasPermi('base:baseCommon:addRole')")
@PostMapping("/addRole")
public AjaxResult addRole(@RequestBody SysRole role) {
role.setDeptId(SecurityUtils.getDeptId());
if (!zdyBaseuserService.checkRoleNameUniqueDept(role)) {
return error("新增岗位'" + role.getRoleName() + "'失败,岗位名称已存在");
} else if (!zdyBaseuserService.checkRoleKeyUniqueDept(role)) {
return error("新增岗位'" + role.getRoleName() + "'失败,岗位权限已存在");
}
role.setCreateBy(getUsername());
// 新增角色信息
if (StringUtils.isBlank(role.getDataScope())) {
role.setDataScope(DATA_SCOPE_DEPT_AND_CHILD);
}
//默认岗位角色从100开始排序
String roleKey = String.format("role_%s", RandomUtil.randomStringUpper(4));
role.setRoleKey(roleKey);
return toAjax(zdyBaseuserService.addRole(role));
}
/**
* 修改岗位管理
*/
@PreAuthorize("@ss.hasPermi('base:baseCommon:editRole')")
@PostMapping("/editRole")
public AjaxResult editRole(@RequestBody SysRole role) {
roleService.checkRoleAllowed(role);
roleService.checkRoleDataScope(role.getRoleId());
if (!zdyBaseuserService.checkRoleNameUniqueDept(role)) {
return error("修改岗位'" + role.getRoleName() + "'失败,岗位名称已存在");
} else if (!zdyBaseuserService.checkRoleKeyUniqueDept(role)) {
return error("修改岗位'" + role.getRoleName() + "'失败,岗位权限已存在");
}
role.setUpdateBy(getUsername());
if (zdyBaseuserService.editRole(role) > 0) {
// 更新缓存用户权限
LoginUser loginUser = getLoginUser();
if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin()) {
loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser()));
loginUser.setUser(userService.selectUserByUserName(loginUser.getUser().getUserName()));
tokenService.setLoginUser(loginUser);
}
return success();
}
return error("修改岗位'" + role.getRoleName() + "'失败,请联系管理员");
}
/**
* 获取管理员岗位
*/
@PreAuthorize("@ss.hasPermi('base:baseCommon:roleList')")
@GetMapping("/queryMangeRole")
public AjaxResult queryMangeRole(SysRole sysRole) {
return AjaxResult.success(zdyBaseuserService.queryManageRole(sysRole));
}
/**
* 获取角色下拉选项
* @param role
* @return
*/
@PreAuthorize("@ss.hasPermi('base:baseCommon:roleList')")
@GetMapping("/roleList")
public AjaxResult roleList(SysRole role) {
return AjaxResult.success(zdyBaseuserService.selectRoleList(role));
}
/**
* 获取部门下拉选项
* @param sysDept
* @return
*/
@PreAuthorize("@ss.hasPermi('base:baseCommon:deptList')")
@GetMapping("/deptList")
public AjaxResult roleList(SysDept sysDept) {
return AjaxResult.success(deptService.selectDeptList(sysDept));
}
}

View File

@@ -0,0 +1,39 @@
package com.zhwl.base.domain;
import com.zhwl.common.annotation.Excel;
import lombok.Data;
import java.io.Serializable;
@Data
public class BaseEmployeeTemplate implements Serializable {
private static final long serialVersionUID = -8753696202187451521L;
/**
* 姓名
*/
@Excel(name = "姓名")
private String name;
/**
* 手机号
*/
@Excel(name = "手机号")
private String phone;
/**
* 身份证号
*/
@Excel(name = "身份证号")
private String idCard;
/**
* 性别
*/
@Excel(name = "性别",dictType = "sys_user_sex",combo = "男,女,未知")
private String sex;
/**
* 公司ID
*/
private Long companyId;
}

View File

@@ -0,0 +1,66 @@
package com.zhwl.base.domain;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zhwl.common.annotation.Excel;
import com.zhwl.common.core.domain.BaseEntity;
/**
* 系统基础模块-公司管理对象 zdy_base_company
*
* @author wangxing
* @date 2024-07-29
*/
@Data
public class ZdyBaseCompany extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private Long id;
/**
* 公司名称
*/
@Excel(name = "公司名称")
private String companyName;
/**
* 部门ID
*/
@Excel(name = "部门ID")
private Long deptId;
/**
* 注册地址
*/
@Excel(name = "注册地址")
private String address;
/**
* 法人姓名
*/
@Excel(name = "法人姓名")
private String legal;
/**
* 联系电话
*/
@Excel(name = "联系电话")
private String phone;
/**
* 企业信用代码
*/
@Excel(name = "企业信用代码")
private String enterpriseCode;
/**
* 营业执照
*/
@Excel(name = "营业执照")
private String businessLicense;
}

View File

@@ -0,0 +1,73 @@
package com.zhwl.base.domain;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zhwl.common.annotation.Excel;
import com.zhwl.common.core.domain.BaseEntity;
/**
* 系统基础模块-员工管理对象 zdy_base_employee
*
* @author wangxing
* @date 2024-07-29
*/
@Data
public class ZdyBaseEmployee extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 所属公司 */
// @Excel(name = "所属公司")
private Long companyId;
/** 所属公司名称 */
@Excel(name = "所属公司")
private String companyName;
/** 员工姓名 */
@Excel(name = "员工姓名")
private String name;
/** 手机号 */
@Excel(name = "手机号")
private String phone;
/** 身份证号 */
@Excel(name = "身份证号")
private String idCard;
/** 员工IC卡 */
@Excel(name = "员工IC卡")
private String cardNo;
/** 员工卡ID */
// @Excel(name = "员工卡ID")
private Long cardId;
/** 性别 */
@Excel(name = "性别",dictType = "sys_user_sex")
private String sex;
/** 职务 */
@Excel(name = "职务")
private String duty;
/** 工号 */
@Excel(name = "工号")
private String jobNumber;
/** 状态(0停用 1启用) */
@Excel(name = "状态",dictType = "employee_status")
private Integer employeeStatus;
/** 性别名称 */
private String sexName;
/** 删除标识(0否 1是) */
private Integer delFlag;
/** 状态(0停用 1启用) */
private String employeeStatusName;
/** 部门ID */
private Long deptId;
}

View File

@@ -0,0 +1,45 @@
package com.zhwl.base.domain;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zhwl.common.annotation.Excel;
import com.zhwl.common.core.domain.BaseEntity;
/**
* 系统基础模块-员工卡管理对象 zdy_base_employee_card
*
* @author wangxing
* @date 2024-07-30
*/
@Data
public class ZdyBaseEmployeeCard extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private Long id;
/**
* 卡号
*/
@Excel(name = "卡号")
private String cardNo;
/**
* 状态(0停用 1启用)
*/
@Excel(name = "状态(0停用 1启用)")
private Integer cardStatus;
/**
* 绑定员工姓名
*/
private String employeeName;
/**
* 部门Id
*/
private Long deptId;
}

View File

@@ -0,0 +1,43 @@
package com.zhwl.base.domain;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zhwl.common.annotation.Excel;
import com.zhwl.common.core.domain.BaseEntity;
/**
* 系统基础模块-员工卡绑定日志管理对象 zdy_base_employee_card_log
*
* @author wangxing
* @date 2024-07-31
*/
@Data
public class ZdyBaseEmployeeCardLog extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private Long id;
/**
* 卡号
*/
@Excel(name = "卡号")
private String cardNo;
/**
* 绑定员工ID
*/
@Excel(name = "绑定员工ID")
private Long employeeId;
/**
* 绑定员工姓名
*/
@Excel(name = "绑定员工姓名")
private String employeeName;
}

View File

@@ -0,0 +1,96 @@
package com.zhwl.base.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zhwl.common.annotation.Excel;
import com.zhwl.common.core.domain.BaseEntity;
/**
* 系统基础模块-线上平台管理对象 zdy_base_online_platform
*
* @author wangxing
* @date 2024-07-29
*/
@Data
public class ZdyBaseOnlinePlatform extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private Long id;
/**
* APPID
*/
@Excel(name = "APPID")
private String appid;
/**
* 景区ID
*/
@Excel(name = "景区ID")
private Long scenicId;
/**
* 小程序名称
*/
@Excel(name = "小程序名称")
private String appName;
/**
* 服务类目
*/
@Excel(name = "服务类目")
private String serviceChannel;
/**
* 主体信息
*/
@Excel(name = "主体信息")
private String bodyInfo;
/**
* 认证状态
*/
@Excel(name = "认证状态")
private String authenticationStatus;
/**
* 小程序备案(0未备案 1已备案)
*/
@Excel(name = "小程序备案(0未备案 1已备案)")
private Integer registrationStatus;
/**
* 首次授权时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "首次授权时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date authorizationTime;
/**
* 二维码
*/
@Excel(name = "二维码")
private String qrCode;
/** 头像 */
@Excel(name = "头像")
private String image;
/**
* 认证状态名称
*/
private String authenticationStatusName;
/**
* 小程序备案名称
*/
private String registrationStatusName;
}

View File

@@ -0,0 +1,48 @@
package com.zhwl.base.domain;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zhwl.common.annotation.Excel;
import com.zhwl.common.core.domain.BaseEntity;
/**
* 系统基础模块-更新包管理对象 zdy_base_package
*
* @author wangxing
* @date 2024-07-29
*/
@Data
public class ZdyBasePackage extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private Long id;
/**
* 版本号
*/
@Excel(name = "版本号")
private String version;
/**
* 更新内容
*/
@Excel(name = "更新内容")
private String content;
/**
* 更新类型
*/
private String updateType;
/**
* 更新包
*/
private String updatePackage;
/**
* 更新类型名称
*/
private String updateTypeName;
}

View File

@@ -0,0 +1,23 @@
package com.zhwl.base.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zhwl.common.core.domain.BaseEntity;
import lombok.Data;
import java.util.Date;
@Data
public class ZdyEmployeeCardGraph extends BaseEntity {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date dataTime;
private String cardNo;
private String deviceName;
private String employeeName;
private String employeePhone;
private Long employeeId;
/** 开关状态3-关门1-开门) */
private Integer openDoor;
private String serial;
}

View File

@@ -0,0 +1,22 @@
package com.zhwl.base.domain;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 员工入园统计返回对象
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ZdyEmployeeEntry {
private String key;
private Long total;
private Long employeeId;
private String employeeName;
private String deviceName;
private String dateTime;
}

View File

@@ -0,0 +1,72 @@
package com.zhwl.base.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zhwl.common.annotation.Excel;
import com.zhwl.common.core.domain.BaseEntity;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.Date;
/**
* 节假日管理对象 zdy_holiday_vacations
*
* @author wangxing
* @date 2024-08-20
*/
@Data
public class ZdyHolidayVacations extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private Long id;
/**
* 节假日名称
*/
@Excel(name = "节假日名称")
private String holidayName;
/**
* 节假日类型
*/
@Excel(name = "节假日类型")
private String holidayType;
/**
* 开始时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date startTime;
/**
* 结束时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date endTime;
/**
* 开始时间
* 根据startTime范围查询参数
*/
private LocalDateTime rangeStartDateTime;
/**
* 结束时间
* 根据startTime范围查询参数
*/
private LocalDateTime rangeEndDateTime;
/**
* 当前日期
*/
private Date nowDate;
/**
* 节假日字典
*/
private String holidayDict;
}

View File

@@ -0,0 +1,119 @@
package com.zhwl.base.domain.dto;
import com.zhwl.common.annotation.Excel;
import com.zhwl.common.annotation.Excel.Type;
import com.zhwl.common.annotation.Excels;
import com.zhwl.common.core.domain.entity.SysDept;
import com.zhwl.common.core.domain.entity.SysRole;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* 用户对象 sys_user
*
* @author ruoyi
*/
@Data
public class SysUserDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 用户类型
*/
private String userType;
/**
* 账号
*/
private String userName;
/**
* 联系人
*/
private String nickName;
/**
* 手机号
*/
private String phonenumber;
/**
* 密码
*/
private String password;
/**
* 创建人
*/
private String createBy;
/**
* 创建时间
*/
private Date createTime;
/**
* 部门ID
*/
private Long deptId;
/**
* 景区用户
*/
private ScenicUser scenicUser;
/**
* 文创商城用户
*/
private WcscUser wcscUser;
/**
* 手机号
*/
private String phone;
/**
* 部门对象
*/
@Excels({
@Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
@Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT)
})
private SysDept dept;
/**
* 角色对象
*/
private List<SysRole> roles;
/**
* 角色组
*/
private Long[] roleIds;
/**
* 帐号状态0正常 1停用
*/
private String status;
@Data
@Accessors(chain = true)
public static class ScenicUser implements Serializable {
private static final long serialVersionUID = 4465376277943307271L;
/**
* 景区名称
*/
private String scenicName;
}
@Data
@Accessors(chain = true)
public static class WcscUser implements Serializable {
private static final long serialVersionUID = 4465376277943307271L;
/**
* 门店名称
*/
private String name;
/**
* 联系人
*/
private String realname;
}
}

View File

@@ -0,0 +1,198 @@
package com.zhwl.base.domain.dto;
import com.alibaba.fastjson2.annotation.JSONField;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 快速创建的小程序的账号基本信息.
*
* @author Hipple
* @since 2019/1/23 14:39
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class WxFastMaAccountBasicInfoResultDTO extends WxOpenResultDTO {
private static final long serialVersionUID = -8713680081353954208L;
/**
* 小程序ID
*/
@JSONField(name = "appid")
private String appId;
/**
* 帐号类型1订阅号2服务号3小程序
*/
@JSONField(name = "account_type")
private Integer accountType;
/**
* 主体类型1企业
*/
@JSONField(name = "principal_type")
private Integer principalType;
/**
* 主体名称
*/
@JSONField(name = "principal_name")
private String principalName;
/**
* 实名验证状态1实名验证成功2实名验证中3实名验证失败调用接口1.1创建帐号时realname_status会初始化为2对于注册方式为微信认证的帐号资质认证成功时realname_status会更新为1 注意当realname_status不为1时帐号只允许调用本文档内的以下API即无权限调用其他API 微信认证相关接口参考2.x 帐号设置相关接口参考3.x
*/
@JSONField(name = "realname_status")
private Integer realnameStatus;
/**
* 小程序名称
*/
@JSONField(name = "nickname")
private String nickname;
/**
* 微信认证信息
*/
@JSONField(name = "wx_verify_info")
private WxVerifyInfo wxVerifyInfo;
/**
* 功能介绍信息
*/
@JSONField(name = "signature_info")
private SignatureInfo signatureInfo;
/**
* 头像信息
*/
@JSONField(name = "head_image_info")
private HeadImageInfo headImageInfo;
/**
* 名称信息
*/
@JSONField(name = "nickname_info")
private NicknameInfo nicknameInfo;
/**
* 注册国家
* <a href="https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/Mini_Program_Basic_Info/Mini_Program_Information_Settings.html#%E6%B3%A8%E5%86%8C%E5%9B%BD%E5%AE%B6">参考链接</a>
*/
@JSONField(name = "registered_country")
private Integer registeredCountry;
/**
* 主体标识,非个人主体时返回的是企业或者政府或其他组织的代号
*/
@JSONField(name = "credential")
private String credential;
/**
* 认证类型如果未完成微信认证则返回0不同枚举值对应的类型说明看下方
* 状态值 说明
* 1 企业
* 2 企业媒体
* 3 政府
* 4 非盈利组织
* 5 民营非企业
* 6 盈利组织
* 8 社会团体
* 9 事业媒体
* 11 事业单位
* 12 个体工商户
* 14 海外企业
*/
@JSONField(name = "customer_type")
private Integer customerType;
@Data
public static class NicknameInfo {
/**
* 小程序名称
*/
@JSONField(name = "nickname")
private String nickname;
/**
* 小程序名称已使用修改次数(本年)
*/
@JSONField(name = "modify_used_count")
private Integer modifyUsedCount;
/**
* 小程序名称修改次数总额度(本年)
*/
@JSONField(name = "modify_quota")
private Integer modifyQuota;
}
@Data
public static class WxVerifyInfo {
/**
* 是否资质认证truefalse若是拥有微信认证相关的权限
*/
@JSONField(name = "qualification_verify")
private Boolean qualificationVerify;
/**
* 是否名称认证truefalse对于公众号订阅号、服务号是名称认证微信客户端才会有微信认证打勾的标识。
*/
@JSONField(name = "naming_verify")
private Boolean namingVerify;
/**
* 是否需要年审truefalsequalification_verify = true时才有该字段
*/
@JSONField(name = "annual_review")
private Boolean annualReview;
/**
* 年审开始时间时间戳qualification_verify = true时才有该字段
*/
@JSONField(name = "annual_review_begin_time")
private String annualReviewBeginTime;
/**
* 年审截止时间时间戳qualification_verify = true时才有该字段
*/
@JSONField(name = "annual_review_end_time")
private String annualReviewEndTime;
}
@Data
public static class SignatureInfo {
/**
* 功能介绍
*/
@JSONField(name = "signature")
private String signature;
/**
* 头像已使用修改次数(本月)
*/
@JSONField(name = "modify_used_count")
private Integer modifyUsedCount;
/**
* 头像修改次数总额度(本月)
*/
@JSONField(name = "modify_quota")
private Integer modifyQuota;
}
@Data
public static class HeadImageInfo {
/**
* 头像url
*/
@JSONField(name = "head_image_url")
private String headImageUrl;
/**
* 头像已使用修改次数(本月)
*/
@JSONField(name = "modify_used_count")
private Integer modifyUsedCount;
/**
* 头像修改次数总额度(本月)
*/
@JSONField(name = "modify_quota")
private Integer modifyQuota;
}
}

View File

@@ -0,0 +1,77 @@
package com.zhwl.base.domain.dto;
import com.alibaba.fastjson2.annotation.JSONField;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.List;
/**
* 获取小程序已经设置的类目结果类.
*
* @author song_xiaowei
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class WxFastMaBeenSetCategoryResultDTO extends WxOpenResultDTO {
private static final long serialVersionUID = -7662344448437700644L;
/**
* 一个更改周期内可以设置类目的次数
*/
@JSONField(name = "limit")
private Integer limit;
/**
* 本更改周期内还可以设置类目的次数
*/
@JSONField(name = "quota")
private Integer quota;
/**
* 最多可以设置的类目数量
*/
@JSONField(name = "category_limit")
private Integer categoryLimit;
/**
* 类目
*/
@JSONField(name = "categories")
private List<CategoriesBean> categories;
@Data
public static class CategoriesBean implements Serializable {
private static final long serialVersionUID = -7662344448437700644L;
/**
* 一级类目ID
*/
@JSONField(name = "first")
private int first;
/**
* 一级类目名称
*/
@JSONField(name = "first_name")
private String firstName;
/**
* 二级类目ID
*/
@JSONField(name = "second")
private int second;
/**
* 二级类目名称
*/
@JSONField(name = "second_name")
private String secondName;
/**
* 审核状态1审核中 2审核不通过 3审核通过
*/
@JSONField(name = "audit_status")
private int auditStatus;
/**
* 审核不通过原因
*/
@JSONField(name = "audit_reason")
private String auditReason;
}
}

View File

@@ -0,0 +1,83 @@
package com.zhwl.base.domain.dto;
import com.alibaba.fastjson2.annotation.JSONField;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.List;
/**
* 获取小程序备案状态
*
* @author song_xiaowei
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class WxFastMaIcpEntranceInfoResultDTO extends WxOpenResultDTO {
private static final long serialVersionUID = -7662344448437700644L;
/**
* 已备案状态
*/
public static final int STATUS_ALREADY_REGISTERED = 6;
/**
* 备案状态信息
*/
@JSONField(name = "info")
private IcpEntranceInfo info;
@Data
public static class IcpEntranceInfo implements Serializable {
private static final long serialVersionUID = -7662344448437700644L;
/**
* 备案状态取值参考备案状态枚举示例值1024
*/
@JSONField(name = "status")
private int status;
/**
* 是否正在注销备案
*/
@JSONField(name = "is_canceling")
private boolean canceling;
/**
* 驳回原因,备案不通过时返回
*/
@JSONField(name = "audit_data")
private List<AuditDataInfo> auditData;
/**
* 备案入口是否对该小程序开放0不开放1开放。特定情况下入口不会开放如小程序昵称包含某些关键词时、管局系统不可用时
* 当备案入口开放时才能提交备案申请。
*/
@JSONField(name = "available")
private int available;
/**
* 管局短信核验状态,仅当备案状态为 4管局审核中的时候才有效。1等待核验中2核验完成3核验超时。
*/
@JSONField(name = "sms_verify_status")
private int smsVerifyStatus;
}
@Data
public static class AuditDataInfo implements Serializable {
private static final long serialVersionUID = -7662344448437700644L;
/**
* 审核不通过的字段中文名
*/
@JSONField(name = "key_name")
private String keyName;
/**
* 字段不通过的原因
*/
@JSONField(name = "error")
private String error;
/**
* 修改建议
*/
@JSONField(name = "suggest")
private String suggest;
}
}

View File

@@ -0,0 +1,28 @@
package com.zhwl.base.domain.dto;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import java.io.Serializable;
import static com.zhwl.common.constant.Constants.SUCCESS;
/**
* 基础的微信开放平台请求结果.
*
* @author yqx
* created on 2018/10/1
*/
@Data
public class WxOpenResultDTO implements Serializable {
private static final long serialVersionUID = 2101652152604850904L;
protected String errcode;
protected String errmsg;
/**
* 请求是否成功.
*/
public boolean isSuccess() {
return StringUtils.equalsIgnoreCase(errcode, SUCCESS);
}
}

View File

@@ -0,0 +1,51 @@
package com.zhwl.base.enums;
import java.util.Arrays;
import java.util.Objects;
import java.util.Optional;
/**
* @Author wangxing
* @description: 节假日分类
*/
public enum HolidayVacationEnum {
NEW_YEARS_DAY("元旦", "2"),
SPRING_FESTIVAL("春节", "1"),
TOMB_SWEEPING_DAY("清明节", "1"),
LABOUR_DAY("劳动节", "2"),
LOONG_BOAT_FESTIVAL("端午节", "1"),
NATIONAL_DAY( "国庆节", "2"),
MOON_FESTIVAL( "中秋节", "1");
private String name;
/**
* 存储状态
*/
private String holidayVacationType;
HolidayVacationEnum(String name, String holidayVacationType) {
this.name = name;
this.holidayVacationType = holidayVacationType;
}
public String getName() {
return name;
}
public String getHolidayVacationType() {
return holidayVacationType;
}
public static String getHolidayVacationTypeByName(String name) {
for (HolidayVacationEnum holidayVacationEnum:HolidayVacationEnum.values()) {
if(Objects.equals(holidayVacationEnum.getName(),name)){
return holidayVacationEnum.getHolidayVacationType();
}
}
return null;
}
}

View File

@@ -0,0 +1,17 @@
package com.zhwl.base.enums;
import lombok.Getter;
/**
* 微信小程序码用途
*
* @author song_xiaowei
*/
@Getter
public enum WxaQrCodePurposeEnum {
/**
* 基础信息
*/
BASE;
}

View File

@@ -0,0 +1,65 @@
package com.zhwl.base.mapper;
import java.util.List;
import com.zhwl.base.domain.ZdyBaseCompany;
/**
* 系统基础模块-公司管理Mapper接口
*
* @author wangxing
* @date 2024-07-29
*/
public interface ZdyBaseCompanyMapper {
/**
* 查询系统基础模块-公司管理
*
* @param id 系统基础模块-公司管理主键
* @return 系统基础模块-公司管理
*/
public ZdyBaseCompany selectZdyBaseCompanyById(Long id);
/**
* 查询系统基础模块-公司管理列表
*
* @param zdyBaseCompany 系统基础模块-公司管理
* @return 系统基础模块-公司管理集合
*/
public List<ZdyBaseCompany> selectZdyBaseCompanyList(ZdyBaseCompany zdyBaseCompany);
/**
* 新增系统基础模块-公司管理
*
* @param zdyBaseCompany 系统基础模块-公司管理
* @return 结果
*/
public int insertZdyBaseCompany(ZdyBaseCompany zdyBaseCompany);
/**
* 修改系统基础模块-公司管理
*
* @param zdyBaseCompany 系统基础模块-公司管理
* @return 结果
*/
public int updateZdyBaseCompany(ZdyBaseCompany zdyBaseCompany);
/**
* 删除系统基础模块-公司管理
*
* @param id 系统基础模块-公司管理主键
* @return 结果
*/
public int deleteZdyBaseCompanyById(Long id);
/**
* 批量删除系统基础模块-公司管理
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteZdyBaseCompanyByIds(Long[] ids);
public int updateZdyBaseCompanyByDeptId(ZdyBaseCompany zdyBaseCompany);
public ZdyBaseCompany selectZdyBaseCompanyByDeptId(Long deptId);
public int countByCompanyName(String companyName);
}

View File

@@ -0,0 +1,61 @@
package com.zhwl.base.mapper;
import java.util.List;
import com.zhwl.base.domain.ZdyBaseEmployeeCardLog;
/**
* 系统基础模块-员工卡绑定日志管理Mapper接口
*
* @author wangxing
* @date 2024-07-31
*/
public interface ZdyBaseEmployeeCardLogMapper {
/**
* 查询系统基础模块-员工卡绑定日志管理
*
* @param id 系统基础模块-员工卡绑定日志管理主键
* @return 系统基础模块-员工卡绑定日志管理
*/
public ZdyBaseEmployeeCardLog selectZdyBaseEmployeeCardLogById(Long id);
/**
* 查询系统基础模块-员工卡绑定日志管理列表
*
* @param zdyBaseEmployeeCardLog 系统基础模块-员工卡绑定日志管理
* @return 系统基础模块-员工卡绑定日志管理集合
*/
public List<ZdyBaseEmployeeCardLog> selectZdyBaseEmployeeCardLogList(ZdyBaseEmployeeCardLog zdyBaseEmployeeCardLog);
/**
* 新增系统基础模块-员工卡绑定日志管理
*
* @param zdyBaseEmployeeCardLog 系统基础模块-员工卡绑定日志管理
* @return 结果
*/
public int insertZdyBaseEmployeeCardLog(ZdyBaseEmployeeCardLog zdyBaseEmployeeCardLog);
/**
* 修改系统基础模块-员工卡绑定日志管理
*
* @param zdyBaseEmployeeCardLog 系统基础模块-员工卡绑定日志管理
* @return 结果
*/
public int updateZdyBaseEmployeeCardLog(ZdyBaseEmployeeCardLog zdyBaseEmployeeCardLog);
/**
* 删除系统基础模块-员工卡绑定日志管理
*
* @param id 系统基础模块-员工卡绑定日志管理主键
* @return 结果
*/
public int deleteZdyBaseEmployeeCardLogById(Long id);
/**
* 批量删除系统基础模块-员工卡绑定日志管理
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteZdyBaseEmployeeCardLogByIds(Long[] ids);
}

View File

@@ -0,0 +1,68 @@
package com.zhwl.base.mapper;
import java.util.List;
import com.zhwl.base.domain.ZdyBaseEmployeeCard;
/**
* 系统基础模块-员工卡管理Mapper接口
*
* @author wangxing
* @date 2024-07-30
*/
public interface ZdyBaseEmployeeCardMapper {
/**
* 查询系统基础模块-员工卡管理
*
* @param id 系统基础模块-员工卡管理主键
* @return 系统基础模块-员工卡管理
*/
public ZdyBaseEmployeeCard selectZdyBaseEmployeeCardById(Long id);
/**
* 查询系统基础模块-员工卡管理列表
*
* @param zdyBaseEmployeeCard 系统基础模块-员工卡管理
* @return 系统基础模块-员工卡管理集合
*/
public List<ZdyBaseEmployeeCard> selectZdyBaseEmployeeCardList(ZdyBaseEmployeeCard zdyBaseEmployeeCard);
/**
* 新增系统基础模块-员工卡管理
*
* @param zdyBaseEmployeeCard 系统基础模块-员工卡管理
* @return 结果
*/
public int insertZdyBaseEmployeeCard(ZdyBaseEmployeeCard zdyBaseEmployeeCard);
/**
* 修改系统基础模块-员工卡管理
*
* @param zdyBaseEmployeeCard 系统基础模块-员工卡管理
* @return 结果
*/
public int updateZdyBaseEmployeeCard(ZdyBaseEmployeeCard zdyBaseEmployeeCard);
/**
* 删除系统基础模块-员工卡管理
*
* @param id 系统基础模块-员工卡管理主键
* @return 结果
*/
public int deleteZdyBaseEmployeeCardById(Long id);
/**
* 批量删除系统基础模块-员工卡管理
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteZdyBaseEmployeeCardByIds(Long[] ids);
/**
* 查询系统基础模块-员工卡管理
*
* @param cardNo
* @return 系统基础模块-员工卡管理
*/
public ZdyBaseEmployeeCard selectZdyBaseEmployeeCardByCardNo(String cardNo);
}

View File

@@ -0,0 +1,82 @@
package com.zhwl.base.mapper;
import com.zhwl.base.domain.ZdyBaseEmployee;
import com.zhwl.base.domain.ZdyEmployeeCardGraph;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 系统基础模块-员工管理Mapper接口
*
* @author wangxing
* @date 2024-07-29
*/
public interface ZdyBaseEmployeeMapper {
/**
* 查询系统基础模块-员工管理
*
* @param id 系统基础模块-员工管理主键
* @return 系统基础模块-员工管理
*/
public ZdyBaseEmployee selectZdyBaseEmployeeById(Long id);
/**
* 查询系统基础模块-员工管理列表
*
* @param zdyBaseEmployee 系统基础模块-员工管理
* @return 系统基础模块-员工管理集合
*/
public List<ZdyBaseEmployee> selectZdyBaseEmployeeList(ZdyBaseEmployee zdyBaseEmployee);
/**
* 新增系统基础模块-员工管理
*
* @param zdyBaseEmployee 系统基础模块-员工管理
* @return 结果
*/
public int insertZdyBaseEmployee(ZdyBaseEmployee zdyBaseEmployee);
/**
* 修改系统基础模块-员工管理
*
* @param zdyBaseEmployee 系统基础模块-员工管理
* @return 结果
*/
public int updateZdyBaseEmployee(ZdyBaseEmployee zdyBaseEmployee);
/**
* 删除系统基础模块-员工管理
*
* @param id 系统基础模块-员工管理主键
* @return 结果
*/
public int deleteZdyBaseEmployeeById(Long id);
/**
* 批量删除系统基础模块-员工管理
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteZdyBaseEmployeeByIds(Long[] ids);
/**
* 查询系统基础模块-手机号和身份证查询员工信息
* @return 系统基础模块-员工管理
*/
public ZdyBaseEmployee selectEmployeeByIdCardAndPhone(@Param("idCard") String idCard, @Param("phone") String phone);
/**
* 查询系统基础模块-卡号
* @return 系统基础模块-员工管理
*/
public ZdyBaseEmployee selectZdyBaseEmployeeByCardNo(String cardNo);
/**
* 查询员工刷卡记录明细
*
* @param zdyEmployeeCardGraph
* @return
*/
List<ZdyEmployeeCardGraph> selectZdyEmployeeCardGraphList(ZdyEmployeeCardGraph zdyEmployeeCardGraph);
}

View File

@@ -0,0 +1,63 @@
package com.zhwl.base.mapper;
import com.zhwl.base.domain.ZdyBaseOnlinePlatform;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 系统基础模块-线上平台管理Mapper接口
*
* @author wangxing
* @date 2024-07-29
*/
@Mapper
public interface ZdyBaseOnlinePlatformMapper {
/**
* 查询系统基础模块-线上平台管理
*
* @param id 系统基础模块-线上平台管理主键
* @return 系统基础模块-线上平台管理
*/
public ZdyBaseOnlinePlatform selectZdyBaseOnlinePlatformById(Long id);
/**
* 查询系统基础模块-线上平台管理列表
*
* @param zdyBaseOnlinePlatform 系统基础模块-线上平台管理
* @return 系统基础模块-线上平台管理集合
*/
public List<ZdyBaseOnlinePlatform> selectZdyBaseOnlinePlatformList(ZdyBaseOnlinePlatform zdyBaseOnlinePlatform);
/**
* 新增系统基础模块-线上平台管理
*
* @param zdyBaseOnlinePlatform 系统基础模块-线上平台管理
* @return 结果
*/
public int insertZdyBaseOnlinePlatform(ZdyBaseOnlinePlatform zdyBaseOnlinePlatform);
/**
* 修改系统基础模块-线上平台管理
*
* @param zdyBaseOnlinePlatform 系统基础模块-线上平台管理
* @return 结果
*/
public int updateZdyBaseOnlinePlatform(ZdyBaseOnlinePlatform zdyBaseOnlinePlatform);
/**
* 删除系统基础模块-线上平台管理
*
* @param id 系统基础模块-线上平台管理主键
* @return 结果
*/
public int deleteZdyBaseOnlinePlatformById(Long id);
/**
* 批量删除系统基础模块-线上平台管理
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteZdyBaseOnlinePlatformByIds(Long[] ids);
}

View File

@@ -0,0 +1,64 @@
package com.zhwl.base.mapper;
import java.util.List;
import com.zhwl.base.domain.ZdyBasePackage;
import org.apache.ibatis.annotations.Param;
/**
* 系统基础模块-更新包管理Mapper接口
*
* @author wangxing
* @date 2024-07-29
*/
public interface ZdyBasePackageMapper {
/**
* 查询系统基础模块-更新包管理
*
* @param id 系统基础模块-更新包管理主键
* @return 系统基础模块-更新包管理
*/
public ZdyBasePackage selectZdyBasePackageById(Long id);
/**
* 查询系统基础模块-更新包管理列表
*
* @param zdyBasePackage 系统基础模块-更新包管理
* @return 系统基础模块-更新包管理集合
*/
public List<ZdyBasePackage> selectZdyBasePackageList(ZdyBasePackage zdyBasePackage);
/**
* 新增系统基础模块-更新包管理
*
* @param zdyBasePackage 系统基础模块-更新包管理
* @return 结果
*/
public int insertZdyBasePackage(ZdyBasePackage zdyBasePackage);
/**
* 修改系统基础模块-更新包管理
*
* @param zdyBasePackage 系统基础模块-更新包管理
* @return 结果
*/
public int updateZdyBasePackage(ZdyBasePackage zdyBasePackage);
/**
* 删除系统基础模块-更新包管理
*
* @param id 系统基础模块-更新包管理主键
* @return 结果
*/
public int deleteZdyBasePackageById(Long id);
/**
* 批量删除系统基础模块-更新包管理
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteZdyBasePackageByIds(Long[] ids);
public ZdyBasePackage selectZdyBasePackage(@Param("updateType") String updateType, @Param("version") String version);
}

View File

@@ -0,0 +1,78 @@
package com.zhwl.base.mapper;
import java.util.Date;
import java.util.List;
import com.zhwl.base.domain.ZdyHolidayVacations;
import org.apache.ibatis.annotations.Param;
/**
* 节假日管理Mapper接口
*
* @author wangxing
* @date 2024-08-20
*/
public interface ZdyHolidayVacationsMapper {
/**
* 查询节假日管理
*
* @param id 节假日管理主键
* @return 节假日管理
*/
public ZdyHolidayVacations selectZdyHolidayVacationsById(Long id);
/**
* 查询节假日管理列表
*
* @param zdyHolidayVacations 节假日管理
* @return 节假日管理集合
*/
public List<ZdyHolidayVacations> selectZdyHolidayVacationsList(ZdyHolidayVacations zdyHolidayVacations);
/**
* 新增节假日管理
*
* @param zdyHolidayVacations 节假日管理
* @return 结果
*/
public int insertZdyHolidayVacations(ZdyHolidayVacations zdyHolidayVacations);
/**
* 修改节假日管理
*
* @param zdyHolidayVacations 节假日管理
* @return 结果
*/
public int updateZdyHolidayVacations(ZdyHolidayVacations zdyHolidayVacations);
/**
* 删除节假日管理
*
* @param id 节假日管理主键
* @return 结果
*/
public int deleteZdyHolidayVacationsById(Long id);
/**
* 批量删除节假日管理
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteZdyHolidayVacationsByIds(Long[] ids);
/**
* 删除节假日管理
*
* @param
* @return 结果
*/
public int deleteZdyHolidayVacationsByHolidayType();
/**
* 查询指定日期是否是法定节假日
*
* @param queryDate
* @return 节假日管理
*/
public ZdyHolidayVacations selectByQueryDate(@Param("queryDate") Date queryDate);
}

View File

@@ -0,0 +1,68 @@
package com.zhwl.base.service;
import java.util.List;
import com.zhwl.base.domain .ZdyBaseCompany;
/**
* 系统基础模块-公司管理Service接口
*
* @author wangxing
* @date 2024-07-29
*/
public interface IZdyBaseCompanyService {
/**
* 查询系统基础模块-公司管理
*
* @param id 系统基础模块-公司管理主键
* @return 系统基础模块-公司管理
*/
public ZdyBaseCompany selectZdyBaseCompanyById(Long id);
/**
* 查询系统基础模块-公司管理列表
*
* @param zdyBaseCompany 系统基础模块-公司管理
* @return 系统基础模块-公司管理集合
*/
public List<ZdyBaseCompany> selectZdyBaseCompanyList(ZdyBaseCompany zdyBaseCompany);
/**
* 新增系统基础模块-公司管理
*
* @param zdyBaseCompany 系统基础模块-公司管理
* @return 结果
*/
public int insertZdyBaseCompany(ZdyBaseCompany zdyBaseCompany);
/**
* 修改系统基础模块-公司管理
*
* @param zdyBaseCompany 系统基础模块-公司管理
* @return 结果
*/
public int updateZdyBaseCompany(ZdyBaseCompany zdyBaseCompany);
/**
* 批量删除系统基础模块-公司管理
*
* @param ids 需要删除的系统基础模块-公司管理主键集合
* @return 结果
*/
public int deleteZdyBaseCompanyByIds(Long[] ids);
/**
* 删除系统基础模块-公司管理信息
*
* @param id 系统基础模块-公司管理主键
* @return 结果
*/
public int deleteZdyBaseCompanyById(Long id);
/**
* 查询系统基础模块-公司管理
*
* @param deptId
* @return 系统基础模块-公司管理
*/
public ZdyBaseCompany selectZdyBaseCompanyByDeptId(Long deptId);
}

View File

@@ -0,0 +1,61 @@
package com.zhwl.base.service;
import java.util.List;
import com.zhwl.base.domain .ZdyBaseEmployeeCardLog;
/**
* 系统基础模块-员工卡绑定日志管理Service接口
*
* @author wangxing
* @date 2024-07-31
*/
public interface IZdyBaseEmployeeCardLogService {
/**
* 查询系统基础模块-员工卡绑定日志管理
*
* @param id 系统基础模块-员工卡绑定日志管理主键
* @return 系统基础模块-员工卡绑定日志管理
*/
public ZdyBaseEmployeeCardLog selectZdyBaseEmployeeCardLogById(Long id);
/**
* 查询系统基础模块-员工卡绑定日志管理列表
*
* @param zdyBaseEmployeeCardLog 系统基础模块-员工卡绑定日志管理
* @return 系统基础模块-员工卡绑定日志管理集合
*/
public List<ZdyBaseEmployeeCardLog> selectZdyBaseEmployeeCardLogList(ZdyBaseEmployeeCardLog zdyBaseEmployeeCardLog);
/**
* 新增系统基础模块-员工卡绑定日志管理
*
* @param zdyBaseEmployeeCardLog 系统基础模块-员工卡绑定日志管理
* @return 结果
*/
public int insertZdyBaseEmployeeCardLog(ZdyBaseEmployeeCardLog zdyBaseEmployeeCardLog);
/**
* 修改系统基础模块-员工卡绑定日志管理
*
* @param zdyBaseEmployeeCardLog 系统基础模块-员工卡绑定日志管理
* @return 结果
*/
public int updateZdyBaseEmployeeCardLog(ZdyBaseEmployeeCardLog zdyBaseEmployeeCardLog);
/**
* 批量删除系统基础模块-员工卡绑定日志管理
*
* @param ids 需要删除的系统基础模块-员工卡绑定日志管理主键集合
* @return 结果
*/
public int deleteZdyBaseEmployeeCardLogByIds(Long[] ids);
/**
* 删除系统基础模块-员工卡绑定日志管理信息
*
* @param id 系统基础模块-员工卡绑定日志管理主键
* @return 结果
*/
public int deleteZdyBaseEmployeeCardLogById(Long id);
}

View File

@@ -0,0 +1,61 @@
package com.zhwl.base.service;
import java.util.List;
import com.zhwl.base.domain .ZdyBaseEmployeeCard;
/**
* 系统基础模块-员工卡管理Service接口
*
* @author wangxing
* @date 2024-07-30
*/
public interface IZdyBaseEmployeeCardService {
/**
* 查询系统基础模块-员工卡管理
*
* @param id 系统基础模块-员工卡管理主键
* @return 系统基础模块-员工卡管理
*/
public ZdyBaseEmployeeCard selectZdyBaseEmployeeCardById(Long id);
/**
* 查询系统基础模块-员工卡管理列表
*
* @param zdyBaseEmployeeCard 系统基础模块-员工卡管理
* @return 系统基础模块-员工卡管理集合
*/
public List<ZdyBaseEmployeeCard> selectZdyBaseEmployeeCardList(ZdyBaseEmployeeCard zdyBaseEmployeeCard);
/**
* 新增系统基础模块-员工卡管理
*
* @param zdyBaseEmployeeCard 系统基础模块-员工卡管理
* @return 结果
*/
public int insertZdyBaseEmployeeCard(ZdyBaseEmployeeCard zdyBaseEmployeeCard);
/**
* 修改系统基础模块-员工卡管理
*
* @param zdyBaseEmployeeCard 系统基础模块-员工卡管理
* @return 结果
*/
public int updateZdyBaseEmployeeCard(ZdyBaseEmployeeCard zdyBaseEmployeeCard);
/**
* 批量删除系统基础模块-员工卡管理
*
* @param ids 需要删除的系统基础模块-员工卡管理主键集合
* @return 结果
*/
public int deleteZdyBaseEmployeeCardByIds(Long[] ids);
/**
* 删除系统基础模块-员工卡管理信息
*
* @param id 系统基础模块-员工卡管理主键
* @return 结果
*/
public int deleteZdyBaseEmployeeCardById(Long id);
}

View File

@@ -0,0 +1,98 @@
package com.zhwl.base.service;
import com.zhwl.base.domain.BaseEmployeeTemplate;
import com.zhwl.base.domain.ZdyBaseEmployee;
import com.zhwl.base.domain.ZdyEmployeeCardGraph;
import com.zhwl.common.core.page.TableDataInfo;
import java.util.List;
/**
* 系统基础模块-员工管理Service接口
*
* @author wangxing
* @date 2024-07-29
*/
public interface IZdyBaseEmployeeService {
/**
* 查询系统基础模块-员工管理
*
* @param id 系统基础模块-员工管理主键
* @return 系统基础模块-员工管理
*/
public ZdyBaseEmployee selectZdyBaseEmployeeById(Long id);
/**
* 查询系统基础模块-员工管理列表
*
* @param zdyBaseEmployee 系统基础模块-员工管理
* @return 系统基础模块-员工管理集合
*/
public List<ZdyBaseEmployee> selectZdyBaseEmployeeList(ZdyBaseEmployee zdyBaseEmployee);
/**
* 新增系统基础模块-员工管理
*
* @param zdyBaseEmployee 系统基础模块-员工管理
* @return 结果
*/
public int insertZdyBaseEmployee(ZdyBaseEmployee zdyBaseEmployee);
/**
* 修改系统基础模块-员工管理
*
* @param zdyBaseEmployee 系统基础模块-员工管理
* @return 结果
*/
public int updateZdyBaseEmployee(ZdyBaseEmployee zdyBaseEmployee);
/**
* 批量删除系统基础模块-员工管理
*
* @param ids 需要删除的系统基础模块-员工管理主键集合
* @return 结果
*/
public int deleteZdyBaseEmployeeByIds(Long[] ids);
/**
* 删除系统基础模块-员工管理信息
*
* @param id 系统基础模块-员工管理主键
* @return 结果
*/
public int deleteZdyBaseEmployeeById(Long id);
/**
* 员工导入
* @param employeeList
* @return
*/
List<BaseEmployeeTemplate> importData(List<BaseEmployeeTemplate> employeeList);
/**
* 修改系统基础模块-员工启用/禁用
*
* @param zdyBaseEmployee 系统基础模块-员工管理
* @return 结果
*/
public boolean checkEmployee(ZdyBaseEmployee zdyBaseEmployee);
/**
* 员工刷卡明细
*
* @param zdyEmployeeCardGraph
* @return
*/
List<ZdyEmployeeCardGraph> getEmployeeCardList(ZdyEmployeeCardGraph zdyEmployeeCardGraph);
/**
* 员工入园刷卡统计
*
* @param zdyEmployeeCardGraph
* @param pageNum
* @param pageSize
* @return
*/
TableDataInfo getEmployeeEntryList(ZdyEmployeeCardGraph zdyEmployeeCardGraph, int pageNum, int pageSize);
}

View File

@@ -0,0 +1,61 @@
package com.zhwl.base.service;
import java.util.List;
import com.zhwl.base.domain .ZdyBaseOnlinePlatform;
/**
* 系统基础模块-线上平台管理Service接口
*
* @author wangxing
* @date 2024-07-29
*/
public interface IZdyBaseOnlinePlatformService {
/**
* 查询系统基础模块-线上平台管理
*
* @param id 系统基础模块-线上平台管理主键
* @return 系统基础模块-线上平台管理
*/
public ZdyBaseOnlinePlatform selectZdyBaseOnlinePlatformById(Long id);
/**
* 查询系统基础模块-线上平台管理列表
*
* @param zdyBaseOnlinePlatform 系统基础模块-线上平台管理
* @return 系统基础模块-线上平台管理集合
*/
public List<ZdyBaseOnlinePlatform> selectZdyBaseOnlinePlatformList(ZdyBaseOnlinePlatform zdyBaseOnlinePlatform);
/**
* 新增系统基础模块-线上平台管理
*
* @param zdyBaseOnlinePlatform 系统基础模块-线上平台管理
* @return 结果
*/
public int insertZdyBaseOnlinePlatform(ZdyBaseOnlinePlatform zdyBaseOnlinePlatform);
/**
* 修改系统基础模块-线上平台管理
*
* @param zdyBaseOnlinePlatform 系统基础模块-线上平台管理
* @return 结果
*/
public int updateZdyBaseOnlinePlatform(ZdyBaseOnlinePlatform zdyBaseOnlinePlatform);
/**
* 批量删除系统基础模块-线上平台管理
*
* @param ids 需要删除的系统基础模块-线上平台管理主键集合
* @return 结果
*/
public int deleteZdyBaseOnlinePlatformByIds(Long[] ids);
/**
* 删除系统基础模块-线上平台管理信息
*
* @param id 系统基础模块-线上平台管理主键
* @return 结果
*/
public int deleteZdyBaseOnlinePlatformById(Long id);
}

View File

@@ -0,0 +1,61 @@
package com.zhwl.base.service;
import java.util.List;
import com.zhwl.base.domain .ZdyBasePackage;
/**
* 系统基础模块-更新包管理Service接口
*
* @author wangxing
* @date 2024-07-29
*/
public interface IZdyBasePackageService {
/**
* 查询系统基础模块-更新包管理
*
* @param id 系统基础模块-更新包管理主键
* @return 系统基础模块-更新包管理
*/
public ZdyBasePackage selectZdyBasePackageById(Long id);
/**
* 查询系统基础模块-更新包管理列表
*
* @param zdyBasePackage 系统基础模块-更新包管理
* @return 系统基础模块-更新包管理集合
*/
public List<ZdyBasePackage> selectZdyBasePackageList(ZdyBasePackage zdyBasePackage);
/**
* 新增系统基础模块-更新包管理
*
* @param zdyBasePackage 系统基础模块-更新包管理
* @return 结果
*/
public int insertZdyBasePackage(ZdyBasePackage zdyBasePackage);
/**
* 修改系统基础模块-更新包管理
*
* @param zdyBasePackage 系统基础模块-更新包管理
* @return 结果
*/
public int updateZdyBasePackage(ZdyBasePackage zdyBasePackage);
/**
* 批量删除系统基础模块-更新包管理
*
* @param ids 需要删除的系统基础模块-更新包管理主键集合
* @return 结果
*/
public int deleteZdyBasePackageByIds(Long[] ids);
/**
* 删除系统基础模块-更新包管理信息
*
* @param id 系统基础模块-更新包管理主键
* @return 结果
*/
public int deleteZdyBasePackageById(Long id);
}

View File

@@ -0,0 +1,60 @@
package com.zhwl.base.service;
import com.zhwl.common.core.domain.entity.SysRole;
import com.zhwl.system.domain.dto.BaseUserDTO;
import java.util.List;
/**
* 系统基础模块-公司管理Service接口
*
* @author wangxing
* @date 2024-07-29
*/
public interface IZdyBaseUserService {
/**
* 添加员工
*
* @param baseUserDTO
* @return 结果
*/
public void addUser(BaseUserDTO baseUserDTO);
/**
* 修改岗位
* @param sysRole
* @return
*/
public int editRole(SysRole sysRole);
/**
* 添加岗位
* @param sysRole
* @return
*/
public int addRole(SysRole sysRole);
/**
* 添加管理员岗位
* @param sysRole
* @return
*/
public List<SysRole> queryManageRole(SysRole sysRole);
public List<SysRole> selectRoleList(SysRole sysRole);
/**
* 校验角色名称是否唯一
*
* @param
* @return 角色信息
*/
public boolean checkRoleNameUniqueDept(SysRole sysRole);
/**
* 校验角色权限是否唯一
*
* @param
* @return 角色信息
*/
public boolean checkRoleKeyUniqueDept(SysRole sysRole);
}

View File

@@ -0,0 +1,75 @@
package com.zhwl.base.service;
import com.zhwl.base.domain.ZdyHolidayVacations;
import java.util.List;
/**
* 节假日管理Service接口
*
* @author wangxing
* @date 2024-08-20
*/
public interface IZdyHolidayVacationsService {
/**
* 查询节假日管理
*
* @param id 节假日管理主键
* @return 节假日管理
*/
public ZdyHolidayVacations selectZdyHolidayVacationsById(Long id);
/**
* 查询节假日管理列表
*
* @param zdyHolidayVacations 节假日管理
* @return 节假日管理集合
*/
public List<ZdyHolidayVacations> selectZdyHolidayVacationsList(ZdyHolidayVacations zdyHolidayVacations);
/**
* 新增节假日管理
*
* @param zdyHolidayVacations 节假日管理
* @return 结果
*/
public int insertZdyHolidayVacations(ZdyHolidayVacations zdyHolidayVacations);
/**
* 修改节假日管理
*
* @param zdyHolidayVacations 节假日管理
* @return 结果
*/
public int updateZdyHolidayVacations(ZdyHolidayVacations zdyHolidayVacations);
/**
* 批量删除节假日管理
*
* @param ids 需要删除的节假日管理主键集合
* @return 结果
*/
public int deleteZdyHolidayVacationsByIds(Long[] ids);
/**
* 删除节假日管理信息
*
* @param id 节假日管理主键
* @return 结果
*/
public int deleteZdyHolidayVacationsById(Long id);
/**
* 同步节假日管理信息
*/
public void syncHolidayVacations(String year);
/**
* 获取指定年份的节假日列表
*
* @param year 年份
* @param zdyHolidayVacations 查询参数
* @return 节假日列表
*/
List<ZdyHolidayVacations> holidayListByYear(int year, ZdyHolidayVacations zdyHolidayVacations);
}

View File

@@ -0,0 +1,142 @@
package com.zhwl.base.service.impl;
import java.util.List;
import java.util.Objects;
import com.zhwl.common.core.domain.entity.SysDept;
import com.zhwl.common.exception.ServiceException;
import com.zhwl.common.utils.DataOperateCommonUtils;
import com.zhwl.system.mapper.SysDeptMapper;
import com.zhwl.system.service.ParentBaseCompanyService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import com.zhwl.base.mapper.ZdyBaseCompanyMapper;
import com.zhwl.base.domain.ZdyBaseCompany;
import com.zhwl.base.service.IZdyBaseCompanyService;
import org.springframework.transaction.annotation.Transactional;
/**
* 系统基础模块-公司管理Service业务层处理
*
* @author wangxing
* @date 2024-07-29
*/
@Service
@RequiredArgsConstructor
public class ZdyBaseCompanyServiceImpl implements IZdyBaseCompanyService, ParentBaseCompanyService {
private final ZdyBaseCompanyMapper zdyBaseCompanyMapper;
private final SysDeptMapper sysDeptMapper;
/**
* 查询系统基础模块-公司管理
*
* @param id 系统基础模块-公司管理主键
* @return 系统基础模块-公司管理
*/
@Override
public ZdyBaseCompany selectZdyBaseCompanyById(Long id) {
return zdyBaseCompanyMapper.selectZdyBaseCompanyById(id);
}
/**
* 查询系统基础模块-公司管理列表
*
* @param zdyBaseCompany 系统基础模块-公司管理
* @return 系统基础模块-公司管理
*/
@Override
public List<ZdyBaseCompany> selectZdyBaseCompanyList(ZdyBaseCompany zdyBaseCompany) {
return zdyBaseCompanyMapper.selectZdyBaseCompanyList(zdyBaseCompany);
}
/**
* 新增系统基础模块-公司管理
*
* @param zdyBaseCompany 系统基础模块-公司管理
* @return 结果
*/
@Override
public int insertZdyBaseCompany(ZdyBaseCompany zdyBaseCompany) {
DataOperateCommonUtils.setCommonData(zdyBaseCompany);
return zdyBaseCompanyMapper.insertZdyBaseCompany(zdyBaseCompany);
}
/**
* 修改系统基础模块-公司管理
*
* @param zdyBaseCompany 系统基础模块-公司管理
* @return 结果
*/
@Transactional
@Override
public int updateZdyBaseCompany(ZdyBaseCompany zdyBaseCompany) {
DataOperateCommonUtils.setCommonData(zdyBaseCompany);
ZdyBaseCompany baseCompany = zdyBaseCompanyMapper.selectZdyBaseCompanyById(zdyBaseCompany.getId());
if (!Objects.equals(zdyBaseCompany.getCompanyName(), baseCompany.getCompanyName())) {
if (zdyBaseCompanyMapper.countByCompanyName(zdyBaseCompany.getCompanyName()) > 0) {
throw new ServiceException("公司名称已存在,请勿重复添加!");
}
//修改景区名称
SysDept sysDept = new SysDept();
sysDept.setDeptId(zdyBaseCompany.getDeptId());
sysDept.setDeptName(zdyBaseCompany.getCompanyName());
sysDeptMapper.updateDept(sysDept);
}
return zdyBaseCompanyMapper.updateZdyBaseCompany(zdyBaseCompany);
}
/**
* 批量删除系统基础模块-公司管理
*
* @param ids 需要删除的系统基础模块-公司管理主键
* @return 结果
*/
@Override
public int deleteZdyBaseCompanyByIds(Long[] ids) {
return zdyBaseCompanyMapper.deleteZdyBaseCompanyByIds(ids);
}
/**
* 删除系统基础模块-公司管理信息
*
* @param id 系统基础模块-公司管理主键
* @return 结果
*/
@Override
public int deleteZdyBaseCompanyById(Long id) {
return zdyBaseCompanyMapper.deleteZdyBaseCompanyById(id);
}
@Override
public ZdyBaseCompany selectZdyBaseCompanyByDeptId(Long deptId) {
return zdyBaseCompanyMapper.selectZdyBaseCompanyByDeptId(deptId);
}
@Override
public void createBaseCompany(SysDept sysDept) {
ZdyBaseCompany zdyBaseCompany = new ZdyBaseCompany();
zdyBaseCompany.setCompanyName(sysDept.getDeptName());
zdyBaseCompany.setDeptId(sysDept.getDeptId());
this.insertZdyBaseCompany(zdyBaseCompany);
}
@Override
public void updateBaseCompany(SysDept sysDept) {
ZdyBaseCompany zdyBaseCompany = new ZdyBaseCompany();
zdyBaseCompany.setCompanyName(sysDept.getDeptName());
zdyBaseCompany.setDeptId(sysDept.getDeptId());
zdyBaseCompanyMapper.updateZdyBaseCompanyByDeptId(zdyBaseCompany);
}
@Override
public void delBaseCompany(Long deptId) {
ZdyBaseCompany zdyBaseCompany = zdyBaseCompanyMapper.selectZdyBaseCompanyByDeptId(deptId);
if (Objects.isNull(zdyBaseCompany)) {
return;
}
this.deleteZdyBaseCompanyById(zdyBaseCompany.getId());
}
}

View File

@@ -0,0 +1,89 @@
package com.zhwl.base.service.impl;
import java.util.List;
import com.zhwl.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zhwl.base.mapper.ZdyBaseEmployeeCardLogMapper;
import com.zhwl.base.domain.ZdyBaseEmployeeCardLog;
import com.zhwl.base.service.IZdyBaseEmployeeCardLogService;
/**
* 系统基础模块-员工卡绑定日志管理Service业务层处理
*
* @author wangxing
* @date 2024-07-31
*/
@Service
public class ZdyBaseEmployeeCardLogServiceImpl implements IZdyBaseEmployeeCardLogService {
@Autowired
private ZdyBaseEmployeeCardLogMapper zdyBaseEmployeeCardLogMapper;
/**
* 查询系统基础模块-员工卡绑定日志管理
*
* @param id 系统基础模块-员工卡绑定日志管理主键
* @return 系统基础模块-员工卡绑定日志管理
*/
@Override
public ZdyBaseEmployeeCardLog selectZdyBaseEmployeeCardLogById(Long id) {
return zdyBaseEmployeeCardLogMapper.selectZdyBaseEmployeeCardLogById(id);
}
/**
* 查询系统基础模块-员工卡绑定日志管理列表
*
* @param zdyBaseEmployeeCardLog 系统基础模块-员工卡绑定日志管理
* @return 系统基础模块-员工卡绑定日志管理
*/
@Override
public List<ZdyBaseEmployeeCardLog> selectZdyBaseEmployeeCardLogList(ZdyBaseEmployeeCardLog zdyBaseEmployeeCardLog) {
return zdyBaseEmployeeCardLogMapper.selectZdyBaseEmployeeCardLogList(zdyBaseEmployeeCardLog);
}
/**
* 新增系统基础模块-员工卡绑定日志管理
*
* @param zdyBaseEmployeeCardLog 系统基础模块-员工卡绑定日志管理
* @return 结果
*/
@Override
public int insertZdyBaseEmployeeCardLog(ZdyBaseEmployeeCardLog zdyBaseEmployeeCardLog) {
zdyBaseEmployeeCardLog.setCreateTime(DateUtils.getNowDate());
return zdyBaseEmployeeCardLogMapper.insertZdyBaseEmployeeCardLog(zdyBaseEmployeeCardLog);
}
/**
* 修改系统基础模块-员工卡绑定日志管理
*
* @param zdyBaseEmployeeCardLog 系统基础模块-员工卡绑定日志管理
* @return 结果
*/
@Override
public int updateZdyBaseEmployeeCardLog(ZdyBaseEmployeeCardLog zdyBaseEmployeeCardLog) {
zdyBaseEmployeeCardLog.setUpdateTime(DateUtils.getNowDate());
return zdyBaseEmployeeCardLogMapper.updateZdyBaseEmployeeCardLog(zdyBaseEmployeeCardLog);
}
/**
* 批量删除系统基础模块-员工卡绑定日志管理
*
* @param ids 需要删除的系统基础模块-员工卡绑定日志管理主键
* @return 结果
*/
@Override
public int deleteZdyBaseEmployeeCardLogByIds(Long[] ids) {
return zdyBaseEmployeeCardLogMapper.deleteZdyBaseEmployeeCardLogByIds(ids);
}
/**
* 删除系统基础模块-员工卡绑定日志管理信息
*
* @param id 系统基础模块-员工卡绑定日志管理主键
* @return 结果
*/
@Override
public int deleteZdyBaseEmployeeCardLogById(Long id) {
return zdyBaseEmployeeCardLogMapper.deleteZdyBaseEmployeeCardLogById(id);
}
}

View File

@@ -0,0 +1,107 @@
package com.zhwl.base.service.impl;
import java.util.List;
import java.util.Objects;
import com.zhwl.common.annotation.DataScope;
import com.zhwl.common.exception.ServiceException;
import com.zhwl.common.utils.DataOperateCommonUtils;
import com.zhwl.common.utils.DateUtils;
import com.zhwl.common.utils.SecurityUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zhwl.base.mapper.ZdyBaseEmployeeCardMapper;
import com.zhwl.base.domain.ZdyBaseEmployeeCard;
import com.zhwl.base.service.IZdyBaseEmployeeCardService;
/**
* 系统基础模块-员工卡管理Service业务层处理
*
* @author wangxing
* @date 2024-07-30
*/
@Service
@RequiredArgsConstructor
public class ZdyBaseEmployeeCardServiceImpl implements IZdyBaseEmployeeCardService {
private final ZdyBaseEmployeeCardMapper zdyBaseEmployeeCardMapper;
/**
* 查询系统基础模块-员工卡管理
*
* @param id 系统基础模块-员工卡管理主键
* @return 系统基础模块-员工卡管理
*/
@Override
public ZdyBaseEmployeeCard selectZdyBaseEmployeeCardById(Long id) {
return zdyBaseEmployeeCardMapper.selectZdyBaseEmployeeCardById(id);
}
/**
* 查询系统基础模块-员工卡管理列表
*
* @param zdyBaseEmployeeCard 系统基础模块-员工卡管理
* @return 系统基础模块-员工卡管理
*/
@DataScope(deptAlias = "d")
@Override
public List<ZdyBaseEmployeeCard> selectZdyBaseEmployeeCardList(ZdyBaseEmployeeCard zdyBaseEmployeeCard) {
return zdyBaseEmployeeCardMapper.selectZdyBaseEmployeeCardList(zdyBaseEmployeeCard);
}
/**
* 新增系统基础模块-员工卡管理
*
* @param zdyBaseEmployeeCard 系统基础模块-员工卡管理
* @return 结果
*/
@Override
public int insertZdyBaseEmployeeCard(ZdyBaseEmployeeCard zdyBaseEmployeeCard) {
//卡号不能重复
ZdyBaseEmployeeCard employeeCard = zdyBaseEmployeeCardMapper.selectZdyBaseEmployeeCardByCardNo(zdyBaseEmployeeCard.getCardNo());
if(Objects.nonNull(employeeCard)){
throw new ServiceException("IC卡号不能重复!");
}
zdyBaseEmployeeCard.setDeptId(SecurityUtils.getDeptId());
return zdyBaseEmployeeCardMapper.insertZdyBaseEmployeeCard(zdyBaseEmployeeCard);
}
/**
* 修改系统基础模块-员工卡管理
*
* @param zdyBaseEmployeeCard 系统基础模块-员工卡管理
* @return 结果
*/
@Override
public int updateZdyBaseEmployeeCard(ZdyBaseEmployeeCard zdyBaseEmployeeCard) {
//卡号不能重复
ZdyBaseEmployeeCard employeeCard = zdyBaseEmployeeCardMapper.selectZdyBaseEmployeeCardByCardNo(zdyBaseEmployeeCard.getCardNo());
if(Objects.nonNull(employeeCard) && !Objects.equals(zdyBaseEmployeeCard.getId(),employeeCard.getId())){
throw new ServiceException("IC卡号不能重复!");
}
DataOperateCommonUtils.setCommonData(zdyBaseEmployeeCard);
return zdyBaseEmployeeCardMapper.updateZdyBaseEmployeeCard(zdyBaseEmployeeCard);
}
/**
* 批量删除系统基础模块-员工卡管理
*
* @param ids 需要删除的系统基础模块-员工卡管理主键
* @return 结果
*/
@Override
public int deleteZdyBaseEmployeeCardByIds(Long[] ids) {
return zdyBaseEmployeeCardMapper.deleteZdyBaseEmployeeCardByIds(ids);
}
/**
* 删除系统基础模块-员工卡管理信息
*
* @param id 系统基础模块-员工卡管理主键
* @return 结果
*/
@Override
public int deleteZdyBaseEmployeeCardById(Long id) {
return zdyBaseEmployeeCardMapper.deleteZdyBaseEmployeeCardById(id);
}
}

View File

@@ -0,0 +1,349 @@
package com.zhwl.base.service.impl;
import cn.hutool.core.util.IdcardUtil;
import cn.hutool.core.util.PhoneUtil;
import com.zhwl.base.constant.Constants;
import com.zhwl.base.domain.*;
import com.zhwl.base.mapper.ZdyBaseEmployeeCardLogMapper;
import com.zhwl.base.mapper.ZdyBaseEmployeeCardMapper;
import com.zhwl.base.mapper.ZdyBaseEmployeeMapper;
import com.zhwl.base.service.IZdyBaseEmployeeService;
import com.zhwl.common.annotation.DataScope;
import com.zhwl.common.core.domain.entity.SysUser;
import com.zhwl.common.core.page.TableDataInfo;
import com.zhwl.common.enums.DictTypeEnum;
import com.zhwl.common.exception.ServiceException;
import com.zhwl.common.utils.*;
import com.zhwl.common.utils.bean.BeanUtils;
import com.zhwl.common.utils.bean.BeanValidators;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.compress.utils.Lists;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.validation.Validator;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
* 系统基础模块-员工管理Service业务层处理
*
* @author wangxing
* @date 2024-07-29
*/
@Slf4j
@Service
@RequiredArgsConstructor
public class ZdyBaseEmployeeServiceImpl implements IZdyBaseEmployeeService {
private final ZdyBaseEmployeeMapper zdyBaseEmployeeMapper;
private final ZdyBaseEmployeeCardMapper zdyBaseEmployeeCardMapper;
private final ZdyBaseEmployeeCardLogMapper zdyBaseEmployeeCardLogMapper;
protected final Validator validator;
/**
* 查询系统基础模块-员工管理
*
* @param id 系统基础模块-员工管理主键
* @return 系统基础模块-员工管理
*/
@Override
public ZdyBaseEmployee selectZdyBaseEmployeeById(Long id) {
ZdyBaseEmployee zdyBaseEmployee = zdyBaseEmployeeMapper.selectZdyBaseEmployeeById(id);
zdyBaseEmployee.setEmployeeStatusName(DictUtils.getDictLabel(DictTypeEnum.EMPLOYEE_STATUS.getType(), String.valueOf(zdyBaseEmployee.getEmployeeStatus())));
zdyBaseEmployee.setSexName(DictUtils.getDictLabel(DictTypeEnum.SYS_USER_SEX.getType(), zdyBaseEmployee.getSex()));
return zdyBaseEmployee;
}
/**
* 查询系统基础模块-员工管理列表
*
* @param zdyBaseEmployee 系统基础模块-员工管理
* @return 系统基础模块-员工管理
*/
@DataScope(deptAlias = "d")
@Override
public List<ZdyBaseEmployee> selectZdyBaseEmployeeList(ZdyBaseEmployee zdyBaseEmployee) {
List<ZdyBaseEmployee> zdyBaseEmployees = zdyBaseEmployeeMapper.selectZdyBaseEmployeeList(zdyBaseEmployee);
zdyBaseEmployees.forEach(d -> {
d.setEmployeeStatusName(DictUtils.getDictLabel(DictTypeEnum.EMPLOYEE_STATUS.getType(), String.valueOf(d.getEmployeeStatus())));
d.setSexName(DictUtils.getDictLabel(DictTypeEnum.SYS_USER_SEX.getType(), d.getSex()));
});
return zdyBaseEmployees;
}
/**
* 新增系统基础模块-员工管理
*
* @param zdyBaseEmployee 系统基础模块-员工管理
* @return 结果
*/
@Transactional(rollbackFor = Exception.class)
@Override
public int insertZdyBaseEmployee(ZdyBaseEmployee zdyBaseEmployee) {
DataOperateCommonUtils.setCommonData(zdyBaseEmployee);
//判断卡号是否已绑定
ZdyBaseEmployeeCard zdyBaseEmployeeCard = zdyBaseEmployeeCardMapper.selectZdyBaseEmployeeCardByCardNo(zdyBaseEmployee.getCardNo());
if (Objects.isNull(zdyBaseEmployeeCard)) {
throw new ServiceException("请先去IC卡管理内进行卡片新增");
}
if (Objects.equals(zdyBaseEmployeeCard.getCardStatus(), Constants.ZDY_EMPLOYEE_CARD_YES)) {
throw new ServiceException("IC卡已绑定,请勿重复操作");
}
int i = zdyBaseEmployeeMapper.insertZdyBaseEmployee(zdyBaseEmployee);
//卡修改为已绑定
zdyBaseEmployeeCard.setCardStatus(Constants.ZDY_EMPLOYEE_CARD_YES);
zdyBaseEmployeeCardMapper.updateZdyBaseEmployeeCard(zdyBaseEmployeeCard);
insertEmployeeLog(zdyBaseEmployee);
return i;
}
/**
* 修改系统基础模块-员工管理
*
* @param zdyBaseEmployee 系统基础模块-员工管理
* @return 结果
*/
@Transactional(rollbackFor = Exception.class)
@Override
public int updateZdyBaseEmployee(ZdyBaseEmployee zdyBaseEmployee) {
ZdyBaseEmployee baseEmployee = zdyBaseEmployeeMapper.selectZdyBaseEmployeeById(zdyBaseEmployee.getId());
if (Objects.isNull(baseEmployee)) {
throw new ServiceException("员工不存在!");
}
DataOperateCommonUtils.setCommonData(zdyBaseEmployee);
//判断卡号是否已绑定
ZdyBaseEmployeeCard zdyBaseEmployeeCard = zdyBaseEmployeeCardMapper.selectZdyBaseEmployeeCardByCardNo(zdyBaseEmployee.getCardNo());
if (Objects.isNull(zdyBaseEmployeeCard)) {
throw new ServiceException("请先去IC卡管理内进行卡片新增");
}
if (Objects.equals(zdyBaseEmployeeCard.getCardStatus(), Constants.ZDY_EMPLOYEE_CARD_YES)) {
ZdyBaseEmployee employee = zdyBaseEmployeeMapper.selectZdyBaseEmployeeByCardNo(zdyBaseEmployeeCard.getCardNo());
if (Objects.nonNull(employee) && !Objects.equals(zdyBaseEmployee.getId(), employee.getId())) {
throw new ServiceException("IC卡已绑定,请勿重复操作");
}
}
int i = zdyBaseEmployeeMapper.updateZdyBaseEmployee(zdyBaseEmployee);
//如果卡号修改,执行更新
if(!Objects.equals(zdyBaseEmployee.getCardNo(),baseEmployee.getCardNo())){
//新卡修改为已绑定
zdyBaseEmployeeCard.setCardStatus(Constants.ZDY_EMPLOYEE_CARD_YES);
zdyBaseEmployeeCardMapper.updateZdyBaseEmployeeCard(zdyBaseEmployeeCard);
ZdyBaseEmployeeCard baseEmployeeCard = zdyBaseEmployeeCardMapper.selectZdyBaseEmployeeCardByCardNo(baseEmployee.getCardNo());
if (Objects.nonNull(baseEmployeeCard)) {
//旧卡修改为未绑定
baseEmployeeCard.setCardStatus(Constants.ZDY_EMPLOYEE_CARD_NO);
zdyBaseEmployeeCardMapper.updateZdyBaseEmployeeCard(baseEmployeeCard);
}
insertEmployeeLog(zdyBaseEmployee);
}
return i;
}
/**
* 批量删除系统基础模块-员工管理
*
* @param ids 需要删除的系统基础模块-员工管理主键
* @return 结果
*/
@Override
public int deleteZdyBaseEmployeeByIds(Long[] ids) {
return zdyBaseEmployeeMapper.deleteZdyBaseEmployeeByIds(ids);
}
/**
* 删除系统基础模块-员工管理信息
*
* @param id 系统基础模块-员工管理主键
* @return 结果
*/
@Override
public int deleteZdyBaseEmployeeById(Long id) {
return zdyBaseEmployeeMapper.deleteZdyBaseEmployeeById(id);
}
/**
* 员工导入
*
* @param employeeList
* @return
*/
@Override
public List<BaseEmployeeTemplate> importData(List<BaseEmployeeTemplate> employeeList) {
if (CollectionUtils.isEmpty(employeeList)) {
throw new ServiceException("导入员工数据不能为空!");
}
int successNum = 0;
int failureNum = 0;
StringBuilder successMsg = new StringBuilder();
StringBuilder failureMsg = new StringBuilder();
for (BaseEmployeeTemplate employeeTemplate : employeeList) {
try {
BeanValidators.validateWithException(validator, employeeTemplate);
if (!IdcardUtil.isValidCard(employeeTemplate.getIdCard())) {
failureNum++;
String msg = "<br/>" + failureNum + "、员工姓名 " + employeeTemplate.getName() + " 导入失败:";
failureMsg.append(msg).append("身份证号格式不正确!");
continue;
}
if (!PhoneUtil.isPhone(employeeTemplate.getPhone())) {
failureNum++;
String msg = "<br/>" + failureNum + "、员工姓名 " + employeeTemplate.getName() + " 导入失败:";
failureMsg.append(msg).append("手机号格式不正确!");
continue;
}
//导入时校验手机号和身份证号是否在系统内存在如果存在则导入失败1条重复就无法导入
ZdyBaseEmployee zdyBaseEmployee = zdyBaseEmployeeMapper.selectEmployeeByIdCardAndPhone(employeeTemplate.getIdCard(), employeeTemplate.getPhone());
if (StringUtils.isNull(zdyBaseEmployee)) {
ZdyBaseEmployee employee = new ZdyBaseEmployee();
BeanUtils.copyProperties(employeeTemplate, employee);
try {
SysUser user = SecurityUtils.getLoginUser().getUser();
Long companyId = user.getCompanyId();
if(Objects.isNull(companyId)){
companyId = 1L;
}
employee.setCompanyId(companyId);
employee.setDeptId(user.getDeptId());
employee.setCreateBy(SecurityUtils.getUsername());
} catch (Exception e) {
e.printStackTrace();
employee.setCreateBy("1");
}
employee.setCreateTime(DateUtils.getNowDate());
zdyBaseEmployeeMapper.insertZdyBaseEmployee(employee);
successNum++;
successMsg.append("<br/>").append(successNum).append("、员工姓名 ").append(employeeTemplate.getName()).append(" 导入成功");
} else {
failureNum++;
String msg = "<br/>" + failureNum + "、员工姓名 " + employeeTemplate.getName() + " 导入失败:";
failureMsg.append(msg).append("员工信息已存在!");
}
} catch (Exception e) {
failureNum++;
String msg = "<br/>" + failureNum + "、员工姓名 " + employeeTemplate.getName() + " 导入失败:";
failureMsg.append(msg).append(e.getMessage());
log.error(msg, e);
}
}
if (failureNum > 0) {
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
throw new ServiceException(failureMsg.toString());
} else {
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
}
return employeeList;
}
/**
* 修改系统基础模块-员工启用/禁用
*
* @param zdyBaseEmployee 系统基础模块-员工管理
* @return
*/
@Override
public boolean checkEmployee(ZdyBaseEmployee zdyBaseEmployee) {
ZdyBaseEmployee bseEmployee = zdyBaseEmployeeMapper.selectZdyBaseEmployeeById(zdyBaseEmployee.getId());
if (Objects.isNull(bseEmployee)) {
throw new ServiceException("员工不存在!");
}
DataOperateCommonUtils.setCommonData(zdyBaseEmployee);
int i = zdyBaseEmployeeMapper.updateZdyBaseEmployee(zdyBaseEmployee);
return i > 0;
}
@DataScope(deptAlias = "d")
@Override
public List<ZdyEmployeeCardGraph> getEmployeeCardList(ZdyEmployeeCardGraph zdyEmployeeCardGraph) {
return zdyBaseEmployeeMapper.selectZdyEmployeeCardGraphList(zdyEmployeeCardGraph);
}
@DataScope(deptAlias = "d")
@Override
public TableDataInfo getEmployeeEntryList(ZdyEmployeeCardGraph zdyEmployeeCardGraph, int pageNum, int pageSize) {
try {
zdyEmployeeCardGraph.setOpenDoor(1);
List<ZdyEmployeeCardGraph> list = zdyBaseEmployeeMapper.selectZdyEmployeeCardGraphList(zdyEmployeeCardGraph);
if (org.springframework.util.CollectionUtils.isEmpty(list)) {
return TableDataInfo.success(list, 0);
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
sdf.setLenient(false);
// 按每天分组展示内容
Map<String, List<ZdyEmployeeCardGraph>> sourceListMap = list.stream()
.collect(Collectors.groupingBy(item ->
item.getDataTime() == null ? "未知日期" : sdf.format(item.getDataTime()),
Collectors.toList()));
List<ZdyEmployeeEntry> arrayList = Lists.newArrayList();
for (Map.Entry<String, List<ZdyEmployeeCardGraph>> e : sourceListMap.entrySet()) {
String date = e.getKey();
List<ZdyEmployeeCardGraph> valueList = e.getValue();
// 统计每个 key 的出现次数
Map<String, Long> countMap = valueList.stream().collect(Collectors.groupingBy(p -> p.getSerial() + "-" + p.getEmployeeId(), Collectors.counting()));
List<ZdyEmployeeEntry> resultList;
// 转换为包含 GroupResult 的列表
if (!org.springframework.util.CollectionUtils.isEmpty(countMap)) {
resultList = countMap.entrySet().stream()
.map(entry -> {
String key = entry.getKey();
if (!StringUtils.contains(key, "null-") || !StringUtils.contains(key, "null")) {
ZdyEmployeeCardGraph graph = list.stream().filter(l -> (key.split("-")[0].equals(l.getSerial())) && key.split("-")[1].equals(String.valueOf(l.getEmployeeId()))).findFirst().orElse(null);
ZdyEmployeeEntry zdyEmployeeEntry = new ZdyEmployeeEntry();
if (Objects.nonNull(graph)) {
zdyEmployeeEntry.setEmployeeId(graph.getEmployeeId());
zdyEmployeeEntry.setEmployeeName(Objects.nonNull(graph.getEmployeeName()) ? graph.getEmployeeName() : "-");
zdyEmployeeEntry.setDeviceName(graph.getDeviceName());
zdyEmployeeEntry.setKey(entry.getKey());
zdyEmployeeEntry.setTotal(Objects.nonNull(entry.getValue()) ? entry.getValue() : 0L);
zdyEmployeeEntry.setDateTime(date);
return zdyEmployeeEntry;
}
}
return null;
}
)
.filter(Objects::nonNull)
.collect(Collectors.toList());
if (!CollectionUtils.isEmpty(resultList)) {
arrayList.addAll(resultList);
}
}
}
if (!CollectionUtils.isEmpty(arrayList)) {
arrayList = arrayList.stream().sorted(Comparator.comparing(ZdyEmployeeEntry::getDateTime).reversed().thenComparing(ZdyEmployeeEntry::getEmployeeName)).collect(Collectors.toList());
// 手动分页
int totalPage = arrayList.size();
return TableDataInfo.success(ListUtils.pageList(arrayList, pageNum, pageSize), totalPage);
}
} catch (Exception e) {
log.error("员工入园统计异常:{}", e.getMessage());
throw new ServiceException("员工入园统计异常" + e.getMessage());
}
return TableDataInfo.success(Lists.newArrayList(), 0);
}
/**
* 绑定记录添加
*
* @param zdyBaseEmployee
*/
private void insertEmployeeLog(ZdyBaseEmployee zdyBaseEmployee) {
//写入绑定记录
ZdyBaseEmployeeCardLog Log = new ZdyBaseEmployeeCardLog();
Log.setCardNo(zdyBaseEmployee.getCardNo());
Log.setEmployeeId(zdyBaseEmployee.getId());
Log.setEmployeeName(zdyBaseEmployee.getName());
Log.setCreateTime(DateUtils.getNowDate());
zdyBaseEmployeeCardLogMapper.insertZdyBaseEmployeeCardLog(Log);
}
}

View File

@@ -0,0 +1,283 @@
package com.zhwl.base.service.impl;
import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.hutool.core.io.FileUtil;
import com.alibaba.fastjson2.JSONObject;
import com.zhwl.base.domain.ZdyBaseOnlinePlatform;
import com.zhwl.base.domain.dto.WxFastMaAccountBasicInfoResultDTO;
import com.zhwl.base.domain.dto.WxFastMaBeenSetCategoryResultDTO;
import com.zhwl.base.domain.dto.WxFastMaIcpEntranceInfoResultDTO;
import com.zhwl.base.domain.dto.WxOpenResultDTO;
import com.zhwl.base.enums.WxaQrCodePurposeEnum;
import com.zhwl.base.mapper.ZdyBaseOnlinePlatformMapper;
import com.zhwl.base.service.IZdyBaseOnlinePlatformService;
import com.zhwl.common.config.RuoYiConfig;
import com.zhwl.common.enums.DictTypeEnum;
import com.zhwl.common.exception.ServiceException;
import com.zhwl.common.utils.DataOperateCommonUtils;
import com.zhwl.common.utils.DateUtils;
import com.zhwl.common.utils.DictUtils;
import com.zhwl.common.utils.file.FileUploadUtils;
import com.zhwl.common.utils.file.FileUtils;
import com.zhwl.framework.service.WechatService;
import com.zhwl.scenic.service.IZdyScenicService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.io.File;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import static com.zhwl.base.constant.WxBaseInfoConstants.*;
import static com.zhwl.base.domain.dto.WxFastMaIcpEntranceInfoResultDTO.STATUS_ALREADY_REGISTERED;
import static com.zhwl.common.constant.Constants.*;
/**
* 系统基础模块-线上平台管理Service业务层处理
*
* @author wangxing
* @date 2024-07-29
*/
@Service
@Slf4j
@RequiredArgsConstructor
public class ZdyBaseOnlinePlatformServiceImpl implements IZdyBaseOnlinePlatformService {
private final ZdyBaseOnlinePlatformMapper zdyBaseOnlinePlatformMapper;
private final WxMaService wxMaService;
private final WechatService wechatService;
/**
* 查询系统基础模块-线上平台管理
*
* @param id 系统基础模块-线上平台管理主键
* @return 系统基础模块-线上平台管理
*/
@Override
public ZdyBaseOnlinePlatform selectZdyBaseOnlinePlatformById(Long id) {
ZdyBaseOnlinePlatform zdyBaseOnlinePlatform = zdyBaseOnlinePlatformMapper.selectZdyBaseOnlinePlatformById(id);
zdyBaseOnlinePlatform.setAuthenticationStatusName(DictUtils.getDictLabel(DictTypeEnum.AUTHENTICATION_STATUS.getType(), zdyBaseOnlinePlatform.getAuthenticationStatus()));
zdyBaseOnlinePlatform.setRegistrationStatusName(DictUtils.getDictLabel(DictTypeEnum.REGISTRATION_STATUS.getType(), String.valueOf(zdyBaseOnlinePlatform.getRegistrationStatus())));
return zdyBaseOnlinePlatform;
}
/**
* 查询系统基础模块-线上平台管理列表
*
* @param zdyBaseOnlinePlatform 系统基础模块-线上平台管理
* @return 系统基础模块-线上平台管理
*/
@Override
public List<ZdyBaseOnlinePlatform> selectZdyBaseOnlinePlatformList(ZdyBaseOnlinePlatform zdyBaseOnlinePlatform) {
List<ZdyBaseOnlinePlatform> zdyBaseOnlinePlatforms = zdyBaseOnlinePlatformMapper.selectZdyBaseOnlinePlatformList(zdyBaseOnlinePlatform);
zdyBaseOnlinePlatforms.forEach(d -> {
d.setAuthenticationStatusName(DictUtils.getDictLabel(DictTypeEnum.AUTHENTICATION_STATUS.getType(), d.getAuthenticationStatus()));
d.setRegistrationStatusName(DictUtils.getDictLabel(DictTypeEnum.REGISTRATION_STATUS.getType(), String.valueOf(d.getRegistrationStatus())));
});
return zdyBaseOnlinePlatforms;
}
/**
* 新增系统基础模块-线上平台管理
*
* @param zdyBaseOnlinePlatform 系统基础模块-线上平台管理
* @return 结果
*/
@Override
public int insertZdyBaseOnlinePlatform(ZdyBaseOnlinePlatform zdyBaseOnlinePlatform) {
DataOperateCommonUtils.setCommonData(zdyBaseOnlinePlatform);
return zdyBaseOnlinePlatformMapper.insertZdyBaseOnlinePlatform(zdyBaseOnlinePlatform);
}
/**
* 修改系统基础模块-线上平台管理
*
* @param zdyBaseOnlinePlatform 系统基础模块-线上平台管理
* @return 结果
*/
@Override
public int updateZdyBaseOnlinePlatform(ZdyBaseOnlinePlatform zdyBaseOnlinePlatform) {
DataOperateCommonUtils.setCommonData(zdyBaseOnlinePlatform);
String qrCode = getUnlimitedQrCode();
WxFastMaAccountBasicInfoResultDTO accountBasicInfo = getAccountBasicInfo();
WxFastMaIcpEntranceInfoResultDTO icpEntranceInfo = getIcpEntranceInfo();
WxFastMaBeenSetCategoryResultDTO settingCategories = getSettingCategories();
zdyBaseOnlinePlatform.setAppid(accountBasicInfo.getAppId());
zdyBaseOnlinePlatform.setAppName(accountBasicInfo.getNickname());
setServiceChannel(zdyBaseOnlinePlatform, settingCategories);
zdyBaseOnlinePlatform.setBodyInfo(accountBasicInfo.getPrincipalName());
setAuthenticationStatus(zdyBaseOnlinePlatform, accountBasicInfo);
setRegistrationStatus(zdyBaseOnlinePlatform, icpEntranceInfo);
setImage(zdyBaseOnlinePlatform, accountBasicInfo);
zdyBaseOnlinePlatform.setQrCode(qrCode);
return zdyBaseOnlinePlatformMapper.updateZdyBaseOnlinePlatform(zdyBaseOnlinePlatform);
}
/**
* 批量删除系统基础模块-线上平台管理
*
* @param ids 需要删除的系统基础模块-线上平台管理主键
* @return 结果
*/
@Override
public int deleteZdyBaseOnlinePlatformByIds(Long[] ids) {
return zdyBaseOnlinePlatformMapper.deleteZdyBaseOnlinePlatformByIds(ids);
}
/**
* 删除系统基础模块-线上平台管理信息
*
* @param id 系统基础模块-线上平台管理主键
* @return 结果
*/
@Override
public int deleteZdyBaseOnlinePlatformById(Long id) {
return zdyBaseOnlinePlatformMapper.deleteZdyBaseOnlinePlatformById(id);
}
/**
* 设置认证状态
*
* @param zdyBaseOnlinePlatform 线上平台信息
* @param accountBasicInfo 基础信息
*/
private void setAuthenticationStatus(ZdyBaseOnlinePlatform zdyBaseOnlinePlatform,
WxFastMaAccountBasicInfoResultDTO accountBasicInfo) {
Optional.ofNullable(accountBasicInfo.getWxVerifyInfo())
.map(WxFastMaAccountBasicInfoResultDTO.WxVerifyInfo::getQualificationVerify)
.ifPresent(qualificationVerify -> zdyBaseOnlinePlatform
.setAuthenticationStatus(Objects.equals(qualificationVerify, Boolean.TRUE) ? YES_STR : NO_STR));
}
/**
* 设置备案状态
*
* @param zdyBaseOnlinePlatform 线上平台信息
* @param icpEntranceInfo 备案信息
*/
private void setRegistrationStatus(ZdyBaseOnlinePlatform zdyBaseOnlinePlatform,
WxFastMaIcpEntranceInfoResultDTO icpEntranceInfo) {
Optional.ofNullable(icpEntranceInfo.getInfo())
.map(WxFastMaIcpEntranceInfoResultDTO.IcpEntranceInfo::getStatus)
.ifPresent(status -> zdyBaseOnlinePlatform.setRegistrationStatus(status == STATUS_ALREADY_REGISTERED ? YES : NO));
}
/**
* 设置头像
*
* @param zdyBaseOnlinePlatform 线上平台信息
* @param accountBasicInfo 基础信息
*/
private void setImage(ZdyBaseOnlinePlatform zdyBaseOnlinePlatform,
WxFastMaAccountBasicInfoResultDTO accountBasicInfo) {
Optional.ofNullable(accountBasicInfo.getHeadImageInfo())
.map(WxFastMaAccountBasicInfoResultDTO.HeadImageInfo::getHeadImageUrl)
.ifPresent(zdyBaseOnlinePlatform::setImage);
}
/**
* 设置服务类目
*
* @param zdyBaseOnlinePlatform 线上平台信息
* @param settingCategories 服务类目信息
*/
private void setServiceChannel(ZdyBaseOnlinePlatform zdyBaseOnlinePlatform,
WxFastMaBeenSetCategoryResultDTO settingCategories) {
Optional.ofNullable(settingCategories.getCategories())
.orElse(Collections.emptyList())
.stream()
.findFirst()
.ifPresent(categoriesBean -> zdyBaseOnlinePlatform.setServiceChannel(categoriesBean.getFirstName()
+ ">" + categoriesBean.getSecondName()));
}
/**
* 获取小程序码
*
* @return 图片地址
*/
private String getUnlimitedQrCode() {
//自定义参数
String scene = "purpose=" + WxaQrCodePurposeEnum.BASE;
try {
return wechatService.getUnlimitedQrCodeUrl(scene, null);
} catch (Exception e) {
log.error("获取小程序码失败", e);
throw new ServiceException("获取小程序码失败");
}
}
/**
* 获取小程序基本信息
*/
private WxFastMaAccountBasicInfoResultDTO getAccountBasicInfo() {
try {
String response = wxMaService.get(URL_GET_ACCOUNT_BASIC_INFO, StringUtils.EMPTY);
log.info("获取小程序基本信息:{}", response);
WxFastMaAccountBasicInfoResultDTO result = JSONObject.parseObject(response,
WxFastMaAccountBasicInfoResultDTO.class);
checkIsSuccess(result);
return result;
} catch (Exception e) {
log.error("获取小程序基本信息失败", e);
throw new ServiceException("获取小程序基本信息失败");
}
}
/**
* 获取小程序备案状态
*/
private WxFastMaIcpEntranceInfoResultDTO getIcpEntranceInfo() {
try {
String response = wxMaService.get(URL_GET_ICP_ENTRANCE_INFO, StringUtils.EMPTY);
log.info("获取小程序备案状态:{}", response);
WxFastMaIcpEntranceInfoResultDTO result = JSONObject.parseObject(response,
WxFastMaIcpEntranceInfoResultDTO.class);
checkIsSuccess(result);
return result;
} catch (Exception e) {
log.error("获取小程序备案状态失败", e);
throw new ServiceException("获取小程序备案状态失败");
}
}
/**
* 获取小程序已设置的所有类目
*/
private WxFastMaBeenSetCategoryResultDTO getSettingCategories() {
try {
String response = wxMaService.get(URL_GET_CATEGORY, StringUtils.EMPTY);
log.info("获取小程序已设置的所有类目:{}", response);
WxFastMaBeenSetCategoryResultDTO result = JSONObject.parseObject(response,
WxFastMaBeenSetCategoryResultDTO.class);
checkIsSuccess(result);
return result;
} catch (Exception e) {
log.error("获取小程序已设置的所有类目失败", e);
throw new ServiceException("获取小程序已设置的所有类目失败");
}
}
/**
* 检查是否成功
*
* @param result 响应结果
*/
private void checkIsSuccess(WxOpenResultDTO result) {
if (!result.isSuccess()) {
throw new ServiceException();
}
}
}

View File

@@ -0,0 +1,114 @@
package com.zhwl.base.service.impl;
import java.util.List;
import java.util.Objects;
import com.zhwl.common.enums.DictTypeEnum;
import com.zhwl.common.enums.ScenicOrderType;
import com.zhwl.common.exception.ServiceException;
import com.zhwl.common.utils.DataOperateCommonUtils;
import com.zhwl.common.utils.DateUtils;
import com.zhwl.common.utils.DictUtils;
import com.zhwl.common.utils.StringUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zhwl.base.mapper.ZdyBasePackageMapper;
import com.zhwl.base.domain.ZdyBasePackage;
import com.zhwl.base.service.IZdyBasePackageService;
/**
* 系统基础模块-更新包管理Service业务层处理
*
* @author wangxing
* @date 2024-07-29
*/
@Service
@RequiredArgsConstructor
public class ZdyBasePackageServiceImpl implements IZdyBasePackageService {
private final ZdyBasePackageMapper zdyBasePackageMapper;
/**
* 查询系统基础模块-更新包管理
*
* @param id 系统基础模块-更新包管理主键
* @return 系统基础模块-更新包管理
*/
@Override
public ZdyBasePackage selectZdyBasePackageById(Long id) {
return zdyBasePackageMapper.selectZdyBasePackageById(id);
}
/**
* 查询系统基础模块-更新包管理列表
*
* @param zdyBasePackage 系统基础模块-更新包管理
* @return 系统基础模块-更新包管理
*/
@Override
public List<ZdyBasePackage> selectZdyBasePackageList(ZdyBasePackage zdyBasePackage) {
List<ZdyBasePackage> zdyBasePackages = zdyBasePackageMapper.selectZdyBasePackageList(zdyBasePackage);
zdyBasePackages.forEach(p->{
if (StringUtils.isNotEmpty(p.getUpdateType())) {
p.setUpdateTypeName(DictUtils.getDictLabel(DictTypeEnum.BASE_UPDATE_TYPE.getType(), p.getUpdateType()));
}
});
return zdyBasePackages;
}
/**
* 新增系统基础模块-更新包管理
*
* @param zdyBasePackage 系统基础模块-更新包管理
* @return 结果
*/
@Override
public int insertZdyBasePackage(ZdyBasePackage zdyBasePackage) {
DataOperateCommonUtils.setCommonData(zdyBasePackage);
//类型+版本号不能重复
ZdyBasePackage basePackage = zdyBasePackageMapper.selectZdyBasePackage(zdyBasePackage.getUpdateType(), zdyBasePackage.getVersion());
if(Objects.nonNull(basePackage)){
throw new ServiceException("当前版本号已存在,请重新添加!");
}
return zdyBasePackageMapper.insertZdyBasePackage(zdyBasePackage);
}
/**
* 修改系统基础模块-更新包管理
*
* @param zdyBasePackage 系统基础模块-更新包管理
* @return 结果
*/
@Override
public int updateZdyBasePackage(ZdyBasePackage zdyBasePackage) {
DataOperateCommonUtils.setCommonData(zdyBasePackage);
//类型+版本号不能重复
ZdyBasePackage basePackage = zdyBasePackageMapper.selectZdyBasePackage(zdyBasePackage.getUpdateType(), zdyBasePackage.getVersion());
if(Objects.nonNull(basePackage) && !Objects.equals(basePackage.getId(),zdyBasePackage.getId())){
throw new ServiceException("当前版本号已存在,请重新添加!");
}
return zdyBasePackageMapper.updateZdyBasePackage(zdyBasePackage);
}
/**
* 批量删除系统基础模块-更新包管理
*
* @param ids 需要删除的系统基础模块-更新包管理主键
* @return 结果
*/
@Override
public int deleteZdyBasePackageByIds(Long[] ids) {
return zdyBasePackageMapper.deleteZdyBasePackageByIds(ids);
}
/**
* 删除系统基础模块-更新包管理信息
*
* @param id 系统基础模块-更新包管理主键
* @return 结果
*/
@Override
public int deleteZdyBasePackageById(Long id) {
return zdyBasePackageMapper.deleteZdyBasePackageById(id);
}
}

View File

@@ -0,0 +1,204 @@
package com.zhwl.base.service.impl;
import com.zhwl.base.service.IZdyBaseUserService;
import com.zhwl.common.annotation.DataScope;
import com.zhwl.common.constant.Constants;
import com.zhwl.common.constant.UserConstants;
import com.zhwl.common.core.domain.entity.SysDept;
import com.zhwl.common.core.domain.entity.SysRole;
import com.zhwl.common.enums.ZdyModuleNameEnum;
import com.zhwl.common.exception.ServiceException;
import com.zhwl.common.factory.ZdyModuleFactory;
import com.zhwl.common.utils.SecurityUtils;
import com.zhwl.common.utils.StringUtils;
import com.zhwl.system.domain.SysRoleDept;
import com.zhwl.system.domain.dto.BaseUserDTO;
import com.zhwl.system.enums.SysManagerRoleEnum;
import com.zhwl.system.manager.SysDeptManager;
import com.zhwl.system.mapper.SysRoleDeptMapper;
import com.zhwl.system.mapper.SysRoleMapper;
import com.zhwl.system.service.ISysUserService;
import com.zhwl.system.service.ParentBaseCommonService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import static com.zhwl.common.constant.UserConstants.DEPT_NORMAL;
import static com.zhwl.common.constant.UserConstants.DEPT_ORDER_DEFAULT;
/**
* 系统基础模块-公司管理Service业务层处理
*
* @author wangxing
* @date 2024-07-29
*/
@Service
@RequiredArgsConstructor
public class ZdyBaseUserServiceImpl implements IZdyBaseUserService {
private final ISysUserService sysUserService;
private final SysRoleMapper sysRoleMapper;
private final SysRoleDeptMapper roleDeptMapper;
private final SysDeptManager sysDeptManager;
private final ZdyModuleFactory zdyModuleFactory;
/**
* 添加员工
*
* @param baseUserDTO 员工信息
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void addUser(BaseUserDTO baseUserDTO) {
if (!sysUserService.checkUserNameUnique(baseUserDTO)) {
throw new ServiceException("该账号已存在,请重新编辑");
}
if (Objects.equals(baseUserDTO.getUserType(), Constants.MANAGER_YES)) {
//系统管理员只有一个角色
Long[] roleIds = baseUserDTO.getRoleIds();
Long roleId = roleIds[0];
SysRole sysRole = sysRoleMapper.selectRoleById(roleId);
SysManagerRoleEnum sysManagerRoleEnum = SysManagerRoleEnum.getByRoleKey(sysRole.getRoleKey());
if (Objects.isNull(sysManagerRoleEnum)) {
throw new ServiceException("不支持的角色类型");
}
Long operatingCompanyDeptId = sysDeptManager.getFirstOperatingCompany();
if (sysManagerRoleEnum.isNeedToAddDepartment()) {
//需要创建用户时直接创建新部门
String newDeptName = baseUserDTO.getNewDeptName();
SysDept sysDept = new SysDept();
sysDept.setDeptName(newDeptName);
sysDept.setOrgType(sysManagerRoleEnum.getOrgType().getValue());
sysDept.setOrderNum(DEPT_ORDER_DEFAULT);
sysDept.setParentId(operatingCompanyDeptId);
sysDept.setStatus(DEPT_NORMAL);
sysDeptManager.insertDept(sysDept);
baseUserDTO.setDeptId(sysDept.getDeptId());
baseUserDTO.setDept(sysDept);
} else {
//不需要创建时直接使用运营公司部门
baseUserDTO.setDeptId(operatingCompanyDeptId);
}
sysUserService.insertUser(baseUserDTO);
//同步子模块数据
ZdyModuleNameEnum moduleName = sysManagerRoleEnum.getModuleName();
if (Objects.nonNull(moduleName)) {
ParentBaseCommonService service = zdyModuleFactory.getBean(sysManagerRoleEnum.getModuleName(),
ParentBaseCommonService.class);
if (Objects.nonNull(service)) {
service.addManagerUser(baseUserDTO);
}
}
} else if (Objects.equals(baseUserDTO.getUserType(), Constants.MANAGER_NO)) {
sysUserService.insertUser(baseUserDTO);
} else {
throw new ServiceException("不支持的员工类型");
}
}
/**
* 修改岗位
*
* @param sysRole 岗位信息
* @return 结果
*/
@Transactional
@Override
public int editRole(SysRole sysRole) {
int i = sysRoleMapper.updateRole(sysRole);
roleDeptMapper.deleteRoleDeptByRoleId(sysRole.getRoleId());
insertRoleDept(sysRole.getRoleId());
return i;
}
/**
* 添加岗位
*
* @param sysRole 岗位信息
* @return 结果
*/
@Transactional
@Override
public int addRole(SysRole sysRole) {
int i = sysRoleMapper.insertRole(sysRole);
//角色部门关联
insertRoleDept(sysRole.getRoleId());
return i;
}
/**
* 查询管理员岗位
*
* @param sysRole 岗位查询参数
* @return 岗位信息
*/
@DataScope(deptAlias = "d")
@Override
public List<SysRole> queryManageRole(SysRole sysRole) {
sysRole.setManager("1");
sysRole.setDeptId(SecurityUtils.getDeptId());
return sysRoleMapper.listByManager(sysRole);
}
/**
* 查询管理员岗位
*
* @param sysRole 查询参数
* @return 管理员岗位列表
*/
@Override
public List<SysRole> selectRoleList(SysRole sysRole) {
return sysRoleMapper.roleListDataScope(sysRole);
}
/**
* 校验角色名称是否唯一
*
* @param role 角色信息
* @return 结果
*/
@Override
public boolean checkRoleNameUniqueDept(SysRole role) {
long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
SysRole info = sysRoleMapper.checkRoleNameUniqueDept(role.getRoleName(), role.getDeptId());
if (StringUtils.isNotNull(info) && info.getRoleId() != roleId) {
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
/**
* 校验角色权限是否唯一
*
* @param role 角色信息
* @return 结果
*/
@Override
public boolean checkRoleKeyUniqueDept(SysRole role) {
long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
SysRole info = sysRoleMapper.checkRoleKeyUniqueDept(role.getRoleName(), role.getDeptId());
if (StringUtils.isNotNull(info) && info.getRoleId() != roleId) {
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
/**
* 添加用户角色关联
*
* @param roleId 角色id
*/
private void insertRoleDept(Long roleId) {
//角色部门关联
SysRoleDept sysRoleDept = new SysRoleDept();
sysRoleDept.setDeptId(SecurityUtils.getDeptId());
sysRoleDept.setRoleId(roleId);
roleDeptMapper.batchRoleDept(Collections.singletonList(sysRoleDept));
}
}

View File

@@ -0,0 +1,213 @@
package com.zhwl.base.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.zhwl.base.domain.ZdyHolidayVacations;
import com.zhwl.base.enums.HolidayVacationEnum;
import com.zhwl.base.mapper.ZdyHolidayVacationsMapper;
import com.zhwl.base.service.IZdyHolidayVacationsService;
import com.zhwl.common.enums.DictTypeEnum;
import com.zhwl.common.exception.ServiceException;
import com.zhwl.common.utils.DateUtils;
import com.zhwl.common.utils.DictUtils;
import com.zhwl.common.utils.MybatisBatchUtils;
import com.zhwl.common.utils.StringUtils;
import com.zhwl.common.utils.http.HttpUtils;
import com.zhwl.system.service.ISysConfigService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.*;
import java.time.temporal.ChronoUnit;
import java.util.*;
/**
* 节假日管理Service业务层处理
*
* @author wangxing
* @date 2024-08-20
*/
@Slf4j
@Service
@RequiredArgsConstructor
public class ZdyHolidayVacationsServiceImpl implements IZdyHolidayVacationsService {
private final ZdyHolidayVacationsMapper zdyHolidayVacationsMapper;
private final ISysConfigService sysConfigService;
private final MybatisBatchUtils mybatisBatchUtils;
/**
* 查询节假日管理
*
* @param id 节假日管理主键
* @return 节假日管理
*/
@Override
public ZdyHolidayVacations selectZdyHolidayVacationsById(Long id) {
return zdyHolidayVacationsMapper.selectZdyHolidayVacationsById(id);
}
/**
* 查询节假日管理列表
*
* @param zdyHolidayVacations 节假日管理
* @return 节假日管理
*/
@Override
public List<ZdyHolidayVacations> selectZdyHolidayVacationsList(ZdyHolidayVacations zdyHolidayVacations) {
return zdyHolidayVacationsMapper.selectZdyHolidayVacationsList(zdyHolidayVacations);
}
/**
* 新增节假日管理
*
* @param zdyHolidayVacations 节假日管理
* @return 结果
*/
@Override
public int insertZdyHolidayVacations(ZdyHolidayVacations zdyHolidayVacations) {
zdyHolidayVacations.setCreateTime(DateUtils.getNowDate());
zdyHolidayVacations.setEndTime(DateUtils.getEndOfDay(zdyHolidayVacations.getEndTime()));
return zdyHolidayVacationsMapper.insertZdyHolidayVacations(zdyHolidayVacations);
}
/**
* 修改节假日管理
*
* @param zdyHolidayVacations 节假日管理
* @return 结果
*/
@Override
public int updateZdyHolidayVacations(ZdyHolidayVacations zdyHolidayVacations) {
zdyHolidayVacations.setUpdateTime(DateUtils.getNowDate());
zdyHolidayVacations.setEndTime(DateUtils.getEndOfDay(zdyHolidayVacations.getEndTime()));
return zdyHolidayVacationsMapper.updateZdyHolidayVacations(zdyHolidayVacations);
}
/**
* 批量删除节假日管理
*
* @param ids 需要删除的节假日管理主键
* @return 结果
*/
@Override
public int deleteZdyHolidayVacationsByIds(Long[] ids) {
return zdyHolidayVacationsMapper.deleteZdyHolidayVacationsByIds(ids);
}
/**
* 删除节假日管理信息
*
* @param id 节假日管理主键
* @return 结果
*/
@Override
public int deleteZdyHolidayVacationsById(Long id) {
return zdyHolidayVacationsMapper.deleteZdyHolidayVacationsById(id);
}
/**
* 同步节假日管理信息
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void syncHolidayVacations(String year) {
String url = sysConfigService.selectConfigByKey("holidays_vacations_url");
if (StringUtils.isEmpty(url)) {
throw new ServiceException("请配置节假日同步URL!");
}
List<ZdyHolidayVacations> list = new ArrayList<>();
if (StringUtils.isNotEmpty(year)) {
List<ZdyHolidayVacations> yearList = this.holidayListByYear(Integer.parseInt(year), new ZdyHolidayVacations());
if (StringUtils.isNotEmpty(yearList)) {
return;
}
this.addHoliday(url + year, list);
} else {
//执行时有可能当年和下一年假期已全部更新
LocalDate currentDate = LocalDate.now();
List<ZdyHolidayVacations> yearList = this.holidayListByYear(currentDate.getYear(), new ZdyHolidayVacations());
if (StringUtils.isEmpty(yearList)) {
this.addHoliday(url + currentDate.getYear(), list);
}
// 日期向后加一年
LocalDate nextYearDate = currentDate.plusYears(1);
List<ZdyHolidayVacations> nextYearList = this.holidayListByYear(nextYearDate.getYear(), new ZdyHolidayVacations());
if (StringUtils.isEmpty(nextYearList)) {
this.addHoliday(url + nextYearDate.getYear(), list);
}
}
if (StringUtils.isEmpty(list)) {
return;
}
mybatisBatchUtils.batchUpdateOrInsert(list, ZdyHolidayVacationsMapper.class, (d, m) -> m.insertZdyHolidayVacations(d));
}
@Override
public List<ZdyHolidayVacations> holidayListByYear(int year, ZdyHolidayVacations zdyHolidayVacations) {
Year year1 = Year.of(year);
LocalDateTime startDateTime = year1.atDay(1).atStartOfDay();
LocalDateTime endDateTime = year1.atMonth(Month.DECEMBER).atEndOfMonth().atTime(LocalTime.MAX)
.truncatedTo(ChronoUnit.SECONDS);
zdyHolidayVacations.setRangeStartDateTime(startDateTime);
zdyHolidayVacations.setRangeEndDateTime(endDateTime);
return Optional.ofNullable(zdyHolidayVacationsMapper.selectZdyHolidayVacationsList(zdyHolidayVacations))
.orElse(Collections.emptyList());
}
private void addHoliday(String url, List<ZdyHolidayVacations> holidayVacationsList) {
try {
log.info("节假日同步URL:{}", url);
String result = HttpUtils.sendGet(url);
log.info("节假日同步数据:{}", result);
JSONObject entries = JSONUtil.parseObj(result);
JSONObject holiday = entries.getJSONObject("holiday");
Map<String, List<Date>> map = new HashMap<>();
for (HolidayVacationEnum vacationEnum : HolidayVacationEnum.values()) {
List<Date> list = new ArrayList<>();
holiday.forEach((key, value) -> {
JSONObject v = (JSONObject) value;
Boolean flag = v.getBool("holiday");
if (flag) {
String name = v.getStr("name");
String date = v.getStr("date");
if (Objects.equals(HolidayVacationEnum.SPRING_FESTIVAL.getName(), vacationEnum.getName())) {
if (name.startsWith("除夕") || name.startsWith("") || Objects.equals(HolidayVacationEnum.SPRING_FESTIVAL.getName(), name)) {
list.add(DateUtils.parseDate(date));
}
} else {
if (Objects.equals(name, vacationEnum.getName())) {
list.add(DateUtils.parseDate(date));
}
}
}
});
map.put(vacationEnum.getName(), list);
}
log.info("节假日数据:{}", map);
for (String key : map.keySet()) {
ZdyHolidayVacations zdyHolidayVacations = new ZdyHolidayVacations();
zdyHolidayVacations.setHolidayName(key);
List<Date> dates = map.get(key);
if (StringUtils.isEmpty(dates)) {
continue;
}
Date maxDate = Collections.max(dates);
Date minDate = Collections.min(dates);
zdyHolidayVacations.setStartTime(minDate);
zdyHolidayVacations.setEndTime(DateUtils.getEndOfDay(maxDate));
zdyHolidayVacations.setHolidayType(HolidayVacationEnum.getHolidayVacationTypeByName(key));
zdyHolidayVacations.setCreateTime(DateUtils.getNowDate());
zdyHolidayVacations.setHolidayDict(DictUtils.getDictValue(DictTypeEnum.HOLIDAY_TYPE.getType(), key));
holidayVacationsList.add(zdyHolidayVacations);
}
} catch (Exception e) {
throw new ServiceException("同步节假日异常,请稍后重试!");
}
}
}

View File

@@ -0,0 +1,203 @@
<?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="com.zhwl.base.mapper.ZdyBaseCompanyMapper">
<resultMap type="ZdyBaseCompany" id="ZdyBaseCompanyResult">
<result property="id" column="id"/>
<result property="companyName" column="company_name"/>
<result property="deptId" column="dept_id"/>
<result property="address" column="address"/>
<result property="legal" column="legal"/>
<result property="phone" column="phone"/>
<result property="enterpriseCode" column="enterprise_code"/>
<result property="businessLicense" column="business_license"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
<result property="updateTime" column="update_time"/>
<result property="updateBy" column="update_by"/>
<result property="remark" column="remark"/>
</resultMap>
<sql id="selectZdyBaseCompanyVo">
select id,
company_name,
dept_id,
address,
legal,
phone,
enterprise_code,
business_license,
create_time,
create_by,
update_time,
update_by,
remark
from zdy_base_company
</sql>
<select id="selectZdyBaseCompanyList" parameterType="ZdyBaseCompany" resultMap="ZdyBaseCompanyResult">
<include refid="selectZdyBaseCompanyVo"/>
<where>
<if test="companyName != null and companyName != ''">
and company_name like concat('%', #{companyName}, '%')
</if>
<if test="address != null and address != ''">
and address = #{address}
</if>
<if test="legal != null and legal != ''">
and legal = #{legal}
</if>
<if test="phone != null and phone != ''">
and phone = #{phone}
</if>
<if test="enterpriseCode != null and enterpriseCode != ''">
and enterprise_code = #{enterpriseCode}
</if>
<if test="businessLicense != null and businessLicense != ''">
and business_license = #{businessLicense}
</if>
<if test="deptId != null">
and dept_id = #{deptId}
</if>
</where>
</select>
<select id="selectZdyBaseCompanyById" parameterType="Long"
resultMap="ZdyBaseCompanyResult">
<include refid="selectZdyBaseCompanyVo"/>
where id = #{id}
</select>
<insert id="insertZdyBaseCompany" parameterType="ZdyBaseCompany" useGeneratedKeys="true"
keyProperty="id">
insert into zdy_base_company
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="companyName != null">company_name,
</if>
<if test="address != null">address,
</if>
<if test="legal != null">legal,
</if>
<if test="phone != null">phone,
</if>
<if test="enterpriseCode != null">enterprise_code,
</if>
<if test="businessLicense != null">business_license,
</if>
<if test="createTime != null">create_time,
</if>
<if test="createBy != null">create_by,
</if>
<if test="updateTime != null">update_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="remark != null">remark,
</if>
<if test="deptId != null">dept_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="companyName != null">#{companyName},
</if>
<if test="address != null">#{address},
</if>
<if test="legal != null">#{legal},
</if>
<if test="phone != null">#{phone},
</if>
<if test="enterpriseCode != null">#{enterpriseCode},
</if>
<if test="businessLicense != null">#{businessLicense},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="remark != null">#{remark},
</if>
<if test="deptId != null">#{deptId},
</if>
</trim>
</insert>
<update id="updateZdyBaseCompany" parameterType="ZdyBaseCompany">
update zdy_base_company
<trim prefix="SET" suffixOverrides=",">
<if test="companyName != null">company_name =
#{companyName},
</if>
<if test="address != null">address =
#{address},
</if>
<if test="legal != null">legal =
#{legal},
</if>
<if test="phone != null">phone =
#{phone},
</if>
<if test="enterpriseCode != null">enterprise_code =
#{enterpriseCode},
</if>
<if test="businessLicense != null">business_license =
#{businessLicense},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="remark != null">remark =
#{remark},
</if>
<if test="deptId != null">dept_id =
#{deptId},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteZdyBaseCompanyById" parameterType="Long">
delete
from zdy_base_company
where id = #{id}
</delete>
<delete id="deleteZdyBaseCompanyByIds" parameterType="String">
delete from zdy_base_company where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="updateZdyBaseCompanyByDeptId" parameterType="ZdyBaseCompany">
update zdy_base_company
set company_name = #{companyName}
where dept_id = #{deptId}
</update>
<select id="selectZdyBaseCompanyByDeptId" parameterType="Long"
resultMap="ZdyBaseCompanyResult">
<include refid="selectZdyBaseCompanyVo"/>
where dept_id = #{deptId} limit 1
</select>
<select id="countByCompanyName" resultType="int">
select count(1)
from zdy_base_company
where company_name = #{companyName}
</select>
</mapper>

View File

@@ -0,0 +1,138 @@
<?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="com.zhwl.base.mapper.ZdyBaseEmployeeCardLogMapper">
<resultMap type="ZdyBaseEmployeeCardLog" id="ZdyBaseEmployeeCardLogResult">
<result property="id" column="id"/>
<result property="cardNo" column="card_no"/>
<result property="employeeId" column="employee_id"/>
<result property="employeeName" column="employee_name"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
<result property="updateTime" column="update_time"/>
<result property="updateBy" column="update_by"/>
<result property="remark" column="remark"/>
</resultMap>
<sql id="selectZdyBaseEmployeeCardLogVo">
select id,
card_no,
employee_id,
employee_name,
create_time,
create_by,
update_time,
update_by,
remark
from zdy_base_employee_card_log
</sql>
<select id="selectZdyBaseEmployeeCardLogList" parameterType="ZdyBaseEmployeeCardLog"
resultMap="ZdyBaseEmployeeCardLogResult">
<include refid="selectZdyBaseEmployeeCardLogVo"/>
<where>
<if test="cardNo != null and cardNo != ''">
and card_no = #{cardNo}
</if>
<if test="employeeId != null ">
and employee_id = #{employeeId}
</if>
<if test="employeeName != null and employeeName != ''">
and employee_name like concat('%', #{employeeName}, '%')
</if>
</where>
</select>
<select id="selectZdyBaseEmployeeCardLogById" parameterType="Long"
resultMap="ZdyBaseEmployeeCardLogResult">
<include refid="selectZdyBaseEmployeeCardLogVo"/>
where id = #{id}
</select>
<insert id="insertZdyBaseEmployeeCardLog" parameterType="ZdyBaseEmployeeCardLog" useGeneratedKeys="true"
keyProperty="id">
insert into zdy_base_employee_card_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="cardNo != null">card_no,
</if>
<if test="employeeId != null">employee_id,
</if>
<if test="employeeName != null">employee_name,
</if>
<if test="createTime != null">create_time,
</if>
<if test="createBy != null">create_by,
</if>
<if test="updateTime != null">update_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="remark != null">remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="cardNo != null">#{cardNo},
</if>
<if test="employeeId != null">#{employeeId},
</if>
<if test="employeeName != null">#{employeeName},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="remark != null">#{remark},
</if>
</trim>
</insert>
<update id="updateZdyBaseEmployeeCardLog" parameterType="ZdyBaseEmployeeCardLog">
update zdy_base_employee_card_log
<trim prefix="SET" suffixOverrides=",">
<if test="cardNo != null">card_no =
#{cardNo},
</if>
<if test="employeeId != null">employee_id =
#{employeeId},
</if>
<if test="employeeName != null">employee_name =
#{employeeName},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="remark != null">remark =
#{remark},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteZdyBaseEmployeeCardLogById" parameterType="Long">
delete
from zdy_base_employee_card_log
where id = #{id}
</delete>
<delete id="deleteZdyBaseEmployeeCardLogByIds" parameterType="String">
delete from zdy_base_employee_card_log where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,149 @@
<?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="com.zhwl.base.mapper.ZdyBaseEmployeeCardMapper">
<resultMap type="ZdyBaseEmployeeCard" id="ZdyBaseEmployeeCardResult">
<result property="id" column="id"/>
<result property="cardNo" column="card_no"/>
<result property="cardStatus" column="card_status"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
<result property="updateTime" column="update_time"/>
<result property="updateBy" column="update_by"/>
<result property="remark" column="remark"/>
<result property="employeeName" column="employeeName"/>
<result property="deptId" column="dept_id"/>
</resultMap>
<sql id="selectZdyBaseEmployeeCardVo">
SELECT
bec.id,
bec.card_no,
bec.card_status,
bec.create_time,
bec.create_by,
bec.update_time,
bec.update_by,
bec.remark,
be.NAME AS employeeName,
bec.dept_id
FROM
zdy_base_employee_card bec
LEFT JOIN zdy_base_employee be ON bec.card_no = be.card_no
</sql>
<select id="selectZdyBaseEmployeeCardList" parameterType="ZdyBaseEmployeeCard"
resultMap="ZdyBaseEmployeeCardResult">
<include refid="selectZdyBaseEmployeeCardVo"/>
left join sys_dept d on d.dept_id = bec.dept_id
<where>
<if test="cardNo != null and cardNo != ''">
and bec.card_no = #{cardNo}
</if>
<if test="cardStatus != null ">
and bec.card_status = #{cardStatus}
</if>
${params.dataScope}
</where>
</select>
<select id="selectZdyBaseEmployeeCardById" parameterType="Long"
resultMap="ZdyBaseEmployeeCardResult">
<include refid="selectZdyBaseEmployeeCardVo"/>
where bec.id = #{id}
</select>
<insert id="insertZdyBaseEmployeeCard" parameterType="ZdyBaseEmployeeCard" useGeneratedKeys="true"
keyProperty="id">
insert into zdy_base_employee_card
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="cardNo != null">card_no,
</if>
<if test="cardStatus != null">card_status,
</if>
<if test="createTime != null">create_time,
</if>
<if test="createBy != null">create_by,
</if>
<if test="updateTime != null">update_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="remark != null">remark,
</if>
<if test="deptId != null">dept_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="cardNo != null">#{cardNo},
</if>
<if test="cardStatus != null">#{cardStatus},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="remark != null">#{remark},
</if>
<if test="deptId != null">#{deptId},
</if>
</trim>
</insert>
<update id="updateZdyBaseEmployeeCard" parameterType="ZdyBaseEmployeeCard">
update zdy_base_employee_card
<trim prefix="SET" suffixOverrides=",">
<if test="cardNo != null">card_no =
#{cardNo},
</if>
<if test="cardStatus != null">card_status =
#{cardStatus},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="remark != null">remark =
#{remark},
</if>
<if test="deptId != null">dept_id =
#{deptId},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteZdyBaseEmployeeCardById" parameterType="Long">
delete
from zdy_base_employee_card
where id = #{id}
</delete>
<delete id="deleteZdyBaseEmployeeCardByIds" parameterType="String">
delete from zdy_base_employee_card where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectZdyBaseEmployeeCardByCardNo" parameterType="String"
resultMap="ZdyBaseEmployeeCardResult">
<include refid="selectZdyBaseEmployeeCardVo"/>
where bec.card_no = #{cardNo} limit 1
</select>
</mapper>

View File

@@ -0,0 +1,309 @@
<?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="com.zhwl.base.mapper.ZdyBaseEmployeeMapper">
<resultMap type="ZdyBaseEmployee" id="ZdyBaseEmployeeResult">
<result property="id" column="id"/>
<result property="companyId" column="company_id"/>
<result property="name" column="name"/>
<result property="phone" column="phone"/>
<result property="idCard" column="id_card"/>
<result property="cardNo" column="card_no"/>
<result property="cardId" column="card_id"/>
<result property="sex" column="sex"/>
<result property="duty" column="duty"/>
<result property="employeeStatus" column="employee_status"/>
<result property="delFlag" column="del_flag"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
<result property="updateTime" column="update_time"/>
<result property="updateBy" column="update_by"/>
<result property="remark" column="remark"/>
<result property="companyName" column="company_name"/>
<result property="deptId" column="dept_id"/>
</resultMap>
<resultMap type="ZdyEmployeeCardGraph" id="ZdyEmployeeCardGraphResult">
<result property="dataTime" column="data_time"/>
<result property="cardNo" column="card_no"/>
<result property="deviceName" column="device_name"/>
<result property="employeeName" column="name"/>
<result property="employeePhone" column="phone"/>
<result property="employeeId" column="employee_id"/>
<result property="openDoor" column="open_door"/>
<result property="serial" column="serial"/>
</resultMap>
<sql id="selectZdyBaseEmployeeVo">
select be.id,
be.company_id,
be.name,
be.phone,
be.id_card,
be.card_no,
be.card_id,
be.sex,
be.duty,
be.employee_status,
be.del_flag,
be.create_time,
be.create_by,
be.update_time,
be.update_by,
be.remark,
bc.company_name,
be.dept_id
from zdy_base_employee be
left join zdy_base_company bc on be.company_id = bc.id
</sql>
<sql id = "whereZdyEmployeeCardGraph">
<if test="cardNo != null and cardNo != ''">
and l.card_no = #{cardNo}
</if>
<if test="openDoor != null">
and l.open_door = #{openDoor}
</if>
<if test="deviceName != null and deviceName != ''">
and g.device_name like concat('%', #{deviceName}, '%')
</if>
<if test="employeeName != null and employeeName != ''">
and be.name like concat('%', #{employeeName}, '%')
</if>
<if test="employeePhone != null and employeePhone != ''">
and be.phone = #{employeePhone}
</if>
<if test="params.beginDataTime != null and params.beginDataTime != '' and params.endDataTime != null and params.endDataTime != ''">
and l.create_time between #{params.beginDataTime} and #{params.endDataTime}
</if>
</sql>
<sql id = "whereInZdyEmployeeCardGraph">
<if test="cardNo != null and cardNo != ''">
and l.card_no = #{cardNo}
</if>
<if test="openDoor != null">
and l.open_door = #{openDoor}
</if>
<if test="deviceName != null and deviceName != ''">
and l.serial in (select serial_no from zdy_device_gate where device_name like concat('%', #{deviceName}, '%') )
</if>
<if test="employeeName != null and employeeName != ''">
and be.name like concat('%', #{employeeName}, '%')
</if>
<if test="employeePhone != null and employeePhone != ''">
and be.phone = #{employeePhone}
</if>
<if test="params.beginDataTime != null and params.beginDataTime != '' and params.endDataTime != null and params.endDataTime != ''">
and l.create_time between #{params.beginDataTime} and #{params.endDataTime}
</if>
</sql>
<select id="selectZdyBaseEmployeeList" parameterType="ZdyBaseEmployee" resultMap="ZdyBaseEmployeeResult">
<include refid="selectZdyBaseEmployeeVo"/>
left join sys_dept d on d.dept_id = be.dept_id
<where>
be.del_flag = 0
<if test="companyId != null ">
and be.company_id = #{companyId}
</if>
<if test="name != null and name != ''">
and be.name like concat('%', #{name}, '%')
</if>
<if test="phone != null and phone != ''">
and be.phone = #{phone}
</if>
<if test="idCard != null and idCard != ''">
and be.id_card = #{idCard}
</if>
<if test="cardNo != null and cardNo != ''">
and be.card_no = #{cardNo}
</if>
<if test="cardId != null ">
and be.card_id = #{cardId}
</if>
<if test="sex != null and sex != ''">
and be.sex = #{sex}
</if>
<if test="duty != null and duty != ''">
and be.duty = #{duty}
</if>
<if test="employeeStatus != null ">
and be.employee_status = #{employeeStatus}
</if>
${params.dataScope}
</where>
</select>
<select id="selectZdyBaseEmployeeById" parameterType="Long"
resultMap="ZdyBaseEmployeeResult">
<include refid="selectZdyBaseEmployeeVo"/>
where be.id = #{id}
</select>
<insert id="insertZdyBaseEmployee" parameterType="ZdyBaseEmployee" useGeneratedKeys="true"
keyProperty="id">
insert into zdy_base_employee
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="companyId != null">company_id,
</if>
<if test="name != null">name,
</if>
<if test="phone != null">phone,
</if>
<if test="idCard != null">id_card,
</if>
<if test="cardNo != null">card_no,
</if>
<if test="cardId != null">card_id,
</if>
<if test="sex != null">sex,
</if>
<if test="duty != null">duty,
</if>
<if test="employeeStatus != null">employee_status,
</if>
<if test="delFlag != null">del_flag,
</if>
<if test="createTime != null">create_time,
</if>
<if test="createBy != null">create_by,
</if>
<if test="updateTime != null">update_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="remark != null">remark,
</if>
<if test="deptId != null">dept_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="companyId != null">#{companyId},
</if>
<if test="name != null">#{name},
</if>
<if test="phone != null">#{phone},
</if>
<if test="idCard != null">#{idCard},
</if>
<if test="cardNo != null">#{cardNo},
</if>
<if test="cardId != null">#{cardId},
</if>
<if test="sex != null">#{sex},
</if>
<if test="duty != null">#{duty},
</if>
<if test="employeeStatus != null">#{employeeStatus},
</if>
<if test="delFlag != null">#{delFlag},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="remark != null">#{remark},
</if>
<if test="deptId != null">#{deptId},
</if>
</trim>
</insert>
<update id="updateZdyBaseEmployee" parameterType="ZdyBaseEmployee">
update zdy_base_employee
<trim prefix="SET" suffixOverrides=",">
<if test="companyId != null">company_id =
#{companyId},
</if>
<if test="name != null">name =
#{name},
</if>
<if test="phone != null">phone =
#{phone},
</if>
<if test="idCard != null">id_card =
#{idCard},
</if>
<if test="cardNo != null">card_no =
#{cardNo},
</if>
<if test="cardId != null">card_id =
#{cardId},
</if>
<if test="sex != null">sex =
#{sex},
</if>
<if test="duty != null">duty =
#{duty},
</if>
<if test="employeeStatus != null">employee_status =
#{employeeStatus},
</if>
<if test="delFlag != null">del_flag =
#{delFlag},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="remark != null">remark =
#{remark},
</if>
<if test="deptId != null">dept_id =
#{deptId},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteZdyBaseEmployeeById" parameterType="Long">
delete
from zdy_base_employee
where id = #{id}
</delete>
<delete id="deleteZdyBaseEmployeeByIds" parameterType="String">
delete from zdy_base_employee where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectEmployeeByIdCardAndPhone" resultMap="ZdyBaseEmployeeResult">
<include refid="selectZdyBaseEmployeeVo"/>
where be.id_card = #{idCard} and be.phone = #{phone} and be.del_flag = 0 limit 1
</select>
<select id="selectZdyBaseEmployeeByCardNo" parameterType="String"
resultMap="ZdyBaseEmployeeResult">
<include refid="selectZdyBaseEmployeeVo"/>
where be.card_no = #{cardNo} and del_flag = 0 limit 1
</select>
<select id="selectZdyEmployeeCardGraphList" resultMap="ZdyEmployeeCardGraphResult">
SELECT
l.create_time AS data_time, l.serial, l.card_no, l.open_door, g.device_name, be.name, be.phone, l.employee_id
FROM zdy_device_gate_card_log l
LEFT JOIN zdy_base_employee be ON be.id = l.employee_id
LEFT JOIN zdy_device_gate g ON g.serial_no = l.serial
left join sys_dept d on d.dept_id = be.dept_id
WHERE l.type = '0' and l.employee_id is not null and be.id is not null and g.del_flag != 1
<include refid="whereZdyEmployeeCardGraph"/>
${params.dataScope}
order by l.id desc
</select>
</mapper>

View File

@@ -0,0 +1,204 @@
<?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="com.zhwl.base.mapper.ZdyBaseOnlinePlatformMapper">
<resultMap type="ZdyBaseOnlinePlatform" id="ZdyBaseOnlinePlatformResult">
<result property="id" column="id"/>
<result property="appid" column="appid"/>
<result property="appName" column="app_name"/>
<result property="scenicId" column="scenic_id"/>
<result property="serviceChannel" column="service_channel"/>
<result property="bodyInfo" column="body_info"/>
<result property="authenticationStatus" column="authentication_status"/>
<result property="registrationStatus" column="registration_status"/>
<result property="authorizationTime" column="authorization_time"/>
<result property="qrCode" column="qr_code"/>
<result property="image" column="image"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
<result property="updateTime" column="update_time"/>
<result property="updateBy" column="update_by"/>
<result property="remark" column="remark"/>
</resultMap>
<sql id="selectZdyBaseOnlinePlatformVo">
select id, appid,scenic_id, app_name, service_channel, body_info, authentication_status, registration_status, authorization_time, qr_code, image, create_time, create_by, update_time, update_by, remark
from zdy_base_online_platform
</sql>
<select id="selectZdyBaseOnlinePlatformList" parameterType="ZdyBaseOnlinePlatform" resultMap="ZdyBaseOnlinePlatformResult">
<include refid="selectZdyBaseOnlinePlatformVo"/>
<where>
<if test="appid != null and appid != ''">
and appid = #{appid}
</if>
<if test="appName != null and appName != ''">
and app_name like concat('%', #{appName}, '%')
</if>
<if test="serviceChannel != null and serviceChannel != ''">
and service_channel = #{serviceChannel}
</if>
<if test="bodyInfo != null and bodyInfo != ''">
and body_info = #{bodyInfo}
</if>
<if test="authenticationStatus != null and authenticationStatus != ''">
and authentication_status = #{authenticationStatus}
</if>
<if test="registrationStatus != null ">
and registration_status = #{registrationStatus}
</if>
<if test="authorizationTime != null ">
and authorization_time = #{authorizationTime}
</if>
<if test="qrCode != null and qrCode != ''">
and qr_code = #{qrCode}
</if>
<if test="image != null and image != ''">
and image = #{image}
</if>
<if test="scenicId != null">
and scenic_id = #{scenicId}
</if>
</where>
</select>
<select id="selectZdyBaseOnlinePlatformById" parameterType="Long"
resultMap="ZdyBaseOnlinePlatformResult">
<include refid="selectZdyBaseOnlinePlatformVo"/>
where id = #{id}
</select>
<insert id="insertZdyBaseOnlinePlatform" parameterType="ZdyBaseOnlinePlatform" useGeneratedKeys="true"
keyProperty="id">
insert into zdy_base_online_platform
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="appid != null">appid,
</if>
<if test="appName != null">app_name,
</if>
<if test="serviceChannel != null">service_channel,
</if>
<if test="bodyInfo != null">body_info,
</if>
<if test="authenticationStatus != null">authentication_status,
</if>
<if test="registrationStatus != null">registration_status,
</if>
<if test="authorizationTime != null">authorization_time,
</if>
<if test="qrCode != null">qr_code,
</if>
<if test="image != null">image,
</if>
<if test="createTime != null">create_time,
</if>
<if test="createBy != null">create_by,
</if>
<if test="updateTime != null">update_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="remark != null">remark,
</if>
<if test="scenicId != null">scenic_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="appid != null">#{appid},
</if>
<if test="appName != null">#{appName},
</if>
<if test="serviceChannel != null">#{serviceChannel},
</if>
<if test="bodyInfo != null">#{bodyInfo},
</if>
<if test="authenticationStatus != null">#{authenticationStatus},
</if>
<if test="registrationStatus != null">#{registrationStatus},
</if>
<if test="authorizationTime != null">#{authorizationTime},
</if>
<if test="qrCode != null">#{qrCode},
</if>
<if test="image != null">#{image},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="remark != null">#{remark},
</if>
<if test="scenicId != null">#{scenicId},
</if>
</trim>
</insert>
<update id="updateZdyBaseOnlinePlatform" parameterType="ZdyBaseOnlinePlatform">
update zdy_base_online_platform
<trim prefix="SET" suffixOverrides=",">
<if test="appid != null">appid =
#{appid},
</if>
<if test="appName != null">app_name =
#{appName},
</if>
<if test="serviceChannel != null">service_channel =
#{serviceChannel},
</if>
<if test="bodyInfo != null">body_info =
#{bodyInfo},
</if>
<if test="authenticationStatus != null">authentication_status =
#{authenticationStatus},
</if>
<if test="registrationStatus != null">registration_status =
#{registrationStatus},
</if>
<if test="authorizationTime != null">authorization_time =
#{authorizationTime},
</if>
<if test="qrCode != null">qr_code =
#{qrCode},
</if>
<if test="image != null">image =
#{image},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="remark != null">remark =
#{remark},
</if>
<if test="scenicId != null">scenic_id =
#{scenicId},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteZdyBaseOnlinePlatformById" parameterType="Long">
delete from zdy_base_online_platform where id = #{id}
</delete>
<delete id="deleteZdyBaseOnlinePlatformByIds" parameterType="String">
delete from zdy_base_online_platform where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,132 @@
<?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="com.zhwl.base.mapper.ZdyBasePackageMapper">
<resultMap type="ZdyBasePackage" id="ZdyBasePackageResult">
<result property="id" column="id"/>
<result property="version" column="version"/>
<result property="content" column="content"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
<result property="updateTime" column="update_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateType" column="update_type"/>
<result property="updatePackage" column="update_package"/>
</resultMap>
<sql id="selectZdyBasePackageVo">
select id, version, content, create_time, create_by, update_time, update_by,update_type,update_package
from zdy_base_package
</sql>
<select id="selectZdyBasePackageList" parameterType="ZdyBasePackage" resultMap="ZdyBasePackageResult">
<include refid="selectZdyBasePackageVo"/>
<where>
<if test="version != null and version != ''">
and version = #{version}
</if>
<if test="updateType != null and updateType != ''">
and update_type = #{updateType}
</if>
</where>
order by create_time desc
</select>
<select id="selectZdyBasePackageById" parameterType="Long"
resultMap="ZdyBasePackageResult">
<include refid="selectZdyBasePackageVo"/>
where id = #{id}
</select>
<insert id="insertZdyBasePackage" parameterType="ZdyBasePackage" useGeneratedKeys="true"
keyProperty="id">
insert into zdy_base_package
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="version != null and version != ''">version,
</if>
<if test="content != null">content,
</if>
<if test="createTime != null">create_time,
</if>
<if test="createBy != null">create_by,
</if>
<if test="updateTime != null">update_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="updateType != null">update_type,
</if>
<if test="updatePackage != null">update_package,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="version != null and version != ''">#{version},
</if>
<if test="content != null">#{content},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="updateType != null">#{updateType},
</if>
<if test="updatePackage != null">#{updatePackage},
</if>
</trim>
</insert>
<update id="updateZdyBasePackage" parameterType="ZdyBasePackage">
update zdy_base_package
<trim prefix="SET" suffixOverrides=",">
<if test="version != null and version != ''">version =
#{version},
</if>
<if test="content != null">content =
#{content},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="updateType != null">update_type =
#{updateType},
</if>
<if test="updatePackage != null">update_package =
#{updatePackage},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteZdyBasePackageById" parameterType="Long">
delete
from zdy_base_package
where id = #{id}
</delete>
<delete id="deleteZdyBasePackageByIds" parameterType="String">
delete from zdy_base_package where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectZdyBasePackage" resultMap="ZdyBasePackageResult">
<include refid="selectZdyBasePackageVo"/>
where update_type = #{updateType} and version = #{version} limit 1
</select>
</mapper>

View File

@@ -0,0 +1,187 @@
<?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="com.zhwl.base.mapper.ZdyHolidayVacationsMapper">
<resultMap type="ZdyHolidayVacations" id="ZdyHolidayVacationsResult">
<result property="id" column="id"/>
<result property="holidayName" column="holiday_name"/>
<result property="holidayType" column="holiday_type"/>
<result property="startTime" column="start_time"/>
<result property="endTime" column="end_time"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
<result property="updateTime" column="update_time"/>
<result property="updateBy" column="update_by"/>
<result property="remark" column="remark"/>
<result property="holidayDict" column="holiday_dict"/>
</resultMap>
<sql id="selectZdyHolidayVacationsVo">
select id,
holiday_name,
holiday_type,
start_time,
end_time,
create_time,
create_by,
update_time,
update_by,
remark,
holiday_dict
from zdy_holiday_vacations
</sql>
<select id="selectZdyHolidayVacationsList" parameterType="ZdyHolidayVacations"
resultMap="ZdyHolidayVacationsResult">
<include refid="selectZdyHolidayVacationsVo"/>
<where>
<if test="holidayName != null and holidayName != ''">
and holiday_name like concat('%', #{holidayName}, '%')
</if>
<if test="holidayType != null and holidayType != ''">
and holiday_type = #{holidayType}
</if>
<if test="startTime != null ">
and start_time = #{startTime}
</if>
<if test="endTime != null ">
and end_time = #{endTime}
</if>
<if test="rangeStartDateTime != null ">
and start_time &gt;= #{rangeStartDateTime}
</if>
<if test="rangeEndDateTime != null ">
and start_time &lt;= #{rangeEndDateTime}
</if>
<if test="holidayDict != null ">
and holiday_dict = #{holidayDict}
</if>
<if test="nowDate != null ">
and #{nowDate} &lt;= end_time
</if>
</where>
order by start_time asc
</select>
<select id="selectZdyHolidayVacationsById" parameterType="Long"
resultMap="ZdyHolidayVacationsResult">
<include refid="selectZdyHolidayVacationsVo"/>
where id = #{id}
</select>
<insert id="insertZdyHolidayVacations" parameterType="ZdyHolidayVacations" useGeneratedKeys="true"
keyProperty="id">
insert into zdy_holiday_vacations
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="holidayName != null and holidayName != ''">holiday_name,
</if>
<if test="holidayType != null">holiday_type,
</if>
<if test="startTime != null">start_time,
</if>
<if test="endTime != null">end_time,
</if>
<if test="createTime != null">create_time,
</if>
<if test="createBy != null">create_by,
</if>
<if test="updateTime != null">update_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="remark != null">remark,
</if>
<if test="holidayDict != null">holiday_dict,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="holidayName != null and holidayName != ''">#{holidayName},
</if>
<if test="holidayType != null">#{holidayType},
</if>
<if test="startTime != null">#{startTime},
</if>
<if test="endTime != null">#{endTime},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="remark != null">#{remark},
</if>
<if test="holidayDict != null">#{holidayDict},
</if>
</trim>
</insert>
<update id="updateZdyHolidayVacations" parameterType="ZdyHolidayVacations">
update zdy_holiday_vacations
<trim prefix="SET" suffixOverrides=",">
<if test="holidayName != null and holidayName != ''">holiday_name =
#{holidayName},
</if>
<if test="holidayType != null">holiday_type =
#{holidayType},
</if>
<if test="startTime != null">start_time =
#{startTime},
</if>
<if test="endTime != null">end_time =
#{endTime},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="remark != null">remark =
#{remark},
</if>
<if test="holidayDict != null">holiday_dict =
#{holidayDict},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteZdyHolidayVacationsById" parameterType="Long">
delete
from zdy_holiday_vacations
where id = #{id}
</delete>
<delete id="deleteZdyHolidayVacationsByIds" parameterType="String">
delete from zdy_holiday_vacations where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteZdyHolidayVacationsByHolidayType">
delete
from zdy_holiday_vacations
where holiday_type in (1,2)
</delete>
<select id="selectByQueryDate" resultMap="ZdyHolidayVacationsResult">
<include refid="selectZdyHolidayVacationsVo"/>
<![CDATA[
where start_time <= DATE_FORMAT(#{queryDate}, '%Y-%m-%d')
and end_time >= DATE_FORMAT(#{queryDate}, '%Y-%m-%d')
]]>
and holiday_type in (1,2)
limit 1
</select>
</mapper>

Some files were not shown because too many files have changed in this diff Show More