Commit 35b2784e by yao.xiao

关账接口

parent f6a2832c
...@@ -116,8 +116,8 @@ public class AgmsController { ...@@ -116,8 +116,8 @@ public class AgmsController {
/** /**
* AGMS -- 商机统计报表 * AGMS -- 商机统计报表
* @param requestVO * @param requestVO requestVO
* @return * @return 响应数据
*/ */
@RequestMapping(value="/leadsStatistics") @RequestMapping(value="/leadsStatistics")
public Object leadsStatistics(@RequestBody LeadsStatisticsRequestVO requestVO,HttpServletResponse response) { public Object leadsStatistics(@RequestBody LeadsStatisticsRequestVO requestVO,HttpServletResponse response) {
...@@ -148,7 +148,7 @@ public class AgmsController { ...@@ -148,7 +148,7 @@ public class AgmsController {
* @return 响应数据 * @return 响应数据
*/ */
@RequestMapping(value="/commissionPayoutStatusQuery") @RequestMapping(value="/commissionPayoutStatusQuery")
public Object commissionPayoutStatusQuery(@RequestBody CommissionPayoutStatusQueryRequestVO requestVO) throws InvocationTargetException, IllegalAccessException { public Object commissionPayoutStatusQuery(@RequestBody CommissionPayoutStatusQueryRequestVO requestVO){
JsonResult result = new JsonResult(); JsonResult result = new JsonResult();
CommissionPayoutStatusQueryResponseVO responseVO = agmsFortuneService.commissionPayoutStatusQuery(requestVO); CommissionPayoutStatusQueryResponseVO responseVO = agmsFortuneService.commissionPayoutStatusQuery(requestVO);
result.setData(responseVO); result.setData(responseVO);
...@@ -162,7 +162,7 @@ public class AgmsController { ...@@ -162,7 +162,7 @@ public class AgmsController {
* @return 响应数据 * @return 响应数据
*/ */
@RequestMapping("/withdrawQuery") @RequestMapping("/withdrawQuery")
public Object withdrawQuery(@RequestBody WithdrawQueryRequestVO requestVO) throws InvocationTargetException, IllegalAccessException { public Object withdrawQuery(@RequestBody WithdrawQueryRequestVO requestVO){
JsonResult result = new JsonResult(); JsonResult result = new JsonResult();
WithdrawQueryResponseVO withdrawQueryResponseVO = agmsFortuneService.withdrawQuery(requestVO); WithdrawQueryResponseVO withdrawQueryResponseVO = agmsFortuneService.withdrawQuery(requestVO);
result.addResult(withdrawQueryResponseVO); result.addResult(withdrawQueryResponseVO);
...@@ -184,4 +184,17 @@ public class AgmsController { ...@@ -184,4 +184,17 @@ public class AgmsController {
return result; return result;
} }
/**
* AGMS -- 财富批量支付
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping(value="/fortunePay")
public Object fortunePay(@RequestBody FortunePayRequestVO requestVO) {
JsonResult result = new JsonResult();
FortunePayResponseVO responseVO = agmsFortuneService.fortunePay(requestVO);
result.setData(responseVO);
result.addResult(responseVO);
return result;
}
} }
...@@ -22,14 +22,14 @@ public interface AgmsFortuneService { ...@@ -22,14 +22,14 @@ public interface AgmsFortuneService {
* @throws InvocationTargetException InvocationTargetException * @throws InvocationTargetException InvocationTargetException
* @throws IllegalAccessException IllegalAccessException * @throws IllegalAccessException IllegalAccessException
*/ */
CommissionPayoutStatusQueryResponseVO commissionPayoutStatusQuery(CommissionPayoutStatusQueryRequestVO requestVO) throws InvocationTargetException, IllegalAccessException; CommissionPayoutStatusQueryResponseVO commissionPayoutStatusQuery(CommissionPayoutStatusQueryRequestVO requestVO);
/** /**
* AGMS -- 支付列表查询 * AGMS -- 支付列表查询
* @param requestVO 请求数据 * @param requestVO 请求数据
* @return 响应数据 * @return 响应数据
*/ */
WithdrawQueryResponseVO withdrawQuery(WithdrawQueryRequestVO requestVO) throws InvocationTargetException, IllegalAccessException ; WithdrawQueryResponseVO withdrawQuery(WithdrawQueryRequestVO requestVO);
/** /**
* AGMS -- 提现财富对应订单查询 * AGMS -- 提现财富对应订单查询
...@@ -37,4 +37,11 @@ public interface AgmsFortuneService { ...@@ -37,4 +37,11 @@ public interface AgmsFortuneService {
* @return 响应数据 * @return 响应数据
*/ */
FortunePayToOrderResponseVO fortunePayToOrder(FortunePayToOrderRequestVO requestVO); FortunePayToOrderResponseVO fortunePayToOrder(FortunePayToOrderRequestVO requestVO);
/**
* AGMS -- 财富批量支付
* @param requestVO 请求数据
* @return 响应数据
*/
FortunePayResponseVO fortunePay(FortunePayRequestVO requestVO);
} }
...@@ -4,22 +4,21 @@ import com.yd.api.agms.service.AgmsFortuneService; ...@@ -4,22 +4,21 @@ import com.yd.api.agms.service.AgmsFortuneService;
import com.yd.api.agms.vo.fortune.*; import com.yd.api.agms.vo.fortune.*;
import com.yd.api.result.CommonResult; import com.yd.api.result.CommonResult;
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.entity.customer.*;
import com.yd.dal.entity.customer.AclCustomerFortunePay;
import com.yd.dal.entity.customer.AclCustomerFortunePayoutBatch;
import com.yd.dal.entity.customer.AclCustomerFortuneWithdraw;
import com.yd.dal.entity.meta.MdIncometaxRate; import com.yd.dal.entity.meta.MdIncometaxRate;
import com.yd.dal.entity.user.AclUser;
import com.yd.dal.service.agms.AgmsFortuneDALService; import com.yd.dal.service.agms.AgmsFortuneDALService;
import com.yd.dal.service.customer.AclCustomerFortuneDALService; import com.yd.dal.service.customer.*;
import com.yd.dal.service.customer.AclCustomerFortunePayDALService; import com.yd.dal.service.user.AclUserDALService;
import com.yd.dal.service.customer.AclCustomerFortunePayoutBatchDALService;
import com.yd.dal.service.customer.AclCustomerFortuneWithdrawDALService;
import com.yd.rmi.cache.SystemConfigService; import com.yd.rmi.cache.SystemConfigService;
import com.yd.util.CommonUtil; import com.yd.util.CommonUtil;
import com.yd.util.config.ZHBErrorConfig; import com.yd.util.config.ZHBErrorConfig;
import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.beanutils.BeanPropertyValueEqualsPredicate;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
...@@ -38,6 +37,8 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService { ...@@ -38,6 +37,8 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
private AgmsFortuneDALService agmsFortuneDalService; private AgmsFortuneDALService agmsFortuneDalService;
private SystemConfigService systemConfigService; private SystemConfigService systemConfigService;
private AclCustomerFortunePayoutBatchDALService customerFortunePayoutBatchDalService; private AclCustomerFortunePayoutBatchDALService customerFortunePayoutBatchDalService;
private AclCustomerFortuneStatisticDALService customerFortuneStatisticDalService;
private AclUserDALService userDalService;
@Autowired @Autowired
public void setAclCustomerFortuneDalService(AclCustomerFortuneDALService customerFortuneDalService) { public void setAclCustomerFortuneDalService(AclCustomerFortuneDALService customerFortuneDalService) {
this.customerFortuneDalService = customerFortuneDalService; this.customerFortuneDalService = customerFortuneDalService;
...@@ -67,6 +68,15 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService { ...@@ -67,6 +68,15 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
this.customerFortunePayoutBatchDalService = customerFortunePayoutBatchDalService; this.customerFortunePayoutBatchDalService = customerFortunePayoutBatchDalService;
} }
@Autowired
public void setAclUserDALService(AclUserDALService userDalService){
this.userDalService = userDalService;
}
@Autowired
public void setAclCustomerFortuneStatisticDALService(AclCustomerFortuneStatisticDALService customerFortuneStatisticDalService){
this.customerFortuneStatisticDalService = customerFortuneStatisticDalService;
}
@Override @Override
public CommissionPayoutStatusUpdateResponseVO commissionPayoutStatusUpdate(CommissionPayoutStatusUpdateRequestVO requestVO) { public CommissionPayoutStatusUpdateResponseVO commissionPayoutStatusUpdate(CommissionPayoutStatusUpdateRequestVO requestVO) {
CommissionPayoutStatusUpdateResponseVO responseVO = new CommissionPayoutStatusUpdateResponseVO(); CommissionPayoutStatusUpdateResponseVO responseVO = new CommissionPayoutStatusUpdateResponseVO();
...@@ -389,6 +399,8 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService { ...@@ -389,6 +399,8 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
pay.setCustomerName(customerFortuneStatisticalInfo.getCustomerName()); pay.setCustomerName(customerFortuneStatisticalInfo.getCustomerName());
pay.setPaidMethod(1); pay.setPaidMethod(1);
pay.setPayStatus(0); pay.setPayStatus(0);
pay.setPayAmount(paidAmount);
pay.setTaxAmount(taxAmount);
pay.setCreatedAt(new Date()); pay.setCreatedAt(new Date());
pay.setCreatedBy(loginId); pay.setCreatedBy(loginId);
pay.setUpdatedAt(new Date()); pay.setUpdatedAt(new Date());
...@@ -477,10 +489,10 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService { ...@@ -477,10 +489,10 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
@Override @Override
public CommissionPayoutStatusQueryResponseVO commissionPayoutStatusQuery(CommissionPayoutStatusQueryRequestVO requestVO) throws InvocationTargetException, IllegalAccessException { public CommissionPayoutStatusQueryResponseVO commissionPayoutStatusQuery(CommissionPayoutStatusQueryRequestVO requestVO){
CommissionPayoutStatusQueryResponseVO responseVO = new CommissionPayoutStatusQueryResponseVO(); CommissionPayoutStatusQueryResponseVO responseVO = new CommissionPayoutStatusQueryResponseVO();
CommissionPayoutStatusQueryInfo info = new CommissionPayoutStatusQueryInfo(); CommissionPayoutStatusQueryInfo info = new CommissionPayoutStatusQueryInfo();
BeanUtils.copyProperties(info,requestVO); BeanUtils.copyProperties(requestVO,info);
List<CommissionPayoutStatus> commissionPayoutStatusList = agmsFortuneDalService.commissionPayoutStatusQuery(info); List<CommissionPayoutStatus> commissionPayoutStatusList = agmsFortuneDalService.commissionPayoutStatusQuery(info);
responseVO.setTotalSingular(commissionPayoutStatusList.size()); responseVO.setTotalSingular(commissionPayoutStatusList.size());
BigDecimal totalOrderPrice = commissionPayoutStatusList.stream() BigDecimal totalOrderPrice = commissionPayoutStatusList.stream()
...@@ -497,10 +509,10 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService { ...@@ -497,10 +509,10 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
} }
@Override @Override
public WithdrawQueryResponseVO withdrawQuery(WithdrawQueryRequestVO requestVO) throws InvocationTargetException, IllegalAccessException { public WithdrawQueryResponseVO withdrawQuery(WithdrawQueryRequestVO requestVO){
WithdrawQueryResponseVO responseVO = new WithdrawQueryResponseVO(); WithdrawQueryResponseVO responseVO = new WithdrawQueryResponseVO();
WithdrawQueryInfo info = new WithdrawQueryInfo(); WithdrawQueryInfo info = new WithdrawQueryInfo();
BeanUtils.copyProperties(info,requestVO); BeanUtils.copyProperties(requestVO,info);
List<WithdrawLabelInfo> withdraws = agmsFortuneDalService.transformForWithdrawLabel(info); List<WithdrawLabelInfo> withdraws = agmsFortuneDalService.transformForWithdrawLabel(info);
responseVO.setTotalPeople(withdraws.size()); responseVO.setTotalPeople(withdraws.size());
BigDecimal totalReferralAmount = withdraws.stream() BigDecimal totalReferralAmount = withdraws.stream()
...@@ -519,13 +531,13 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService { ...@@ -519,13 +531,13 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
Long payId = requestVO.getPayId(); Long payId = requestVO.getPayId();
//查询所有订单,并根据支付id标记本次提现订单 //查询所有订单,并根据支付id标记本次提现订单
List<FortunePayToOrderInfo> fortunePayToOrderInfos = agmsFortuneDalService.fortunePayToOrder(customerId,payId); List<FortunePayToOrderInfo> fortunePayToOrderInfos = agmsFortuneDalService.fortunePayToOrder(customerId,payId);
responseVO.setTotalSingular(fortunePayToOrderInfos.size());
BigDecimal totalOrderPrice = fortunePayToOrderInfos.stream() BigDecimal totalOrderPrice = fortunePayToOrderInfos.stream()
.map(f -> f.getOrderPrice() == null ? BigDecimal.ZERO : f.getOrderPrice()) .map(f -> f.getOrderPrice() == null ? BigDecimal.ZERO : f.getOrderPrice())
.reduce(BigDecimal.ZERO,BigDecimal::add); .reduce(BigDecimal.ZERO,BigDecimal::add);
BigDecimal totalReferralAmount = fortunePayToOrderInfos.stream() BigDecimal totalReferralAmount = fortunePayToOrderInfos.stream()
.map(f -> f.getReferralAmount() == null ? BigDecimal.ZERO : f.getReferralAmount()) .map(f -> f.getReferralAmount() == null ? BigDecimal.ZERO : f.getReferralAmount())
.reduce(BigDecimal.ZERO,BigDecimal::add); .reduce(BigDecimal.ZERO,BigDecimal::add);
responseVO.setTotalSingular(fortunePayToOrderInfos.size());
responseVO.setTotalOrderPrice(totalOrderPrice); responseVO.setTotalOrderPrice(totalOrderPrice);
responseVO.setTotalReferralAmount(totalReferralAmount); responseVO.setTotalReferralAmount(totalReferralAmount);
responseVO.setFortunePayToOrderInfos(fortunePayToOrderInfos); responseVO.setFortunePayToOrderInfos(fortunePayToOrderInfos);
...@@ -533,4 +545,78 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService { ...@@ -533,4 +545,78 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
return responseVO; return responseVO;
} }
@Override
@Transactional(rollbackFor = Exception.class)
public FortunePayResponseVO fortunePay(FortunePayRequestVO requestVO) {
FortunePayResponseVO responseVO = new FortunePayResponseVO();
CommonResult commonResult = check(requestVO);
Long[] payIds = requestVO.getPayIds();
Long loginId = requestVO.getLoginId();
AclUser user = userDalService.selectByPrimaryKey(loginId);
//查询所有pay记录和withdraw记录
List<AclCustomerFortunePay> customerFortunePays = customerFortunePayDalService.findByIds(payIds);
Long[] withdrawIds = new Long[customerFortunePays.size()];
for(int i = 0; i <= customerFortunePays.size();i++){
withdrawIds[i] = customerFortunePays.get(i).getWithdrawId();
}
List<AclCustomerFortuneWithdraw> customerFortuneWithdraws = customerFortuneWithdrawDalService.findByIds(Arrays.asList(withdrawIds));
//查询经纪人的静态记录
Long[] customerIds = new Long[customerFortunePays.size()];
for(int i = 0; i <= customerFortunePays.size();i++){
customerIds[i] = customerFortunePays.get(i).getCustomerId();
}
List<AclCustomerFortuneStatistic> customerFortuneStatistics = customerFortuneStatisticDalService.findByCustomerIds(customerIds);
//更新静态表
for (AclCustomerFortuneStatistic statistic: customerFortuneStatistics){
Long customerId = statistic.getCustomerId();
BeanPropertyValueEqualsPredicate predicateClause = new BeanPropertyValueEqualsPredicate( "customerId", customerId);
List<AclCustomerFortuneWithdraw> withdraws = (List<AclCustomerFortuneWithdraw>) CollectionUtils.select(customerFortuneWithdraws,predicateClause);
if (withdraws.isEmpty()){
continue;
}
for (AclCustomerFortuneWithdraw withdraw: withdraws) {
if (CommonUtil.isNullOrZero(withdraw.getIsPaid())){
BigDecimal drawnFortune = statistic.getDrawnFortune();
if (CommonUtil.isNullOrZero(drawnFortune)){
drawnFortune = BigDecimal.ZERO;
}
drawnFortune = drawnFortune.add(withdraw.getWithdrawAmount());
statistic.setDrawnFortune(drawnFortune);
}
}
}
customerFortuneStatisticDalService.updateAll(customerFortuneStatistics);
//修改withdraw记录
customerFortuneWithdraws.forEach(w -> {
w.setIsPaid(1);
w.setPaidDate(new Date());
});
customerFortuneWithdrawDalService.updateAll(customerFortuneWithdraws);
//修改pay表
customerFortunePays.forEach(p -> {
p.setPayStatus(1);
p.setPaidBy(user.getName());
p.setUpdatedAt(new Date());
p.setUpdatedBy(loginId);
});
customerFortunePayDalService.updateAll(customerFortunePays);
responseVO.setCommonResult(commonResult);
return responseVO;
}
private CommonResult check(FortunePayRequestVO requestVO) {
CommonResult commonResult = new CommonResult();
Boolean success = true;
String message = ZHBErrorConfig.getErrorInfo("800000");
Long[] payIds = requestVO.getPayIds();
if (payIds == null || payIds.length == 0){
success = false;
message = ZHBErrorConfig.getErrorInfo("830022");
}
commonResult.setSuccess(success);
commonResult.setMessage(message);
return commonResult;
}
} }
package com.yd.api.agms.vo.fortune;
import lombok.Data;
/**
* @author xxy
*/
@Data
public class FortunePayRequestVO {
private Long[] payIds;
private Long loginId;
}
package com.yd.api.agms.vo.fortune;
import com.yd.api.result.CommonResult;
import lombok.Data;
/**
* @author xxy
*/
@Data
public class FortunePayResponseVO {
private CommonResult commonResult;
}
package com.yd.dal.entity.customer;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;
/**
* 用户财富最终统计结果
*/
@Data
public class AclCustomerFortuneStatistic {
/**
* serial id
*/
private Long id;
/**
* FK ag_acl_customer.id
*/
private Long customerId;
/**
* 历史累积财富
*/
private BigDecimal accumulatedFortune;
/**
* 已提现财富
*/
private BigDecimal drawnFortune;
/**
* 已退保财富
*/
private BigDecimal cancelledFortune;
/**
* 注释或补充
*/
private String remark;
private Date createdAt;
private Long createdBy;
private Date updatedAt;
/**
* 变更者 id
*/
private Long updatedBy;
}
\ No newline at end of file
...@@ -24,4 +24,6 @@ public interface AclCustomerFortunePayMapper { ...@@ -24,4 +24,6 @@ public interface AclCustomerFortunePayMapper {
int batchInsert(@Param("list") List<AclCustomerFortunePay> list); int batchInsert(@Param("list") List<AclCustomerFortunePay> list);
List<AclCustomerFortunePay> findByWithdrawIds(List<Long> withdrawIds); List<AclCustomerFortunePay> findByWithdrawIds(List<Long> withdrawIds);
List<AclCustomerFortunePay> findByIds(Long[] payIds);
} }
\ No newline at end of file
package com.yd.dal.mapper.customer;
import com.yd.dal.entity.customer.AclCustomerFortuneStatistic;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface AclCustomerFortuneStatisticMapper {
int deleteByPrimaryKey(Long id);
int insert(AclCustomerFortuneStatistic record);
int insertSelective(AclCustomerFortuneStatistic record);
AclCustomerFortuneStatistic selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(AclCustomerFortuneStatistic record);
int updateByPrimaryKey(AclCustomerFortuneStatistic record);
int updateBatch(List<AclCustomerFortuneStatistic> list);
int updateBatchSelective(List<AclCustomerFortuneStatistic> list);
int batchInsert(@Param("list") List<AclCustomerFortuneStatistic> list);
List<AclCustomerFortuneStatistic> findByCustomerIds(Long[] customerIds);
}
\ No newline at end of file
...@@ -23,4 +23,11 @@ public interface AclCustomerFortunePayDALService { ...@@ -23,4 +23,11 @@ public interface AclCustomerFortunePayDALService {
void updateAll(List<AclCustomerFortunePay> pays); void updateAll(List<AclCustomerFortunePay> pays);
Long save(AclCustomerFortunePay pay); Long save(AclCustomerFortunePay pay);
/**
* 批量查询
* @param payIds payIds
* @return 列表
*/
List<AclCustomerFortunePay> findByIds(Long[] payIds);
} }
package com.yd.dal.service.customer;
import com.yd.dal.entity.customer.AclCustomerFortuneStatistic;
import java.util.List;
/**
* @author xxy
*/
public interface AclCustomerFortuneStatisticDALService {
/**
* 通过customerIds查询静态表
* @param customerIds customerIds
* @return 列表
*/
List<AclCustomerFortuneStatistic> findByCustomerIds(Long[] customerIds);
void updateAll(List<AclCustomerFortuneStatistic> customerFortuneStatistics);
}
...@@ -31,4 +31,9 @@ public class AclCustomerFortunePayDALServiceImpl implements AclCustomerFortunePa ...@@ -31,4 +31,9 @@ public class AclCustomerFortunePayDALServiceImpl implements AclCustomerFortunePa
public Long save(AclCustomerFortunePay pay) { public Long save(AclCustomerFortunePay pay) {
return (long)customerFortunePayMapper.insert(pay); return (long)customerFortunePayMapper.insert(pay);
} }
@Override
public List<AclCustomerFortunePay> findByIds(Long[] payIds) {
return customerFortunePayMapper.findByIds(payIds);
}
} }
package com.yd.dal.service.customer.impl;
import com.yd.dal.entity.customer.AclCustomerFortuneStatistic;
import com.yd.dal.mapper.customer.AclCustomerFortuneStatisticMapper;
import com.yd.dal.service.customer.AclCustomerFortuneStatisticDALService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author xxy
*/
@Service("aclCustomerFortuneStatisticDALService")
public class AclCustomerFortuneStatisticDALServiceImpl implements AclCustomerFortuneStatisticDALService {
@Autowired
private AclCustomerFortuneStatisticMapper customerFortuneStatisticMapper;
@Override
public List<AclCustomerFortuneStatistic> findByCustomerIds(Long[] customerIds) {
return customerFortuneStatisticMapper.findByCustomerIds(customerIds);
}
@Override
public void updateAll(List<AclCustomerFortuneStatistic> customerFortuneStatistics) {
customerFortuneStatisticMapper.updateBatch(customerFortuneStatistics);
}
}
...@@ -35,4 +35,5 @@ ...@@ -35,4 +35,5 @@
830019=已申请过专家支持!请等待 830019=已申请过专家支持!请等待
830020=活动时间段冲突 830020=活动时间段冲突
830021=请选择发佣日期 830021=请选择发佣日期
830022=请选择关账记录
900003=保险公司响应报文为空! 900003=保险公司响应报文为空!
\ No newline at end of file
...@@ -13,10 +13,10 @@ ...@@ -13,10 +13,10 @@
<result column="campaign_name" jdbcType="VARCHAR" property="campaignName" /> <result column="campaign_name" jdbcType="VARCHAR" property="campaignName" />
<result column="campaing_reward" jdbcType="DECIMAL" property="campaingReward" /> <result column="campaing_reward" jdbcType="DECIMAL" property="campaingReward" />
<result column="pay_to" jdbcType="VARCHAR" property="payTo" /> <result column="pay_to" jdbcType="VARCHAR" property="payTo" />
<result column="pay_to_mobile" jdbcType="VARCHAR" property="payToMobile" /> <result column="pay_to_mobile" jdbcType="VARCHAR" property="payToMobile" typeHandler="com.yd.util.deshandler.DESTypeHandler"/>
<result column="pay_to_wechat" jdbcType="VARCHAR" property="payToWechat" /> <result column="pay_to_wechat" jdbcType="VARCHAR" property="payToWechat" />
<result column="pay_to_id_type_id" jdbcType="BIGINT" property="payToIdTypeId" /> <result column="pay_to_id_type_id" jdbcType="BIGINT" property="payToIdTypeId" />
<result column="pay_to_id_no" jdbcType="VARCHAR" property="payToIdNo" /> <result column="pay_to_id_no" jdbcType="VARCHAR" property="payToIdNo" typeHandler="com.yd.util.deshandler.DESTypeHandler"/>
<result column="pay_to_birthday" jdbcType="DATE" property="payToBirthday" /> <result column="pay_to_birthday" jdbcType="DATE" property="payToBirthday" />
<result column="pay_to_gender" jdbcType="INTEGER" property="payToGender" /> <result column="pay_to_gender" jdbcType="INTEGER" property="payToGender" />
<result column="pay_date" jdbcType="TIMESTAMP" property="payDate" /> <result column="pay_date" jdbcType="TIMESTAMP" property="payDate" />
...@@ -63,8 +63,8 @@ ...@@ -63,8 +63,8 @@
updated_by) updated_by)
values (#{withdrawId,jdbcType=BIGINT}, #{withdrawAmount,jdbcType=DECIMAL}, #{customerId,jdbcType=BIGINT}, values (#{withdrawId,jdbcType=BIGINT}, #{withdrawAmount,jdbcType=DECIMAL}, #{customerId,jdbcType=BIGINT},
#{customerName,jdbcType=VARCHAR}, #{campaignId,jdbcType=BIGINT}, #{campaignName,jdbcType=VARCHAR}, #{customerName,jdbcType=VARCHAR}, #{campaignId,jdbcType=BIGINT}, #{campaignName,jdbcType=VARCHAR},
#{campaingReward,jdbcType=DECIMAL}, #{payTo,jdbcType=VARCHAR}, #{payToMobile,jdbcType=VARCHAR}, #{campaingReward,jdbcType=DECIMAL}, #{payTo,jdbcType=VARCHAR}, #{payToMobile,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler},
#{payToWechat,jdbcType=VARCHAR}, #{payToIdTypeId,jdbcType=BIGINT}, #{payToIdNo,jdbcType=VARCHAR}, #{payToWechat,jdbcType=VARCHAR}, #{payToIdTypeId,jdbcType=BIGINT}, #{payToIdNo,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler},
#{payToBirthday,jdbcType=DATE}, #{payToGender,jdbcType=INTEGER}, #{payDate,jdbcType=TIMESTAMP}, #{payToBirthday,jdbcType=DATE}, #{payToGender,jdbcType=INTEGER}, #{payDate,jdbcType=TIMESTAMP},
#{payAmount,jdbcType=DECIMAL}, #{taxAmount,jdbcType=DECIMAL}, #{paidBy,jdbcType=VARCHAR}, #{payAmount,jdbcType=DECIMAL}, #{taxAmount,jdbcType=DECIMAL}, #{paidBy,jdbcType=VARCHAR},
#{paidMethod,jdbcType=INTEGER}, #{payStatus,jdbcType=INTEGER}, #{remark,jdbcType=LONGVARCHAR}, #{paidMethod,jdbcType=INTEGER}, #{payStatus,jdbcType=INTEGER}, #{remark,jdbcType=LONGVARCHAR},
...@@ -177,7 +177,7 @@ ...@@ -177,7 +177,7 @@
#{payTo,jdbcType=VARCHAR}, #{payTo,jdbcType=VARCHAR},
</if> </if>
<if test="payToMobile != null"> <if test="payToMobile != null">
#{payToMobile,jdbcType=VARCHAR}, #{payToMobile,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler},
</if> </if>
<if test="payToWechat != null"> <if test="payToWechat != null">
#{payToWechat,jdbcType=VARCHAR}, #{payToWechat,jdbcType=VARCHAR},
...@@ -186,7 +186,7 @@ ...@@ -186,7 +186,7 @@
#{payToIdTypeId,jdbcType=BIGINT}, #{payToIdTypeId,jdbcType=BIGINT},
</if> </if>
<if test="payToIdNo != null"> <if test="payToIdNo != null">
#{payToIdNo,jdbcType=VARCHAR}, #{payToIdNo,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler},
</if> </if>
<if test="payToBirthday != null"> <if test="payToBirthday != null">
#{payToBirthday,jdbcType=DATE}, #{payToBirthday,jdbcType=DATE},
...@@ -258,7 +258,7 @@ ...@@ -258,7 +258,7 @@
pay_to = #{payTo,jdbcType=VARCHAR}, pay_to = #{payTo,jdbcType=VARCHAR},
</if> </if>
<if test="payToMobile != null"> <if test="payToMobile != null">
pay_to_mobile = #{payToMobile,jdbcType=VARCHAR}, pay_to_mobile = #{payToMobile,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler},
</if> </if>
<if test="payToWechat != null"> <if test="payToWechat != null">
pay_to_wechat = #{payToWechat,jdbcType=VARCHAR}, pay_to_wechat = #{payToWechat,jdbcType=VARCHAR},
...@@ -267,7 +267,7 @@ ...@@ -267,7 +267,7 @@
pay_to_id_type_id = #{payToIdTypeId,jdbcType=BIGINT}, pay_to_id_type_id = #{payToIdTypeId,jdbcType=BIGINT},
</if> </if>
<if test="payToIdNo != null"> <if test="payToIdNo != null">
pay_to_id_no = #{payToIdNo,jdbcType=VARCHAR}, pay_to_id_no = #{payToIdNo,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler},
</if> </if>
<if test="payToBirthday != null"> <if test="payToBirthday != null">
pay_to_birthday = #{payToBirthday,jdbcType=DATE}, pay_to_birthday = #{payToBirthday,jdbcType=DATE},
...@@ -692,4 +692,14 @@ ...@@ -692,4 +692,14 @@
#{item} #{item}
</foreach> </foreach>
</select> </select>
<select id="findByIds" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_acl_customer_fortune_pay
where id in
<foreach collection="array" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yd.dal.mapper.customer.AclCustomerFortuneStatisticMapper">
<resultMap id="BaseResultMap" type="com.yd.dal.entity.customer.AclCustomerFortuneStatistic">
<!--@mbg.generated-->
<!--@Table ag_acl_customer_fortune_statistic-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="customer_id" jdbcType="BIGINT" property="customerId" />
<result column="accumulated_fortune" jdbcType="DECIMAL" property="accumulatedFortune" />
<result column="drawn_fortune" jdbcType="DECIMAL" property="drawnFortune" />
<result column="cancelled_fortune" jdbcType="DECIMAL" property="cancelledFortune" />
<result column="remark" jdbcType="LONGVARCHAR" property="remark" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="created_by" jdbcType="BIGINT" property="createdBy" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="updated_by" jdbcType="BIGINT" property="updatedBy" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, customer_id, accumulated_fortune, drawn_fortune, cancelled_fortune, remark, created_at,
created_by, updated_at, updated_by
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from ag_acl_customer_fortune_statistic
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<!--@mbg.generated-->
delete from ag_acl_customer_fortune_statistic
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclCustomerFortuneStatistic" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into ag_acl_customer_fortune_statistic (customer_id, accumulated_fortune, drawn_fortune,
cancelled_fortune, remark, created_at,
created_by, updated_at, updated_by
)
values (#{customerId,jdbcType=BIGINT}, #{accumulatedFortune,jdbcType=DECIMAL}, #{drawnFortune,jdbcType=DECIMAL},
#{cancelledFortune,jdbcType=DECIMAL}, #{remark,jdbcType=LONGVARCHAR}, #{createdAt,jdbcType=TIMESTAMP},
#{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclCustomerFortuneStatistic" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into ag_acl_customer_fortune_statistic
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="customerId != null">
customer_id,
</if>
<if test="accumulatedFortune != null">
accumulated_fortune,
</if>
<if test="drawnFortune != null">
drawn_fortune,
</if>
<if test="cancelledFortune != null">
cancelled_fortune,
</if>
<if test="remark != null">
remark,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="createdBy != null">
created_by,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="updatedBy != null">
updated_by,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="customerId != null">
#{customerId,jdbcType=BIGINT},
</if>
<if test="accumulatedFortune != null">
#{accumulatedFortune,jdbcType=DECIMAL},
</if>
<if test="drawnFortune != null">
#{drawnFortune,jdbcType=DECIMAL},
</if>
<if test="cancelledFortune != null">
#{cancelledFortune,jdbcType=DECIMAL},
</if>
<if test="remark != null">
#{remark,jdbcType=LONGVARCHAR},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="createdBy != null">
#{createdBy,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
#{updatedBy,jdbcType=BIGINT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.customer.AclCustomerFortuneStatistic">
<!--@mbg.generated-->
update ag_acl_customer_fortune_statistic
<set>
<if test="customerId != null">
customer_id = #{customerId,jdbcType=BIGINT},
</if>
<if test="accumulatedFortune != null">
accumulated_fortune = #{accumulatedFortune,jdbcType=DECIMAL},
</if>
<if test="drawnFortune != null">
drawn_fortune = #{drawnFortune,jdbcType=DECIMAL},
</if>
<if test="cancelledFortune != null">
cancelled_fortune = #{cancelledFortune,jdbcType=DECIMAL},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=LONGVARCHAR},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="createdBy != null">
created_by = #{createdBy,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
updated_by = #{updatedBy,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.customer.AclCustomerFortuneStatistic">
<!--@mbg.generated-->
update ag_acl_customer_fortune_statistic
set customer_id = #{customerId,jdbcType=BIGINT},
accumulated_fortune = #{accumulatedFortune,jdbcType=DECIMAL},
drawn_fortune = #{drawnFortune,jdbcType=DECIMAL},
cancelled_fortune = #{cancelledFortune,jdbcType=DECIMAL},
remark = #{remark,jdbcType=LONGVARCHAR},
created_at = #{createdAt,jdbcType=TIMESTAMP},
created_by = #{createdBy,jdbcType=BIGINT},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
updated_by = #{updatedBy,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateBatch" parameterType="java.util.List">
<!--@mbg.generated-->
update ag_acl_customer_fortune_statistic
<trim prefix="set" suffixOverrides=",">
<trim prefix="customer_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.customerId,jdbcType=BIGINT}
</foreach>
</trim>
<trim prefix="accumulated_fortune = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.accumulatedFortune,jdbcType=DECIMAL}
</foreach>
</trim>
<trim prefix="drawn_fortune = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.drawnFortune,jdbcType=DECIMAL}
</foreach>
</trim>
<trim prefix="cancelled_fortune = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.cancelledFortune,jdbcType=DECIMAL}
</foreach>
</trim>
<trim prefix="remark = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.remark,jdbcType=LONGVARCHAR}
</foreach>
</trim>
<trim prefix="created_at = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.createdAt,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="created_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.createdBy,jdbcType=BIGINT}
</foreach>
</trim>
<trim prefix="updated_at = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.updatedAt,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="updated_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.updatedBy,jdbcType=BIGINT}
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=BIGINT}
</foreach>
</update>
<update id="updateBatchSelective" parameterType="java.util.List">
<!--@mbg.generated-->
update ag_acl_customer_fortune_statistic
<trim prefix="set" suffixOverrides=",">
<trim prefix="customer_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.customerId != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.customerId,jdbcType=BIGINT}
</if>
</foreach>
</trim>
<trim prefix="accumulated_fortune = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.accumulatedFortune != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.accumulatedFortune,jdbcType=DECIMAL}
</if>
</foreach>
</trim>
<trim prefix="drawn_fortune = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.drawnFortune != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.drawnFortune,jdbcType=DECIMAL}
</if>
</foreach>
</trim>
<trim prefix="cancelled_fortune = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.cancelledFortune != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.cancelledFortune,jdbcType=DECIMAL}
</if>
</foreach>
</trim>
<trim prefix="remark = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.remark != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.remark,jdbcType=LONGVARCHAR}
</if>
</foreach>
</trim>
<trim prefix="created_at = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createdAt != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.createdAt,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="created_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createdBy != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.createdBy,jdbcType=BIGINT}
</if>
</foreach>
</trim>
<trim prefix="updated_at = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updatedAt != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.updatedAt,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="updated_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updatedBy != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.updatedBy,jdbcType=BIGINT}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=BIGINT}
</foreach>
</update>
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into ag_acl_customer_fortune_statistic
(customer_id, accumulated_fortune, drawn_fortune, cancelled_fortune, remark, created_at,
created_by, updated_at, updated_by)
values
<foreach collection="list" item="item" separator=",">
(#{item.customerId,jdbcType=BIGINT}, #{item.accumulatedFortune,jdbcType=DECIMAL},
#{item.drawnFortune,jdbcType=DECIMAL}, #{item.cancelledFortune,jdbcType=DECIMAL},
#{item.remark,jdbcType=LONGVARCHAR}, #{item.createdAt,jdbcType=TIMESTAMP}, #{item.createdBy,jdbcType=BIGINT},
#{item.updatedAt,jdbcType=TIMESTAMP}, #{item.updatedBy,jdbcType=BIGINT})
</foreach>
</insert>
<select id="findByCustomerIds" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_acl_customer_fortune_statistic
where customer_id in
<foreach collection="array" item="item" open="(" separator="," close=")">
#{item,jdbcType=BIGINT}
</foreach>
</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