|
|
@@ -17,7 +17,6 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.text.DecimalFormat;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
@@ -303,9 +302,9 @@ public class DesignerServiceImpl implements IDesignerService {
|
|
|
Map<String, Object> bytedanceMap = new HashMap<>();
|
|
|
Map<String, Object> kuaishouMap = new HashMap<>();
|
|
|
bytedanceMap.put("type", "byteDance");
|
|
|
- bytedanceMap.put("cost", String.format("%.2f", bytedanceCost));
|
|
|
+ bytedanceMap.put("cost", String.format("%.3f", bytedanceCost));
|
|
|
kuaishouMap.put("type", "kuaiShou");
|
|
|
- kuaishouMap.put("cost", String.format("%.2f", kuaishouCost));
|
|
|
+ kuaishouMap.put("cost", String.format("%.3f", kuaishouCost));
|
|
|
quarterCostList.add(bytedanceMap);
|
|
|
quarterCostList.add(kuaishouMap);
|
|
|
|
|
|
@@ -314,12 +313,12 @@ public class DesignerServiceImpl implements IDesignerService {
|
|
|
|
|
|
//季度素材 总消耗
|
|
|
Double tatolCost = quarterCostList.stream().mapToDouble(json -> new Double(json.get("cost") + "")).reduce(Double::sum).orElse(new Double("0"));
|
|
|
- userFrozen.put("tatolQuarterCost", String.format("%.2f", tatolCost));
|
|
|
+ userFrozen.put("tatolQuarterCost", String.format("%.3f", tatolCost));
|
|
|
|
|
|
//季度 管理消耗汇总
|
|
|
Double bytedanceLeaderCost = leaderCostList.stream().mapToDouble(json -> new Double(json.get("bytedanceCost") + "")).reduce(Double::sum).orElse(new Double("0"));
|
|
|
Double kuaishouLeaderCost = leaderCostList.stream().mapToDouble(json -> new Double(json.get("kuaishouCost") + "")).reduce(Double::sum).orElse(new Double("0"));
|
|
|
- userFrozen.put("leaderCost", String.format("%.2f", bytedanceLeaderCost + kuaishouLeaderCost));
|
|
|
+ userFrozen.put("leaderCost", String.format("%.3f", bytedanceLeaderCost + kuaishouLeaderCost));
|
|
|
|
|
|
|
|
|
//判断素材消耗是否达标
|
|
|
@@ -390,7 +389,7 @@ public class DesignerServiceImpl implements IDesignerService {
|
|
|
}
|
|
|
commissionJson.put("monthTime", bytedance.get(i).get(0).getBigInteger("monthTime"));
|
|
|
commissionJson.put("xishu", userHappyProbability);
|
|
|
- commissionJson.put("commission", String.format("%.2f", (bytedanceCommission + kuaishouCommission) * userHappyProbability));
|
|
|
+ commissionJson.put("commission", String.format("%.3f", (bytedanceCommission + kuaishouCommission) * userHappyProbability));
|
|
|
commissionList.add(commissionJson);
|
|
|
}
|
|
|
bytedanceJson.get(0);
|
|
|
@@ -409,7 +408,7 @@ public class DesignerServiceImpl implements IDesignerService {
|
|
|
Double designerLeaderCommissionKuaishou = kuaishouLeaderCost * 0.003 * 0.2;
|
|
|
designerLeaderCommission = designerLeaderCommissionBytedance + designerLeaderCommissionKuaishou;
|
|
|
}
|
|
|
- userFrozen.put("designerLeaderCommission", String.format("%.2f", designerLeaderCommission));
|
|
|
+ userFrozen.put("designerLeaderCommission", String.format("%.3f", designerLeaderCommission));
|
|
|
|
|
|
//提成汇总 = 季度汇总 + 负责人提成
|
|
|
totalCommission += designerLeaderCommission;
|
|
|
@@ -442,7 +441,7 @@ public class DesignerServiceImpl implements IDesignerService {
|
|
|
|
|
|
//提成发放金额 = 总提成 * 爆款达标发放系数
|
|
|
Double userHappyGetMoney = totalCommission * coefficient;
|
|
|
- userFrozen.put("userHappyGetMoney", String.format("%.2f", userHappyGetMoney));
|
|
|
+ userFrozen.put("userHappyGetMoney", String.format("%.3f", userHappyGetMoney));
|
|
|
|
|
|
return userFrozen;
|
|
|
}
|
|
|
@@ -477,14 +476,19 @@ public class DesignerServiceImpl implements IDesignerService {
|
|
|
|
|
|
@Override
|
|
|
public Result getDesignerBasicsAndAch(String userId, String yearTime, String monthTime, int pageNum, int pageSize) {
|
|
|
+ long startTime = System.currentTimeMillis() / 1000;
|
|
|
//取当前时间的季度的月份
|
|
|
List<Map<String, Integer>> timeMap = DateUtils.getQuarStartAndEndTime(Integer.valueOf(monthTime));
|
|
|
//基础信息 + 绩效
|
|
|
PageInfo<JSONObject> baseics = getDesignBasicsInfoList(userId, pageNum, pageSize, timeMap);
|
|
|
+ long endTime1 = System.currentTimeMillis() / 1000;
|
|
|
+ System.out.println("------------------查询人员用时---------->" + (endTime1 - startTime) + "S");
|
|
|
for (JSONObject jsonObject : baseics.getList()) {
|
|
|
//绩效
|
|
|
getDesignerAchievements(jsonObject, yearTime, timeMap);
|
|
|
}
|
|
|
+ long endTime = System.currentTimeMillis() / 1000;
|
|
|
+ System.out.println("------------------总共用时---------->" + (endTime - startTime) + "S");
|
|
|
return Result.successMsg("基础+绩效查询成功。", baseics);
|
|
|
}
|
|
|
|