| @@ -37,6 +37,7 @@ public class WxCUserBasicInfoController extends BaseController | |||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||
| public ResultData list(@ModelAttribute WxCUserBasicInfo wxCUserBasicInfo,Integer pageNum, Integer pageSize) { | |||
| if (null == wxCUserBasicInfo) wxCUserBasicInfo = new WxCUserBasicInfo(); | |||
| wxCUserBasicInfo.setTenantId(getTenantId()); | |||
| final PageInfo<WxCUserBasicInfo> page = wxCUserBasicInfoService.listAsPage(wxCUserBasicInfo, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @@ -46,6 +47,7 @@ public class WxCUserBasicInfoController extends BaseController | |||
| public ResultData add(@RequestBody WxCUserBasicInfo wxCUserBasicInfo) { | |||
| //Assert.notNull(wxCUserBasicInfo.getName(), "角色名不能为空"); | |||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||
| wxCUserBasicInfo.setTenantId(getTenantId()); | |||
| wxCUserBasicInfoService.saveOrUpdate(wxCUserBasicInfo); | |||
| return new ResultData(); | |||
| } | |||
| @@ -53,6 +55,7 @@ public class WxCUserBasicInfoController extends BaseController | |||
| @ApiOperation("根据id更新接口") | |||
| @PostMapping("update") | |||
| public ResultData update(@RequestBody WxCUserBasicInfo wxCUserBasicInfo) { | |||
| wxCUserBasicInfo.setTenantId(getTenantId()); | |||
| wxCUserBasicInfoService.saveOrUpdate(wxCUserBasicInfo); | |||
| return new ResultData(); | |||
| } | |||
| @@ -0,0 +1,110 @@ | |||
| package com.simple.controller; | |||
| import java.util.ArrayList; | |||
| import java.util.Calendar; | |||
| import java.util.List; | |||
| import org.apache.log4j.Logger; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.RequestMapping; | |||
| import org.springframework.web.bind.annotation.RestController; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.simple.common.Result; | |||
| import com.simple.common.ResultData; | |||
| import com.simple.domain.po.WxDateAmountRecord; | |||
| import com.simple.domain.vo.AmountRecordVo; | |||
| import com.simple.service.WxDateAmountRecordService; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| @RestController | |||
| @RequestMapping("wxDateAmountRecord") | |||
| @Api(description="首页查询交易金额记录和核销记录接口") | |||
| public class WxDateAmountRecordController extends BaseController | |||
| { | |||
| @Autowired | |||
| private WxDateAmountRecordService wxDateAmountRecordService; | |||
| private Logger logger = Logger.getLogger(WxDateAmountRecordController.class); | |||
| @ApiOperation("首页查询交易金额记录和核销记录接口") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name="tenantId",value="租户id",dataType="String", paramType = "query",required=true), | |||
| @ApiImplicitParam(name="merchantId",value="商户id",dataType="long", paramType = "query",required=true)}) | |||
| public ResultData getRecord(String tenantId,Long merchantId) { | |||
| Calendar c =Calendar.getInstance(); | |||
| int weekOfYear =c.get(Calendar.WEEK_OF_YEAR); | |||
| WxDateAmountRecord temp = new WxDateAmountRecord(); | |||
| temp.setDayOfWeek(weekOfYear); | |||
| temp.setTenantId(tenantId); | |||
| temp.setMerchantId(merchantId); | |||
| AmountRecordVo vo = new AmountRecordVo(); | |||
| vo.setOrderAmountList(getAmountRecord(temp, 0)); | |||
| vo.setVerifyAmountList(getAmountRecord(temp, 0)); | |||
| return new ResultData(Result.SUCCESS,"ok",vo); | |||
| } | |||
| private List<WxDateAmountRecord> getAmountRecord( WxDateAmountRecord temp,int type){ | |||
| temp.setType(type); | |||
| List<WxDateAmountRecord> list =new ArrayList<>(); | |||
| for(int i=1;i<=7;i++) {//周日是1 | |||
| temp.setDayOfWeek(i); | |||
| PageInfo<WxDateAmountRecord> page = wxDateAmountRecordService.listAsPage(temp, 1, 1); | |||
| if(page.getSize()>0) { | |||
| list.add(page.getList().get(0)); | |||
| } | |||
| } | |||
| return list; | |||
| } | |||
| // @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 WxDateAmountRecord wxDateAmountRecord,Integer pageNum, Integer pageSize) { | |||
| // if (null == wxDateAmountRecord) wxDateAmountRecord = new WxDateAmountRecord(); | |||
| // final PageInfo<WxDateAmountRecord> page = wxDateAmountRecordService.listAsPage(wxDateAmountRecord, pageNum, pageSize); | |||
| // return new ResultData(page); | |||
| // } | |||
| // @ApiOperation("新增接口") | |||
| // @PostMapping("add") | |||
| // public ResultData add(@RequestBody WxDateAmountRecord wxDateAmountRecord) { | |||
| // //Assert.notNull(wxDateAmountRecord.getName(), "角色名不能为空"); | |||
| // //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||
| // wxDateAmountRecordService.saveOrUpdate(wxDateAmountRecord); | |||
| // return new ResultData(); | |||
| // } | |||
| // | |||
| // @ApiOperation("根据id更新接口") | |||
| // @PostMapping("update") | |||
| // public ResultData update(@RequestBody WxDateAmountRecord wxDateAmountRecord) { | |||
| // wxDateAmountRecordService.saveOrUpdate(wxDateAmountRecord); | |||
| // return new ResultData(); | |||
| // } | |||
| // | |||
| // @ApiOperation("根据id删除接口") | |||
| // @GetMapping("/del") | |||
| // @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| // public ResultData delete(Long id) { | |||
| // wxDateAmountRecordService.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,"查询成功",wxDateAmountRecordService.getById(id)); | |||
| // } | |||
| } | |||
| @@ -1,12 +1,12 @@ | |||
| package com.simple.domain.po; | |||
| import javax.persistence.*; | |||
| import java.util.*; | |||
| import java.math.*; | |||
| import javax.persistence.Transient; | |||
| import java.io.Serializable; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| import javax.persistence.Id; | |||
| import java.io.Serializable; | |||
| import javax.persistence.Table; | |||
| import javax.persistence.Transient; | |||
| @Table(name = "wx_c_user_basic_info") | |||
| public class WxCUserBasicInfo implements Serializable { | |||
| @@ -16,7 +16,7 @@ public class WxCUserBasicInfo implements Serializable { | |||
| protected Long id; | |||
| @Transient | |||
| protected List<String> ids; | |||
| protected List<Long> ids; | |||
| @Transient | |||
| protected String sortColumns; | |||
| @@ -32,10 +32,11 @@ public class WxCUserBasicInfo implements Serializable { | |||
| return sortColumns; | |||
| } | |||
| public List<String> getIds() { | |||
| public List<Long> getIds() { | |||
| return ids; | |||
| } | |||
| public void setIds(List<String> ids) { | |||
| public void setIds(List<Long> ids) { | |||
| this.ids = ids; | |||
| } | |||
| @@ -74,6 +75,12 @@ public class WxCUserBasicInfo implements Serializable { | |||
| /*更新时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||
| private Date updateDate; | |||
| /*租户id**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租户id",name="tenantId") | |||
| private String tenantId; | |||
| /*商户id**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商户id",name="merchantId") | |||
| private Long merchantId; | |||
| public String getPhone() { | |||
| return phone; | |||
| } | |||
| @@ -140,6 +147,18 @@ public class WxCUserBasicInfo implements Serializable { | |||
| public void setUpdateDate(Date _updateDate) { | |||
| updateDate = _updateDate; | |||
| } | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| public void setTenantId(String _tenantId) { | |||
| tenantId = _tenantId; | |||
| } | |||
| public Long getMerchantId() { | |||
| return merchantId; | |||
| } | |||
| public void setMerchantId(Long _merchantId) { | |||
| merchantId = _merchantId; | |||
| } | |||
| @@ -157,6 +176,8 @@ public class WxCUserBasicInfo implements Serializable { | |||
| ,CUserId_ASC("`cUserId` ASC"),CUserId_DESC("`cUserId` DESC") | |||
| ,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC") | |||
| ,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` DESC") | |||
| ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | |||
| ,MerchantId_ASC("`merchantId` ASC"),MerchantId_DESC("`merchantId` DESC") | |||
| ; | |||
| private String value; | |||
| Field(String value){ | |||
| @@ -69,6 +69,9 @@ public class WxDateAmountRecord implements Serializable { | |||
| /*更新日期**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="更新日期",name="updateDate") | |||
| private Date updateDate; | |||
| /*类型:0 交易记录 1.核销记录**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="类型:0 交易记录 1.核销记录",name="type") | |||
| private Integer type; | |||
| public Date getDate() { | |||
| return date; | |||
| } | |||
| @@ -123,6 +126,12 @@ public class WxDateAmountRecord implements Serializable { | |||
| public void setUpdateDate(Date _updateDate) { | |||
| updateDate = _updateDate; | |||
| } | |||
| public Integer getType() { | |||
| return type; | |||
| } | |||
| public void setType(Integer _type) { | |||
| type = _type; | |||
| } | |||
| @@ -138,6 +147,7 @@ public class WxDateAmountRecord implements Serializable { | |||
| ,MerchantId_ASC("`merchantId` ASC"),MerchantId_DESC("`merchantId` DESC") | |||
| ,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC") | |||
| ,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` DESC") | |||
| ,Type_ASC("`type` ASC"),Type_DESC("`type` DESC") | |||
| ; | |||
| private String value; | |||
| Field(String value){ | |||
| @@ -0,0 +1,41 @@ | |||
| package com.simple.domain.vo; | |||
| import java.io.Serializable; | |||
| /** | |||
| * 交易记录核销记录Vo | |||
| * @author jinguo | |||
| * | |||
| */ | |||
| import java.util.List; | |||
| import com.simple.domain.po.WxDateAmountRecord; | |||
| public class AmountRecordVo implements Serializable{ | |||
| /** | |||
| * | |||
| */ | |||
| private static final long serialVersionUID = 4494858079134918638L; | |||
| List<WxDateAmountRecord> orderAmountList; | |||
| List<WxDateAmountRecord> verifyAmountList; | |||
| public List<WxDateAmountRecord> getOrderAmountList() { | |||
| return orderAmountList; | |||
| } | |||
| public void setOrderAmountList(List<WxDateAmountRecord> orderAmountList) { | |||
| this.orderAmountList = orderAmountList; | |||
| } | |||
| public List<WxDateAmountRecord> getVerifyAmountList() { | |||
| return verifyAmountList; | |||
| } | |||
| public void setVerifyAmountList(List<WxDateAmountRecord> verifyAmountList) { | |||
| this.verifyAmountList = verifyAmountList; | |||
| } | |||
| } | |||
| @@ -14,10 +14,12 @@ | |||
| <result column="c_user_id" jdbcType="BIGINT" property="cUserId" /> | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | |||
| <result column="merchant_id" jdbcType="BIGINT" property="merchantId" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`phone`,`birthdate`,`education`,`sex`,`email`,`address`,`poins`,`tag_id`,`c_user_id`,`create_date`,`update_date` | |||
| `id`,`phone`,`birthdate`,`education`,`sex`,`email`,`address`,`poins`,`tag_id`,`c_user_id`,`create_date`,`update_date`,`tenant_id`,`merchant_id` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -81,6 +83,16 @@ | |||
| <if test=" null != updateDate "> | |||
| and `update_date` = #{updateDate} | |||
| </if> | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||
| </if> | |||
| <if test=" null != merchantId "> | |||
| and `merchant_id` = #{merchantId} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| @@ -12,10 +12,11 @@ | |||
| <result column="merchant_id" jdbcType="BIGINT" property="merchantId" /> | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | |||
| <result column="type" jdbcType="INTEGER" property="type" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`date`,`day_of_week`,`week_of_year`,`pay_price`,`tenant_id`,`month`,`merchant_id`,`create_date`,`update_date` | |||
| `id`,`date`,`day_of_week`,`week_of_year`,`pay_price`,`tenant_id`,`month`,`merchant_id`,`create_date`,`update_date`,`type` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -69,6 +70,11 @@ | |||
| <if test=" null != updateDate "> | |||
| and `update_date` = #{updateDate} | |||
| </if> | |||
| <if test=" null != type "> | |||
| and `type` = #{type} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||