feat:订餐预约播报
This commit is contained in:
1 parent
2db6f9b0ac
commit
1ebd4f9bc8
6 files changed
+30
-11
No files matched your search
+1
-1
@@ -14,7 +14,7 @@ import java.util.List;
|
||||
@Getter
|
||||
public enum HardOrderTypeEnum {
|
||||
BELOW("1", "线下购买"),
|
||||
RESERVE("2", "线上订餐"),
|
||||
RESERVE("2", "线上预定"),
|
||||
FOREIGN_TICKET("3", "外来人员"),
|
||||
STRIDE_DEPT("4", "跨单位"),
|
||||
ZY("5", "正元公务餐"),
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ public enum HardPayTypeEnum {
|
||||
FACE("4", "人脸识别支付"),
|
||||
STRIDE_DEPT_QR_CODE("5", "跨单位二维码支付"),
|
||||
FOREIGN_TICKET_QR_CODE("6", "外来人员二维码支付"),
|
||||
RESERVE_QR_CODE("7", "线上订餐二维码支付"),
|
||||
RESERVE_QR_CODE("7", "线上二维码支付"),
|
||||
CASH("8", "现金支付"),
|
||||
HARD_DOOR_FREE_PAY("9", "智能柜免密支付"),
|
||||
;
|
||||
|
||||
+2
@@ -41,5 +41,7 @@ public class HardBroadcastVo extends HardBroadcastEntity implements BaseHardInte
|
||||
|
||||
private Integer payPrice;
|
||||
|
||||
private String hourType;
|
||||
|
||||
|
||||
}
|
||||
+8
-4
@@ -195,10 +195,14 @@ public class HardBroadcastServiceImpl extends ServiceImpl<HardBroadcastMapper, H
|
||||
public void androidDoneBroadcast(HardAdBroadcastDto dto) {
|
||||
if (ObjectUtil.isEmpty(dto.getIds())) return;
|
||||
if (ObjectUtil.isEmpty(dto.getCount())) dto.setCount(1);
|
||||
baseMapper.update(new LambdaUpdateWrapper<HardBroadcastEntity>()
|
||||
.setSql(" broadcast_count = broadcast_count + " + dto.getCount())
|
||||
.in(HardBroadcastEntity::getId, dto.getIds())
|
||||
);
|
||||
LambdaUpdateWrapper<HardBroadcastEntity> updateWrapper = new LambdaUpdateWrapper<HardBroadcastEntity>();
|
||||
if (ObjectUtil.equals(dto.getCount(), -1)) {
|
||||
updateWrapper.setSql(" broadcast_count = 0 ");
|
||||
} else {
|
||||
updateWrapper.setSql(" broadcast_count = broadcast_count + " + dto.getCount());
|
||||
}
|
||||
updateWrapper.in(HardBroadcastEntity::getId, dto.getIds());
|
||||
baseMapper.update(updateWrapper);
|
||||
}
|
||||
|
||||
private void disposeList(List<HardBroadcastVo> list, HardBroadcastDto dto) {
|
||||
|
||||
+1
@@ -77,6 +77,7 @@
|
||||
<select id="scopePageJoin" resultType="com.bsd.pjcloud.hard.api.vo.HardBroadcastVo">
|
||||
<include refid="selectA"/>
|
||||
o.id as orderId,
|
||||
o.hour_type as hourType,
|
||||
o.product_desc as productDesc,
|
||||
o.pay_price as payPrice
|
||||
from hard_broadcast a
|
||||
|
||||
+17
-5
@@ -78,12 +78,24 @@ public class WalletCodeUseServiceImpl extends ServiceImpl<WalletCodeUseMapper, W
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean generate(Long id, Long userId, WalletCodeBizEnum biz, Integer count) {
|
||||
if (count == 0) return false;
|
||||
HardOrderTypeEnum orderType = HardOrderTypeEnum.FOREIGN_TICKET;
|
||||
HardPayTypeEnum payType = HardPayTypeEnum.FOREIGN_TICKET_QR_CODE;
|
||||
HardOrderTypeEnum orderType = null;
|
||||
HardPayTypeEnum payType = null;
|
||||
if (biz == WalletCodeBizEnum.STRIDE) {
|
||||
orderType = HardOrderTypeEnum.STRIDE_DEPT;
|
||||
payType = HardPayTypeEnum.STRIDE_DEPT_QR_CODE;
|
||||
}
|
||||
if (biz == WalletCodeBizEnum.FOREIGN) {
|
||||
orderType = HardOrderTypeEnum.FOREIGN_TICKET;
|
||||
payType = HardPayTypeEnum.FOREIGN_TICKET_QR_CODE;
|
||||
}
|
||||
if (biz == WalletCodeBizEnum.CANTEEN_RESERVE) {
|
||||
orderType = HardOrderTypeEnum.RESERVE;
|
||||
payType = HardPayTypeEnum.RESERVE_QR_CODE;
|
||||
}
|
||||
if (biz == WalletCodeBizEnum.SUPERMARKET_RESERVE) {
|
||||
orderType = HardOrderTypeEnum.RESERVE;
|
||||
payType = HardPayTypeEnum.RESERVE_QR_CODE;
|
||||
}
|
||||
for (int i = 0; i < count; i++) {
|
||||
WalletCodeUseEntity item = WalletCodeUseEntity.builder().bizId(id).userId(userId).bizType(biz.getCode()).build();
|
||||
int insert = baseMapper.insert(item);
|
||||
@@ -91,13 +103,13 @@ public class WalletCodeUseServiceImpl extends ServiceImpl<WalletCodeUseMapper, W
|
||||
QRCodeDto dto = QRCodeDto.builder().id(id).itemId(item.getId()).userId(item.getUserId()).orderType(orderType.getType()).payType(payType.getType()).exceedTime(-1L).build();
|
||||
try {
|
||||
ImmutablePair<String, String> code = HardUtil.generate(dto);
|
||||
byte[] bytes = QRCodeImageGenerator.generateQrCodeImage(code.getRight(), 1024);
|
||||
// 生成短码
|
||||
String shortCode = generateShortCode(code.getRight());
|
||||
byte[] bytes = QRCodeImageGenerator.generateQrCodeImage(shortCode, 1024);
|
||||
MultipartFile multipartFile = new MockMultipartFile("file", code.getLeft() + ".png", "image/png", new ByteArrayInputStream(bytes));
|
||||
R upload = remoteFileService.innerUpload(multipartFile, null, null, null);
|
||||
Map data = (Map) upload.getData();
|
||||
String url = (String) data.get("url");
|
||||
// 生成短码
|
||||
String shortCode = generateShortCode(code.getRight());
|
||||
// 更新
|
||||
WalletCodeUseEntity updateObj = WalletCodeUseEntity.builder().id(item.getId()).code(url).codeContent(code.getRight()).shortCode(shortCode).build();
|
||||
baseMapper.updateById(updateObj);
|
||||
|
||||
Reference in new issue
Block a user