钱包、硬件权限
This commit is contained in:
1 parent
f1d57d6d51
commit
07084b07c9
20 files changed
+176
-78
No files matched your search
+8
@@ -3,11 +3,19 @@ package com.bsd.pjcloud.hard.api.dto;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardInvoiceEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class HardInvoiceDto extends HardInvoiceEntity {
|
||||
|
||||
private List<Long> deptIds;
|
||||
|
||||
private List<Long> userIds;
|
||||
|
||||
private List<Long> merchantIds;
|
||||
|
||||
private String hardType;
|
||||
|
||||
private LocalDate[] createTimeList;
|
||||
}
|
||||
+6
-1
@@ -11,10 +11,15 @@ import java.util.List;
|
||||
public class HardOrderDto extends HardOrderEntity {
|
||||
|
||||
/**
|
||||
* 用户相关
|
||||
* 订单部门id极其子部门id
|
||||
*/
|
||||
private Long deptIdIdDeepen;
|
||||
private List<Long> deptIds;
|
||||
|
||||
private List<Long> userIds;
|
||||
|
||||
private List<Long> userDeptIds;
|
||||
|
||||
private List<Long> orderIds;
|
||||
|
||||
private List<Long> hardIds;
|
||||
|
||||
+15
-1
@@ -1,6 +1,7 @@
|
||||
package com.bsd.pjcloud.hard.api.vo;
|
||||
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseDeptInterface;
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseUserInterface;
|
||||
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;
|
||||
@@ -10,7 +11,7 @@ import lombok.Data;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class HardInvoiceVo extends HardInvoiceEntity implements BaseDeptInterface, BaseMchInterface, BaseOrderInterface, BaseHardInterface {
|
||||
public class HardInvoiceVo extends HardInvoiceEntity implements BaseDeptInterface, BaseMchInterface, BaseOrderInterface, BaseHardInterface, BaseUserInterface {
|
||||
|
||||
private Long historyId;
|
||||
|
||||
@@ -33,6 +34,8 @@ public class HardInvoiceVo extends HardInvoiceEntity implements BaseDeptInterfac
|
||||
*/
|
||||
private Long orderHardId;
|
||||
|
||||
private Long orderUserId;
|
||||
|
||||
private Long orderMchId;
|
||||
|
||||
private Long orderId;
|
||||
@@ -58,4 +61,15 @@ public class HardInvoiceVo extends HardInvoiceEntity implements BaseDeptInterfac
|
||||
|
||||
private String hardType;
|
||||
|
||||
/**
|
||||
* 用户相关
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
private String username;
|
||||
|
||||
private String userMobile;
|
||||
|
||||
private String userAvatar;
|
||||
|
||||
}
|
||||
+2
-1
@@ -43,6 +43,7 @@ public class HardInvoiceController {
|
||||
@SysLog("后台打印")
|
||||
@Idempotent(expireTime = 5, info = "正在打印中,请勿重复操作")
|
||||
@GetMapping("/print")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardInvoice_admin_print')")
|
||||
public R print(@RequestParam Long orderId) {
|
||||
return R.ok(hardInvoiceService.print(orderId));
|
||||
}
|
||||
@@ -59,7 +60,7 @@ public class HardInvoiceController {
|
||||
@GetMapping("/page-join")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardInvoice_view')")
|
||||
public R pageJoin(@ParameterObject Page page, @ParameterObject HardInvoiceDto dto) {
|
||||
return R.ok(hardInvoiceService.scopePageList(page, dto));
|
||||
return R.ok(hardInvoiceService.scopeJoinPageList(page, dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
|
||||
+2
@@ -93,6 +93,7 @@ public class HardAfterSaleController {
|
||||
|
||||
@PutMapping("/agree")
|
||||
@Operation(summary = "同意售后")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardAfterSale_change')")
|
||||
@Idempotent(expireTime = 10, info = "正在处理中,请勿重复操作")
|
||||
public R<Boolean> agreeRefund(@RequestParam Long id) {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
@@ -101,6 +102,7 @@ public class HardAfterSaleController {
|
||||
|
||||
@PostMapping("/disagree")
|
||||
@Operation(summary = "拒绝售后")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardAfterSale_change')")
|
||||
@Idempotent(expireTime = 10, info = "正在处理中,请勿重复操作")
|
||||
public R<Boolean> disagreeRefund(@RequestBody HardDisagreeDto dto) {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
|
||||
+2
-8
@@ -11,6 +11,7 @@ import com.bsd.pjcloud.hard.api.entity.HardInvoiceEntity;
|
||||
import com.bsd.pjcloud.hard.api.vo.HardInvoiceVo;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface HardInvoiceMapper extends PjcloudBaseMapper<HardInvoiceEntity> {
|
||||
@@ -23,13 +24,6 @@ public interface HardInvoiceMapper extends PjcloudBaseMapper<HardInvoiceEntity>
|
||||
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.getOrderId()), HardInvoiceEntity::getOrderId, dto.getOrderId());
|
||||
Page list = selectPageByScope(page, wrapper, DataScope.of());
|
||||
list.setRecords(BeanUtils.toBean(list.getRecords(), HardInvoiceVo.class));
|
||||
return list;
|
||||
}
|
||||
Page<HardInvoiceVo> scopePageList(Page page, @Param("dto") HardInvoiceDto dto, @Param("dataScope") DataScope dataScope);
|
||||
|
||||
}
|
||||
+2
-1
@@ -28,6 +28,7 @@ public interface HardOrderMapper extends PjcloudBaseMapper<HardOrderEntity> {
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), HardOrderEntity::getUserId, dto.getUserIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getHardIds()), HardOrderEntity::getHardId, dto.getHardIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getMchIds()), HardOrderEntity::getMerchantId, dto.getMchIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserDeptIds()), HardOrderEntity::getDeptId, dto.getUserDeptIds())
|
||||
.between(
|
||||
ObjectUtil.isNotEmpty(dto.getCreateTimeList()),
|
||||
HardOrderEntity::getCreateTime,
|
||||
@@ -36,7 +37,7 @@ public interface HardOrderMapper extends PjcloudBaseMapper<HardOrderEntity> {
|
||||
)
|
||||
.between(
|
||||
ObjectUtil.isNotEmpty(dto.getPayTimeList()),
|
||||
HardOrderEntity::getPayType,
|
||||
HardOrderEntity::getPayTime,
|
||||
ObjectUtil.isNotEmpty(dto.getPayTimeList()) ? dto.getPayTimeList()[0] : null,
|
||||
ObjectUtil.isNotEmpty(dto.getPayTimeList()) ? dto.getPayTimeList()[1] : null
|
||||
);
|
||||
|
||||
+1
-7
@@ -3,19 +3,13 @@ package com.bsd.pjcloud.hard.service;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.hard.api.dto.HardInvoiceDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.async.SyncOfflineReqVo;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardInvoiceEntity;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardOrderEntity;
|
||||
import com.bsd.pjcloud.hard.api.vo.HardInvoiceVo;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface HardInvoiceService extends IService<HardInvoiceEntity> {
|
||||
|
||||
Page<HardInvoiceVo> pageJoin(Page page, HardInvoiceDto dto);
|
||||
|
||||
Page<HardInvoiceVo> scopePageList(Page page, HardInvoiceDto dto);
|
||||
Page<HardInvoiceVo> scopeJoinPageList(Page page, HardInvoiceDto dto);
|
||||
|
||||
/**
|
||||
* 生成发票
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ public class HardApiServiceImpl implements HardApiService {
|
||||
if (ObjectUtil.isEmpty(wallet)) return null;
|
||||
SysUser sysUser = user.getSysUser();
|
||||
result.setUserId(sysUser.getUserId());
|
||||
result.setUsername(sysUser.getUsername());
|
||||
result.setUsername(sysUser.getName());
|
||||
result.setUserAvatar(sysUser.getAvatar());
|
||||
result.setUserMobile(sysUser.getPhone());
|
||||
result.setDeptId(sysUser.getDeptId());
|
||||
|
||||
+20
-53
@@ -18,6 +18,7 @@ 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.common.data.datascope.DataScope;
|
||||
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;
|
||||
@@ -32,6 +33,7 @@ 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.HardAfterSaleVo;
|
||||
import com.bsd.pjcloud.hard.api.vo.order.HardOrderVo;
|
||||
import com.bsd.pjcloud.hard.mapper.HardInvoiceMapper;
|
||||
import com.bsd.pjcloud.hard.mapper.HardManagerMapper;
|
||||
@@ -57,6 +59,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
@@ -84,13 +87,13 @@ public class HardInvoiceServiceImpl extends ServiceImpl<HardInvoiceMapper, HardI
|
||||
|
||||
private final RemoteUserService userService;
|
||||
private final RemoteDeptService deptService;
|
||||
private final RemoteMchService mchService;
|
||||
private final RemoteMchService remoteMchService;
|
||||
private final RemoteFileService fileService;
|
||||
private final RemoteMqttEventService mqttEventService;
|
||||
|
||||
@Override
|
||||
public Page<HardInvoiceVo> pageJoin(Page page, HardInvoiceDto dto) {
|
||||
Page<HardInvoiceVo> list = baseMapper.pageJoin(page, dto);
|
||||
public Page<HardInvoiceVo> scopeJoinPageList(Page page, HardInvoiceDto dto) {
|
||||
Page<HardInvoiceVo> list = baseMapper.scopePageList(page, dto, DataScope.of());
|
||||
if (ObjectUtil.isNotEmpty(list.getRecords())) {
|
||||
// 部门
|
||||
List<Long> deptIds = list.getRecords().stream().map(HardInvoiceVo::getDeptId).filter(ObjectUtil::isNotEmpty).distinct().toList();
|
||||
@@ -100,56 +103,20 @@ public class HardInvoiceServiceImpl extends ServiceImpl<HardInvoiceMapper, HardI
|
||||
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));
|
||||
// 用户
|
||||
List<Long> userIds = list.getRecords().stream().map(HardInvoiceVo::getOrderUserId).filter(ObjectUtil::isNotEmpty).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(userIds)) {
|
||||
R<List<SysUser>> userList = userService.getUserById(new ArrayList<>(userIds));
|
||||
if (ObjectUtil.isNotEmpty(userList.getData())) {
|
||||
DataUtil.convertUserList(list.getRecords(), CollectionUtils.convertMap(userList.getData(), SysUser::getUserId));
|
||||
}
|
||||
}
|
||||
}
|
||||
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));
|
||||
// 商户
|
||||
List<Long> mchIds = list.getRecords().stream().map(HardInvoiceVo::getMerchantId).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(mchIds)) {
|
||||
R<List<MchManageVo>> mchList = remoteMchService.getByIds(mchIds);
|
||||
if (ObjectUtil.isNotEmpty(mchList.getData())) {
|
||||
WalletDataUtil.convertMchList(list.getRecords(), CollectionUtils.convertMap(mchList.getData(), MchManageVo::getId));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -170,7 +137,7 @@ public class HardInvoiceServiceImpl extends ServiceImpl<HardInvoiceMapper, HardI
|
||||
UserInfo user = Optional.of(userService.getByUserId(order.getUserId())).map(R::getData).orElseThrow(() -> new RuntimeException("用户不存在"));
|
||||
SysUser sysUser = user.getSysUser();
|
||||
// 查询商户
|
||||
MchManageVo mch = Optional.of(mchService.getById(order.getMerchantId())).map(R::getData).orElseThrow(() -> new RuntimeException("商户不存在"));
|
||||
MchManageVo mch = Optional.of(remoteMchService.getById(order.getMerchantId())).map(R::getData).orElseThrow(() -> new RuntimeException("商户不存在"));
|
||||
// 订单类型
|
||||
String orderType = "- -";
|
||||
HardOrderTypeEnum orderTypeEnum = HardOrderTypeEnum.valueOfByType(order.getOrderType());
|
||||
@@ -276,7 +243,7 @@ public class HardInvoiceServiceImpl extends ServiceImpl<HardInvoiceMapper, HardI
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean printByOrder(HardOrderEntity order) {
|
||||
// 查询商户
|
||||
MchManageVo mch = mchService.getById(order.getMerchantId()).getData();
|
||||
MchManageVo mch = remoteMchService.getById(order.getMerchantId()).getData();
|
||||
if (ObjectUtil.isEmpty(mch)) throw new RuntimeException("设备不存在");
|
||||
// 查询设备
|
||||
HardManagerVo hard = hardManagerService.getById(order.getHardId());
|
||||
|
||||
+17
@@ -2,6 +2,7 @@ package com.bsd.pjcloud.hard.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
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.entity.SysDept;
|
||||
@@ -24,6 +25,7 @@ import com.bsd.pjcloud.hard.service.HardManagerService;
|
||||
import com.bsd.pjcloud.hard.mqtt.config.MqttConfig;
|
||||
import com.bsd.pjcloud.hard.utils.MqTopicUtil;
|
||||
import com.bsd.pjcloud.mqtt.api.feign.RemoteMqttEventService;
|
||||
import com.bsd.pjcloud.wallet.api.entity.MchManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.feign.RemoteMchService;
|
||||
import com.bsd.pjcloud.wallet.api.utils.WalletDataUtil;
|
||||
import com.bsd.pjcloud.wallet.api.vo.MchManageVo;
|
||||
@@ -184,6 +186,9 @@ public class HardManagerServiceImpl extends ServiceImpl<HardManagerMapper, HardM
|
||||
if (ObjectUtil.isEmpty(detail)) {
|
||||
throw new RuntimeException("设备不存在");
|
||||
}
|
||||
if (existUniqueCode(dto.getUniqueCode(), dto.getId())) {
|
||||
throw new RuntimeException("该唯一编码已经被绑定");
|
||||
}
|
||||
HardManagerEntity updateObj = HardManagerEntity.builder().id(detail.getId()).uniqueCode(dto.getUniqueCode()).build();
|
||||
baseMapper.updateById(updateObj);
|
||||
return getById(dto.getId());
|
||||
@@ -200,6 +205,18 @@ public class HardManagerServiceImpl extends ServiceImpl<HardManagerMapper, HardM
|
||||
return vo;
|
||||
}
|
||||
|
||||
private boolean existUniqueCode(String uniqueCode, Long id) {
|
||||
Long count = baseMapper.selectCount(new LambdaQueryWrapper<HardManagerEntity>()
|
||||
.eq(ObjectUtil.isNotEmpty(uniqueCode), HardManagerEntity::getUniqueCode, uniqueCode)
|
||||
.ne(ObjectUtil.isNotEmpty(id), HardManagerEntity::getId, id)
|
||||
);
|
||||
if (ObjectUtil.isNotEmpty(id)) {
|
||||
return count >= 1;
|
||||
}
|
||||
return count > 0;
|
||||
}
|
||||
|
||||
|
||||
private String createMqConfigByAction(Long groupId, Long deptId, Long hardId, Integer action) {
|
||||
MqTopicUtil eventDto = MqTopicUtil.builder().groupId(groupId).deptId(deptId).hardId(hardId).build();
|
||||
if (ObjectUtil.equals(action, 1)) {
|
||||
|
||||
+8
@@ -152,6 +152,14 @@ public class HardOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardOrder
|
||||
|
||||
@Override
|
||||
public Page<HardOrderVo> scopePageList(Page page, HardOrderDto dto) {
|
||||
if (ObjectUtil.isNotEmpty(dto.getDeptIdIdDeepen())) {
|
||||
List<SysDept> deptList = deptService.getDescendantList(dto.getDeptIdIdDeepen()).getData();
|
||||
if (ObjectUtil.isNotEmpty(deptList)) {
|
||||
dto.setUserDeptIds(deptList.stream().map(SysDept::getDeptId).toList());
|
||||
} else {
|
||||
dto.setUserDeptIds(List.of(-1L));
|
||||
}
|
||||
}
|
||||
Page<HardOrderVo> list = baseMapper.scopePageList(page, dto);
|
||||
if (ObjectUtil.isNotEmpty(list.getRecords())) {
|
||||
// 用户
|
||||
|
||||
+69
-3
@@ -2,8 +2,7 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.bsd.pjcloud.hard.mapper.HardInvoiceMapper">
|
||||
|
||||
<resultMap id="hardInvoiceMap" type="com.bsd.pjcloud.hard.api.entity.HardInvoiceEntity">
|
||||
<resultMap id="hardInvoiceMap" type="com.bsd.pjcloud.hard.api.entity.HardInvoiceEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="deptId" column="dept_id"/>
|
||||
<result property="hardId" column="hard_id"/>
|
||||
@@ -16,5 +15,72 @@
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
</resultMap>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectA">
|
||||
select a.id,
|
||||
a.dept_id,
|
||||
a.hard_id,
|
||||
a.order_id,
|
||||
a.status,
|
||||
a.pic,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,
|
||||
a.del_flag,
|
||||
a.tenant_id,
|
||||
</sql>
|
||||
|
||||
<sql id="whereA">
|
||||
a.del_flag = '0'
|
||||
<if test="dto.createTimeList != null and dto.createTimeList.length == 2">
|
||||
and a.create_time between #{dto.createTimeList[0]} and #{dto.createTimeList[1]}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="scopePageList" resultType="com.bsd.pjcloud.hard.api.vo.HardInvoiceVo">
|
||||
<include refid="selectA"/>
|
||||
m.name as hardName,
|
||||
m.type as hardType,
|
||||
o.hard_id as orderHardId,
|
||||
o.user_id as orderUserId,
|
||||
o.user_id as userId,
|
||||
o.merchant_id as orderMchId,
|
||||
o.merchant_id as merchantId,
|
||||
o.dept_id as dept_id,
|
||||
o.wallet_id as orderWalletId,
|
||||
o.parent_car_id as orderParentCarId,
|
||||
o.total_price as orderTotalPrice,
|
||||
o.extra_price as orderExtraPrice,
|
||||
o.pay_price as orderPayPrice,
|
||||
o.pay_time as orderPayTime
|
||||
from hard_invoice a
|
||||
left join hard_manager m on m.id = a.hard_id
|
||||
left join hard_order o on o.id = a.order_id
|
||||
<where>
|
||||
<include refid="whereA"/>
|
||||
<if test="dto.merchantIds != null and dto.merchantIds.size() != 0">
|
||||
and o.merchant_id IN
|
||||
<foreach collection="dto.merchantIds" item="v" open="(" close=")" separator=",">
|
||||
#{v}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="dto.hardType != null and dto.hardType != '' ">
|
||||
and m.type = #{dto.hardType}
|
||||
</if>
|
||||
<if test="dto.userIds != null and dto.userIds.size() != 0">
|
||||
and o.user_id IN
|
||||
<foreach collection="dto.userIds" item="v" open="(" close=")" separator=",">
|
||||
#{v}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="dto.deptIds != null and dto.deptIds.size() != 0">
|
||||
and o.dept_id IN
|
||||
<foreach collection="dto.deptIds" item="v" open="(" close=")" separator=",">
|
||||
#{v}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -63,4 +63,6 @@ public class UserDTO extends SysUser {
|
||||
*/
|
||||
private String nameOrPhone;
|
||||
|
||||
private List<Long> userIds;
|
||||
|
||||
}
|
||||
+10
@@ -85,6 +85,16 @@ public interface RemoteDeptService {
|
||||
@GetMapping("/dept/getParentDeptList")
|
||||
R<List<SysDept>> getParentDeptList(@RequestParam("deptId") Long deptId);
|
||||
|
||||
/**
|
||||
* 获得指定部门的所有父部门
|
||||
*
|
||||
* @param deptId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/dept/getDescendantList/{deptId}")
|
||||
R<List<SysDept>> getDescendantList(@PathVariable Long deptId);
|
||||
|
||||
|
||||
/**
|
||||
* 查询部门所属的分组部门
|
||||
* @param deptId
|
||||
|
||||
+1
-1
@@ -518,8 +518,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("|{}|导入用户意外的错误error:|{}|", TAG, e.getMessage());
|
||||
throw new RuntimeException("导入错误");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -186,6 +186,12 @@
|
||||
<bind name="nameOrPhone" value="'%'+query.nameOrPhone+'%'"/>
|
||||
AND (u.phone LIKE #{nameOrPhone} OR u.name LIKE #{nameOrPhone} )
|
||||
</if>
|
||||
<if test="query.userIds != null and query.userIds.size() != 0">
|
||||
and u.user_id IN
|
||||
<foreach collection="query.userIds" item="v" open="(" close=")" separator=",">
|
||||
#{v}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
|
||||
<if test="_databaseId != 'mssql'">
|
||||
|
||||
+2
@@ -11,6 +11,7 @@ import org.springframework.http.HttpHeaders;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
@@ -60,6 +61,7 @@ public class WalletSettingController {
|
||||
@Operation(summary = "更新支付配置", description = "更新支付配置")
|
||||
@SysLog("更新支付配置")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_setting_edit')")
|
||||
public R updateById(@RequestBody WalletSettingDto dto) {
|
||||
walletSettingService.edit(dto);
|
||||
return R.ok(true);
|
||||
|
||||
+1
@@ -73,6 +73,7 @@ public class WalletTransactionController {
|
||||
|
||||
@PutMapping("/update-balance")
|
||||
@Operation(summary = "更新会员用户余额")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletTransaction_update_balance')")
|
||||
public R<Boolean> updateWalletBalance(@RequestBody WalletTransactionDto dto) {
|
||||
return R.ok(walletTransactionService.updateWalletBalance(dto));
|
||||
}
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ public class WalletRechargeApplyController {
|
||||
@Operation(summary = "新增充值/扣款申请", description = "新增充值/扣款申请")
|
||||
@SysLog("新增充值/扣款申请")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletRechargeApply_add')")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletRechargeApply_apply')")
|
||||
public R save(@RequestBody WalletRechargeApplyDto dto) {
|
||||
walletRechargeApplyService.create(dto);
|
||||
return R.ok();
|
||||
|
||||
Reference in new issue
Block a user