Commit de8c8f37 by guojuxing

Merge remote-tracking branch 'origin/developer' into developer

parents b4d69cec 8bf9e0d3
......@@ -26,7 +26,7 @@ public interface BillingOrderApiService {
*/
ServiceResponse<Integer> saveSmsOrderBuyNow(BillingOrderDTO billingOrderDTO, SmsPackageOrderItemDTO smsPackageOrderItemDTO);
ServiceResponse<BillingPayInfoDTO> paySmsPackageOrder(Integer enterpriseId, Integer orderId, Integer payType, String authCode, String userName);
ServiceResponse<BillingPayInfoDTO> paySmsPackageOrder(Integer enterpriseId, Integer orderId, Integer payType, String authCode, String userName, Integer userId);
/**
* 条件分页查询订单状态
......
......@@ -22,7 +22,7 @@ public class TabBillingOrder {
private String serialNumber;
/**
* 订单状态
* 订单状态 1:审核中 2:已取消 3:审核失败 4:审核通过(已完成) 0:待支付
*/
private Integer orderStatus;
......@@ -34,7 +34,7 @@ public class TabBillingOrder {
/**
* 支付方式 1微信 2支付宝 3.线下支付 4余额支付
*/
private Integer payType=0;
private Integer payType;
/**
* 应付金额
......@@ -56,7 +56,6 @@ public class TabBillingOrder {
*/
private Integer couponCardId;
/**
* 审批结果id
*/
......@@ -82,6 +81,16 @@ public class TabBillingOrder {
*/
private String itemJson;
/**
* 1:短信套餐包
*/
private Integer orderType;
/**
* 发起人
*/
private Integer initiatorUser;
public Integer getOrderId() {
return orderId;
}
......@@ -201,4 +210,20 @@ public class TabBillingOrder {
public void setItemJson(String itemJson) {
this.itemJson = itemJson;
}
public Integer getOrderType() {
return orderType;
}
public void setOrderType(Integer orderType) {
this.orderType = orderType;
}
public Integer getInitiatorUser() {
return initiatorUser;
}
public void setInitiatorUser(Integer initiatorUser) {
this.initiatorUser = initiatorUser;
}
}
\ No newline at end of file
......@@ -46,6 +46,7 @@ public class BillingOrderServiceImpl implements BillingOrderService {
billingOrder.setItemJson(billingOrderDTO.getItemJson());
billingOrder.setPayType(billingOrderDTO.getPayType());
billingOrder.setOrderContent(billingOrderDTO.getOrderContent());
billingOrder.setInitiatorUser(billingOrderDTO.getInitiatorUser());
tabBillingOrderMapper.insertSelective(billingOrder);
return billingOrder.getOrderId();
}
......
......@@ -193,7 +193,7 @@ public class BillingAccountApiServiceImpl implements BillingAccountApiService {
ServiceResponse<Integer> orderResponse = billingOrderApiService.saveSmsOrderBuyNow(orderDTO, itemDTO);
//订购短信套餐包
billingOrderApiService.
paySmsPackageOrder(enterpriseId, orderResponse.getResult(), PayTypeEnum.BALANCE_PAY.getCode(), null, null);
paySmsPackageOrder(enterpriseId, orderResponse.getResult(), PayTypeEnum.BALANCE_PAY.getCode(), null, null, null);
}
}
} else {
......
......@@ -98,7 +98,7 @@ public class BillingOrderApiServcImpl implements BillingOrderApiService {
@Override
@Transactional
public ServiceResponse<BillingPayInfoDTO> paySmsPackageOrder(Integer enterpriseId, Integer orderId, Integer payType,
String authCode, String userName){
String authCode, String userName, Integer userId){
TabBillingOrder order = this.billingOrderService.getOrderById(orderId);
OutPayDTO outPayDTO = new OutPayDTO();
outPayDTO.setEnterpriseId(enterpriseId);
......@@ -118,6 +118,7 @@ public class BillingOrderApiServcImpl implements BillingOrderApiService {
outPayDTO.setPayType(payType);
outPayDTO.setAuthCode(authCode);
outPayDTO.setInitiatorName(userName);
outPayDTO.setInitiatorUser(userId);
ServiceResponse<BillingPayInfoDTO> response = this.billingPayInfoApiService.savePrePayInfo(outPayDTO);
if(response.isSuccess()){
Integer payInfoId = response.getResult().getPayInfoId();
......
......@@ -12,6 +12,7 @@ import com.gic.enterprise.dto.ApprovalCallBackDTO;
import com.gic.enterprise.dto.BillingPayInfoDTO;
import com.gic.enterprise.dto.EnterpriseDTO;
import com.gic.enterprise.dto.OutPayDTO;
import com.gic.enterprise.entity.TabBillingOrder;
import com.gic.enterprise.entity.TabBillingPayInfo;
import com.gic.enterprise.entity.TabBillingRechargeRecord;
import com.gic.enterprise.entity.TabEnterprise;
......@@ -161,7 +162,7 @@ public class OfflineStrategy implements PayStrategy {
case 2:
// 短信套餐包购买
this.billingOrderService.updateBySerialNumber(resData.getOrderSerialNumber(), resData.getTotalFeePaid(), resData.getAuditStatus(), resData.getTimeEnd());
sendApprovalSms(resData, "GICJFZX008");
sendOrderApprovalSms(resData, "GICJFZX008");
break;
default:
break;
......@@ -184,6 +185,16 @@ public class OfflineStrategy implements PayStrategy {
sendSms(resData, userDTO, code);
}
private void sendOrderApprovalSms(ApprovalCallBackDTO resData, String code) {
// TabBillingRechargeRecord rechargeRecord = billingRechargeRecordService.getRechargeRecordBySerialNumber(resData.getOrderSerialNumber());
TabBillingOrder order = billingOrderService.getOrderBySerialNumber(resData.getOrderSerialNumber());
Integer initiator = order.getInitiatorUser();
if (initiator != null) {
UserDTO userDTO = userApiService.getUserById(initiator).getResult();
sendSms(resData, userDTO, code);
}
}
private void sendSms(ApprovalCallBackDTO resData, UserDTO userDTO, String code) {
try {
if (StringUtils.isBlank(userDTO.getPhoneAreaCode())) {
......
......@@ -17,11 +17,13 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="item_json" jdbcType="VARCHAR" property="itemJson" />
<result column="order_type" jdbcType="INTEGER" property="orderType" />
<result column="initiator_user" jdbcType="INTEGER" property="initiatorUser" />
</resultMap>
<sql id="Base_Column_List">
order_id, enterprise_id, serial_number, order_status, order_content, pay_type, total_fee,
total_fee_paid, pay_info_id, coupon_card_id, audit_result_id, status,
create_time, update_time, item_json
total_fee_paid, pay_info_id, coupon_card_id, audit_result_id, status, create_time,
update_time, item_json, order_type, initiator_user
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
......@@ -37,15 +39,15 @@
insert into tab_billing_order (order_id, enterprise_id, serial_number,
order_status, order_content, pay_type,
total_fee, total_fee_paid, pay_info_id,
coupon_card_id, audit_result_id,
status, create_time, update_time,
item_json)
coupon_card_id, audit_result_id, status,
create_time, update_time, item_json,
order_type, initiator_user)
values (#{orderId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{serialNumber,jdbcType=VARCHAR},
#{orderStatus,jdbcType=INTEGER}, #{orderContent,jdbcType=VARCHAR}, #{payType,jdbcType=INTEGER},
#{totalFee,jdbcType=DOUBLE}, #{totalFeePaid,jdbcType=DOUBLE}, #{payInfoId,jdbcType=INTEGER},
#{couponCardId,jdbcType=INTEGER}, #{auditResultId,jdbcType=INTEGER},
#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{itemJson,jdbcType=VARCHAR})
#{couponCardId,jdbcType=INTEGER}, #{auditResultId,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{itemJson,jdbcType=VARCHAR},
#{orderType,jdbcType=INTEGER}, #{initiatorUser,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.gic.enterprise.entity.TabBillingOrder">
<selectKey keyProperty="orderId" order="AFTER" resultType="java.lang.Integer">
......@@ -98,6 +100,12 @@
<if test="itemJson != null">
item_json,
</if>
<if test="orderType != null">
order_type,
</if>
<if test="initiatorUser != null">
initiator_user,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderId != null">
......@@ -145,6 +153,12 @@
<if test="itemJson != null">
#{itemJson,jdbcType=VARCHAR},
</if>
<if test="orderType != null">
#{orderType,jdbcType=INTEGER},
</if>
<if test="initiatorUser != null">
#{initiatorUser,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.enterprise.entity.TabBillingOrder">
......@@ -192,6 +206,12 @@
<if test="itemJson != null">
item_json = #{itemJson,jdbcType=VARCHAR},
</if>
<if test="orderType != null">
order_type = #{orderType,jdbcType=INTEGER},
</if>
<if test="initiatorUser != null">
initiator_user = #{initiatorUser,jdbcType=INTEGER},
</if>
</set>
where order_id = #{orderId,jdbcType=INTEGER}
</update>
......@@ -210,7 +230,9 @@
status = #{status,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
item_json = #{itemJson,jdbcType=VARCHAR}
item_json = #{itemJson,jdbcType=VARCHAR},
order_type = #{orderType,jdbcType=INTEGER},
initiator_user = #{initiatorUser,jdbcType=INTEGER}
where order_id = #{orderId,jdbcType=INTEGER}
</update>
<select id="getOrderByPayInfoId" resultMap="BaseResultMap">
......
......@@ -84,7 +84,7 @@ public class BillingOrderController {
vo.setCouponCardVO(EntityUtil.changeEntityByJSON(BillingCouponCardVO.class, couponCardDTO));
}
}
if(dto.getPayType().intValue() == PayTypeEnum.OFFLINE_PAY.getCode()){
if(dto.getPayType() != null && dto.getPayType() == PayTypeEnum.OFFLINE_PAY.getCode()){
ServiceResponse<TransferAccountsApprovalDTO> byOrderNumber = this.transferAccountsApprovalApiService.
getByOrderNumber(dto.getSerialNumber());
if(byOrderNumber.isSuccess()){
......
......@@ -7,6 +7,7 @@ import com.gic.auth.service.AuthCodeApiService;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.download.utils.log.LogUtils;
import com.gic.enterprise.base.UserInfo;
import com.gic.enterprise.constant.PackageHoursEnum;
import com.gic.enterprise.dto.*;
import com.gic.enterprise.qo.PageQO;
......@@ -82,6 +83,7 @@ public class PackageController {
orderDTO.setOrderContent(qo.getSmsPackageName());
orderDTO.setTotalFee(qo.getTotalFee());
orderDTO.setTotalFeePaid(qo.getTotalFeePaid());
orderDTO.setInitiatorUser(UserDetailUtils.getUserDetail().getUserId());
SmsPackageOrderItemDTO itemDTO = new SmsPackageOrderItemDTO();
itemDTO.setBuyCount(qo.getNum());
itemDTO.setCode(qo.getSmsPackageCode());
......@@ -109,8 +111,9 @@ public class PackageController {
}
this.authCodeApiService.expireAuthCode(authCodeId);
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
UserInfo userInfo = UserDetailUtils.getUserDetail().getUserInfo();
ServiceResponse<BillingPayInfoDTO> serviceResponse = this.billingOrderApiService.
paySmsPackageOrder(enterpriseId, orderId, payType, authCode, UserDetailUtils.getUserDetail().getUserInfo().getUserName());
paySmsPackageOrder(enterpriseId, orderId, payType, authCode, userInfo.getUserName(), userInfo.getUserId());
if(serviceResponse.isSuccess()){
BillingOrderDTO orderDTO = this.billingOrderApiService.getOrderById(orderId).getResult();
LogUtils.createLog("套餐包支付", orderDTO.getOrderContent());
......
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