Commit 3ea990ad by 林冲

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

2 parents 164dfa31 d3afe4be
Showing 55 changed files with 225 additions and 476 deletions
...@@ -44,4 +44,8 @@ public class PerformanceConfigDTO extends PerformanceConfig { ...@@ -44,4 +44,8 @@ public class PerformanceConfigDTO extends PerformanceConfig {
*/ */
private String merchantName; private String merchantName;
private String brandName;
private String childBrandName;
} }
...@@ -6,12 +6,11 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -6,12 +6,11 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.*; import lombok.*;
import lombok.experimental.SuperBuilder; import lombok.experimental.SuperBuilder;
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder @SuperBuilder
@ToString(callSuper = true) @ToString(callSuper = true)
@Data @Data
@EqualsAndHashCode(callSuper=false)
@AllArgsConstructor
@NoArgsConstructor
public class PerformanceParamConfigConditionDTO extends PerformanceParamConfigCondition { public class PerformanceParamConfigConditionDTO extends PerformanceParamConfigCondition {
private MerchantPerformanceProductDefineDTO productDefine; private MerchantPerformanceProductDefineDTO productDefine;
@ApiModelProperty(notes = "提成方案置ID") @ApiModelProperty(notes = "提成方案置ID")
......
...@@ -64,11 +64,21 @@ public class StaffPerformanceCalContextDTO implements Serializable { ...@@ -64,11 +64,21 @@ public class StaffPerformanceCalContextDTO implements Serializable {
private Integer brandId; private Integer brandId;
/** /**
* 品牌名称
*/
private String brandName;
/**
* 子品牌ID * 子品牌ID
*/ */
private Integer childBrandId; private Integer childBrandId;
/** /**
* 子品牌名称
*/
private String childBrandName;
/**
* 当前计算的门店提成方案 * 当前计算的门店提成方案
*/ */
private PerformanceConfigDTO performanceConfig; private PerformanceConfigDTO performanceConfig;
......
...@@ -2,9 +2,9 @@ package cn.com.glsx.dj.staff.dto; ...@@ -2,9 +2,9 @@ package cn.com.glsx.dj.staff.dto;
import cn.com.glsx.dj.staff.model.StaffPerformanceDetail; import cn.com.glsx.dj.staff.model.StaffPerformanceDetail;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.SuperBuilder; import lombok.experimental.SuperBuilder;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -12,13 +12,16 @@ import java.math.BigDecimal; ...@@ -12,13 +12,16 @@ import java.math.BigDecimal;
/** /**
* 提成结果明细DTO * 提成结果明细DTO
*/ */
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder @SuperBuilder
@ToString(callSuper = true)
@Data @Data
@EqualsAndHashCode(callSuper=false)
public class StaffPerformanceDetailDTO extends StaffPerformanceDetail { public class StaffPerformanceDetailDTO extends StaffPerformanceDetail {
private static final long serialVersionUID = 833236627080089143L; private static final long serialVersionUID = 833236627080089143L;
@ApiModelProperty(notes = "额外提成金额") @ApiModelProperty(notes = "额外提成金额")
private BigDecimal extraPerformanceAmount; private BigDecimal extraPerformanceAmount;
@ApiModelProperty(notes = "个人渗透率")
private BigDecimal personalPenetrationRate;
} }
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;
...@@ -8,7 +7,6 @@ import lombok.NoArgsConstructor; ...@@ -8,7 +7,6 @@ import lombok.NoArgsConstructor;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
/** /**
* 自动评绩效规则配置表 * 自动评绩效规则配置表
...@@ -122,8 +120,7 @@ public class AutoPerformRuleDetailDTO implements Serializable { ...@@ -122,8 +120,7 @@ public class AutoPerformRuleDetailDTO implements Serializable {
* 生效月份(yyyy-mm格式) * 生效月份(yyyy-mm格式)
*/ */
@ApiModelProperty(notes = "生效月份(yyyy-mm格式)") @ApiModelProperty(notes = "生效月份(yyyy-mm格式)")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private String effectiveMonth;
private Date effectiveMonth;
/** /**
* 生效状态:1-生效中,2-待生效 * 生效状态:1-生效中,2-待生效
......
package cn.com.glsx.dj.staff.dto.perfSalary; package cn.com.glsx.dj.staff.dto.perfSalary;
import cn.com.glsx.dj.staff.model.perfSalary.EffectiveReferralReview; import cn.com.glsx.dj.staff.model.perfSalary.EffectiveReferralReview;
import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor;
import lombok.*; import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.SuperBuilder; import lombok.experimental.SuperBuilder;
import java.util.List;
/** /**
* 有效引荐数表 * 有效引荐数表
*/ */
//@AllArgsConstructor // @AllArgsConstructor
//@NoArgsConstructor // @NoArgsConstructor
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder @SuperBuilder
@ToString(callSuper = true) @ToString(callSuper = true)
@Data @Data
@EqualsAndHashCode(callSuper=false)
public class EffectiveReferralReviewDTO extends EffectiveReferralReview { public class EffectiveReferralReviewDTO extends EffectiveReferralReview {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private List<Integer> ids;
} }
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.staff.enums; package cn.com.glsx.dj.staff.enums;
import java.util.Objects;
/** /**
* 绩效参数配置条件类型枚举 * 绩效参数配置条件类型枚举
*/ */
...@@ -17,12 +19,12 @@ public enum PerformanceConditionTypeEnum implements BaseEnum<Byte, String> { ...@@ -17,12 +19,12 @@ public enum PerformanceConditionTypeEnum implements BaseEnum<Byte, String> {
this.desc = desc; this.desc = desc;
} }
public static PerformanceConditionTypeEnum getByCode(Number code) { public static PerformanceConditionTypeEnum getByCode(Byte code) {
if (code == null) { if (code == null) {
return null; return null;
} }
for (PerformanceConditionTypeEnum type : PerformanceConditionTypeEnum.values()) { for (PerformanceConditionTypeEnum type : PerformanceConditionTypeEnum.values()) {
if (type.getCode().equals(code.intValue())) { if (Objects.equals(type.getCode(), code)) {
return type; return type;
} }
} }
......
...@@ -134,10 +134,6 @@ public class StaffPerformanceDetail implements Serializable { ...@@ -134,10 +134,6 @@ public class StaffPerformanceDetail implements Serializable {
@Column(name = "upgrade_order_num") @Column(name = "upgrade_order_num")
private Integer upgradeOrderNum; private Integer upgradeOrderNum;
@ApiModelProperty(notes = "个人渗透率")
@Column(name = "personal_penetration_rate")
private BigDecimal personalPenetrationRate;
@ApiModelProperty(notes = "提成方式(比例-BL,系数-XS,固定金额-DDJE)") @ApiModelProperty(notes = "提成方式(比例-BL,系数-XS,固定金额-DDJE)")
@Column(name = "commission_type") @Column(name = "commission_type")
private String commissionType; private String commissionType;
...@@ -151,6 +147,26 @@ public class StaffPerformanceDetail implements Serializable { ...@@ -151,6 +147,26 @@ public class StaffPerformanceDetail implements Serializable {
/** /**
* <pre> * <pre>
* { * {
* "assessmentFactorDependencyData": {
* "orderData": { // 订单依赖数据
* "personalMonthlyTotalOutput": 1000.00, // 个人月度总产值(业务)
* "personalMonthlyStoreOutput": 800.00, // 个人月度单店产值(门店+业务)
* "mainOrderCountByBrand": 5, // 主订单成交数(门店+业务+品牌)
* "mainOrderCountByBrandAndCategory": 3, // 主订单成交数(门店+业务+品牌+品类)
* "subOrderCountByBrandAndCategory": 10, // 子订单成交数(门店+业务+品牌+品类)
* "categoryOrderOutputTotalByBrandAndCategory": 500.00, // 品类订单产值合计(门店+业务+品牌+品类)
* "commissionBaseSubOrderCountByBrandAndCategory": 8, // 提成基数-子订单成交数(门店+业务+品牌+品类)
* "commissionBaseCategoryOrderOutputTotalByBrandAndCategory": 400.00 // 提成基数-品类订单产值合计(门店+业务+品牌+品类)
* },
* "dailyData": { // 日报/触客依赖数据
* "personalTotalPreSalesTouchCount": 100, // 该个人在所有门店的实际售前触客数总和
* "storePersonalPreSalesTouchCount": 50, // 该门店的该个人实际售前触客数
* "storeTotalTouchCount": 500, // 门店总触客数(该门店的所有个人实际售前触客数之和)
* "storeDeliveryCount": 40, // 门店交车数
* "storeValidRecommendationCount": 45, // 门店有效引荐数
* "personalTargetTouchCount": 10.50 // 个人应触客数
* }
* },
* "conditionExecutions": [ * "conditionExecutions": [
* { * {
* "conditionType": 1, * "conditionType": 1,
......
...@@ -148,9 +148,8 @@ public class AutoPerformRule implements Serializable { ...@@ -148,9 +148,8 @@ public class AutoPerformRule implements Serializable {
* 生效月份(yyyy-mm格式) * 生效月份(yyyy-mm格式)
*/ */
@ApiModelProperty(notes = "生效月份(yyyy-mm格式)") @ApiModelProperty(notes = "生效月份(yyyy-mm格式)")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Column(name = "effective_month") @Column(name = "effective_month")
private Date effectiveMonth; private String effectiveMonth;
/** /**
* 生效状态:1-生效中,2-待生效 * 生效状态:1-生效中,2-待生效
......
...@@ -82,7 +82,7 @@ public interface PerfRuleRemote { ...@@ -82,7 +82,7 @@ public interface PerfRuleRemote {
/** /**
* 定时任务-绩效配置设置 * 定时任务-绩效配置设置
*/ */
RpcResponse<Boolean> syncQwClockInDetailData(String clockInDateStr); RpcResponse<Boolean> perfRuleSettingJob(String clockInDateStr);
/** /**
* 每月自动评绩效 * 每月自动评绩效
......
package cn.com.glsx.dj.staff.remote.performance; package cn.com.glsx.dj.staff.remote.performance;
import cn.com.glsx.dj.staff.dto.performance.PerformanceApproveConfigDTO; import cn.com.glsx.dj.staff.dto.performance.PerformanceApproveConfigDTO;
import cn.com.glsx.framework.core.annotation.ApiService; import cn.com.glsx.framework.core.annotation.*;
import java.util.List; import java.util.List;
@ApiService(value = "提成方案审批人配置", owner = "zhangjb", protocol = ApiService.ProtocolEnum.dubbo, version = "1.0.0") @ApiService(value = "提成方案审批人配置", owner = "zhangjb", protocol = ApiService.ProtocolEnum.dubbo, version = "1.0.0")
public interface PerformanceApproveConfigRemote { public interface PerformanceApproveConfigRemote {
@ApiMethod("获取提成方案审批人配置")
@ApiResponse("提成方案审批配置")
List<PerformanceApproveConfigDTO> listAll(); List<PerformanceApproveConfigDTO> listAll();
} }
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.staff.remote.performance;
import cn.com.glsx.framework.core.annotation.ApiService;
@ApiService(value = "提成方案审批操作记录", owner = "zhangjb", protocol = ApiService.ProtocolEnum.dubbo, version = "1.0.0")
public interface PerformanceConfigApproveOperationRecordRemote {
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.staff.remote.performance;
import cn.com.glsx.dj.staff.dto.PerformanceConfigMerchantBrandRefDTO;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import java.util.List;
@ApiService(value = "提成方案商户品牌关联", owner = "zhangjb", protocol = ApiService.ProtocolEnum.dubbo, version = "1.0.0")
public interface PerformanceConfigMerchantBrandRefRemote {
RpcResponse<Boolean> performanceConfigMerchantBrandRefAdd(List<PerformanceConfigMerchantBrandRefDTO> merchantBrandRefList);
}
package cn.com.glsx.dj.staff.remote.performance;
import cn.com.glsx.dj.staff.dto.PerformanceParamConfigDTO;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import java.util.List;
@ApiService(value = "提成方案参数配置", owner = "zhangjb", protocol = ApiService.ProtocolEnum.dubbo, version = "1.0.0")
public interface PerformanceConfigParamConfigRemote {
RpcResponse<Boolean> performanceConfigParamConfigAdd(List<PerformanceParamConfigDTO> performanceParamConfigList);
}
package cn.com.glsx.dj.staff.remote.performance;
import cn.com.glsx.dj.staff.dto.PerformanceConfigRuleDTO;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
@ApiService(value = "提成方案规则", owner = "zhangjb", protocol = ApiService.ProtocolEnum.dubbo, version = "1.0.0")
public interface PerformanceConfigRuleRemote {
RpcResponse<Boolean> performanceConfigRuleAdd(PerformanceConfigRuleDTO performanceConfigRule);
}
package cn.com.glsx.dj.staff.remote.performance;
import cn.com.glsx.dj.staff.dto.PerformanceParamConfigConditionDTO;
import cn.com.glsx.framework.core.annotation.*;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import java.util.List;
@ApiService(value = "提成方案参数条件配置", owner = "zhangjb", protocol = ApiService.ProtocolEnum.dubbo, version = "1.0.0")
public interface PerformanceParamConfigConditionRemote {
@ApiMethod("添加提成参数条件")
@ApiParam(name = "dto", notes = "dto", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("添加提成参数条件")
RpcResponse<Boolean> performanceParamConfigConditionAdd(List<PerformanceParamConfigConditionDTO> performanceParamConfigConditionDTOList);
}
...@@ -27,8 +27,6 @@ public interface PerformanceConfigMapper extends OreMapper<PerformanceConfig> { ...@@ -27,8 +27,6 @@ public interface PerformanceConfigMapper extends OreMapper<PerformanceConfig> {
Boolean hasEffectivePerformanceConfigForMerchant(Integer merchantId); Boolean hasEffectivePerformanceConfigForMerchant(Integer merchantId);
int insertOne(PerformanceConfigDTO dto);
void updateById(PerformanceConfigDTO dto); void updateById(PerformanceConfigDTO dto);
void enblePerformanceConfig(); void enblePerformanceConfig();
......
...@@ -11,8 +11,6 @@ import java.util.List; ...@@ -11,8 +11,6 @@ import java.util.List;
public interface PerformanceConfigMerchantBrandRefMapper extends OreMapper<PerformanceConfigMerchantBrandRef> { public interface PerformanceConfigMerchantBrandRefMapper extends OreMapper<PerformanceConfigMerchantBrandRef> {
void deleteByConfigId(Integer performanceConfigId); void deleteByConfigId(Integer performanceConfigId);
void insertLists(List<PerformanceConfigMerchantBrandRefDTO> merchantBrandModelPageBrands);
List<PerformanceConfigMerchantBrandRefDTO> listByConfigId(Integer id); List<PerformanceConfigMerchantBrandRefDTO> listByConfigId(Integer id);
void invalidByBusinessTypeAndMerchantBrand(PerformanceConfigMerchantBrandRefDTO merchantBrandRef); void invalidByBusinessTypeAndMerchantBrand(PerformanceConfigMerchantBrandRefDTO merchantBrandRef);
......
...@@ -9,7 +9,5 @@ import org.oreframework.datasource.mybatis.mapper.OreMapper; ...@@ -9,7 +9,5 @@ import org.oreframework.datasource.mybatis.mapper.OreMapper;
public interface PerformanceConfigRuleMapper extends OreMapper<PerformanceConfigRule> { public interface PerformanceConfigRuleMapper extends OreMapper<PerformanceConfigRule> {
PerformanceConfigRuleDTO listByConfigId(Integer id); PerformanceConfigRuleDTO listByConfigId(Integer id);
void insertOne(PerformanceConfigRuleDTO performanceConfigRule);
void deleteByConfigId(Integer performanceConfigId); void deleteByConfigId(Integer performanceConfigId);
} }
\ No newline at end of file \ No newline at end of file
...@@ -13,6 +13,4 @@ public interface PerformanceParamConfigConditionMapper extends OreMapper<Perform ...@@ -13,6 +13,4 @@ public interface PerformanceParamConfigConditionMapper extends OreMapper<Perform
List<PerformanceParamConfigConditionDTO> listByParamConfigId( List<PerformanceParamConfigConditionDTO> listByParamConfigId(
PerformanceParamConfigConditionDTO dto); PerformanceParamConfigConditionDTO dto);
void deleteByPerformanceConfigId(@Param("performanceConfigId") Integer performanceConfigId); void deleteByPerformanceConfigId(@Param("performanceConfigId") Integer performanceConfigId);
void insertLists(List<PerformanceParamConfigConditionDTO> performanceParamConfigConditionDTOList);
} }
\ No newline at end of file \ No newline at end of file
...@@ -12,6 +12,4 @@ public interface PerformanceParamConfigMapper extends OreMapper<PerformanceParam ...@@ -12,6 +12,4 @@ public interface PerformanceParamConfigMapper extends OreMapper<PerformanceParam
List<PerformanceParamConfigDTO> listByConfigId(PerformanceParamConfigDTO dto); List<PerformanceParamConfigDTO> listByConfigId(PerformanceParamConfigDTO dto);
void deleteByPerformanceParamConfigId(Integer id); void deleteByPerformanceParamConfigId(Integer id);
int insertOne(PerformanceParamConfigDTO performanceParamConfig);
} }
\ No newline at end of file \ No newline at end of file
...@@ -18,7 +18,7 @@ public interface AutoPerformRuleMapper extends OreMapper<AutoPerformRule> { ...@@ -18,7 +18,7 @@ public interface AutoPerformRuleMapper extends OreMapper<AutoPerformRule> {
void deleteLatestRuleConfig(); void deleteLatestRuleConfig();
void deleteEffectiveRuleConfig(); void deleteEffectiveRuleConfig(@Param("date") String date);
void updatePendingRuleConfig(@Param("id") Integer id); void updatePendingRuleConfig(@Param("id") Integer id);
......
...@@ -16,6 +16,6 @@ public interface PerformanceMonthlyMapper extends OreMapper<PerformanceMonthly> ...@@ -16,6 +16,6 @@ public interface PerformanceMonthlyMapper extends OreMapper<PerformanceMonthly>
/** /**
* 插入更新保存自动绩效配置 * 插入更新保存自动绩效配置
*/ */
PerformanceMonthly insertUpdate(PerformanceMonthly performanceMonthly); void insertUpdate(PerformanceMonthly performanceMonthly);
} }
\ No newline at end of file \ No newline at end of file
...@@ -205,7 +205,7 @@ public class PerfRuleRemoteImpl implements PerfRuleRemote { ...@@ -205,7 +205,7 @@ public class PerfRuleRemoteImpl implements PerfRuleRemote {
* 定时任务-绩效配置设置 * 定时任务-绩效配置设置
*/ */
@Override @Override
public RpcResponse<Boolean> syncQwClockInDetailData(String clockInDateStr) { public RpcResponse<Boolean> perfRuleSettingJob(String clockInDateStr) {
perfRuleRemoteService.perfRuleSettingJob(""); perfRuleRemoteService.perfRuleSettingJob("");
return RpcResponse.success(true); return RpcResponse.success(true);
} }
......
package cn.com.glsx.dj.staff.remote.performance;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
@Slf4j
@DubboService(version = "1.0.0", validation = "true")
public class PerformanceConfigApproveOperationRecordRemoteImpl implements PerformanceConfigApproveOperationRecordRemote {
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.staff.remote.performance;
import cn.com.glsx.dj.staff.dto.PerformanceConfigMerchantBrandRefDTO;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import java.util.List;
@Slf4j
@DubboService(version = "1.0.0", validation = "true")
public class PerformanceConfigMerchantBrandRefRemoteImpl implements PerformanceConfigMerchantBrandRefRemote {
@Override
public RpcResponse<Boolean> performanceConfigMerchantBrandRefAdd(List<PerformanceConfigMerchantBrandRefDTO> merchantBrandRefList) {
return null;
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.staff.remote.performance;
import cn.com.glsx.dj.staff.dto.PerformanceParamConfigDTO;
import cn.com.glsx.dj.staff.service.staffPerformance.PerformanceConfigParamConfigService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
@Slf4j
@DubboService(version = "1.0.0", validation = "true")
public class PerformanceConfigParamConfigRemoteImpl implements PerformanceConfigParamConfigRemote {
@Autowired
private PerformanceConfigParamConfigService performanceConfigParamConfigService;
@Override
public RpcResponse<Boolean> performanceConfigParamConfigAdd(List<PerformanceParamConfigDTO> performanceParamConfigList) {
performanceConfigParamConfigService.insertList(performanceParamConfigList);
return RpcResponse.success(true);
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.staff.remote.performance;
import cn.com.glsx.dj.staff.dto.PerformanceConfigRuleDTO;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
@Slf4j
@DubboService(version = "1.0.0", validation = "true")
public class PerformanceConfigRuleRemoteImpl implements PerformanceConfigRuleRemote {
@Override
public RpcResponse<Boolean> performanceConfigRuleAdd(PerformanceConfigRuleDTO performanceConfigRule) {
return null;
}
}
package cn.com.glsx.dj.staff.remote.performance;
import cn.com.glsx.dj.staff.dto.PerformanceParamConfigConditionDTO;
import cn.com.glsx.dj.staff.service.staffPerformance.PerformanceParamConfigConditionService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
@Slf4j
@DubboService(version = "1.0.0", validation = "true")
public class PerformanceParamConfigConditionRemoteImpl implements PerformanceParamConfigConditionRemote {
@Autowired
private PerformanceParamConfigConditionService performanceParamConfigConditionService;
@Override
public RpcResponse<Boolean> performanceParamConfigConditionAdd(List<PerformanceParamConfigConditionDTO> performanceParamConfigConditionDTOList) {
performanceParamConfigConditionService.insertList(performanceParamConfigConditionDTOList);
return RpcResponse.success(true);
}
}
\ No newline at end of file \ No newline at end of file
...@@ -124,9 +124,12 @@ public class AttendanceDataCleansingService { ...@@ -124,9 +124,12 @@ public class AttendanceDataCleansingService {
String lastMonth = DateUtil.format(lastMonthDate, DatePattern.NORM_MONTH_PATTERN); String lastMonth = DateUtil.format(lastMonthDate, DatePattern.NORM_MONTH_PATTERN);
log.info("开始处理考勤数据,时间范围:{}", lastMonth); log.info("开始处理考勤数据,时间范围:{}", lastMonth);
String staffBeisenBaseCondition = "(DATE_FORMAT(last_work_date, '%Y-%m') = '{}' or last_work_date is null)"; String staffBeisenBaseCondition1 = "(DATE_FORMAT(last_work_date, '%Y-%m') = '{}' or last_work_date is null)";
staffBeisenBaseCondition = StrUtil.format(staffBeisenBaseCondition, lastMonth); staffBeisenBaseCondition1 = StrUtil.format(staffBeisenBaseCondition1, lastMonth);
staffBeisenBaseExample.createCriteria().andEqualTo("deletedFlag", 'N').andCondition(staffBeisenBaseCondition); String staffBeisenBaseCondition2 = "DATE_FORMAT(entry_date, '%Y-%m') <= '{}'";
staffBeisenBaseCondition2 = StrUtil.format(staffBeisenBaseCondition2, lastMonth);
staffBeisenBaseExample.createCriteria().andEqualTo("deletedFlag", 'N')
.andCondition(staffBeisenBaseCondition1).andCondition(staffBeisenBaseCondition2);
List<StaffBeisenBaseInfo> staffBeiSenBaseInfos = staffBeisenBaseInfoMapper.selectByExample(staffBeisenBaseExample); List<StaffBeisenBaseInfo> staffBeiSenBaseInfos = staffBeisenBaseInfoMapper.selectByExample(staffBeisenBaseExample);
log.info("获取到 {} 条员工数据", staffBeiSenBaseInfos.size()); log.info("获取到 {} 条员工数据", staffBeiSenBaseInfos.size());
...@@ -311,7 +314,7 @@ public class AttendanceDataCleansingService { ...@@ -311,7 +314,7 @@ public class AttendanceDataCleansingService {
// 2. 处理每条考勤记录 // 2. 处理每条考勤记录
// 判断该打卡日期是否在离职直接之后,如果在离职日期之后则不计算 // 判断该打卡日期是否在离职直接之后,如果在离职日期之后则不计算
if (StrUtil.isNotBlank(employee.getLastWorkDate())) { if (StrUtil.isNotBlank(employee.getLastWorkDate())) {
if(DateUtil.compare(DateUtil.parse(clockInfo.getClockInDate(), "yyyy-MM-dd"), DateUtil.parse(employee.getLastWorkDate(), "yyyy-MM-dd")) > 0){ if (DateUtil.compare(DateUtil.parse(clockInfo.getClockInDate(), "yyyy-MM-dd"), DateUtil.parse(employee.getLastWorkDate(), "yyyy-MM-dd")) > 0) {
log.info("{} 打卡日期:{},离职日期:{} 打卡日期在离职日期之后,不处理", employee.getStaffName(), clockInfo.getClockInDate(), employee.getLastWorkDate()); log.info("{} 打卡日期:{},离职日期:{} 打卡日期在离职日期之后,不处理", employee.getStaffName(), clockInfo.getClockInDate(), employee.getLastWorkDate());
continue; continue;
} }
...@@ -773,7 +776,6 @@ public class AttendanceDataCleansingService { ...@@ -773,7 +776,6 @@ public class AttendanceDataCleansingService {
} }
private ClockInResult processWithMerchant(StaffQwClockClean clockInfo, MerchantAttendanceList merchant, StaffBeisenBaseInfo employee) { private ClockInResult processWithMerchant(StaffQwClockClean clockInfo, MerchantAttendanceList merchant, StaffBeisenBaseInfo employee) {
log.info("策略一:处理打卡时间:{}-{},经纬度:{},{}", clockInfo.getClockInTimeStart(), clockInfo.getClockOutTimeEnd(), log.info("策略一:处理打卡时间:{}-{},经纬度:{},{}", clockInfo.getClockInTimeStart(), clockInfo.getClockOutTimeEnd(),
merchant.getAddressLng(), merchant.getAddressLat()); merchant.getAddressLng(), merchant.getAddressLat());
......
...@@ -186,9 +186,9 @@ public class AttendanceSummaryService { ...@@ -186,9 +186,9 @@ public class AttendanceSummaryService {
afterAttendanceTotalBasicSalary = trialBasicSalary; afterAttendanceTotalBasicSalary = trialBasicSalary;
} }
} else { } else {
updatePerfAppraisal.setAfterAttendanceProbationBasicSalary(BigDecimal.ZERO); afterAttendanceProbationBasicSalary = BigDecimal.ZERO;
updatePerfAppraisal.setAfterAttendanceRegularBasicSalary(formalBasicSalary); afterAttendanceRegularBasicSalary = formalBasicSalary;
updatePerfAppraisal.setAfterAttendanceTotalBasicSalary(formalBasicSalary); afterAttendanceTotalBasicSalary = formalBasicSalary;
} }
} else { } else {
// 不满勤 // 不满勤
......
...@@ -80,9 +80,13 @@ public class AutoPerfEvaluationService { ...@@ -80,9 +80,13 @@ public class AutoPerfEvaluationService {
String lastMonth = DateUtil.format(lastMonthDate, DatePattern.NORM_MONTH_PATTERN); String lastMonth = DateUtil.format(lastMonthDate, DatePattern.NORM_MONTH_PATTERN);
log.info("开始处理考勤数据,时间范围:{}", lastMonth); log.info("开始处理考勤数据,时间范围:{}", lastMonth);
String staffBeisenBaseCondition = "(DATE_FORMAT(last_work_date, '%Y-%m') = '{}' or last_work_date is null)"; String staffBeisenBaseCondition1 = "(DATE_FORMAT(last_work_date, '%Y-%m') = '{}' or last_work_date is null)";
staffBeisenBaseCondition = StrUtil.format(staffBeisenBaseCondition, lastMonth); staffBeisenBaseCondition1 = StrUtil.format(staffBeisenBaseCondition1, lastMonth);
staffBeisenBaseExample.createCriteria().andEqualTo("deletedFlag", 'N').andCondition(staffBeisenBaseCondition); String staffBeisenBaseCondition2 = "DATE_FORMAT(entry_date, '%Y-%m') <= '{}'";
staffBeisenBaseCondition2 = StrUtil.format(staffBeisenBaseCondition2, lastMonth);
staffBeisenBaseExample.createCriteria().andEqualTo("deletedFlag", 'N')
// .andEqualTo("staffPhone", "15889804758")
.andCondition(staffBeisenBaseCondition1).andCondition(staffBeisenBaseCondition2);
List<StaffBeisenBaseInfo> staffBeiSenBaseInfos = staffBeisenBaseInfoMapper.selectByExample(staffBeisenBaseExample); List<StaffBeisenBaseInfo> staffBeiSenBaseInfos = staffBeisenBaseInfoMapper.selectByExample(staffBeisenBaseExample);
log.info("获取到 {} 条员工数据", staffBeiSenBaseInfos.size()); log.info("获取到 {} 条员工数据", staffBeiSenBaseInfos.size());
if (ObjectUtil.isEmpty(staffBeiSenBaseInfos)) { if (ObjectUtil.isEmpty(staffBeiSenBaseInfos)) {
...@@ -91,9 +95,12 @@ public class AutoPerfEvaluationService { ...@@ -91,9 +95,12 @@ public class AutoPerfEvaluationService {
} }
// 获取该月的考勤汇总数据 // 获取该月的考勤汇总数据
Example attendanceSummaryExample = new Example(AttendanceSummary.class); Example attendanceSummaryExample = new Example(AttendanceSummary.class);
String attendanceSummaryCondition = "(DATE_FORMAT(attendanceMonth, '%Y-%m') = '{}')"; String attendanceSummaryCondition = "attendance_month = '{}')";
attendanceSummaryCondition = StrUtil.format(attendanceSummaryCondition, lastMonth); attendanceSummaryCondition = StrUtil.format(attendanceSummaryCondition, lastMonth);
attendanceSummaryExample.createCriteria().andEqualTo("deletedFlag", 'N').andCondition(attendanceSummaryCondition); attendanceSummaryExample.createCriteria().andEqualTo("deletedFlag", 'N')
// .andCondition(attendanceSummaryCondition)
// .andEqualTo("mobilePhone", "15889804758")
.andEqualTo("attendanceMonth", lastMonth);
List<AttendanceSummary> attendanceSummaries = attendanceSummaryMapper.selectByExample(attendanceSummaryExample); List<AttendanceSummary> attendanceSummaries = attendanceSummaryMapper.selectByExample(attendanceSummaryExample);
Map<String, AttendanceSummary> attendanceSummaryMap = new HashMap<>(); Map<String, AttendanceSummary> attendanceSummaryMap = new HashMap<>();
if (CollUtil.isNotEmpty(attendanceSummaries)) { if (CollUtil.isNotEmpty(attendanceSummaries)) {
...@@ -114,12 +121,14 @@ public class AutoPerfEvaluationService { ...@@ -114,12 +121,14 @@ public class AutoPerfEvaluationService {
dataBizQueryParamsDTO.setStartDate(DateUtil.format(lastMonthFirstYMD, DatePattern.NORM_DATE_PATTERN)); dataBizQueryParamsDTO.setStartDate(DateUtil.format(lastMonthFirstYMD, DatePattern.NORM_DATE_PATTERN));
dataBizQueryParamsDTO.setEndDate(DateUtil.format(lastMonthLastYMD, DatePattern.NORM_DATE_PATTERN)); dataBizQueryParamsDTO.setEndDate(DateUtil.format(lastMonthLastYMD, DatePattern.NORM_DATE_PATTERN));
// 线上 default.brand.id=1,-2,2695,-4 // 线上 default.brand.id=1,-2,2695,-4
String brandIds = OrePropertyConfigurer.getProperty("default.brand.id", String.class, "-1,-2,3454,-4"); String brandIds = OrePropertyConfigurer.getProperty("default.brand.id", String.class, "1,-2,2695,-4");
dataBizQueryParamsDTO.setBrandIds(brandIds); dataBizQueryParamsDTO.setBrandIds(brandIds);
dataBizQueryParamsDTO.setExts("staffIds"); dataBizQueryParamsDTO.setExts("staffIds");
dataBizQueryParamsDTO.setDateType(2); dataBizQueryParamsDTO.setDateType(2);
String jsonBody = JSONUtil.toJsonStr(dataBizQueryParamsDTO); String jsonBody = JSONUtil.toJsonStr(dataBizQueryParamsDTO);
DataResp<List<DataBusinessDTO>> listDataResp = getDataStatsService.getListDataResp(jsonBody); DataResp<List<DataBusinessDTO>> listDataResp = getDataStatsService.getListDataResp(jsonBody);
// DataResp<List<DataBusinessDTO>> listDataResp = new DataResp<>();
// listDataResp.setContent(new ArrayList<>());
List<DataBusinessDTO> content = listDataResp.getContent(); List<DataBusinessDTO> content = listDataResp.getContent();
// 给每个手机号设置 0 产值 map // 给每个手机号设置 0 产值 map
Map<String, BigDecimal> phoneOutValueMap = staffBeiSenBaseInfos.stream().collect( Map<String, BigDecimal> phoneOutValueMap = staffBeiSenBaseInfos.stream().collect(
...@@ -128,7 +137,7 @@ public class AutoPerfEvaluationService { ...@@ -128,7 +137,7 @@ public class AutoPerfEvaluationService {
if (ObjectUtil.isNotEmpty(content)) { if (ObjectUtil.isNotEmpty(content)) {
// 按员工手机号分组 计算产值 // 按员工手机号分组 计算产值
for (DataBusinessDTO dataBusinessDTO : content) { for (DataBusinessDTO dataBusinessDTO : content) {
BigDecimal outValue = phoneOutValueMap.get(dataBusinessDTO.getStaffPhone()); BigDecimal outValue = phoneOutValueMap.getOrDefault(dataBusinessDTO.getStaffPhone(), BigDecimal.ZERO);
BigDecimal itemValue = dataBusinessDTO.getItemValue(); BigDecimal itemValue = dataBusinessDTO.getItemValue();
if (ObjectUtil.isNotEmpty(itemValue)) { if (ObjectUtil.isNotEmpty(itemValue)) {
outValue = outValue.add(itemValue); outValue = outValue.add(itemValue);
...@@ -138,7 +147,7 @@ public class AutoPerfEvaluationService { ...@@ -138,7 +147,7 @@ public class AutoPerfEvaluationService {
} }
log.info("phoneOutValueMap:{}", phoneOutValueMap); log.info("phoneOutValueMap:{}", phoneOutValueMap);
content.clear(); content.clear();
boolean judgeAutoPerformRuleEnable = ObjectUtil.isEmpty(autoPerformRule) || (ObjectUtil.isNotEmpty(autoPerformRule) && ObjectUtil.equals(autoPerformRule.getStatus(), 1)); boolean judgeAutoPerformRuleEnable = ObjectUtil.isEmpty(autoPerformRule) || (ObjectUtil.isNotEmpty(autoPerformRule) && ObjectUtil.equals(autoPerformRule.getStatus(), 2));
List<PerformanceEvaluation> performanceEvaluations = new ArrayList<>(); List<PerformanceEvaluation> performanceEvaluations = new ArrayList<>();
for (StaffBeisenBaseInfo employee : staffBeiSenBaseInfos) { for (StaffBeisenBaseInfo employee : staffBeiSenBaseInfos) {
log.info("开始处理员工 {} 的数据", employee.getStaffName()); log.info("开始处理员工 {} 的数据", employee.getStaffName());
...@@ -212,9 +221,9 @@ public class AutoPerfEvaluationService { ...@@ -212,9 +221,9 @@ public class AutoPerfEvaluationService {
afterAttendanceTotalBasicSalary = trialBasicSalary; afterAttendanceTotalBasicSalary = trialBasicSalary;
} }
} else { } else {
performanceEvaluation.setAfterAttendanceProbationBasicSalary(BigDecimal.ZERO); afterAttendanceProbationBasicSalary = BigDecimal.ZERO;
performanceEvaluation.setAfterAttendanceRegularBasicSalary(formalBasicSalary); afterAttendanceRegularBasicSalary = formalBasicSalary;
performanceEvaluation.setAfterAttendanceTotalBasicSalary(formalBasicSalary); afterAttendanceTotalBasicSalary = formalBasicSalary;
} }
} else { } else {
// 不满勤 // 不满勤
...@@ -280,32 +289,32 @@ public class AutoPerfEvaluationService { ...@@ -280,32 +289,32 @@ public class AutoPerfEvaluationService {
calculatorMonthOnboardTriggerRewardCoefficient = autoPerformRule.getMonthOnboardDefaultRewardCoefficient(); calculatorMonthOnboardTriggerRewardCoefficient = autoPerformRule.getMonthOnboardDefaultRewardCoefficient();
Integer monthOnboardAttendanceDays = autoPerformRule.getMonthOnboardAttendanceDays(); Integer monthOnboardAttendanceDays = autoPerformRule.getMonthOnboardAttendanceDays();
// 自动打绩效类型 1-当月入职新员工-规则内 2-当月入职新员工-规则外 3-非当月入职员工-规则内 4-非当月入职员工-规则外 // 自动打绩效类型 1-当月入职新员工-规则内 2-当月入职新员工-规则外 3-非当月入职员工-规则内 4-非当月入职员工-规则外
autoGradeType = 1; autoGradeType = 2;
// 判断出勤天数是否满足 monthOnboardAttendanceDays 标准 >=该天数 // 判断出勤天数是否满足 monthOnboardAttendanceDays 标准 >=该天数
if (actualAttendanceDays.compareTo(new BigDecimal(monthOnboardAttendanceDays)) >= 0) { if (actualAttendanceDays.compareTo(new BigDecimal(monthOnboardAttendanceDays)) >= 0) {
// 判断产值是否满足产值阈值 < 该产值阈值 // 判断产值是否满足产值阈值 < 该产值阈值
Integer monthOnboardOutputThreshold = autoPerformRule.getMonthOnboardOutputThreshold(); Integer monthOnboardOutputThreshold = autoPerformRule.getMonthOnboardOutputThreshold();
if (staffOutValue.compareTo(BigDecimal.valueOf(monthOnboardOutputThreshold)) < 0) { if (staffOutValue.compareTo(BigDecimal.valueOf(monthOnboardOutputThreshold)) < 0) {
// 触发规则 // 触发规则
autoGradeType = 2; autoGradeType = 1;
calculatorLevel = autoPerformRule.getMonthOnboardTriggerLevelCode(); calculatorLevel = autoPerformRule.getMonthOnboardTriggerLevelCode();
calculatorMonthOnboardTriggerScore = autoPerformRule.getMonthOnboardTriggerScore(); calculatorMonthOnboardTriggerScore = autoPerformRule.getMonthOnboardTriggerScore();
calculatorMonthOnboardTriggerRewardCoefficient = autoPerformRule.getMonthOnboardTriggerRewardCoefficient(); calculatorMonthOnboardTriggerRewardCoefficient = autoPerformRule.getMonthOnboardTriggerRewardCoefficient();
} }
} }
} else { } else {
autoGradeType = 3; autoGradeType = 4;
calculatorLevel = autoPerformRule.getNoMonthOnboardTriggerLevelCode(); calculatorLevel = autoPerformRule.getNoMonthOnboardDefaultLevelCode();
calculatorMonthOnboardTriggerScore = autoPerformRule.getNoMonthOnboardTriggerScore(); calculatorMonthOnboardTriggerScore = autoPerformRule.getNoMonthOnboardDefaultScore();
calculatorMonthOnboardTriggerRewardCoefficient = autoPerformRule.getNoMonthOnboardTriggerRewardCoefficient(); calculatorMonthOnboardTriggerRewardCoefficient = autoPerformRule.getNoMonthOnboardDefaultRewardCoefficient();
Integer noMonthOnboardOutputThreshold = autoPerformRule.getNoMonthOnboardOutputThreshold(); Integer noMonthOnboardOutputThreshold = autoPerformRule.getNoMonthOnboardOutputThreshold();
// 判断产值是否满足产值阈值 < 该产值阈值 // 判断产值是否满足产值阈值 < 该产值阈值
if (staffOutValue.compareTo(BigDecimal.valueOf(noMonthOnboardOutputThreshold)) < 0) { if (staffOutValue.compareTo(BigDecimal.valueOf(noMonthOnboardOutputThreshold)) < 0) {
// 触发规则 // 触发规则
autoGradeType = 4; autoGradeType = 3;
calculatorLevel = autoPerformRule.getNoMonthOnboardTriggerLevelCode(); calculatorLevel = autoPerformRule.getNoMonthOnboardTriggerLevelCode();
calculatorMonthOnboardTriggerScore = autoPerformRule.getNoMonthOnboardDefaultScore(); calculatorMonthOnboardTriggerScore = autoPerformRule.getNoMonthOnboardTriggerScore();
calculatorMonthOnboardTriggerRewardCoefficient = autoPerformRule.getNoMonthOnboardDefaultRewardCoefficient(); calculatorMonthOnboardTriggerRewardCoefficient = autoPerformRule.getNoMonthOnboardTriggerRewardCoefficient();
} }
} }
performanceEvaluation.setAutoGradeCode(calculatorLevel); performanceEvaluation.setAutoGradeCode(calculatorLevel);
...@@ -336,6 +345,9 @@ public class AutoPerfEvaluationService { ...@@ -336,6 +345,9 @@ public class AutoPerfEvaluationService {
performanceEvaluation.setPerformanceGradeUuid(autoPerformRule.getPerformanceLevelUuid()); performanceEvaluation.setPerformanceGradeUuid(autoPerformRule.getPerformanceLevelUuid());
performanceEvaluation.setAmountCalculationType(1); performanceEvaluation.setAmountCalculationType(1);
performanceEvaluation.setCreatedBy("system");
performanceEvaluation.setUpdatedBy("system");
performanceEvaluation.setDeletedFlag("N");
performanceEvaluations.add(performanceEvaluation); performanceEvaluations.add(performanceEvaluation);
} }
// 保存插入数据 // 保存插入数据
...@@ -405,9 +417,9 @@ public class AutoPerfEvaluationService { ...@@ -405,9 +417,9 @@ public class AutoPerfEvaluationService {
DateTime officialDate = DateUtil.parse(officialDateStr, DatePattern.NORM_DATE_PATTERN); DateTime officialDate = DateUtil.parse(officialDateStr, DatePattern.NORM_DATE_PATTERN);
// 如果转正时间晚于当月最后一天,则当月无转正 // 如果转正时间晚于当月最后一天,则当月无转正
if (officialDate.compareTo(monthLastYMD) > 0) { if (officialDate.compareTo(monthLastYMD) > 0) {
return false;
} else {
return true; return true;
} else {
return false;
} }
} else { } else {
return false; return false;
......
...@@ -25,8 +25,8 @@ public class GetDataStatsService { ...@@ -25,8 +25,8 @@ public class GetDataStatsService {
public DataResp<List<DataBusinessDTO>> getListDataResp(String jsonBody) { public DataResp<List<DataBusinessDTO>> getListDataResp(String jsonBody) {
DataResp<List<DataBusinessDTO>> dataResp; DataResp<List<DataBusinessDTO>> dataResp;
// String url = OrePropertyConfigurer.getProperty("total.data.url", String.class, "http://dc.glsx.com.cn/data"); String url = OrePropertyConfigurer.getProperty("total.data.url", String.class, "http://dc.glsx.com.cn/data");
String url = OrePropertyConfigurer.getProperty("total.data.url", String.class, "http://192.168.3.211:8021/data"); // String url = OrePropertyConfigurer.getProperty("total.data.url", String.class, "http://192.168.3.211:8021/data");
// post请求 // post请求
String jsonResponse; String jsonResponse;
try { try {
......
...@@ -119,6 +119,7 @@ public class PerfRuleRemoteService { ...@@ -119,6 +119,7 @@ public class PerfRuleRemoteService {
autoPerformRule.setNoMonthOnboardDefaultRewardCoefficient(map.get(noMonthOnboardDefaultLevelCode).getRewardCoefficient()); autoPerformRule.setNoMonthOnboardDefaultRewardCoefficient(map.get(noMonthOnboardDefaultLevelCode).getRewardCoefficient());
// 设置待生效 // 设置待生效
autoPerformRule.setEffectiveStatus(EffectiveStatusEnum.PENDING_EFFECTIVE.getCode()); autoPerformRule.setEffectiveStatus(EffectiveStatusEnum.PENDING_EFFECTIVE.getCode());
autoPerformRule.setEffectiveMonth(autoPerformRuleUpdateDTO.getEffectiveMonth());
autoPerformRule.setCreatedBy(perfRuleConfigUpdateDTO.getOperatorName()); autoPerformRule.setCreatedBy(perfRuleConfigUpdateDTO.getOperatorName());
autoPerformRule.setCreatedDate(new Date()); autoPerformRule.setCreatedDate(new Date());
...@@ -157,7 +158,7 @@ public class PerfRuleRemoteService { ...@@ -157,7 +158,7 @@ public class PerfRuleRemoteService {
/** /**
* 定时任务-绩效配置设置 * 定时任务-绩效配置设置 todz
*/ */
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = RpcServiceException.class) @Transactional(propagation = Propagation.REQUIRED, rollbackFor = RpcServiceException.class)
public void perfRuleSettingJob(String monthDate) { public void perfRuleSettingJob(String monthDate) {
...@@ -169,14 +170,14 @@ public class PerfRuleRemoteService { ...@@ -169,14 +170,14 @@ public class PerfRuleRemoteService {
queryLastMonthPendingCondition = StrUtil.format(queryLastMonthPendingCondition, lastMonth); queryLastMonthPendingCondition = StrUtil.format(queryLastMonthPendingCondition, lastMonth);
Example queryLastMonthPendingExample = new Example(AutoPerformRule.class); Example queryLastMonthPendingExample = new Example(AutoPerformRule.class);
queryLastMonthPendingExample.createCriteria().andEqualTo("effectiveStatus", EffectiveStatusEnum.PENDING_EFFECTIVE.getCode()) queryLastMonthPendingExample.createCriteria().andEqualTo("effectiveStatus", EffectiveStatusEnum.PENDING_EFFECTIVE.getCode())
.andCondition(queryLastMonthPendingCondition) .andEqualTo("deletedFlag", 'N')
.andEqualTo("effectiveStartDate", lastMonth); // .andCondition(queryLastMonthPendingCondition)
.andEqualTo("effectiveMonth", lastMonth);
AutoPerformRule lastMonthPendingAutoPerformRule = autoPerformRuleMapper.selectOneByExample(queryLastMonthPendingExample); AutoPerformRule lastMonthPendingAutoPerformRule = autoPerformRuleMapper.selectOneByExample(queryLastMonthPendingExample);
if (ObjectUtil.isEmpty(lastMonthPendingAutoPerformRule)) { if (ObjectUtil.isEmpty(lastMonthPendingAutoPerformRule)) {
// 使用生效中的配置 // 使用生效中的配置
Example queryEffectiveExample = new Example(AutoPerformRule.class); Example queryEffectiveExample = new Example(AutoPerformRule.class);
queryEffectiveExample.createCriteria().andEqualTo("effectiveStatus", EffectiveStatusEnum.EFFECTIVE.getCode()) queryEffectiveExample.createCriteria().andEqualTo("effectiveStatus", EffectiveStatusEnum.EFFECTIVE.getCode());
.andEqualTo("deletedFlag", 'N');
AutoPerformRule effectiveAutoPerformRule = autoPerformRuleMapper.selectOneByExample(queryEffectiveExample); AutoPerformRule effectiveAutoPerformRule = autoPerformRuleMapper.selectOneByExample(queryEffectiveExample);
PerformanceMonthly insertOrUpdate = new PerformanceMonthly(); PerformanceMonthly insertOrUpdate = new PerformanceMonthly();
insertOrUpdate.setMonthDate(lastMonth); insertOrUpdate.setMonthDate(lastMonth);
...@@ -190,6 +191,10 @@ public class PerfRuleRemoteService { ...@@ -190,6 +191,10 @@ public class PerfRuleRemoteService {
log.error("未找到有效的绩效配置"); log.error("未找到有效的绩效配置");
} }
performanceMonthlyMapper.insertUpdate(insertOrUpdate); performanceMonthlyMapper.insertUpdate(insertOrUpdate);
// 将早于等于当前月生效中的配置逻辑删除
autoPerformRuleMapper.deleteEffectiveRuleConfig(lastMonth);
// 将lastMonthPendingAutoPerformRule设置为生效中
autoPerformRuleMapper.updatePendingRuleConfig(effectiveAutoPerformRule.getId());
return; return;
} }
PerformanceMonthly insertOrUpdate = new PerformanceMonthly(); PerformanceMonthly insertOrUpdate = new PerformanceMonthly();
...@@ -199,8 +204,8 @@ public class PerfRuleRemoteService { ...@@ -199,8 +204,8 @@ public class PerfRuleRemoteService {
insertOrUpdate.setPerformanceLevelUuid(lastMonthPendingAutoPerformRule.getPerformanceLevelUuid()); insertOrUpdate.setPerformanceLevelUuid(lastMonthPendingAutoPerformRule.getPerformanceLevelUuid());
performanceMonthlyMapper.insertUpdate(insertOrUpdate); performanceMonthlyMapper.insertUpdate(insertOrUpdate);
// 存在待生效的 // 存在待生效的
// 将生效中的配置逻辑删除 // 将早于等于当前月生效中的配置逻辑删除
autoPerformRuleMapper.deleteEffectiveRuleConfig(); autoPerformRuleMapper.deleteEffectiveRuleConfig(lastMonth);
// 将lastMonthPendingAutoPerformRule设置为生效中 // 将lastMonthPendingAutoPerformRule设置为生效中
autoPerformRuleMapper.updatePendingRuleConfig(lastMonthPendingAutoPerformRule.getId()); autoPerformRuleMapper.updatePendingRuleConfig(lastMonthPendingAutoPerformRule.getId());
} }
......
...@@ -6,6 +6,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -6,6 +6,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
...@@ -24,12 +25,17 @@ public class PerformanceConfigMerchantBrandRefService { ...@@ -24,12 +25,17 @@ public class PerformanceConfigMerchantBrandRefService {
return performanceConfigMerchantBrandRefMapper.listByConfigId(id); return performanceConfigMerchantBrandRefMapper.listByConfigId(id);
} }
public void addRef(List<PerformanceConfigMerchantBrandRefDTO> merchantBrandModelPageBrands, Integer performanceConfigId) { public void addRef(List<PerformanceConfigMerchantBrandRefDTO> merchantBrandModelPageBrands, Integer performanceConfigId, String createdBy, Date createdDate) {
for (PerformanceConfigMerchantBrandRefDTO merchantBrandModelPageBrand : merchantBrandModelPageBrands) { for (PerformanceConfigMerchantBrandRefDTO merchantBrandModelPageBrand : merchantBrandModelPageBrands) {
merchantBrandModelPageBrand.setPerformanceConfigId(performanceConfigId); merchantBrandModelPageBrand.setPerformanceConfigId(performanceConfigId);
merchantBrandModelPageBrand.setCreatedBy(createdBy);
merchantBrandModelPageBrand.setUpdatedBy(createdBy);
merchantBrandModelPageBrand.setCreatedDate(createdDate);
merchantBrandModelPageBrand.setUpdatedDate(createdDate);
merchantBrandModelPageBrand.setDeletedFlag("N");
} }
performanceConfigMerchantBrandRefMapper.deleteByConfigId(performanceConfigId); performanceConfigMerchantBrandRefMapper.deleteByConfigId(performanceConfigId);
performanceConfigMerchantBrandRefMapper.insertLists(merchantBrandModelPageBrands); performanceConfigMerchantBrandRefMapper.insertList(merchantBrandModelPageBrands);
} }
public void invalidByBusinessTypeAndMerchantBrand(Byte businessType, PerformanceConfigMerchantBrandRefDTO merchantBrandRef) { public void invalidByBusinessTypeAndMerchantBrand(Byte businessType, PerformanceConfigMerchantBrandRefDTO merchantBrandRef) {
......
...@@ -6,6 +6,8 @@ import lombok.extern.slf4j.Slf4j; ...@@ -6,6 +6,8 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Date;
/** /**
* *
* *
...@@ -20,9 +22,14 @@ public class PerformanceConfigRuleService { ...@@ -20,9 +22,14 @@ public class PerformanceConfigRuleService {
return performanceConfigRuleMapper.listByConfigId(id); return performanceConfigRuleMapper.listByConfigId(id);
} }
public void addRule(PerformanceConfigRuleDTO performanceConfigRule, Integer performanceConfigId) { public void addRule(PerformanceConfigRuleDTO performanceConfigRule, Integer performanceConfigId, String createdBy, Date createdDate) {
performanceConfigRuleMapper.deleteByConfigId(performanceConfigId); performanceConfigRuleMapper.deleteByConfigId(performanceConfigId);
performanceConfigRule.setPerformanceConfigId(performanceConfigId); performanceConfigRule.setPerformanceConfigId(performanceConfigId);
performanceConfigRuleMapper.insertOne(performanceConfigRule); performanceConfigRule.setCreatedBy(createdBy);
performanceConfigRule.setCreatedDate(createdDate);
performanceConfigRule.setUpdatedBy(createdBy);
performanceConfigRule.setUpdatedDate(createdDate);
performanceConfigRule.setDeletedFlag("N");
performanceConfigRuleMapper.insert(performanceConfigRule);
} }
} }
...@@ -9,15 +9,13 @@ import cn.com.glsx.framework.core.beans.rpc.RpcResponse; ...@@ -9,15 +9,13 @@ import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum; import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException; import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.RpcAssert; import cn.com.glsx.framework.core.util.RpcAssert;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.*;
import java.util.List;
/** /**
* 提成配置Service * 提成配置Service
...@@ -158,15 +156,17 @@ public class PerformanceConfigService { ...@@ -158,15 +156,17 @@ public class PerformanceConfigService {
*/ */
public RpcResponse<Integer> savePerformanceConfig(PerformanceConfigDTO dto) { public RpcResponse<Integer> savePerformanceConfig(PerformanceConfigDTO dto) {
Integer id = dto.getId(); Integer id = dto.getId();
String userName = dto.getUpdatedBy();
Date updateTime = dto.getUpdatedDate();
if (id == null) { if (id == null) {
performanceConfigMapper.insertOne(dto); performanceConfigMapper.insert(dto);
id = dto.getId(); id = dto.getId();
} else { } else {
performanceConfigMapper.updateById(dto); performanceConfigMapper.updateById(dto);
} }
performanceParamConfigService.addParamConfig(dto.getPerformanceParamConfigs(), id); performanceParamConfigService.addParamConfig(dto.getPerformanceParamConfigs(), id, userName, updateTime);
performanceConfigRuleService.addRule(dto.getPerformanceConfigRule(), id); performanceConfigRuleService.addRule(dto.getPerformanceConfigRule(), id, userName, updateTime);
performanceConfigMerchantBrandRefService.addRef(dto.getMerchantBrandModelPageBrands(), id); performanceConfigMerchantBrandRefService.addRef(dto.getMerchantBrandModelPageBrands(), id, userName, updateTime);
return RpcResponse.success(id); return RpcResponse.success(id);
} }
......
...@@ -17,6 +17,6 @@ public class PerformanceParamConfigConditionService { ...@@ -17,6 +17,6 @@ public class PerformanceParamConfigConditionService {
performanceParamConfigConditionMapper.deleteByPerformanceConfigId(performanceConfigId); performanceParamConfigConditionMapper.deleteByPerformanceConfigId(performanceConfigId);
} }
public void insertList(List<PerformanceParamConfigConditionDTO> performanceParamConfigConditionDTOList) { public void insertList(List<PerformanceParamConfigConditionDTO> performanceParamConfigConditionDTOList) {
performanceParamConfigConditionMapper.insertLists(performanceParamConfigConditionDTOList); performanceParamConfigConditionMapper.insertList(performanceParamConfigConditionDTOList);
} }
} }
...@@ -9,6 +9,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -9,6 +9,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
...@@ -37,20 +38,31 @@ public class PerformanceParamConfigService { ...@@ -37,20 +38,31 @@ public class PerformanceParamConfigService {
return performanceParamConfigMapper.listByConfigId(dto); return performanceParamConfigMapper.listByConfigId(dto);
} }
public void addParamConfig(List<PerformanceParamConfigDTO> performanceParamConfigs, Integer performanceConfigId) { public void addParamConfig(List<PerformanceParamConfigDTO> performanceParamConfigs, Integer performanceConfigId, String createdBy, Date curr) {
// 1. 先删掉原来的配置 // 1. 先删掉原来的配置
performanceParamConfigMapper.deleteByPerformanceParamConfigId(performanceConfigId); performanceParamConfigMapper.deleteByPerformanceParamConfigId(performanceConfigId);
// 2. 删除掉原有的条件 // 2. 删除掉原有的条件
performanceParamConfigConditionService.deleteByPerformanceConfigId(performanceConfigId); performanceParamConfigConditionService.deleteByPerformanceConfigId(performanceConfigId);
for (PerformanceParamConfigDTO performanceParamConfig : performanceParamConfigs) { for (PerformanceParamConfigDTO performanceParamConfig : performanceParamConfigs) {
performanceParamConfig.setCreatedBy(createdBy);
performanceParamConfig.setCreatedDate(curr);
performanceParamConfig.setUpdatedDate(curr);
performanceParamConfig.setUpdatedBy(createdBy);
performanceParamConfig.setDeletedFlag("N");
performanceParamConfig.setPerformanceConfigId(performanceConfigId); performanceParamConfig.setPerformanceConfigId(performanceConfigId);
// 3. 执行插入,拿到id // 3. 执行插入,拿到id
int id = performanceParamConfigMapper.insertOne(performanceParamConfig); int id = performanceParamConfigMapper.insert(performanceParamConfig);
// 4. 插入条件 // 4. 插入条件
List<PerformanceParamConfigConditionDTO> performanceParamConfigConditions = performanceParamConfig.getPerformanceParamConfigConditions(); List<PerformanceParamConfigConditionDTO> performanceParamConfigConditions = performanceParamConfig.getPerformanceParamConfigConditions();
if (performanceParamConfigConditions != null && !performanceParamConfigConditions.isEmpty()) { if (performanceParamConfigConditions != null && !performanceParamConfigConditions.isEmpty()) {
for (PerformanceParamConfigConditionDTO performanceParamConfigCondition : performanceParamConfigConditions) { for (PerformanceParamConfigConditionDTO performanceParamConfigCondition : performanceParamConfigConditions) {
performanceParamConfigCondition.setPerformanceConfigId(id); performanceParamConfigCondition.setPerformanceConfigId(id);
performanceParamConfigCondition.setCreatedBy(createdBy);
performanceParamConfigCondition.setCreatedDate(curr);
performanceParamConfigCondition.setUpdatedBy(createdBy);
performanceParamConfigCondition.setUpdatedDate(curr);
performanceParamConfigCondition.setDeletedFlag("N");
} }
performanceParamConfigConditionService.insertList(performanceParamConfigConditions); performanceParamConfigConditionService.insertList(performanceParamConfigConditions);
} }
......
...@@ -41,8 +41,10 @@ public class StaffPerformanceDetailService { ...@@ -41,8 +41,10 @@ public class StaffPerformanceDetailService {
return; return;
} }
log.info("Saving staff performance details. merchantId={}, businessType={}, month={}, count={}", log.info(
config.getMerchantId(), config.getBusinessType(), config.getEffectiveMonth(), "Saving staff performance details. merchantId={}, businessType={}, brandId={}, childBrandId={}, month={}, count={}",
config.getMerchantId(), config.getBusinessType(), config.getBrandId(), config.getChildBrandId(),
config.getEffectiveMonth(),
performanceDetailDTOS == null ? 0 : performanceDetailDTOS.size()); performanceDetailDTOS == null ? 0 : performanceDetailDTOS.size());
if (CollectionUtils.isEmpty(performanceDetailDTOS)) { if (CollectionUtils.isEmpty(performanceDetailDTOS)) {
......
...@@ -61,16 +61,22 @@ public class StaffPerformanceService { ...@@ -61,16 +61,22 @@ public class StaffPerformanceService {
merchantId, businessType, brandId, childBrandId, performanceMonth, staffPhone); merchantId, businessType, brandId, childBrandId, performanceMonth, staffPhone);
return; return;
} }
log.info(
"保存员工绩效数据: merchantId={}, businessType={}, brandId={}, childBrandId={}, performanceMonth={}, staffPhone={}",
merchantId, businessType, brandId, childBrandId, performanceMonth, staffPhone);
// 2. 检查是否处于新人保护期 // 2. 检查是否处于新人保护期
boolean isNewcomerProtection = checkNewcomerProtection(context.getStaffPhone(), context.getPerformanceMonth()); boolean isNewcomerProtection = checkNewcomerProtection(context.getStaffPhone(), context.getPerformanceMonth());
log.info("是否处于新人保护期: isNewcomerProtection={}", isNewcomerProtection);
// 3. 构建 StaffPerformance // 3. 构建 StaffPerformance
StaffPerformance staffPerformance = buildStaffPerformance(performanceDetailDTOS, context, isNewcomerProtection); StaffPerformance staffPerformance = buildStaffPerformance(performanceDetailDTOS, context, isNewcomerProtection);
// 4. 逻辑删除旧数据 // 4. 逻辑删除旧数据
log.debug("逻辑删除旧数据: staffPerformance={}", staffPerformance);
staffPerformanceMapper.removeStaffPerformance(staffPerformance); staffPerformanceMapper.removeStaffPerformance(staffPerformance);
// 5. 插入新数据 // 5. 插入新数据
log.debug("插入新数据: staffPerformance={}", staffPerformance);
staffPerformanceMapper.insertSelective(staffPerformance); staffPerformanceMapper.insertSelective(staffPerformance);
} }
......
...@@ -24,7 +24,7 @@ public class DataCalUtil { ...@@ -24,7 +24,7 @@ public class DataCalUtil {
if (divisor.compareTo(BigDecimal.ZERO) == 0) { if (divisor.compareTo(BigDecimal.ZERO) == 0) {
return null; return null;
} }
return dividend.divide(divisor, 4, BigDecimal.ROUND_HALF_UP); return dividend.divide(divisor, 2, BigDecimal.ROUND_HALF_UP);
} }
} }
...@@ -124,12 +124,12 @@ ...@@ -124,12 +124,12 @@
#{item.lateEarlyMinutes}, #{item.lateEarlyMinutes},
#{item.lateEarlyHours}, #{item.lateEarlyHours},
#{item.missingPunchCount}, #{item.missingPunchCount},
#{entryDate}, #{item.entryDate},
#{correctionDate}, #{item.correctionDate},
#{leaveDate}, #{item.leaveDate},
#{isEntry}, #{item.isEntry},
#{isProbation}, #{item.isProbation},
#{isCorrection}, #{item.isCorrection},
#{item.superiorLeaderName}, #{item.superiorLeaderName},
#{item.superiorLeaderMobilePhone}, #{item.superiorLeaderMobilePhone},
#{item.createdBy}, #{item.createdBy},
......
...@@ -51,13 +51,13 @@ ...@@ -51,13 +51,13 @@
<update id="deleteEffectiveRuleConfig"> <update id="deleteEffectiveRuleConfig">
UPDATE sal_auto_perform_rule UPDATE sal_auto_perform_rule
SET deleted_flag = 'D' SET deleted_flag = 'D', effective_status = null
WHERE effective_status = 1; WHERE effective_status = 1 and <![CDATA[ effective_month <= #{date}]]>;
</update> </update>
<update id="updatePendingRuleConfig"> <update id="updatePendingRuleConfig">
UPDATE sal_auto_perform_rule UPDATE sal_auto_perform_rule
SET effective_status = 2 SET effective_status = 1, deleted_flag = 'N'
WHERE id = #{id}; WHERE id = #{id};
</update> </update>
......
...@@ -101,6 +101,31 @@ ...@@ -101,6 +101,31 @@
LEFT JOIN dj_car_life_service_merchant dclsm ON serr.merchant_id = dclsm.merchant_id LEFT JOIN dj_car_life_service_merchant dclsm ON serr.merchant_id = dclsm.merchant_id
AND dclsm.deleted_flag = 'N' AND dclsm.deleted_flag = 'N'
WHERE serr.deleted_flag = 'N' WHERE serr.deleted_flag = 'N'
<if test="isReviewed != null and isReviewed == 0">
AND serr.is_reviewed = #{isReviewed}
AND now() BETWEEN
STR_TO_DATE(CONCAT(DATE_FORMAT(now(), '%Y-%m-'),
(SELECT start_day_of_month FROM dj_car_life_performance_time_cycle ORDER BY id LIMIT 1)),
'%Y-%m-%d %H:%i:%s')
AND
STR_TO_DATE(CONCAT(DATE_FORMAT(now(), '%Y-%m-'),
(SELECT end_day_of_month FROM dj_car_life_performance_time_cycle ORDER BY id LIMIT 1)),
'%Y-%m-%d %H:%i:%s')
</if>
<if test="isReviewed != null and isReviewed == 1">
AND serr.is_reviewed = #{isReviewed}
</if>
<if test="isReviewed != null and isReviewed == 2">
AND serr.is_reviewed = #{isReviewed}
AND now() NOT BETWEEN
STR_TO_DATE(CONCAT(DATE_FORMAT(now(), '%Y-%m-'),
(SELECT start_day_of_month FROM dj_car_life_performance_time_cycle ORDER BY id LIMIT 1)),
'%Y-%m-%d %H:%i:%s')
AND
STR_TO_DATE(CONCAT(DATE_FORMAT(now(), '%Y-%m-'),
(SELECT end_day_of_month FROM dj_car_life_performance_time_cycle ORDER BY id LIMIT 1)),
'%Y-%m-%d %H:%i:%s')
</if>
<if test="merchantId != null"> <if test="merchantId != null">
AND serr.merchant_id = #{merchantId} AND serr.merchant_id = #{merchantId}
</if> </if>
...@@ -116,9 +141,6 @@ ...@@ -116,9 +141,6 @@
<if test="isNeedReviewed != null and isNeedReviewed != '' "> <if test="isNeedReviewed != null and isNeedReviewed != '' ">
AND serr.is_need_reviewed = #{isNeedReviewed} AND serr.is_need_reviewed = #{isNeedReviewed}
</if> </if>
<if test="isReviewed != null ">
AND serr.is_reviewed = #{isReviewed}
</if>
<if test="brandName != null and brandName != '' "> <if test="brandName != null and brandName != '' ">
AND serr.brand_name = #{brandName} AND serr.brand_name = #{brandName}
</if> </if>
......
...@@ -20,16 +20,10 @@ ...@@ -20,16 +20,10 @@
<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.PerformanceConfigDTO" extends="BaseResultMap"> <resultMap id="DTOResultMap" type="cn.com.glsx.dj.staff.dto.PerformanceConfigDTO" extends="BaseResultMap">
<result column="merchant_id" property="merchantId" jdbcType="INTEGER" />
<result column="merchant_name" property="merchantName" jdbcType="VARCHAR" /> <result column="merchant_name" property="merchantName" jdbcType="VARCHAR" />
</resultMap> <result column="brand_name" property="brandName" jdbcType="VARCHAR" />
<result column="child_name" property="childBrandName" jdbcType="VARCHAR" />
<resultMap id="MerchantPerformanceResultMap"
type="cn.com.glsx.dj.staff.dto.performance.PerformanceConfigPageByMerchantDTO">
<result column="merchant_id" property="merchantId" jdbcType="INTEGER"/>
<result column="merchant_name" property="merchantNames" jdbcType="VARCHAR"/>
<result column="scheme_names" property="schemeNames" jdbcType="VARCHAR"/>
<result column="brand_names" property="brandNames" jdbcType="VARCHAR"/>
<result column="business_types" property="businessTypes" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<sql id="Base_Column_List" > <sql id="Base_Column_List" >
<!-- <!--
...@@ -41,7 +35,10 @@ ...@@ -41,7 +35,10 @@
<select id="selectEffectiveConfig" parameterType="cn.com.glsx.dj.staff.dto.PerformanceConfigDTO" resultMap="DTOResultMap"> <select id="selectEffectiveConfig" parameterType="cn.com.glsx.dj.staff.dto.PerformanceConfigDTO" resultMap="DTOResultMap">
SELECT c.*, SELECT c.*,
dclsm.merchant_name r.merchant_id,
r.brand_name,
r.child_name,
ifnull(dclsm.merchant_name, r.merchant_name) merchant_name
FROM dj_car_life_performance_config c FROM dj_car_life_performance_config c
LEFT JOIN dj_car_life_performance_config_merchant_brand_ref r ON c.id = r.performance_config_id LEFT JOIN dj_car_life_performance_config_merchant_brand_ref r ON c.id = r.performance_config_id
LEFT JOIN dj_car_life_service_merchant dclsm ON dclsm.merchant_id = r.merchant_id LEFT JOIN dj_car_life_service_merchant dclsm ON dclsm.merchant_id = r.merchant_id
...@@ -65,7 +62,7 @@ ...@@ -65,7 +62,7 @@
WHERE WHERE
c.deleted_flag = 'N' c.deleted_flag = 'N'
AND c.status = 2 AND c.status = 2
AND r.scheme_name = #{schemeName} AND c.scheme_name = #{schemeName}
LIMIT LIMIT
1 1
</select> </select>
...@@ -113,16 +110,15 @@ ...@@ -113,16 +110,15 @@
LIMIT LIMIT
1 1
</select> </select>
<select id="listByMerchant" <select id="listByMerchant"
parameterType="cn.com.glsx.dj.staff.dto.performance.PerformanceConfigPageByMerchantDTO" parameterType="cn.com.glsx.dj.staff.dto.performance.PerformanceConfigPageByMerchantDTO"
resultMap="MerchantPerformanceResultMap"> resultType="cn.com.glsx.dj.staff.dto.performance.PerformanceConfigPageByMerchantDTO">
SELECT SELECT
ref.merchant_id AS merchant_id, ref.merchant_id AS merchantId,
IFNULL(s.merchant_name, '') AS merchant_name, IFNULL(s.merchant_name, '') AS merchantNames,
IFNULL(GROUP_CONCAT(DISTINCT cfg.scheme_name SEPARATOR ','), '') AS scheme_names, IFNULL(GROUP_CONCAT(DISTINCT cfg.scheme_name SEPARATOR ','), '') AS schemeNames,
IFNULL(GROUP_CONCAT(DISTINCT ref.brand_name SEPARATOR ','), '') AS brand_names, IFNULL(GROUP_CONCAT(DISTINCT ref.brand_name SEPARATOR ','), '') AS brandNames,
IFNULL(GROUP_CONCAT(DISTINCT cfg.business_type SEPARATOR ','), '') AS business_types IFNULL(GROUP_CONCAT(DISTINCT cfg.business_type SEPARATOR ','), '') AS businessTypes
FROM FROM
dj_car_life_performance_config_merchant_brand_ref ref dj_car_life_performance_config_merchant_brand_ref ref
INNER JOIN INNER JOIN
...@@ -201,22 +197,6 @@ ...@@ -201,22 +197,6 @@
) AS exist_flag; ) AS exist_flag;
</select> </select>
<insert id="insertOne" parameterType="cn.com.glsx.dj.staff.dto.PerformanceConfigDTO"
useGeneratedKeys="true" keyProperty="id" keyColumn="id">
INSERT INTO dj_car_life_performance_config (scheme_name,
scheme_type,
origin_performance_config_id,
business_type,
effective_month,
status)
VALUES (#{schemeName},
#{schemeType},
#{originPerformanceConfigId},
#{businessType},
#{effectiveMonth},
#{status})
</insert>
<update id="updateById" parameterType="cn.com.glsx.dj.staff.dto.PerformanceConfigDTO"> <update id="updateById" parameterType="cn.com.glsx.dj.staff.dto.PerformanceConfigDTO">
UPDATE dj_car_life_performance_config UPDATE dj_car_life_performance_config
SET SET
......
...@@ -40,45 +40,6 @@ ...@@ -40,45 +40,6 @@
deleted_flag = 'N' deleted_flag = 'N'
AND performance_config_id = #{performanceConfigId} AND performance_config_id = #{performanceConfigId}
</update> </update>
<!-- 新增:批量插入商户品牌关联数据 -->
<insert id="insertLists"
parameterType="java.util.List"
useGeneratedKeys="true"
keyProperty="id"
keyColumn="id">
INSERT INTO dj_car_life_performance_config_merchant_brand_ref (
performance_config_id,
merchant_id,
merchant_name,
brand_id,
brand_name,
child_id,
child_name,
created_by,
created_date,
updated_by,
updated_date,
deleted_flag
) VALUES
<foreach collection="list" item="item" separator=",">
(
#{item.performanceConfigId},
#{item.merchantId},
#{item.merchantName},
#{item.brandId},
#{item.brandName},
#{item.childId},
#{item.childName},
#{item.createdBy},
NOW(),
#{item.updatedBy},
NOW(),
'N'
)
</foreach>
</insert>
<!-- 新增:根据配置ID查询商户品牌关联列表 --> <!-- 新增:根据配置ID查询商户品牌关联列表 -->
<select id="listByConfigId" parameterType="java.lang.Integer" resultMap="DTOResultMap"> <select id="listByConfigId" parameterType="java.lang.Integer" resultMap="DTOResultMap">
SELECT SELECT
......
...@@ -39,37 +39,6 @@ ...@@ -39,37 +39,6 @@
LIMIT 1 LIMIT 1
</select> </select>
<!-- 新增:单条插入规则数据 -->
<insert id="insertOne"
parameterType="cn.com.glsx.dj.staff.dto.PerformanceConfigRuleDTO"
useGeneratedKeys="true"
keyProperty="id"
keyColumn="id">
INSERT INTO dj_car_life_performance_config_rule (
performance_config_id,
assessment_factors,
commission_bases,
commission_types,
goods_config_types,
created_by,
created_date,
updated_by,
updated_date,
deleted_flag
) VALUES (
#{performanceConfigId},
#{assessmentFactors},
#{commissionBases},
#{commissionTypes},
#{goodsConfigTypes},
#{createdBy},
NOW(),
#{updatedBy},
NOW(),
'N'
)
</insert>
<!-- 新增:根据配置ID逻辑删除规则 --> <!-- 新增:根据配置ID逻辑删除规则 -->
<update id="deleteByConfigId" parameterType="java.lang.Integer"> <update id="deleteByConfigId" parameterType="java.lang.Integer">
UPDATE dj_car_life_performance_config_rule UPDATE dj_car_life_performance_config_rule
......
...@@ -69,7 +69,6 @@ ...@@ -69,7 +69,6 @@
#{baseSalary}, #{baseSalary},
#{performanceSalary}, #{performanceSalary},
#{basicSalary}, #{basicSalary},
#{totalGrossSalary},
#{outputValue}, #{outputValue},
#{entryDate}, #{entryDate},
#{correctionDate}, #{correctionDate},
...@@ -201,7 +200,6 @@ ...@@ -201,7 +200,6 @@
#{item.baseSalary}, #{item.baseSalary},
#{item.performanceSalary}, #{item.performanceSalary},
#{item.basicSalary}, #{item.basicSalary},
#{item.totalGrossSalary},
#{item.outputValue}, #{item.outputValue},
#{item.entryDate}, #{item.entryDate},
#{item.correctionDate}, #{item.correctionDate},
......
...@@ -88,61 +88,4 @@ ...@@ -88,61 +88,4 @@
ORDER BY ORDER BY
dcpcc.id DESC dcpcc.id DESC
</select> </select>
<!-- 新增的批量插入语句 -->
<insert id="insertLists"
parameterType="java.util.List"
useGeneratedKeys="true"
keyProperty="id"
keyColumn="id">
INSERT INTO dj_car_life_performance_param_config_condition (
performance_param_config_id,
condition_type,
condition_goods_config_type,
condition_goods_type,
condition_goods_type_name,
condition_secondary_goods_type,
condition_secondary_goods_type_name,
condition_third_level_goods_type,
condition_third_level_goods_type_name,
condition_product_define_id,
condition_product_define_name,
condition_assessment_factors,
condition_start_value,
condition_end_value,
condition_commission_base,
condition_commission_type,
condition_commission_type_value,
created_by,
created_date,
updated_by,
updated_date,
deleted_flag
) VALUES
<foreach collection="list" item="item" separator=",">
(
#{item.performanceParamConfigId},
#{item.conditionType},
#{item.conditionGoodsConfigType},
#{item.conditionGoodsType},
#{item.conditionGoodsTypeName},
#{item.conditionSecondaryGoodsType},
#{item.conditionSecondaryGoodsTypeName},
#{item.conditionThirdLevelGoodsType},
#{item.conditionThirdLevelGoodsTypeName},
#{item.conditionProductDefineId},
#{item.conditionProductDefineName},
#{item.conditionAssessmentFactors},
#{item.conditionStartValue},
#{item.conditionEndValue},
#{item.conditionCommissionBase},
#{item.conditionCommissionType},
#{item.conditionCommissionTypeValue},
#{item.createdBy},
NOW(),
#{item.updatedBy},
NOW(),
'N'
)
</foreach>
</insert>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
...@@ -84,54 +84,4 @@ ...@@ -84,54 +84,4 @@
deleted_flag = 'N' deleted_flag = 'N'
AND performance_config_id = #{id} AND performance_config_id = #{id}
</update> </update>
<insert id="insertOne"
parameterType="cn.com.glsx.dj.staff.dto.PerformanceParamConfigDTO"
useGeneratedKeys="true"
keyProperty="id"
keyColumn="id">
INSERT INTO dj_car_life_performance_param_config (performance_config_id,
template_type,
assessment_factor,
start_value,
end_value,
commission_base,
commission_type,
goods_config_type,
goods_type,
goods_type_name,
secondary_goods_type,
secondary_goods_type_name,
third_level_goods_type,
third_level_goods_type_name,
product_define_id,
product_define_name,
commission_type_value,
created_by,
created_date,
updated_by,
updated_date,
deleted_flag)
VALUES (#{performanceConfigId},
#{templateType},
#{assessmentFactor},
#{startValue},
#{endValue},
#{commissionBase},
#{commissionType},
#{goodsConfigType},
#{goodsType},
#{goodsTypeName},
#{secondaryGoodsType},
#{secondaryGoodsTypeName},
#{thirdLevelGoodsType},
#{thirdLevelGoodsTypeName},
#{productDefineId},
#{productDefineName},
#{commissionTypeValue},
#{createdBy},
NOW(),
#{updatedBy},
NOW(),
'N')
</insert>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
...@@ -91,10 +91,8 @@ ...@@ -91,10 +91,8 @@
AND dclsdrh.brand_id = #{childBrandId} AND dclsdrh.brand_id = #{childBrandId}
</if> </if>
<if test="month != null and month != ''"> <if test="month != null and month != ''">
AND dclsdrh.report_date &gt;= concat( #{month}, AND dclsdrh.report_date &gt;= concat( #{month}, '-01')
'-01') AND dclsdrh.report_date &lt; DATE_ADD(concat( #{month}, '-01'), INTERVAL 1 MONTH)
AND dclsdrh.report_date &lt; DATE_ADD(concat( #{month},
'-01'), INTERVAL 1 MONTH)
</if> </if>
</where> </where>
</select> </select>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!