Browse Source

积分兑换居民端接口

feature/dangjian
wanggongfeng 4 years ago
parent
commit
bbf8084d78
  1. 56
      esua-epdc/epdc-module/epdc-points/epdc-points-client/src/main/java/com/elink/esua/epdc/dto/form/PointsLogListFormDTO.java
  2. 65
      esua-epdc/epdc-module/epdc-points/epdc-points-client/src/main/java/com/elink/esua/epdc/dto/result/PointsLogListResultDTO.java
  3. 15
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/controller/AppAcitveController.java
  4. 4
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/dao/AppAcitveDao.java
  5. 4
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/AppAcitveService.java
  6. 13
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/impl/AppAcitveServiceImpl.java
  7. 17
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/mapper/AppAcitveDao.xml

56
esua-epdc/epdc-module/epdc-points/epdc-points-client/src/main/java/com/elink/esua/epdc/dto/form/PointsLogListFormDTO.java

@ -0,0 +1,56 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dto.form;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 居民端-积分记录
*
* @author wgf
* @since v1.0.0 2021-09-23
*/
@Data
public class PointsLogListFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 页码从1开始
*/
@Min(value = 1, message = "页码必须大于0")
private int pageIndex;
/**
* 页容量默认20页
*/
@Min(value = 1, message = "每页条数必须大于必须大于0")
private int pageSize = 10;
/**
* 第一页查询发起时的时间
*/
@NotBlank(message = "时间戳不能为空")
private String timestamp;
}

65
esua-epdc/epdc-module/epdc-points/epdc-points-client/src/main/java/com/elink/esua/epdc/dto/result/PointsLogListResultDTO.java

@ -0,0 +1,65 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 居民端-积分记录
*
* @author wgf
* @since v1.0.0 2021-09-23
*/
@Data
public class PointsLogListResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
private String id;
/**
* 积分操作类型
*/
private String operationType;
/**
* 操作描述
*/
private String operationDesc;
/**
* 积分
*/
private String points;
/**
* 操作时间
*/
private String operationTime;
}

15
esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/controller/AppAcitveController.java

@ -29,9 +29,11 @@ import com.elink.esua.epdc.dto.AcitveProductExchangeDTO;
import com.elink.esua.epdc.dto.form.ExchangedCheckFormDTO;
import com.elink.esua.epdc.dto.form.ExchangedListFormDTO;
import com.elink.esua.epdc.dto.form.ExchangedListJMFormDTO;
import com.elink.esua.epdc.dto.form.PointsLogListFormDTO;
import com.elink.esua.epdc.dto.result.ExchangedCheckResultDTO;
import com.elink.esua.epdc.dto.result.ExchangedListJMResultDTO;
import com.elink.esua.epdc.dto.result.ExchangedListResultDTO;
import com.elink.esua.epdc.dto.result.PointsLogListResultDTO;
import com.elink.esua.epdc.excel.AcitveProductExchangeExcel;
import com.elink.esua.epdc.service.AcitveProductExchangeService;
import com.elink.esua.epdc.service.AppAcitveService;
@ -96,5 +98,18 @@ public class AppAcitveController {
return result;
}
/**
* 居民端-积分记录
* @param formDto
* @return
*/
@GetMapping("getPointsLogList")
public Result<List<PointsLogListResultDTO>> getPointsLogList(@RequestBody PointsLogListFormDTO formDto){
//效验数据
ValidatorUtils.validateEntity(formDto);
Result<List<PointsLogListResultDTO>> result = appAcitveService.getPointsLogList(formDto);
return result;
}
}

4
esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/dao/AppAcitveDao.java

@ -22,8 +22,10 @@ import com.elink.esua.epdc.dto.AcitveProductExchangeDTO;
import com.elink.esua.epdc.dto.form.ExchangedCheckFormDTO;
import com.elink.esua.epdc.dto.form.ExchangedListFormDTO;
import com.elink.esua.epdc.dto.form.ExchangedListJMFormDTO;
import com.elink.esua.epdc.dto.form.PointsLogListFormDTO;
import com.elink.esua.epdc.dto.result.ExchangedListJMResultDTO;
import com.elink.esua.epdc.dto.result.ExchangedListResultDTO;
import com.elink.esua.epdc.dto.result.PointsLogListResultDTO;
import com.elink.esua.epdc.entity.AcitveProductExchangeEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -53,4 +55,6 @@ public interface AppAcitveDao {
List<ExchangedListJMResultDTO> getExchangedJMList(ExchangedListJMFormDTO formDto);
List<PointsLogListResultDTO> getPointsLogList(PointsLogListFormDTO formDto);
}

4
esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/AppAcitveService.java

@ -24,9 +24,11 @@ import com.elink.esua.epdc.dto.AcitveProductExchangeDTO;
import com.elink.esua.epdc.dto.form.ExchangedCheckFormDTO;
import com.elink.esua.epdc.dto.form.ExchangedListFormDTO;
import com.elink.esua.epdc.dto.form.ExchangedListJMFormDTO;
import com.elink.esua.epdc.dto.form.PointsLogListFormDTO;
import com.elink.esua.epdc.dto.result.ExchangedCheckResultDTO;
import com.elink.esua.epdc.dto.result.ExchangedListJMResultDTO;
import com.elink.esua.epdc.dto.result.ExchangedListResultDTO;
import com.elink.esua.epdc.dto.result.PointsLogListResultDTO;
import com.elink.esua.epdc.entity.AcitveProductExchangeEntity;
import java.util.List;
@ -45,4 +47,6 @@ public interface AppAcitveService {
Result<ExchangedCheckResultDTO> exchangedCheck(ExchangedCheckFormDTO formDto);
Result<List<ExchangedListJMResultDTO>> getExchangedJMList(ExchangedListJMFormDTO formDto);
Result<List<PointsLogListResultDTO>> getPointsLogList(PointsLogListFormDTO formDto);
}

13
esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/impl/AppAcitveServiceImpl.java

@ -32,9 +32,11 @@ import com.elink.esua.epdc.dto.AcitveProductExchangeDTO;
import com.elink.esua.epdc.dto.form.ExchangedCheckFormDTO;
import com.elink.esua.epdc.dto.form.ExchangedListFormDTO;
import com.elink.esua.epdc.dto.form.ExchangedListJMFormDTO;
import com.elink.esua.epdc.dto.form.PointsLogListFormDTO;
import com.elink.esua.epdc.dto.result.ExchangedCheckResultDTO;
import com.elink.esua.epdc.dto.result.ExchangedListJMResultDTO;
import com.elink.esua.epdc.dto.result.ExchangedListResultDTO;
import com.elink.esua.epdc.dto.result.PointsLogListResultDTO;
import com.elink.esua.epdc.entity.AcitveProductExchangeEntity;
import com.elink.esua.epdc.redis.AcitveProductExchangeRedis;
import com.elink.esua.epdc.service.AcitveProductExchangeService;
@ -129,4 +131,15 @@ public class AppAcitveServiceImpl implements AppAcitveService {
return new Result<List<ExchangedListJMResultDTO>>().ok(list);
}
@Override
public Result<List<PointsLogListResultDTO>> getPointsLogList(PointsLogListFormDTO formDto) {
int pageIndex = (formDto.getPageIndex() - NumConstant.ONE) * formDto.getPageSize();
formDto.setPageIndex(pageIndex);
List<PointsLogListResultDTO> list = appAcitveDao.getPointsLogList(formDto);
return new Result<List<PointsLogListResultDTO>>().ok(list);
}
}

17
esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/mapper/AppAcitveDao.xml

@ -100,5 +100,22 @@
LIMIT #{pageIndex},#{pageSize}
</select>
<select id="getPointsLogList" resultType="com.elink.esua.epdc.dto.result.PointsLogListResultDTO"
parameterType="com.elink.esua.epdc.dto.form.PointsLogListFormDTO">
select
a.ID id,
a.OPERATION_TYPE operationType,
a.OPERATION_DESC operationDesc,
a.POINTS points,
a.OPERATION_TIME operationTime
from epdc_active_point_log a
where a.DEL_FLAG = 0
<if test="timestamp != null">
<![CDATA[ AND DATE_FORMAT(a.OPERATION_TIME,'%Y-%m-%d %H:%i:%s') <= ]]> #{timestamp}
</if>
order by a.OPERATION_TIME desc
LIMIT #{pageIndex},#{pageSize}
</select>
</mapper>

Loading…
Cancel
Save