|
|
@ -14,6 +14,7 @@ import com.yxt.yyth.api.lpkcardbuildrecord.LpkCardBuildRecordVo; |
|
|
|
import com.yxt.yyth.api.lpkcustomer.LpkCustomer; |
|
|
|
import com.yxt.yyth.api.lpkcustomer.LpkCustomerQuery; |
|
|
|
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.biz.lpkgiftcard.LpkGiftCardService; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
@ -39,27 +40,19 @@ public class LpkCardBuildRecordService extends MybatisBaseService<LpkCardBuildRe |
|
|
|
QueryWrapper<LpkCardBuildRecord> qw = new QueryWrapper<>(); |
|
|
|
qw.eq("1", "1"); |
|
|
|
if (StringUtils.isNotBlank(query.getCountNumber())) { |
|
|
|
qw.eq("countNumber", query.getCountNumber()); |
|
|
|
qw.eq("r.countNumber", query.getCountNumber()); |
|
|
|
} |
|
|
|
String startDate = query.getStartDate(); |
|
|
|
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')"). |
|
|
|
apply(org.apache.commons.lang3.StringUtils.isNotEmpty(effEndTime), "date_format (buildDate,'%Y-%m-%d') <= date_format('" + effEndTime + "','%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 (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<LpkCardBuildRecordVo> pagging = baseMapper.recordListPage(page, qw); |
|
|
|
PagerVo<LpkCardBuildRecordVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
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); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|