Explorar el Código

合并成coupon

release_toaliyun_real
masterspirit hace 7 años
padre
commit
2e1e7656e9
Se han modificado 5 ficheros con 0 adiciones y 664 borrados
  1. +0
    -71
      mallinkAdmin/src/main/java/com/simple/controller/WxCouponActivityController.java
  2. +0
    -321
      mallinkService/src/main/java/com/simple/domain/po/WxCouponActivity.java
  3. +0
    -48
      mallinkService/src/main/java/com/simple/service/WxCouponActivityService.java
  4. +0
    -54
      mallinkService/src/main/java/com/simple/service/impl/WxCouponActivityServiceImpl.java
  5. +0
    -170
      mallinkService/src/main/resources/mapper/WxCouponActivityMapper.xml

+ 0
- 71
mallinkAdmin/src/main/java/com/simple/controller/WxCouponActivityController.java Ver fichero

@@ -1,71 +0,0 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxCouponActivity;
import com.simple.service.WxCouponActivityService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("wxCouponActivity")
public class WxCouponActivityController extends BaseController
{
@Autowired
private WxCouponActivityService wxCouponActivityService;

private Logger logger = Logger.getLogger(WxCouponActivityController.class);
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxCouponActivity wxCouponActivity,Integer pageNum, Integer pageSize) {
if (null == wxCouponActivity) wxCouponActivity = new WxCouponActivity();
final PageInfo<WxCouponActivity> page = wxCouponActivityService.listAsPage(wxCouponActivity, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxCouponActivity wxCouponActivity) {
//Assert.notNull(wxCouponActivity.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxCouponActivityService.saveOrUpdate(wxCouponActivity);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxCouponActivity wxCouponActivity) {
wxCouponActivityService.saveOrUpdate(wxCouponActivity);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxCouponActivityService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxCouponActivityService.getById(id));
}
}

+ 0
- 321
mallinkService/src/main/java/com/simple/domain/po/WxCouponActivity.java Ver fichero

@@ -1,321 +0,0 @@
package com.simple.domain.po;

import javax.persistence.*;
import java.util.*;
import java.math.*;
import javax.persistence.Transient;
import java.util.List;
import javax.persistence.Id;
import java.io.Serializable;

@Table(name = "wx_coupon_activity")
public class WxCouponActivity implements Serializable {
private static final long serialVersionUID = 1L;
@Id
protected Long id;
@Transient
protected List<String> ids;
@Transient
protected String sortColumns;
public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}
public String getSortColumns() {
return sortColumns;
}
public List<String> getIds() {
return ids;
}
public void setIds(List<String> ids) {
this.ids = ids;
}
/*租户ID**/
@io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId")
private String tenantId;
/*商户id**/
@io.swagger.annotations.ApiModelProperty(value="商户id",name="merchantId")
private Long merchantId;
/*券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券)**/
@io.swagger.annotations.ApiModelProperty(value="券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券)",name="type")
private Integer type;
/*封面图**/
@io.swagger.annotations.ApiModelProperty(value="封面图",name="coverImg")
private String coverImg;
/*券名称**/
@io.swagger.annotations.ApiModelProperty(value="券名称",name="title")
private String title;
/*副标题**/
@io.swagger.annotations.ApiModelProperty(value="副标题",name="subTitle")
private String subTitle;
/*售价(适用于类型2,3,4,5)**/
@io.swagger.annotations.ApiModelProperty(value="售价(适用于类型2,3,4,5)",name="salePrice")
private BigDecimal salePrice;
/*使用条件金额(适用于类型1,2,3,4)**/
@io.swagger.annotations.ApiModelProperty(value="使用条件金额(适用于类型1,2,3,4)",name="usePrice")
private BigDecimal usePrice;
/*限领张数**/
@io.swagger.annotations.ApiModelProperty(value="限领张数",name="useLimitQuantity")
private Integer useLimitQuantity;
/*发放开始时间**/
@io.swagger.annotations.ApiModelProperty(value="发放开始时间",name="sendStartDate")
private Date sendStartDate;
/*发放结束时间**/
@io.swagger.annotations.ApiModelProperty(value="发放结束时间",name="sendEndDate")
private Date sendEndDate;
/*有效日期-开始**/
@io.swagger.annotations.ApiModelProperty(value="有效日期-开始",name="validStartDate")
private Date validStartDate;
/*有效日期-结束**/
@io.swagger.annotations.ApiModelProperty(value="有效日期-结束",name="validEndDate")
private Date validEndDate;
/*自领取之日几日有效,(停车券当天有效)**/
@io.swagger.annotations.ApiModelProperty(value="自领取之日几日有效,(停车券当天有效)",name="validDays")
private Integer validDays;
/*须知**/
@io.swagger.annotations.ApiModelProperty(value="须知",name="detail")
private String detail;
/*发券方式(1.主动领取,2.定向投放)**/
@io.swagger.annotations.ApiModelProperty(value="发券方式(1.主动领取,2.定向投放)",name="sendType")
private Integer sendType;
/*定向投放(1.banner图,2.限时抢购)**/
@io.swagger.annotations.ApiModelProperty(value="定向投放(1.banner图,2.限时抢购)",name="targetAd")
private Integer targetAd;
/*业态**/
@io.swagger.annotations.ApiModelProperty(value="业态",name="businesses")
private String businesses;
/*面额**/
@io.swagger.annotations.ApiModelProperty(value="面额",name="price")
private BigDecimal price;
/*库存**/
@io.swagger.annotations.ApiModelProperty(value="库存",name="number")
private Integer number;
/*总数**/
@io.swagger.annotations.ApiModelProperty(value="总数",name="total")
private Integer total;
/*状态(0:草稿,1:待生效,2:已生效,3:已失效,4:已作废)**/
@io.swagger.annotations.ApiModelProperty(value="状态(0:草稿,1:待生效,2:已生效,3:已失效,4:已作废)",name="status")
private Integer status;
public String getTenantId() {
return tenantId;
}
public void setTenantId(String _tenantId) {
tenantId = _tenantId;
}
public Long getMerchantId() {
return merchantId;
}
public void setMerchantId(Long _merchantId) {
merchantId = _merchantId;
}
public Integer getType() {
return type;
}
public void setType(Integer _type) {
type = _type;
}
public String getCoverImg() {
return coverImg;
}
public void setCoverImg(String _coverImg) {
coverImg = _coverImg;
}
public String getTitle() {
return title;
}
public void setTitle(String _title) {
title = _title;
}
public String getSubTitle() {
return subTitle;
}
public void setSubTitle(String _subTitle) {
subTitle = _subTitle;
}
public BigDecimal getSalePrice() {
return salePrice;
}
public void setSalePrice(BigDecimal _salePrice) {
salePrice = _salePrice;
}
public BigDecimal getUsePrice() {
return usePrice;
}
public void setUsePrice(BigDecimal _usePrice) {
usePrice = _usePrice;
}
public Integer getUseLimitQuantity() {
return useLimitQuantity;
}
public void setUseLimitQuantity(Integer _useLimitQuantity) {
useLimitQuantity = _useLimitQuantity;
}
public Date getSendStartDate() {
return sendStartDate;
}
public void setSendStartDate(Date _sendStartDate) {
sendStartDate = _sendStartDate;
}
public Date getSendEndDate() {
return sendEndDate;
}
public void setSendEndDate(Date _sendEndDate) {
sendEndDate = _sendEndDate;
}
public Date getValidStartDate() {
return validStartDate;
}
public void setValidStartDate(Date _validStartDate) {
validStartDate = _validStartDate;
}
public Date getValidEndDate() {
return validEndDate;
}
public void setValidEndDate(Date _validEndDate) {
validEndDate = _validEndDate;
}
public Integer getValidDays() {
return validDays;
}
public void setValidDays(Integer _validDays) {
validDays = _validDays;
}
public String getDetail() {
return detail;
}
public void setDetail(String _detail) {
detail = _detail;
}
public Integer getSendType() {
return sendType;
}
public void setSendType(Integer _sendType) {
sendType = _sendType;
}
public Integer getTargetAd() {
return targetAd;
}
public void setTargetAd(Integer _targetAd) {
targetAd = _targetAd;
}
public String getBusinesses() {
return businesses;
}
public void setBusinesses(String _businesses) {
businesses = _businesses;
}
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal _price) {
price = _price;
}
public Integer getNumber() {
return number;
}
public void setNumber(Integer _number) {
number = _number;
}
public Integer getTotal() {
return total;
}
public void setTotal(Integer _total) {
total = _total;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer _status) {
status = _status;
}



public static enum Field
{
Id_ASC("`id` ASC"),Id_DESC("`id` DESC")
,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC")
,MerchantId_ASC("`merchantId` ASC"),MerchantId_DESC("`merchantId` DESC")
,Type_ASC("`type` ASC"),Type_DESC("`type` DESC")
,CoverImg_ASC("`coverImg` ASC"),CoverImg_DESC("`coverImg` DESC")
,Title_ASC("`title` ASC"),Title_DESC("`title` DESC")
,SubTitle_ASC("`subTitle` ASC"),SubTitle_DESC("`subTitle` DESC")
,SalePrice_ASC("`salePrice` ASC"),SalePrice_DESC("`salePrice` DESC")
,UsePrice_ASC("`usePrice` ASC"),UsePrice_DESC("`usePrice` DESC")
,UseLimitQuantity_ASC("`useLimitQuantity` ASC"),UseLimitQuantity_DESC("`useLimitQuantity` DESC")
,SendStartDate_ASC("`sendStartDate` ASC"),SendStartDate_DESC("`sendStartDate` DESC")
,SendEndDate_ASC("`sendEndDate` ASC"),SendEndDate_DESC("`sendEndDate` DESC")
,ValidStartDate_ASC("`validStartDate` ASC"),ValidStartDate_DESC("`validStartDate` DESC")
,ValidEndDate_ASC("`validEndDate` ASC"),ValidEndDate_DESC("`validEndDate` DESC")
,ValidDays_ASC("`validDays` ASC"),ValidDays_DESC("`validDays` DESC")
,Detail_ASC("`detail` ASC"),Detail_DESC("`detail` DESC")
,SendType_ASC("`sendType` ASC"),SendType_DESC("`sendType` DESC")
,TargetAd_ASC("`targetAd` ASC"),TargetAd_DESC("`targetAd` DESC")
,Businesses_ASC("`businesses` ASC"),Businesses_DESC("`businesses` DESC")
,Price_ASC("`price` ASC"),Price_DESC("`price` DESC")
,Number_ASC("`number` ASC"),Number_DESC("`number` DESC")
,Total_ASC("`total` ASC"),Total_DESC("`total` DESC")
,Status_ASC("`status` ASC"),Status_DESC("`status` 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(WxCouponActivity.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());
}
}
public void setSortColumns(String sortColumns)
{
if (sortColumns == null || "".equals(sortColumns.trim())) {
return;
}
if (sortColumns.contains(",")) {
String[] cols = sortColumns.split(",");
java.util.List<Field> fList = new java.util.ArrayList();
for (int k = 0; k < cols.length; k++) {
fList.add(Field.valueOf(cols[k]));
}
this.setSortColumns(fList.toArray(new Field[fList.size()]));
} else {
this.setSortColumns(Field.valueOf(sortColumns));
}
}
}

+ 0
- 48
mallinkService/src/main/java/com/simple/service/WxCouponActivityService.java Ver fichero

@@ -1,48 +0,0 @@
package com.simple.service;

import java.util.*;
import com.github.pagehelper.PageInfo;
import com.simple.domain.po.WxCouponActivity;

public interface WxCouponActivityService {

/**
* 根据实体查询分页列表
*
* @param record
* @param offset
* @param limit
* @return
*/
PageInfo<WxCouponActivity> listAsPage(WxCouponActivity record, Integer pageIndex, Integer pageSize);
/**
* 根据Id获得实体
*
* @param id
* @return
*/
WxCouponActivity getById(Long id);
/**
* 保存或更新实体
*
* @param record
*/
void saveOrUpdate(WxCouponActivity record);

/**
* 根据Id删除实体
*
* @param id
*/
void deleteById(Long id);

}

+ 0
- 54
mallinkService/src/main/java/com/simple/service/impl/WxCouponActivityServiceImpl.java Ver fichero

@@ -1,54 +0,0 @@
package com.simple.service.impl;

import java.util.*;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.simple.domain.po.WxCouponActivity;
import com.simple.mapper.WxCouponActivityMapper;
import com.simple.service.WxCouponActivityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.simple.common.IdWorker;

@Service
public class WxCouponActivityServiceImpl implements WxCouponActivityService {
@Autowired
WxCouponActivityMapper wxCouponActivityMapper;


@Override
public PageInfo<WxCouponActivity> listAsPage(WxCouponActivity record, Integer pageIndex, Integer pageSize) {
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponActivityMapper.findList(record));
}

@Override
public WxCouponActivity getById(Long id) {
return wxCouponActivityMapper.selectByPrimaryKey(id);
}

@Override
public void saveOrUpdate(WxCouponActivity record) {
if (record.getId() == null) {
//record.setId(UUID.randomUUID().toString().replaceAll("-", ""));
IdWorker idWorker = new IdWorker(0, 0);
record.setId(idWorker.nextId());
wxCouponActivityMapper.insertSelective(record);
} else {
wxCouponActivityMapper.updateByPrimaryKeySelective(record);
}
}

@Override
public void deleteById(Long id) {
wxCouponActivityMapper.deleteByPrimaryKey(id);
}
}

+ 0
- 170
mallinkService/src/main/resources/mapper/WxCouponActivityMapper.xml Ver fichero

@@ -1,170 +0,0 @@
<?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.simple.mapper.WxCouponActivityMapper">
<resultMap id="BaseResultMap" type="com.simple.domain.po.WxCouponActivity">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
<result column="merchant_id" jdbcType="BIGINT" property="merchantId" />
<result column="type" jdbcType="INTEGER" property="type" />
<result column="cover_img" jdbcType="VARCHAR" property="coverImg" />
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="sub_title" jdbcType="VARCHAR" property="subTitle" />
<result column="sale_price" jdbcType="DECIMAL" property="salePrice" />
<result column="use_price" jdbcType="DECIMAL" property="usePrice" />
<result column="use_limit_quantity" jdbcType="INTEGER" property="useLimitQuantity" />
<result column="send_start_date" jdbcType="TIMESTAMP" property="sendStartDate" />
<result column="send_end_date" jdbcType="TIMESTAMP" property="sendEndDate" />
<result column="valid_start_date" jdbcType="TIMESTAMP" property="validStartDate" />
<result column="valid_end_date" jdbcType="TIMESTAMP" property="validEndDate" />
<result column="valid_days" jdbcType="INTEGER" property="validDays" />
<result column="detail" jdbcType="VARCHAR" property="detail" />
<result column="send_type" jdbcType="INTEGER" property="sendType" />
<result column="target_ad" jdbcType="INTEGER" property="targetAd" />
<result column="businesses" jdbcType="VARCHAR" property="businesses" />
<result column="price" jdbcType="DECIMAL" property="price" />
<result column="number" jdbcType="INTEGER" property="number" />
<result column="total" jdbcType="INTEGER" property="total" />
<result column="status" jdbcType="INTEGER" property="status" />
</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`merchant_id`,`type`,`cover_img`,`title`,`sub_title`,`sale_price`,`use_price`,`use_limit_quantity`,`send_start_date`,`send_end_date`,`valid_start_date`,`valid_end_date`,`valid_days`,`detail`,`send_type`,`target_ad`,`businesses`,`price`,`number`,`total`,`status`
</sql>

<sql id="dynamicWhereConditions">
where 1 = 1
<if test=" null != id ">
and `id` = #{id}
</if>
<if test=" null != tenantId ">
and `tenant_id` like concat('%', #{tenantId},'%')
</if>
<if test=" null != merchantId ">
and `merchant_id` = #{merchantId}
</if>
<if test=" null != type ">
and `type` = #{type}
</if>
<if test=" null != coverImg ">
and `cover_img` like concat('%', #{coverImg},'%')
</if>
<if test=" null != title ">
and `title` like concat('%', #{title},'%')
</if>
<if test=" null != subTitle ">
and `sub_title` like concat('%', #{subTitle},'%')
</if>
<if test=" null != salePrice ">
and `sale_price` = #{salePrice}
</if>
<if test=" null != usePrice ">
and `use_price` = #{usePrice}
</if>
<if test=" null != useLimitQuantity ">
and `use_limit_quantity` = #{useLimitQuantity}
</if>
<if test=" null != sendStartDate ">
and `send_start_date` = #{sendStartDate}
</if>
<if test=" null != sendEndDate ">
and `send_end_date` = #{sendEndDate}
</if>
<if test=" null != validStartDate ">
and `valid_start_date` = #{validStartDate}
</if>
<if test=" null != validEndDate ">
and `valid_end_date` = #{validEndDate}
</if>
<if test=" null != validDays ">
and `valid_days` = #{validDays}
</if>
<if test=" null != detail ">
and `detail` like concat('%', #{detail},'%')
</if>
<if test=" null != sendType ">
and `send_type` = #{sendType}
</if>
<if test=" null != targetAd ">
and `target_ad` = #{targetAd}
</if>
<if test=" null != businesses ">
and `businesses` like concat('%', #{businesses},'%')
</if>
<if test=" null != price ">
and `price` = #{price}
</if>
<if test=" null != number ">
and `number` = #{number}
</if>
<if test=" null != total ">
and `total` = #{total}
</if>
<if test=" null != status ">
and `status` = #{status}
</if>
<if test=" null != ids ">
and id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
#{idItem}
</foreach>
</if>
<if test=" null != sortColumns"> order by ${sortColumns} </if>
</sql>
<select id="findList" parameterType="com.simple.domain.po.WxCouponActivity" resultMap="BaseResultMap">
select <include refid="allColumns" /> from wx_coupon_activity
<include refid="dynamicWhereConditions" />
</select>
</mapper>

Cargando…
Cancelar
Guardar