Browse Source

20221207修改导出签到表的文件地址

master
zhangye 3 years ago
parent
commit
c40f3983d5
  1. 54
      src/main/java/com/ccsens/ptccsens/api/SalaryController.java
  2. 28
      src/main/java/com/ccsens/ptccsens/bean/dto/SalaryDto.java
  3. 205
      src/main/java/com/ccsens/ptccsens/bean/po/PluMemberSalary.java
  4. 1231
      src/main/java/com/ccsens/ptccsens/bean/po/PluMemberSalaryExample.java
  5. 12
      src/main/java/com/ccsens/ptccsens/bean/vo/PluMemberSalaryVo.java
  6. 248
      src/main/java/com/ccsens/ptccsens/bean/vo/SalaryVo.java
  7. 22
      src/main/java/com/ccsens/ptccsens/persist/dao/PluMemberSalaryDao.java
  8. 30
      src/main/java/com/ccsens/ptccsens/persist/mapper/PluMemberSalaryMapper.java
  9. 2
      src/main/java/com/ccsens/ptccsens/service/ClockingInService.java
  10. 28
      src/main/java/com/ccsens/ptccsens/service/ISalaryService.java
  11. 115
      src/main/java/com/ccsens/ptccsens/service/SalaryService.java
  12. 4
      src/main/java/com/ccsens/ptccsens/util/BasicsCodeError.java
  13. 2
      src/main/resources/application.yml
  14. 17
      src/main/resources/mapper_dao/PluMemberSalaryDao.xml
  15. 403
      src/main/resources/mapper_raw/PluMemberSalaryMapper.xml
  16. 9
      src/main/resources/mbg.xml

54
src/main/java/com/ccsens/ptccsens/api/SalaryController.java

@ -0,0 +1,54 @@
package com.ccsens.ptccsens.api;
import com.ccsens.ptccsens.annotation.MustLogin;
import com.ccsens.ptccsens.bean.dto.SalaryDto;
import com.ccsens.ptccsens.bean.vo.SalaryVo;
import com.ccsens.ptccsens.service.ISalaryService;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.bean.dto.QueryDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
* @author
*/
@Api(tags = "工资相关")
@RestController
@RequestMapping("/salary")
@Slf4j
public class SalaryController {
@Resource
private ISalaryService salaryService;
@MustLogin
@ApiOperation(value = "查看员工工资信息", notes = "")
@RequestMapping(value = "/getMemberSalary", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<SalaryVo.MemberSalary> getMemberSalary(@ApiParam @Validated @RequestBody QueryDto<SalaryDto.SocialSecurity> params) throws Exception{
log.info("查看员工工资信息:{}",params);
SalaryVo.MemberSalary memberSalary = salaryService.getMemberSalary(params.getParam(), params.getUserId());
log.info("查看员工工资信息返回:{}",memberSalary);
return JsonResponse.newInstance().ok(memberSalary);
}
@MustLogin
@ApiOperation(value = "查看项目下所有员工的工资信息", notes = "")
@RequestMapping(value = "/queryMemberSalary", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<SalaryVo.MemberSalary>> queryMemberSalary(@ApiParam @Validated @RequestBody QueryDto<SalaryDto.SocialSecurity> params) throws Exception{
log.info("查看项目下所有员工的工资信息:{}",params);
List<SalaryVo.MemberSalary> memberSalaryList = salaryService.queryMemberSalary(params.getParam(), params.getUserId());
log.info("查看项目下所有员工的工资信息返回:{}",memberSalaryList);
return JsonResponse.newInstance().ok(memberSalaryList);
}
}

28
src/main/java/com/ccsens/ptccsens/bean/dto/SalaryDto.java

@ -0,0 +1,28 @@
package com.ccsens.ptccsens.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* @author
*/
@Data
public class SalaryDto {
@Data
@ApiModel("查询员工的工资信息")
public static class SocialSecurity{
@NotNull(message = "请传入项目信息")
@ApiModelProperty("项目id")
private Long projectId;
@ApiModelProperty("成员id")
private Long memberId;
@ApiModelProperty("开始时间")
private Long startTime;
@ApiModelProperty("结束时间")
private Long endTime;
}
}

205
src/main/java/com/ccsens/ptccsens/bean/po/PluMemberSalary.java

@ -0,0 +1,205 @@
package com.ccsens.ptccsens.bean.po;
import java.io.Serializable;
import java.util.Date;
public class PluMemberSalary implements Serializable {
private Long id;
private Long memberId;
private Long basicWage;
private String position;
private Integer workingTime;
private Long shareOption;
private Long receiveDividends;
private Long medicalInsurance;
private Long maternityInsurance;
private Long employmentInjuryInsurance;
private Long endowmentInsurance;
private Long unemploymentInsurance;
private Long housingFund;
private Long operator;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getMemberId() {
return memberId;
}
public void setMemberId(Long memberId) {
this.memberId = memberId;
}
public Long getBasicWage() {
return basicWage;
}
public void setBasicWage(Long basicWage) {
this.basicWage = basicWage;
}
public String getPosition() {
return position;
}
public void setPosition(String position) {
this.position = position == null ? null : position.trim();
}
public Integer getWorkingTime() {
return workingTime;
}
public void setWorkingTime(Integer workingTime) {
this.workingTime = workingTime;
}
public Long getShareOption() {
return shareOption;
}
public void setShareOption(Long shareOption) {
this.shareOption = shareOption;
}
public Long getReceiveDividends() {
return receiveDividends;
}
public void setReceiveDividends(Long receiveDividends) {
this.receiveDividends = receiveDividends;
}
public Long getMedicalInsurance() {
return medicalInsurance;
}
public void setMedicalInsurance(Long medicalInsurance) {
this.medicalInsurance = medicalInsurance;
}
public Long getMaternityInsurance() {
return maternityInsurance;
}
public void setMaternityInsurance(Long maternityInsurance) {
this.maternityInsurance = maternityInsurance;
}
public Long getEmploymentInjuryInsurance() {
return employmentInjuryInsurance;
}
public void setEmploymentInjuryInsurance(Long employmentInjuryInsurance) {
this.employmentInjuryInsurance = employmentInjuryInsurance;
}
public Long getEndowmentInsurance() {
return endowmentInsurance;
}
public void setEndowmentInsurance(Long endowmentInsurance) {
this.endowmentInsurance = endowmentInsurance;
}
public Long getUnemploymentInsurance() {
return unemploymentInsurance;
}
public void setUnemploymentInsurance(Long unemploymentInsurance) {
this.unemploymentInsurance = unemploymentInsurance;
}
public Long getHousingFund() {
return housingFund;
}
public void setHousingFund(Long housingFund) {
this.housingFund = housingFund;
}
public Long getOperator() {
return operator;
}
public void setOperator(Long operator) {
this.operator = operator;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", memberId=").append(memberId);
sb.append(", basicWage=").append(basicWage);
sb.append(", position=").append(position);
sb.append(", workingTime=").append(workingTime);
sb.append(", shareOption=").append(shareOption);
sb.append(", receiveDividends=").append(receiveDividends);
sb.append(", medicalInsurance=").append(medicalInsurance);
sb.append(", maternityInsurance=").append(maternityInsurance);
sb.append(", employmentInjuryInsurance=").append(employmentInjuryInsurance);
sb.append(", endowmentInsurance=").append(endowmentInsurance);
sb.append(", unemploymentInsurance=").append(unemploymentInsurance);
sb.append(", housingFund=").append(housingFund);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

1231
src/main/java/com/ccsens/ptccsens/bean/po/PluMemberSalaryExample.java

File diff suppressed because it is too large

12
src/main/java/com/ccsens/ptccsens/bean/vo/PluMemberSalaryVo.java

@ -0,0 +1,12 @@
package com.ccsens.ptccsens.bean.vo;
import com.ccsens.ptccsens.bean.po.PluMemberSalary;
import lombok.Data;
/**
* @author
*/
@Data
public class PluMemberSalaryVo extends PluMemberSalary {
private String memberName;
}

248
src/main/java/com/ccsens/ptccsens/bean/vo/SalaryVo.java

@ -0,0 +1,248 @@
package com.ccsens.ptccsens.bean.vo;
import cn.hutool.core.util.ObjectUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.HashMap;
import java.util.Map;
/**
* @author
*/
@Data
public class SalaryVo {
@Data
@ApiModel("成员工资信息")
public static class MemberSalary{
@ApiModelProperty("成员Id")
private Long memberId;
@ApiModelProperty("成员名")
private String memberName;
@ApiModelProperty("固定工资")
private Long fixedSalary = 0L;
@ApiModelProperty("固定工资分项")
private FixedSalaryOption fixedSalaryOption;
@ApiModelProperty("绩效工资")
private Long performance = 0L;
@ApiModelProperty("绩效工资分项")
private PerformanceOption performanceOption;
@ApiModelProperty("主人翁收入")
private Long stockRights = 0L;
@ApiModelProperty("主人翁收入分项")
private StockRightsOption stockRightsOption;
@ApiModelProperty("应发工资")
private Long shouldSalary = 0L;
@ApiModelProperty("社保支出")
private Long socialSecurity = 0L;
@ApiModelProperty("社保支出分项")
private SocialSecurityOption socialSecurityOption;
@ApiModelProperty("扣税")
private Long personalTax = 0L;
@ApiModelProperty("实发工资")
private Long realSalary = 0L;
public MemberSalary(FixedSalaryOption fixedSalaryOption, PerformanceOption performanceOption, StockRightsOption stockRightsOption, SocialSecurityOption socialSecurityOption) {
this.fixedSalaryOption = fixedSalaryOption;
this.performanceOption = performanceOption;
this.stockRightsOption = stockRightsOption;
this.socialSecurityOption = socialSecurityOption;
}
public MemberSalary() {
}
public Long getFixedSalary() {
Long f = fixedSalary;
//固定工资 = 基本工资 + 岗位工资 + 工龄工资
if(ObjectUtil.isNotNull(fixedSalaryOption)){
f = fixedSalaryOption.getBasicWage() + fixedSalaryOption.getPositionWage() + fixedSalaryOption.getWorkingTimeWage();
}
return f;
}
public Long getPerformance() {
Long p = performance;
//绩效工资 = 项目奖金 + 补助 + 提成 + 考核
if(ObjectUtil.isNotNull(performanceOption)){
p = performanceOption.getProjectBonus() + performanceOption.getSubsidy() + performanceOption.getPushMoney() + performanceOption.getAssess();
}
return p;
}
public Long getStockRights() {
Long s = stockRights;
//主人翁收入 = 分红
if(ObjectUtil.isNotNull(stockRightsOption)){
s = stockRightsOption.getReceiveDividends();
}
return s;
}
public Long getShouldSalary() {
//应发工资 = 固定工资 + 绩效工资 + 主人翁收入
return getFixedSalary() + getPerformance() + getStockRights();
}
public Long getSocialSecurity() {
Long s = socialSecurity;
//社保支出 = 五险一金的总数
if(ObjectUtil.isNotNull(socialSecurityOption)){
s = socialSecurityOption.getEmploymentInjuryInsurance() + socialSecurityOption.getEndowmentInsurance() + socialSecurityOption.getHousingFund() + socialSecurityOption.getMaternityInsurance() + socialSecurityOption.getMedicalInsurance() + socialSecurityOption.getUnemploymentInsurance();
}
return s;
}
public Long getPersonalTax() {
//TODO 扣税计算不明
return personalTax;
}
public Long getRealSalary() {
//实发工资 = 应发工资 - 社保支出 - 扣税
return getShouldSalary() - getSocialSecurity() - getPersonalTax();
}
}
@Data
@ApiModel("固定工资分项")
public static class FixedSalaryOption{
@ApiModelProperty("基本工资")
private Long basicWage = 0L;
@ApiModelProperty("考勤信息")
private Basic basic;
@ApiModelProperty("岗位工资")
private Long positionWage = 0L;
@ApiModelProperty("岗位工资列表")
private Map<String,String> position = new HashMap<>();
@ApiModelProperty("工龄工资")
private Long workingTimeWage = 0L;
@ApiModelProperty("工龄工资列表")
private Map<String,String> workingTime = new HashMap<>();
{
position.put("P1","2000");
position.put("P2","3000");
position.put("P3","4000");
position.put("P4","5000");
position.put("P5","6000");
}
{
workingTime.put("1年","300");
workingTime.put("2年","500");
workingTime.put("3年","700");
workingTime.put("3年以上","1000");
}
public void setPositionWage(String p) {
if(p == null){
return;
}
String s = position.get(p);
if(ObjectUtil.isNotNull(s)){
this.positionWage = Long.parseLong(s);
}
}
public void setWorkingTimeWage(Integer w) {
if(w == null){
return;
}
long l = 0L;
switch (w){
case 0:
l = 300L;
break;
case 1:
l = 500L;
break;
case 2:
l = 700L;
break;
case 3:
l = 1000L;
break;
default:
break;
}
this.workingTimeWage = l;
}
public FixedSalaryOption(Long basicWage, Basic basic) {
this.basicWage = basicWage == null ? 0 : basicWage;
this.basic = basic;
}
public FixedSalaryOption() {
}
}
@Data
@ApiModel("考勤信息")
public static class Basic{
@ApiModelProperty("应出勤天数")
private int shouldAttendanceDay;
@ApiModelProperty("实际出勤天数")
private int realAttendanceDay;
@ApiModelProperty("弹性天数")
private int elasticityDay;
@ApiModelProperty("请假天数")
private int askForLeaveDay;
}
@Data
@ApiModel("绩效工资分项")
public static class PerformanceOption{
@ApiModelProperty("项目奖金")
private Long projectBonus = 0L;
@ApiModelProperty("补助")
private Long subsidy = 0L;
@ApiModelProperty("提成")
private Long pushMoney = 0L;
@ApiModelProperty("考核")
private Long assess = 0L;
}
@Data
@ApiModel("主人翁收入分项")
public static class StockRightsOption{
@ApiModelProperty("期权置换")
private Long sharePtion = 0L;
@ApiModelProperty("分红")
private Long receiveDividends = 0L;
public StockRightsOption(Long sharePtion, Long receiveDividends) {
this.sharePtion = sharePtion == null ? 0 : sharePtion;
this.receiveDividends = receiveDividends == null ? 0 : receiveDividends;
}
public StockRightsOption() {
}
}
@Data
@ApiModel("社保支出分项")
public static class SocialSecurityOption{
@ApiModelProperty("医疗保险")
private Long medicalInsurance = 0L;
@ApiModelProperty("生育保险")
private Long maternityInsurance = 0L;
@ApiModelProperty("工伤保险")
private Long employmentInjuryInsurance = 0L;
@ApiModelProperty("养老保险")
private Long endowmentInsurance = 0L;
@ApiModelProperty("失业保险")
private Long unemploymentInsurance = 0L;
@ApiModelProperty("住房公积金")
private Long housingFund = 0L;
public SocialSecurityOption(Long medicalInsurance, Long maternityInsurance, Long employmentInjuryInsurance, Long endowmentInsurance, Long unemploymentInsurance, Long housingFund) {
this.medicalInsurance = medicalInsurance == null ? 0 : medicalInsurance;
this.maternityInsurance = maternityInsurance == null ? 0 : maternityInsurance;
this.employmentInjuryInsurance = employmentInjuryInsurance == null ? 0 : employmentInjuryInsurance;
this.endowmentInsurance = endowmentInsurance == null ? 0 : endowmentInsurance;
this.unemploymentInsurance = unemploymentInsurance == null ? 0 : unemploymentInsurance;
this.housingFund = housingFund == null ? 0 : housingFund;
}
public SocialSecurityOption() {
}
}
}

22
src/main/java/com/ccsens/ptccsens/persist/dao/PluMemberSalaryDao.java

@ -0,0 +1,22 @@
package com.ccsens.ptccsens.persist.dao;
import com.ccsens.ptccsens.bean.vo.PluMemberSalaryVo;
import com.ccsens.ptccsens.persist.mapper.PluMemberSalaryMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author
*/
@Repository
public interface PluMemberSalaryDao extends PluMemberSalaryMapper {
/**
* 查询项目下所有成员的工资信息
* @param projectId 项目id
* @return 返回成员的工资信息
*/
List<PluMemberSalaryVo> queryByProjectId(@Param("projectId") Long projectId);
}

30
src/main/java/com/ccsens/ptccsens/persist/mapper/PluMemberSalaryMapper.java

@ -0,0 +1,30 @@
package com.ccsens.ptccsens.persist.mapper;
import com.ccsens.ptccsens.bean.po.PluMemberSalary;
import com.ccsens.ptccsens.bean.po.PluMemberSalaryExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface PluMemberSalaryMapper {
long countByExample(PluMemberSalaryExample example);
int deleteByExample(PluMemberSalaryExample example);
int deleteByPrimaryKey(Long id);
int insert(PluMemberSalary record);
int insertSelective(PluMemberSalary record);
List<PluMemberSalary> selectByExample(PluMemberSalaryExample example);
PluMemberSalary selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") PluMemberSalary record, @Param("example") PluMemberSalaryExample example);
int updateByExample(@Param("record") PluMemberSalary record, @Param("example") PluMemberSalaryExample example);
int updateByPrimaryKeySelective(PluMemberSalary record);
int updateByPrimaryKey(PluMemberSalary record);
}

2
src/main/java/com/ccsens/ptccsens/service/ClockingInService.java

@ -467,7 +467,7 @@ public class ClockingInService implements IClockingInService {
stream.close(); stream.close();
//返回文件路径 //返回文件路径
ClockingInVo.ExcelUrl excelUrl = new ClockingInVo.ExcelUrl(); ClockingInVo.ExcelUrl excelUrl = new ClockingInVo.ExcelUrl();
String url = PropUtil.imgDomain+fileName; String url = PropUtil.imgDomain + "/" + fileName;
excelUrl.setUrl(url); excelUrl.setUrl(url);
return excelUrl; return excelUrl;
} }

28
src/main/java/com/ccsens/ptccsens/service/ISalaryService.java

@ -0,0 +1,28 @@
package com.ccsens.ptccsens.service;
import com.ccsens.ptccsens.bean.dto.SalaryDto;
import com.ccsens.ptccsens.bean.vo.SalaryVo;
import java.util.List;
/**
* @author
*/
public interface ISalaryService {
/**
* 通过id查找成员工资信息
* @param param 成员id
* @param userId userId
* @return 返回成员工资信息
*/
SalaryVo.MemberSalary getMemberSalary(SalaryDto.SocialSecurity param, Long userId);
/**
* 查看项目下所有员工的工资信息
* @param param 项目id和时间
* @param userId userId
* @return 返回所有员工的工资信息
*/
List<SalaryVo.MemberSalary> queryMemberSalary(SalaryDto.SocialSecurity param, Long userId);
}

115
src/main/java/com/ccsens/ptccsens/service/SalaryService.java

@ -0,0 +1,115 @@
package com.ccsens.ptccsens.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.ObjectUtil;
import com.ccsens.ptccsens.bean.dto.SalaryDto;
import com.ccsens.ptccsens.bean.po.*;
import com.ccsens.ptccsens.bean.vo.PluMemberSalaryVo;
import com.ccsens.ptccsens.bean.vo.SalaryVo;
import com.ccsens.ptccsens.persist.dao.PluMemberSalaryDao;
import com.ccsens.ptccsens.persist.dao.ProMemberDao;
import com.ccsens.ptccsens.persist.dao.ProTaskDetailDao;
import com.ccsens.ptccsens.util.BasicsCodeError;
import com.ccsens.util.exception.BaseException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* @author
*/
@Slf4j
@Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class SalaryService implements ISalaryService{
@Resource
private ProTaskDetailDao taskDetailDao;
@Resource
private ProMemberDao proMemberDao;
@Resource
private PluMemberSalaryDao memberSalaryDao;
@Resource
private Snowflake snowflake;
@Override
public SalaryVo.MemberSalary getMemberSalary(SalaryDto.SocialSecurity param, Long userId) {
//成员信息或成员工资信息为空,返回错误信息
ProMember member = null;
if(ObjectUtil.isNull(param.getMemberId())){
//不传memberId 查询当前用户自身的信息
ProMemberExample memberExample = new ProMemberExample();
memberExample.createCriteria().andProjectIdEqualTo(param.getProjectId()).andUserIdEqualTo(userId);
List<ProMember> memberList = proMemberDao.selectByExample(memberExample);
if(CollectionUtil.isNotEmpty(memberList)){
member = memberList.get(0);
}
}else {
member = proMemberDao.selectByPrimaryKey(param.getMemberId());
}
if(ObjectUtil.isNull(member)){
throw new BaseException(BasicsCodeError.PROJECT_NOT_MEMBER);
}
//根据成员id查找成员工资信息
PluMemberSalaryExample memberSalaryExample = new PluMemberSalaryExample();
memberSalaryExample.createCriteria().andMemberIdEqualTo(member.getId());
List<PluMemberSalary> proMemberSalaries = memberSalaryDao.selectByExample(memberSalaryExample);
if(CollectionUtil.isEmpty(proMemberSalaries)){
throw new BaseException(BasicsCodeError.NOT_MEMBER_SALARIES);
}
PluMemberSalary salary = proMemberSalaries.get(0);
//返回
return getMemberSalaryVo(param, salary, member.getId(), member.getName());
}
private SalaryVo.MemberSalary getMemberSalaryVo(SalaryDto.SocialSecurity param, PluMemberSalary salary, Long id, String name) {
//TODO 查询成员的打卡信息
SalaryVo.Basic basic = clockingIn(id, param.getStartTime(), param.getEndTime(), param.getProjectId());
//固定工资
SalaryVo.FixedSalaryOption fixedSalaryOption = new SalaryVo.FixedSalaryOption(salary.getBasicWage(), basic);
fixedSalaryOption.setPositionWage(salary.getPosition());
fixedSalaryOption.setWorkingTimeWage(salary.getWorkingTime());
//绩效工资
SalaryVo.PerformanceOption performanceOption = new SalaryVo.PerformanceOption();
//主人翁收入
SalaryVo.StockRightsOption stockRightsOption = new SalaryVo.StockRightsOption(salary.getShareOption(), salary.getReceiveDividends());
//社保支出
SalaryVo.SocialSecurityOption socialSecurityOption = new SalaryVo.SocialSecurityOption(salary.getMedicalInsurance(), salary.getMaternityInsurance(), salary.getEmploymentInjuryInsurance(), salary.getEndowmentInsurance(), salary.getUnemploymentInsurance(), salary.getHousingFund());
//总的工资信息
SalaryVo.MemberSalary memberSalary = new SalaryVo.MemberSalary(fixedSalaryOption, performanceOption, stockRightsOption, socialSecurityOption);
memberSalary.setMemberId(id);
memberSalary.setMemberName(name);
return memberSalary;
}
private SalaryVo.Basic clockingIn(Long memberId, Long startTime, Long endTime, Long projectId) {
SalaryVo.Basic basic = new SalaryVo.Basic();
return basic;
}
@Override
public List<SalaryVo.MemberSalary> queryMemberSalary(SalaryDto.SocialSecurity param, Long userId) {
List<SalaryVo.MemberSalary> memberSalaryList = new ArrayList<>();
//查询项目下所有的成员的工资信息
List<PluMemberSalaryVo> proMemberSalaryVoList = memberSalaryDao.queryByProjectId(param.getProjectId());
if(CollectionUtil.isNotEmpty(proMemberSalaryVoList)){
proMemberSalaryVoList.forEach(salary -> {
//TODO 查询成员的打卡信息
SalaryVo.MemberSalary memberSalary = getMemberSalaryVo(param, salary, salary.getMemberId(), salary.getMemberName());
memberSalaryList.add(memberSalary);
});
}
return memberSalaryList;
}
}

4
src/main/java/com/ccsens/ptccsens/util/BasicsCodeError.java

@ -31,8 +31,8 @@ public class BasicsCodeError extends CodeError {
public static final Code TRAINING_NOT_CHECK = new Code(519,"培训计划未审核通过", true); public static final Code TRAINING_NOT_CHECK = new Code(519,"培训计划未审核通过", true);
public static final Code NOT_TRAINING_TEACHER = new Code(520,"未找到对应的委派通知", true); public static final Code NOT_TRAINING_TEACHER = new Code(520,"未找到对应的委派通知", true);
public static final Code TRAINING_TEACHER_NOT_MINE = new Code(521,"您不是被委托人,无法接受", true); public static final Code TRAINING_TEACHER_NOT_MINE = new Code(521,"您不是被委托人,无法接受", true);
public static final Code NOT_PLAYER = new Code(522,"未找到对应的运动员信息", true); public static final Code PROJECT_NOT_MEMBER = new Code(522,"未找到对应的员信息", true);
public static final Code NOT_PLAYER_APPLY = new Code(523,"未找到报名信息信息", true); public static final Code NOT_MEMBER_SALARIES = new Code(523,"该员工没有基本工资信息,请补充后再查询", true);
public static final Code ID_CODE_ERROR = new Code(524,"请输入正确的身份证", true); public static final Code ID_CODE_ERROR = new Code(524,"请输入正确的身份证", true);
public static final Code NOT_FILE = new Code(525,"找不到文件", true); public static final Code NOT_FILE = new Code(525,"找不到文件", true);
public static final Code FINANCE_ERROR = new Code(526,"财务信息错误", true); public static final Code FINANCE_ERROR = new Code(526,"财务信息错误", true);

2
src/main/resources/application.yml

@ -1,4 +1,4 @@
spring: spring:
profiles: profiles:
active: dev active: dev
include: common, util-dev include: common, util-dev

17
src/main/resources/mapper_dao/PluMemberSalaryDao.xml

@ -0,0 +1,17 @@
<?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.ccsens.ptccsens.persist.dao.PluMemberSalaryDao">
<select id="queryByProjectId" resultType="com.ccsens.ptccsens.bean.vo.PluMemberSalaryVo">
SELECT
m.id as memberId,
m.`name` as memberName,
s.*
FROM
t_pro_member m
LEFT JOIN t_pro_member_salary s on s.member_id = m.id and s.rec_status = 0
WHERE
m.project_id = #{projectId}
and m.rec_status = 0
</select>
</mapper>

403
src/main/resources/mapper_raw/PluMemberSalaryMapper.xml

@ -0,0 +1,403 @@
<?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.ccsens.ptccsens.persist.mapper.PluMemberSalaryMapper">
<resultMap id="BaseResultMap" type="com.ccsens.ptccsens.bean.po.PluMemberSalary">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="member_id" jdbcType="BIGINT" property="memberId" />
<result column="basic_wage" jdbcType="BIGINT" property="basicWage" />
<result column="position" jdbcType="VARCHAR" property="position" />
<result column="working_time" jdbcType="INTEGER" property="workingTime" />
<result column="share_option" jdbcType="BIGINT" property="shareOption" />
<result column="receive_dividends" jdbcType="BIGINT" property="receiveDividends" />
<result column="medical_insurance" jdbcType="BIGINT" property="medicalInsurance" />
<result column="maternity_insurance" jdbcType="BIGINT" property="maternityInsurance" />
<result column="employment_injury_insurance" jdbcType="BIGINT" property="employmentInjuryInsurance" />
<result column="endowment_insurance" jdbcType="BIGINT" property="endowmentInsurance" />
<result column="unemployment_insurance" jdbcType="BIGINT" property="unemploymentInsurance" />
<result column="housing_fund" jdbcType="BIGINT" property="housingFund" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, member_id, basic_wage, position, working_time, share_option, receive_dividends,
medical_insurance, maternity_insurance, employment_injury_insurance, endowment_insurance,
unemployment_insurance, housing_fund, operator, created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.ptccsens.bean.po.PluMemberSalaryExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_plu_member_salary
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_plu_member_salary
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_plu_member_salary
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.ptccsens.bean.po.PluMemberSalaryExample">
delete from t_plu_member_salary
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.ptccsens.bean.po.PluMemberSalary">
insert into t_plu_member_salary (id, member_id, basic_wage,
position, working_time, share_option,
receive_dividends, medical_insurance, maternity_insurance,
employment_injury_insurance, endowment_insurance,
unemployment_insurance, housing_fund, operator,
created_at, updated_at, rec_status
)
values (#{id,jdbcType=BIGINT}, #{memberId,jdbcType=BIGINT}, #{basicWage,jdbcType=BIGINT},
#{position,jdbcType=VARCHAR}, #{workingTime,jdbcType=INTEGER}, #{shareOption,jdbcType=BIGINT},
#{receiveDividends,jdbcType=BIGINT}, #{medicalInsurance,jdbcType=BIGINT}, #{maternityInsurance,jdbcType=BIGINT},
#{employmentInjuryInsurance,jdbcType=BIGINT}, #{endowmentInsurance,jdbcType=BIGINT},
#{unemploymentInsurance,jdbcType=BIGINT}, #{housingFund,jdbcType=BIGINT}, #{operator,jdbcType=BIGINT},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ptccsens.bean.po.PluMemberSalary">
insert into t_plu_member_salary
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="memberId != null">
member_id,
</if>
<if test="basicWage != null">
basic_wage,
</if>
<if test="position != null">
position,
</if>
<if test="workingTime != null">
working_time,
</if>
<if test="shareOption != null">
share_option,
</if>
<if test="receiveDividends != null">
receive_dividends,
</if>
<if test="medicalInsurance != null">
medical_insurance,
</if>
<if test="maternityInsurance != null">
maternity_insurance,
</if>
<if test="employmentInjuryInsurance != null">
employment_injury_insurance,
</if>
<if test="endowmentInsurance != null">
endowment_insurance,
</if>
<if test="unemploymentInsurance != null">
unemployment_insurance,
</if>
<if test="housingFund != null">
housing_fund,
</if>
<if test="operator != null">
operator,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="memberId != null">
#{memberId,jdbcType=BIGINT},
</if>
<if test="basicWage != null">
#{basicWage,jdbcType=BIGINT},
</if>
<if test="position != null">
#{position,jdbcType=VARCHAR},
</if>
<if test="workingTime != null">
#{workingTime,jdbcType=INTEGER},
</if>
<if test="shareOption != null">
#{shareOption,jdbcType=BIGINT},
</if>
<if test="receiveDividends != null">
#{receiveDividends,jdbcType=BIGINT},
</if>
<if test="medicalInsurance != null">
#{medicalInsurance,jdbcType=BIGINT},
</if>
<if test="maternityInsurance != null">
#{maternityInsurance,jdbcType=BIGINT},
</if>
<if test="employmentInjuryInsurance != null">
#{employmentInjuryInsurance,jdbcType=BIGINT},
</if>
<if test="endowmentInsurance != null">
#{endowmentInsurance,jdbcType=BIGINT},
</if>
<if test="unemploymentInsurance != null">
#{unemploymentInsurance,jdbcType=BIGINT},
</if>
<if test="housingFund != null">
#{housingFund,jdbcType=BIGINT},
</if>
<if test="operator != null">
#{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.ptccsens.bean.po.PluMemberSalaryExample" resultType="java.lang.Long">
select count(*) from t_plu_member_salary
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_plu_member_salary
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.memberId != null">
member_id = #{record.memberId,jdbcType=BIGINT},
</if>
<if test="record.basicWage != null">
basic_wage = #{record.basicWage,jdbcType=BIGINT},
</if>
<if test="record.position != null">
position = #{record.position,jdbcType=VARCHAR},
</if>
<if test="record.workingTime != null">
working_time = #{record.workingTime,jdbcType=INTEGER},
</if>
<if test="record.shareOption != null">
share_option = #{record.shareOption,jdbcType=BIGINT},
</if>
<if test="record.receiveDividends != null">
receive_dividends = #{record.receiveDividends,jdbcType=BIGINT},
</if>
<if test="record.medicalInsurance != null">
medical_insurance = #{record.medicalInsurance,jdbcType=BIGINT},
</if>
<if test="record.maternityInsurance != null">
maternity_insurance = #{record.maternityInsurance,jdbcType=BIGINT},
</if>
<if test="record.employmentInjuryInsurance != null">
employment_injury_insurance = #{record.employmentInjuryInsurance,jdbcType=BIGINT},
</if>
<if test="record.endowmentInsurance != null">
endowment_insurance = #{record.endowmentInsurance,jdbcType=BIGINT},
</if>
<if test="record.unemploymentInsurance != null">
unemployment_insurance = #{record.unemploymentInsurance,jdbcType=BIGINT},
</if>
<if test="record.housingFund != null">
housing_fund = #{record.housingFund,jdbcType=BIGINT},
</if>
<if test="record.operator != null">
operator = #{record.operator,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_plu_member_salary
set id = #{record.id,jdbcType=BIGINT},
member_id = #{record.memberId,jdbcType=BIGINT},
basic_wage = #{record.basicWage,jdbcType=BIGINT},
position = #{record.position,jdbcType=VARCHAR},
working_time = #{record.workingTime,jdbcType=INTEGER},
share_option = #{record.shareOption,jdbcType=BIGINT},
receive_dividends = #{record.receiveDividends,jdbcType=BIGINT},
medical_insurance = #{record.medicalInsurance,jdbcType=BIGINT},
maternity_insurance = #{record.maternityInsurance,jdbcType=BIGINT},
employment_injury_insurance = #{record.employmentInjuryInsurance,jdbcType=BIGINT},
endowment_insurance = #{record.endowmentInsurance,jdbcType=BIGINT},
unemployment_insurance = #{record.unemploymentInsurance,jdbcType=BIGINT},
housing_fund = #{record.housingFund,jdbcType=BIGINT},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.ptccsens.bean.po.PluMemberSalary">
update t_plu_member_salary
<set>
<if test="memberId != null">
member_id = #{memberId,jdbcType=BIGINT},
</if>
<if test="basicWage != null">
basic_wage = #{basicWage,jdbcType=BIGINT},
</if>
<if test="position != null">
position = #{position,jdbcType=VARCHAR},
</if>
<if test="workingTime != null">
working_time = #{workingTime,jdbcType=INTEGER},
</if>
<if test="shareOption != null">
share_option = #{shareOption,jdbcType=BIGINT},
</if>
<if test="receiveDividends != null">
receive_dividends = #{receiveDividends,jdbcType=BIGINT},
</if>
<if test="medicalInsurance != null">
medical_insurance = #{medicalInsurance,jdbcType=BIGINT},
</if>
<if test="maternityInsurance != null">
maternity_insurance = #{maternityInsurance,jdbcType=BIGINT},
</if>
<if test="employmentInjuryInsurance != null">
employment_injury_insurance = #{employmentInjuryInsurance,jdbcType=BIGINT},
</if>
<if test="endowmentInsurance != null">
endowment_insurance = #{endowmentInsurance,jdbcType=BIGINT},
</if>
<if test="unemploymentInsurance != null">
unemployment_insurance = #{unemploymentInsurance,jdbcType=BIGINT},
</if>
<if test="housingFund != null">
housing_fund = #{housingFund,jdbcType=BIGINT},
</if>
<if test="operator != null">
operator = #{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.ptccsens.bean.po.PluMemberSalary">
update t_plu_member_salary
set member_id = #{memberId,jdbcType=BIGINT},
basic_wage = #{basicWage,jdbcType=BIGINT},
position = #{position,jdbcType=VARCHAR},
working_time = #{workingTime,jdbcType=INTEGER},
share_option = #{shareOption,jdbcType=BIGINT},
receive_dividends = #{receiveDividends,jdbcType=BIGINT},
medical_insurance = #{medicalInsurance,jdbcType=BIGINT},
maternity_insurance = #{maternityInsurance,jdbcType=BIGINT},
employment_injury_insurance = #{employmentInjuryInsurance,jdbcType=BIGINT},
endowment_insurance = #{endowmentInsurance,jdbcType=BIGINT},
unemployment_insurance = #{unemploymentInsurance,jdbcType=BIGINT},
housing_fund = #{housingFund,jdbcType=BIGINT},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

9
src/main/resources/mbg.xml

@ -98,10 +98,11 @@
<!-- <table tableName="t_plu_clocking_in" domainObjectName="PluClockingIn"></table>--> <!-- <table tableName="t_plu_clocking_in" domainObjectName="PluClockingIn"></table>-->
<!-- <table tableName="t_sys_holidays" domainObjectName="SysHolidays"></table>--> <!-- <table tableName="t_sys_holidays" domainObjectName="SysHolidays"></table>-->
<table tableName="t_plu_daily_account_pro" domainObjectName="PluDailyAccountPro"></table> <!-- <table tableName="t_plu_daily_account_pro" domainObjectName="PluDailyAccountPro"></table>-->
<table tableName="t_plu_daily_account_emp" domainObjectName="PluDailyAccountEmp"></table> <!-- <table tableName="t_plu_daily_account_emp" domainObjectName="PluDailyAccountEmp"></table>-->
<table tableName="t_plu_daily_account_task" domainObjectName="PluDailyAccountTask"></table> <!-- <table tableName="t_plu_daily_account_task" domainObjectName="PluDailyAccountTask"></table>-->
<table tableName="t_plu_daily_account_emp_pro_task" domainObjectName="PluDailyAccountEmpProTask"></table> <!-- <table tableName="t_plu_daily_account_emp_pro_task" domainObjectName="PluDailyAccountEmpProTask"></table>-->
<table tableName="t_plu_member_salary" domainObjectName="PluMemberSalary"></table>

Loading…
Cancel
Save