1/11
This commit is contained in:
@@ -54,4 +54,7 @@ public interface EmpCardMapper extends BaseMapper<EmpCard> {
|
||||
|
||||
@Select("update emp_card set isItInvalid='1',state='5',isReservation='1' where giftbagSid=#{giftbagSid} and state!=#{state} ")
|
||||
Integer updateIsItInvalid(@Param("giftbagSid") String giftbagSid, @Param("state") String state);
|
||||
|
||||
|
||||
IPage<LpkGiftCardWordVo> selGiftCard(IPage<LpkGiftCard> page, @Param(Constants.WRAPPER) QueryWrapper<LpkGiftCard> qw);
|
||||
}
|
||||
|
||||
@@ -225,5 +225,11 @@
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
</select>
|
||||
<select id="selGiftCard" resultType="com.yxt.yyth.api.lpkgiftcard.LpkGiftCardWordVo">
|
||||
select card.*,bag.name as bagName from emp_card card left join lpk_giftbag bag on bag.sid =card.giftbagSid
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,15 +1,13 @@
|
||||
package com.yxt.yyth.biz.empcard;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.yyth.api.empcard.EmpCardDto;
|
||||
import com.yxt.yyth.api.empcard.EmpCardQuery;
|
||||
import com.yxt.yyth.api.empcard.EmpCardVo;
|
||||
import com.yxt.yyth.api.lpkgiftcard.BindCardDto;
|
||||
import com.yxt.yyth.api.lpkgiftcard.LpkGiftCardListQuery;
|
||||
import com.yxt.yyth.api.lpkgiftcard.LpkGiftCardListVo;
|
||||
import com.yxt.yyth.api.lpkgiftcard.LpkGiftCardQuery;
|
||||
import com.yxt.yyth.api.lpkgiftcard.*;
|
||||
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderQuery;
|
||||
import com.yxt.yyth.biz.empcardgift.EmpCardGiftService;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -91,5 +89,34 @@ public class EmpCardRest {
|
||||
return empCardService.isSaturAndSun(cardSid);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 企业卡积木报表接口
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param printAll
|
||||
* @param end
|
||||
* @param start
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getEmpCard")
|
||||
@ApiOperation(value = "生成礼包卡信息")
|
||||
public JSONObject getCardByBank(@RequestParam(value = "pageNo",defaultValue = "1")Integer pageNo,
|
||||
@RequestParam(value = "pageSize",defaultValue = "8")Integer pageSize,
|
||||
@RequestParam(value = "printAll",required = false) String printAll,
|
||||
@RequestParam(value = "end",defaultValue = "") String end,
|
||||
@RequestParam(value = "start",defaultValue = "") String start) {
|
||||
PagerQuery<LpkGiftCardListQuery> pq=new PagerQuery<>();
|
||||
LpkGiftCardListQuery q=new LpkGiftCardListQuery();
|
||||
pq.setCurrent(pageNo);
|
||||
pq.setSize(pageSize);
|
||||
q.setNoEnd(end);
|
||||
q.setNoStart(start);
|
||||
pq.setParams(q);
|
||||
PagerVo<LpkGiftCardWordVo> p=empCardService.getCardByBank(pq).getData();
|
||||
JSONObject jsonObject=new JSONObject();
|
||||
jsonObject.put("date",p.getRecords());
|
||||
jsonObject.put("total",p.getPages());
|
||||
jsonObject.put("count",p.getTotal());
|
||||
return jsonObject;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -592,4 +592,39 @@ public class EmpCardService extends MybatisBaseService<EmpCardMapper, EmpCard> {
|
||||
baseMapper.updateById(card);
|
||||
return rb.success().setData("成功");
|
||||
}
|
||||
|
||||
public ResultBean<PagerVo<LpkGiftCardWordVo>> getCardByBank(PagerQuery<LpkGiftCardListQuery> pq) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
LpkGiftCardListQuery query = pq.getParams();
|
||||
QueryWrapper<LpkGiftCard> qw = new QueryWrapper<>();
|
||||
Integer end = 0;
|
||||
Integer start = 0;
|
||||
List<Integer> serialNumbers = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(query.getNoStart())) {
|
||||
start = Integer.valueOf(query.getNoStart());
|
||||
if (StringUtils.isNotBlank(query.getNoEnd())) {
|
||||
end = Integer.valueOf(query.getNoEnd());
|
||||
if (start > end) {
|
||||
for (int i = 0; end <= start; end++) {
|
||||
serialNumbers.add(end);
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; start <= end; start++) {
|
||||
serialNumbers.add(start);
|
||||
}
|
||||
}
|
||||
qw.in("card.serialNumber", serialNumbers);
|
||||
}
|
||||
}
|
||||
qw.eq("card.isEnable","1");
|
||||
IPage<LpkGiftCard> page = PagerUtil.queryToPage(pq);
|
||||
IPage<LpkGiftCardWordVo> pagging = baseMapper.selGiftCard(page, qw);
|
||||
pagging.getRecords().forEach(s -> {
|
||||
// s.setQrCode("https://supervise.yxtsoft.com/lpkapi?code=" + s.getCode());
|
||||
s.setQrCode(qrUrl + s.getCode());
|
||||
});
|
||||
PagerVo<LpkGiftCardWordVo> p = PagerUtil.pageToVo(pagging, null);
|
||||
// System.out.println(a);
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ public class SaTokenConfigure implements WebMvcConfigurer {
|
||||
.excludePathPatterns("/lpkgoods/goodsDetails/**")
|
||||
.excludePathPatterns("/lpkstore/getAllStoreByQuery")
|
||||
.excludePathPatterns("/lpkgiftcard/getCardByBank")
|
||||
.excludePathPatterns("/empcard/getEmpCard")
|
||||
.excludePathPatterns("/empcardgift/shareEmpCard/**")
|
||||
.excludePathPatterns("/empcardgift/generateEmpCardGift")
|
||||
.excludePathPatterns("/empcardgift/generateEmpCard")
|
||||
|
||||
Reference in New Issue
Block a user