Commit 5bcc8e39 by 叶立庆

Merge branch 'v5.7.2' into 'master'

上线合并

See merge request !12
2 parents ecd0de13 71c53674
package cn.com.glsx.dj.staff.dto.meituan;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class DeptStaffDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("部门名称")
private String deptName;
@ApiModelProperty("员工列表")
private List<Staff> staffList;
/**
* 员工类
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public static class Staff implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("员工姓名")
private String staffName;
@ApiModelProperty("员工手机号")
private String staffPhone;
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package cn.com.glsx.dj.staff.job;
import cn.com.glsx.dj.staff.dto.WechatMessageSendDTO;
import cn.com.glsx.dj.staff.dto.meituan.DeptMonthlyReportDTO;
import cn.com.glsx.dj.staff.dto.meituan.DeptStaffDTO;
import cn.com.glsx.dj.staff.enums.MeituanPushStatusEnum;
import cn.com.glsx.dj.staff.enums.MeituanPushTypeEnum;
import cn.com.glsx.dj.staff.model.StaffMeituanPushLog;
......@@ -22,7 +23,11 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 每月1号上午10点15分定时任务推送美团消费部门月度报告
......@@ -80,6 +85,25 @@ public class MeiTuanDeptMonthlyReportJob implements SimpleJob {
String personHrList = env.getProperty("staff.meituan.order.send.hr.person", String.class);
log.info("推送hr人员名单:{}", personHrList);
String deptPersonList = env.getProperty("staff.meituan.order.send.dept.person", String.class);
log.info("推送指定部门人员名单:{}", deptPersonList);
List<DeptStaffDTO> deptStaffDTOList = Collections.emptyList();
if (!StringUtils.isEmpty(deptPersonList)) {
try {
deptStaffDTOList = JSON.parseArray(deptPersonList, DeptStaffDTO.class);
} catch (Exception e) {
log.error("解析配置的部门人员名单失败: {}", deptPersonList, e);
}
}
Map<String, List<DeptStaffDTO.Staff>> deptStaffMap = new HashMap<>();
if (!CollectionUtils.isEmpty(deptStaffDTOList)) {
for (DeptStaffDTO deptStaffDTO : deptStaffDTOList) {
deptStaffMap.computeIfAbsent(deptStaffDTO.getDeptName(), k -> new ArrayList<>()).addAll(deptStaffDTO.getStaffList());
}
}
int pushCount = 0;
for (DeptMonthlyReportDTO dto : reportList) {
Long directOrgId = dto.getDirectOrgId();
......@@ -87,7 +111,17 @@ public class MeiTuanDeptMonthlyReportJob implements SimpleJob {
List<StaffUniqueMarkInfo> staffUniqueMarkInfos = meiTuanOrderManager.obtainDeptList(directOrgId);
if (CollectionUtils.isEmpty(staffUniqueMarkInfos)){
log.info("根据部门id查询不到对应的部门主管,directOrgId:{}", directOrgId);
continue;
staffUniqueMarkInfos = new ArrayList<>();
}
List<DeptStaffDTO.Staff> extraStaffList = deptStaffMap.get(directOrgName);
if (!CollectionUtils.isEmpty(extraStaffList)) {
for (DeptStaffDTO.Staff staff : extraStaffList) {
StaffUniqueMarkInfo markInfo = new StaffUniqueMarkInfo();
markInfo.setStaffName(staff.getStaffName());
markInfo.setStaffIdentifier(staff.getStaffPhone());
staffUniqueMarkInfos.add(markInfo);
}
}
if (!StringUtils.isEmpty(personHrList)){
......
......@@ -544,7 +544,11 @@ public class StaffPerformanceCalService {
// 非系数的计算提成金额
BigDecimal commission = null;
if (Objects.equals(detailDTO.getCommissionType(), CommissionTypeEnum.GDJE.getCode())) {
commission = detailDTO.getCommissionTypeValue();
if (detailDTO.getCommissionTypeValue() != null && detailDTO.getUpgradeOrderNum() != null) {
commission = detailDTO.getCommissionTypeValue().multiply(BigDecimal.valueOf(detailDTO.getUpgradeOrderNum()));
}else{
log.warn("按固定金额计算,提成类型值或升级订单数为空");
}
} else if (Objects.equals(detailDTO.getCommissionType(), CommissionTypeEnum.BL.getCode())) {
// 比例:基数 * 比例
commission = detailDTO.getGmvOutput()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!