Commit e1e565ac by yao.xiao

Merge branch 'dev_20201104_CommissionCheck' of…

Merge branch 'dev_20201104_CommissionCheck' of http://139.224.139.2:9091/AGSH/yd-backend into dev_20201104_CommissionCheck
parents a73f6a8f 735cc3e8
...@@ -672,7 +672,7 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService { ...@@ -672,7 +672,7 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
poOrderDALService.update(poOrder); poOrderDALService.update(poOrder);
//财富此订单对应的财富 //财富此订单对应的财富
List<AclCustomerFortune> fortunes = agmsFortuneDalService.findByOrderId(orderId); List<AclCustomerFortune> fortunes = customerFortuneDalService.findByOrderId(orderId);
for (AclCustomerFortune fortune : fortunes){ for (AclCustomerFortune fortune : fortunes){
//查询财富对应的customer的statistic //查询财富对应的customer的statistic
AclCustomerFortuneStatistic statistic = customerFortuneStatisticDalService.findByCustomerId(fortune.getCustomerId()); AclCustomerFortuneStatistic statistic = customerFortuneStatisticDalService.findByCustomerId(fortune.getCustomerId());
......
...@@ -12,7 +12,6 @@ import com.yd.dal.entity.commission.OrderCommissonCheck; ...@@ -12,7 +12,6 @@ import com.yd.dal.entity.commission.OrderCommissonCheck;
import com.yd.dal.entity.customer.AclCustomerFortune; import com.yd.dal.entity.customer.AclCustomerFortune;
import com.yd.dal.entity.order.PoOrder; import com.yd.dal.entity.order.PoOrder;
import com.yd.dal.mapper.lifecommission.LifeCommissionMapper; import com.yd.dal.mapper.lifecommission.LifeCommissionMapper;
import com.yd.dal.service.agms.AgmsFortuneDALService;
import com.yd.dal.service.customer.AclCustomerFortuneDALService; import com.yd.dal.service.customer.AclCustomerFortuneDALService;
import com.yd.dal.service.order.PoOrderDALService; import com.yd.dal.service.order.PoOrderDALService;
import com.yd.util.CommonUtil; import com.yd.util.CommonUtil;
...@@ -31,8 +30,6 @@ public class LifeCommissionServiceImpl implements LifeCommissionService { ...@@ -31,8 +30,6 @@ public class LifeCommissionServiceImpl implements LifeCommissionService {
@Autowired @Autowired
private LifeCommissionMapper lifeCommissionMapper; private LifeCommissionMapper lifeCommissionMapper;
@Autowired @Autowired
private AgmsFortuneDALService agmsFortuneDALService;
@Autowired
private AclCustomerFortuneDALService customerFortuneDalService; private AclCustomerFortuneDALService customerFortuneDalService;
@Autowired @Autowired
private AgmsFortuneService agmsFortuneService; private AgmsFortuneService agmsFortuneService;
...@@ -109,7 +106,7 @@ public class LifeCommissionServiceImpl implements LifeCommissionService { ...@@ -109,7 +106,7 @@ public class LifeCommissionServiceImpl implements LifeCommissionService {
// 查询对应订单记录 // 查询对应订单记录
List<PoOrder> orders = poOrderDALService.findByIds(orderIds); List<PoOrder> orders = poOrderDALService.findByIds(orderIds);
// 查询保单下的所有寿险经纪人的fortune记录 // 查询保单下的所有寿险经纪人的fortune记录
List<AclCustomerFortune> fortuneList = agmsFortuneDALService.queryLifeFortuneListByOrderIds(orderIds); List<AclCustomerFortune> fortuneList = customerFortuneDalService.queryLifeFortuneListByOrderIds(orderIds);
// 校验数据,若订单下存在已发放的财富记录,则该笔订单来佣比对状态不能改为待来佣 // 校验数据,若订单下存在已发放的财富记录,则该笔订单来佣比对状态不能改为待来佣
this.validateRollBackOrders(orders, fortuneList); this.validateRollBackOrders(orders, fortuneList);
...@@ -163,7 +160,7 @@ public class LifeCommissionServiceImpl implements LifeCommissionService { ...@@ -163,7 +160,7 @@ public class LifeCommissionServiceImpl implements LifeCommissionService {
// 设置order记录的CommissionCheckId // 设置order记录的CommissionCheckId
this.setOrderCommissionCheckId(orderIds, status, checkBatchId, loginId); this.setOrderCommissionCheckId(orderIds, status, checkBatchId, loginId);
// 查询保单下的所有寿险经纪人的fortune记录 // 查询保单下的所有寿险经纪人的fortune记录
List<AclCustomerFortune> fortuneList = agmsFortuneDALService.queryLifeFortuneListByOrderIds(orderIds); List<AclCustomerFortune> fortuneList = customerFortuneDalService.queryLifeFortuneListByOrderIds(orderIds);
if (fortuneList.size() == 0) { if (fortuneList.size() == 0) {
return; return;
} }
...@@ -171,7 +168,7 @@ public class LifeCommissionServiceImpl implements LifeCommissionService { ...@@ -171,7 +168,7 @@ public class LifeCommissionServiceImpl implements LifeCommissionService {
fortuneList.forEach(f -> { fortuneList.forEach(f -> {
f.setCommissionPayoutStatus("2"); f.setCommissionPayoutStatus("2");
f.setCommissionPayoutAt(new Date()); f.setCommissionPayoutAt(new Date());
f.setCommissionPayoutBy(Long.getLong(loginId)); f.setCommissionPayoutBy(Long.valueOf(loginId));
}); });
customerFortuneDalService.updateBatch(fortuneList); customerFortuneDalService.updateBatch(fortuneList);
// 初始化withdraw和pay // 初始化withdraw和pay
......
...@@ -38,8 +38,4 @@ public interface AgmsFortuneMapper { ...@@ -38,8 +38,4 @@ public interface AgmsFortuneMapper {
*/ */
List<WithdrawLabelInfo> transformForWithdrawLabel(@Param("item")WithdrawQueryInfo info); List<WithdrawLabelInfo> transformForWithdrawLabel(@Param("item")WithdrawQueryInfo info);
List<AclCustomerFortune> queryLifeFortuneListByOrderIds(List<Long> orderIds);
List<AclCustomerFortune> findByOrderId(@Param("orderId")Long orderId);
} }
package com.yd.dal.mapper.customer; package com.yd.dal.mapper.customer;
import com.yd.api.practitioner.vo.rank.AclCustomerFortuneStatistics;import com.yd.dal.entity.customer.AclCustomerFortune; import com.yd.api.practitioner.vo.rank.AclCustomerFortuneStatistics;
import com.yd.dal.entity.customer.AclCustomerFortune;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -28,4 +29,8 @@ public interface AclCustomerFortuneMapper { ...@@ -28,4 +29,8 @@ public interface AclCustomerFortuneMapper {
List<AclCustomerFortune> findByIds(Long[] fortuneIds); List<AclCustomerFortune> findByIds(Long[] fortuneIds);
List<AclCustomerFortune> findByWithdrawIds(List<Long> withdrawUpdateIds); List<AclCustomerFortune> findByWithdrawIds(List<Long> withdrawUpdateIds);
List<AclCustomerFortune> queryLifeFortuneListByOrderIds(List<Long> orderIds);
List<AclCustomerFortune> findByOrderId(Long orderId);
} }
\ No newline at end of file
...@@ -28,10 +28,6 @@ public interface AgmsFortuneDALService { ...@@ -28,10 +28,6 @@ public interface AgmsFortuneDALService {
*/ */
List<CommissionPayoutStatus> commissionPayoutStatusQuery(CommissionPayoutStatusQueryInfo requestVO); List<CommissionPayoutStatus> commissionPayoutStatusQuery(CommissionPayoutStatusQueryInfo requestVO);
List<AclCustomerFortune> queryLifeFortuneListByOrderIds(List<Long> orderIds);
List<AclCustomerFortune> findByOrderId(Long orderId);
/** /**
* 通过customerId和payId查询fortune记录 * 通过customerId和payId查询fortune记录
* @param payId payId * @param payId payId
......
package com.yd.dal.service.agms.impl; package com.yd.dal.service.agms.impl;
import com.yd.dal.entity.agms.fortune.*; import com.yd.dal.entity.agms.fortune.*;
import com.yd.dal.entity.customer.AclCustomerFortune;
import com.yd.dal.mapper.agms.AgmsFortuneMapper; import com.yd.dal.mapper.agms.AgmsFortuneMapper;
import com.yd.dal.service.agms.AgmsFortuneDALService; import com.yd.dal.service.agms.AgmsFortuneDALService;
import com.yd.util.deshandler.DESTypeHandler; import com.yd.util.deshandler.DESTypeHandler;
...@@ -53,16 +52,6 @@ public class AgmsFortuneDALServiceImpl implements AgmsFortuneDALService { ...@@ -53,16 +52,6 @@ public class AgmsFortuneDALServiceImpl implements AgmsFortuneDALService {
} }
@Override @Override
public List<AclCustomerFortune> queryLifeFortuneListByOrderIds(List<Long> orderIds) {
return agmsFortuneMapper.queryLifeFortuneListByOrderIds(orderIds);
}
@Override
public List<AclCustomerFortune> findByOrderId(Long orderId) {
return agmsFortuneMapper.findByOrderId(orderId);
}
@Override
public List<FortunePayToOrderInfo> fortunePayToOrder( Long[] payIds) { public List<FortunePayToOrderInfo> fortunePayToOrder( Long[] payIds) {
DESTypeHandler desTypeHandler = new DESTypeHandler(); DESTypeHandler desTypeHandler = new DESTypeHandler();
List<FortunePayToOrderInfo> fortunePayToOrderInfos = agmsFortuneMapper.fortunePayToOrder(payIds); List<FortunePayToOrderInfo> fortunePayToOrderInfos = agmsFortuneMapper.fortunePayToOrder(payIds);
......
...@@ -21,4 +21,8 @@ public interface AclCustomerFortuneDALService { ...@@ -21,4 +21,8 @@ public interface AclCustomerFortuneDALService {
void save(AclCustomerFortune fortuneNew); void save(AclCustomerFortune fortuneNew);
List<AclCustomerFortune> queryLifeFortuneListByOrderIds(List<Long> orderIds);
List<AclCustomerFortune> findByOrderId(Long orderId);
} }
...@@ -39,4 +39,14 @@ public class AclCustomerFortuneDALServiceImpl implements AclCustomerFortuneDALSe ...@@ -39,4 +39,14 @@ public class AclCustomerFortuneDALServiceImpl implements AclCustomerFortuneDALSe
public void save(AclCustomerFortune fortuneNew) { public void save(AclCustomerFortune fortuneNew) {
aclCustomerFortuneMapper.insert(fortuneNew); aclCustomerFortuneMapper.insert(fortuneNew);
} }
@Override
public List<AclCustomerFortune> queryLifeFortuneListByOrderIds(List<Long> orderIds) {
return aclCustomerFortuneMapper.queryLifeFortuneListByOrderIds(orderIds);
}
@Override
public List<AclCustomerFortune> findByOrderId(Long orderId) {
return aclCustomerFortuneMapper.findByOrderId(orderId);
}
} }
...@@ -192,24 +192,4 @@ ...@@ -192,24 +192,4 @@
group by pay.id group by pay.id
</select> </select>
<select id="queryLifeFortuneListByOrderIds" resultType="com.yd.dal.entity.customer.AclCustomerFortune">
select f.*
from ag_acl_customer_fortune f
left join (select p.customer_id, s.practitioner_type_id from ag_acl_practitioner p left join ag_acl_practitioner_setting s on p.id = s.practitioner_id) p
on f.customer_id = p.customer_id
where 1=1
and p.practitioner_type_id = 28
and f.order_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="findByOrderId" resultType="com.yd.dal.entity.customer.AclCustomerFortune">
select f.*
from ag_acl_customer_fortune f
left join ag_po_order o on o.id = f.order_id
where f.order_id = #{orderId}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -882,4 +882,26 @@ ...@@ -882,4 +882,26 @@
#{item} #{item}
</foreach> </foreach>
</select> </select>
<select id="queryLifeFortuneListByOrderIds" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_acl_customer_fortune f
left join (select p.customer_id p_customer_id, s.practitioner_type_id from ag_acl_practitioner p left join ag_acl_practitioner_setting s on p.id = s.practitioner_id) p
on f.customer_id = p.p_customer_id
where 1=1
and p.practitioner_type_id = 28
and f.order_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="findByOrderId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_acl_customer_fortune f
where f.order_id = #{orderId}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
plan_id, insurer_id, order_date, commission_check_at plan_id, insurer_id, order_date, commission_check_at
from ag_po_order t from ag_po_order t
where t.status in (3,4) and policy_no is not null where t.status in (3,4) and policy_no is not null
and t.plan_id not in (424,453,464) and (t.plan_id not in (424,453,464) or t.plan_id is not null)
) o ) o
left join ag_po_order_commission_check c on o.commission_check_id = c.id left join ag_po_order_commission_check c on o.commission_check_id = c.id
left join (select p.id, p.name, pc.name categoryName left join (select p.id, p.name, pc.name categoryName
......
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