Commit 155525c1 authored by hongguangwu's avatar hongguangwu

MVP1.6.2-工资原表识别-配置表

parent c0f2d023
package com.yifu.cloud.plus.v1.yifu.salary.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.util.ArrayList;
import java.util.List;
/**
* 薪资原表识别主表
*
* @author hgw
* @date 2024-4-1 18:06:46
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_salary_standard_original")
@Tag(name = "薪资原表识别主表")
public class TSalaryStandardOriginal extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(type = IdType.ASSIGN_ID)
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "主键")
private String id;
/**
* 部门ID
*/
@ExcelAttribute(name = "部门ID", isNotEmpty = true, errorInfo = "部门ID不能为空", maxLength = 32)
@NotBlank(message = "部门ID不能为空")
@Length(max = 32, message = "部门ID不能超过32个字符")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("部门ID")
private String deptId;
/**
* 部门名称
*/
@ExcelAttribute(name = "部门名称", isNotEmpty = true, errorInfo = "部门名称不能为空", maxLength = 50)
@NotBlank(message = "部门名称不能为空")
@Length(max = 50, message = "部门名称不能超过50个字符")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("部门名称")
private String deptName;
/**
* 部门编码
*/
@ExcelAttribute(name = "部门编码", maxLength = 32)
@Length(max = 32, message = "部门编码不能超过32个字符")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("部门编码")
private String deptNo;
/**
* 原表类型
*/
@NotBlank(message = "原表类型不能为空")
@ExcelAttribute(name = "原表类型", maxLength = 50)
@Length(max = 50, message = "原表类型不能超过50个字符")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("原表类型")
private String setName;
/**
* sheet名
*/
@ExcelAttribute(name = "sheet名", maxLength = 100)
@Length(max = 100, message = "sheet名不能超过100个字符")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("sheet名")
private String sheetName;
/**
* 附件名称
*/
@ExcelAttribute(name = "附件名称", maxLength = 200)
@Length(max = 200, message = "附件名称不能超过200个字符")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("附件名称")
private String attaName;
/**
* 资源路径
*/
@ExcelAttribute(name = "资源路径", maxLength = 200)
@Length(max = 200, message = "资源路径不能超过200个字符")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("资源路径")
private String attaSrc;
/**
* 资源地址
*/
@ExcelAttribute(name = "资源地址", maxLength = 100)
@Length(max = 100, message = "资源地址不能超过100个字符")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("资源地址")
private String attaUrl;
/**
* 资源大小
*/
@ExcelAttribute(name = "资源大小")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("资源大小")
private Long attaSize;
/**
* 资源类型(数据字典)
*/
@ExcelAttribute(name = "资源类型(数据字典)", maxLength = 32)
@Length(max = 32, message = "资源类型(数据字典)不能超过32个字符")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("资源类型(数据字典)")
private String attaType;
/**
* 是否删除0:未删除;1:已删除
*/
@ExcelAttribute(name = "是否删除0:未删除;1:已删除", isNotEmpty = true, errorInfo = "是否删除0:未删除;1:已删除不能为空")
@NotBlank(message = "是否删除0:未删除;1:已删除不能为空")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("是否删除0:未删除;1:已删除")
private Integer deleteFlag;
/**
* 明细
*/
@TableField(exist = false)
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "明细")
private List<TSalaryStandardOriginalDetail> detailList = new ArrayList<>();
}
package com.yifu.cloud.plus.v1.yifu.salary.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* 薪资原表识别明细表
*
* @author hgw
* @date 2024-4-1 18:10:43
*/
@Data
@TableName("t_salary_standard_original_detail")
@Tag(name = "薪资原表识别明细表")
public class TSalaryStandardOriginalDetail {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(type = IdType.ASSIGN_ID)
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "主键")
private String id;
/**
* TSalaryStandardOriginal表的主键
*/
@NotBlank(message = "TSalaryStandardOriginal表的主键不能为空")
@Length(max = 32, message = "TSalaryStandardOriginal表的主键不能超过32个字符")
@ExcelAttribute(name = "TSalaryStandardOriginal表的主键", isNotEmpty = true, errorInfo = "不能为空", maxLength = 32)
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "TSalaryStandardOriginal表的主键")
private String originalId;
/**
* 表格列号
*/
@ExcelAttribute(name = "表格列号", isNotEmpty = true, errorInfo = "表格列号不能为空")
@NotBlank(message = "表格列号不能为空")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("表格列号")
private Integer columnNo;
/**
* 原表表头
*/
@NotBlank(message = "原表表头不能为空")
@Length(max = 50, message = "原表表头不能超过50个字符")
@ExcelAttribute(name = "原表表头", isNotEmpty = true, errorInfo = "原表表头不能为空", maxLength = 50)
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "原表表头")
private String excelName;
/**
* 模板表头
*/
@Length(max = 50, message = "模板表头不能超过50个字符")
@ExcelAttribute(name = "模板表头", maxLength = 50)
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "模板表头")
private String modelName;
/**
* 公式标志:MAIN主;ADD加;REDUCE减
*/
@Length(max = 50, message = "公式标志不能超过50个字符")
@ExcelAttribute(name = "公式标志", maxLength = 50)
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "公式标志:MAIN主;ADD加;REDUCE减")
private String flag;
}
package com.yifu.cloud.plus.v1.yifu.salary.vo;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandardOriginal;
import lombok.Getter;
import lombok.Setter;
import org.springframework.web.multipart.MultipartFile;
/**
* @author hgw
* @description 薪资原表识别vo
* @date 2024-4-3 09:15:24
*/
@Getter
@Setter
public class SalaryOriginalVo {
/**
* 附件
*/
private MultipartFile file;
/**
* 配置关系(含配置list)
*/
private TSalaryStandardOriginal salaryOriginal;
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.salary.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandardOriginal;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandardOriginalDetail;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryStandardOriginalDetailService;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryStandardOriginalService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryOriginalVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.net.URL;
import java.util.List;
/**
* 薪资原表识别导入
*
* @author hgw
* @date 2024-4-2 11:03:33
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tsalarystandardoriginal")
@Tag(name = "薪资原表识别导入")
public class TSalaryStandardOriginalController {
private final TSalaryStandardOriginalService tSalaryStandardOriginalService;
private final TSalaryStandardOriginalDetailService tSalaryStandardOriginalDetailService;
private final MenuUtil menuUtil;
private OSSUtil ossUtil;
/**
* 简单分页查询
*
* @param page 分页对象
* @param tSalaryStandardOriginal 原表识别
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/pageApply")
public R<IPage<TSalaryStandardOriginal>> getTSalaryStandardOriginalPage(Page<TSalaryStandardOriginal> page, TSalaryStandardOriginal tSalaryStandardOriginal) {
tSalaryStandardOriginal.setDeleteFlag(CommonConstants.ZERO_INT);
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, tSalaryStandardOriginal);
return new R<>(tSalaryStandardOriginalService.getTSalaryStandardOriginalPage(page, tSalaryStandardOriginal));
}
/**
* 通过id查询薪资原表识别
*
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('salary_tsalarystandardoriginal_get')")
@GetMapping("/{id}")
public R<TSalaryStandardOriginal> getById(@PathVariable("id") String id) {
TSalaryStandardOriginal original = tSalaryStandardOriginalService.getById(id);
if (original != null && Common.isNotNull(original.getId())) {
if (Common.isNotNull(original.getAttaSrc())) {
URL url = ossUtil.getObjectUrl(null, original.getAttaSrc());
original.setAttaUrl(url.toString().replace("http", "https"));
}
original.setDetailList(tSalaryStandardOriginalDetailService.getTSalaryStandardOriginalDetailByOrgId(original.getId()));
}
return R.ok(original);
}
/**
* 修改
*
* @param tSalaryStandardOriginal
* @return R
*/
@Operation(summary = "修改薪资原表识别", description = "修改薪资原表识别:hasPermission('salary_tsalarystandardoriginal_edit')")
@SysLog("修改薪资原表识别")
@PutMapping
@PreAuthorize("@pms.hasPermission('salary_tsalarystandardoriginal_edit')")
@Transactional
public R<Boolean> updateById(@RequestBody TSalaryStandardOriginal tSalaryStandardOriginal) {
List<TSalaryStandardOriginalDetail> detailList = tSalaryStandardOriginal.getDetailList();
if (detailList == null || detailList.isEmpty()) {
return R.failed("请传配置表头list");
}
// 先删除关系
tSalaryStandardOriginalDetailService.deleteByOrgId(tSalaryStandardOriginal.getId());
for (TSalaryStandardOriginalDetail detail : detailList) {
detail.setOriginalId(tSalaryStandardOriginal.getId());
}
// 再新增权限
tSalaryStandardOriginalDetailService.saveBatch(detailList);
// 再保存
tSalaryStandardOriginalService.updateById(tSalaryStandardOriginal);
return R.ok(true);
}
/**
* 通过id删除薪资原表识别
*
* @param id id
* @return R
*/
@Operation(summary = "通过id删除薪资原表识别", description = "通过id删除薪资原表识别:hasPermission('salary_tsalarystandardoriginal_del')")
@SysLog("通过id删除薪资原表识别")
@DeleteMapping("/{id}")
@PreAuthorize("@pms.hasPermission('salary_tsalarystandardoriginal_del')")
public R<String> removeById(@PathVariable String id) {
TSalaryStandardOriginal original = tSalaryStandardOriginalService.getById(id);
if (original != null && Common.isNotNull(original.getId())) {
original.setDeleteFlag(CommonConstants.ONE_INT);
tSalaryStandardOriginalService.updateById(original);
return R.ok();
} else {
return R.failed("未找到");
}
}
/**
* @param vo
* @Description: 原表识别配置保存
* @Author: hgw
* @Date: 2024/4/2 18:02
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@SysLog("原表识别配置保存")
@Operation(description = "保存")
@PostMapping("/doSave")
public R<String> doSave(@RequestBody SalaryOriginalVo vo) throws IOException {
TSalaryStandardOriginal tSalaryStandardOriginal = vo.getSalaryOriginal();
MultipartFile file = vo.getFile();
if (tSalaryStandardOriginal != null && Common.isNotNull(tSalaryStandardOriginal.getDeptId()) && file != null) {
List<TSalaryStandardOriginalDetail> detailList = tSalaryStandardOriginal.getDetailList();
if (detailList == null || detailList.isEmpty()) {
return R.failed("请传配置表头list");
}
tSalaryStandardOriginalService.save(tSalaryStandardOriginal);
for (TSalaryStandardOriginalDetail detail : detailList) {
detail.setOriginalId(tSalaryStandardOriginal.getId());
}
tSalaryStandardOriginalDetailService.saveBatch(detailList);
// 上传附件
String fileName = System.currentTimeMillis() + "_" + file.getOriginalFilename();
//filePath不传默认存储空间的根目录
//jpg,jpeg,png,bmp
String key = "original/"+ fileName;
boolean flag = ossUtil.uploadFileByStream(file.getInputStream(), key, null);
if (flag) {
char slash = '/';
char point = '.';
if (fileName.lastIndexOf(slash) >= 0) {
tSalaryStandardOriginal.setAttaName(key.substring(fileName.lastIndexOf(slash), fileName.length()));
} else {
tSalaryStandardOriginal.setAttaName(fileName);
}
tSalaryStandardOriginal.setAttaSize(file.getSize());
tSalaryStandardOriginal.setAttaSrc(key);
if (key.lastIndexOf(point) >= 0) {
tSalaryStandardOriginal.setAttaType(key.substring(fileName.lastIndexOf(point), fileName.length()));
}
tSalaryStandardOriginalService.updateById(tSalaryStandardOriginal);
} else {
return R.failed("failed:上传至存储空间失败");
}
return R.ok("保存成功!");
} else {
return R.failed("请传参!");
}
}
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.salary.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandardOriginalDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 薪资原表识别导入
*
* @author hgw
* @date 2024-4-2 11:57:29
*/
@Mapper
public interface TSalaryStandardOriginalDetailMapper extends BaseMapper<TSalaryStandardOriginalDetail> {
/**
* 薪资原表识别导入-分页
*/
IPage<TSalaryStandardOriginalDetail> getTSalaryStandardOriginalDetailPage(Page<TSalaryStandardOriginalDetail> page
, @Param("tSalaryStandardOriginalDetail") TSalaryStandardOriginalDetail tSalaryStandardOriginalDetail);
/**
* 薪资原表识别导入-分页
*/
List<TSalaryStandardOriginalDetail> getTSalaryStandardOriginalDetailByOrgId(@Param("originalId") String originalId);
/**
* @Description: 删除关系
* @Author: hgw
* @Date: 2024/4/3 15:42
* @return: int
**/
int deleteByOrgId(@Param("originalId") String originalId);
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.salary.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandardOriginal;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 薪资原表识别导入
*
* @author hgw
* @date 2024-4-2 11:57:29
*/
@Mapper
public interface TSalaryStandardOriginalMapper extends BaseMapper<TSalaryStandardOriginal> {
/**
* 薪资原表识别导入-分页
*/
IPage<TSalaryStandardOriginal> getTSalaryStandardOriginalPage(Page<TSalaryStandardOriginal> page
, @Param("tSalaryStandardOriginal") TSalaryStandardOriginal tSalaryStandardOriginal);
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.salary.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandardOriginalDetail;
import java.util.List;
/**
* 薪资原表识别
*
* @author hgw
* @date 2024-4-2 17:20:36
*/
public interface TSalaryStandardOriginalDetailService extends IService<TSalaryStandardOriginalDetail> {
/**
* @Description: 分页查询
* @Author: hgw
* @Date: 2024/4/2 17:20
* @return:
**/
IPage<TSalaryStandardOriginalDetail> getTSalaryStandardOriginalPage(Page<TSalaryStandardOriginalDetail> page, TSalaryStandardOriginalDetail tSalaryStandardOriginalDetail);
/**
* @param originalId
* @Description: 获取详情
* @Author: hgw
* @Date: 2024/4/2 18:18
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandardOriginalDetail>
**/
List<TSalaryStandardOriginalDetail> getTSalaryStandardOriginalDetailByOrgId(String originalId);
/**
* @param originalId
* @Description: 删除关系
* @Author: hgw
* @Date: 2024/4/3 15:39
* @return: boolean
**/
int deleteByOrgId(String originalId);
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.salary.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandardOriginal;
/**
* 薪资原表识别
*
* @author hgw
* @date 2024-4-2 17:20:36
*/
public interface TSalaryStandardOriginalService extends IService<TSalaryStandardOriginal> {
/**
* @Description: 分页查询
* @Author: hgw
* @Date: 2024/4/2 17:20
* @return:
**/
IPage<TSalaryStandardOriginal> getTSalaryStandardOriginalPage(Page<TSalaryStandardOriginal> page, TSalaryStandardOriginal tSalaryStandardOriginal);
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.salary.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandardOriginalDetail;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryStandardOriginalDetailMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryStandardOriginalDetailService;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 薪资原表识别
* @author hgw
* @date 2024-4-2 17:20:46
*/
@Log4j2
@Service
@AllArgsConstructor
public class TSalaryStandardOriginalDetailServiceImpl extends ServiceImpl<TSalaryStandardOriginalDetailMapper, TSalaryStandardOriginalDetail>
implements TSalaryStandardOriginalDetailService {
/**
* @Description: 分页查询
* @Author: hgw
* @Date: 2024/4/2 17:19
* @return:
**/
@Override
public IPage<TSalaryStandardOriginalDetail> getTSalaryStandardOriginalPage(Page<TSalaryStandardOriginalDetail> page, TSalaryStandardOriginalDetail tSalaryStandardOriginalDetail) {
return baseMapper.getTSalaryStandardOriginalDetailPage(page, tSalaryStandardOriginalDetail);
}
@Override
public List<TSalaryStandardOriginalDetail> getTSalaryStandardOriginalDetailByOrgId(String originalId) {
return baseMapper.getTSalaryStandardOriginalDetailByOrgId(originalId);
}
/**
* @Description: 删除关系
* @Author: hgw
* @Date: 2024/4/3 15:42
* @return: int
**/
@Override
public int deleteByOrgId(String originalId) {
return baseMapper.deleteByOrgId(originalId);
}
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.salary.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandardOriginal;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryStandardOriginalMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.SalaryUploadService;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryStandardOriginalService;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
/**
* 薪资原表识别
* @author hgw
* @date 2024-4-2 17:20:46
*/
@Log4j2
@Service
@AllArgsConstructor
public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStandardOriginalMapper, TSalaryStandardOriginal>
implements TSalaryStandardOriginalService {
private final SalaryUploadService salaryUploadService;
/**
* @Description: 分页查询
* @Author: hgw
* @Date: 2024/4/2 17:19
* @return:
**/
@Override
public IPage<TSalaryStandardOriginal> getTSalaryStandardOriginalPage(Page<TSalaryStandardOriginal> page, TSalaryStandardOriginal tSalaryStandardOriginal) {
return baseMapper.getTSalaryStandardOriginalPage(page, tSalaryStandardOriginal);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryStandardOriginalDetailMapper">
<resultMap id="TSalaryStandardOriginalDetailMap" type="com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandardOriginalDetail">
<id property="id" column="ID"/>
<result property="originalId" column="ORIGINAL_ID"/>
<result property="columnNo" column="COLUMN_NO"/>
<result property="excelName" column="EXCEL_NAME"/>
<result property="modelName" column="MODEL_NAME"/>
<result property="flag" column="FLAG"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.ORIGINAL_ID,
a.COLUMN_NO,
a.EXCEL_NAME,
a.MODEL_NAME,
a.FLAG
</sql>
<sql id="TSalaryStandardOriginalDetail_where">
<if test="tSalaryStandardOriginalDetail != null">
<if test="tSalaryStandardOriginalDetail.id != null and tSalaryStandardOriginalDetail.id.trim() != ''">
AND a.ID = #{tSalaryStandardOriginalDetail.id}
</if>
<if test="tSalaryStandardOriginalDetail.originalId != null and tSalaryStandardOriginalDetail.originalId.trim() != ''">
AND a.ORIGINAL_ID = #{tSalaryStandardOriginalDetail.originalId}
</if>
<if test="tSalaryStandardOriginalDetail.columnNo != null and tSalaryStandardOriginalDetail.columnNo.trim() != ''">
AND a.COLUMN_NO = #{tSalaryStandardOriginalDetail.columnNo}
</if>
<if test="tSalaryStandardOriginalDetail.excelName != null and tSalaryStandardOriginalDetail.excelName.trim() != ''">
AND a.EXCEL_NAME = #{tSalaryStandardOriginalDetail.excelName}
</if>
<if test="tSalaryStandardOriginalDetail.modelName != null and tSalaryStandardOriginalDetail.modelName.trim() != ''">
AND a.MODEL_NAME = #{tSalaryStandardOriginalDetail.modelName}
</if>
</if>
</sql>
<!--TSalaryStandardOriginalDetail简单分页查询-->
<select id="getTSalaryStandardOriginalDetailPage" resultMap="TSalaryStandardOriginalDetailMap">
SELECT
<include refid="Base_Column_List"/>
FROM
t_salary_standard_original_detail a
<where> 1=1
<include refid="TSalaryStandardOriginalDetail_where"/>
</where>
ORDER BY a.COLUMN_NO asc
</select>
<!--获取详情-->
<select id="getTSalaryStandardOriginalDetailByOrgId" resultMap="TSalaryStandardOriginalDetailMap">
SELECT
<include refid="Base_Column_List"/>
FROM
t_salary_standard_original_detail a
where a.ORIGINAL_ID = #{originalId}
ORDER BY a.COLUMN_NO asc
</select>
<!--删除关系-->
<delete id="deleteByOrgId" >
DELETE FROM t_salary_standard_original_detail WHERE ORIGINAL_ID = #{originalId}
</delete>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryStandardOriginalMapper">
<resultMap id="TSalaryStandardOriginalMap" type="com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandardOriginal">
<id property="id" column="ID"/>
<result property="deptId" column="DEPT_ID"/>
<result property="deptName" column="DEPT_NAME"/>
<result property="deptNo" column="DEPT_NO"/>
<result property="createBy" column="CREATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="updateTime" column="UPDATE_TIME"/>
<result property="setName" column="SET_NAME"/>
<result property="sheetName" column="SHEET_NAME"/>
<result property="attaName" column="ATTA_NAME"/>
<result property="attaSrc" column="ATTA_SRC"/>
<result property="attaUrl" column="ATTA_URL"/>
<result property="attaSize" column="ATTA_SIZE"/>
<result property="attaType" column="ATTA_TYPE"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.DEPT_ID,
a.DEPT_NAME,
a.DEPT_NO,
a.CREATE_BY,
a.CREATE_NAME,
a.CREATE_TIME,
a.UPDATE_BY,
a.UPDATE_TIME,
a.SET_NAME,
a.SHEET_NAME,
a.ATTA_NAME,
a.ATTA_SRC,
a.ATTA_URL,
a.ATTA_SIZE,
a.ATTA_TYPE
</sql>
<sql id="TSalaryStandardOriginal_where">
<if test="tSalaryStandardOriginal != null">
<if test="tSalaryStandardOriginal.id != null and tSalaryStandardOriginal.id.trim() != ''">
AND a.ID = #{tSalaryStandardOriginal.id}
</if>
<if test="tSalaryStandardOriginal.deptId != null and tSalaryStandardOriginal.deptId.trim() != ''">
AND a.DEPT_ID = #{tSalaryStandardOriginal.deptId}
</if>
<if test="tSalaryStandardOriginal.deptName != null and tSalaryStandardOriginal.deptName.trim() != ''">
AND a.DEPT_NAME like concat('%',#{tSalaryStandardOriginal.deptName},'%')
</if>
<if test="tSalaryStandardOriginal.deptNo != null and tSalaryStandardOriginal.deptNo.trim() != ''">
AND a.DEPT_NO = #{tSalaryStandardOriginal.deptNo}
</if>
<if test="tSalaryStandardOriginal.setName != null and tSalaryStandardOriginal.setName.trim() != ''">
AND a.SET_NAME like concat('%',#{tSalaryStandardOriginal.setName},'%')
</if>
<if test="tSalaryStandardOriginal.sheetName != null and tSalaryStandardOriginal.sheetName.trim() != ''">
AND a.SHEET_NAME like concat('%',#{tSalaryStandardOriginal.sheetName},'%')
</if>
<if test="tSalaryStandardOriginal.attaName != null and tSalaryStandardOriginal.attaName.trim() != ''">
AND ATTA_NAME = #{tSalaryStandardOriginal.attaName}
</if>
<if test="tSalaryStandardOriginal.attaSrc != null and tSalaryStandardOriginal.attaSrc.trim() != ''">
AND ATTA_SRC = #{tSalaryStandardOriginal.attaSrc}
</if>
<if test="tSalaryStandardOriginal.attaUrl != null and tSalaryStandardOriginal.attaUrl.trim() != ''">
AND ATTA_URL = #{tSalaryStandardOriginal.attaUrl}
</if>
<if test="tSalaryStandardOriginal.attaSize != null and tSalaryStandardOriginal.attaSize.trim() != ''">
AND ATTA_SIZE = #{tSalaryStandardOriginal.attaSize}
</if>
<if test="tSalaryStandardOriginal.attaType != null and tSalaryStandardOriginal.attaType.trim() != ''">
AND ATTA_TYPE = #{tSalaryStandardOriginal.attaType}
</if>
</if>
</sql>
<!--TSalaryStandardOriginal简单分页查询-->
<select id="getTSalaryStandardOriginalPage" resultMap="TSalaryStandardOriginalMap">
SELECT
<include refid="Base_Column_List"/>
FROM
t_salary_standard_original a
<where> a.DELETE_FLAG = 0
<include refid="TSalaryStandardOriginal_where"/>
</where>
ORDER BY a.CREATE_TIME desc
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment