Procházet zdrojové kódy

[补贴][修改]:补贴流水添加持有者信息

release_toaliyun_real
Stormeye Wu před 7 roky
rodič
revize
1b1b3e0bf1
3 změnil soubory, kde provedl 139 přidání a 81 odebrání
  1. +1
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/WxMerchantSubsidyController.java
  2. +82
    -50
      mallinkService/src/main/java/com/iformall/domain/vo/WxMerchantSubsidyVo.java
  3. +56
    -31
      mallinkService/src/main/resources/mapper/WxMerchantSubsidyMapper.xml

+ 1
- 0
mallinkAdmin/src/main/java/com/iformall/controller/WxMerchantSubsidyController.java Zobrazit soubor

@@ -82,6 +82,7 @@ public class WxMerchantSubsidyController extends BaseController {
wxMerchantSubsidy.setStatusS(tmpList);
}
}
wxMerchantSubsidy.setSortColumns(WxMerchantSubsidy.Field.CreateDate_DESC);
final PageInfo<WxMerchantSubsidyVo> page = wxMerchantSubsidyService.listAsPage(wxMerchantSubsidy, pageNum, pageSize);
return new ResultData(page);
}


+ 82
- 50
mallinkService/src/main/java/com/iformall/domain/vo/WxMerchantSubsidyVo.java Zobrazit soubor

@@ -1,7 +1,15 @@
package com.iformall.domain.vo;

import com.iformall.domain.po.WxMerchantSubsidy;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import javax.persistence.Transient;

@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class WxMerchantSubsidyVo extends WxMerchantSubsidy {
/**卡信息*/
/**封面图**/
@@ -27,59 +35,83 @@ public class WxMerchantSubsidyVo extends WxMerchantSubsidy {
@io.swagger.annotations.ApiModelProperty(value="商户名",name="name")
private String merchantName;

public String getCoverImg() {
return coverImg;
}

public void setCoverImg(String coverImg) {
this.coverImg = coverImg;
}

public String getTitle() {
return title;
}

public void setTitle(String title) {
this.title = title;
}

public String getSubTitle() {
return subTitle;
}

public void setSubTitle(String subTitle) {
this.subTitle = subTitle;
}

public Integer getUnit() {
return unit;
}

public void setUnit(Integer unit) {
this.unit = unit;
}

public String getDetail() {
return detail;
}

public void setDetail(String detail) {
this.detail = detail;
}

public String getRemark() {
return remark;
}

public void setRemark(String remark) {
this.remark = remark;
/**持有人昵称**/
@io.swagger.annotations.ApiModelProperty(value="持有人昵称",name="nickName")
private String nickName;

/**持有人手机**/
@io.swagger.annotations.ApiModelProperty(value="持有人手机",name="phone")
private String phone;

@Transient
protected String sortColumns;

public static enum Field
{
Id_ASC("t.`id` ASC"),Id_DESC("t.`id` DESC")
,TenantId_ASC("t.`tenant_id` ASC"),TenantId_DESC("t.`tenant_id` DESC")
,OrderId_ASC("t.`order_id` ASC"),OrderId_DESC("t.`order_id` DESC")
,OrderType_ASC("t.`order_type` ASC"),OrderType_DESC("t.`order_type` DESC")
,MerchantId_ASC("t.`merchant_id` ASC"),MerchantId_DESC("t.`merchant_id` DESC")
,CouponOrderId_ASC("t.`coupon_order_id` ASC"),CouponOrderId_DESC("t.`coupon_order_id` DESC")
,CouponType_ASC("t.`coupon_type` ASC"),CouponType_DESC("t.`coupon_type` DESC")
,OrderPayment_ASC("t.`order_payment` ASC"),OrderPayment_DESC("t.`order_payment` DESC")
,ReceiverPayment_ASC("t.`receiver_payment` ASC"),ReceiverPayment_DESC("t.`receiver_payment` DESC")
,RealPayment_ASC("t.`real_payment` ASC"),RealPayment_DESC("t.`real_payment` DESC")
,Subsidy_ASC("t.`subsidy` ASC"),Subsidy_DESC("t.`subsidy` DESC")
,RealSubsidy_ASC("t.`real_subsidy` ASC"),RealSubsidy_DESC("t.`real_subsidy` DESC")
,Status_ASC("t.`status` ASC"),Status_DESC("t.`status` DESC")
,CreateDate_ASC("t.`create_date` ASC"),CreateDate_DESC("t.`create_date` DESC")
,UpdateDate_ASC("t.`update_date` ASC"),UpdateDate_DESC("t.`update_date` 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();
}
}

public String getMerchantName() {
return merchantName;
public void setSortColumns(WxMerchantSubsidy.Field... fields)
{
if (fields == null || fields.length == 0) {
return;
}
for (int k = 0; k < fields.length; k++) {
if (fields[k] == null) {
return;
}
}
StringBuilder sb = new StringBuilder(fields[0].toString());
for (int k = 1; k < fields.length; k++) {
sb.append(",");
sb.append(fields[k].toString());
}
this.sortColumns = sb.toString();
}

public void setMerchantName(String merchantName) {
this.merchantName = merchantName;
public void setSortColumns(String sortColumns)
{
if (sortColumns == null || "".equals(sortColumns.trim())) {
return;
}
if (sortColumns.contains(",")) {
String[] cols = sortColumns.split(",");
java.util.List<WxMerchantSubsidy.Field> fList = new java.util.ArrayList();
for (int k = 0; k < cols.length; k++) {
fList.add(WxMerchantSubsidy.Field.valueOf(cols[k]));
}
this.setSortColumns(fList.toArray(new WxMerchantSubsidy.Field[fList.size()]));
} else {
this.setSortColumns(WxMerchantSubsidy.Field.valueOf(sortColumns));
}
}
}

+ 56
- 31
mallinkService/src/main/resources/mapper/WxMerchantSubsidyMapper.xml Zobrazit soubor

@@ -26,7 +26,10 @@
where 1 = 1
<if test=" null != id ">
and `id` = #{id}
</if>
</if>
<if test=" null != tenantId ">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != orderId ">
and `order_id` = #{orderId}
</if>
@@ -119,70 +122,76 @@
<result column="unit" jdbcType="INTEGER" property="unit" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="name" jdbcType="VARCHAR" property="merchantName" />

<result column="nick_name" jdbcType="VARCHAR" property="nickName" />
<result column="phone" jdbcType="VARCHAR" property="phone" />
</resultMap>

<sql id="allVoColumns">
ms.`id`,ms.`order_id`,ms.`order_type`,ms.`merchant_id`,ms.`coupon_order_id`,ms.`coupon_type`,
ms.`id`,ms.`tenant_id`,ms.`order_id`,ms.`order_type`,ms.`merchant_id`,ms.`coupon_order_id`,ms.`coupon_type`,
ms.`order_payment`,ms.`receiver_payment`,ms.`real_payment`,
ms.`subsidy`,ms.`real_subsidy`,ms.`status`,ms.`create_date`,ms.`update_date`,
c.`title`,c.`sub_title`,c.`unit`,m.`name`
c.`title`,c.`sub_title`,c.`unit`,m.`name`,
cu.`nick_name`, cu.`phone`
</sql>

<sql id="dynamicVoWhereConditions">
where 1 = 1
<if test=" null != id ">
and ms.`id` = #{id}
and t.`id` = #{id}
</if>
<if test=" null != tenantId ">
and t.`tenant_id` = #{tenantId}
</if>
<if test=" null != orderId ">
and ms.`order_id` = #{orderId}
and t.`order_id` = #{orderId}
</if>
<if test=" null != orderType ">
and ms.`order_type` = #{orderType}
and t.`order_type` = #{orderType}
</if>
<if test=" null != merchantId ">
and ms.`merchant_id` = #{merchantId}
and t.`merchant_id` = #{merchantId}
</if>
<if test=" null != couponOrderId ">
and ms.`coupon_order_id` = #{couponOrderId}
and t.`coupon_order_id` = #{couponOrderId}
</if>
<if test=" null != couponType ">
and ms.`coupon_type` = #{couponType}
and t.`coupon_type` = #{couponType}
</if>
<if test=" null != orderPayment ">
and ms.`order_payment` = #{orderPayment}
and t.`order_payment` = #{orderPayment}
</if>
<if test=" null != receiverPayment ">
and ms.`receiver_payment` = #{receiverPayment}
and t.`receiver_payment` = #{receiverPayment}
</if>
<if test=" null != realPayment ">
and ms.`real_payment` = #{realPayment}
and t.`real_payment` = #{realPayment}
</if>
<if test=" null != subsidy ">
and ms.`subsidy` = #{subsidy}
and t.`subsidy` = #{subsidy}
</if>
<if test=" null != realSubsidy ">
and ms.`real_subsidy` = #{realSubsidy}
and t.`real_subsidy` = #{realSubsidy}
</if>
<if test=" null != status ">
and ms.`status` = #{status}
and t.`status` = #{status}
</if>
<if test=" null != createDate ">
and ms.`create_date` = #{createDate}
and t.`create_date` = #{createDate}
</if>
<if test=" null != updateDate ">
and ms.`update_date` = #{updateDate}
and t.`update_date` = #{updateDate}
</if>
<if test=" null != startdate and null!=enddate">
and ms.`create_date` between #{startdate} and #{enddate}
and t.`create_date` between #{startdate} and #{enddate}
</if>
<if test=" null != statusS ">
and ms.`status` in
and t.`status` in
<foreach collection="statusS" index="index" item="sItem" open="(" separator="," close=")">
#{sItem}
</foreach>
</if>
<if test=" null != ids ">
and ms.`id` in
and t.`id` in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
#{idItem}
</foreach>
@@ -191,20 +200,36 @@
</sql>

<select id="findVoList" parameterType="com.iformall.domain.po.WxMerchantSubsidy" resultMap="VoBaseResultMap">
select <include refid="allVoColumns" />
from wx_merchant_subsidy ms
left join wx_coupon_order co on co.id = ms.coupon_order_id
left join wx_coupon c on c.id = co.coupon_id
left join wx_merchant m on m.id = ms.merchant_id
select * from
(
select <include refid="allVoColumns" />
from wx_merchant_subsidy ms
left join wx_coupon_order co on co.id = ms.coupon_order_id
left join wx_coupon c on c.id = co.coupon_id
left join wx_merchant m on m.id = ms.merchant_id
left join wx_card_spend cs on cs.order_id = ms.order_id
left join wx_c_user cu on cu.id = cs.owner_id
where ms.order_type = 3
union
select <include refid="allVoColumns" />
from wx_merchant_subsidy ms
left join wx_coupon_order co on co.id = ms.coupon_order_id
left join wx_coupon c on c.id = co.coupon_id
left join wx_merchant m on m.id = ms.merchant_id
left join wx_order o on o.id = ms.order_id
left join wx_c_user cu on cu.id = o.c_user_id
where ms.order_type = 0
) t
where 1=1
<include refid="dynamicVoWhereConditions" />
</select>

<select id="sumVoList" parameterType="com.iformall.domain.po.WxMerchantSubsidy" resultType="hashmap">
select ms.`merchant_id`, m.`name` as merchant_name,
IFNULL(sum(ms.`order_payment`),0) as sum_order_payment,
IFNULL(sum(ms.`receiver_payment`),0) as sum_receiver_payment,
IFNULL(sum(ms.`subsidy`),0) as sum_subsidy,
IFNULL(sum(ms.`real_subsidy`),0) as sum_real_subsidy
select ms.`merchant_id` merchantId, m.`name` as merchantName,
IFNULL(sum(ms.`order_payment`),0) as sumOrderPayment,
IFNULL(sum(ms.`receiver_payment`),0) as sumReceiverPayment,
IFNULL(sum(ms.`subsidy`),0) as sumSubsidy,
IFNULL(sum(ms.`real_subsidy`),0) as sumRealSubsidy
from wx_merchant_subsidy ms
left join wx_coupon_order co on co.id = ms.coupon_order_id
left join wx_coupon c on c.id = co.coupon_id


Načítá se…
Zrušit
Uložit