| @@ -226,6 +226,7 @@ public class WxMicroPayController extends BaseController { | |||||
| } | } | ||||
| } | } | ||||
| @RedisCache | |||||
| @ApiOperation("付款码支付交易流水分页列表接口") | @ApiOperation("付款码支付交易流水分页列表接口") | ||||
| @GetMapping("listMicroPay") | @GetMapping("listMicroPay") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @@ -245,6 +246,16 @@ public class WxMicroPayController extends BaseController { | |||||
| return wxOrderService.microPayListOnDateAsPage(getUser().getId(), EnumOrderType.MICROPAY.getCode(), date, null, null); | return wxOrderService.microPayListOnDateAsPage(getUser().getId(), EnumOrderType.MICROPAY.getCode(), date, null, null); | ||||
| } | } | ||||
| @ApiOperation("付款码支付某日异常交易分页列表接口") | |||||
| @GetMapping("listMicroPayExp") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "date", value = "日期yyyy-MM-dd", dataType = "string", paramType = "query"), | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query",required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query",required = true)}) | |||||
| public ResultData listMicroPayExp(String date, Integer pageNum, Integer pageSize) { | |||||
| return wxOrderService.microPayExpListOnDateAsPage(getUser().getId(), EnumOrderType.MICROPAY.getCode(), date, pageNum, pageSize); | |||||
| } | |||||
| @ApiOperation(value = "付款码支付退款", notes = "{\"orderId\":\"string\"}") | @ApiOperation(value = "付款码支付退款", notes = "{\"orderId\":\"string\"}") | ||||
| @PostMapping("/microPayRefund") | @PostMapping("/microPayRefund") | ||||
| @@ -0,0 +1,67 @@ | |||||
| package com.iformall.domain.vo; | |||||
| import com.iformall.domain.po.WxOrder; | |||||
| import io.swagger.annotations.ApiModelProperty; | |||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| import lombok.ToString; | |||||
| @Data | |||||
| @ToString(callSuper = true) | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class WxOrderPayExpVo extends WxOrder { | |||||
| /** 发券商户信息 */ | |||||
| @ApiModelProperty(value="商户名",name="merchantName") | |||||
| private String merchantName; | |||||
| @ApiModelProperty(value="b端用户姓名",name="bUserName") | |||||
| private String bUserName; | |||||
| @ApiModelProperty(value="b端用户手机号",name="bUserPhone") | |||||
| private String bUserPhone; | |||||
| /** c端用户信息 */ | |||||
| @ApiModelProperty(value="c用户绑定的手机号",name="cUserPhone") | |||||
| private String cUserPhone; | |||||
| @ApiModelProperty(value="c用户昵称",name="nickName") | |||||
| private String nickName; | |||||
| @ApiModelProperty(value="c用户名",name="cUserName") | |||||
| private String cUserName; | |||||
| @ApiModelProperty(value ="支付订单ID", name = "payOrderId") | |||||
| private Long payOrderId; | |||||
| @ApiModelProperty(value ="微信支付订单ID", name = "transactionId") | |||||
| private String transactionId; | |||||
| public static enum Field | |||||
| { | |||||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||||
| ,OrderNumber_ASC("`order_number` ASC"),OrderNumber_DESC("`order_number` DESC") | |||||
| ,TenantId_ASC("`tenant_id` ASC"),TenantId_DESC("`tenant_id` DESC") | |||||
| ,CUserId_ASC("`c_user_id` ASC"),CUserId_DESC("`c_user_id` DESC") | |||||
| ,CouponId_ASC("`product_id` ASC"),CouponId_DESC("`product_id` DESC") | |||||
| ,PaymentType_ASC("`payment_type` ASC"),PaymentType_DESC("`payment_type` DESC") | |||||
| ,Payment_ASC("`payment` ASC"),Payment_DESC("`payment` DESC") | |||||
| ,PaymentTime_ASC("`payment_time` ASC"),PaymentTime_DESC("`payment_time` DESC") | |||||
| ,OrderStatus_ASC("`order_status` ASC"),OrderStatus_DESC("`order_status` DESC") | |||||
| ,CreateDate_ASC("`create_date` ASC"),CreateDate_DESC("`create_date` DESC") | |||||
| ,UpdateDate_ASC("`update_date` ASC"),UpdateDate_DESC("`update_date` DESC") | |||||
| ,Detail_ASC("`detail` ASC"),Detail_DESC("`detail` DESC") | |||||
| ; | |||||
| private String value; | |||||
| Field(String value){ | |||||
| this.value = value; | |||||
| } | |||||
| public String getValue() { | |||||
| return value; | |||||
| } | |||||
| public void setCol(String value) { | |||||
| this.value = value; | |||||
| } | |||||
| @Override | |||||
| public String toString() { | |||||
| return this.getValue(); | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -1,6 +1,7 @@ | |||||
| package com.iformall.domain.vo; | package com.iformall.domain.vo; | ||||
| import com.iformall.domain.po.WxOrder; | import com.iformall.domain.po.WxOrder; | ||||
| import io.swagger.annotations.ApiModelProperty; | |||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | import lombok.ToString; | ||||
| @@ -13,20 +14,19 @@ import java.util.List; | |||||
| public class WxOrderPayVo extends WxOrder { | public class WxOrderPayVo extends WxOrder { | ||||
| /**发券商户信息*/ | /**发券商户信息*/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="商户名",name="merchantName") | |||||
| @ApiModelProperty(value="商户名",name="merchantName") | |||||
| private String merchantName; | private String merchantName; | ||||
| @io.swagger.annotations.ApiModelProperty(value="b端用户姓名",name="bUserName") | |||||
| @ApiModelProperty(value="b端用户姓名",name="bUserName") | |||||
| private String bUserName; | private String bUserName; | ||||
| @io.swagger.annotations.ApiModelProperty(value="b端用户手机号",name="bUserPhone") | |||||
| @ApiModelProperty(value="b端用户手机号",name="bUserPhone") | |||||
| private String bUserPhone; | private String bUserPhone; | ||||
| @io.swagger.annotations.ApiModelProperty(value="c用户绑定的手机号",name="cUserPhone") | |||||
| @ApiModelProperty(value="c用户绑定的手机号",name="cUserPhone") | |||||
| private String cUserPhone; | private String cUserPhone; | ||||
| @io.swagger.annotations.ApiModelProperty(value="c用户昵称",name="nickName") | |||||
| @ApiModelProperty(value="c用户昵称",name="nickName") | |||||
| private String nickName; | private String nickName; | ||||
| @io.swagger.annotations.ApiModelProperty(value="c用户名",name="cUserName") | |||||
| @ApiModelProperty(value="c用户名",name="cUserName") | |||||
| private String cUserName; | private String cUserName; | ||||
| public static enum Field | public static enum Field | ||||
| @@ -24,8 +24,10 @@ public interface WxOrderMapper extends CommonMapper<WxOrder, Long> { | |||||
| List<WxOrderCouponVo> findListOfCUser(WxOrder wxOrder); | List<WxOrderCouponVo> findListOfCUser(WxOrder wxOrder); | ||||
| List<WxOrderCouponVo> selectDetailOfCUser(WxOrder wxOrder); | List<WxOrderCouponVo> selectDetailOfCUser(WxOrder wxOrder); | ||||
| /** B端收银台(收款码支付) */ | |||||
| Map dayMicroPayAmountList(Map dateMap); | Map dayMicroPayAmountList(Map dateMap); | ||||
| List<WxOrderPayVo> findListOfMicroPayOrderByDate(Map dateMap); | List<WxOrderPayVo> findListOfMicroPayOrderByDate(Map dateMap); | ||||
| List<WxOrderPayExpVo> findListOfExpMicroPayOrderByDate(Map dateMap); | |||||
| List<MarkingSceneDataVo> queryForSceneRepotyHistory(HashMap<String,Object> params); | List<MarkingSceneDataVo> queryForSceneRepotyHistory(HashMap<String,Object> params); | ||||
| @@ -37,6 +37,14 @@ public interface WxOrderService { | |||||
| ResultData microPayListOnDateAsPage(Long bUserId, Integer type, String date, Integer pageIndex, Integer pageSize); | ResultData microPayListOnDateAsPage(Long bUserId, Integer type, String date, Integer pageIndex, Integer pageSize); | ||||
| /** | |||||
| * 根据日期 b用户查刷卡异常支付list | |||||
| * | |||||
| * @param bUserId B端用户) | |||||
| */ | |||||
| ResultData microPayExpListOnDateAsPage(Long bUserId, Integer type, String date, Integer pageIndex, Integer pageSize); | |||||
| /** | /** | ||||
| * 付款码支付 | * 付款码支付 | ||||
| * @param user | * @param user | ||||
| @@ -201,6 +201,68 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| return new ResultData(resultMap); | return new ResultData(resultMap); | ||||
| } | } | ||||
| @Override | |||||
| public ResultData microPayExpListOnDateAsPage(Long bUserId, Integer type, String date, Integer pageIndex, Integer pageSize) { | |||||
| WxMerchantBUser wxMerchantBUser = wxMerchantBUserMapper.selectById(bUserId.longValue()); | |||||
| if (wxMerchantBUser == null) { | |||||
| logger.error("B端用户不存在:" + bUserId); | |||||
| throw new MallinkException(ErrorCode.MERCHANT_INFO_NOT_FOUND); | |||||
| } | |||||
| WxMerchant wxMerchant = wxMerchantMapper.selectById(wxMerchantBUser.getMerchantId()); | |||||
| if (wxMerchant == null) { | |||||
| logger.error("商户不存在:" + bUserId); | |||||
| throw new MallinkException(ErrorCode.MERCHANT_INFO_NOT_FOUND); | |||||
| } | |||||
| SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd"); | |||||
| String dateString; | |||||
| Date startDate; | |||||
| Date endDate; | |||||
| if (date == null) { | |||||
| endDate = new Date(); | |||||
| dateString = fmt.format(new Date()); | |||||
| try { | |||||
| startDate = fmt.parse(dateString); | |||||
| } catch (ParseException e) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_CAST_ERROR); | |||||
| } | |||||
| } else { | |||||
| try { | |||||
| startDate = fmt.parse(date); | |||||
| } catch (ParseException e) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_CAST_ERROR); | |||||
| } | |||||
| Calendar cal = Calendar.getInstance(); | |||||
| cal.setTime(startDate); | |||||
| cal.add(Calendar.DATE, 1); | |||||
| endDate = cal.getTime(); | |||||
| } | |||||
| Map dateMap = new HashMap(); | |||||
| dateMap.put("startDate", startDate); | |||||
| dateMap.put("endDate", endDate); | |||||
| dateMap.put("merchantId", wxMerchant.getId()); | |||||
| dateMap.put("type", type); | |||||
| Map resultMap = new HashMap(); | |||||
| if (pageIndex == null || pageSize == null) { | |||||
| List<WxOrderPayExpVo> list; | |||||
| list = wxOrderMapper.findListOfExpMicroPayOrderByDate(dateMap); | |||||
| logger.info("find " + list.size() + " order from " + startDate + " to " + new Date()); | |||||
| int total_price = 0; | |||||
| for (WxOrder order : list) { | |||||
| total_price = total_price + order.getPayment(); | |||||
| } | |||||
| resultMap.put("amount", total_price); | |||||
| } else { | |||||
| resultMap.put("list", PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxOrderMapper.findListOfExpMicroPayOrderByDate(dateMap))); | |||||
| } | |||||
| return new ResultData(resultMap); | |||||
| } | |||||
| /** | /** | ||||
| * 拼团数量 | * 拼团数量 | ||||
| * | * | ||||
| @@ -430,6 +430,69 @@ | |||||
| order by o.create_date desc | order by o.create_date desc | ||||
| </select> | </select> | ||||
| <resultMap id="PayExpVoResultMap" type="com.iformall.domain.vo.WxOrderPayExpVo"> | |||||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||||
| <result column="order_number" jdbcType="BIGINT" property="orderNumber"/> | |||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||||
| <result column="c_user_id" jdbcType="BIGINT" property="cUserId"/> | |||||
| <result column="coupon_channel_id" jdbcType="BIGINT" property="couponChannelId"/> | |||||
| <result column="product_id" jdbcType="BIGINT" property="productId"/> | |||||
| <result column="type" jdbcType="TINYINT" property="type"/> | |||||
| <result column="payment_type" jdbcType="INTEGER" property="paymentType"/> | |||||
| <result column="payment" jdbcType="INTEGER" property="payment"/> | |||||
| <result column="payment_time" jdbcType="TIMESTAMP" property="paymentTime"/> | |||||
| <result column="order_status" jdbcType="INTEGER" property="orderStatus"/> | |||||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> | |||||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> | |||||
| <result column="detail" jdbcType="VARCHAR" property="detail"/> | |||||
| <result column="merchant_name" jdbcType="VARCHAR" property="merchantName" /> | |||||
| <result column="name" jdbcType="VARCHAR" property="bUserName" /> | |||||
| <result column="bphone" jdbcType="VARCHAR" property="bUserPhone" /> | |||||
| <result column="phone" jdbcType="VARCHAR" property="cUserPhone" /> | |||||
| <result column="nick_name" jdbcType="VARCHAR" property="nickName" /> | |||||
| <result column="c_user_name" jdbcType="VARCHAR" property="cUserName" /> | |||||
| <result column="pay_order_id" jdbcType="BIGINT" property="payOrderId"/> | |||||
| <result column="transaction_id" jdbcType="VARCHAR" property="transactionId"/> | |||||
| </resultMap> | |||||
| <sql id="allExpPayOrderColumns"> | |||||
| o.`id`,o.`order_number`,o.`tenant_id`,o.`c_user_id`,o.`coupon_channel_id`,o.`product_id`,o.`type`, | |||||
| o.`payment_type`,o.`payment`,o.`payment_time`,o.`order_status`,o.`create_date`,o.`update_date`,o.`detail`, | |||||
| m.name as merchant_name, bu.name, bu.phone as bphone, | |||||
| cu.phone, cu.nick_name, cubi.name c_user_name, | |||||
| po.id as pay_order_id, po.transaction_id | |||||
| </sql> | |||||
| <select id="findListOfExpMicroPayOrderByDate" parameterType="map" resultMap="PayExpVoResultMap"> | |||||
| select | |||||
| <include refid="allExpPayOrderColumns"/> | |||||
| from wx_order o | |||||
| inner join wx_merchant_b_user bu on bu.id = o.product_id | |||||
| inner join wx_merchant m on m.id = bu.merchant_id | |||||
| left join wx_pay_order po on po.order_id = o.id | |||||
| LEFT JOIN wx_c_user cu on cu.id = o.c_user_id | |||||
| LEFT JOIN wx_c_user_basic_info cubi on cubi.id = o.c_user_id | |||||
| where o.order_status = '0' and o.`type` = 1 | |||||
| <if test=" null != tenantId "> | |||||
| and o.`tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != merchantId "> | |||||
| and bu.`merchant_id` = #{merchantId} | |||||
| </if> | |||||
| <if test=" null != bUserId "> | |||||
| and bu.`id` = #{bUserId} | |||||
| </if> | |||||
| <if test="startDate != null"> | |||||
| AND o.create_date > #{startDate,jdbcType=TIMESTAMP} | |||||
| </if> | |||||
| <if test="endDate != null"> | |||||
| AND o.create_date < #{endDate,jdbcType=TIMESTAMP} | |||||
| </if> | |||||
| order by o.create_date desc | |||||
| </select> | |||||
| <select id="queryForSceneRepotyHistory" resultType="com.iformall.domain.vo.MarkingSceneDataVo" parameterType="hashmap"> | <select id="queryForSceneRepotyHistory" resultType="com.iformall.domain.vo.MarkingSceneDataVo" parameterType="hashmap"> | ||||
| select DATE_FORMAT(o.create_date,'%Y-%m-%d') xTime, count(o.id) triggerCount | select DATE_FORMAT(o.create_date,'%Y-%m-%d') xTime, count(o.id) triggerCount | ||||
| from wx_order o | from wx_order o | ||||