diff --git a/mallinkAdmin/src/main/java/com/simple/controller/WxCouponActivityController.java b/mallinkAdmin/src/main/java/com/simple/controller/WxCouponActivityController.java deleted file mode 100644 index 734e68e1a..000000000 --- a/mallinkAdmin/src/main/java/com/simple/controller/WxCouponActivityController.java +++ /dev/null @@ -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 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)); - } - - - -} diff --git a/mallinkService/src/main/java/com/simple/domain/po/WxCouponActivity.java b/mallinkService/src/main/java/com/simple/domain/po/WxCouponActivity.java deleted file mode 100644 index c62cd1f11..000000000 --- a/mallinkService/src/main/java/com/simple/domain/po/WxCouponActivity.java +++ /dev/null @@ -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 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 getIds() { - return ids; - } - public void setIds(List 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 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)); - } - } -} diff --git a/mallinkService/src/main/java/com/simple/service/WxCouponActivityService.java b/mallinkService/src/main/java/com/simple/service/WxCouponActivityService.java deleted file mode 100644 index 62337528c..000000000 --- a/mallinkService/src/main/java/com/simple/service/WxCouponActivityService.java +++ /dev/null @@ -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 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); - - - - - - - - -} diff --git a/mallinkService/src/main/java/com/simple/service/impl/WxCouponActivityServiceImpl.java b/mallinkService/src/main/java/com/simple/service/impl/WxCouponActivityServiceImpl.java deleted file mode 100644 index 1376ab689..000000000 --- a/mallinkService/src/main/java/com/simple/service/impl/WxCouponActivityServiceImpl.java +++ /dev/null @@ -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 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); - } - - - - - - - - -} diff --git a/mallinkService/src/main/resources/mapper/WxCouponActivityMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponActivityMapper.xml deleted file mode 100644 index 5033c01f2..000000000 --- a/mallinkService/src/main/resources/mapper/WxCouponActivityMapper.xml +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - `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` - - - - where 1 = 1 - - - and `id` = #{id} - - - - - and `tenant_id` like concat('%', #{tenantId},'%') - - - - - and `merchant_id` = #{merchantId} - - - - - and `type` = #{type} - - - - - and `cover_img` like concat('%', #{coverImg},'%') - - - - - and `title` like concat('%', #{title},'%') - - - - - and `sub_title` like concat('%', #{subTitle},'%') - - - - - and `sale_price` = #{salePrice} - - - - - and `use_price` = #{usePrice} - - - - - and `use_limit_quantity` = #{useLimitQuantity} - - - - - and `send_start_date` = #{sendStartDate} - - - - - and `send_end_date` = #{sendEndDate} - - - - - and `valid_start_date` = #{validStartDate} - - - - - and `valid_end_date` = #{validEndDate} - - - - - and `valid_days` = #{validDays} - - - - - and `detail` like concat('%', #{detail},'%') - - - - - and `send_type` = #{sendType} - - - - - and `target_ad` = #{targetAd} - - - - - and `businesses` like concat('%', #{businesses},'%') - - - - - and `price` = #{price} - - - - - and `number` = #{number} - - - - - and `total` = #{total} - - - - - and `status` = #{status} - - - - and id in - - #{idItem} - - - order by ${sortColumns} - - - - - - - - - -