卡片信息详情接口完善
This commit is contained in:
@@ -20,4 +20,5 @@ public class LpkCardBuildRecordVo implements Vo {
|
|||||||
private String countNumber; //总数
|
private String countNumber; //总数
|
||||||
private String startNumber; //起始号
|
private String startNumber; //起始号
|
||||||
private String endNumber; //结束号
|
private String endNumber; //结束号
|
||||||
|
private String bagName;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,4 +13,6 @@ public class LpkGiftCardListQuery implements Query {
|
|||||||
private String state;
|
private String state;
|
||||||
private String noStart; //序列号开始
|
private String noStart; //序列号开始
|
||||||
private String noEnd; //序列号结束
|
private String noEnd; //序列号结束
|
||||||
|
private String sid;
|
||||||
|
private String serialNumber;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,4 +25,5 @@ public class LpkGiftCardListVo implements Vo {
|
|||||||
private String grantDate;
|
private String grantDate;
|
||||||
private String customerMobile;
|
private String customerMobile;
|
||||||
private String customerSid;
|
private String customerSid;
|
||||||
|
private String bagName;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,12 +7,14 @@
|
|||||||
|
|
||||||
<select id="recordListPage" resultType="com.yxt.yyth.api.lpkcardbuildrecord.LpkCardBuildRecordVo">
|
<select id="recordListPage" resultType="com.yxt.yyth.api.lpkcardbuildrecord.LpkCardBuildRecordVo">
|
||||||
select
|
select
|
||||||
sid,
|
r.sid,
|
||||||
date_format(buildDate, '%Y-%m-%d') as buildDate,
|
r.date_format(buildDate, '%Y-%m-%d') as buildDate,
|
||||||
countNumber,
|
r.countNumber,
|
||||||
startNumber,
|
r.startNumber,
|
||||||
endNumber
|
r.endNumber,
|
||||||
from lpk_card_build_record
|
g.name as bagName
|
||||||
|
from lpk_card_build_record as r
|
||||||
|
left join lpk_giftbag as g on r.giftbagSid = g.sid
|
||||||
<where>
|
<where>
|
||||||
${ew.sqlSegment}
|
${ew.sqlSegment}
|
||||||
</where>
|
</where>
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import com.yxt.common.core.result.ResultBean;
|
|||||||
import com.yxt.common.core.vo.PagerVo;
|
import com.yxt.common.core.vo.PagerVo;
|
||||||
import com.yxt.yyth.api.lpkcardbuildrecord.LpkCardBuildRecordQuery;
|
import com.yxt.yyth.api.lpkcardbuildrecord.LpkCardBuildRecordQuery;
|
||||||
import com.yxt.yyth.api.lpkcardbuildrecord.LpkCardBuildRecordVo;
|
import com.yxt.yyth.api.lpkcardbuildrecord.LpkCardBuildRecordVo;
|
||||||
|
import com.yxt.yyth.api.lpkgiftcard.LpkGiftCardListQuery;
|
||||||
|
import com.yxt.yyth.api.lpkgiftcard.LpkGiftCardListVo;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
@@ -31,9 +33,6 @@ public class LpkCardBuildRecordRest {
|
|||||||
return lpkCardBuildRecordService.recordListPage(pq);
|
return lpkCardBuildRecordService.recordListPage(pq);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("创建记录列表")
|
|
||||||
@GetMapping("/recordDetails/{sid}")
|
|
||||||
public ResultBean recordDetails(@PathVariable("sid") String sid) {
|
|
||||||
return lpkCardBuildRecordService.recordDetails(sid);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import com.yxt.yyth.api.lpkcardbuildrecord.LpkCardBuildRecordVo;
|
|||||||
import com.yxt.yyth.api.lpkcustomer.LpkCustomer;
|
import com.yxt.yyth.api.lpkcustomer.LpkCustomer;
|
||||||
import com.yxt.yyth.api.lpkcustomer.LpkCustomerQuery;
|
import com.yxt.yyth.api.lpkcustomer.LpkCustomerQuery;
|
||||||
import com.yxt.yyth.api.lpkcustomer.LpkCustomerVo;
|
import com.yxt.yyth.api.lpkcustomer.LpkCustomerVo;
|
||||||
|
import com.yxt.yyth.api.lpkgiftcard.LpkGiftCardListQuery;
|
||||||
import com.yxt.yyth.api.lpkgiftcard.LpkGiftCardListVo;
|
import com.yxt.yyth.api.lpkgiftcard.LpkGiftCardListVo;
|
||||||
import com.yxt.yyth.biz.lpkgiftcard.LpkGiftCardService;
|
import com.yxt.yyth.biz.lpkgiftcard.LpkGiftCardService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -39,27 +40,19 @@ public class LpkCardBuildRecordService extends MybatisBaseService<LpkCardBuildRe
|
|||||||
QueryWrapper<LpkCardBuildRecord> qw = new QueryWrapper<>();
|
QueryWrapper<LpkCardBuildRecord> qw = new QueryWrapper<>();
|
||||||
qw.eq("1", "1");
|
qw.eq("1", "1");
|
||||||
if (StringUtils.isNotBlank(query.getCountNumber())) {
|
if (StringUtils.isNotBlank(query.getCountNumber())) {
|
||||||
qw.eq("countNumber", query.getCountNumber());
|
qw.eq("r.countNumber", query.getCountNumber());
|
||||||
}
|
}
|
||||||
String startDate = query.getStartDate();
|
String startDate = query.getStartDate();
|
||||||
String effEndTime = query.getEndDate();
|
String effEndTime = query.getEndDate();
|
||||||
qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(startDate), "date_format (buildDate,'%Y-%m-%d') >= date_format('" + startDate + "','%Y-%m-%d')").
|
qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(startDate), "date_format (r.buildDate,'%Y-%m-%d') >= date_format('" + startDate + "','%Y-%m-%d')").
|
||||||
apply(org.apache.commons.lang3.StringUtils.isNotEmpty(effEndTime), "date_format (buildDate,'%Y-%m-%d') <= date_format('" + effEndTime + "','%Y-%m-%d')"
|
apply(org.apache.commons.lang3.StringUtils.isNotEmpty(effEndTime), "date_format (r.buildDate,'%Y-%m-%d') <= date_format('" + effEndTime + "','%Y-%m-%d')"
|
||||||
);
|
);
|
||||||
qw.orderByDesc("createTime");
|
qw.orderByDesc("r.createTime");
|
||||||
IPage<LpkCardBuildRecord> page = PagerUtil.queryToPage(pq);
|
IPage<LpkCardBuildRecord> page = PagerUtil.queryToPage(pq);
|
||||||
IPage<LpkCardBuildRecordVo> pagging = baseMapper.recordListPage(page, qw);
|
IPage<LpkCardBuildRecordVo> pagging = baseMapper.recordListPage(page, qw);
|
||||||
PagerVo<LpkCardBuildRecordVo> p = PagerUtil.pageToVo(pagging, null);
|
PagerVo<LpkCardBuildRecordVo> p = PagerUtil.pageToVo(pagging, null);
|
||||||
return rb.success().setData(p);
|
return rb.success().setData(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResultBean recordDetails(String sid) {
|
|
||||||
ResultBean rb = ResultBean.fireFail();
|
|
||||||
List<LpkGiftCardListVo> list = new ArrayList<>();
|
|
||||||
LpkCardBuildRecord record = fetchBySid(sid);
|
|
||||||
if (record != null) {
|
|
||||||
list = lpkGiftCardService.selAllByRecordSid(sid);
|
|
||||||
}
|
|
||||||
return rb.success().setData(list);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,4 +47,6 @@ public interface LpkGiftCardMapper extends BaseMapper<LpkGiftCard> {
|
|||||||
IPage<LpkGiftCardListVo> cardList(IPage<LpkGiftCard> page, @Param(Constants.WRAPPER) QueryWrapper<LpkGiftCard> qw);
|
IPage<LpkGiftCardListVo> cardList(IPage<LpkGiftCard> page, @Param(Constants.WRAPPER) QueryWrapper<LpkGiftCard> qw);
|
||||||
|
|
||||||
List<LpkGiftCardListVo> selAllByRecordSid(@Param("sid") String sid);
|
List<LpkGiftCardListVo> selAllByRecordSid(@Param("sid") String sid);
|
||||||
|
|
||||||
|
IPage<LpkGiftCardListVo> recordDetails(IPage<LpkGiftCard> page, @Param(Constants.WRAPPER) QueryWrapper<LpkGiftCard> qw);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,6 +65,26 @@
|
|||||||
FROM lpk_giftcard
|
FROM lpk_giftcard
|
||||||
where recordSid = #{sid}
|
where recordSid = #{sid}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="recordDetails" resultType="com.yxt.yyth.api.lpkgiftcard.LpkGiftCardListVo">
|
||||||
|
SELECT
|
||||||
|
sid,
|
||||||
|
date_format(createTime, '%Y-%m-%d') as createTime,
|
||||||
|
remarks,
|
||||||
|
giftbagSid,
|
||||||
|
serialNumber,
|
||||||
|
code,
|
||||||
|
codeKey,
|
||||||
|
`state`,
|
||||||
|
grantName,
|
||||||
|
date_format(grantDate, '%Y-%m-%d') as grantDate,
|
||||||
|
customerMobile,
|
||||||
|
customerSid
|
||||||
|
FROM
|
||||||
|
lpk_giftcard
|
||||||
|
<where>
|
||||||
|
${ew.sqlSegment}
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -67,4 +67,10 @@ public class LpkGiftCardRest {
|
|||||||
return lpkGiftCardService.cardList(pq);
|
return lpkGiftCardService.cardList(pq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查看记录详情列表")
|
||||||
|
@PostMapping("/recordDetails")
|
||||||
|
public ResultBean<PagerVo<LpkGiftCardListVo>> recordDetails(@RequestBody PagerQuery<LpkGiftCardListQuery> pq) {
|
||||||
|
return lpkGiftCardService.recordDetails(pq);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ import com.yxt.common.core.query.PagerQuery;
|
|||||||
import com.yxt.common.core.result.ResultBean;
|
import com.yxt.common.core.result.ResultBean;
|
||||||
import com.yxt.common.core.vo.PagerVo;
|
import com.yxt.common.core.vo.PagerVo;
|
||||||
import com.yxt.yyth.api.lpkcardbuildrecord.LpkCardBuildRecord;
|
import com.yxt.yyth.api.lpkcardbuildrecord.LpkCardBuildRecord;
|
||||||
|
import com.yxt.yyth.api.lpkcardbuildrecord.LpkCardBuildRecordQuery;
|
||||||
|
import com.yxt.yyth.api.lpkcardbuildrecord.LpkCardBuildRecordVo;
|
||||||
import com.yxt.yyth.api.lpkgiftbaggoods.LpkGiftBagGoodsVo;
|
import com.yxt.yyth.api.lpkgiftbaggoods.LpkGiftBagGoodsVo;
|
||||||
import com.yxt.yyth.api.lpkgiftcard.*;
|
import com.yxt.yyth.api.lpkgiftcard.*;
|
||||||
import com.yxt.yyth.api.lpkgoods.LpkGoods;
|
import com.yxt.yyth.api.lpkgoods.LpkGoods;
|
||||||
@@ -257,4 +259,25 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
|||||||
public List<LpkGiftCardListVo> selAllByRecordSid(String sid) {
|
public List<LpkGiftCardListVo> selAllByRecordSid(String sid) {
|
||||||
return baseMapper.selAllByRecordSid(sid);
|
return baseMapper.selAllByRecordSid(sid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ResultBean<PagerVo<LpkGiftCardListVo>> recordDetails(PagerQuery<LpkGiftCardListQuery> pq) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
LpkGiftCardListQuery query = pq.getParams();
|
||||||
|
QueryWrapper<LpkGiftCard> qw = new QueryWrapper<>();
|
||||||
|
qw.eq("1", "1");
|
||||||
|
if (StringUtils.isNotBlank(query.getState())) {
|
||||||
|
qw.eq("state", query.getState());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(query.getSerialNumber())) {
|
||||||
|
qw.like("serialNumber", query.getSerialNumber());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(query.getSid())) {
|
||||||
|
qw.like("recordSid", query.getSid());
|
||||||
|
}
|
||||||
|
qw.orderByDesc("createTime");
|
||||||
|
IPage<LpkGiftCard> page = PagerUtil.queryToPage(pq);
|
||||||
|
IPage<LpkGiftCardListVo> pagging = baseMapper.recordDetails(page, qw);
|
||||||
|
PagerVo<LpkGiftCardListVo> p = PagerUtil.pageToVo(pagging, null);
|
||||||
|
return rb.success().setData(p);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user