Commit d94a4ec1 authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/MVP1.5.1' into MVP1.5.1

parents 516a30a0 42534844
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* @author pwang
* @date 2019-11-05 15:24:25
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("l_unit_info_for_prove")
@Schema(description = "工资证明用户操作数据表")
public class LUnitInfoForProve extends Model<LUnitInfoForProve> {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private String id;
/**
*
*/
@NotBlank(message = "创建人不能为空")
@ExcelAttribute(name = "", isNotEmpty = true, errorInfo = "不能为空")
@Schema(description = "创建人", name = "creatUser")
private String creatUser;
/**
*
*/
@NotBlank(message = "单位全称不能为空")
@Length(max = 20, message = "单位全称不能超过20个字符")
@Schema(description = "单位全称", name = "unitName")
private String unitName;
/**
*
*/
@NotBlank(message = "单位地址不能为空")
@Length(max = 50, message = "单位地址不能超过50个字符")
@Schema(description = "单位地址", name = "unitAddr")
private String unitAddr;
/**
* 单位固定电话
*/
@NotBlank(message = "单位固定电话不能为空")
@Length(max = 20, message = "单位固定电话不能超过20个字符")
@ExcelAttribute(name = "单位固定电话", isNotEmpty = true, errorInfo = "单位固定电话不能为空", maxLength = 20)
@Schema(description = "单位固定电话", name = "phone")
private String phone;
}
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* 收入证明附件关系表
*
* @author pwang
* @date 2019-11-08 11:23:53
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("m_salary_prova_atta")
@Schema(description = "收入证明附件关系表")
public class MSalaryProvaAtta extends Model<MSalaryProvaAtta> {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键", name = "id")
private String id;
/**
* 收入证明申请id
*/
@NotBlank(message = "收入证明申请id不能为空")
@Length(max = 32, message = "收入证明申请id不能超过32个字符")
private String salaryProvaId;
/**
* 附件id
*/
@NotBlank(message = "附件id不能为空")
@Length(max = 32, message = "附件id不能超过32个字符")
private String attaId;
}
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDate;
/**
* @author pwang
* @date 2019-11-05 15:24:25
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_prove_apply")
@Schema(description = "工资证明申请表")
public class TProveApply extends Model<TProveApply> {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键", name = "id")
private String id;
/**
* 员工id
*/
@NotBlank(message = "员工id不能为空")
@Length(max = 32, message = "员工id不能超过32个字符")
@ExcelAttribute(name = "员工id", isNotEmpty = true, errorInfo = "员工id不能为空", maxLength = 32)
@Schema(description = "员工id", name = "employeeInfo")
private String employeeInfo;
/**
* 申请人
*/
@ExcelAttribute(name = "申请人", isNotEmpty = true, errorInfo = "申请人不能为空")
@Schema(description = "申请人", name = "creatUser")
private String creatUser;
@Schema(description = "申请人名称")
private String creatUserName;
/**
* 申请日期
*/
@ExcelAttribute(name = "申请日期", isNotEmpty = true, errorInfo = "申请日期不能为空")
@Schema(description = "申请日期", name = "creatDate")
private LocalDate creatDate;
/**
* 开始月
*/
@NotBlank(message = "开始月不能为空")
@Length(max = 6, message = "开始月不能超过6个字符")
@ExcelAttribute(name = "开始月", isNotEmpty = true, errorInfo = "开始月不能为空", maxLength = 6)
@Schema(description = "开始月", name = "startMonth")
private String startMonth;
/**
* 结束月
*/
@NotBlank(message = "结束月不能为空")
@Length(max = 6, message = "结束月不能超过6个字符")
@ExcelAttribute(name = "结束月", isNotEmpty = true, errorInfo = "结束月不能为空", maxLength = 6)
@Schema(description = "结束月", name = "endMonth")
private String endMonth;
/**
* 证明的工资
*/
@NotNull(message = "证明的工资不能为空")
@ExcelAttribute(name = "证明的工资")
@Schema(description = "证明的工资", name = "proveSalary")
private BigDecimal proveSalary;
/**
* 申请理由
*/
@Length(max = 100, message = "申请理由不能超过100个字符")
@ExcelAttribute(name = "申请理由", maxLength = 100)
@Schema(description = "申请理由", name = "applyReason")
private String applyReason;
/**
* 审核状态 0待审核1审核通过2审核不通过
*/
@Length(max = 1, message = "审核状态不能超过1个字符")
@Schema(description = "审核状态 0待审核1审核通过2审核不通过", name = "auditStatus")
private String auditStatus;
/**
* 审核人
*/
@ExcelAttribute(name = "审核人")
@Schema(description = "审核人", name = "auditUser")
private String auditUser;
@Schema(description = "审核人名称")
private String auditUserName;
/**
* 审核日期
*/
@ExcelAttribute(name = "审核日期")
@Schema(description = "审核日期", name = "auditDate")
private LocalDate auditDate;
/* @Length(max = 100, message = "附件id逗号隔开不能超过100个字符")
@ExcelAttribute(name = "附件id逗号隔开", maxLength = 100)
@Schema(description = "附件id逗号隔开", name = "fileId")
private String fileId;*/
/**
* 0实发平均1应发平均
*/
@NotBlank(message = "实发应发不能为空")
@Length(max = 1, message = "实发应发类型不能超过1个字符")
@Schema(description = "0实发平均1应发平均", name = "sumType")
private String sumType;
/**
* 实际工资
*/
@NotNull(message = "实际工资不能为空")
@ExcelAttribute(name = "实际工资")
@Schema(description = "实际工资", name = "salary")
private BigDecimal salary;
/**
* 员工身份证号
*
* @Author pwang
* @Date 2019-11-07 10:27
* @return
**/
@Schema(description = "员工身份证号")
private String employeeIdCard;
@Schema(description = "员工姓名")
@ExcelAttribute(name = "姓名")
private String employeeName;
/**
* 结算主体id
*
* @Author pwang
* @Date 2019-11-07 10:27
* @return
**/
@Schema(description = "结算主体id")
private String settleDomain;
@Schema(description = "结算主体名称")
private String settleDomainName;
}
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.alibaba.excel.annotation.ExcelProperty;
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.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Date;
import java.util.List;
import java.util.Set;
/**
* @author pwang
* @date 2019-11-05 15:24:25
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_prove_record")
@Schema(description = "工资证明记录表")
public class TProveRecord extends Model<TProveRecord> {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(type = IdType.ASSIGN_ID)
private String id;
/**
* 员工id
*/
@NotBlank(message = "员工id不能为空")
@Length(max = 32, message = "员工id不能超过32个字符")
private String employeeInfo;
/**
* 员工姓名
*
* @Author pwang
* @Date 2019-11-07 10:27
* @return
**/
@Schema(description = "员工姓名")
@ExcelAttribute(name = "姓名")
@NotBlank(message = "员工姓名不能为空")
@ExcelProperty("姓名")
private String employeeName;
/**
* 员工身份证号
*
* @Author pwang
* @Date 2019-11-07 10:27
* @return
**/
@Schema(description = "员工身份证号")
@NotBlank(message = "员工身份证号不能为空")
@ExcelAttribute(name = "身份证")
@ExcelProperty("身份证")
private String employeeIdCard;
/**
* 结算主体(部门)名称
*
* @Author pwang
* @Date 2019-11-07 10:27
* @return
**/
@Schema(description = "结算主体(部门)名称")
@NotBlank(message = "结算主体名称不能为空")
@ExcelAttribute(name = "结算主体")
@ExcelProperty("结算主体")
private String employeeSettleDepartName;
/**
*
*/
private String creatUser;
@Schema(description = "申请人名称")
@ExcelAttribute(name = "开具人")
@ExcelProperty("开具人")
private String creatUserName;
/**
* 创建日期
*/
@Schema(description = "创建日期", name = "creatDate")
@ExcelAttribute(name = "开具日期")
@ExcelProperty("开具日期")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDate creatDate;
/**
* 开始月份
*/
@NotBlank(message = "开始月份不能为空")
@Length(max = 6, message = "开始月份(yyyyMM)不能超过6个字符")
@ExcelAttribute(name = "开始月份", isNotEmpty = true, errorInfo = "不能为空", maxLength = 6)
@Schema(description = "开始月份", name = "startMonth")
@ExcelProperty("开始月份")
private String startMonth;
/**
* 结束月份
*/
@NotBlank(message = "结束月份不能为空")
@Length(max = 6, message = "结束月份(yyyyMM)不能超过6个字符")
@ExcelAttribute(name = "结束月份", isNotEmpty = true, errorInfo = "不能为空", maxLength = 6)
@Schema(description = "结束月份", name = "endMonth")
@ExcelProperty("结束月份")
private String endMonth;
/**
* 计算的工资
*/
@NotNull(message = "计算的工资不能为空")
@ExcelAttribute(name = "计算的工资")
@Schema(description = "计算的工资(数据库数字)", name = "salary")
private BigDecimal salary;
/**
* 证明的工资
*/
@NotNull(message = "证明的工资不能为空")
@ExcelAttribute(name = "平均工资")
@Schema(description = "证明的工资(显示的数字)", name = "proveSalary")
@ExcelProperty("平均工资")
private BigDecimal proveSalary;
/**
* 是否作废 0否1是
*/
@Length(max = 1, message = "是否作废不能超过1个字符")
@ExcelAttribute(name = "是否作废", dataType = "isInvalid", isDataId = true)
@ExcelProperty("是否作废")
private String isInvalid;
/**
* 作废原因
*/
@Length(max = 100, message = "作废原因不能超过100个字符")
@ExcelAttribute(name = "作废原因")
@ExcelProperty("作废原因")
@Schema(description = "作废原因", name = "invalidReason")
private String invalidReason;
/**
* 证明编号
*/
@Length(max = 20, message = "证明编号不能超过20个字符")
@ExcelAttribute(name = "证明编号")
@Schema(description = "证明编号", name = "no")
@ExcelProperty("证明编号")
private String no;
/**
* 用途
*/
@Length(max = 100, message = "用途不能超过100个字符")
@ExcelAttribute(name = "用途")
@Schema(description = "用途", name = "purpose")
@ExcelProperty("用途")
private String purpose;
/**
* 0实发平均1应发平均
*/
@NotBlank(message = "实发应发不能为空")
@Length(max = 1, message = "实发应发不能超过1个字符")
@ExcelAttribute(name = "计算类型", dataType = "sumType", isDataId = true)
@Schema(description = "0实发平均1应发平均", name = "sumType")
@ExcelProperty("计算类型")
private String sumType;
/**
* 证明类型 0正式员工证明1试用期员工证明
*/
@NotBlank(message = "证明类型不能为空")
@Length(max = 1, message = "证明类型不能超过1个字符")
@Schema(description = "证明类型 0正式员工证明1试用期员工证明", name = "proveType")
private String proveType;
/**
* 打印次数
*/
@ExcelAttribute(name = "打印次数")
@Schema(description = "打印次数", name = "number")
private Integer number;
/**
*
*/
@NotBlank(message = "单位全称不能为空")
@Length(max = 20, message = "不能超过20个字符")
@Schema(description = "单位全称", name = "unitName")
private String unitName;
/**
*
*/
@NotBlank(message = "单位地址不能为空")
@Length(max = 50, message = "不能超过50个字符")
@Schema(description = "单位地址", name = "unitAddr")
private String unitAddr;
/**
* 单位固定电话
*/
@NotBlank(message = "单位固定电话不能为空")
@Length(max = 20, message = "单位固定电话不能超过20个字符")
@Schema(description = "单位固定电话", name = "phone")
private String phone;
/**
* 合同结束时间
*/
@Schema(description = "合同结束时间")
private Date contractEndDate;
/**
* 入职时间
*/
@Schema(description = "入职时间")
private LocalDate entryDate;
/**
* 合同类型
*/
@Schema(description = "合同类型")
private String contractType;
/**
* 岗位
*
* @Author
* @Date 2019-11-07 10:27pwang
* @return
**/
@Schema(description = "岗位")
private String post;
@Schema(description = "计算月份数")
private Integer mouthCount;
/**
* 申请人部门所在城市id
*
* @Author pwang
* @Date 2019-11-07 18:18
* @param null
* @return
**/
private String belongDepartCity;
/**
* 根据证明工资手动在方法中转换NumberToCN.number2CNMontrayUnit(re.getProveSalary())
*
* @Author pwang
* @Date 2019-11-07 10:43
* @return
**/
@Schema(description = "大写")
@TableField(exist = false)
private String capital;
@TableField(exist = false)
private List<String> idList;
@TableField(exist = false)
@Schema(description = "导出的表头的Set")
private Set<String> exportFields;
@Schema(description = "查询limit 开始")
private int limitStart;
@Schema(description = "查询limit 数据条数")
private int limitEnd;
}
......@@ -51,7 +51,7 @@ public class FileUploadController {
@Operation(description = "OSS文件上传接口" +
"@ApiImplicitParam(name = \"file\", value = \"Form文件上传\", required = true, dataType = \"__file\", paramType = \"form\"),\n" +
"\t\t\t@ApiImplicitParam(name = \"filePath\", value = \"文件上传路径\", required = false, dataType = \"String\", paramType = \"form\"),\n" +
"\t\t\t@ApiImplicitParam(name = \"type\", value = \"关系类型(0员工附件-学历 1 员工附件-伤残 2.员工附件-职业 3.员工附件-不良记录 4.员工附件-合同)\", required = true, dataType = \"int\", paramType = \"form\"),\n" +
"\t\t\t@ApiImplicitParam(name = \"type\", value = \"关系类型(0员工附件-学历 1 员工附件-伤残 2.员工附件-职业 3.员工附件-不良记录 4.员工附件-合同;5收入证明)\", required = true, dataType = \"int\", paramType = \"form\"),\n" +
"\t\t\t@ApiImplicitParam(name = \"domain\", value = \"实体id(传入就插入对应关系,用于编辑)\", required = false, paramType = \"form\")\n" +
"\t")
/*@ApiImplicitParams({
......
package com.yifu.cloud.plus.v1.yifu.archives.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.archives.entity.LUnitInfoForProve;
import org.apache.ibatis.annotations.Mapper;
/**
* @author pwang
* @date 2019-11-05 15:24:25
*/
@Mapper
public interface LUnitInfoForProveMapper extends BaseMapper<LUnitInfoForProve> {
}
package com.yifu.cloud.plus.v1.yifu.archives.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.archives.entity.MSalaryProvaAtta;
import org.apache.ibatis.annotations.Mapper;
/**
* 收入证明附件关系表
*
* @author pwang
* @date 2019-11-08 11:23:53
*/
@Mapper
public interface MSalaryProvaAttaMapper extends BaseMapper<MSalaryProvaAtta> {
}
......@@ -39,4 +39,6 @@ public interface TAttaInfoMapper extends BaseMapper<TAttaInfo> {
List<TAttaInfo> getKeenAtta(@Param("dayStart")LocalDateTime dayStart, @Param("values")Collection<String> values);
int updateDomainId(@Param("domainId")String domainId, @Param("ids")List<String> ids);
List<TAttaInfo> getAttaByApplyId(@Param("applyId")String applyId);
}
package com.yifu.cloud.plus.v1.yifu.archives.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.archives.entity.TProveApply;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @author pwang
* @date 2019-11-05 15:24:25
*/
@Mapper
public interface TProveApplyMapper extends BaseMapper<TProveApply> {
/**
* 简单分页查询
*
* @param tProveApply
* @return
*/
IPage<TProveApply> getTProveApplyPage(Page page, @Param("tProveApply") TProveApply tProveApply);
}
package com.yifu.cloud.plus.v1.yifu.archives.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.archives.entity.TProveRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author pwang
* @date 2019-11-05 15:24:25
*/
@Mapper
public interface TProveRecordMapper extends BaseMapper<TProveRecord> {
/**
* 简单分页查询
*
* @param tProveRecord
* @return
*/
IPage<TProveRecord> getTProveRecordPage(Page page, @Param("tProveRecord") TProveRecord tProveRecord);
/**
* @param tProveRecord
* @Description: 导出查条数
* @Author: hgw
* @Date: 2023/2/22 14:56
* @return: int
**/
int getCountByExport(@Param("tProveRecord") TProveRecord tProveRecord);
/**
* @param tProveRecord
* @Description: 导出list
* @Author: hgw
* @Date: 2023/2/22 14:56
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.archives.entity.TProveRecord>
**/
List<TProveRecord> getRecordInfoNoPage(@Param("tProveRecord") TProveRecord tProveRecord);
Integer createNo(@Param("str") String str);
}
package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.LUnitInfoForProve;
/**
* @author pwang
* @date 2019-11-05 15:24:25
*/
public interface LUnitInfoForProveService extends IService<LUnitInfoForProve> {
}
package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.MSalaryProvaAtta;
/**
* 收入证明附件关系表
*
* @author pwang
* @date 2019-11-08 11:23:53
*/
public interface MSalaryProvaAttaService extends IService<MSalaryProvaAtta> {
}
......@@ -4,6 +4,7 @@ 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.archives.entity.TAttaInfo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import java.time.LocalDateTime;
import java.util.Collection;
......@@ -51,4 +52,14 @@ public interface TAttaInfoService extends IService<TAttaInfo> {
List<TAttaInfo> getKeenAtta(LocalDateTime dayStart, Collection<String> values);
Boolean updateDomainId(String domainId, List<String> ids);
/**
* @param applyId
* @Description: 收入证明使用
* @Author: hgw
* @Date: 2023/2/22 10:50
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.List < com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo>>
**/
R<List<TAttaInfo>> getAttaByApplyId(String applyId);
}
package com.yifu.cloud.plus.v1.yifu.archives.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.archives.entity.TProveApply;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
/**
* @author pwang
* @date 2019-11-05 15:24:25
*/
public interface TProveApplyService extends IService<TProveApply> {
/**
* 简单分页查询
*
* @param tProveApply
* @return
*/
IPage<TProveApply> getTProveApplyPage(Page<TProveApply> page, TProveApply tProveApply);
R validSave(TProveApply proveApply, String[] attaIdArray);
}
package com.yifu.cloud.plus.v1.yifu.archives.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.archives.entity.TProveRecord;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* @author pwang
* @date 2019-11-05 15:24:25
*/
public interface TProveRecordService extends IService<TProveRecord> {
/**
* 简单分页查询
*/
IPage<TProveRecord> getTProveRecordPage(Page<TProveRecord> page, TProveRecord tProveRecord);
void saveNo(TProveRecord record);
List<TProveRecord> getRecordInfoNoPage(TProveRecord pr);
void listExport(HttpServletResponse response, TProveRecord searchVo);
}
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.LUnitInfoForProve;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.LUnitInfoForProveMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.LUnitInfoForProveService;
import org.springframework.stereotype.Service;
/**
* @author pwang
* @date 2019-11-05 15:24:25
*/
@Service
public class LUnitInfoForProveServiceImpl extends ServiceImpl<LUnitInfoForProveMapper, LUnitInfoForProve> implements LUnitInfoForProveService {
}
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.MSalaryProvaAtta;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.MSalaryProvaAttaMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.MSalaryProvaAttaService;
import org.springframework.stereotype.Service;
/**
* 收入证明附件关系表
*
* @author pwang
* @date 2019-11-08 11:23:53
*/
@Service
public class MSalaryProvaAttaServiceImpl extends ServiceImpl<MSalaryProvaAttaMapper, MSalaryProvaAtta> implements MSalaryProvaAttaService {
}
......@@ -8,9 +8,11 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.TAttaInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TAttaInfoService;
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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.net.URL;
import java.time.LocalDateTime;
import java.util.Collection;
import java.util.List;
......@@ -107,4 +109,19 @@ public class TAttaInfoServiceImpl extends ServiceImpl<TAttaInfoMapper, TAttaInfo
}
return baseMapper.updateDomainId(domainId,ids) > 0;
}
@Override
public R<List<TAttaInfo>> getAttaByApplyId(String applyId) {
List<TAttaInfo> list = baseMapper.getAttaByApplyId(applyId);
if (Common.isNotNull(list)) {
URL url;
for (TAttaInfo atta:list) {
url = ossUtil.getObjectUrl(null, atta.getAttaSrc());
atta.setAttaUrl(url.toString());
}
return R.ok(list);
}else{
return R.failed("没有附件");
}
}
}
......@@ -28,12 +28,12 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.TElecEmployeeInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.FileUploadService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TElecEmployeeInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.util.RedisUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import lombok.RequiredArgsConstructor;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileItemFactory;
......@@ -145,19 +145,19 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
*/
private R unZip(File srcFile, String destDirPath) throws RuntimeException {
// 调用字典服务,渲染字典值
R<Map<String, Map<String, Map<String, String>>>> dictR = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(), daprUpmsProperties.getAppId()
, "/dict/inner/getDictToLable", null, Map.class, SecurityConstants.FROM_IN);
Map<String, Map<String, Map<String, String>>> dictMap;
// 电子档案类型
Map<String, Map<String, String>> elecTypeMapData;
Map<String, String> elecTypeMap;
if (dictR == null) {
Map<String, String> elecTypeMap = new HashMap<>();
// 渲染字典值
Map<String,String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue()
.get(CacheConstants.DICT_DETAILS
+ CommonConstants.COLON_STRING
+ "literature_types");
if (Common.isNotNull(dicObj)) {
for (Map.Entry<String, String> entry : dicObj.entrySet()) {
elecTypeMap.put(entry.getValue(),entry.getKey());
}
}
if (!elecTypeMap.isEmpty()) {
return R.failed("获取字典失败!");
} else {
dictMap = dictR.getData();
elecTypeMapData = dictMap.get("data");
elecTypeMap = elecTypeMapData.get("literature_types");
}
// 判断源文件是否存在
if (!srcFile.exists()) {
......@@ -173,15 +173,18 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
Set<String> infoList =new HashSet<>();
Set<String> idCardList =new HashSet<>();
Set<String> cardType =new HashSet<>();
TEmployeeInfo tEmployeeInfo;
ZipEntry entry;
while (entriesCheck.hasMoreElements()) {
ZipEntry entry = (ZipEntry) entriesCheck.nextElement();
entry = (ZipEntry) entriesCheck.nextElement();
//添加进filesName
String empInfo = entry.getName();
infoList.add(empInfo);
String dataType = "";
if (empInfo.length() == empInfo.lastIndexOf("/") + 1) {
String idCard = empInfo.substring(0, empInfo.indexOf("/"));
TEmployeeInfo tEmployeeInfo = tEmployeeInfoService.getOne((Wrappers.<TEmployeeInfo>query().lambda()
tEmployeeInfo = tEmployeeInfoService.getOne((Wrappers.<TEmployeeInfo>query().lambda()
.eq(TEmployeeInfo::getEmpIdcard, idCard)).eq(TEmployeeInfo::getFileStatus, CommonConstants.ZERO_INT)
.eq(TEmployeeInfo::getDeleteFlag, CommonConstants.ZERO_STRING)
.eq(TEmployeeInfo::getFileStatus, CommonConstants.ZERO_INT));
......@@ -191,34 +194,30 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
idCardList.add(idCard);
if (empInfo.length() > 20) {
dataType = empInfo.substring(empInfo.indexOf("/") + 1, empInfo.lastIndexOf("/"));
if (Common.isNotNull(elecTypeMap)) {
if (!Common.isNotNull(elecTypeMap.get(dataType))) {
return R.failed("资料类型错误:" + dataType);
}
cardType.add(idCard + "/" + dataType);
if (!Common.isNotNull(elecTypeMap.get(dataType))) {
return R.failed("资料类型错误:" + dataType);
}
cardType.add(idCard + "/" + dataType);
}
}
}
for (String idCarInfo : idCardList) {
if (!infoList.stream().anyMatch(e-> containsCheckTwo(e,idCarInfo))) {
if (infoList.stream().noneMatch(e-> containsCheckTwo(e,idCarInfo))) {
return R.failed(idCarInfo + ":"+"证件数据不可为空");
}
}
if (cardType.size() > CommonConstants.ZERO_INT) {
for (String typeInfo :cardType) {
if (!infoList.stream().anyMatch(e -> containsCheckOne(e, typeInfo))) {
if (infoList.stream().noneMatch(e -> containsCheckOne(e, typeInfo))) {
return R.failed(typeInfo + ":" + "证件数据不可为空");
}
}
}
Map<String, String> insMap = new HashMap<>();
List<TElecEmployeeInfo> infolist = new ArrayList<>();
List<String> list = new ArrayList<>();
TEmployeeInfo employeeInfo;
while (entries.hasMoreElements()) {
ZipEntry entry = (ZipEntry) entries.nextElement();
entry = (ZipEntry) entries.nextElement();
//添加进filesName
String empInfo = entry.getName();
// 如果是文件夹,就创建个文件夹
......@@ -249,26 +248,22 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
String idCard = empInfo.substring(0, empInfo.indexOf("/"));
String dataType = empInfo.substring(empInfo.indexOf("/") + 1, empInfo.lastIndexOf("/"));
String empName = "";
TEmployeeInfo tEmployeeInfo = tEmployeeInfoService.getOne((Wrappers.<TEmployeeInfo>query().lambda()
employeeInfo = tEmployeeInfoService.getOne((Wrappers.<TEmployeeInfo>query().lambda()
.eq(TEmployeeInfo::getEmpIdcard, idCard)).eq(TEmployeeInfo::getFileStatus, CommonConstants.ZERO_INT)
.eq(TEmployeeInfo::getDeleteFlag, CommonConstants.ZERO_STRING));
if (Common.isNotNull(tEmployeeInfo)) {
empName = tEmployeeInfo.getEmpName();
if (Common.isNotNull(employeeInfo)) {
empName = employeeInfo.getEmpName();
}
tElecEmployeeInfo.setEmpIdcard(idCard);
tElecEmployeeInfo.setEmpName(empName);
if (Common.isNotNull(elecTypeMap)) {
if (Common.isNotNull(elecTypeMap.get(dataType))) {
tElecEmployeeInfo.setDataType(elecTypeMap.get(dataType));
}
if (Common.isNotNull(elecTypeMap.get(dataType))) {
tElecEmployeeInfo.setDataType(elecTypeMap.get(dataType));
}
String id = insMap.get(idCard + CommonConstants.DOWN_LINE_STRING + dataType);
if (Common.isEmpty(id)) {
infolist.add(tElecEmployeeInfo);
this.save(tElecEmployeeInfo);
insMap.put(idCard + CommonConstants.DOWN_LINE_STRING + dataType, tElecEmployeeInfo.getId());
}
list.add(insMap.get(idCard + CommonConstants.DOWN_LINE_STRING + dataType));
fileUploadService.uploadImg(fileCovertMultipartFile(targetFile), "", CommonConstants.EIGHT_INT, insMap.get(idCard + CommonConstants.DOWN_LINE_STRING + dataType));
}
......
......@@ -159,6 +159,12 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
List<TEmployeeProject> updateList = new ArrayList<>();
Set<String> errorMsg;
//对象声明
TEmpChangeInfoVO excel;
TSettleDomain tSettleDomain;
TEmployeeProject employeeProject;
TEmployeeProject updateTEmployeePro;
TEmployeeProject tEmployeeProjectOld;
// 执行数据插入操作 组装
for (int i = 0; i < excelVOList.size(); i++) {
// 已有验证报错直接下一个
......@@ -166,7 +172,7 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
continue;
}
errorMsg = new HashSet<>();
TEmpChangeInfoVO excel = excelVOList.get(i);
excel = excelVOList.get(i);
excel.setUnsettleDeal(CommonConstants.IS_NO_CHANGE);
if (Common.isNotNull(excel.getChangeStartMonth()) && excel.getChangeStartMonth().length() > CommonConstants.dingleDigitIntArray[6]) {
errorMsg.add("划转起始月长度不能超过6位");
......@@ -184,7 +190,7 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
}
//项目编码校验
TSettleDomain tSettleDomain = tSettleDomainMapper.selectOne(Wrappers.<TSettleDomain>query().lambda()
tSettleDomain = tSettleDomainMapper.selectOne(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDepartNo, excel.getNewSettleCode())
.eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING)
.eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING));
......@@ -193,17 +199,17 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
}
//待划转员工已在目标项目下不可划转
TEmployeeProject tEmployeeProject = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query().lambda()
employeeProject = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard, excel.getEmpIdcard()).eq(TEmployeeProject::getDeptNo,excel.getNewSettleCode())
.eq(TEmployeeProject::getDeleteFlag,CommonConstants.STATUS_NORMAL)
.eq(TEmployeeProject::getProjectStatus,CommonConstants.ZERO_INT));
if (Common.isNotNull(tEmployeeProject)) {
if (Common.isNotNull(employeeProject)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.PROJECT_NEW_SEARCH_NOT_EXIST, excel.getNewSettleCode()));
}
// 数据合法情况
if (CollUtil.isEmpty(errorMsg)) {
//划转,更新项目信息
TEmployeeProject updateTEmployeePro = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query().lambda()
updateTEmployeePro = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard, excel.getEmpIdcard()).eq(TEmployeeProject::getDeptNo,excel.getOldSettleCode())
.eq(TEmployeeProject::getDeleteFlag,CommonConstants.STATUS_NORMAL));
if (Common.isNotNull(updateTEmployeePro)) {
......@@ -214,7 +220,7 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
if (CommonConstants.ONE_INT == updateTEmployeePro.getProjectStatus()) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.PROJECT_PERSON_DELETE_EXIT, excel.getOldSettleCode()));
} else if (Common.isNotNull(tSettleDomain)) {
TEmployeeProject tEmployeeProjectOld = tEmployeeProjectService.getById(updateTEmployeePro.getId());
tEmployeeProjectOld = tEmployeeProjectService.getById(updateTEmployeePro.getId());
updateTEmployeePro.setDeptNo(tSettleDomain.getDepartNo());
updateTEmployeePro.setDeptId(tSettleDomain.getId());
updateTEmployeePro.setDeptName(tSettleDomain.getDepartName());
......@@ -300,7 +306,6 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
*/
@Override
public R<List<TCustomerInfo>> getAllUint(String customerName) {
//List<TCustomerInfo> list = tCustomerInfoService.list(Wrappers.<TCustomerInfo>query().lambda().eq(TCustomerInfo::getDeleteFlag, CommonConstants.STATUS_NORMAL));
List<TCustomerInfo> list = tCustomerInfoService.getAllUnit(customerName);
return R.ok(list);
}
......
......@@ -949,9 +949,13 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
// 新老项目档案List
List<EmployeeProjectNewOldVO> updateProjectList = new ArrayList<>();
EmployeeProjectUpdateVO excel;
TEmployeeProject tEmployeeProject;
TEmployeeInfo tEmployeeInfo;
TEmployeeProject tEmployeeProjectOld;
// 执行数据插入操作 组装
for (int i = 0; i < excelVOList.size(); i++) {
EmployeeProjectUpdateVO excel = excelVOList.get(i);
excel = excelVOList.get(i);
String checkCount = excel.getEmpIdcard().concat(excel.getDeptNo());
if (Common.isNotNull(checkCountMap.get(checkCount))) {
......@@ -960,7 +964,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
checkCountMap.put(checkCount, i + 2);
}
//根据身份证和项目编码获取项目档案
TEmployeeProject tEmployeeProject = this.getOne(Wrappers.<TEmployeeProject>query().lambda()
tEmployeeProject = this.getOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard, excel.getEmpIdcard())
.eq(TEmployeeProject::getDeptNo, excel.getDeptNo())
.eq(TEmployeeProject::getDeleteFlag, CommonConstants.STATUS_NORMAL));
......@@ -971,13 +975,13 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.CHECKS_EMP_DELETE_ERROR)));
} else {
updateExcelProj(excel, updateList, tEmployeeProject);
TEmployeeProject tEmployeeProjectOld = this.getById(tEmployeeProject.getId());
tEmployeeProjectOld = this.getById(tEmployeeProject.getId());
newOldProject = new EmployeeProjectNewOldVO();
newOldProject.setOldProjectEmployee(tEmployeeProjectOld);
newOldProject.setNewProjectEmployee(tEmployeeProject);
updateProjectList.add(newOldProject);
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectOne(Wrappers.<TEmployeeInfo>query().lambda()
tEmployeeInfo = tEmployeeInfoMapper.selectOne(Wrappers.<TEmployeeInfo>query().lambda()
.eq(TEmployeeInfo::getEmpIdcard, excel.getEmpIdcard())
.eq(TEmployeeInfo::getFileStatus, CommonConstants.ZERO_INT)
.eq(TEmployeeInfo::getDeleteFlag, CommonConstants.STATUS_NORMAL));
......@@ -1065,6 +1069,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
.eq(TEmployeeProject::getProjectStatus, CommonConstants.ZERO_INT));
}
if (Common.isNotEmpty(list)) {
TEmployeeInfo tEmployeeInfo;
int i = 0;
for (TEmployeeProject delProject : list) {
++i;
......@@ -1072,7 +1077,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if (CommonConstants.dingleDigitIntArray[0] == delProject.getStatus()) {
delProject.setDeleteFlag(CommonConstants.ONE_STRING);
updList.add(delProject);
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectOne(Wrappers.<TEmployeeInfo>query().lambda()
tEmployeeInfo = tEmployeeInfoMapper.selectOne(Wrappers.<TEmployeeInfo>query().lambda()
.eq(TEmployeeInfo::getEmpIdcard, delProject.getEmpIdcard())
.eq(TEmployeeInfo::getDeleteFlag, CommonConstants.STATUS_NORMAL));
infoUpdList.add(tEmployeeInfo);
......
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.MSalaryProvaAtta;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TProveApply;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TProveApplyMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.MSalaryProvaAttaService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TProveApplyService;
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.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
/**
* @author pwang
* @date 2019-11-05 15:24:25
*/
@Service
public class TProveApplyServiceImpl extends ServiceImpl<TProveApplyMapper, TProveApply> implements TProveApplyService {
@Autowired
private MSalaryProvaAttaService salaryProvaAttaService;
/**
* 简单分页查询
*
* @param tProveApply
* @return
*/
@Override
public IPage<TProveApply> getTProveApplyPage(Page<TProveApply> page, TProveApply tProveApply) {
return baseMapper.getTProveApplyPage(page, tProveApply);
}
@Override
public R validSave(TProveApply proveApply, String[] attaIdArray) {
YifuUser user = SecurityUtils.getUser();
//查重
long count = this.count(Wrappers.<TProveApply>lambdaQuery()
.eq(TProveApply::getEmployeeInfo, proveApply.getEmployeeInfo())
.eq(TProveApply::getStartMonth, proveApply.getStartMonth())
.eq(TProveApply::getEndMonth, proveApply.getEndMonth())
.eq(TProveApply::getSumType, proveApply.getSumType())
.ne(TProveApply::getAuditStatus, CommonConstants.dingleDigitStrArray[2]));
if (count > 0) {
return R.failed("该员工这段时间内已存在申请记录");
}
proveApply.setId(null);
//初始化数据填充
proveApply.setAuditStatus(CommonConstants.ZERO_STRING);//待审核
proveApply.setCreatDate(LocalDate.now());
proveApply.setCreatUser(user.getId());
proveApply.setCreatUserName(user.getNickname());
//保存数据
this.save(proveApply);
if (Common.isNotNull(attaIdArray)) {
//保存关系
List<MSalaryProvaAtta> mList = new ArrayList<>();
MSalaryProvaAtta m;
for (String id : attaIdArray) {
m = new MSalaryProvaAtta();
m.setAttaId(id);
m.setSalaryProvaId(proveApply.getId());
mList.add(m);
}
salaryProvaAttaService.saveBatch(mList);
}
return R.ok("操作成功!");
}
}
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
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.archives.entity.TProveRecord;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TProveRecordMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TProveRecordService;
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.DateUtil;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.stream.Collectors;
/**
* @author pwang
* @date 2019-11-05 15:24:25
*/
@Service
public class TProveRecordServiceImpl extends ServiceImpl<TProveRecordMapper, TProveRecord> implements TProveRecordService {
private Lock lock = new ReentrantLock();
/**
* 简单分页查询
*
* @param tProveRecord
* @return
*/
@Override
public IPage<TProveRecord> getTProveRecordPage(Page<TProveRecord> page, TProveRecord tProveRecord) {
return baseMapper.getTProveRecordPage(page, tProveRecord);
}
@Override
public synchronized void saveNo(TProveRecord record) {
String str = "WX-";
if (record.getUnitName() != null) {
if (record.getUnitName().contains("易服")) {
str = "YF-";
} else if (record.getUnitName().contains("柯恩")) {
str = "KE-";
}
}
Integer count = 0;
//cityName = cityName.replace("市", "");
//str += PingYinUtil.getPYIndexStr(cityName, true) + "-";
count = baseMapper.createNo(str);
if (count != null) {
count++;
if (count < 10000) {
str += new DecimalFormat("00000").format(count);
} else {
str += String.valueOf(count);
}
} else {
str += "00001";
}
record.setNo(str);
this.save(record);
}
@Override
public List<TProveRecord> getRecordInfoNoPage(TProveRecord pr) {
return baseMapper.getRecordInfoNoPage(pr);
}
/**
* 工资报账主表(工资条)批量导出
*
* @return
*/
@Override
public void listExport(HttpServletResponse response, TProveRecord searchVo) {
String fileName = "证明记录导出" + DateUtil.getThisTime() + CommonConstants.XLSX;
//获取要导出的列表
List<TProveRecord> list = new ArrayList<>();
int count = baseMapper.getCountByExport(searchVo);
ServletOutputStream out = null;
try {
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
if (Common.isEmpty(searchVo.getExportFields())) {
//String[] exportFields = {"姓名", "证明编号", "身份证", "结算主体", "计算类型", "开始月份", "结束月份"
// , "平均工资", "开具人", "开具日期", "用途", "是否作废", "作废原因"}
String[] exportFields = {"employeeName", "no", "employeeIdCard", "employeeSettleDepartName", "sumType"
, "startMonth", "endMonth", "proveSalary", "creatUserName", "creatDate", "purpose", "isInvalid"
, "invalidReason"};
Set<String> exportSet = Arrays.stream(exportFields).collect(Collectors.toSet());
searchVo.setExportFields(exportSet);
}
ExcelWriter excelWriter = EasyExcelFactory.write(out, TProveRecord.class).includeColumnFiledNames(searchVo.getExportFields()).build();
int index = 0;
WriteSheet writeSheet;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT_3) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT_3);
list = baseMapper.getRecordInfoNoPage(searchVo);
if (Common.isNotNull(list)) {
writeSheet = EasyExcelFactory.writerSheet("证明记录" + index).build();
excelWriter.write(list, writeSheet);
index++;
list.clear();
}
}
} else {
writeSheet = EasyExcelFactory.writerSheet("证明记录" + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
list.clear();
}
out.flush();
excelWriter.finish();
} catch (Exception e) {
log.error("执行异常", e);
} finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}
}
}
/**
* Copyright © 2017yifu. All rights reserved.
*
* @Title: NumberToCN.java
* @Prject: wanxin_hr
* @Package: com.yifu.util
* @Description: TODO
* @author: Administrator
* @date: 2017年5月8日 下午6:45:01
* @version: V1.0
*/
package com.yifu.cloud.plus.v1.yifu.archives.utils;
import java.math.BigDecimal;
/**
* @Author: wangan
* @Date: 2019/8/9
* @Description: 金额转换金额大写, 从老hr复制过
* @return:
**/
public class NumberToCN {
/**
* 汉语中数字大写
*/
private static final String[] CN_UPPER_NUMBER = {"零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"};
/**
* 汉语中货币单位大写,这样的设计类似于占位符
*/
private static final String[] CN_UPPER_MONETRAY_UNIT = {"分", "角", "元", "拾", "佰", "仟", "万", "拾", "佰", "仟", "亿", "拾",
"佰", "仟", "兆", "拾", "佰", "仟"};
/**
* 特殊字符:整
*/
private static final String CN_FULL = "整";
/**
* 特殊字符:负
*/
private static final String CN_NEGATIVE = "负";
/**
* 金额的精度,默认值为2
*/
private static final int MONEY_PRECISION = 2;
/**
* 特殊字符:零元整
*/
private static final String CN_ZEOR_FULL = "零元" + CN_FULL;
/**
* 把输入的金额转换为汉语中人民币的大写
*
* @param numberOfMoney
* 输入的金额
* @return 对应的汉语大写
*/
public static String number2CNMontrayUnit(BigDecimal numberOfMoney) {
if (null == numberOfMoney) {
numberOfMoney = BigDecimal.ZERO;
}
StringBuffer sb = new StringBuffer();
// -1, 0, or 1 as the value of this BigDecimal is negative, zero, or
// positive.
int signum = numberOfMoney.signum();
// 零元整的情况
if (signum == 0) {
return CN_ZEOR_FULL;
}
// 这里会进行金额的四舍五入
long number = numberOfMoney.movePointRight(MONEY_PRECISION).setScale(0, 4).abs().longValue();
// 得到小数点后两位值
long scale = number % 100;
int numUnit = 0;
int numIndex = 0;
boolean getZero = false;
// 判断最后两位数,一共有四中情况:00 = 0, 01 = 1, 10, 11
if (!(scale > 0)) {
numIndex = 2;
number = number / 100;
getZero = true;
}
if ((scale > 0) && (!(scale % 10 > 0))) {
numIndex = 1;
number = number / 10;
getZero = true;
}
int zeroSize = 0;
while (true) {
if (number <= 0) {
break;
}
// 每次获取到最后一个数
numUnit = (int) (number % 10);
if (numUnit > 0) {
if ((numIndex == 9) && (zeroSize >= 3)) {
sb.insert(0, CN_UPPER_MONETRAY_UNIT[6]);
}
if ((numIndex == 13) && (zeroSize >= 3)) {
sb.insert(0, CN_UPPER_MONETRAY_UNIT[10]);
}
sb.insert(0, CN_UPPER_MONETRAY_UNIT[numIndex]);
sb.insert(0, CN_UPPER_NUMBER[numUnit]);
getZero = false;
zeroSize = 0;
} else {
++zeroSize;
if (!(getZero)) {
sb.insert(0, CN_UPPER_NUMBER[numUnit]);
}
if (numIndex == 2) {
if (number > 0) {
sb.insert(0, CN_UPPER_MONETRAY_UNIT[numIndex]);
}
} else if (((numIndex - 2) % 4 == 0) && (number % 1000 > 0)) {
sb.insert(0, CN_UPPER_MONETRAY_UNIT[numIndex]);
}
getZero = true;
}
// 让number每次都去掉最后一个数
number = number / 10;
++numIndex;
}
// 如果signum == -1,则说明输入的数字为负数,就在最前面追加特殊字符:负
if (signum == -1) {
sb.insert(0, CN_NEGATIVE);
}
// 输入的数字小数点后两位为"00"的情况,则要在最后追加特殊字符:整
if (!(scale > 0)) {
sb.append(CN_FULL);
}
return sb.toString();
}
}
<?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.yifu.cloud.plus.v1.yifu.archives.mapper.LUnitInfoForProveMapper">
<resultMap id="lUnitInfoForProveMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.LUnitInfoForProve">
<id property="id" column="id"/>
<result property="creatUser" column="creat_user"/>
<result property="unitName" column="unit_name"/>
<result property="unitAddr" column="unit_addr"/>
<result property="phone" column="phone"/>
</resultMap>
<sql id="Base_Column_List">
a.id,
a.creat_user,
a.unit_name,
a.unit_addr,
a.phone
</sql>
<sql id="lUnitInfoForProve_where">
<if test="lUnitInfoForProve != null">
<if test="lUnitInfoForProve.id != null">
AND a.id = #{lUnitInfoForProve.id}
</if>
<if test="lUnitInfoForProve.creatUser != null">
AND a.creat_user = #{lUnitInfoForProve.creatUser}
</if>
<if test="lUnitInfoForProve.unitName != null and lUnitInfoForProve.unitName.trim() != ''">
AND a.unit_name = #{lUnitInfoForProve.unitName}
</if>
<if test="lUnitInfoForProve.unitAddr != null and lUnitInfoForProve.unitAddr.trim() != ''">
AND a.unit_addr = #{lUnitInfoForProve.unitAddr}
</if>
<if test="lUnitInfoForProve.phone != null and lUnitInfoForProve.phone.trim() != ''">
AND a.phone = #{lUnitInfoForProve.phone}
</if>
</if>
</sql>
</mapper>
<?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.yifu.cloud.plus.v1.yifu.archives.mapper.MSalaryProvaAttaMapper">
<resultMap id="mSalaryProvaAttaMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.MSalaryProvaAtta">
<id property="id" column="id"/>
<result property="salaryProvaId" column="SALARY_PROVA_ID"/>
<result property="attaId" column="ATTA_ID"/>
</resultMap>
<sql id="Base_Column_List">
a.id,
a.SALARY_PROVA_ID,
a.ATTA_ID
</sql>
<sql id="mSalaryProvaAtta_where">
<if test="mSalaryProvaAtta != null">
<if test="mSalaryProvaAtta.id != null and mSalaryProvaAtta.id.trim() != ''">
AND a.id = #{mSalaryProvaAtta.id}
</if>
<if test="mSalaryProvaAtta.salaryProvaId != null and mSalaryProvaAtta.salaryProvaId.trim() != ''">
AND a.SALARY_PROVA_ID = #{mSalaryProvaAtta.salaryProvaId}
</if>
<if test="mSalaryProvaAtta.attaId != null and mSalaryProvaAtta.attaId.trim() != ''">
AND a.ATTA_ID = #{mSalaryProvaAtta.attaId}
</if>
</if>
</sql>
</mapper>
......@@ -8,7 +8,7 @@
<result property="attaSrc" column="atta_src"/>
<result property="attaSize" column="atta_size"/>
<result property="attaType" column="atta_type"/>
<result property="createUser" column="create_user"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="relationType" column="relation_type"/>
<result property="domainId" column="domain_id"/>
......@@ -19,7 +19,7 @@
a.atta_src,
a.atta_size,
a.atta_type,
a.create_user,
a.create_by,
a.create_time,
a.relation_type,
a.domain_id
......@@ -41,8 +41,8 @@
<if test="tAttaInfo.attaType != null and tAttaInfo.attaType.trim() != ''">
AND a.atta_type = #{tAttaInfo.attaType}
</if>
<if test="tAttaInfo.createUser != null and tAttaInfo.createUser.trim() != ''">
AND a.create_user = #{tAttaInfo.createUser}
<if test="tAttaInfo.createBy != null and tAttaInfo.createBy.trim() != ''">
AND a.create_by = #{tAttaInfo.createBy}
</if>
<if test="tAttaInfo.createTime != null">
AND a.create_time = #{tAttaInfo.createTime}
......@@ -106,4 +106,12 @@
</foreach>
</if>
</update>
<select id="getAttaByApplyId" resultMap="tAttaInfoMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_atta_info a
where EXISTS (select 1 from m_salary_prova_atta b where b.SALARY_PROVA_ID = #{applyId} and a.id = b.ATTA_ID);
</select>
</mapper>
<?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.yifu.cloud.plus.v1.yifu.archives.mapper.TProveApplyMapper">
<resultMap id="tProveApplyMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TProveApply">
<id property="id" column="id"/>
<result property="employeeInfo" column="employee_info"/>
<result property="creatUser" column="creat_user"/>
<result property="creatDate" column="creat_date"/>
<result property="startMonth" column="start_month"/>
<result property="endMonth" column="end_month"/>
<result property="proveSalary" column="prove_salary"/>
<result property="applyReason" column="apply_reason"/>
<result property="auditStatus" column="audit_status"/>
<result property="auditUser" column="audit_user"/>
<result property="auditDate" column="audit_date"/>
<result property="sumType" column="sum_type"/>
<result property="salary" column="salary"/>
<result property="employeeName" column="EMPLOYEE_NAME"/>
<result property="employeeIdCard" column="EMPLOYEE_ID_CARD"/>
<result property="settleDomainName" column="SETTLE_DOMAIN_NAME"/>
<result property="creatUserName" column="CREAT_USER_NAME"/>
</resultMap>
<sql id="Base_Column_List">
a.id,
a.employee_info,
a.creat_user,
a.creat_date,
a.start_month,
a.end_month,
a.prove_salary,
a.apply_reason,
a.audit_status,
a.audit_user,
a.audit_date,
a.sum_type,
a.salary,
a.EMPLOYEE_NAME,
a.EMPLOYEE_ID_CARD,
a.SETTLE_DOMAIN_NAME,
a.AUDIT_USER_NAME,
a.CREAT_USER_NAME
</sql>
<sql id="tProveApply_where">
<if test="tProveApply != null">
<if test="tProveApply.employeeIdCard != null and tProveApply.employeeIdCard.trim() != ''">
AND a.EMPLOYEE_ID_CARD like '%${tProveApply.employeeIdCard}%'
</if>
<if test="tProveApply.employeeName != null and tProveApply.employeeName.trim() != ''">
AND a.EMPLOYEE_NAME like '%${tProveApply.employeeName}%'
</if>
<if test="tProveApply.employeeInfo != null and tProveApply.employeeInfo.trim() != ''">
AND a.employee_info = #{tProveApply.employeeInfo}
</if>
<if test="tProveApply.creatUser != null">
AND a.creat_user = #{tProveApply.creatUser}
</if>
<if test="tProveApply.creatDate != null">
AND a.creat_date = #{tProveApply.creatDate}
</if>
<if test="tProveApply.startMonth != null and tProveApply.startMonth.trim() != ''">
AND a.start_month = #{tProveApply.startMonth}
</if>
<if test="tProveApply.endMonth != null and tProveApply.endMonth.trim() != ''">
AND a.end_month = #{tProveApply.endMonth}
</if>
<if test="tProveApply.proveSalary != null">
AND a.prove_salary = #{tProveApply.proveSalary}
</if>
<if test="tProveApply.applyReason != null and tProveApply.applyReason.trim() != ''">
AND a.apply_reason = #{tProveApply.applyReason}
</if>
<if test="tProveApply.auditStatus != null">
AND a.audit_status = #{tProveApply.auditStatus}
</if>
<if test="tProveApply.auditUser != null">
AND a.audit_user = #{tProveApply.auditUser}
</if>
<if test="tProveApply.auditDate != null">
AND a.audit_date = #{tProveApply.auditDate}
</if>
<if test="tProveApply.sumType != null">
AND a.sum_type = #{tProveApply.sumType}
</if>
<if test="tProveApply.salary != null">
AND a.salary = #{tProveApply.salary}
</if>
</if>
</sql>
<!--tProveApply简单分页查询-->
<select id="getTProveApplyPage" resultMap="tProveApplyMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_prove_apply a
<where>
1=1
<include refid="tProveApply_where"/>
</where>
</select>
</mapper>
<?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.yifu.cloud.plus.v1.yifu.archives.mapper.TProveRecordMapper">
<resultMap id="tProveRecordMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TProveRecord">
<id property="id" column="id"/>
<result property="employeeInfo" column="employee_info"/>
<result property="creatUser" column="creat_user"/>
<result property="creatDate" column="creat_date"/>
<result property="startMonth" column="start_month"/>
<result property="endMonth" column="end_month"/>
<result property="salary" column="salary"/>
<result property="proveSalary" column="prove_salary"/>
<result property="isInvalid" column="is_invalid"/>
<result property="invalidReason" column="invalid_reason"/>
<result property="no" column="no"/>
<result property="purpose" column="purpose"/>
<result property="sumType" column="sum_type"/>
<result property="proveType" column="prove_type"/>
<result property="number" column="number"/>
<result property="unitName" column="unit_name"/>
<result property="unitAddr" column="unit_addr"/>
<result property="phone" column="phone"/>
<result property="employeeIdCard" column="EMPLOYEE_ID_CARD"/>
<result property="employeeName" column="EMPLOYEE_NAME"/>
<result property="employeeSettleDepartName" column="EMPLOYEE_SETTLE_DEPART_NAME"/>
<result property="creatUserName" column="CREAT_USER_NAME"/>
</resultMap>
<sql id="Base_Column_List">
a.id,
a.employee_info,
a.creat_user,
a.creat_date,
a.start_month,
a.end_month,
a.salary,
a.prove_salary,
a.is_invalid,
a.invalid_reason,
a.no,
a.purpose,
a.sum_type,
a.prove_type,
a.number,
a.unit_name,
a.unit_addr,
a.phone,
a.EMPLOYEE_ID_CARD,
a.EMPLOYEE_NAME,
a.EMPLOYEE_SETTLE_DEPART_NAME,
a.CREAT_USER_NAME
</sql>
<sql id="tProveRecord_where">
<if test="tProveRecord != null">
<if test="tProveRecord.idList != null and tProveRecord.idList.size>0">
AND a.id in
<foreach item="idStr" index="index" collection="tProveRecord.idList" open="(" separator="," close=")">
#{idStr}
</foreach>
</if>
<if test="tProveRecord.creatUser != null">
AND a.creat_user = #{tProveRecord.creatUser}
</if>
<if test="tProveRecord.employeeIdCard != null and tProveRecord.employeeIdCard.trim() != ''">
AND a.EMPLOYEE_ID_CARD like '%${tProveRecord.employeeIdCard}%'
</if>
<if test="tProveRecord.employeeName != null and tProveRecord.employeeName.trim() != ''">
AND a.EMPLOYEE_NAME like '%${tProveRecord.employeeName}%'
</if>
<if test="tProveRecord.creatDate != null">
AND a.creat_date = #{tProveRecord.creatDate}
</if>
<if test="tProveRecord.startMonth != null and tProveRecord.startMonth.trim() != ''">
AND a.start_month = #{tProveRecord.startMonth}
</if>
<if test="tProveRecord.endMonth != null and tProveRecord.endMonth.trim() != ''">
AND a.end_month = #{tProveRecord.endMonth}
</if>
<if test="tProveRecord.salary != null">
AND a.salary = #{tProveRecord.salary}
</if>
<if test="tProveRecord.proveSalary != null">
AND a.prove_salary = #{tProveRecord.proveSalary}
</if>
<if test="tProveRecord.isInvalid != null">
AND a.is_invalid = #{tProveRecord.isInvalid}
</if>
<if test="tProveRecord.invalidReason != null and tProveRecord.invalidReason.trim() != ''">
AND a.invalid_reason = #{tProveRecord.invalidReason}
</if>
<if test="tProveRecord.no != null and tProveRecord.no.trim() != ''">
AND a.no = #{tProveRecord.no}
</if>
<if test="tProveRecord.purpose != null and tProveRecord.purpose.trim() != ''">
AND a.purpose = #{tProveRecord.purpose}
</if>
<if test="tProveRecord.sumType != null">
AND a.sum_type = #{tProveRecord.sumType}
</if>
<if test="tProveRecord.proveType != null">
AND a.prove_type = #{tProveRecord.proveType}
</if>
<if test="tProveRecord.number != null">
AND a.number = #{tProveRecord.number}
</if>
<if test="tProveRecord.unitName != null and tProveRecord.unitName.trim() != ''">
AND a.unit_name = #{tProveRecord.unitName}
</if>
<if test="tProveRecord.unitAddr != null and tProveRecord.unitAddr.trim() != ''">
AND a.unit_addr = #{tProveRecord.unitAddr}
</if>
<if test="tProveRecord.phone != null and tProveRecord.phone.trim() != ''">
AND a.phone = #{tProveRecord.phone}
</if>
</if>
</sql>
<!--tProveRecord简单分页查询-->
<select id="getTProveRecordPage" resultMap="tProveRecordMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_prove_record a
<where>
1=1
<include refid="tProveRecord_where"/>
</where>
</select>
<!--导出查条数-->
<select id="getCountByExport" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_prove_record a
<where>
1=1
<include refid="tProveRecord_where"/>
</where>
</select>
<!--导出list-->
<select id="getRecordInfoNoPage" resultMap="tProveRecordMap">
SELECT
a.id,
a.creat_date,
a.start_month,
a.end_month,
a.salary,
a.prove_salary,
if(a.is_invalid='0','否','是') as is_invalid,
a.invalid_reason,
a.no,
a.purpose,
if(a.sum_type='0','实发平均','应发平均') as sum_type,
if(a.prove_type='0','正式员工证明','试用期员工证明') as prove_type,
a.number,
a.unit_name,
a.unit_addr,
a.phone,
a.EMPLOYEE_ID_CARD,
a.EMPLOYEE_NAME,
a.EMPLOYEE_SETTLE_DEPART_NAME,
a.CREAT_USER_NAME
FROM t_prove_record a
<where>
1=1
<include refid="tProveRecord_where"/>
</where>
<if test="tProveRecord != null">
<if test="tProveRecord.limitStart != null">
limit #{tProveRecord.limitStart},#{tProveRecord.limitEnd}
</if>
</if>
</select>
<select id="createNo" resultType="java.lang.Integer">
select max(right(a.`no`,5))+1 from t_prove_record a where a.`no` like '${str}%'
</select>
</mapper>
package com.yifu.cloud.plus.v1.yifu.salary.vo;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @program: master
* @description: 工资证明数据
* @author: pwang
* @create: 2019-11-06 12:01
**/
@Data
public class WageProofDto implements Serializable {
private static final long serialVersionUID = 1L;
private BigDecimal salary;//应发平均
private Integer realMonthCount;//实发月数
private String startMouth;
private String endMouth;
private String emIdCard;
private String sumType;
}
......@@ -24,6 +24,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainListVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.LocalDateTimeUtils;
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.config.DaprArchivesProperties;
......@@ -39,8 +40,10 @@ import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccountItem;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryAccountItemService;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryAccountService;
import com.yifu.cloud.plus.v1.yifu.salary.util.SalaryCommonUtil;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryAccountSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryDetailVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.WageProofDto;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
......@@ -48,6 +51,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -316,4 +320,73 @@ public class TSalaryAccountController {
public Boolean updateSalarySettleStatus(@RequestBody List<EkpSocialViewVo> viewVo) {
return tSalaryAccountService.updateSalarySettleStatus(viewVo);
}
/**
* 服务间调用
* @Author pwang
* @Date 2019-11-06 17:14
* @return
**/
@Inner
@PostMapping("/inner/findAverageSalaryForProve")
public R<WageProofDto> findAverageSalaryForProve(WageProofDto pd) {
return getWageProofDtoR(pd.getStartMouth(), pd.getEndMouth(), pd.getEmIdCard(), pd.getSumType(), null);
}
/**
* 获取证明工资数据接口
* @Author pwang
* @Date 2019-11-06 17:14
* @param startMouth 开始月
* @param endMouth 结束月
* @param emIdCard 员工身份证
* @param settleDepartId 结算主体id
* @param sumType 0实发平均 1应发平均
* @return
**/
@Operation(summary = "获取证明工资数据", description = "获取证明工资数据")
@GetMapping("/getAverageSalaryForProve")
public R<WageProofDto> getAverageSalaryForProve(String startMouth, String endMouth, String emIdCard,String sumType, String settleDepartId) {
if( Common.isEmpty(startMouth) || Common.isEmpty(endMouth) || Common.isEmpty(emIdCard) || Common.isEmpty(sumType) ){
return R.failed("参数不完整");
}
return getWageProofDtoR(startMouth, endMouth, emIdCard, sumType, settleDepartId);
}
private R<WageProofDto> getWageProofDtoR(String startMouth, String endMouth, String emIdCard, String sumType, String settleDepartId) {
WageProofDto wp = new WageProofDto();
List<String> accountIdForProve = tSalaryAccountService.getAccountIdForProve(startMouth, endMouth, emIdCard, settleDepartId);
String accIdStr;
int realMonthCount = 0;
BigDecimal salary = null;
List<String> accountMonthForProve = null;
if (Common.isNotNull(accountIdForProve)) {
accountMonthForProve = tSalaryAccountService.getAccountMonthForProve(startMouth, endMouth, emIdCard, settleDepartId);
if (Common.isNotNull(accountMonthForProve)) {
realMonthCount = accountMonthForProve.size();
int count = LocalDateTimeUtils.getBeginOfMonth(endMouth.concat("01"), startMouth.concat("01"), "yyyyMMdd") + 1;
if (count != realMonthCount) {
return R.failed("信息不一致,实际发工资月份为:" + SalaryCommonUtil.listToStrEasy(accountMonthForProve));
}
} else {
return R.failed("实发工资月份有误!");
}
//普通工资信息
accIdStr = SalaryCommonUtil.listForSqlIn(accountIdForProve);
if ("0".equals(sumType)) {
salary = tSalaryAccountItemService.getAllMoneyByAccountIdAndFiedName(accIdStr, SalaryConstants.ACTUAL_SALARY_SUM_JAVA);//实发合计
} else {
salary = tSalaryAccountItemService.getAllMoneyByAccountIdAndFiedName(accIdStr, SalaryConstants.RELAY_SALARY_JAVA);//应发合计
}
}
if (null == salary) {
return R.failed("无工资信息!");
}
wp.setRealMonthCount(realMonthCount);
wp.setSalary(salary.divide(new BigDecimal(realMonthCount), SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP));
return new R(wp);
}
}
......@@ -176,4 +176,10 @@ public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> {
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount>
**/
List<TSalaryAccount> getListByIdList(@Param("idList") List<String> idList);
List<String> getAccountIdForProve(@Param("startMouth") String startMouth, @Param("endMouth") String endMouth
, @Param("emIdCard") String emIdCard, @Param("settleDepartId") String settleDepartId);
List<String> getAccountMonthForProve(@Param("startMouth") String startMouth, @Param("endMouth") String endMouth
, @Param("emIdCard") String emIdCard, @Param("settleDepartId") String settleDepartId);
}
......@@ -193,4 +193,8 @@ public interface TSalaryAccountService extends IService<TSalaryAccount> {
**/
List<TSalaryAccount> getListByIdList(List<String> idList);
// 收入证明使用的
List<String> getAccountIdForProve(String startMouth, String endMouth, String emIdCard, String settleDepartId);
List<String> getAccountMonthForProve(String startMouth, String endMouth, String emIdCard, String settleDepartId);
}
......@@ -365,4 +365,13 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
public List<TSalaryAccount> getListByIdList(List<String> idList) {
return baseMapper.getListByIdList(idList);
}
@Override
public List<String> getAccountIdForProve(String startMouth, String endMouth, String emIdCard, String settleDepartId) {
return baseMapper.getAccountIdForProve(startMouth, endMouth, emIdCard, settleDepartId);
}
@Override
public List<String> getAccountMonthForProve(String startMouth, String endMouth, String emIdCard, String settleDepartId) {
return baseMapper.getAccountMonthForProve(startMouth, endMouth, emIdCard, settleDepartId);
}
}
......@@ -18,9 +18,7 @@ import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.Map;
import java.util.Set;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
......@@ -524,4 +522,47 @@ public class SalaryCommonUtil implements Serializable {
entity.setFormType(salaryType);
}
/**
* @param strList
* @Description: 简单的list转化为String
* @Author: hgw
* @Date: 2019/9/27 17:19
* @return: java.lang.String
**/
public static String listToStrEasy(List<String> strList) {
StringBuilder result = new StringBuilder();
if (strList != null && !strList.isEmpty()) {
for (int i = 0; i < strList.size(); i++) {
if (i == 0) {
result.append(strList.get(0));
} else {
result.append(",").append(strList.get(i));
}
}
}
return result.toString();
}
/**
* 拼成带'的串xml里用$取值
*
* @param list
* @return
*/
public static String listForSqlIn(List<String> list) {
String result = "";
if (Common.isNotNull(list)) {
// 去重
Set<String> set = new HashSet<String>(list);
for (String str : set) {
if ("".equals(result)) {
result = "'" + str + "'";
} else {
result += ",'" + str + "'";
}
}
}
return result;
}
}
......@@ -1136,4 +1136,29 @@
#{ids}
</foreach>
</select>
<!-- 收入证明使用的 -->
<select id="getAccountIdForProve" resultType="java.lang.String">
SELECT a.id
FROM t_salary_account a
WHERE a.EMP_IDCARD = #{emIdCard}
<if test="settleDepartId != null">
and a.DEPT_ID = #{settleDepartId}
</if>
and a.DELETE_FLAG = 0
AND PERIOD_DIFF(a.SALARY_MONTH, #{startMouth}) >= 0
AND PERIOD_DIFF(#{endMouth}, a.SALARY_MONTH) >= 0
</select>
<select id="getAccountMonthForProve" resultType="java.lang.String">
SELECT a.SALARY_MONTH
FROM t_salary_account a
WHERE a.EMP_IDCARD = #{emIdCard}
<if test="settleDepartId != null">
and a.DEPT_ID = #{settleDepartId}
</if>
and a.DELETE_FLAG = 0
AND PERIOD_DIFF(a.SALARY_MONTH, #{startMouth}) >= 0
AND PERIOD_DIFF(#{endMouth}, a.SALARY_MONTH) >= 0
group by a.SALARY_MONTH
</select>
</mapper>
......@@ -473,6 +473,9 @@
<if test="searchVo.status != null">
AND a.STATUS = #{searchVo.status}
</if>
<if test="searchVo.createName != null and searchVo.createName.trim() != ''">
AND a.CREATE_NAME = #{searchVo.createName}
</if>
</if>
</sql>
......
......@@ -356,15 +356,6 @@ public class TPaymentInfo extends BaseEntity {
@ExcelProperty("就职班组")
private String inauguralTeam;
/**
* 排序字段
*/
@ExcelAttribute(name = "排序字段" )
@Schema(description ="排序字段")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("排序字段")
private String sortTime;
/**
* 推送状态
*/
......@@ -663,6 +654,13 @@ public class TPaymentInfo extends BaseEntity {
@ExcelProperty("支出信息付款状态")
private String payCollectFlag;
/**
* EKP的 是否BPO: 是 否
*/
@Schema(description = "是否BPO", name = "bpoFlag")
@ExcelIgnore
private String bpoFlag;
/**
* 是否需要生成收入
*/
......
......@@ -211,6 +211,15 @@ public class TProvidentFund extends BaseEntity {
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("项目" )
private String settleDomain;
/**
* 项目编码
*/
@Length(max = 32, message = "项目编码 不能超过32个字符" )
@ExcelAttribute(name = "项目编码", maxLength = 32)
@Schema(description = "项目编码" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("项目编码" )
private String settleDomainCode;
/**
* 缴纳地-省
*/
......
......@@ -314,6 +314,15 @@ public class TSocialInfo extends BaseEntity {
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("项目" )
private String settleDomain;
/**
* 项目编码
*/
@Length(max = 32, message = "项目编码 不能超过32个字符" )
@ExcelAttribute(name = "项目编码", maxLength = 32)
@Schema(description = "项目编码" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("项目编码" )
private String settleDomainCode;
/**
* 缴纳地-省
*/
......
......@@ -260,5 +260,12 @@ public class TPaymentInfoPushVo implements Serializable {
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("创建时间")
private String createTime;
/**
* 是否bpo标识
*/
@Schema(description = "是否bpo标识")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("是否bpo标识")
private String bpoFlag;
}
......@@ -337,15 +337,6 @@ public class TPaymentInfoVo extends RowIndex implements Serializable {
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "就职班组")
private String inauguralTeam;
/**
* 排序字段
*/
@Length(max = 32, message = "排序字段 不能超过32 个字符")
@ExcelAttribute(name = "排序字段", maxLength = 32)
@Schema(description = "排序字段")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "排序字段")
private String sortTime;
/**
* 单位补缴利息
*/
......
......@@ -1373,6 +1373,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
fund.setDeleteFlag(CommonConstants.ZERO_STRING);
fund.setBelongUnit(excel.getCustomerId());
fund.setSettleDomain(excel.getSettleDomainId());
fund.setSettleDomainCode(excel.getSettleDomainCode());
if (Common.isNotNull(empVo)){
fund.setEmpId(empVo.getId());
fund.setEmpNo(empVo.getEmpNo());
......@@ -1504,6 +1505,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
// 封装单位信息 结算信息
social.setBelongUnit(excel.getCustomerId());
social.setSettleDomain(excel.getSettleDomainId());
social.setSettleDomainCode(excel.getSettleDomainCode());
if (Common.isNotNull(empVo)){
social.setEmpId(empVo.getId());
social.setEmpName(empVo.getEmpName());
......
......@@ -510,11 +510,7 @@ public class DoJointSocialTask {
socialParam.setFd_3adfe8c73cb5a4(CommonConstants.EMPTY_STRING);
}
//是否为BPO业务
if (Common.isNotNull(settleDomain) && Common.isNotNull(settleDomain.getBpoFlag())) {
socialParam.setFd_3b178dfcf9e3e6(settleDomain.getBpoFlag());
} else {
socialParam.setFd_3b178dfcf9e3e6(CommonConstants.EMPTY_STRING);
}
socialParam.setFd_3b178dfcf9e3e6(library.getBpoFlag());
//客户名称
if (Common.isNotNull(library.getUnitName())) {
socialParam.setFd_3adfe8c81a0e42(library.getUnitName());
......@@ -809,11 +805,7 @@ public class DoJointSocialTask {
fundParam.setFd_3adfe8c73cb5a4(CommonConstants.EMPTY_STRING);
}
//是否为BPO业务
if (Common.isNotNull(settleDomain) && Common.isNotNull(settleDomain.getBpoFlag())) {
fundParam.setFd_3b178ea361cabe(settleDomain.getBpoFlag());
} else {
fundParam.setFd_3b178ea361cabe(CommonConstants.EMPTY_STRING);
}
fundParam.setFd_3b178ea361cabe(library.getBpoFlag());
//单位代缴
if (Common.isNotNull(library.getUnitProvidentSum())) {
fundParam.setFd_3adfeb52fbe966(library.getUnitProvidentSum().toString());
......
......@@ -58,7 +58,6 @@
<result property="socialSecurityPersonalSum" column="SOCIAL_SECURITY_PERSONAL_SUM"/>
<result property="providentSum" column="PROVIDENT_SUM"/>
<result property="inauguralTeam" column="INAUGURAL_TEAM"/>
<result property="sortTime" column="SORT_TIME"/>
<result property="companyAccrual" column="COMPANY_ACCRUAL"/>
<result property="personalAccrual" column="PERSONAL_ACCRUAL"/>
<result property="unitPensionSet" column="UNIT_PENSION_SET"/>
......@@ -105,6 +104,7 @@
<result property="incomeCollectFlag" column="INCOME_COLLECT_FLAG"/>
<result property="paySettleFlag" column="PAY_SETTLE_FLAG"/>
<result property="payCollectFlag" column="PAY_COLLECT_FLAG"/>
<result property="bpoFlag" column="BPO_FLAG"/>
</resultMap>
<resultMap id="tPaymentInfoSumMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoExportVo">
<result property="empName" column="EMP_NAME"/>
......@@ -188,6 +188,7 @@
<result property="personalBigmailmentMoney" column="PERSONAL_BIGMAILMENT_MONEY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="bpoFlag" column="BPO_FLAG"/>
</resultMap>
<resultMap id="tPaymentInfoBatchMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoBatchVo">
......@@ -286,7 +287,6 @@
a.SOCIAL_SECURITY_PERSONAL_SUM,
a.PROVIDENT_SUM,
a.INAUGURAL_TEAM,
a.SORT_TIME,
a.SALARY_SOCIAL_FLAG,
a.SALARY_FUND_FLAG,
a.COMPANY_ACCRUAL,
......@@ -430,9 +430,6 @@
<if test="tPaymentInfo.inauguralTeam != null and tPaymentInfo.inauguralTeam.trim() != ''">
AND a.INAUGURAL_TEAM = #{tPaymentInfo.inauguralTeam}
</if>
<if test="tPaymentInfo.sortTime != null and tPaymentInfo.sortTime.trim() != ''">
AND a.SORT_TIME = #{tPaymentInfo.sortTime}
</if>
<if test="tPaymentInfo.companyAccrual != null">
AND a.COMPANY_ACCRUAL = #{tPaymentInfo.companyAccrual}
</if>
......@@ -1178,6 +1175,7 @@
SUM( a.PERSONAL_MEDICAL_MONEY ) AS PERSONAL_MEDICAL_MONEY,
SUM( a.PERSONAL_UNEMPLOYMENT_MONEY ) AS PERSONAL_UNEMPLOYMENT_MONEY,
SUM( a.PERSONAL_BIGMAILMENT_MONEY ) AS PERSONAL_BIGMAILMENT_MONEY,
a.BPO_FLAG,
a.CREATE_NAME,
DATE_FORMAT(a.CREATE_TIME,'%Y-%m-%d') AS CREATE_NAME
FROM t_payment_info a
......
......@@ -43,6 +43,7 @@
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="settleDomain" column="SETTLE_DOMAIN"/>
<result property="settleDomainCode" column="SETTLE_DOMAIN_CODE"/>
<result property="fundProvince" column="FUND_PROVINCE"/>
<result property="fundCity" column="FUND_CITY"/>
<result property="fundTown" column="FUND_TOWN"/>
......
......@@ -56,6 +56,7 @@
<result property="cardinalId" column="CARDINAL_ID"/>
<result property="oldId" column="OLD_ID"/>
<result property="settleDomain" column="SETTLE_DOMAIN"/>
<result property="settleDomainCode" column="SETTLE_DOMAIN_CODE"/>
<result property="socialProvince" column="SOCIAL_PROVINCE"/>
<result property="socialCity" column="SOCIAL_CITY"/>
<result property="socialTown" column="SOCIAL_TOWN"/>
......
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