| @@ -128,7 +128,6 @@ public class WxCouponOrderBVo extends WxCouponOrder{ | |||
| public Date getStartDate() { | |||
| return startDate; | |||
| } | |||
| @@ -294,4 +293,13 @@ public class WxCouponOrderBVo extends WxCouponOrder{ | |||
| this.priceStr = priceStr; | |||
| } | |||
| public List<WxMerchantVo> getMerchantVoList() { | |||
| return merchantVoList; | |||
| } | |||
| public void setMerchantVoList(List<WxMerchantVo> merchantVoList) { | |||
| this.merchantVoList = merchantVoList; | |||
| } | |||
| } | |||
| @@ -1,5 +1,6 @@ | |||
| package com.iformall.domain.vo; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import com.iformall.domain.po.WxCouponOrder; | |||
| import javax.persistence.Id; | |||
| @@ -7,6 +8,7 @@ import javax.persistence.Transient; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| @JsonIgnoreProperties(value = {"handler"}) | |||
| public class WxCouponOrderCVo extends WxCouponOrder { | |||
| /** | |||
| @@ -111,37 +113,23 @@ public class WxCouponOrderCVo extends WxCouponOrder { | |||
| @io.swagger.annotations.ApiModelProperty(value="购买须知",name="remark") | |||
| private String remark; | |||
| /*发券商户信息*/ | |||
| /*商户图片**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商户图片",name="imgUrl") | |||
| private String merchantImgUrl; | |||
| /*商户名**/ | |||
| /*使用商户名**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商户名",name="name") | |||
| private String merchantName; | |||
| /*联系方式**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商户联系方式",name="linkPhone") | |||
| private String merchantLinkPhone; | |||
| /*商户状态**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商户状态1可用0停用",name="status") | |||
| private Integer merchantStatus; | |||
| /*发券商户信息*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商户列表",name="merchantVoList") | |||
| private List<WxMerchantVo> merchantVoList; | |||
| /*地址**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="地址",name="addr") | |||
| private String addr; | |||
| /*百度poi(省市区县street等)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="百度poi(省市区县street等)",name="baiduPoi") | |||
| private String baiduPoi; | |||
| /*商铺编号**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商铺编号",name="shopNumber") | |||
| private String shopNumber; | |||
| /*楼座号**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="楼座",name="buildingName") | |||
| private String buildingName; | |||
| /*楼层号**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="楼层",name="floorName") | |||
| private String floorName; | |||
| public List<WxMerchantVo> getMerchantVoList() { | |||
| return merchantVoList; | |||
| } | |||
| public void setMerchantVoList(List<WxMerchantVo> merchantVoList) { | |||
| this.merchantVoList = merchantVoList; | |||
| } | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| @@ -263,7 +251,6 @@ public class WxCouponOrderCVo extends WxCouponOrder { | |||
| public Integer getUnit() { | |||
| return unit; | |||
| } | |||
| public void setUnit(Integer unit) { | |||
| this.unit = unit; | |||
| } | |||
| @@ -275,126 +262,12 @@ public class WxCouponOrderCVo extends WxCouponOrder { | |||
| remark = _remark; | |||
| } | |||
| public String getBuildingName() {return buildingName; } | |||
| public void setBuildingName(String _building) { | |||
| buildingName = _building; | |||
| } | |||
| public String getFloorName() { | |||
| return floorName; | |||
| } | |||
| public void setFloorName(String _floor) { | |||
| floorName = _floor; | |||
| } | |||
| public String getShopNumber() { | |||
| return shopNumber; | |||
| } | |||
| public void setShopNumber(String _shopNumber) { | |||
| shopNumber = _shopNumber; | |||
| } | |||
| public String getBaiduPoi() { | |||
| return baiduPoi; | |||
| } | |||
| public void setBaiduPoi(String _baiduPoi) { | |||
| baiduPoi = _baiduPoi; | |||
| } | |||
| public String getAddr() { | |||
| return addr; | |||
| } | |||
| public void setAddr(String _addr) { | |||
| addr = _addr; | |||
| } | |||
| public String getMerChantImgUrl() { | |||
| return merchantImgUrl; | |||
| } | |||
| public void setMerChantImgUrl(String _imgUrl) { | |||
| merchantImgUrl = _imgUrl; | |||
| } | |||
| public String getMerchantName() { | |||
| return merchantName; | |||
| } | |||
| public void setMerchantName(String _name) { | |||
| merchantName = _name; | |||
| } | |||
| public String getMerchantLinkPhone() { | |||
| return merchantLinkPhone; | |||
| } | |||
| public void setMerchantLinkPhone(String _linkPhone) { | |||
| merchantLinkPhone = _linkPhone; | |||
| } | |||
| public Integer getMerchantStatus() { | |||
| return merchantStatus; | |||
| } | |||
| public void setMerchantStatus(Integer status) { | |||
| this.merchantStatus = status; | |||
| } | |||
| public static enum Field { | |||
| Id_ASC("`id` ASC"), Id_DESC("`id` DESC"), | |||
| TenantId_ASC("`tenant_id` ASC"), TenantId_DESC("`tenant_id` DESC"), | |||
| CouponId_ASC("`coupon_id` ASC"), CouponId_DESC("`coupon_id` DESC"), | |||
| CUserId_ASC("`c_user_id` ASC"), UserId_DESC("`c_user_id` DESC"), | |||
| BUserId_ASC("`b_user_id` ASC"), BUserId_DESC("`b_user_id` DESC"), | |||
| OrderId_ASC("`order_id` ASC"), OrderId_DESC("`order_id` DESC"), | |||
| ExpiredTime_ASC("`expired_time` ASC"), ExpiredTime_DESC("`expired_time` DESC"), | |||
| CouponOrderStatus_ASC("`coupon_order_status` ASC"), CouponOrderStatus_DESC("`coupon_order_status` DESC"), | |||
| CreateDate_ASC("`create_date` ASC"), CreateDate_DESC("`create_date` DESC"), | |||
| UpdateDate_ASC("`update_date` ASC"), UpdateDate_DESC("`update_date` DESC"), | |||
| CouponPrice_ASC("`coupon_price` ASC"), CouponPrice_DESC("`coupon_price` 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 void setSortColumns(WxCouponOrder.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 setSortColumns(String sortColumns) { | |||
| if (sortColumns == null || "".equals(sortColumns.trim())) { | |||
| return; | |||
| } | |||
| if (sortColumns.contains(",")) { | |||
| String[] cols = sortColumns.split(","); | |||
| java.util.List<WxCouponOrder.Field> fList = new java.util.ArrayList(); | |||
| for (int k = 0; k < cols.length; k++) { | |||
| fList.add(WxCouponOrder.Field.valueOf(cols[k])); | |||
| } | |||
| this.setSortColumns(fList.toArray(new WxCouponOrder.Field[fList.size()])); | |||
| } else { | |||
| this.setSortColumns(WxCouponOrder.Field.valueOf(sortColumns)); | |||
| } | |||
| } | |||
| } | |||
| @@ -23,71 +23,4 @@ public class WxCouponOrderCarCVo extends WxCouponOrderCVo { | |||
| this.couponFreeId = couponFreeId; | |||
| } | |||
| public static enum Field { | |||
| Id_ASC("`id` ASC"), Id_DESC("`id` DESC"), | |||
| TenantId_ASC("`tenant_id` ASC"), TenantId_DESC("`tenant_id` DESC"), | |||
| CouponId_ASC("`coupon_id` ASC"), couponId_DESC("`coupon_id` DESC"), | |||
| CUserId_ASC("`c_user_id` ASC"), CUserId_DESC("`c_user_id` DESC"), | |||
| BUserId_ASC("`b_user_id` ASC"), BUserId_DESC("`b_user_id` DESC"), | |||
| OrderId_ASC("`order_id` ASC"), OrderId_DESC("`order_id` DESC"), | |||
| ExpiredTime_ASC("`expired_iime` ASC"), ExpiredTime_DESC("`expired_iime` DESC"), | |||
| CouponOrderStatus_ASC("`coupon_order_status` ASC"), CouponOrderStatus_DESC("`coupon_order_status` DESC"), | |||
| CreateDate_ASC("`create_date` ASC"), CreateDate_DESC("`create_date` DESC"), | |||
| UpdateDate_ASC("`update_date` ASC"), UpdateDate_DESC("`update_date` DESC"), | |||
| CouponPrice_ASC("`coupon_price` ASC"), CouponPrice_DESC("`coupon_price` DESC"), | |||
| CouponFreeId_ASC("`coupon_free_id` ASC"), CouponFreeId_DESC("`coupon_free_id` 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 void setSortColumns(WxCouponOrder.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 setSortColumns(String sortColumns) { | |||
| if (sortColumns == null || "".equals(sortColumns.trim())) { | |||
| return; | |||
| } | |||
| if (sortColumns.contains(",")) { | |||
| String[] cols = sortColumns.split(","); | |||
| List<WxCouponOrder.Field> fList = new java.util.ArrayList(); | |||
| for (int k = 0; k < cols.length; k++) { | |||
| fList.add(WxCouponOrder.Field.valueOf(cols[k])); | |||
| } | |||
| this.setSortColumns(fList.toArray(new WxCouponOrder.Field[fList.size()])); | |||
| } else { | |||
| this.setSortColumns(WxCouponOrder.Field.valueOf(sortColumns)); | |||
| } | |||
| } | |||
| } | |||
| @@ -128,7 +128,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| logger.error("商户不存在:" + bUserId); | |||
| throw new MallinkException(ErrorCode.MERCHANT_INFO_NOT_FOUND); | |||
| } | |||
| /* | |||
| SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd"); | |||
| String dateString; | |||
| Date startDate; | |||
| @@ -153,10 +153,10 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| cal.add(Calendar.DATE, 1); | |||
| endDate = cal.getTime(); | |||
| } | |||
| */ | |||
| Map dateMap = new HashMap(); | |||
| dateMap.put("startDate", startDate); | |||
| dateMap.put("endDate", endDate); | |||
| // dateMap.put("startDate", startDate); | |||
| // dateMap.put("endDate", endDate); | |||
| dateMap.put("merchantId", wxMerchant.getId()); | |||
| Map resultMap = new HashMap(); | |||
| @@ -167,7 +167,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| list = wxCouponOrderMapper.findListOfVerifiedByDate(dateMap); | |||
| else | |||
| list = wxCouponOrderMapper.findListOfOrderedByDate(dateMap); | |||
| logger.info("find " + list.size() + " coupon order from " + startDate + " to " + new Date()); | |||
| //logger.info("find " + list.size() + " coupon order from " + /startDate + " to " + new Date()); | |||
| resultMap.put("amount", list.stream().mapToInt(p->p.getCouponPrice()).sum()); | |||
| } else { | |||
| if (isVerified) | |||
| @@ -376,7 +376,7 @@ | |||
| <select id="findListOfOrderedByDateForBUser" parameterType="map" resultMap="BVoResultMap"> | |||
| select <include refid="allBUserOrderedCouponOrderColumns" /> | |||
| from wx_coupon_order co,wx_order o,wx_coupon c,wx_c_user cu,wx_coupon_merchant cm | |||
| from wx_coupon_order co,wx_order o,wx_coupon c,wx_c_user cu,wx_coupon_merchant cm, | |||
| (select tco.id as tcoid, | |||
| (select count(*) from wx_coupon_merchant tcm | |||
| where tcm.product_id = tco.coupon_id) as mc | |||
| @@ -451,7 +451,7 @@ | |||
| <sql id="allCUserCouponOrderListColumns"> | |||
| co.id,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price, | |||
| co.id,co.coupon_id,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price, | |||
| c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.price,c.unit | |||
| </sql> | |||
| @@ -494,23 +494,23 @@ | |||
| <select id="findListOfCUser" parameterType="com.iformall.domain.vo.WxCouponOrderCVo" resultMap="CVoResultMap"> | |||
| select <include refid="allCUserCouponOrderListColumns" /> | |||
| from wx_coupon_order c,wx_coupon co | |||
| from wx_coupon_order co,wx_coupon c | |||
| where 1=1 | |||
| and c.coupon_id = co.id | |||
| and co.coupon_id = c.id | |||
| <if test="cUserId != null"> | |||
| and c.c_user_id = #{cUserId} | |||
| and co.c_user_id = #{cUserId} | |||
| </if> | |||
| <if test="tenantId != null"> | |||
| and c.tenant_id = #{tenantId} | |||
| and co.tenant_id = #{tenantId} | |||
| </if> | |||
| <if test="type != null"> | |||
| and co.type = #{type} | |||
| and c.type = #{type} | |||
| </if> | |||
| <if test="type == null"> | |||
| and co.type < 5 | |||
| and c.type < 5 | |||
| </if> | |||
| <if test="couponOrderStatus != null"> | |||
| AND c.coupon_order_status = #{couponOrderStatus} | |||
| AND co.coupon_order_status = #{couponOrderStatus} | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </select> | |||