Commit 1e345462 by 章家宝

Merge remote-tracking branch 'origin/v5.6.0' into v5.6.0

2 parents 2d1a01ef e2eabc5f
Showing 29 changed files with 567 additions and 242 deletions
...@@ -72,6 +72,12 @@ public class AttendanceInfoDTO implements Serializable { ...@@ -72,6 +72,12 @@ public class AttendanceInfoDTO implements Serializable {
private BigDecimal appealAttendanceDays; private BigDecimal appealAttendanceDays;
/** /**
* 出勤天数-最终取值
*/
@ApiModelProperty(notes = "出勤天数-最终取值")
private BigDecimal attendanceDays;
/**
* 上级领导手机号-北森表 * 上级领导手机号-北森表
*/ */
@ApiModelProperty(notes = "上级领导手机号-北森表") @ApiModelProperty(notes = "上级领导手机号-北森表")
......
package cn.com.glsx.dj.staff.dto.perfSalary; package cn.com.glsx.dj.staff.dto.perfSalary;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
/** /**
* 考勤统计汇总表 * 考勤统计汇总表
...@@ -31,13 +29,11 @@ public class AttendanceReqDTO implements Serializable { ...@@ -31,13 +29,11 @@ public class AttendanceReqDTO implements Serializable {
@ApiModelProperty(notes = "员工姓名-北森表") @ApiModelProperty(notes = "员工姓名-北森表")
private String name; private String name;
/** /**
* 考勤月份 * 考勤月份
*/ */
@ApiModelProperty(notes = "考勤月份") @ApiModelProperty(notes = "考勤月份 - 入参(yyyy-MM)")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private String attendanceMonth;
private Date attendanceMonth;
/** /**
* 区域经理手机号 * 区域经理手机号
......
package cn.com.glsx.dj.staff.dto.salary;
import java.math.BigDecimal;
import java.util.List;
import cn.com.glsx.dj.staff.model.StaffMonthSalarySlip;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.SuperBuilder;
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@Data
@ToString
public class StaffMonthSalarySlipDTO extends StaffMonthSalarySlip {
/**
*
*/
private static final long serialVersionUID = -4482729958297967553L;
@ApiModelProperty(notes="员工手机号列表")
private List<String> staffPhones;
@ApiModelProperty(notes="月份列表(格式:yyyy-MM)")
private List<String> salaryMonthList;
@ApiModelProperty(notes="工资月份-开始")
private String salaryMonthBegin;
@ApiModelProperty(notes="工资月份-结束")
private String salaryMonthEnd;
private BigDecimal totalActualSalary;
}
package cn.com.glsx.dj.staff.model; package cn.com.glsx.dj.staff.model;
import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import javax.persistence.*;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.SuperBuilder;
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@Data
@ToString
@Table(name = "dj_car_life_staff_month_business_data") @Table(name = "dj_car_life_staff_month_business_data")
public class StaffMonthBusinessData { public class StaffMonthBusinessData implements Serializable{
/** /**
*
*/
private static final long serialVersionUID = 9037646833505966717L;
/**
* 主键ID * 主键ID
*/ */
@Id @Id
...@@ -26,10 +47,10 @@ public class StaffMonthBusinessData { ...@@ -26,10 +47,10 @@ public class StaffMonthBusinessData {
private String salaryMonth; private String salaryMonth;
/** /**
* 业务场景类型 * 业务场景类型(0:轻改,1:权益;2:延保)
*/ */
@Column(name = "business_type") @Column(name = "business_type")
private String businessType; private Byte businessType;
/** /**
* 产值 * 产值
...@@ -72,202 +93,4 @@ public class StaffMonthBusinessData { ...@@ -72,202 +93,4 @@ public class StaffMonthBusinessData {
*/ */
@Column(name = "deleted_flag") @Column(name = "deleted_flag")
private String deletedFlag; private String deletedFlag;
/**
* 获取主键ID
*
* @return id - 主键ID
*/
public Integer getId() {
return id;
}
/**
* 设置主键ID
*
* @param id 主键ID
*/
public void setId(Integer id) {
this.id = id;
}
/**
* 获取驻店员工手机号
*
* @return staff_phone - 驻店员工手机号
*/
public String getStaffPhone() {
return staffPhone;
}
/**
* 设置驻店员工手机号
*
* @param staffPhone 驻店员工手机号
*/
public void setStaffPhone(String staffPhone) {
this.staffPhone = staffPhone == null ? null : staffPhone.trim();
}
/**
* 获取工资月份
*
* @return salary_month - 工资月份
*/
public String getSalaryMonth() {
return salaryMonth;
}
/**
* 设置工资月份
*
* @param salaryMonth 工资月份
*/
public void setSalaryMonth(String salaryMonth) {
this.salaryMonth = salaryMonth == null ? null : salaryMonth.trim();
}
/**
* 获取业务场景类型
*
* @return business_type - 业务场景类型
*/
public String getBusinessType() {
return businessType;
}
/**
* 设置业务场景类型
*
* @param businessType 业务场景类型
*/
public void setBusinessType(String businessType) {
this.businessType = businessType == null ? null : businessType.trim();
}
/**
* 获取产值
*
* @return order_total_price - 产值
*/
public BigDecimal getOrderTotalPrice() {
return orderTotalPrice;
}
/**
* 设置产值
*
* @param orderTotalPrice 产值
*/
public void setOrderTotalPrice(BigDecimal orderTotalPrice) {
this.orderTotalPrice = orderTotalPrice;
}
/**
* 获取提成
*
* @return commission_price - 提成
*/
public BigDecimal getCommissionPrice() {
return commissionPrice;
}
/**
* 设置提成
*
* @param commissionPrice 提成
*/
public void setCommissionPrice(BigDecimal commissionPrice) {
this.commissionPrice = commissionPrice;
}
/**
* 获取创建人
*
* @return created_by - 创建人
*/
public String getCreatedBy() {
return createdBy;
}
/**
* 设置创建人
*
* @param createdBy 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy == null ? null : createdBy.trim();
}
/**
* 获取创建时间
*
* @return created_date - 创建时间
*/
public Date getCreatedDate() {
return createdDate;
}
/**
* 设置创建时间
*
* @param createdDate 创建时间
*/
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
/**
* 获取修改人
*
* @return updated_by - 修改人
*/
public String getUpdatedBy() {
return updatedBy;
}
/**
* 设置修改人
*
* @param updatedBy 修改人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy == null ? null : updatedBy.trim();
}
/**
* 获取修改时间
*
* @return updated_date - 修改时间
*/
public Date getUpdatedDate() {
return updatedDate;
}
/**
* 设置修改时间
*
* @param updatedDate 修改时间
*/
public void setUpdatedDate(Date updatedDate) {
this.updatedDate = updatedDate;
}
/**
* 获取删除标识(D:已删除;N:未删除)
*
* @return deleted_flag - 删除标识(D:已删除;N:未删除)
*/
public String getDeletedFlag() {
return deletedFlag;
}
/**
* 设置删除标识(D:已删除;N:未删除)
*
* @param deletedFlag 删除标识(D:已删除;N:未删除)
*/
public void setDeletedFlag(String deletedFlag) {
this.deletedFlag = deletedFlag == null ? null : deletedFlag.trim();
}
} }
\ No newline at end of file \ No newline at end of file
...@@ -77,9 +77,9 @@ public class EffectiveReferralReview implements Serializable { ...@@ -77,9 +77,9 @@ public class EffectiveReferralReview implements Serializable {
private String remark; private String remark;
/** /**
* 状态:0-待提交,1-待复核 * 状态:0-未保存过,1-待提交(草稿),2-待复核
*/ */
@ApiModelProperty(notes = "状态:0-待提交,1-待复核") @ApiModelProperty(notes = "状态:0-未保存过,1-待提交(草稿),2-待复核")
@Column(name = "status") @Column(name = "status")
private Integer status; private Integer status;
......
package cn.com.glsx.dj.staff.remote.salary;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import cn.com.glsx.dj.staff.dto.salary.StaffMonthSalarySlipDTO;
import cn.com.glsx.dj.staff.model.StaffMonthSalarySlip;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiParams;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
@ApiService(value = "员工工资接口", owner = "zhoulm", protocol = ApiService.ProtocolEnum.dubbo, version = "1.0.0")
public interface StaffMonthSalarySlipRemote {
@ApiMethod("分页查询员工月度工资")
@ApiParam(name = "pagination", notes = "分页查询条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("分页查询结果")
RpcResponse<RpcPagination<StaffMonthSalarySlipDTO>> pageStaffMonthSalary(@NotNull RpcPagination<StaffMonthSalarySlipDTO> pagination);
@ApiMethod("统计员工月度工资")
@ApiParam(name = "dto", notes = "查询条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("统计结果")
RpcResponse<StaffMonthSalarySlipDTO> statStaffMonthSalary(@NotNull StaffMonthSalarySlipDTO dto);
@ApiMethod("查询员工月度工资")
@ApiParams({
@ApiParam(name = "staffPhone", notes = "手机号", dataType = ApiParam.DataTypeEnum.STRING, required = true),
@ApiParam(name = "salaryMonth", notes = "工资月份", dataType = ApiParam.DataTypeEnum.STRING, required = true)
})
@ApiResponse("员工月度工资")
RpcResponse<StaffMonthSalarySlip> getStaffSalary(@NotBlank String staffPhone,@NotBlank String salaryMonth);
}
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<dependency> <dependency>
<groupId>cn.com.glsx.dj</groupId> <groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-smartcarlife-api</artifactId> <artifactId>rpc-dj-smartcarlife-api</artifactId>
<version>5.3.0-SNAPSHOT</version> <version>5.6.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>cn.com.glsx.entmicro</groupId> <groupId>cn.com.glsx.entmicro</groupId>
......
package cn.com.glsx.dj.staff.config.dubbo; package cn.com.glsx.dj.staff.config.dubbo;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import cn.com.glsx.dj.smartcarlife.remote.GoodsOrderRemote;
import cn.com.glsx.dj.smartcarlife.remote.MerchantDailyReportHuaweiRemote; import cn.com.glsx.dj.smartcarlife.remote.MerchantDailyReportHuaweiRemote;
import cn.com.glsx.dj.smartcarlife.remote.StaffBaseInfoRemote;
import cn.com.glsx.dj.smartcarlife.remote.StaffBehaviorDeductMoneyRecordRemote;
import cn.com.glsx.dj.smartcarlife.remote.StaffInfoRemote; import cn.com.glsx.dj.smartcarlife.remote.StaffInfoRemote;
import cn.com.glsx.dj.staff.config.DubboConfig; import cn.com.glsx.dj.staff.config.DubboConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration @Configuration
public class SmartCarLifeDubboConfig extends DubboConfig { public class SmartCarLifeDubboConfig extends DubboConfig {
...@@ -19,4 +23,19 @@ public class SmartCarLifeDubboConfig extends DubboConfig { ...@@ -19,4 +23,19 @@ public class SmartCarLifeDubboConfig extends DubboConfig {
return factory.builder(MerchantDailyReportHuaweiRemote.class).check(check).timeout(timeout).version("1.0.0").build(); return factory.builder(MerchantDailyReportHuaweiRemote.class).check(check).timeout(timeout).version("1.0.0").build();
} }
@Bean
public StaffBaseInfoRemote staffBaseInfoRemote() {
return factory.builder(StaffBaseInfoRemote.class).check(check).timeout(timeout).version("1.0.0").build();
}
@Bean
public GoodsOrderRemote goodsOrderRemote() {
return factory.builder(GoodsOrderRemote.class).check(check).timeout(timeout).build();
}
@Bean
public StaffBehaviorDeductMoneyRecordRemote staffBehaviorDeductMoneyRecordRemote() {
return factory.builder(StaffBehaviorDeductMoneyRecordRemote.class).check(check).timeout(timeout).version("1.0.0").build();
}
} }
package cn.com.glsx.dj.staff.constant;
import java.math.BigDecimal;
public class CommonConstants {
public static final String DEFAULT_UPDATE_BY = "system";
public static final BigDecimal ONEHUNDRED_BIGDECIMAL = BigDecimal.valueOf(100);
}
package cn.com.glsx.dj.staff.job;
import cn.com.glsx.dj.staff.service.perfSalary.PerfRuleRemoteService;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import lombok.extern.slf4j.Slf4j;
import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf;
import javax.annotation.Resource;
@Slf4j
@ElasticJobConf(name = "PerfRuleSettingJob", cron = "0 0 1 1 * ? ", description = "绩效配置设置", overwrite = false)
public class PerfRuleSettingJob implements SimpleJob {
@Resource
private PerfRuleRemoteService perfRuleRemoteService;
@Override
public void execute(ShardingContext shardingContext) {
log.info("----------------绩效配置设置开始-----------------");
try {
perfRuleRemoteService.perfRuleSettingJob();
} catch (Exception e) {
log.error(e.getMessage(), e);
}
log.info("----------------绩效配置设置结束-----------------");
}
}
...@@ -8,7 +8,7 @@ import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf; ...@@ -8,7 +8,7 @@ import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@Slf4j @Slf4j
@ElasticJobConf(name = "SyncQwClockInDetailDataJob", cron = "0 0 4 1 * ? ", description = "定时打卡详情同步任务-每月1号4点执行", overwrite = false) @ElasticJobConf(name = "SyncQwClockInDetailDataJob", cron = "0 0 4 1 * ? ", description = "定时打卡详情同步任务-每月1号4点执行-可配参数格式(yyyy-MM)", overwrite = false)
public class SyncQwClockInDetailDataJob implements SimpleJob { public class SyncQwClockInDetailDataJob implements SimpleJob {
@Autowired @Autowired
...@@ -19,7 +19,9 @@ public class SyncQwClockInDetailDataJob implements SimpleJob { ...@@ -19,7 +19,9 @@ public class SyncQwClockInDetailDataJob implements SimpleJob {
log.info("----------------定时打卡详情同步任务开始-----------------"); log.info("----------------定时打卡详情同步任务开始-----------------");
long l = System.currentTimeMillis(); long l = System.currentTimeMillis();
try { try {
clockInCompleteAnalysisStaffService.syncQwClockInDetailData(); String shardingParameter = shardingContext.getShardingParameter();
log.info("参数:{}", shardingParameter);
clockInCompleteAnalysisStaffService.syncQwClockInDetailData(shardingParameter);
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
} }
......
package cn.com.glsx.dj.staff.mapper; package cn.com.glsx.dj.staff.mapper;
import cn.com.glsx.dj.staff.model.StaffMonthBusinessData; import cn.com.glsx.dj.staff.model.StaffMonthBusinessData;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
@Mapper
public interface StaffMonthBusinessDataMapper extends OreMapper<StaffMonthBusinessData> { public interface StaffMonthBusinessDataMapper extends OreMapper<StaffMonthBusinessData> {
} }
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.staff.mapper; package cn.com.glsx.dj.staff.mapper;
import cn.com.glsx.dj.staff.model.StaffMonthSalarySlip; import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper; import org.oreframework.datasource.mybatis.mapper.OreMapper;
import cn.com.glsx.dj.staff.dto.salary.StaffMonthSalarySlipDTO;
import cn.com.glsx.dj.staff.model.StaffMonthSalarySlip;
@Mapper
public interface StaffMonthSalarySlipMapper extends OreMapper<StaffMonthSalarySlip> { public interface StaffMonthSalarySlipMapper extends OreMapper<StaffMonthSalarySlip> {
List<StaffMonthSalarySlipDTO> list(StaffMonthSalarySlipDTO condition);
StaffMonthSalarySlipDTO statStaffMonthSalary(StaffMonthSalarySlipDTO dto);
} }
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.staff.mapper.perfSalary; package cn.com.glsx.dj.staff.mapper.perfSalary;
import cn.com.glsx.dj.staff.dto.perfSalary.AttendanceInfoDTO;
import cn.com.glsx.dj.staff.dto.perfSalary.AttendanceReqDTO;
import cn.com.glsx.dj.staff.model.perfSalary.AttendanceSummary; import cn.com.glsx.dj.staff.model.perfSalary.AttendanceSummary;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper; import org.oreframework.datasource.mybatis.mapper.OreMapper;
...@@ -12,4 +14,6 @@ public interface AttendanceSummaryMapper extends OreMapper<AttendanceSummary> { ...@@ -12,4 +14,6 @@ public interface AttendanceSummaryMapper extends OreMapper<AttendanceSummary> {
void insertOrUpdate(AttendanceSummary summary); void insertOrUpdate(AttendanceSummary summary);
void insertOrUpdateBatch(List<AttendanceSummary> summaries); void insertOrUpdateBatch(List<AttendanceSummary> summaries);
List<AttendanceInfoDTO> attendanceList(AttendanceReqDTO attendanceReqDTO);
} }
\ No newline at end of file \ No newline at end of file
...@@ -18,4 +18,8 @@ public interface AutoPerformRuleMapper extends OreMapper<AutoPerformRule> { ...@@ -18,4 +18,8 @@ public interface AutoPerformRuleMapper extends OreMapper<AutoPerformRule> {
void deleteLatestRuleConfig(); void deleteLatestRuleConfig();
void deleteEffectiveRuleConfig();
void updatePendingRuleConfig(@Param("id") Integer id);
} }
\ No newline at end of file \ No newline at end of file
...@@ -4,22 +4,33 @@ import cn.com.glsx.dj.staff.dto.perfSalary.AttendanceDailyDetailDTO; ...@@ -4,22 +4,33 @@ import cn.com.glsx.dj.staff.dto.perfSalary.AttendanceDailyDetailDTO;
import cn.com.glsx.dj.staff.dto.perfSalary.AttendanceInfoDTO; import cn.com.glsx.dj.staff.dto.perfSalary.AttendanceInfoDTO;
import cn.com.glsx.dj.staff.dto.perfSalary.AttendanceReqDTO; import cn.com.glsx.dj.staff.dto.perfSalary.AttendanceReqDTO;
import cn.com.glsx.dj.staff.dto.perfSalary.AttendanceStaffSummaryDTO; import cn.com.glsx.dj.staff.dto.perfSalary.AttendanceStaffSummaryDTO;
import cn.com.glsx.dj.staff.service.perfSalary.AttendanceSummaryService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse; import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService; import org.apache.dubbo.config.annotation.DubboService;
import javax.annotation.Resource;
import java.util.List; import java.util.List;
@Slf4j @Slf4j
@DubboService(version = "1.0.0", validation = "true") @DubboService(version = "1.0.0", validation = "true")
public class AttendanceRemoteImpl implements AttendanceRemote { public class AttendanceRemoteImpl implements AttendanceRemote {
@Resource
private AttendanceSummaryService attendanceSummaryService;
/** /**
* 考勤列表 * 考勤列表
*/ */
@Override @Override
public RpcResponse<List<AttendanceInfoDTO>> attendanceList(AttendanceReqDTO attendanceReqDTO) { public RpcResponse<List<AttendanceInfoDTO>> attendanceList(AttendanceReqDTO attendanceReqDTO) {
return null; try {
return RpcResponse.success(attendanceSummaryService.attendanceList(attendanceReqDTO));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
} }
/** /**
......
...@@ -126,7 +126,7 @@ public class PerfRuleRemoteImpl implements PerfRuleRemote { ...@@ -126,7 +126,7 @@ public class PerfRuleRemoteImpl implements PerfRuleRemote {
*/ */
@Override @Override
public RpcResponse<Boolean> clockInCompleteAnalysisStaff() { public RpcResponse<Boolean> clockInCompleteAnalysisStaff() {
clockInCompleteAnalysisStaffService.syncQwClockInDetailData(); clockInCompleteAnalysisStaffService.syncQwClockInDetailData("");
return RpcResponse.success(true); return RpcResponse.success(true);
} }
......
package cn.com.glsx.dj.staff.remote.salary;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.staff.dto.salary.StaffMonthSalarySlipDTO;
import cn.com.glsx.dj.staff.model.StaffMonthSalarySlip;
import cn.com.glsx.dj.staff.service.salary.StaffMonthSalarySlipService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@DubboService(version = "1.0.0", validation = "true")
public class StaffMonthSalarySlipRemoteImpl implements StaffMonthSalarySlipRemote {
@Autowired
private StaffMonthSalarySlipService staffMonthSalarySlipService;
@Override
public RpcResponse<RpcPagination<StaffMonthSalarySlipDTO>> pageStaffMonthSalary(
@NotNull RpcPagination<StaffMonthSalarySlipDTO> pagination) {
try{
pagination = RpcPagination.copyPage(staffMonthSalarySlipService.pageStaffMonthSalary(pagination));
return RpcResponse.success(pagination);
}catch(Exception e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<StaffMonthSalarySlipDTO> statStaffMonthSalary(@NotNull StaffMonthSalarySlipDTO dto) {
try{
return RpcResponse.success(staffMonthSalarySlipService.statStaffMonthSalary(dto));
}catch(Exception e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<StaffMonthSalarySlip> getStaffSalary(@NotBlank String staffPhone, @NotBlank String salaryMonth) {
try{
return RpcResponse.success(staffMonthSalarySlipService.get(staffPhone,salaryMonth));
}catch(Exception e){
log.error(e.getMessage(),e);
return RpcResponse.error(e);
}
}
}
package cn.com.glsx.dj.staff.service.perfSalary; package cn.com.glsx.dj.staff.service.perfSalary;
import cn.com.glsx.dj.staff.dto.perfSalary.AttendanceInfoDTO;
import cn.com.glsx.dj.staff.dto.perfSalary.AttendanceReqDTO;
import cn.com.glsx.dj.staff.mapper.perfSalary.AttendanceSummaryMapper; import cn.com.glsx.dj.staff.mapper.perfSalary.AttendanceSummaryMapper;
import cn.com.glsx.framework.core.exception.RpcServiceException; import cn.com.glsx.framework.core.exception.RpcServiceException;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -8,6 +10,7 @@ import org.springframework.transaction.annotation.Propagation; ...@@ -8,6 +10,7 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
@Slf4j @Slf4j
...@@ -23,4 +26,10 @@ public class AttendanceSummaryService { ...@@ -23,4 +26,10 @@ public class AttendanceSummaryService {
} }
/**
* 考勤列表
*/
public List<AttendanceInfoDTO> attendanceList(AttendanceReqDTO attendanceReqDTO) {
return attendanceSummaryMapper.attendanceList(attendanceReqDTO);
}
} }
\ No newline at end of file \ No newline at end of file
...@@ -13,6 +13,7 @@ import cn.hutool.core.date.DatePattern; ...@@ -13,6 +13,7 @@ import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
...@@ -37,11 +38,16 @@ public class ClockInCompleteAnalysisStaffService { ...@@ -37,11 +38,16 @@ public class ClockInCompleteAnalysisStaffService {
@Resource @Resource
private StaffQwClockCleanMapper staffQwClockCleanMapper; private StaffQwClockCleanMapper staffQwClockCleanMapper;
public void syncQwClockInDetailData() { public void syncQwClockInDetailData(String clockInDateStr) {
Integer merchantId = OrePropertyConfigurer.getProperty("syncQwClockInData.build.merchantId", Integer.class, 44202977); Integer merchantId = OrePropertyConfigurer.getProperty("syncQwClockInData.build.merchantId", Integer.class, 44202977);
// 查询企微打卡表指定日期所有人员 // 查询企微打卡表指定日期所有人员
DateTime lastMonthDate = DateUtil.offsetMonth(new Date(), -1); DateTime lastMonthDate = DateUtil.offsetMonth(new Date(), -1);
String clockInDate = DateUtil.format(lastMonthDate, DatePattern.NORM_MONTH_PATTERN); String clockInDate;
if (StrUtil.isNotBlank(clockInDateStr)) {
clockInDate = clockInDateStr;
} else {
clockInDate = DateUtil.format(lastMonthDate, DatePattern.NORM_MONTH_PATTERN);
}
List<StaffQwClockInInfo> staffQwClockInInfos = staffQwClockInInfoMapper.selectByDate(clockInDate); List<StaffQwClockInInfo> staffQwClockInInfos = staffQwClockInInfoMapper.selectByDate(clockInDate);
// 判断是否有数据 // 判断是否有数据
if (ObjectUtil.isEmpty(staffQwClockInInfos)) { if (ObjectUtil.isEmpty(staffQwClockInInfos)) {
......
...@@ -11,14 +11,18 @@ import cn.com.glsx.dj.staff.model.perfSalary.PerformanceLevel; ...@@ -11,14 +11,18 @@ import cn.com.glsx.dj.staff.model.perfSalary.PerformanceLevel;
import cn.com.glsx.dj.staff.model.perfSalary.PerformanceMonthly; import cn.com.glsx.dj.staff.model.perfSalary.PerformanceMonthly;
import cn.com.glsx.framework.core.exception.RpcServiceException; import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.oreframework.boot.env.OrePropertyConfigurer; import org.oreframework.boot.env.OrePropertyConfigurer;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Date; import java.util.Date;
...@@ -73,10 +77,10 @@ public class PerfRuleRemoteService { ...@@ -73,10 +77,10 @@ public class PerfRuleRemoteService {
// log.info("perfRuleConfigUpdate:{}", JSONUtil.toJsonPrettyStr(perfRuleConfigUpdateDTO)); // log.info("perfRuleConfigUpdate:{}", JSONUtil.toJsonPrettyStr(perfRuleConfigUpdateDTO));
AutoPerformRuleUpdateDTO autoPerformRuleUpdateDTO = perfRuleConfigUpdateDTO.getAutoPerformRuleUpdateDTO(); AutoPerformRuleUpdateDTO autoPerformRuleUpdateDTO = perfRuleConfigUpdateDTO.getAutoPerformRuleUpdateDTO();
List<PerformanceLevelUpdateDTO> performanceLevelUpdateDTOS = perfRuleConfigUpdateDTO.getPerformanceLevelUpdateDTOS(); List<PerformanceLevelUpdateDTO> performanceLevelUpdateDTOS = perfRuleConfigUpdateDTO.getPerformanceLevelUpdateDTOS();
// hutool判断生效月份是未来月份 如果不是则抛异常 // hutool判断生效月份是当月或未来月份 如果不是则抛异常
Date effectiveMonth = autoPerformRuleUpdateDTO.getEffectiveMonth(); Date effectiveMonth = autoPerformRuleUpdateDTO.getEffectiveMonth();
if (!isFutureMonth(DateUtil.formatDate(effectiveMonth))) { if (!isCurrentAndFutureMonth(DateUtil.formatDate(effectiveMonth))) {
throw new RpcServiceException("生效时间应大于当前月"); throw new RpcServiceException("生效时间应大于等于当前月");
} }
// 删除最新的配置 // 删除最新的配置
autoPerformRuleMapper.deleteLatestRuleConfig(); autoPerformRuleMapper.deleteLatestRuleConfig();
...@@ -147,12 +151,46 @@ public class PerfRuleRemoteService { ...@@ -147,12 +151,46 @@ public class PerfRuleRemoteService {
} }
/** /**
* 判断指定日期时间字符串是否属于未来月份 * 定时任务-绩效配置设置
*/
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = RpcServiceException.class)
public void perfRuleSettingJob() {
// 查询是否存在 待生效且生效时间等于上个月的配置
// 上个月
DateTime lastMonthDate = DateUtil.offsetMonth(new Date(), -1);
String lastMonth = DateUtil.format(lastMonthDate, DatePattern.NORM_MONTH_PATTERN);
String queryLastMonthPendingCondition = "(DATE_FORMAT(effective_month, '%Y-%m') = '{}')";
queryLastMonthPendingCondition = StrUtil.format(queryLastMonthPendingCondition, lastMonth);
Example queryLastMonthPendingExample = new Example(AutoPerformRule.class);
queryLastMonthPendingExample.createCriteria().andEqualTo("effectiveStatus", EffectiveStatusEnum.PENDING_EFFECTIVE.getCode())
.andCondition(queryLastMonthPendingCondition)
.andEqualTo("effectiveStartDate", lastMonth);
AutoPerformRule lastMonthPendingAutoPerformRule = autoPerformRuleMapper.selectOneByExample(queryLastMonthPendingExample);
if (ObjectUtil.isEmpty(lastMonthPendingAutoPerformRule)) {
// 使用生效中的配置
Example queryEffectiveExample = new Example(AutoPerformRule.class);
queryEffectiveExample.createCriteria().andEqualTo("effectiveStatus", EffectiveStatusEnum.EFFECTIVE.getCode())
.andEqualTo("deletedFlag", 'N');
AutoPerformRule effectiveAutoPerformRule = autoPerformRuleMapper.selectOneByExample(queryEffectiveExample);
if (ObjectUtil.isEmpty(effectiveAutoPerformRule)) {
log.error("未找到有效的绩效配置");
return;
}
}
// 存在待生效的
// 将生效中的配置逻辑删除
autoPerformRuleMapper.deleteEffectiveRuleConfig();
// 将lastMonthPendingAutoPerformRule设置为生效中
autoPerformRuleMapper.updatePendingRuleConfig(lastMonthPendingAutoPerformRule.getId());
}
/**
* 判断指定日期时间字符串是否属于当前或未来月份
* *
* @param dateTimeStr 日期时间字符串 (格式: yyyy-MM-dd hh:mm:ss) * @param dateTimeStr 日期时间字符串 (格式: yyyy-MM-dd hh:mm:ss)
* @return true 表示是未来月份,false 表示不是 * @return true 表示是当前或未来月份,false 表示不是
*/ */
public static boolean isFutureMonth(String dateTimeStr) { public static boolean isCurrentAndFutureMonth(String dateTimeStr) {
// 1. 解析传入的日期字符串 // 1. 解析传入的日期字符串
Date targetDate = DateUtil.parse(dateTimeStr); Date targetDate = DateUtil.parse(dateTimeStr);
...@@ -165,16 +203,15 @@ public class PerfRuleRemoteService { ...@@ -165,16 +203,15 @@ public class PerfRuleRemoteService {
int currentYear = DateUtil.year(now); int currentYear = DateUtil.year(now);
int currentMonth = DateUtil.month(now) + 1; int currentMonth = DateUtil.month(now) + 1;
// 4. 比较逻辑 // 4. 比较逻辑(关键修改:当前月份也返回 true)
// 同年同月或更早
if (targetYear > currentYear) { if (targetYear > currentYear) {
return true; // 目标年份更晚 return true; // 目标年份更晚
} else return targetYear == currentYear && targetMonth > currentMonth; // 同年但目标月份更晚 } else {
// 修正:目标月份 >= 当前月份(包含当前月份)
return targetYear == currentYear && targetMonth >= currentMonth;
}
} }
} }
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.staff.service.salary;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import org.oreframework.boot.env.OrePropertyConfigurer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import cn.com.glsx.dj.smartcarlife.dto.GoodsOrderDTO;
import cn.com.glsx.dj.smartcarlife.dto.OrderCountDTO;
import cn.com.glsx.dj.smartcarlife.enums.BusinessTypeEnum;
import cn.com.glsx.dj.smartcarlife.enums.CarLifeEnum.OrderStatus;
import cn.com.glsx.dj.smartcarlife.enums.OrderBusinessTypeEnum;
import cn.com.glsx.dj.smartcarlife.enums.SceneTypeEnum;
import cn.com.glsx.dj.smartcarlife.remote.GoodsOrderRemote;
import cn.com.glsx.dj.smartcarlife.util.DateUtils;
import cn.com.glsx.dj.staff.constant.CommonConstants;
import cn.com.glsx.dj.staff.mapper.StaffMonthBusinessDataMapper;
import cn.com.glsx.dj.staff.model.StaffMonthBusinessData;
import cn.com.glsx.dj.staff.util.CommonUtil;
import cn.com.glsx.framework.core.beans.BaseModel;
import cn.com.glsx.framework.core.beans.BaseModel.DeletedFlagEnum;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert;
import lombok.extern.slf4j.Slf4j;
import tk.mybatis.mapper.entity.Example;
@Slf4j
@Service
@Transactional(propagation = Propagation.SUPPORTS, rollbackFor = RpcServiceException.class)
public class StaffMonthBusinessDataService {
@Lazy
@Autowired
private StaffMonthBusinessDataService thiz;
@Autowired
private StaffMonthBusinessDataMapper staffMonthBusinessDataMapper;
@Autowired
private GoodsOrderRemote goodsOrderRemote;
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = RpcServiceException.class)
public List<StaffMonthBusinessData> updateStaffMonthBusinessData(String staffPhone, String salaryMonth) {
RpcAssert.assertNotEmpty(staffPhone, DefaultErrorEnum.DATA_NULL, "staffPhone not be null");
RpcAssert.assertNotEmpty(salaryMonth, DefaultErrorEnum.DATA_NULL, "salaryMonth not be null");
try {
StaffMonthBusinessData staffMonthBusinessData = new StaffMonthBusinessData();
staffMonthBusinessData.setDeletedFlag(BaseModel.DeletedFlagEnum.D.name());
staffMonthBusinessData.setUpdatedDate(new Date());
Example example = new Example(StaffMonthBusinessData.class);
example.createCriteria().andEqualTo("staffPhone", staffPhone)
.andEqualTo("salaryMonth", salaryMonth)
.andEqualTo("deletedFlag", BaseModel.DeletedFlagEnum.N.name());
staffMonthBusinessDataMapper.updateByExampleSelective(staffMonthBusinessData, example);
List<StaffMonthBusinessData> list = new ArrayList<>();
list.add(thiz.init(staffPhone, salaryMonth, OrderBusinessTypeEnum.LIGHTLY_MODIFY));
list.add(thiz.init(staffPhone, salaryMonth, OrderBusinessTypeEnum.EQUITY));
list.add(thiz.init(staffPhone, salaryMonth, OrderBusinessTypeEnum.EXTENDED_WARRANTY));
staffMonthBusinessDataMapper.insertList(list);
return list;
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
public StaffMonthBusinessData init(String staffPhone, String salaryMonth,OrderBusinessTypeEnum businessType) {
RpcAssert.assertNotEmpty(staffPhone, DefaultErrorEnum.DATA_NULL, "staffPhone not be null");
RpcAssert.assertNotEmpty(salaryMonth, DefaultErrorEnum.DATA_NULL, "salaryMonth not be null");
RpcAssert.assertNotNull(businessType, DefaultErrorEnum.DATA_NULL, "businessType not be null");
try {
String monthFirstAndLastDayTime = DateUtils.getMonthFirstAndLastDayTime(salaryMonth);
String startDate = monthFirstAndLastDayTime.split(",")[0];
String endDate = monthFirstAndLastDayTime.split(",")[1];
GoodsOrderDTO condition = GoodsOrderDTO.builder()
.paySuccessStartDate(startDate).paySuccessEndDate(endDate)
.notAllRefund(true).sellerPhone(staffPhone)
.statusList(Arrays.asList(OrderStatus.PAYED.getValue(), OrderStatus.FINISHED.getValue(),
OrderStatus.REFUNDED.getValue()))
.build();
final Date now = new Date();
StaffMonthBusinessData data = StaffMonthBusinessData.builder()
.staffPhone(staffPhone).salaryMonth(salaryMonth)
.businessType(businessType.getValue())
.orderTotalPrice(BigDecimal.ZERO)
.commissionPrice(BigDecimal.ZERO)
.createdBy(CommonConstants.DEFAULT_UPDATE_BY).createdDate(now)
.updatedBy(CommonConstants.DEFAULT_UPDATE_BY).updatedDate(now)
.deletedFlag(DeletedFlagEnum.N.name())
.build();
OrderCountDTO orderCount = null;
switch (businessType) {
case EQUITY:
condition.setSceneType(SceneTypeEnum.SCENE1_0.getValue());
//权益服务
condition.setUpgradeGoodsTypeList(CommonUtil.convert2Integer(OrePropertyConfigurer.getString("smartcarlife.goodsType.equity", "126").split(",")));
orderCount = goodsOrderRemote.countSubOrderTotal(condition).getResult();
break;
case EXTENDED_WARRANTY:
condition.setSceneType(SceneTypeEnum.SCENE1_0.getValue());
//延保类
condition.setUpgradeGoodsTypeList(CommonUtil.convert2Integer(OrePropertyConfigurer.getString("smartcarlife.goodsType.extendedInsurance", "155").split(",")));
orderCount = goodsOrderRemote.countSubOrderTotal(condition).getResult();
break;
case LIGHTLY_MODIFY:
condition.setSceneType(SceneTypeEnum.SCENE1_1.getValue());
orderCount = goodsOrderRemote.countOrderTotal(condition).getResult();
break;
default:
throw new RpcServiceException(DefaultErrorEnum.SERVER_ERROR,"业务类型错误");
}
if(orderCount != null && orderCount.getTotalOutputPrice() != null) {
data.setOrderTotalPrice(orderCount.getTotalOutputPrice());
}
//TODO //填充提成
return data;
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
}
...@@ -4,6 +4,7 @@ package cn.com.glsx.dj.staff.util; ...@@ -4,6 +4,7 @@ package cn.com.glsx.dj.staff.util;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
import java.util.List; import java.util.List;
@Slf4j @Slf4j
...@@ -15,5 +16,18 @@ public class CommonUtil { ...@@ -15,5 +16,18 @@ public class CommonUtil {
} }
return null; return null;
} }
public static List<Integer> convert2Integer(String[] strArr) {
if(strArr == null || strArr.length == 0) {
return null;
}
List<Integer> list = new ArrayList<>();
for(String s:strArr) {
try {
list.add(Integer.valueOf(s));
}catch(Exception e) {
}
}
return list.isEmpty() ? null:list;
}
} }
...@@ -83,4 +83,28 @@ ...@@ -83,4 +83,28 @@
missing_punch_count = VALUES(missing_punch_count), missing_punch_count = VALUES(missing_punch_count),
superior_leader_mobile_phone = VALUES(superior_leader_mobile_phone) superior_leader_mobile_phone = VALUES(superior_leader_mobile_phone)
</insert> </insert>
<select id="attendanceList" resultType="cn.com.glsx.dj.staff.dto.perfSalary.AttendanceInfoDTO">
SELECT
id AS id,
mobile_phone AS mobilePhone,
name AS name,
attendance_month AS attendanceMonth,
expected_attendance_days AS expectedAttendanceDays,
actual_attendance_days AS actualAttendanceDays,
appeal_attendance_days AS appealAttendanceDays,
COALESCE(appeal_attendance_days, actual_attendance_days) AS attendanceDays,
superior_leader_mobile_phone AS superiorLeaderMobilePhone
FROM sal_attendance_summary
WHERE
superior_leader_mobile_phone = #{regionManagerMobilePhone}
<if test="attendanceMonth != null and attendanceMonth != ''">
AND DATE_FORMAT(attendance_month, '%Y-%m') = #{attendanceMonth}
</if>
<if test="name != null and name != ''">
AND name LIKE CONCAT('%', #{name}, '%')
</if>
ORDER BY IF(name REGEXP '^[A-Za-z]', CONVERT(name USING gbk), CONVERT(CONVERT(name USING gbk) USING utf8mb4)),
name
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
LIMIT 1 LIMIT 1
</select> </select>
<!-- 2. 查询绩效等级配置(关联表) -->
<select id="getPerformanceLevels" resultType="cn.com.glsx.dj.staff.dto.perfSalary.PerformanceLevelDetailDTO"> <select id="getPerformanceLevels" resultType="cn.com.glsx.dj.staff.dto.perfSalary.PerformanceLevelDetailDTO">
SELECT SELECT
level_code AS levelCode, level_code AS levelCode,
...@@ -40,16 +39,27 @@ ...@@ -40,16 +39,27 @@
score_symbol_value AS scoreSymbolValue, score_symbol_value AS scoreSymbolValue,
reward_coefficient AS rewardCoefficient reward_coefficient AS rewardCoefficient
FROM sal_performance_level FROM sal_performance_level
WHERE uuid = #{uuid} <!-- 通过外部参数传入 --> WHERE uuid = #{uuid}
</select> </select>
<update id="deleteLatestRuleConfig"> <update id="deleteLatestRuleConfig">
UPDATE sal_auto_perform_rule UPDATE sal_auto_perform_rule
SET deleted_flag = 'D' SET deleted_flag = 'D'
WHERE effective_month > Date(now())
ORDER BY created_date DESC ORDER BY created_date DESC
LIMIT 1 LIMIT 1
</update> </update>
<update id="deleteEffectiveRuleConfig">
UPDATE sal_auto_perform_rule
SET deleted_flag = 'D'
WHERE effective_status = 1;
</update>
<update id="updatePendingRuleConfig">
UPDATE sal_auto_perform_rule
SET effective_status = 2
WHERE id = #{id};
</update>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<id column="id" property="id" jdbcType="INTEGER" /> <id column="id" property="id" jdbcType="INTEGER" />
<result column="staff_phone" property="staffPhone" jdbcType="VARCHAR" /> <result column="staff_phone" property="staffPhone" jdbcType="VARCHAR" />
<result column="salary_month" property="salaryMonth" jdbcType="CHAR" /> <result column="salary_month" property="salaryMonth" jdbcType="CHAR" />
<result column="business_type" property="businessType" jdbcType="VARCHAR" /> <result column="business_type" property="businessType" />
<result column="order_total_price" property="orderTotalPrice" jdbcType="DECIMAL" /> <result column="order_total_price" property="orderTotalPrice" jdbcType="DECIMAL" />
<result column="commission_price" property="commissionPrice" jdbcType="DECIMAL" /> <result column="commission_price" property="commissionPrice" jdbcType="DECIMAL" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" /> <result column="created_by" property="createdBy" jdbcType="VARCHAR" />
......
...@@ -20,16 +20,19 @@ ...@@ -20,16 +20,19 @@
<result column="basic_salary" property="basicSalary" jdbcType="DECIMAL" /> <result column="basic_salary" property="basicSalary" jdbcType="DECIMAL" />
<result column="order_total_price" property="orderTotalPrice" jdbcType="DECIMAL" /> <result column="order_total_price" property="orderTotalPrice" jdbcType="DECIMAL" />
<result column="commission_price" property="commissionPrice" jdbcType="DECIMAL" /> <result column="commission_price" property="commissionPrice" jdbcType="DECIMAL" />
<result column="daily_deduct_count" property="dailyDeductCount"/>
<result column="daily_deduct_money" property="dailyDeductMoney" jdbcType="DECIMAL" /> <result column="daily_deduct_money" property="dailyDeductMoney" jdbcType="DECIMAL" />
<result column="pad_deduct_count" property="padDeductCount"/>
<result column="pad_deduct_money" property="padDeductMoney" jdbcType="DECIMAL" /> <result column="pad_deduct_money" property="padDeductMoney" jdbcType="DECIMAL" />
<result column="defer_expenses" property="deferExpenses" jdbcType="DECIMAL" /> <result column="defer_expenses" property="deferExpenses" jdbcType="DECIMAL" />
<result column="defer_income" property="deferIncome" jdbcType="DECIMAL" /> <result column="defer_income" property="deferIncome" jdbcType="DECIMAL" />
<result column="daily_deduction" property="dailyDeduction" jdbcType="DECIMAL" /> <result column="daily_deduction" property="dailyDeduction" jdbcType="DECIMAL" />
<result column="pad_deduction" property="padDeduction" jdbcType="DECIMAL" /> <result column="pad_deduction" property="padDeduction" jdbcType="DECIMAL" />
<result column="deferred_ratio" property="deferredRatio" jdbcType="DECIMAL" /> <result column="deferred_ratio" property="deferredRatio" jdbcType="DECIMAL" />
<result column="refund_offset" property="refundOffset" jdbcType="DECIMAL" />
<result column="other_deduction" property="otherDeduction" jdbcType="DECIMAL" /> <result column="other_deduction" property="otherDeduction" jdbcType="DECIMAL" />
<result column="other_deduction_detail" property="otherDeductionDetail"/>
<result column="other_rewards" property="otherRewards" jdbcType="DECIMAL" /> <result column="other_rewards" property="otherRewards" jdbcType="DECIMAL" />
<result column="other_rewards_detail" property="otherRewardsDetail"/>
<result column="salary" property="salary" jdbcType="DECIMAL" /> <result column="salary" property="salary" jdbcType="DECIMAL" />
<result column="correct_salary" property="correctSalary" jdbcType="DECIMAL" /> <result column="correct_salary" property="correctSalary" jdbcType="DECIMAL" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" /> <result column="created_by" property="createdBy" jdbcType="VARCHAR" />
...@@ -38,15 +41,61 @@ ...@@ -38,15 +41,61 @@
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" /> <result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" /> <result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap> </resultMap>
<resultMap id="DTOResultMap" type="cn.com.glsx.dj.staff.dto.salary.StaffMonthSalarySlipDTO" extends="BaseResultMap">
<result column="totalActualSalary" property="totalActualSalary"/>
</resultMap>
<sql id="Base_Column_List" > <sql id="Base_Column_List" >
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
--> -->
id, staff_name, staff_phone, business_types, salary_month, final_data_flag, should_work_day, id, staff_name, staff_phone, business_types, salary_month, final_data_flag, should_work_day,
actual_work_day, salary_standard, minimum_salary, performance_level, performance_salary, actual_work_day, salary_standard, minimum_salary, performance_level, performance_salary,
basic_salary, order_total_price, commission_price, daily_deduct_money, pad_deduct_money, basic_salary, order_total_price, commission_price,daily_deduct_count, daily_deduct_money,pad_deduct_count, pad_deduct_money,
defer_expenses, defer_income, daily_deduction, pad_deduction, deferred_ratio, refund_offset, defer_expenses, defer_income, daily_deduction, pad_deduction, deferred_ratio,
other_deduction, other_rewards, salary, correct_salary, created_by, created_date, other_deduction,other_deduction_detail, other_rewards,other_rewards_detail, salary, correct_salary, created_by, created_date,
updated_by, updated_date, deleted_flag updated_by, updated_date, deleted_flag
</sql> </sql>
<select id="list" parameterType="cn.com.glsx.dj.staff.dto.salary.StaffMonthSalarySlipDTO" resultMap="DTOResultMap">
select <include refid="Base_Column_List"/>
from dj_car_life_staff_month_salary_slip
<include refid="list_condition"/>
order by salary_month desc
</select>
<select id="statStaffMonthSalary" resultMap="DTOResultMap">
select ifnull(sum(ifnull(correct_salary, salary)), 0) totalActualSalary
from dj_car_life_staff_month_salary_slip
<include refid="list_condition"/>
</select>
<sql id="list_condition">
<where>
deleted_flag = 'N'
<if test="staffPhone != null and staffPhone != ''">
and staff_phone = #{staffPhone}
</if>
<if test="staffPhones != null and staffPhones.size()>0">
and staff_phone in
<foreach collection="staffPhones" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="salaryMonthList != null and salaryMonthList.size()>0">
and salary_month in
<foreach collection="salaryMonthList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="salaryMonth != null and salaryMonth != ''">
and salary_month = #{salaryMonth}
</if>
<if test="salaryMonthBegin != null and salaryMonthBegin != ''">
and salary_month &gt;= #{salaryMonthBegin}
</if>
<if test="salaryMonthEnd != null and salaryMonthEnd != ''">
and salary_month &lt;= #{salaryMonthEnd}
</if>
</where>
</sql>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!