Commit ce44cef6 by jianan

来佣比对修改比对状态

parent f6a2832c
package com.yd.api.agms.service; package com.yd.api.agms.service;
import com.yd.api.agms.vo.fortune.*; import com.yd.api.agms.vo.fortune.*;
import com.yd.api.order.vo.SurrenderFortuneRequestVO;
import com.yd.api.order.vo.SurrenderFortuneResponseVO;
import com.yd.dal.entity.customer.AclCustomerFortune;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.util.List;
/** /**
* @author xxy * @author xxy
...@@ -37,4 +41,9 @@ public interface AgmsFortuneService { ...@@ -37,4 +41,9 @@ public interface AgmsFortuneService {
* @return 响应数据 * @return 响应数据
*/ */
FortunePayToOrderResponseVO fortunePayToOrder(FortunePayToOrderRequestVO requestVO); FortunePayToOrderResponseVO fortunePayToOrder(FortunePayToOrderRequestVO requestVO);
SurrenderFortuneResponseVO surrenderFortune(SurrenderFortuneRequestVO requestVO);
public void canPaymentUpDate(String paymentStatus, Long payoutBatchId , Long loginId, List<AclCustomerFortune> customerFortunes);
} }
...@@ -2,18 +2,26 @@ package com.yd.api.agms.service.impl; ...@@ -2,18 +2,26 @@ package com.yd.api.agms.service.impl;
import com.yd.api.agms.service.AgmsFortuneService; 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.order.vo.SurrenderFortuneRequestVO;
import com.yd.api.order.vo.SurrenderFortuneResponseVO;
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.AclCustomerFortune;
import com.yd.dal.entity.customer.AclCustomerFortunePay; import com.yd.dal.entity.customer.AclCustomerFortunePay;
import com.yd.dal.entity.customer.AclCustomerFortunePayoutBatch; import com.yd.dal.entity.customer.AclCustomerFortunePayoutBatch;
import com.yd.dal.entity.customer.AclCustomerFortuneWithdraw; import com.yd.dal.entity.customer.AclCustomerFortuneWithdraw;
import com.yd.dal.entity.customer.AclPolicyholder;
import com.yd.dal.entity.meta.MdIncometaxRate; import com.yd.dal.entity.meta.MdIncometaxRate;
import com.yd.dal.entity.order.PoOrder;
import com.yd.dal.entity.product.Product;
import com.yd.dal.entity.product.ProductPlan;
import com.yd.dal.service.agms.AclCustomerFortuneStatisticService;
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.order.PoOrderDALService;
import com.yd.dal.service.customer.AclCustomerFortunePayoutBatchDALService; import com.yd.dal.service.product.ProductDALService;
import com.yd.dal.service.customer.AclCustomerFortuneWithdrawDALService; import com.yd.dal.service.product.ProductPlanDALService;
import com.yd.rmi.ali.send.service.SendService;
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;
...@@ -67,6 +75,19 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService { ...@@ -67,6 +75,19 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
this.customerFortunePayoutBatchDalService = customerFortunePayoutBatchDalService; this.customerFortunePayoutBatchDalService = customerFortunePayoutBatchDalService;
} }
@Autowired
private PoOrderDALService poOrderDALService;
@Autowired
private AclCustomerFortuneStatisticService aclCustomerFortuneStatisticService;
@Autowired
private ProductDALService productDALService;
@Autowired
private ProductPlanDALService productPlanDALService;
@Autowired
private AclPolicyholderService aclPolicyholderService;
@Autowired
private SendService sendService;
@Override @Override
public CommissionPayoutStatusUpdateResponseVO commissionPayoutStatusUpdate(CommissionPayoutStatusUpdateRequestVO requestVO) { public CommissionPayoutStatusUpdateResponseVO commissionPayoutStatusUpdate(CommissionPayoutStatusUpdateRequestVO requestVO) {
CommissionPayoutStatusUpdateResponseVO responseVO = new CommissionPayoutStatusUpdateResponseVO(); CommissionPayoutStatusUpdateResponseVO responseVO = new CommissionPayoutStatusUpdateResponseVO();
...@@ -126,7 +147,8 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService { ...@@ -126,7 +147,8 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
return customerFortunePayoutBatch.getId(); return customerFortunePayoutBatch.getId();
} }
private void canPaymentUpDate(String paymentStatus, Long payoutBatchId , Long loginId, List<AclCustomerFortune> customerFortunes) { @Override
public void canPaymentUpDate(String paymentStatus, Long payoutBatchId , Long loginId, List<AclCustomerFortune> customerFortunes) {
System.out.println("canPaymentUpDate"); System.out.println("canPaymentUpDate");
//将查询出来的财富列表根据customerId经行分类 //将查询出来的财富列表根据customerId经行分类
Map<Long,List<AclCustomerFortune>> customerFortuneMap = changeCustomerFortunesByFieldName(customerFortunes,"customerId"); Map<Long,List<AclCustomerFortune>> customerFortuneMap = changeCustomerFortunesByFieldName(customerFortunes,"customerId");
...@@ -533,4 +555,99 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService { ...@@ -533,4 +555,99 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
return responseVO; return responseVO;
} }
@Override
public SurrenderFortuneResponseVO surrenderFortune(SurrenderFortuneRequestVO requestVO) {
//退保,更新order中status=4 并更新statistic表
SurrenderFortuneResponseVO resp = new SurrenderFortuneResponseVO();
Long orderId = requestVO.getOrderId();
//判断此订单是否可以退保
//保单财富以进行提现申请,无法进行退保
PoOrder poOrder = poOrderDALService.findByIdAndStatus(orderId,3);
if(poOrder == null){
resp.setCommonResult(new CommonResult(false,ZHBErrorConfig.getErrorInfo("830065")));
return resp;
}
//修改订单状态
poOrder.setStatus(4);
poOrderDALService.update(poOrder);
//财富此订单对应的财富
List<AclCustomerFortune> fortunes = agmsFortuneDalService.findByOrderId(orderId);
for (AclCustomerFortune fortune : fortunes){
//查询财富对应的customer的statistic
AclCustomerFortuneStatistic statistic = aclCustomerFortuneStatisticService.findByCustomerId(fortune.getCustomerId());
Double cancelledFortune = statistic.getCancelledFortune();
if (CommonUtil.isNullOrZero(cancelledFortune)){
cancelledFortune = 0.0;
}
cancelledFortune = BigDecimal.valueOf(cancelledFortune)
.add(fortune.getReferralAmount())
.doubleValue();
statistic.setCancelledFortune(cancelledFortune);
aclCustomerFortuneStatisticService.update(statistic);
//生成对应的负向记录 (commission_amount/fyc_amount/referral_amount)
AclCustomerFortune fortuneNew = new AclCustomerFortune();
org.springframework.beans.BeanUtils.copyProperties(fortune,fortuneNew);
Double commissionAmount = -fortune.getCommissionAmount().doubleValue();
fortuneNew.setCommissionAmount(BigDecimal.valueOf(commissionAmount));
Double fycAmount = -fortune.getFycAmount().doubleValue();
fortuneNew.setFycAmount(BigDecimal.valueOf(fycAmount));
Double referralAmount = -fortune.getReferralAmount().doubleValue();
fortuneNew.setReferralAmount(BigDecimal.valueOf(referralAmount));
fortuneNew.setCreatedAt(new Date());
fortuneNew.setWithdrawedId(null);
fortuneNew.setFortunePayedId(null);
fortuneNew.setId(null);
agmsFortuneDalService.save(fortuneNew);
}
//发送邮件
String email = systemConfigService.getSingleConfigValue("FortuneUpdateToAddress");
List<String> ccList = systemConfigService.getListConfigValue("FortuneUpdateToCCAddress");
String[] ccAddresses = ccList.toArray(new String[ccList.size()]);
PoOrder order = poOrderDALService.findByOrderId(orderId);
Integer configLevel = order.getConfigLevel();
String name = "";
if(configLevel == 2){
Long productId = order.getProductId();
Product product = productDALService.findById(productId);
name = product.getName();
}else if (configLevel == 3){
Long planId = order.getPlanId();
ProductPlan productPlan = productPlanDALService.findById(planId);
name = productPlan.getName();
}
String messageText = "订单id:" + order.getId() + "<br>" +
"订单号:" + order.getOrderNo() + "<br>" +
"产品名称:" + name + "<br>" +
"产品金额:" + order.getOrderPrice() + "<br>" ;
List<AclPolicyholder> policyHolders = aclPolicyholderService.findByOrderId(orderId);
for(AclPolicyholder policyHolder : policyHolders){
Integer type = policyHolder.getType();
if (type == 2){
messageText += "投标人:<br>" +
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;姓名:" + policyHolder.getName() +
"&nbsp;&nbsp;&nbsp;&nbsp;电话" + policyHolder.getMobileNo() + "<br>";
}else if (type == 3){
messageText += "被保人:<br>" +
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;姓名:" + policyHolder.getName();
if (!CommonUtil.isNullOrBlank(policyHolder.getMobileNo())) {
messageText += "&nbsp;&nbsp;&nbsp;&nbsp;电话" + policyHolder.getMobileNo() + "<br>";
}
}
}
String subject = "回退财富";
sendService.sendEmailOrSMS("email", email, "3", messageText, null, subject, ccAddresses, "回复财富", 99, null);
resp.setCommonResult(new CommonResult(true,ZHBErrorConfig.getErrorInfo("800000")));
return resp;
}
} }
...@@ -40,10 +40,10 @@ public class LifeCommissionController { ...@@ -40,10 +40,10 @@ public class LifeCommissionController {
* *
* @return * @return
*/ */
@RequestMapping("/checkComeCommission") @RequestMapping("/updateCommissionCheckStatus")
public Object checkComeCommission(@RequestBody CheckComeCommissionRequestVO requestVO){ public Object updateCommissionCheckStatus(@RequestBody CheckComeCommissionRequestVO requestVO){
JsonResult result = new JsonResult(); JsonResult result = new JsonResult();
CheckComeCommissionResponseVO responseVO = lifeCommissionService.checkComeCommission(requestVO); CheckComeCommissionResponseVO responseVO = lifeCommissionService.updateCommissionCheckStatus(requestVO);
result.addResult(responseVO); result.addResult(responseVO);
result.setData(responseVO); result.setData(responseVO);
return result; return result;
......
...@@ -8,5 +8,5 @@ import com.yd.api.commission.vo.lifecommission.QueryComeCommissionListRequestVO; ...@@ -8,5 +8,5 @@ import com.yd.api.commission.vo.lifecommission.QueryComeCommissionListRequestVO;
public interface LifeCommissionService { public interface LifeCommissionService {
ComeCommissionListResponseVO queryComeCommissionList(QueryComeCommissionListRequestVO requestVO); ComeCommissionListResponseVO queryComeCommissionList(QueryComeCommissionListRequestVO requestVO);
CheckComeCommissionResponseVO checkComeCommission(CheckComeCommissionRequestVO requestVO); CheckComeCommissionResponseVO updateCommissionCheckStatus(CheckComeCommissionRequestVO requestVO);
} }
package com.yd.api.commission.service.impl; package com.yd.api.commission.service.impl;
import com.yd.api.agms.service.AgmsFortuneService;
import com.yd.api.order.vo.SurrenderFortuneRequestVO;
import com.yd.api.commission.service.LifeCommissionService; import com.yd.api.commission.service.LifeCommissionService;
import com.yd.api.commission.vo.lifecommission.*; import com.yd.api.commission.vo.lifecommission.*;
import com.yd.api.result.CommonResult; import com.yd.api.result.CommonResult;
import com.yd.dal.entity.commission.OrderCommissonCheck; import com.yd.dal.entity.commission.OrderCommissonCheck;
import com.yd.dal.entity.customer.AclCustomerFortune;
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.order.PoOrderDALService;
import com.yd.util.CommonUtil; import com.yd.util.CommonUtil;
import com.yd.util.config.ZHBErrorConfig; import com.yd.util.config.ZHBErrorConfig;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -18,6 +25,15 @@ public class LifeCommissionServiceImpl implements LifeCommissionService { ...@@ -18,6 +25,15 @@ public class LifeCommissionServiceImpl implements LifeCommissionService {
@Autowired @Autowired
private LifeCommissionMapper lifeCommissionMapper; private LifeCommissionMapper lifeCommissionMapper;
@Autowired
private AgmsFortuneDALService agmsFortuneDALService;
@Autowired
private AclCustomerFortuneDALService customerFortuneDalService;
@Autowired
private AgmsFortuneService agmsFortuneService;
@Autowired
private PoOrderDALService poOrderDALService;
@Override @Override
public ComeCommissionListResponseVO queryComeCommissionList(QueryComeCommissionListRequestVO requestVO) { public ComeCommissionListResponseVO queryComeCommissionList(QueryComeCommissionListRequestVO requestVO) {
...@@ -35,21 +51,56 @@ public class LifeCommissionServiceImpl implements LifeCommissionService { ...@@ -35,21 +51,56 @@ public class LifeCommissionServiceImpl implements LifeCommissionService {
} }
@Override @Override
public CheckComeCommissionResponseVO checkComeCommission(CheckComeCommissionRequestVO requestVO) { public CheckComeCommissionResponseVO updateCommissionCheckStatus(CheckComeCommissionRequestVO requestVO) {
CheckComeCommissionResponseVO resp = new CheckComeCommissionResponseVO(); CheckComeCommissionResponseVO resp = new CheckComeCommissionResponseVO();
List<Long> orderIds = requestVO.getOrderIds(); List<Long> orderIds = requestVO.getOrderIds();
String status = null; String status = requestVO.getCheckStatus();
String loginId = requestVO.getLoginId(); String loginId = requestVO.getLoginId();
try { try {
// 插入批次表信息 // 寿险经纪人的财富需要初始化withdraw和pay
OrderCommissonCheck orderCommissionCheck= this.batchInsertOrderCommissionCheck(orderIds, loginId); if ("2".equals(status)) {//已比对
System.out.println("看看主键回写"); // 插入批次表信息
System.out.println(orderCommissionCheck); OrderCommissonCheck orderCommissionCheck= this.batchInsertOrderCommissionCheck(orderIds, loginId);
// 设置order记录的CommissionCheckId
this.checkComeCommission(orderIds, status, orderCommissionCheck); this.setOrderCommissionCheckId(orderIds, status, orderCommissionCheck);
// 查询保单下的所有寿险经纪人的fortune记录
//TODO 处理withdraw表 和 pay表 List<AclCustomerFortune> fortuneList = agmsFortuneDALService.queryLifeFortuneListByOrderIds(orderIds);
// 批量设置fortune为可发佣
fortuneList.forEach(f -> {
f.setCommissionPayoutStatus("2");
f.setCommissionPayoutAt(new Date());
f.setCommissionPayoutBy(Long.getLong(loginId));
});
customerFortuneDalService.updateBatch(fortuneList);
// 初始化withdraw和pay
agmsFortuneService.canPaymentUpDate("2", Long.getLong("-1"), Long.getLong(loginId), fortuneList);
} else if ("3".equals(status)) {//已退保
SurrenderFortuneRequestVO surrenderFortuneRequest = new SurrenderFortuneRequestVO();
for (Long orderId: orderIds) {
surrenderFortuneRequest.setOrderId(orderId);
agmsFortuneService.surrenderFortune(surrenderFortuneRequest);
}
} else {//待来佣
// 设置order记录为待来佣
List<PoOrder> orders = poOrderDALService.findByIds(orderIds);
orders.forEach(o -> {
o.setCommissionCheckId(null);
o.setCommissionCheckStatus("1");
o.setCommissionCheckAt(new Date());
o.setCommissionCheckBy(Long.getLong(loginId));
poOrderDALService.update(o);
});
// 查询保单下的所有寿险经纪人的fortune记录
List<AclCustomerFortune> fortuneList = agmsFortuneDALService.queryLifeFortuneListByOrderIds(orderIds);
// 批量设置fortune为b不可发佣
fortuneList.forEach(f -> {
f.setCommissionPayoutStatus("1");
f.setCommissionPayoutAt(new Date());
f.setCommissionPayoutBy(Long.getLong(loginId));
});
customerFortuneDalService.updateBatch(fortuneList);
}
resp.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000"))); resp.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
} catch (Exception e) { } catch (Exception e) {
...@@ -59,7 +110,7 @@ public class LifeCommissionServiceImpl implements LifeCommissionService { ...@@ -59,7 +110,7 @@ public class LifeCommissionServiceImpl implements LifeCommissionService {
return resp; return resp;
} }
private void checkComeCommission(List<Long> orderIds, String status, OrderCommissonCheck orderCommissionCheck) { private void setOrderCommissionCheckId(List<Long> orderIds, String status, OrderCommissonCheck orderCommissionCheck) {
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("checkId", orderCommissionCheck.getId()); paramMap.put("checkId", orderCommissionCheck.getId());
...@@ -67,7 +118,7 @@ public class LifeCommissionServiceImpl implements LifeCommissionService { ...@@ -67,7 +118,7 @@ public class LifeCommissionServiceImpl implements LifeCommissionService {
paramMap.put("checkAt", orderCommissionCheck.getCreatedAt()); paramMap.put("checkAt", orderCommissionCheck.getCreatedAt());
paramMap.put("checkBy", orderCommissionCheck.getCreatedBy()); paramMap.put("checkBy", orderCommissionCheck.getCreatedBy());
lifeCommissionMapper.checkComeCommission(orderIds, paramMap); lifeCommissionMapper.setOrderCommissionCheckId(orderIds, paramMap);
} }
private OrderCommissonCheck batchInsertOrderCommissionCheck(List<Long> orderIds, String loginId) { private OrderCommissonCheck batchInsertOrderCommissionCheck(List<Long> orderIds, String loginId) {
......
package com.yd.api.order.vo;
public class SurrenderFortuneRequestVO {
private Long orderId;
public Long getOrderId() {
return orderId;
}
public void setOrderId(Long orderId) {
this.orderId = orderId;
}
}
package com.yd.api.order.vo;
import com.yd.api.result.CommonResult;
public class SurrenderFortuneResponseVO {
private CommonResult commonResult;
public CommonResult getCommonResult() {
return commonResult;
}
public void setCommonResult(CommonResult commonResult) {
this.commonResult = commonResult;
}
}
package com.yd.dal.entity.agms.fortune;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* ag_acl_customer_fortune_statistic
* @author
*/
public class AclCustomerFortuneStatistic implements Serializable {
/**
* serial id
*/
private Long id;
/**
* FK ag_acl_customer.id
*/
private Long customerId;
/**
* 历史累积财富
*/
private Double accumulatedFortune;
/**
* 已提现财富
*/
private Double drawnFortune;
/**
* 已退保财富
*/
private Double cancelledFortune;
private Date createdAt;
private Long createdBy;
private Date updatedAt;
/**
* 变更者 id
*/
private Long updatedBy;
/**
* 注释或补充
*/
private String remark;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getCustomerId() {
return customerId;
}
public void setCustomerId(Long customerId) {
this.customerId = customerId;
}
public Double getAccumulatedFortune() {
return accumulatedFortune;
}
public void setAccumulatedFortune(Double accumulatedFortune) {
this.accumulatedFortune = accumulatedFortune;
}
public Double getDrawnFortune() {
return drawnFortune;
}
public void setDrawnFortune(Double drawnFortune) {
this.drawnFortune = drawnFortune;
}
public Double getCancelledFortune() {
return cancelledFortune;
}
public void setCancelledFortune(Double cancelledFortune) {
this.cancelledFortune = cancelledFortune;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Long getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Long createdBy) {
this.createdBy = createdBy;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Long getUpdatedBy() {
return updatedBy;
}
public void setUpdatedBy(Long updatedBy) {
this.updatedBy = updatedBy;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
AclCustomerFortuneStatistic other = (AclCustomerFortuneStatistic) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getCustomerId() == null ? other.getCustomerId() == null : this.getCustomerId().equals(other.getCustomerId()))
&& (this.getAccumulatedFortune() == null ? other.getAccumulatedFortune() == null : this.getAccumulatedFortune().equals(other.getAccumulatedFortune()))
&& (this.getDrawnFortune() == null ? other.getDrawnFortune() == null : this.getDrawnFortune().equals(other.getDrawnFortune()))
&& (this.getCancelledFortune() == null ? other.getCancelledFortune() == null : this.getCancelledFortune().equals(other.getCancelledFortune()))
&& (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
&& (this.getCreatedBy() == null ? other.getCreatedBy() == null : this.getCreatedBy().equals(other.getCreatedBy()))
&& (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()))
&& (this.getUpdatedBy() == null ? other.getUpdatedBy() == null : this.getUpdatedBy().equals(other.getUpdatedBy()))
&& (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getCustomerId() == null) ? 0 : getCustomerId().hashCode());
result = prime * result + ((getAccumulatedFortune() == null) ? 0 : getAccumulatedFortune().hashCode());
result = prime * result + ((getDrawnFortune() == null) ? 0 : getDrawnFortune().hashCode());
result = prime * result + ((getCancelledFortune() == null) ? 0 : getCancelledFortune().hashCode());
result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
result = prime * result + ((getCreatedBy() == null) ? 0 : getCreatedBy().hashCode());
result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
result = prime * result + ((getUpdatedBy() == null) ? 0 : getUpdatedBy().hashCode());
result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", customerId=").append(customerId);
sb.append(", accumulatedFortune=").append(accumulatedFortune);
sb.append(", drawnFortune=").append(drawnFortune);
sb.append(", cancelledFortune=").append(cancelledFortune);
sb.append(", createdAt=").append(createdAt);
sb.append(", createdBy=").append(createdBy);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", updatedBy=").append(updatedBy);
sb.append(", remark=").append(remark);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}
\ No newline at end of file
...@@ -387,6 +387,11 @@ public class PoOrder { ...@@ -387,6 +387,11 @@ public class PoOrder {
*/ */
private String autoPayFlag; private String autoPayFlag;
private Long commissionCheckId;
private String commissionCheckStatus;
private Date commissionCheckAt;
private Long commissionCheckBy;
public Long getId() { public Long getId() {
return id; return id;
} }
...@@ -1026,4 +1031,36 @@ public class PoOrder { ...@@ -1026,4 +1031,36 @@ public class PoOrder {
public void setAutoPayFlag(String autoPayFlag) { public void setAutoPayFlag(String autoPayFlag) {
this.autoPayFlag = autoPayFlag; this.autoPayFlag = autoPayFlag;
} }
public Long getCommissionCheckId() {
return commissionCheckId;
}
public void setCommissionCheckId(Long commissionCheckId) {
this.commissionCheckId = commissionCheckId;
}
public String getCommissionCheckStatus() {
return commissionCheckStatus;
}
public void setCommissionCheckStatus(String commissionCheckStatus) {
this.commissionCheckStatus = commissionCheckStatus;
}
public Date getCommissionCheckAt() {
return commissionCheckAt;
}
public void setCommissionCheckAt(Date commissionCheckAt) {
this.commissionCheckAt = commissionCheckAt;
}
public Long getCommissionCheckBy() {
return commissionCheckBy;
}
public void setCommissionCheckBy(Long commissionCheckBy) {
this.commissionCheckBy = commissionCheckBy;
}
} }
\ No newline at end of file
package com.yd.dal.entity.sms;
import java.io.Serializable;
import java.util.Date;
/**
* ag_sms_record
* @author
*/
public class ShortMessageSendRecord implements Serializable {
/**
* serial id
*/
private Long id;
/**
* 手机号
*/
private String mobileNo;
/**
* 业务类型 1订单保存
*/
private String businessType;
/**
* 业务ID
*/
private String businessId;
/**
* 短信类型 1-校验码 2-支付提醒短信 3-承保成功短信 4-生日祝福短信 5-续保提现短信 0-临时短信
*/
private String smsType;
/**
* 短信类容
*/
private String smsContent;
/**
* 校验码
*/
private String verificationCode;
/**
* 发送时间
*/
private Date sendTime;
/**
* 失效时间
*/
private Date expireTime;
/**
* 发送状态 1成功 0失败
*/
private String sendStatus;
/**
* 发送返回信息
*/
private String returnMessage;
/**
* request_id
*/
private String requestId;
/**
* biz_id
*/
private String bizId;
/**
* 短信模板code
*/
private String templateCode;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getMobileNo() {
return mobileNo;
}
public void setMobileNo(String mobileNo) {
this.mobileNo = mobileNo;
}
public String getBusinessType() {
return businessType;
}
public void setBusinessType(String businessType) {
this.businessType = businessType;
}
public String getBusinessId() {
return businessId;
}
public void setBusinessId(String businessId) {
this.businessId = businessId;
}
public String getSmsType() {
return smsType;
}
public void setSmsType(String smsType) {
this.smsType = smsType;
}
public String getSmsContent() {
return smsContent;
}
public void setSmsContent(String smsContent) {
this.smsContent = smsContent;
}
public String getVerificationCode() {
return verificationCode;
}
public void setVerificationCode(String verificationCode) {
this.verificationCode = verificationCode;
}
public Date getSendTime() {
return sendTime;
}
public void setSendTime(Date sendTime) {
this.sendTime = sendTime;
}
public Date getExpireTime() {
return expireTime;
}
public void setExpireTime(Date expireTime) {
this.expireTime = expireTime;
}
public String getSendStatus() {
return sendStatus;
}
public void setSendStatus(String sendStatus) {
this.sendStatus = sendStatus;
}
public String getReturnMessage() {
return returnMessage;
}
public void setReturnMessage(String returnMessage) {
this.returnMessage = returnMessage;
}
public String getRequestId() {
return requestId;
}
public void setRequestId(String requestId) {
this.requestId = requestId;
}
public String getBizId() {
return bizId;
}
public void setBizId(String bizId) {
this.bizId = bizId;
}
public String getTemplateCode() {
return templateCode;
}
public void setTemplateCode(String templateCode) {
this.templateCode = templateCode;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
ShortMessageSendRecord other = (ShortMessageSendRecord) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getMobileNo() == null ? other.getMobileNo() == null : this.getMobileNo().equals(other.getMobileNo()))
&& (this.getBusinessType() == null ? other.getBusinessType() == null : this.getBusinessType().equals(other.getBusinessType()))
&& (this.getBusinessId() == null ? other.getBusinessId() == null : this.getBusinessId().equals(other.getBusinessId()))
&& (this.getSmsType() == null ? other.getSmsType() == null : this.getSmsType().equals(other.getSmsType()))
&& (this.getSmsContent() == null ? other.getSmsContent() == null : this.getSmsContent().equals(other.getSmsContent()))
&& (this.getVerificationCode() == null ? other.getVerificationCode() == null : this.getVerificationCode().equals(other.getVerificationCode()))
&& (this.getSendTime() == null ? other.getSendTime() == null : this.getSendTime().equals(other.getSendTime()))
&& (this.getExpireTime() == null ? other.getExpireTime() == null : this.getExpireTime().equals(other.getExpireTime()))
&& (this.getSendStatus() == null ? other.getSendStatus() == null : this.getSendStatus().equals(other.getSendStatus()))
&& (this.getReturnMessage() == null ? other.getReturnMessage() == null : this.getReturnMessage().equals(other.getReturnMessage()))
&& (this.getRequestId() == null ? other.getRequestId() == null : this.getRequestId().equals(other.getRequestId()))
&& (this.getBizId() == null ? other.getBizId() == null : this.getBizId().equals(other.getBizId()))
&& (this.getTemplateCode() == null ? other.getTemplateCode() == null : this.getTemplateCode().equals(other.getTemplateCode()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getMobileNo() == null) ? 0 : getMobileNo().hashCode());
result = prime * result + ((getBusinessType() == null) ? 0 : getBusinessType().hashCode());
result = prime * result + ((getBusinessId() == null) ? 0 : getBusinessId().hashCode());
result = prime * result + ((getSmsType() == null) ? 0 : getSmsType().hashCode());
result = prime * result + ((getSmsContent() == null) ? 0 : getSmsContent().hashCode());
result = prime * result + ((getVerificationCode() == null) ? 0 : getVerificationCode().hashCode());
result = prime * result + ((getSendTime() == null) ? 0 : getSendTime().hashCode());
result = prime * result + ((getExpireTime() == null) ? 0 : getExpireTime().hashCode());
result = prime * result + ((getSendStatus() == null) ? 0 : getSendStatus().hashCode());
result = prime * result + ((getReturnMessage() == null) ? 0 : getReturnMessage().hashCode());
result = prime * result + ((getRequestId() == null) ? 0 : getRequestId().hashCode());
result = prime * result + ((getBizId() == null) ? 0 : getBizId().hashCode());
result = prime * result + ((getTemplateCode() == null) ? 0 : getTemplateCode().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", mobileNo=").append(mobileNo);
sb.append(", businessType=").append(businessType);
sb.append(", businessId=").append(businessId);
sb.append(", smsType=").append(smsType);
sb.append(", smsContent=").append(smsContent);
sb.append(", verificationCode=").append(verificationCode);
sb.append(", sendTime=").append(sendTime);
sb.append(", expireTime=").append(expireTime);
sb.append(", sendStatus=").append(sendStatus);
sb.append(", returnMessage=").append(returnMessage);
sb.append(", requestId=").append(requestId);
sb.append(", bizId=").append(bizId);
sb.append(", templateCode=").append(templateCode);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}
\ No newline at end of file
package com.yd.dal.entity.transaction;
import java.io.Serializable;
import java.util.Date;
/**
* ag_trans_sendlist
* @author
*/
public class TransSendList implements Serializable {
private static final long serialVersionUID = 1L;
/**
* serial id
*/
private Long id;
/**
* 发送标识 sms-短信,email-邮件
*/
private String sendTag;
/**
* 寄件者
*/
private String sender;
/**
* FK ag_acl_customer.id
*/
private Long customerId;
/**
* 收件者姓名
*/
private String name;
private String mobileNo;
/**
* 1=订单 2=提现 3=客户意见 4=汽车问卷 5=活动 6=wordpress 7=生日快乐 99=其他
*/
private Integer useFor;
/**
* 对应 use_for 表中的id
*/
private Long useForId;
/**
* 短信模板code
*/
private String smsTemplateCode;
/**
* 标题
*/
private String subject;
/**
* 信息内容概要
*/
private String contentSummary;
/**
* 发送是否成功 0=No, 1=Yes
*/
private Integer isSuccess;
/**
* 失败次数
*/
private Integer failCount;
/**
* 创建时间
*/
private Date createdAt;
private Long createdBy;
/**
* 修改时间
*/
private Date updatedAt;
private Long updatedBy;
/**
* 收件者邮箱
*/
private String emailTo;
/**
* 抄送者邮箱
*/
private String emailCc;
/**
* 密件收件者邮箱
*/
private String emailBcc;
/**
* 信息内容
*/
private String content;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getSendTag() {
return sendTag;
}
public void setSendTag(String sendTag) {
this.sendTag = sendTag;
}
public String getSender() {
return sender;
}
public void setSender(String sender) {
this.sender = sender;
}
public Long getCustomerId() {
return customerId;
}
public void setCustomerId(Long customerId) {
this.customerId = customerId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getMobileNo() {
return mobileNo;
}
public void setMobileNo(String mobileNo) {
this.mobileNo = mobileNo;
}
public Integer getUseFor() {
return useFor;
}
public void setUseFor(Integer useFor) {
this.useFor = useFor;
}
public Long getUseForId() {
return useForId;
}
public void setUseForId(Long useForId) {
this.useForId = useForId;
}
public String getSmsTemplateCode() {
return smsTemplateCode;
}
public void setSmsTemplateCode(String smsTemplateCode) {
this.smsTemplateCode = smsTemplateCode;
}
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public String getContentSummary() {
return contentSummary;
}
public void setContentSummary(String contentSummary) {
this.contentSummary = contentSummary;
}
public Integer getIsSuccess() {
return isSuccess;
}
public void setIsSuccess(Integer isSuccess) {
this.isSuccess = isSuccess;
}
public Integer getFailCount() {
return failCount;
}
public void setFailCount(Integer failCount) {
this.failCount = failCount;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Long getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Long createdBy) {
this.createdBy = createdBy;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Long getUpdatedBy() {
return updatedBy;
}
public void setUpdatedBy(Long updatedBy) {
this.updatedBy = updatedBy;
}
public String getEmailTo() {
return emailTo;
}
public void setEmailTo(String emailTo) {
this.emailTo = emailTo;
}
public String getEmailCc() {
return emailCc;
}
public void setEmailCc(String emailCc) {
this.emailCc = emailCc;
}
public String getEmailBcc() {
return emailBcc;
}
public void setEmailBcc(String emailBcc) {
this.emailBcc = emailBcc;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
}
\ No newline at end of file
package com.yd.dal.mapper.agms;
import com.yd.dal.entity.agms.fortune.AclCustomerFortuneStatistic;
public interface AclCustomerFortuneStatisticMapper {
int deleteByPrimaryKey(Long id);
int insert(AclCustomerFortuneStatistic record);
int insertSelective(AclCustomerFortuneStatistic record);
AclCustomerFortuneStatistic selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(AclCustomerFortuneStatistic record);
int updateByPrimaryKeyWithBLOBs(AclCustomerFortuneStatistic record);
int updateByPrimaryKey(AclCustomerFortuneStatistic record);
AclCustomerFortuneStatistic findByCustomerId(Long customerId);
}
\ No newline at end of file
package com.yd.dal.mapper.agms; package com.yd.dal.mapper.agms;
import com.yd.dal.entity.agms.fortune.*; import com.yd.dal.entity.agms.fortune.*;
import com.yd.dal.entity.customer.AclCustomerFortune;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -37,4 +38,11 @@ public interface AgmsFortuneMapper { ...@@ -37,4 +38,11 @@ public interface AgmsFortuneMapper {
* @return 返回结果 * @return 返回结果
*/ */
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);
void save(AclCustomerFortune fortune);
} }
...@@ -23,4 +23,6 @@ public interface AclCustomerMapper { ...@@ -23,4 +23,6 @@ public interface AclCustomerMapper {
AclCustomer findByMobileNo(String mobileNo); AclCustomer findByMobileNo(String mobileNo);
List<AclCustomer> findByIds(@Param("customerIds") List<Long> customerIds); List<AclCustomer> findByIds(@Param("customerIds") List<Long> customerIds);
List<AclCustomer> findByObj(AclCustomer aclCustomer);
} }
\ No newline at end of file
package com.yd.dal.mapper.customer;
import com.yd.dal.entity.customer.AclPolicyholder;
import java.util.List;
public interface AclPolicyholderMapper {
int deleteByPrimaryKey(Long id);
int insert(AclPolicyholder record);
int insertSelective(AclPolicyholder record);
AclPolicyholder selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(AclPolicyholder record);
int updateByPrimaryKeyWithBLOBs(AclPolicyholder record);
int updateByPrimaryKey(AclPolicyholder record);
List<AclPolicyholder> findByOrderId(Long orderId);
}
\ No newline at end of file
...@@ -11,7 +11,7 @@ import java.util.Map; ...@@ -11,7 +11,7 @@ import java.util.Map;
public interface LifeCommissionMapper { public interface LifeCommissionMapper {
List<ComeCommissionVO> queryComeCommissionList(QueryComeCommissionListRequestVO requestVO); List<ComeCommissionVO> queryComeCommissionList(QueryComeCommissionListRequestVO requestVO);
void checkComeCommission(@Param("list")List<Long> orderIds, @Param("paramMap")Map<String, Object> paramMap); void setOrderCommissionCheckId(@Param("list")List<Long> orderIds, @Param("paramMap")Map<String, Object> paramMap);
OrderCommissonCheck insertOrderCommissionCheck(OrderCommissonCheck orderCommissonCheck); OrderCommissonCheck insertOrderCommissionCheck(OrderCommissonCheck orderCommissonCheck);
......
...@@ -26,4 +26,8 @@ public interface PoOrderMapper { ...@@ -26,4 +26,8 @@ public interface PoOrderMapper {
List<PolicyDetailInfoE> findPolicyDetailsInfoByOrderNoE(@Param("orderNo") String orderNo); List<PolicyDetailInfoE> findPolicyDetailsInfoByOrderNoE(@Param("orderNo") String orderNo);
List<PolicyFactorInfoE> findPolicyFactorByOrderNosE(@Param("orderNoList") List<String> orderNoList); List<PolicyFactorInfoE> findPolicyFactorByOrderNosE(@Param("orderNoList") List<String> orderNoList);
PoOrder findByIdAndStatus(@Param("orderId")Long orderId, @Param("status")int status);
List<PoOrder> findByIds(List<Long> orderIds);
} }
\ No newline at end of file
package com.yd.dal.mapper.sms;
import com.yd.dal.entity.sms.ShortMessageSendRecord;
public interface ShortMessageSendRecordMapper {
int deleteByPrimaryKey(Long id);
int insert(ShortMessageSendRecord record);
int insertSelective(ShortMessageSendRecord record);
ShortMessageSendRecord selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(ShortMessageSendRecord record);
int updateByPrimaryKey(ShortMessageSendRecord record);
}
\ No newline at end of file
package com.yd.dal.mapper.transaction;
import com.yd.dal.entity.transaction.TransSendList;
public interface TransSendlistMapper {
int deleteByPrimaryKey(Long id);
TransSendList insert(TransSendList record);
int insertSelective(TransSendList record);
TransSendList selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(TransSendList record);
int updateByPrimaryKeyWithBLOBs(TransSendList record);
int updateByPrimaryKey(TransSendList record);
}
\ No newline at end of file
package com.yd.dal.service.agms;
import com.yd.dal.entity.agms.fortune.AclCustomerFortuneStatistic;
public interface AclCustomerFortuneStatisticService {
AclCustomerFortuneStatistic findByCustomerId(Long customerId);
void update(AclCustomerFortuneStatistic statistic);
}
\ No newline at end of file
package com.yd.dal.service.agms; package com.yd.dal.service.agms;
import com.yd.dal.entity.agms.fortune.*; import com.yd.dal.entity.agms.fortune.*;
import com.yd.dal.entity.agms.fortune.CommissionPayoutStatus;
import com.yd.dal.entity.agms.fortune.CommissionPayoutStatusQueryInfo;
import com.yd.dal.entity.agms.fortune.CustomerFortuneStatisticalInfo;
import com.yd.dal.entity.customer.AclCustomerFortune;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -24,6 +28,10 @@ public interface AgmsFortuneDALService { ...@@ -24,6 +28,10 @@ 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 customerId customerId * @param customerId customerId
...@@ -38,4 +46,7 @@ public interface AgmsFortuneDALService { ...@@ -38,4 +46,7 @@ public interface AgmsFortuneDALService {
* @return WithdrawLabelInfo * @return WithdrawLabelInfo
*/ */
List<WithdrawLabelInfo> transformForWithdrawLabel(WithdrawQueryInfo info); List<WithdrawLabelInfo> transformForWithdrawLabel(WithdrawQueryInfo info);
void save(AclCustomerFortune fortune);
} }
package com.yd.dal.service.agms.impl;
import com.yd.dal.entity.agms.fortune.AclCustomerFortuneStatistic;
import com.yd.dal.mapper.agms.AclCustomerFortuneStatisticMapper;
import com.yd.dal.service.agms.AclCustomerFortuneStatisticService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service("aclCustomerFortuneStatisticService")
public class AclCustomerFortuneStatisticServiceImpl implements AclCustomerFortuneStatisticService {
@Autowired
private AclCustomerFortuneStatisticMapper aclCustomerFortuneStatisticMapper;
@Override
public AclCustomerFortuneStatistic findByCustomerId(Long customerId) {
return aclCustomerFortuneStatisticMapper.findByCustomerId(customerId);
}
@Override
public void update(AclCustomerFortuneStatistic statistic) {
aclCustomerFortuneStatisticMapper.updateByPrimaryKeySelective(statistic);
}
}
\ No newline at end of file
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 org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -51,6 +52,16 @@ public class AgmsFortuneDALServiceImpl implements AgmsFortuneDALService { ...@@ -51,6 +52,16 @@ 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 customerId, Long payId) { public List<FortunePayToOrderInfo> fortunePayToOrder(Long customerId, Long payId) {
return agmsFortuneMapper.fortunePayToOrder(customerId,payId); return agmsFortuneMapper.fortunePayToOrder(customerId,payId);
} }
...@@ -59,4 +70,9 @@ public class AgmsFortuneDALServiceImpl implements AgmsFortuneDALService { ...@@ -59,4 +70,9 @@ public class AgmsFortuneDALServiceImpl implements AgmsFortuneDALService {
public List<WithdrawLabelInfo> transformForWithdrawLabel(WithdrawQueryInfo info) { public List<WithdrawLabelInfo> transformForWithdrawLabel(WithdrawQueryInfo info) {
return agmsFortuneMapper.transformForWithdrawLabel(info); return agmsFortuneMapper.transformForWithdrawLabel(info);
} }
@Override
public void save(AclCustomerFortune fortune) {
agmsFortuneMapper.save(fortune);
}
} }
...@@ -34,5 +34,7 @@ public interface AclCustomerDALService { ...@@ -34,5 +34,7 @@ public interface AclCustomerDALService {
AclCustomer findByMobileNo(String mobileNo); AclCustomer findByMobileNo(String mobileNo);
List<AclCustomer> findByIds(List<Long> customerIds); List<AclCustomer> findByIds(List<Long> customerIds);
List<AclCustomer> findByObj(AclCustomer aclCustomer);
} }
...@@ -18,4 +18,6 @@ public interface AclCustomerFortuneDALService { ...@@ -18,4 +18,6 @@ public interface AclCustomerFortuneDALService {
void updateBatch(List<AclCustomerFortune> fortuneUpdates); void updateBatch(List<AclCustomerFortune> fortuneUpdates);
List<AclCustomerFortune> findByWithdrawIds(List<Long> withdrawUpdateIds); List<AclCustomerFortune> findByWithdrawIds(List<Long> withdrawUpdateIds);
} }
package com.yd.dal.service.customer;
import com.yd.dal.entity.customer.AclPolicyholder;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Transactional
public interface AclPolicyholderService {
List<AclPolicyholder> findByOrderId(Long orderId);
}
\ No newline at end of file
...@@ -52,4 +52,9 @@ public class AclCustomerDALServiceImpl implements AclCustomerDALService { ...@@ -52,4 +52,9 @@ public class AclCustomerDALServiceImpl implements AclCustomerDALService {
return aclCustomerMapper.findByIds(customerIds); return aclCustomerMapper.findByIds(customerIds);
} }
@Override
public List<AclCustomer> findByObj(AclCustomer aclCustomer) {
return aclCustomerMapper.findByObj(aclCustomer);
}
} }
package com.yd.dal.service.customer.impl;
import com.yd.dal.entity.customer.AclPolicyholder;
import com.yd.dal.mapper.customer.AclPolicyholderMapper;
import com.yd.dal.service.customer.AclPolicyholderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("AclPolicyholderService")
public class AclPolicyholderServiceImpl implements AclPolicyholderService {
@Autowired
private AclPolicyholderMapper AclPolicyholderMapper;
@Override
public List<AclPolicyholder> findByOrderId(Long orderId) {
return AclPolicyholderMapper.findByOrderId(orderId);
}
}
\ No newline at end of file
...@@ -56,4 +56,19 @@ public class PoOrderDALServiceImpl implements PoOrderDALService { ...@@ -56,4 +56,19 @@ public class PoOrderDALServiceImpl implements PoOrderDALService {
public List<PolicyFactorInfoE> findPolicyFactorByOrderNosE(List<String> orderNoList) { public List<PolicyFactorInfoE> findPolicyFactorByOrderNosE(List<String> orderNoList) {
return poOrderMapper.findPolicyFactorByOrderNosE(orderNoList); return poOrderMapper.findPolicyFactorByOrderNosE(orderNoList);
} }
@Override
public PoOrder findByIdAndStatus(Long orderId, int status) {
return poOrderMapper.findByIdAndStatus(orderId, status);
}
@Override
public void update(PoOrder poOrder) {
poOrderMapper.updateByPrimaryKeySelective(poOrder);
}
@Override
public List<PoOrder> findByIds(List<Long> orderIds) {
return poOrderMapper.findByIds(orderIds);
}
} }
...@@ -21,4 +21,10 @@ public interface PoOrderDALService { ...@@ -21,4 +21,10 @@ public interface PoOrderDALService {
List<PolicyDetailInfoE> findPolicyDetailsInfoByOrderNoE(String orderNo); List<PolicyDetailInfoE> findPolicyDetailsInfoByOrderNoE(String orderNo);
List<PolicyFactorInfoE> findPolicyFactorByOrderNosE(List<String> orderNoList); List<PolicyFactorInfoE> findPolicyFactorByOrderNosE(List<String> orderNoList);
PoOrder findByIdAndStatus(Long orderId, int status);
void update(PoOrder poOrder);
List<PoOrder> findByIds(List<Long> orderIds);
} }
...@@ -11,4 +11,6 @@ public interface ProductDALService { ...@@ -11,4 +11,6 @@ public interface ProductDALService {
List<Product> findAll(); List<Product> findAll();
List<ProductE> findAllE(); List<ProductE> findAllE();
Product findById(Long productId);
} }
...@@ -9,4 +9,6 @@ import java.util.List; ...@@ -9,4 +9,6 @@ import java.util.List;
public interface ProductPlanDALService { public interface ProductPlanDALService {
List<ProductPlan> findAll(); List<ProductPlan> findAll();
ProductPlan findById(Long planId);
} }
...@@ -26,4 +26,9 @@ public class ProductDALServiceImpl implements ProductDALService { ...@@ -26,4 +26,9 @@ public class ProductDALServiceImpl implements ProductDALService {
public List<ProductE> findAllE() { public List<ProductE> findAllE() {
return productMapper.findAllE(); return productMapper.findAllE();
} }
@Override
public Product findById(Long productId) {
return productMapper.selectByPrimaryKey(productId);
}
} }
...@@ -16,4 +16,9 @@ public class ProductPlanDALServiceImpl implements ProductPlanDALService { ...@@ -16,4 +16,9 @@ public class ProductPlanDALServiceImpl implements ProductPlanDALService {
public List<ProductPlan> findAll() { public List<ProductPlan> findAll() {
return productPlanMapper.findAll(); return productPlanMapper.findAll();
} }
@Override
public ProductPlan findById(Long planId) {
return productPlanMapper.selectByPrimaryKey(planId);
}
} }
package com.yd.dal.service.sms;
import com.yd.dal.entity.sms.ShortMessageSendRecord;
public interface ShortMessageSendRecordService {
void save(ShortMessageSendRecord shortMessageSendRecord);
// Boolean delete (Long id);
// ShortMessageSendRecord update(ShortMessageSendRecord shortMessageSendRecord);
// ShortMessageSendRecord findById(Long id);
}
\ No newline at end of file
package com.yd.dal.service.sms.impl;
import com.yd.dal.entity.sms.ShortMessageSendRecord;
import com.yd.dal.mapper.sms.ShortMessageSendRecordMapper;
import com.yd.dal.service.sms.ShortMessageSendRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service("shortMessageSendRecordService")
public class ShortMessageSendRecordServiceImpl implements ShortMessageSendRecordService {
@Autowired
private ShortMessageSendRecordMapper shortMessageSendRecordMapper;
@Override
public void save(ShortMessageSendRecord shortMessageSendRecord) {
shortMessageSendRecordMapper.insert(shortMessageSendRecord);
}
}
\ No newline at end of file
package com.yd.dal.service.transaction.Impl;
import com.yd.dal.entity.transaction.TransSendList;
import com.yd.dal.mapper.transaction.TransSendlistMapper;
import com.yd.dal.service.transaction.TransSendListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service("transSendListService")
public class TransSendListServiceImpl implements TransSendListService {
@Autowired
private TransSendlistMapper transSendlistMapper;
@Override
public TransSendList save(TransSendList transSendList) {
return transSendlistMapper.insert(transSendList);
}
@Override
public Boolean delete(Long id) {
return null;
}
@Override
public TransSendList update(TransSendList transSendList) {
return null;
}
@Override
public TransSendList findById(Long id) {
return null;
}
}
\ No newline at end of file
package com.yd.dal.service.transaction;
import com.yd.dal.entity.transaction.TransSendList;
import java.util.List;
public interface TransSendListService {
/**
* 保存对象
* @param transSendList
* @return
*/
TransSendList save(TransSendList transSendList);
/**
* 按id删除对象
* @param id
* @return
*/
Boolean delete (Long id);
/**
* 更新对象
* @param transSendList
* @return
*/
TransSendList update(TransSendList transSendList);
/**
* 按id查找对象
* @param id
* @return
*/
TransSendList findById(Long id);
}
\ No newline at end of file
...@@ -70,14 +70,14 @@ public class MailServiceImpl implements MailService { ...@@ -70,14 +70,14 @@ public class MailServiceImpl implements MailService {
@Override @Override
public void sysException(String warningSubject, String warningMessage) { public void sysException(String warningSubject, String warningMessage) {
// if("prod".equals(SpringContextUtil.getActiveProfile())){ // if("prod".equals(SpringContextUtil.getActiveProfile())){
String toAddress = "water.wang@ydinsurance.cn";//"simon.cheng@autogeneral.cn"; String toAddress = "water.wang@ydinsurance.cn";//"simon.cheng@autogeneral.cn";
List<String> ccList = systemConfigService.getListConfigValue("SysWarningCCAddress"); List<String> ccList = systemConfigService.getListConfigValue("SysWarningCCAddress");
String[] ccAddresses = new String[ccList.size()]; String[] ccAddresses = new String[ccList.size()];
ccList.toArray(ccAddresses); ccList.toArray(ccAddresses);
// String[] ccAddress = new String[]{"water.wang@autogeneral.cn","sweet.zhang@autogeneral.cn","jerold.chen@autogeneral.cn"}; // String[] ccAddress = new String[]{"water.wang@autogeneral.cn","sweet.zhang@autogeneral.cn","jerold.chen@autogeneral.cn"};
String subject = "【"+SpringContextUtil.getEnvironmentName()+"环境】"+warningSubject; String subject = "【"+SpringContextUtil.getEnvironmentName()+"环境】"+warningSubject;
String messageText = CommonUtil.currentIP()+" "+warningMessage; String messageText = CommonUtil.currentIP()+" "+warningMessage;
String imageFile = null; String imageFile = null;
try { try {
aliMailInterfService.smtpSend(toAddress, ccAddresses,subject, messageText, null, imageFile); aliMailInterfService.smtpSend(toAddress, ccAddresses,subject, messageText, null, imageFile);
} catch (Exception e) { } catch (Exception e) {
......
package com.yd.rmi.ali.send.service;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("sendService")
public interface SendService {
/**
* 发送Email和SMS综合接口
* @param category 【邮件】填写email,【短信】则填写sms
* @param number 【邮箱】--邮箱号,【短信】--手机号
* @param type 【邮箱】信件类型【填3】:1-单封邮件发送,2-批量邮件发送,3-SMTP邮件发送,【短信】格式为:1-验证码短信,2-支付提醒短信,3-承保成功短信,4-生日祝福短信,5-续保提现短信,0-临时短信,6-蒙哥方案分析完成短信
* @param content 【邮箱】则为邮箱的正文部分,【短信】则为替换短信模板中变量的JSON字符串,如模板内容为"亲爱的${name},您的验证码为${code}"时,此处的值为 "{\"name\":\""+name+"\",\"code\":\""+code+"\"}";
* @param templateCode 【邮箱】--不填,【短信】--短信模板代码
* @param subject 【邮箱】--邮箱标题,【短信】--签名信息,最惠比、银盾保险经纪、安吉保、银盾保险在线
* @param ccAddress 【邮箱】--抄送的账户,【短信】--不填
* @param contentSummary 内容概要
* @param useFor 该短信和邮件主要是为了什么发送的,1=订单 2=提现 3=客户意见 4=汽车问卷 5=活动 6=wordpress 7=生日快乐 99=其他'
* @param useForId 相应的主键ID,如:订单id等
*/
void sendEmailOrSMS(String category,String number,String type,String content,String templateCode,String subject,String[] ccAddress,String contentSummary,Integer useFor,Long useForId);
/**
* 发送短信
* @param mobile 手机号
* @param type 格式为:1-验证码短信,2-支付提醒短信,3-承保成功短信,4-生日祝福短信,5-续保提现短信,0-临时短信,6-蒙哥方案分析完成短信
* @param content 则为替换短信模板中变量的JSON字符串,如模板内容为"亲爱的${name},您的验证码为${code}"时,此处的值为 "{\"name\":\""+name+"\",\"code\":\""+code+"\"}";
* @param templateCode 短信模板代码
* @param subject 签名信息,最惠比、银盾保险经纪、最惠比、银盾保险经纪、安吉保、银盾保险在线
* @param contentSummary 内容概要
* @param useFor 该短信和邮件主要是为了什么发送的,1=订单 2=提现 3=客户意见 4=汽车问卷 5=活动 6=wordpress 7=生日快乐 99=其他'
* @param useForId 相应的主键ID,如:订单id等
*/
void sendSMS(String mobile, String type, String content, String templateCode, String subject, String contentSummary, Integer useFor, Long useForId);
void sendEmail(String category, String number, String content, String subject, String[] ccAddress, String contentSummary, Integer useFor, List<String> attachmentFiles);
boolean sendEmail(String email, String messageText, String subject, String[] ccAddresses);
}
package com.yd.rmi.ali.sms.service;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
import com.yd.dal.entity.sms.ShortMessageSendRecord;
public interface AliSmsInterfService {
public SendSmsResponse sendSms(ShortMessageSendRecord smsRecord, String signName);
// public QuerySendDetailsResponse querySmsDetail(ShortMessageSendRecord smsRecord);
}
package com.yd.rmi.ali.sms.service.impl;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.dysmsapi.model.v20170525.QuerySendDetailsRequest;
import com.aliyuncs.dysmsapi.model.v20170525.QuerySendDetailsResponse;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.profile.DefaultProfile;
import com.aliyuncs.profile.IClientProfile;
import com.yd.dal.entity.sms.ShortMessageSendRecord;
import com.yd.dal.service.sms.ShortMessageSendRecordService;
import com.yd.rmi.ali.sms.service.AliSmsInterfService;
import com.yd.rmi.cache.SystemConfigService;
import com.yd.util.CommonUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.Date;
@Service("aliSmsInterfService")
public class AliSmsInterfServiceImpl implements AliSmsInterfService {
@Autowired
private SystemConfigService systemConfigService;
@Autowired
private ShortMessageSendRecordService shortMessageSendRecordService;
/**
*
* @param phoneNumber
* @param signName
* @param templateCode
* @param templateParam
* @param outId
* @return SendSmsResponse
* @throws ClientException
*/
private SendSmsResponse send(String phoneNumber,String signName,String templateCode,String templateParam,String outId) throws ClientException {
//可自助调整超时时间
System.setProperty("sun.net.client.defaultConnectTimeout", "10000");
System.setProperty("sun.net.client.defaultReadTimeout", "10000");
//初始化acsClient,暂不支持region化
IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", systemConfigService.getSingleConfigValue("ALI_SMS_ACCESS_KEY_ID"), systemConfigService.getSingleConfigValue("ALI_SMS_ACCESS_KEY_SECRET"));
DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", systemConfigService.getSingleConfigValue("ALI_SMS_PRODUCT"), systemConfigService.getSingleConfigValue("ALI_SMS_DOMAIN"));
IAcsClient acsClient = new DefaultAcsClient(profile);
//组装请求对象-具体描述见控制台-文档部分内容
SendSmsRequest request = new SendSmsRequest();
request.setPhoneNumbers(phoneNumber);//必填:待发送手机号 "13917505984"
request.setSignName(signName);//必填:短信签名-可在短信控制台中找到 "安吉保"
request.setTemplateCode(templateCode); //必填:短信模板-可在短信控制台中找到 "SMS_76610855"
request.setTemplateParam(templateParam);//可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时,此处的值为 "{\"code\":\"231145\"}"
request.setOutId(outId);//可选:outId为提供给业务方扩展字段,最终在短信回执消息中将此值带回给调用者 "zxh_out_id"
SendSmsResponse sendSmsResponse = new SendSmsResponse();
try{
sendSmsResponse = acsClient.getAcsResponse(request);//hint 此处可能会抛出异常,注意catch
}catch(Exception e){
e.printStackTrace();
sendSmsResponse.setCode("Exception");
sendSmsResponse.setMessage(e.getMessage());
}
return sendSmsResponse;
}
/**
* @param phoneNumber
* @param bizId
* @param sendDate 必填-发送日期 支持30天内记录查询,格式yyyyMMdd
* @return
* @throws ClientException
*/
private QuerySendDetailsResponse querySendDetails(String phoneNumber,String bizId,String sendDate) throws ClientException {
//可自助调整超时时间
System.setProperty("sun.net.client.defaultConnectTimeout", "10000");
System.setProperty("sun.net.client.defaultReadTimeout", "10000");
//初始化acsClient,暂不支持region化
IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", systemConfigService.getSingleConfigValue("ALI_SMS_ACCESS_KEY_ID"), systemConfigService.getSingleConfigValue("ALI_SMS_ACCESS_KEY_SECRET"));
DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", systemConfigService.getSingleConfigValue("ALI_SMS_PRODUCT"), systemConfigService.getSingleConfigValue("ALI_SMS_DOMAIN"));
IAcsClient acsClient = new DefaultAcsClient(profile);
//组装请求对象
QuerySendDetailsRequest request = new QuerySendDetailsRequest();
request.setPhoneNumber(phoneNumber);//必填-号码 "13917505984"
request.setBizId(bizId);//可选-流水号
// SimpleDateFormat ft = new SimpleDateFormat("yyyyMMdd");//必填-发送日期 支持30天内记录查询,格式yyyyMMdd
request.setSendDate(sendDate);//ft.format(new Date())
request.setPageSize(10L);//必填-页大小
request.setCurrentPage(1L);//必填-当前页码从1开始计数
QuerySendDetailsResponse querySendDetailsResponse = new QuerySendDetailsResponse();
try{
querySendDetailsResponse = acsClient.getAcsResponse(request);//hint 此处可能会抛出异常,注意catch
}catch(Exception e){
e.printStackTrace();
querySendDetailsResponse.setCode("Exception");
querySendDetailsResponse.setMessage(e.getMessage());
}
return querySendDetailsResponse;
}
/**
*
* @param smsRecord
* @return QuerySendDetailsResponse
*/
@Override
public SendSmsResponse sendSms(ShortMessageSendRecord smsRecord, String signName) {
String phoneNumber = smsRecord.getMobileNo();
String templateParam;
String outId = "ajb";
String templateCode;
SendSmsResponse sendSmsResponse = null;
if("1".equals(smsRecord.getSmsType())){//验证码短信
templateCode = systemConfigService.getSingleConfigValue("ALI_SMS_VERIFICATION_CODE_TEMPLATECODE");
templateParam = "{\"code\":\""+smsRecord.getVerificationCode()+"\"}";
}else if("2".equals(smsRecord.getSmsType())){//支付提醒短信
templateCode = systemConfigService.getSingleConfigValue("ALI_SMS_PAY_NOTIFY_TEMPLATECODE");
templateParam = smsRecord.getSmsContent();
}else if("3".equals(smsRecord.getSmsType())){//承保成功短信
templateCode = systemConfigService.getSingleConfigValue("ALI_SMS_POLICY_SUCCESS_NOTIFY_TEMPLATECODE");
templateParam = smsRecord.getSmsContent();
}else if("4".equals(smsRecord.getSmsType())){//生日祝福短信
templateCode = systemConfigService.getSingleConfigValue("ALI_SMS_BIRTHDAY_TEMPLATECODE");
templateParam = smsRecord.getSmsContent();
}else if("5".equals(smsRecord.getSmsType())){//提醒续保ALI_SMS_RENEWAL
templateCode = systemConfigService.getSingleConfigValue("ALI_SMS_RENEWAL");
templateParam = smsRecord.getSmsContent();
}else if("0".equals(smsRecord.getSmsType())){//其他临时短信
templateCode = smsRecord.getTemplateCode();
templateParam = smsRecord.getSmsContent();
}else{
templateCode = smsRecord.getTemplateCode();
templateParam = smsRecord.getSmsContent();
}
try {
signName = (CommonUtil.isNullOrBlank(signName)) ? systemConfigService.getSingleConfigValue("ALI_SMS_SIGN_NAME") : signName;
sendSmsResponse = send(phoneNumber, signName, templateCode, templateParam, outId);
smsRecord.setSendTime(new Date());
smsRecord.setSendStatus(sendSmsResponse.getCode());
smsRecord.setReturnMessage(sendSmsResponse.getMessage());
smsRecord.setRequestId(sendSmsResponse.getRequestId());
smsRecord.setBizId(sendSmsResponse.getBizId());
smsRecord.setSmsContent(templateParam);
smsRecord.setTemplateCode(templateCode);
shortMessageSendRecordService.save(smsRecord);
} catch (ClientException e) {
e.printStackTrace();
}
return sendSmsResponse;
}
public QuerySendDetailsResponse querySmsDetail(ShortMessageSendRecord smsRecord){
QuerySendDetailsResponse response = null;
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");//必填-发送日期 支持30天内记录查询,格式yyyyMMdd
String sendDate = sdf.format(smsRecord.getSendTime());
try {
response = querySendDetails(smsRecord.getMobileNo(),null, sendDate);
System.out.println("短信明细查询接口返回数据----------------");
System.out.println("Code=" + response.getCode());
System.out.println("Message=" + response.getMessage());
int i = 0;
for(QuerySendDetailsResponse.SmsSendDetailDTO smsSendDetailDTO : response.getSmsSendDetailDTOs())
{
System.out.println("SmsSendDetailDTO["+i+"]:");
System.out.println("Content=" + smsSendDetailDTO.getContent());
System.out.println("ErrCode=" + smsSendDetailDTO.getErrCode());
System.out.println("OutId=" + smsSendDetailDTO.getOutId());
System.out.println("PhoneNum=" + smsSendDetailDTO.getPhoneNum());
System.out.println("ReceiveDate=" + smsSendDetailDTO.getReceiveDate());
System.out.println("SendDate=" + smsSendDetailDTO.getSendDate());
System.out.println("SendStatus=" + smsSendDetailDTO.getSendStatus());
System.out.println("Template=" + smsSendDetailDTO.getTemplateCode());
}
System.out.println("TotalCount=" + response.getTotalCount());
System.out.println("RequestId=" + response.getRequestId());
} catch (ClientException e) {
e.printStackTrace();
}
return response;
}
public static void main(String[] args) {
}
}
<?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.agms.AclCustomerFortuneStatisticMapper">
<resultMap id="BaseResultMap" type="com.yd.dal.entity.agms.fortune.AclCustomerFortuneStatistic">
<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="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>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.yd.dal.entity.agms.fortune.AclCustomerFortuneStatistic">
<result column="remark" jdbcType="LONGVARCHAR" property="remark" />
</resultMap>
<sql id="Base_Column_List">
id, customer_id, accumulated_fortune, drawn_fortune, cancelled_fortune, created_at,
created_by, updated_at, updated_by
</sql>
<sql id="Blob_Column_List">
remark
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from ag_acl_customer_fortune_statistic
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
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.agms.fortune.AclCustomerFortuneStatistic" useGeneratedKeys="true">
insert into ag_acl_customer_fortune_statistic (customer_id, accumulated_fortune, drawn_fortune,
cancelled_fortune, created_at, created_by,
updated_at, updated_by, remark
)
values (#{customerId,jdbcType=BIGINT}, #{accumulatedFortune,jdbcType=DECIMAL}, #{drawnFortune,jdbcType=DECIMAL},
#{cancelledFortune,jdbcType=DECIMAL}, #{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT},
#{updatedAt,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=BIGINT}, #{remark,jdbcType=LONGVARCHAR}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.agms.fortune.AclCustomerFortuneStatistic" useGeneratedKeys="true">
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="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>
<if test="remark != null">
remark,
</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="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>
<if test="remark != null">
#{remark,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.agms.fortune.AclCustomerFortuneStatistic">
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="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>
<if test="remark != null">
remark = #{remark,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.yd.dal.entity.agms.fortune.AclCustomerFortuneStatistic">
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},
created_at = #{createdAt,jdbcType=TIMESTAMP},
created_by = #{createdBy,jdbcType=BIGINT},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
updated_by = #{updatedBy,jdbcType=BIGINT},
remark = #{remark,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.agms.fortune.AclCustomerFortuneStatistic">
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},
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>
<select id="findByCustomerId" resultMap="ResultMapWithBLOBs">
select * from ag_acl_customer_fortune_statistic
where customer_id = #{customerId,jdbcType=BIGINT}
</select>
</mapper>
\ No newline at end of file
...@@ -166,4 +166,50 @@ ...@@ -166,4 +166,50 @@
</if> </if>
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>
<insert id="save" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.agms.fortune.AclCustomerFortuneStatistic" useGeneratedKeys="true">
insert into ag_acl_customer_fortune (share_id, customer_id, order_id,
order_date, order_price, commission_rate,
commission_amount, fyc_rate, fyc_amount,
grade_commission_rate, share_rate, referral_rate,
referral_amount, month_period, commission_type,
drop_option_code, practitioner_level, is_tax,
tax_amount, net_amount, campaign_id,
campaign_name, withdrawable_date, payout_batch_id,
commission_payout_status, commission_payout_at,
commission_payout_by, withdrawed_id, fortune_payed_id,
created_at, created_by)
values (#{shareId,jdbcType=BIGINT}, #{customerId,jdbcType=BIGINT}, #{orderId,jdbcType=BIGINT},
#{orderDate,jdbcType=TIMESTAMP}, #{orderPrice,jdbcType=DECIMAL}, #{commissionRate,jdbcType=DECIMAL},
#{commissionAmount,jdbcType=DECIMAL}, #{fycRate,jdbcType=DECIMAL}, #{fycAmount,jdbcType=DECIMAL},
#{gradeCommissionRate,jdbcType=DECIMAL}, #{shareRate,jdbcType=DECIMAL}, #{referralRate,jdbcType=DECIMAL},
#{referralAmount,jdbcType=DECIMAL}, #{monthPeriod,jdbcType=VARCHAR}, #{commissionType,jdbcType=VARCHAR},
#{dropOptionCode,jdbcType=VARCHAR}, #{practitionerLevel,jdbcType=VARCHAR}, #{isTax,jdbcType=INTEGER},
#{taxAmount,jdbcType=DECIMAL}, #{netAmount,jdbcType=DECIMAL}, #{campaignId,jdbcType=BIGINT},
#{campaignName,jdbcType=VARCHAR}, #{withdrawableDate,jdbcType=TIMESTAMP}, #{payoutBatchId,jdbcType=BIGINT},
#{commissionPayoutStatus,jdbcType=VARCHAR}, #{commissionPayoutAt,jdbcType=TIMESTAMP},
#{commissionPayoutBy,jdbcType=BIGINT}, #{withdrawedId,jdbcType=BIGINT}, #{fortunePayedId,jdbcType=BIGINT},
#{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT})
</insert>
</mapper> </mapper>
\ No newline at end of file
...@@ -771,13 +771,27 @@ ...@@ -771,13 +771,27 @@
from ag_acl_customer from ag_acl_customer
where mobile_no = #{mobileNo,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler} where mobile_no = #{mobileNo,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler}
</select> </select>
<select id="findByIds" resultMap="BaseResultMap">
select <select id="findByIds" resultMap="BaseResultMap">
<include refid="Base_Column_List" /> select
from ag_acl_customer <include refid="Base_Column_List" />
where id in from ag_acl_customer
<foreach collection="customerIds" index="index" item="item" open="(" separator="," close=")"> where id in
#{item} <foreach collection="customerIds" index="index" item="item" open="(" separator="," close=")">
</foreach> #{item}
</select> </foreach>
</select>
<select id="findByObj" parameterType="com.yd.dal.entity.customer.AclCustomer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_acl_customer
where 1=1
<if test="mobileNo != null">
mobile_no = #{mobileNo,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler},
</if>
<if test="email != null">
email = #{email,jdbcType=VARCHAR},
</if>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
</insert> </insert>
<update id="checkComeCommission"> <update id="setOrderCommissionCheckId">
update ag_po_order update ag_po_order
<set> <set>
<if test="isSuccess != null"> <if test="isSuccess != null">
......
<?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.sms.ShortMessageSendRecordMapper">
<resultMap id="BaseResultMap" type="com.yd.dal.entity.sms.ShortMessageSendRecord">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="mobile_no" jdbcType="VARCHAR" property="mobileNo" />
<result column="business_type" jdbcType="VARCHAR" property="businessType" />
<result column="business_id" jdbcType="VARCHAR" property="businessId" />
<result column="sms_type" jdbcType="VARCHAR" property="smsType" />
<result column="sms_content" jdbcType="VARCHAR" property="smsContent" />
<result column="verification_code" jdbcType="VARCHAR" property="verificationCode" />
<result column="send_time" jdbcType="TIMESTAMP" property="sendTime" />
<result column="expire_time" jdbcType="TIMESTAMP" property="expireTime" />
<result column="send_status" jdbcType="VARCHAR" property="sendStatus" />
<result column="return_message" jdbcType="VARCHAR" property="returnMessage" />
<result column="request_id" jdbcType="VARCHAR" property="requestId" />
<result column="biz_id" jdbcType="VARCHAR" property="bizId" />
<result column="template_code" jdbcType="VARCHAR" property="templateCode" />
</resultMap>
<sql id="Base_Column_List">
id, mobile_no, business_type, business_id, sms_type, sms_content, verification_code,
send_time, expire_time, send_status, return_message, request_id, biz_id, template_code
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_sms_record
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ag_sms_record
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.sms.ShortMessageSendRecord" useGeneratedKeys="true">
insert into ag_sms_record (mobile_no, business_type, business_id,
sms_type, sms_content, verification_code,
send_time, expire_time, send_status,
return_message, request_id, biz_id,
template_code)
values (#{mobileNo,jdbcType=VARCHAR}, #{businessType,jdbcType=VARCHAR}, #{businessId,jdbcType=VARCHAR},
#{smsType,jdbcType=VARCHAR}, #{smsContent,jdbcType=VARCHAR}, #{verificationCode,jdbcType=VARCHAR},
#{sendTime,jdbcType=TIMESTAMP}, #{expireTime,jdbcType=TIMESTAMP}, #{sendStatus,jdbcType=VARCHAR},
#{returnMessage,jdbcType=VARCHAR}, #{requestId,jdbcType=VARCHAR}, #{bizId,jdbcType=VARCHAR},
#{templateCode,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.sms.ShortMessageSendRecord" useGeneratedKeys="true">
insert into ag_sms_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="mobileNo != null">
mobile_no,
</if>
<if test="businessType != null">
business_type,
</if>
<if test="businessId != null">
business_id,
</if>
<if test="smsType != null">
sms_type,
</if>
<if test="smsContent != null">
sms_content,
</if>
<if test="verificationCode != null">
verification_code,
</if>
<if test="sendTime != null">
send_time,
</if>
<if test="expireTime != null">
expire_time,
</if>
<if test="sendStatus != null">
send_status,
</if>
<if test="returnMessage != null">
return_message,
</if>
<if test="requestId != null">
request_id,
</if>
<if test="bizId != null">
biz_id,
</if>
<if test="templateCode != null">
template_code,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="mobileNo != null">
#{mobileNo,jdbcType=VARCHAR},
</if>
<if test="businessType != null">
#{businessType,jdbcType=VARCHAR},
</if>
<if test="businessId != null">
#{businessId,jdbcType=VARCHAR},
</if>
<if test="smsType != null">
#{smsType,jdbcType=VARCHAR},
</if>
<if test="smsContent != null">
#{smsContent,jdbcType=VARCHAR},
</if>
<if test="verificationCode != null">
#{verificationCode,jdbcType=VARCHAR},
</if>
<if test="sendTime != null">
#{sendTime,jdbcType=TIMESTAMP},
</if>
<if test="expireTime != null">
#{expireTime,jdbcType=TIMESTAMP},
</if>
<if test="sendStatus != null">
#{sendStatus,jdbcType=VARCHAR},
</if>
<if test="returnMessage != null">
#{returnMessage,jdbcType=VARCHAR},
</if>
<if test="requestId != null">
#{requestId,jdbcType=VARCHAR},
</if>
<if test="bizId != null">
#{bizId,jdbcType=VARCHAR},
</if>
<if test="templateCode != null">
#{templateCode,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.sms.ShortMessageSendRecord">
update ag_sms_record
<set>
<if test="mobileNo != null">
mobile_no = #{mobileNo,jdbcType=VARCHAR},
</if>
<if test="businessType != null">
business_type = #{businessType,jdbcType=VARCHAR},
</if>
<if test="businessId != null">
business_id = #{businessId,jdbcType=VARCHAR},
</if>
<if test="smsType != null">
sms_type = #{smsType,jdbcType=VARCHAR},
</if>
<if test="smsContent != null">
sms_content = #{smsContent,jdbcType=VARCHAR},
</if>
<if test="verificationCode != null">
verification_code = #{verificationCode,jdbcType=VARCHAR},
</if>
<if test="sendTime != null">
send_time = #{sendTime,jdbcType=TIMESTAMP},
</if>
<if test="expireTime != null">
expire_time = #{expireTime,jdbcType=TIMESTAMP},
</if>
<if test="sendStatus != null">
send_status = #{sendStatus,jdbcType=VARCHAR},
</if>
<if test="returnMessage != null">
return_message = #{returnMessage,jdbcType=VARCHAR},
</if>
<if test="requestId != null">
request_id = #{requestId,jdbcType=VARCHAR},
</if>
<if test="bizId != null">
biz_id = #{bizId,jdbcType=VARCHAR},
</if>
<if test="templateCode != null">
template_code = #{templateCode,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.sms.ShortMessageSendRecord">
update ag_sms_record
set mobile_no = #{mobileNo,jdbcType=VARCHAR},
business_type = #{businessType,jdbcType=VARCHAR},
business_id = #{businessId,jdbcType=VARCHAR},
sms_type = #{smsType,jdbcType=VARCHAR},
sms_content = #{smsContent,jdbcType=VARCHAR},
verification_code = #{verificationCode,jdbcType=VARCHAR},
send_time = #{sendTime,jdbcType=TIMESTAMP},
expire_time = #{expireTime,jdbcType=TIMESTAMP},
send_status = #{sendStatus,jdbcType=VARCHAR},
return_message = #{returnMessage,jdbcType=VARCHAR},
request_id = #{requestId,jdbcType=VARCHAR},
biz_id = #{bizId,jdbcType=VARCHAR},
template_code = #{templateCode,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</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