feat:后台打印
This commit is contained in:
1 parent
f122598825
commit
f9c6d9f193
24 files changed
+378
-74
No files matched your search
+12
-12
@@ -61,18 +61,18 @@ CREATE TABLE hard_group
|
||||
DROP TABLE IF EXISTS `hard_invoice`;
|
||||
CREATE TABLE hard_invoice
|
||||
(
|
||||
id bigint NOT NULL COMMENT '编号',
|
||||
dept_id bigint NOT NULL COMMENT '部门id',
|
||||
hard_id bigint NOT NULL COMMENT '设备id',
|
||||
hard_order_id bigint NOT NULL COMMENT '硬件订单id',
|
||||
status char(10) NOT NULL COMMENT '状态',
|
||||
pic varchar(256) NOT NULL COMMENT '发票图片',
|
||||
create_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
create_time datetime DEFAULT NULL COMMENT '创建时间',
|
||||
update_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
|
||||
update_time datetime DEFAULT NULL COMMENT '修改时间',
|
||||
del_flag char(1) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标记',
|
||||
tenant_id bigint DEFAULT NULL COMMENT '租户ID',
|
||||
id bigint NOT NULL COMMENT '编号',
|
||||
dept_id bigint NOT NULL COMMENT '部门id',
|
||||
hard_id bigint NOT NULL COMMENT '设备id',
|
||||
order_id bigint NOT NULL COMMENT '硬件订单id',
|
||||
status char(10) NOT NULL COMMENT '状态',
|
||||
pic varchar(256) NOT NULL COMMENT '发票图片',
|
||||
create_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
create_time datetime DEFAULT NULL COMMENT '创建时间',
|
||||
update_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
|
||||
update_time datetime DEFAULT NULL COMMENT '修改时间',
|
||||
del_flag char(1) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标记',
|
||||
tenant_id bigint DEFAULT NULL COMMENT '租户ID',
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
|
||||
+3
-3
@@ -81,7 +81,7 @@ public class CanteenCategoryController {
|
||||
@PreAuthorize("@pms.hasPermission('canteen_canteenCategory_add')")
|
||||
public R save(@RequestBody CanteenCategoryEntity canteenCategory) {
|
||||
canteenCategory.setDeptId(SecurityUtils.getUser().getDeptId());
|
||||
return R.ok(canteenCategoryService.save(canteenCategory));
|
||||
return R.ok(canteenCategoryService.create(canteenCategory));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -95,7 +95,7 @@ public class CanteenCategoryController {
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('canteen_canteenCategory_edit')")
|
||||
public R updateById(@RequestBody CanteenCategoryEntity canteenCategory) {
|
||||
return R.ok(canteenCategoryService.updateById(canteenCategory));
|
||||
return R.ok(canteenCategoryService.edit(canteenCategory));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -109,7 +109,7 @@ public class CanteenCategoryController {
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('canteen_canteenCategory_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(canteenCategoryService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
return R.ok(canteenCategoryService.delByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
@@ -16,6 +16,7 @@ import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.canteen.entity.CanteenDailyMenuEntity;
|
||||
import com.bsd.pjcloud.canteen.service.CanteenDailyMenuService;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
|
||||
+7
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.canteen.entity.CanteenCategoryEntity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public interface CanteenCategoryService extends IService<CanteenCategoryEntity> {
|
||||
@@ -25,4 +26,10 @@ public interface CanteenCategoryService extends IService<CanteenCategoryEntity>
|
||||
* @return
|
||||
*/
|
||||
List<CanteenCategoryEntity> listScope(LambdaQueryWrapper<CanteenCategoryEntity> wrapper);
|
||||
|
||||
Boolean edit(CanteenCategoryEntity canteenCategory);
|
||||
|
||||
Long create(CanteenCategoryEntity canteenCategory);
|
||||
|
||||
Boolean delByIds(ArrayList<Long> list);
|
||||
}
|
||||
+1
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.canteen.dto.DailyMenuAll;
|
||||
import com.bsd.pjcloud.canteen.dto.app.DailyMenuDTO;
|
||||
import com.bsd.pjcloud.canteen.entity.CanteenDailyMenuEntity;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
+39
-4
@@ -1,5 +1,6 @@
|
||||
package com.bsd.pjcloud.canteen.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -7,8 +8,11 @@ import com.bsd.pjcloud.canteen.entity.CanteenCategoryEntity;
|
||||
import com.bsd.pjcloud.canteen.mapper.CanteenCategoryMapper;
|
||||
import com.bsd.pjcloud.canteen.service.CanteenCategoryService;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.mqtt.api.feign.RemoteMqttEventService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -18,16 +22,47 @@ import java.util.List;
|
||||
* @date 2024-12-05 17:54:19
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class CanteenCategoryServiceImpl extends ServiceImpl<CanteenCategoryMapper, CanteenCategoryEntity> implements CanteenCategoryService {
|
||||
|
||||
private final RemoteMqttEventService remoteMqttEventService;
|
||||
|
||||
@Override
|
||||
public Page<CanteenCategoryEntity> selectPageByScope(Page page, LambdaQueryWrapper<CanteenCategoryEntity> wrapper) {
|
||||
|
||||
|
||||
return baseMapper.selectPageByScope(page,wrapper,DataScope.of());
|
||||
return baseMapper.selectPageByScope(page, wrapper, DataScope.of());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CanteenCategoryEntity> listScope(LambdaQueryWrapper<CanteenCategoryEntity> wrapper) {
|
||||
return baseMapper.selectListByScope(wrapper,DataScope.of());
|
||||
return baseMapper.selectListByScope(wrapper, DataScope.of());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long create(CanteenCategoryEntity canteenCategory) {
|
||||
baseMapper.insert(canteenCategory);
|
||||
// 发送mq消息
|
||||
remoteMqttEventService.sendCanteenClassifyChangeMsg(canteenCategory.getDeptId());
|
||||
return canteenCategory.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean edit(CanteenCategoryEntity canteenCategory) {
|
||||
CanteenCategoryEntity detail = baseMapper.selectById(canteenCategory.getId());
|
||||
if (ObjectUtil.isEmpty(detail)) throw new RuntimeException("菜品分类不存在");
|
||||
baseMapper.updateById(canteenCategory);
|
||||
// 发送mq消息
|
||||
remoteMqttEventService.sendCanteenClassifyChangeMsg(detail.getDeptId());
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean delByIds(ArrayList<Long> list) {
|
||||
if (ObjectUtil.isEmpty(list)) return false;
|
||||
List<CanteenCategoryEntity> categoryList = baseMapper.selectList(new LambdaQueryWrapper<CanteenCategoryEntity>()
|
||||
.in(CanteenCategoryEntity::getId, list)
|
||||
);
|
||||
// 发送mq消息
|
||||
categoryList.forEach(v -> remoteMqttEventService.sendCanteenClassifyChangeMsg(v.getDeptId()));
|
||||
return baseMapper.deleteByIds(list) > 0;
|
||||
}
|
||||
}
|
||||
+10
-2
@@ -14,7 +14,9 @@ import com.bsd.pjcloud.canteen.entity.CanteenDailyMenuEntity;
|
||||
import com.bsd.pjcloud.canteen.mapper.CanteenDailyMenuMapper;
|
||||
import com.bsd.pjcloud.canteen.service.CanteenDailyMenuService;
|
||||
import com.bsd.pjcloud.canteen.vo.app.DailyMenuAppVO;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.mqtt.api.feign.RemoteMqttEventService;
|
||||
import com.bsd.pjcloud.wallet.api.feign.RemoteMchService;
|
||||
import com.bsd.pjcloud.wallet.api.vo.MchManageVo;
|
||||
@@ -98,14 +100,14 @@ public class CanteenDailyMenuServiceImpl extends ServiceImpl<CanteenDailyMenuMap
|
||||
baseMapper.insert(todayDO);
|
||||
});
|
||||
// 发送mq消息
|
||||
remoteMqttEventService.sendCanteenProductChangeMsg(null);
|
||||
sendMqttMsg(canteenDailyMenu.getMerchantId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean delByIds(ArrayList<Long> list, Long merchantId) {
|
||||
baseMapper.deleteByIds(list);
|
||||
// 发送mq消息
|
||||
remoteMqttEventService.sendCanteenProductChangeMsg(null);
|
||||
sendMqttMsg(merchantId);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -155,4 +157,10 @@ public class CanteenDailyMenuServiceImpl extends ServiceImpl<CanteenDailyMenuMap
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
// 发送mq消息
|
||||
private void sendMqttMsg(Long mchId) {
|
||||
if (ObjectUtil.isEmpty(mchId)) return;
|
||||
Optional.of(remoteMchService.getById(mchId)).map(R::getData).map(MchManageVo::getDeptId).ifPresent(remoteMqttEventService::sendCanteenProductChangeMsg);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -47,7 +47,7 @@ public class HardInvoiceEntity extends Model<HardInvoiceEntity> {
|
||||
* 硬件订单id
|
||||
*/
|
||||
@Schema(description="硬件订单id")
|
||||
private Long hardOrderId;
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
|
||||
+1
@@ -58,6 +58,7 @@ public class HardUtil {
|
||||
public <T extends BaseOrderInterface> T convertOrder(T v, HardOrderEntity order) {
|
||||
if (ObjectUtil.isEmpty(order)) return v;
|
||||
v.setOrderHardId(order.getHardId());
|
||||
v.setOrderMchId(order.getMerchantId());
|
||||
v.setOrderId(order.getId());
|
||||
v.setOrderDeptId(order.getDeptId());
|
||||
v.setOrderWalletId(order.getWalletId());
|
||||
|
||||
+45
-2
@@ -2,17 +2,60 @@ package com.bsd.pjcloud.hard.api.vo;
|
||||
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseDeptInterface;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardInvoiceEntity;
|
||||
import com.bsd.pjcloud.hard.api.vo.base.BaseHardInterface;
|
||||
import com.bsd.pjcloud.hard.api.vo.base.BaseOrderInterface;
|
||||
import com.bsd.pjcloud.wallet.api.vo.base.BaseMchInterface;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HardInvoiceVo extends HardInvoiceEntity implements BaseDeptInterface, BaseMchInterface {
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class HardInvoiceVo extends HardInvoiceEntity implements BaseDeptInterface, BaseMchInterface, BaseOrderInterface, BaseHardInterface {
|
||||
|
||||
private Long historyId;
|
||||
|
||||
/**
|
||||
* 部门相关
|
||||
*/
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 商户相关
|
||||
*/
|
||||
private Long merchantId;
|
||||
|
||||
private String merchantName;
|
||||
|
||||
private String logoPic;
|
||||
|
||||
/**
|
||||
* 订单相关
|
||||
*/
|
||||
private Long orderHardId;
|
||||
|
||||
private Long orderMchId;
|
||||
|
||||
private Long orderId;
|
||||
|
||||
private Long orderDeptId;
|
||||
|
||||
private Long orderWalletId;
|
||||
|
||||
private Long orderParentCarId;
|
||||
|
||||
private Integer orderTotalPrice;
|
||||
|
||||
private Integer orderExtraPrice;
|
||||
|
||||
private Integer orderPayPrice;
|
||||
|
||||
private LocalDateTime orderPayTime;
|
||||
|
||||
/**
|
||||
* 设备相关
|
||||
*/
|
||||
private String hardName;
|
||||
|
||||
private String hardType;
|
||||
|
||||
}
|
||||
+4
@@ -8,6 +8,10 @@ public interface BaseOrderInterface {
|
||||
|
||||
void setOrderHardId(Long orderHardId);
|
||||
|
||||
Long getOrderMchId();
|
||||
|
||||
void setOrderMchId(Long orderMchId);
|
||||
|
||||
Long getOrderId();
|
||||
|
||||
void setOrderId(Long orderId);
|
||||
|
||||
+2
@@ -31,6 +31,8 @@ public class HardAfterSaleVo extends HardAfterSaleEntity implements BaseUserInte
|
||||
*/
|
||||
private Long orderHardId;
|
||||
|
||||
private Long orderMchId;
|
||||
|
||||
private Long orderId;
|
||||
|
||||
private Long orderDeptId;
|
||||
|
||||
+10
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.idempotent.annotation.Idempotent;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.hard.api.dto.HardInvoiceDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardInvoiceEntity;
|
||||
@@ -37,6 +38,15 @@ public class HardInvoiceController {
|
||||
|
||||
private final HardInvoiceService hardInvoiceService;
|
||||
|
||||
|
||||
@Operation(summary = "后台打印", description = "后台打印")
|
||||
@SysLog("后台打印")
|
||||
@Idempotent(expireTime = 5, info = "正在打印中,请勿重复操作")
|
||||
@GetMapping("/print")
|
||||
public R print(@RequestParam Long orderId) {
|
||||
return R.ok(hardInvoiceService.print(orderId));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardInvoice_view')")
|
||||
|
||||
+2
-2
@@ -19,14 +19,14 @@ public interface HardInvoiceMapper extends PjcloudBaseMapper<HardInvoiceEntity>
|
||||
MPJLambdaWrapper<HardInvoiceEntity> wrapper = new MPJLambdaWrapper<HardInvoiceEntity>()
|
||||
.selectAll(HardInvoiceEntity.class)
|
||||
.eqIfExists(HardInvoiceEntity::getHardId, dto.getHardId())
|
||||
.eqIfExists(HardInvoiceEntity::getHardOrderId, dto.getHardOrderId());
|
||||
.eqIfExists(HardInvoiceEntity::getOrderId, dto.getOrderId());
|
||||
return selectJoinPage(page, HardInvoiceVo.class, wrapper);
|
||||
}
|
||||
|
||||
default Page<HardInvoiceVo> scopePageList(Page page, HardInvoiceDto dto) {
|
||||
LambdaQueryWrapper<HardInvoiceEntity> wrapper = new LambdaQueryWrapper<HardInvoiceEntity>()
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getHardId()), HardInvoiceEntity::getHardId, dto.getHardId())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getHardOrderId()), HardInvoiceEntity::getHardOrderId, dto.getHardOrderId());
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getOrderId()), HardInvoiceEntity::getOrderId, dto.getOrderId());
|
||||
Page list = selectPageByScope(page, wrapper, DataScope.of());
|
||||
list.setRecords(BeanUtils.toBean(list.getRecords(), HardInvoiceVo.class));
|
||||
return list;
|
||||
|
||||
+9
@@ -46,4 +46,13 @@ public interface HardInvoiceService extends IService<HardInvoiceEntity> {
|
||||
* @return
|
||||
*/
|
||||
Boolean printInvoice(Long orderId, Long historyId);
|
||||
|
||||
Boolean print(Long orderId);
|
||||
|
||||
/**
|
||||
* 根据订单信息打印
|
||||
* @param order
|
||||
* @return
|
||||
*/
|
||||
Boolean printByOrder(HardOrderEntity order);
|
||||
}
|
||||
+126
-4
@@ -3,35 +3,52 @@ package com.bsd.pjcloud.hard.service.impl;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.admin.api.dto.UserInfo;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysDept;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysUser;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteDeptService;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteFileService;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteUserService;
|
||||
import com.bsd.pjcloud.admin.api.utils.DataUtil;
|
||||
import com.bsd.pjcloud.common.core.util.BeanUtils;
|
||||
import com.bsd.pjcloud.common.core.util.CollectionUtils;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.hard.api.constant.HardPrintStatusEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.HardTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.order.HardOrderTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.dto.HardInvoiceDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.HardManagerDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.HardOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardInvoiceEntity;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardManagerEntity;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardCarEntity;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardOrderEntity;
|
||||
import com.bsd.pjcloud.hard.api.utils.Drawing2D;
|
||||
import com.bsd.pjcloud.hard.api.utils.HardUtil;
|
||||
import com.bsd.pjcloud.hard.api.vo.HardInvoiceVo;
|
||||
import com.bsd.pjcloud.hard.api.vo.HardManagerVo;
|
||||
import com.bsd.pjcloud.hard.api.vo.order.HardOrderVo;
|
||||
import com.bsd.pjcloud.hard.mapper.HardInvoiceMapper;
|
||||
import com.bsd.pjcloud.hard.mapper.HardManagerMapper;
|
||||
import com.bsd.pjcloud.hard.mapper.order.HardOrderMapper;
|
||||
import com.bsd.pjcloud.hard.service.HardCarService;
|
||||
import com.bsd.pjcloud.hard.service.HardInvoiceService;
|
||||
import com.bsd.pjcloud.hard.service.HardManagerService;
|
||||
import com.bsd.pjcloud.hard.service.HardOrderService;
|
||||
import com.bsd.pjcloud.hard.service.impl.order.HardAfterSaleServiceImpl;
|
||||
import com.bsd.pjcloud.mqtt.api.feign.RemoteMqttEventService;
|
||||
import com.bsd.pjcloud.mqtt.dto.hard.HardPrintMsg;
|
||||
import com.bsd.pjcloud.wallet.api.feign.RemoteMchService;
|
||||
import com.bsd.pjcloud.wallet.api.utils.WalletDataUtil;
|
||||
import com.bsd.pjcloud.wallet.api.vo.MchManageVo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.hibernate.validator.constraints.Range;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -62,19 +79,80 @@ public class HardInvoiceServiceImpl extends ServiceImpl<HardInvoiceMapper, HardI
|
||||
private final HardOrderService orderService;
|
||||
private final HardCarService carService;
|
||||
|
||||
private final HardOrderMapper hardOrderMapper;
|
||||
private final HardManagerMapper hardManagerMapper;
|
||||
|
||||
private final RemoteUserService userService;
|
||||
private final RemoteDeptService deptService;
|
||||
private final RemoteMchService mchService;
|
||||
private final RemoteFileService fileService;
|
||||
private final RemoteMqttEventService mqttEventService;
|
||||
|
||||
@Override
|
||||
public Page<HardInvoiceVo> pageJoin(Page page, HardInvoiceDto dto) {
|
||||
Page<HardInvoiceVo> list = baseMapper.pageJoin(page, dto);
|
||||
if (ObjectUtil.isNotEmpty(list.getRecords())) {
|
||||
// 部门
|
||||
List<Long> deptIds = list.getRecords().stream().map(HardInvoiceVo::getDeptId).filter(ObjectUtil::isNotEmpty).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(deptIds)) {
|
||||
R<Map<Long, SysDept>> deptList = deptService.getDeptByDeptIds(deptIds);
|
||||
if (ObjectUtil.isNotEmpty(deptList.getData())) {
|
||||
DataUtil.convertDeptList(list.getRecords(), deptList.getData());
|
||||
}
|
||||
}
|
||||
// 订单
|
||||
List<Long> orderIds = list.getRecords().stream().map(HardInvoiceVo::getOrderId).filter(ObjectUtil::isNotEmpty).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(orderIds)) {
|
||||
HardOrderDto hardOrderDto = new HardOrderDto();
|
||||
hardOrderDto.setOrderIds(orderIds);
|
||||
List<HardOrderEntity> orderList = hardOrderMapper.list(hardOrderDto);
|
||||
HardUtil.convertOrderList(list.getRecords(), CollectionUtils.convertMap(orderList, HardOrderEntity::getId));
|
||||
}
|
||||
// 设备
|
||||
List<Long> hardIds = list.getRecords().stream().map(HardInvoiceVo::getHardId).filter(ObjectUtil::isNotEmpty).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(hardIds)) {
|
||||
HardManagerDto hardManagerDto = new HardManagerDto();
|
||||
hardManagerDto.setIds(hardIds);
|
||||
List<HardManagerEntity> hardList = hardManagerMapper.list(hardManagerDto);
|
||||
if (ObjectUtil.isNotEmpty(hardList)) {
|
||||
HardUtil.convertHardList(list.getRecords(), CollectionUtils.convertMap(hardList, HardManagerEntity::getId));
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<HardInvoiceVo> scopePageList(Page page, HardInvoiceDto dto) {
|
||||
Page<HardInvoiceVo> list = baseMapper.scopePageList(page, dto);
|
||||
if (ObjectUtil.isNotEmpty(list.getRecords())) {
|
||||
// 部门
|
||||
List<Long> deptIds = list.getRecords().stream().map(HardInvoiceVo::getDeptId).filter(ObjectUtil::isNotEmpty).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(deptIds)) {
|
||||
R<Map<Long, SysDept>> deptList = deptService.getDeptByDeptIds(deptIds);
|
||||
if (ObjectUtil.isNotEmpty(deptList.getData())) {
|
||||
DataUtil.convertDeptList(list.getRecords(), deptList.getData());
|
||||
}
|
||||
}
|
||||
// 订单
|
||||
List<Long> orderIds = list.getRecords().stream().map(HardInvoiceVo::getOrderId).filter(ObjectUtil::isNotEmpty).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(orderIds)) {
|
||||
HardOrderDto hardOrderDto = new HardOrderDto();
|
||||
hardOrderDto.setOrderIds(orderIds);
|
||||
List<HardOrderEntity> orderList = hardOrderMapper.list(hardOrderDto);
|
||||
HardUtil.convertOrderList(list.getRecords(), CollectionUtils.convertMap(orderList, HardOrderEntity::getId));
|
||||
}
|
||||
// 设备
|
||||
List<Long> hardIds = list.getRecords().stream().map(HardInvoiceVo::getHardId).filter(ObjectUtil::isNotEmpty).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(hardIds)) {
|
||||
HardManagerDto hardManagerDto = new HardManagerDto();
|
||||
hardManagerDto.setIds(hardIds);
|
||||
List<HardManagerEntity> hardList = hardManagerMapper.list(hardManagerDto);
|
||||
if (ObjectUtil.isNotEmpty(hardList)) {
|
||||
HardUtil.convertHardList(list.getRecords(), CollectionUtils.convertMap(hardList, HardManagerEntity::getId));
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -95,13 +173,13 @@ public class HardInvoiceServiceImpl extends ServiceImpl<HardInvoiceMapper, HardI
|
||||
MchManageVo mch = Optional.of(mchService.getById(order.getMerchantId())).map(R::getData).orElseThrow(() -> new RuntimeException("商户不存在"));
|
||||
// 订单类型
|
||||
String orderType = "- -";
|
||||
HardOrderTypeEnum orderTypeEnum = HardOrderTypeEnum.valueOf(order.getOrderType());
|
||||
HardOrderTypeEnum orderTypeEnum = HardOrderTypeEnum.valueOfByType(order.getOrderType());
|
||||
if (ObjectUtil.isNotEmpty(orderTypeEnum)) {
|
||||
orderType = orderTypeEnum.getDescription();
|
||||
}
|
||||
// 硬件类型
|
||||
String hardwareName = HardTypeEnum.CANTEEN.getType();
|
||||
HardTypeEnum sysTypeEnum = HardTypeEnum.valueOf(order.getSysType());
|
||||
HardTypeEnum sysTypeEnum = HardTypeEnum.valueOfByType(order.getSysType());
|
||||
if (ObjectUtil.isNotEmpty(sysTypeEnum)) {
|
||||
hardwareName = sysTypeEnum.getDescription();
|
||||
}
|
||||
@@ -166,9 +244,11 @@ public class HardInvoiceServiceImpl extends ServiceImpl<HardInvoiceMapper, HardI
|
||||
if (ObjectUtil.isEmpty(order)) throw new RuntimeException("设备不存在");
|
||||
String image = generateInvoice(order);
|
||||
if (ObjectUtil.isEmpty(image)) return null;
|
||||
HardInvoiceEntity insertObj = HardInvoiceEntity.builder().hardId(hardManager.getId()).hardOrderId(orderId).pic(image).status(HardPrintStatusEnum.GENERATE.getType()).build();
|
||||
HardInvoiceEntity insertObj = HardInvoiceEntity.builder().deptId(order.getDeptId()).hardId(hardManager.getId()).orderId(orderId).pic(image).status(HardPrintStatusEnum.GENERATE.getType()).build();
|
||||
baseMapper.insert(insertObj);
|
||||
return BeanUtils.toBean(insertObj, HardInvoiceVo.class);
|
||||
HardInvoiceVo result = BeanUtils.toBean(insertObj, HardInvoiceVo.class);
|
||||
result.setHistoryId(result.getId());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -181,4 +261,46 @@ public class HardInvoiceServiceImpl extends ServiceImpl<HardInvoiceMapper, HardI
|
||||
HardInvoiceEntity updateObj = HardInvoiceEntity.builder().id(historyId).status(HardPrintStatusEnum.PRINT.getType()).build();
|
||||
return baseMapper.updateById(updateObj) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean print(Long orderId) {
|
||||
// 查询订单
|
||||
HardOrderEntity order = orderService.getById(orderId);
|
||||
if (ObjectUtil.isEmpty(order)) throw new RuntimeException("订单不存在");
|
||||
getSelf().printByOrder(order);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean printByOrder(HardOrderEntity order) {
|
||||
// 查询商户
|
||||
MchManageVo mch = mchService.getById(order.getMerchantId()).getData();
|
||||
if (ObjectUtil.isEmpty(mch)) throw new RuntimeException("设备不存在");
|
||||
// 查询设备
|
||||
HardManagerVo hard = hardManagerService.getById(order.getHardId());
|
||||
if (ObjectUtil.isEmpty(hard)) throw new RuntimeException("设备不存在");
|
||||
String image = generateInvoice(order);
|
||||
HardInvoiceEntity insertObj = HardInvoiceEntity.builder().deptId(order.getDeptId()).hardId(hard.getId()).orderId(order.getId()).pic(image).status(HardPrintStatusEnum.GENERATE.getType()).build();
|
||||
baseMapper.insert(insertObj);
|
||||
HardPrintMsg hardPrintMsg = new HardPrintMsg();
|
||||
hardPrintMsg.setUserId(order.getUserId());
|
||||
hardPrintMsg.setHardId(order.getHardId());
|
||||
hardPrintMsg.setMchDeptId(mch.getDeptId());
|
||||
hardPrintMsg.setHistoryId(insertObj.getId());
|
||||
hardPrintMsg.setOrderId(order.getId());
|
||||
hardPrintMsg.setAndroidOrderCode(order.getAndroidOrderCode());
|
||||
hardPrintMsg.setPic(image);
|
||||
R<Boolean> result = mqttEventService.sendPrint(hardPrintMsg);
|
||||
if (result.getCode() != 0 || !result.getData()) {
|
||||
log.error("|{}|根据订单信息打印错误order:|{}|error:|{}|", TAG, JSON.toJSONString(order), result.getMsg());
|
||||
throw new RuntimeException("打印错误");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private HardInvoiceServiceImpl getSelf() {
|
||||
return SpringUtil.getBean(getClass());
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
<id property="id" column="id"/>
|
||||
<result property="deptId" column="dept_id"/>
|
||||
<result property="hardId" column="hard_id"/>
|
||||
<result property="hardOrderId" column="hard_order_id"/>
|
||||
<result property="orderId" column="hard_order_id"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="pic" column="pic"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
|
||||
+14
-5
@@ -4,8 +4,10 @@ import com.bsd.pjcloud.common.core.constant.ServiceNameConstants;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.feign.annotation.NoToken;
|
||||
import com.bsd.pjcloud.mqtt.dto.MqttBaseDto;
|
||||
import com.bsd.pjcloud.mqtt.dto.hard.HardPrintMsg;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@@ -23,35 +25,35 @@ public interface RemoteMqttEventService {
|
||||
*/
|
||||
@NoToken
|
||||
@GetMapping("/mqtt/send-config-change-msg")
|
||||
R<Boolean> sendConfigChangeMsg(@RequestParam Long mchDeptId);
|
||||
R<Boolean> sendConfigChangeMsg(@RequestParam Long deptId);
|
||||
|
||||
/**
|
||||
* 食堂商品变化
|
||||
*/
|
||||
@NoToken
|
||||
@GetMapping("/mqtt/send-canteen-product-change-msg")
|
||||
R<Boolean> sendCanteenProductChangeMsg(@RequestParam(required = false) Long mchDeptId);
|
||||
R<Boolean> sendCanteenProductChangeMsg(@RequestParam Long deptId);
|
||||
|
||||
/**
|
||||
* 食堂分类变化
|
||||
*/
|
||||
@NoToken
|
||||
@GetMapping("/mqtt/send-canteen-classify-change-msg")
|
||||
R<Boolean> sendCanteenClassifyChangeMsg(@RequestParam(required = false) Long mchDeptId);
|
||||
R<Boolean> sendCanteenClassifyChangeMsg(@RequestParam Long deptId);
|
||||
|
||||
/**
|
||||
* 超市商品变化
|
||||
*/
|
||||
@NoToken
|
||||
@GetMapping("/mqtt/send-supermarket-product-change-msg")
|
||||
R<Boolean> sendSupermarketProductChangeMsg(@RequestParam(required = false) Long mchDeptId);
|
||||
R<Boolean> sendSupermarketProductChangeMsg(@RequestParam Long deptId);
|
||||
|
||||
/**
|
||||
* 超市分类变化
|
||||
*/
|
||||
@NoToken
|
||||
@GetMapping("/mqtt/send-supermarket-classify-change-msg")
|
||||
R<Boolean> sendSupermarketClassifyChangeMsg(@RequestParam(required = false) Long mchDeptId);
|
||||
R<Boolean> sendSupermarketClassifyChangeMsg(@RequestParam Long deptId);
|
||||
|
||||
/**
|
||||
* 人脸变化
|
||||
@@ -59,4 +61,11 @@ public interface RemoteMqttEventService {
|
||||
@NoToken
|
||||
@GetMapping("/mqtt/send-face-change-msg")
|
||||
R<Boolean> sendFaceChangeMsg(@RequestParam Long userDeptId, @RequestParam Long userId, @RequestParam(required = false) Boolean isGlobalFace);
|
||||
|
||||
/**
|
||||
* 人脸变化
|
||||
*/
|
||||
@NoToken
|
||||
@PostMapping("/mqtt/send-print")
|
||||
R<Boolean> sendPrint(@RequestBody HardPrintMsg dto);
|
||||
}
|
||||
+1
-1
@@ -26,7 +26,7 @@ public class MqttBaseDto<T extends MqttHardBaseMsg> {
|
||||
return String.format("topic/android/%s/%s/%s", hardGroupId, merchantDeptId, hardwareId);
|
||||
}
|
||||
if (ObjectUtil.isAllNotEmpty(hardGroupId, merchantDeptId)) {
|
||||
return String.format("topic/android/%s/%s", merchantDeptId, hardwareId);
|
||||
return String.format("topic/android/%s/%s", hardGroupId, merchantDeptId);
|
||||
}
|
||||
if (ObjectUtil.isAllNotEmpty(hardGroupId)) {
|
||||
return String.format("topic/android/%s", hardGroupId);
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.bsd.pjcloud.mqtt.dto.hard;
|
||||
|
||||
import com.bsd.pjcloud.mqtt.dto.MqttHardBaseMsg;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HardPrintMsg extends MqttHardBaseMsg {
|
||||
// 用户id
|
||||
private Long userId;
|
||||
|
||||
// 设备id
|
||||
private Long hardId;
|
||||
|
||||
// 设备部门id
|
||||
private Long mchDeptId;
|
||||
|
||||
// 打印记录id
|
||||
private Long historyId;
|
||||
|
||||
// 订单id
|
||||
private Long orderId;
|
||||
|
||||
// 安卓订单id
|
||||
private String androidOrderCode;
|
||||
|
||||
// 图片地址
|
||||
private String pic;
|
||||
}
|
||||
+32
-18
@@ -6,6 +6,7 @@ import com.bsd.pjcloud.common.security.annotation.Inner;
|
||||
import com.bsd.pjcloud.mqtt.constant.MqttActionEnum;
|
||||
import com.bsd.pjcloud.mqtt.dto.MqttBaseDto;
|
||||
import com.bsd.pjcloud.mqtt.dto.hard.HardCustomerMsg;
|
||||
import com.bsd.pjcloud.mqtt.dto.hard.HardPrintMsg;
|
||||
import com.bsd.pjcloud.mqtt.service.MqttEventService;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@@ -13,9 +14,6 @@ import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/mqtt")
|
||||
@@ -36,10 +34,10 @@ public class MqttEventController {
|
||||
*/
|
||||
@Inner
|
||||
@GetMapping("/send-config-change-msg")
|
||||
public R<Boolean> sendConfigChangeMsg(@RequestParam Long mchDeptId) {
|
||||
public R<Boolean> sendConfigChangeMsg(@RequestParam Long deptId) {
|
||||
MqttBaseDto dto = new MqttBaseDto<>();
|
||||
dto.setAction(MqttActionEnum.CONFIG);
|
||||
dto.setMerchantDeptId(mchDeptId);
|
||||
dto.setMerchantDeptId(deptId);
|
||||
return R.ok(mqttEventService.defaultAction(dto));
|
||||
}
|
||||
|
||||
@@ -48,10 +46,11 @@ public class MqttEventController {
|
||||
*/
|
||||
@Inner
|
||||
@GetMapping("/send-canteen-product-change-msg")
|
||||
public R<Boolean> sendCanteenProductChangeMsg(@RequestParam Long mchDeptId) {
|
||||
public R<Boolean> sendCanteenProductChangeMsg(@RequestParam Long deptId) {
|
||||
MqttBaseDto dto = new MqttBaseDto<>();
|
||||
if (ObjectUtil.isNotEmpty(mchDeptId)) {
|
||||
dto.setMerchantDeptId(mchDeptId);
|
||||
mqttEventService.getTopicParamsByUserDeptId(dto, deptId);
|
||||
if (ObjectUtil.isNotEmpty(deptId)) {
|
||||
dto.setMerchantDeptId(deptId);
|
||||
}
|
||||
dto.setAction(MqttActionEnum.CANTEEN_PRODUCT);
|
||||
return R.ok(mqttEventService.defaultAction(dto));
|
||||
@@ -62,11 +61,9 @@ public class MqttEventController {
|
||||
*/
|
||||
@Inner
|
||||
@GetMapping("/send-canteen-classify-change-msg")
|
||||
public R<Boolean> sendCanteenClassifyChangeMsg(@RequestParam Long mchDeptId) {
|
||||
public R<Boolean> sendCanteenClassifyChangeMsg(@RequestParam Long deptId) {
|
||||
MqttBaseDto dto = new MqttBaseDto<>();
|
||||
if (ObjectUtil.isNotEmpty(mchDeptId)) {
|
||||
dto.setMerchantDeptId(mchDeptId);
|
||||
}
|
||||
mqttEventService.getTopicParamsByUserDeptId(dto, deptId);
|
||||
dto.setAction(MqttActionEnum.CANTEEN_CLASSIFY);
|
||||
return R.ok(mqttEventService.defaultAction(dto));
|
||||
}
|
||||
@@ -76,10 +73,11 @@ public class MqttEventController {
|
||||
*/
|
||||
@Inner
|
||||
@GetMapping("/send-supermarket-product-change-msg")
|
||||
public R<Boolean> sendSupermarketProductChangeMsg(@RequestParam Long mchDeptId) {
|
||||
public R<Boolean> sendSupermarketProductChangeMsg(@RequestParam Long deptId) {
|
||||
MqttBaseDto dto = new MqttBaseDto<>();
|
||||
if (ObjectUtil.isNotEmpty(mchDeptId)) {
|
||||
dto.setMerchantDeptId(mchDeptId);
|
||||
mqttEventService.getTopicParamsByUserDeptId(dto, deptId);
|
||||
if (ObjectUtil.isNotEmpty(deptId)) {
|
||||
dto.setMerchantDeptId(deptId);
|
||||
}
|
||||
dto.setAction(MqttActionEnum.SUPERMARKET_PRODUCT);
|
||||
return R.ok(mqttEventService.defaultAction(dto));
|
||||
@@ -90,10 +88,10 @@ public class MqttEventController {
|
||||
*/
|
||||
@Inner
|
||||
@GetMapping("/send-supermarket-classify-change-msg")
|
||||
public R<Boolean> sendSupermarketClassifyChangeMsg(@RequestParam Long mchDeptId) {
|
||||
public R<Boolean> sendSupermarketClassifyChangeMsg(@RequestParam Long deptId) {
|
||||
MqttBaseDto dto = new MqttBaseDto<>();
|
||||
if (ObjectUtil.isNotEmpty(mchDeptId)) {
|
||||
dto.setMerchantDeptId(mchDeptId);
|
||||
if (ObjectUtil.isNotEmpty(deptId)) {
|
||||
dto.setMerchantDeptId(deptId);
|
||||
}
|
||||
dto.setAction(MqttActionEnum.SUPERMARKET_CLASSIFY);
|
||||
return R.ok(mqttEventService.defaultAction(dto));
|
||||
@@ -118,4 +116,20 @@ public class MqttEventController {
|
||||
return R.ok(mqttEventService.defaultAction(dto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印发票
|
||||
*/
|
||||
@Inner
|
||||
@PostMapping("/send-print")
|
||||
public R<Boolean> sendPrint(@RequestBody HardPrintMsg dto) {
|
||||
MqttBaseDto mqttBaseDto = new MqttBaseDto();
|
||||
mqttEventService.getTopicParamsByUserDeptId(mqttBaseDto, dto.getMchDeptId());
|
||||
mqttBaseDto.setMerchantDeptId(dto.getMchDeptId());
|
||||
mqttBaseDto.setHardwareId(dto.getHardId());
|
||||
mqttBaseDto.setAction(MqttActionEnum.PRINT);
|
||||
dto.setAction(MqttActionEnum.PRINT);
|
||||
mqttBaseDto.setData(dto);
|
||||
return R.ok(mqttEventService.defaultAction(mqttBaseDto));
|
||||
}
|
||||
|
||||
}
|
||||
+1
@@ -25,6 +25,7 @@ public class MqttEventService {
|
||||
|
||||
public <T extends MqttBaseDto> Boolean defaultAction(T dto) {
|
||||
MqttHardBaseMsg msg = dto.getData();
|
||||
if (ObjectUtil.isEmpty(msg)) msg = new MqttHardBaseMsg();
|
||||
msg.setAction(dto.getAction());
|
||||
mqttService.publish(dto.getQos(), false, dto.getTopic(), JSON.toJSONString(msg));
|
||||
return true;
|
||||
|
||||
+24
-19
@@ -35,27 +35,32 @@ import java.util.List;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class UserDTO extends SysUser {
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@Schema(description = "角色id集合")
|
||||
private List<Long> role;
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@Schema(description = "角色id集合")
|
||||
private List<Long> role;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@Schema(description = "部门id")
|
||||
private Long deptId;
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@Schema(description = "部门id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 岗位ID
|
||||
*/
|
||||
private List<Long> post;
|
||||
/**
|
||||
* 岗位ID
|
||||
*/
|
||||
private List<Long> post;
|
||||
|
||||
/**
|
||||
* 新密码
|
||||
*/
|
||||
@Schema(description = "新密码")
|
||||
private String newpassword1;
|
||||
/**
|
||||
* 新密码
|
||||
*/
|
||||
@Schema(description = "新密码")
|
||||
private String newpassword1;
|
||||
|
||||
/**
|
||||
* 根据名字或者手机号来查询
|
||||
*/
|
||||
private String nameOrPhone;
|
||||
|
||||
}
|
||||
@@ -182,6 +182,10 @@
|
||||
<bind name="phoneLike" value="'%'+query.phone+'%'"/>
|
||||
AND u.phone LIKE #{phoneLike}
|
||||
</if>
|
||||
<if test="query.nameOrPhone != null and query.nameOrPhone != ''">
|
||||
<bind name="nameOrPhone" value="'%'+query.nameOrPhone+'%'"/>
|
||||
AND (u.phone LIKE #{nameOrPhone} OR u.name LIKE #{nameOrPhone} )
|
||||
</if>
|
||||
</where>
|
||||
|
||||
<if test="_databaseId != 'mssql'">
|
||||
|
||||
Reference in new issue
Block a user