Commit cbf748b0 by yao.xiao

增加-销售业绩预测

parent fb188029
......@@ -18,8 +18,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@Controller
@RestController
@RequestMapping("/practitioner")
......@@ -291,7 +289,7 @@ public class PractitionerController {
}
/**
* 队员销售活动量
* 队员销售活动量列表
* @param requestVO 请求数据
* @return 响应数据
*/
......@@ -303,4 +301,18 @@ public class PractitionerController {
result.setData(responseVO);
return result;
}
/**
* 销售业绩预测 保费/佣金/件数 月季年
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping("/salesPerformanceForecastListQuery")
public Object salesPerformanceForecastListQuery(@RequestBody SalesPerformanceForecastListQueryRequestVO requestVO){
JsonResult result = new JsonResult();
SalesPerformanceForecastListQueryResponseVO responseVO = practitionerService.salesPerformanceForecastListQuery(requestVO);
result.addResult(responseVO);
result.setData(responseVO);
return result;
}
}
......@@ -152,4 +152,11 @@ public interface PractitionerService {
* @return
*/
PlayerSalesActivityQueryResponseVO playerSalesActivityQuery(PlayerSalesActivityQueryRequestVO requestVO);
/**
* 销售业绩预测 保费/佣金/件数 月季年
* @param requestVO
* @return
*/
SalesPerformanceForecastListQueryResponseVO salesPerformanceForecastListQuery(SalesPerformanceForecastListQueryRequestVO requestVO);
}
package com.yd.api.practitioner.vo.opportunity;
import lombok.Data;
@Data
public class SalesPerformanceForecastInfo {
private Long practitionerId;
private String name;
/**
* 件数
*/
private Integer pieces;
/**
* 保费
*/
private Double premium;
/**
* 佣金
*/
private Double commission;
/**
* 完成率
*/
private Double achievementRate;
}
package com.yd.api.practitioner.vo.opportunity;
import lombok.Data;
@Data
public class SalesPerformanceForecastListQueryRequestVO {
private Long practitionerId;
private String time; //M月 Q季 Y年
}
package com.yd.api.practitioner.vo.opportunity;
import com.yd.api.result.CommonResult;
import lombok.Data;
import java.util.List;
@Data
public class SalesPerformanceForecastListQueryResponseVO {
private List<SalesPerformanceForecastInfo> salesPerformanceForecastInfos;
private CommonResult commonResult;
}
......@@ -27,4 +27,6 @@ public interface MktLeadsAssignedsMapper {
Integer countPractitionerIdsAndThisWeek(List<Long> practitionerIds);
HashMap<String, BigDecimal> performanceForecastForTeam(@Param("practitionerIds") List<Long> practitionerIds,@Param("refusedId") Long refusedId);
List<MktLeadsAssigneds> selectByPractitionerIdRemoveRefused(@Param("practitionerIds")List<Long> practitionerIds,@Param("dropOptionsId") Long dropOptionsId);
}
\ No newline at end of file
......@@ -18,4 +18,6 @@ public interface MktLeadsGoalsMapper {
void updateIsActiveIsNull(@Param("practitionerId") Long practitionerId, @Param("year") Integer year, @Param("goalsType") Integer goalsType);
List<MktLeadsGoals> selectByMktLeadsGoals(MktLeadsGoals mktLeadsGoals);
List<MktLeadsGoals> selectByPractitionerIds(@Param("practitionerIds") List<Long> practitionerIds,@Param("year") Integer year);
}
\ No newline at end of file
......@@ -49,4 +49,9 @@ public class MktLeadsAssignedsDALServiceImpl implements MktLeadsAssignedsDALServ
public HashMap<String, BigDecimal> performanceForecastForTeam(List<Long> practitionerIds,Long refusedId) {
return mktLeadsAssignedsMapper.performanceForecastForTeam(practitionerIds,refusedId);
}
@Override
public List<MktLeadsAssigneds> selectByPractitionerIdRemoveRefused(List<Long> practitionerIds, Long dropOptionsId) {
return mktLeadsAssignedsMapper.selectByPractitionerIdRemoveRefused( practitionerIds, dropOptionsId);
}
}
......@@ -31,4 +31,9 @@ public class MktLeadsGoalsDALServiceImpl implements MktLeadsGoalsDALService {
return mktLeadsGoalsMapper.selectByMktLeadsGoals(mktLeadsGoals);
}
@Override
public List<MktLeadsGoals> selectByPractitionerIds(List<Long> practitionerIds, int year) {
return mktLeadsGoalsMapper.selectByPractitionerIds( practitionerIds, year);
}
}
......@@ -27,4 +27,12 @@ public interface MktLeadsAssignedsDALService {
* ag_mkt_leads_assigned_track跟进记录不可有"拒绝" md_drop_option_id = 102 (传入)
*/
HashMap<String, BigDecimal> performanceForecastForTeam(List<Long> practitionerIds,Long refusedId);
/**
* 查询该团队所有商机指派,排除以失败的
* @param practitionerIds
* @param dropOptionsId
* @return
*/
List<MktLeadsAssigneds> selectByPractitionerIdRemoveRefused(List<Long> practitionerIds, Long dropOptionsId);
}
......@@ -13,4 +13,5 @@ public interface MktLeadsGoalsDALService {
List<MktLeadsGoals> findByMktLeadsGoals(MktLeadsGoals mktLeadsGoals);
List<MktLeadsGoals> selectByPractitionerIds(List<Long> practitionerIds, int year);
}
......@@ -30,4 +30,5 @@
830015=每天同一个跟进状态只能对一个商机经行一次增加!
830016=您不是团队长,无法进行编辑保存
830017=您不是团队长,无法进行查看
830018=您暂无团队,无法设置
900003=保险公司响应报文为空!
\ No newline at end of file
......@@ -279,4 +279,17 @@
</foreach>
and a.id = t.leads_assigned_id)
</select>
<select id="selectByPractitionerIdRemoveRefused" resultMap="BaseResultMap">
select *
from ag_mkt_leads_assigneds a
where a.assigned_practitioner_id in
<foreach collection="practitionerIds" item="practitionerId" index="index" open="(" close=")" separator=",">
#{practitionerId,jdbcType=BIGINT}
</foreach>
and not EXISTS (select t.leads_assigned_id
from ag_mkt_leads_assigned_track t
where t.md_drop_option_id = #{dropOptionsId,jdbcType=BIGINT}
and t.practitioner_id = a.id
and a.id = t.leads_assigned_id);
</select>
</mapper>
\ No newline at end of file
......@@ -315,4 +315,16 @@
</if>
</where>
</select>
<select id="selectByPractitionerIds" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_mkt_leads_goals
where practitioner_id in
<foreach collection="practitionerIds" item="practitionerId" index="index" open="(" close=")" separator=",">
#{practitionerId,jdbcType=BIGINT}
</foreach>
and is_active = 1
and current_year = #{year,jdbcType=INTEGER}
and goals_type = 1
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment