fix bd String

master
eason.qian 7 years ago
parent dcd9c55f52
commit f385c488a0

@ -21,7 +21,7 @@ public interface BDPrizeService {
JSONObject findReport(String month) throws Exception;
JSONObject getBDReport(String month, int managerId);
JSONObject getBDReport(String month, String managerId);
List<JSONObject> getRateConfig();

@ -246,7 +246,7 @@ public class BDPrizeServiceImpl implements BDPrizeService {
}
@Override
public JSONObject getBDReport(String month, int managerId) {
public JSONObject getBDReport(String month, String managerId) {
try {
Date mon = DateUtils.parseDate(month, new String[]{"yyyy-MM"});
month = DateFormatUtils.format(mon, "yyyy-MM");
@ -281,13 +281,13 @@ public class BDPrizeServiceImpl implements BDPrizeService {
JSONObject totalDetail = financialBDPrizeLogMapper.findByReportAndBDTotal(report.getString("record_id"), managerId);
log.putAll(totalDetail);
JSONObject bdInfo = managerMapper.findById(managerId);
if (ManagerRole.BD_LEADER.hasRole(managerId)) {
if (ManagerRole.BD_LEADER.hasRole(bdInfo.getIntValue("role"))) {
JSONObject groupPrizeLog = financialBDPrizeLogMapper.findByReportAndGroup(report.getString("record_id"), managerId);
log.put("group_prize", groupPrizeLog);
}
JSONObject bdInfo = managerMapper.findById(String.valueOf(managerId));
if (bdInfo == null) {
log.put("leftCompany", true);
}

@ -45,13 +45,13 @@ public class BDPrizeController {
}
@ManagerMapping(value = "/records/{month}/bd_users/{managerId}", method = RequestMethod.GET, role = ManagerRole.FINANCIAL_STAFF)
public JSONObject getBDUserReportDetail(@PathVariable String month, @PathVariable int managerId) {
public JSONObject getBDUserReportDetail(@PathVariable String month, @PathVariable String managerId) {
return bdPrizeService.getBDReport(month, managerId);
}
@ManagerMapping(value = "/records/{month}/bd_user_detail", method = RequestMethod.GET, role = ManagerRole.BD_USER)
public JSONObject getBDUserReportDetailForBD(@PathVariable String month, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return bdPrizeService.getBDReport(month, manager.getIntValue("manager_id"));
return bdPrizeService.getBDReport(month, manager.getString("manager_id"));
}
@ManagerMapping(value = "/config/rates", method = RequestMethod.GET, role = {ManagerRole.BD_USER, ManagerRole.FINANCIAL_STAFF, ManagerRole.ADMIN})

@ -30,21 +30,21 @@ public interface FinancialBDPrizeLogMapper {
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "prize_type=0")
List<JSONObject> findByReportAndBD(@Param("record_id") String recordId, @Param("manager_id") int managerId);
List<JSONObject> findByReportAndBD(@Param("record_id") String recordId, @Param("manager_id") String managerId);
@Select("SELECT prize_log_id,record_id,manager_id,bd_name,bd_level,SUM(total_amount) total_amount, " +
"SUM(total_prize) total_prize,SUM(total_donation) total_donation, SUM(send_prize) send_prize, " +
"SUM(hold_prize) hold_prize,last_punish,prize_type FROM financial_bd_prize_log fbpl " +
"where fbpl.prize_type = 0 and fbpl.record_id = #{record_id} and fbpl.manager_id = #{manager_id} " +
"GROUP BY fbpl.manager_id")
JSONObject findByReportAndBDTotal(@Param("record_id") String recordId, @Param("manager_id") int managerId);
JSONObject findByReportAndBDTotal(@Param("record_id") String recordId, @Param("manager_id") String managerId);
@Select("SELECT prize_log_id,record_id,manager_id,bd_name,bd_level,SUM(total_amount) total_amount," +
"SUM(total_prize) total_prize,SUM(total_donation) total_donation, SUM(send_prize) send_prize," +
"SUM(hold_prize) hold_prize,last_punish,prize_type FROM financial_bd_prize_log fbpl " +
"where fbpl.prize_type = 1 and fbpl.manager_id = #{manager_id} " +
"GROUP BY fbpl.manager_id ")
JSONObject findByReportAndGroup(@Param("record_id") String recordId, @Param("manager_id") int managerId);
JSONObject findByReportAndGroup(@Param("record_id") String recordId, @Param("manager_id") String managerId);
@AutoSql(type = SqlType.DELETE)
void clearLogsOfReport(@Param("record_id") String recordId);

@ -23,7 +23,7 @@ public class PartnerQuery {
private String sub_merchant_id;
private String org_id;
private String org_ids;
private Integer bd;
private String bd;
private String business_structure;
private String industry;
private Integer clean_day;
@ -243,14 +243,6 @@ public class PartnerQuery {
this.org_id = org_id;
}
public Integer getBd() {
return bd;
}
public void setBd(Integer bd) {
this.bd = bd;
}
public void setOnlyMe(boolean onlyMe) {
this.onlyMe = onlyMe;
}
@ -452,4 +444,8 @@ public class PartnerQuery {
public void setOrg_ids(String org_ids) {
this.org_ids = org_ids;
}
public void setBd(String bd) {
this.bd = bd;
}
}

Loading…
Cancel
Save