Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
9b0b26f660
20 files changed
+228
-39
No files matched your search
+5
@@ -39,4 +39,9 @@ public class ADCanteenDailyMenuListVO {
|
||||
* 时间类型
|
||||
*/
|
||||
private Integer hourType;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
}
|
||||
+32
-31
@@ -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.canteen.mapper.CanteenDailyMenuMapper">
|
||||
|
||||
<resultMap id="canteenDailyMenuMap" type="com.bsd.pjcloud.canteen.entity.CanteenDailyMenuEntity">
|
||||
<resultMap id="canteenDailyMenuMap" type="com.bsd.pjcloud.canteen.entity.CanteenDailyMenuEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="startTime" column="start_time"/>
|
||||
<result property="spuId" column="spu_id"/>
|
||||
@@ -16,7 +15,7 @@
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
</resultMap>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="adCanteenDailyMenuListVO" type="com.bsd.pjcloud.canteen.vo.ADCanteenDailyMenuListVO">
|
||||
<id property="id" column="id"/>
|
||||
@@ -27,28 +26,29 @@
|
||||
<result property="categoryId" column="category_id"/>
|
||||
<result property="picUrl" column="pic_url"/>
|
||||
<result property="stock" column="stock"/>
|
||||
<result property="sort" column="sort"/>
|
||||
<result property="hourType" column="hour_type"/>
|
||||
</resultMap>
|
||||
<select id="selectTimeFood" resultType="com.bsd.pjcloud.canteen.vo.DailyMenuVO">
|
||||
SELECT
|
||||
DISTINCT(sp.id),
|
||||
t.id as tid,
|
||||
sp.name,
|
||||
sp.pic_url,
|
||||
t.hour_type,
|
||||
sp.price,
|
||||
sp.category_id
|
||||
t.id as tid,
|
||||
sp.name,
|
||||
sp.pic_url,
|
||||
t.hour_type,
|
||||
sp.price,
|
||||
sp.category_id
|
||||
FROM canteen_daily_menu t
|
||||
LEFT JOIN canteen_spu sp
|
||||
on t.spu_id=sp.id
|
||||
<where>
|
||||
AND t.merchant_id = #{merchantId}
|
||||
<if test="categoryId != null">
|
||||
AND sp.category_id = #{categoryId}
|
||||
</if>
|
||||
AND sp.del_flag = 0
|
||||
AND t.start_time = #{time}
|
||||
And t.del_flag = 0
|
||||
AND t.merchant_id = #{merchantId}
|
||||
<if test="categoryId != null">
|
||||
AND sp.category_id = #{categoryId}
|
||||
</if>
|
||||
AND sp.del_flag = 0
|
||||
AND t.start_time = #{time}
|
||||
And t.del_flag = 0
|
||||
</where>
|
||||
order by sp.sort asc
|
||||
</select>
|
||||
@@ -62,6 +62,7 @@
|
||||
sp.price,
|
||||
sp.stock,
|
||||
sp.category_id,
|
||||
sp.sort,
|
||||
t.dept_id,
|
||||
t.create_by
|
||||
FROM canteen_daily_menu t
|
||||
@@ -83,22 +84,23 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectTimeFoodPage" resultType="com.bsd.pjcloud.canteen.vo.app.DailyMenuAppVO" parameterType="com.bsd.pjcloud.canteen.dto.app.DailyMenuDTO">
|
||||
<select id="selectTimeFoodPage" resultType="com.bsd.pjcloud.canteen.vo.app.DailyMenuAppVO"
|
||||
parameterType="com.bsd.pjcloud.canteen.dto.app.DailyMenuDTO">
|
||||
SELECT m.id,
|
||||
m.hour_type,
|
||||
s.id as spu_id,
|
||||
s.`name`,
|
||||
s.price,
|
||||
s.stock,
|
||||
s.pic_url,
|
||||
s.sort,
|
||||
s.is_show,
|
||||
c.id as category_id
|
||||
m.hour_type,
|
||||
s.id as spu_id,
|
||||
s.`name`,
|
||||
s.price,
|
||||
s.stock,
|
||||
s.pic_url,
|
||||
s.sort,
|
||||
s.is_show,
|
||||
c.id as category_id
|
||||
FROM `canteen_daily_menu` m
|
||||
left JOIN canteen_spu s
|
||||
on m.spu_id = s.id
|
||||
LEFT JOIN canteen_category c
|
||||
on s.category_id = c.id
|
||||
left JOIN canteen_spu s
|
||||
on m.spu_id = s.id
|
||||
LEFT JOIN canteen_category c
|
||||
on s.category_id = c.id
|
||||
<where>
|
||||
m.del_flag = 0 and s.del_flag = 0 and m.merchant_id = #{dailyMenuDTO.merchantId} and s.is_show = 0
|
||||
<if test="dailyMenuDTO.startTime != null">
|
||||
@@ -112,6 +114,5 @@
|
||||
</if>
|
||||
</where>
|
||||
order by s.sort asc
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
+2
@@ -29,6 +29,8 @@ public class HardInvoiceVo extends HardInvoiceEntity implements BaseDeptInterfac
|
||||
|
||||
private String logoPic;
|
||||
|
||||
private String merchantType;
|
||||
|
||||
/**
|
||||
* 订单相关
|
||||
*/
|
||||
|
||||
+2
@@ -20,6 +20,8 @@ public class HardManagerVo extends HardManagerEntity implements BaseDeptInterfac
|
||||
|
||||
private String logoPic;
|
||||
|
||||
private String merchantType;
|
||||
|
||||
/**
|
||||
* 分类相关
|
||||
*/
|
||||
|
||||
+3
@@ -31,6 +31,9 @@ public class HardOrderCsVo implements BaseMchInterface, BaseHardInterface {
|
||||
@Schema(description = "商户id")
|
||||
private Long merchantId;
|
||||
|
||||
@Schema(description = "商户类型")
|
||||
private String merchantType;
|
||||
|
||||
@Schema(description = "总消费金额")
|
||||
private BigDecimal totalPayPrice;
|
||||
|
||||
|
||||
+3
@@ -30,6 +30,9 @@ public class HardOrderSbVo implements BaseMchInterface, BaseHardInterface {
|
||||
@Schema(description = "商户名称")
|
||||
private String merchantName;
|
||||
|
||||
@Schema(description = "商户类型")
|
||||
private String merchantType;
|
||||
|
||||
@Schema(description = "商户logo")
|
||||
private String logoPic;
|
||||
|
||||
|
||||
+2
@@ -16,4 +16,6 @@ public class HardSpuCategoryVo extends HardSpuCategoryEntity implements BaseMchI
|
||||
|
||||
private String logoPic;
|
||||
|
||||
private String merchantType;
|
||||
|
||||
}
|
||||
+2
@@ -34,6 +34,8 @@ public class HardSpuRepertoryVo extends HardSpuRepertoryEntity implements BaseMc
|
||||
|
||||
private String logoPic;
|
||||
|
||||
private String merchantType;
|
||||
|
||||
/**
|
||||
* 用户相关
|
||||
*/
|
||||
|
||||
+1
-1
@@ -41,5 +41,5 @@ public interface BaseUserDeptInterface {
|
||||
*/
|
||||
String getUserDeptName();
|
||||
|
||||
void setUserDeptName(String deptName);
|
||||
void setUserDeptName(String userDeptName);
|
||||
}
|
||||
+8
@@ -3,6 +3,14 @@ package com.bsd.pjcloud.wallet.api.dto.mch;
|
||||
import com.bsd.pjcloud.wallet.api.entity.mch.MchCheckoutEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class MchCheckoutDto extends MchCheckoutEntity {
|
||||
|
||||
private LocalDate[] checkoutTimeList;
|
||||
|
||||
private LocalDate[] createTimeList;
|
||||
|
||||
}
|
||||
+1
@@ -24,6 +24,7 @@ public class WalletDataUtil {
|
||||
if (ObjectUtil.isEmpty(vo)) return v;
|
||||
v.setMerchantName(vo.getName());
|
||||
v.setLogoPic(vo.getLogoPic());
|
||||
v.setMerchantType(vo.getTypes());
|
||||
return v;
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -43,4 +43,6 @@ public class WalletActiveVo extends WalletActiveEntity implements BaseUserInterf
|
||||
private String walletTypeIcon;
|
||||
|
||||
private String isRule;
|
||||
|
||||
private String merchantType;
|
||||
}
|
||||
+7
@@ -23,5 +23,12 @@ public interface BaseMchInterface {
|
||||
|
||||
void setLogoPic(String logoPic);
|
||||
|
||||
/**
|
||||
* 商户类型
|
||||
*/
|
||||
String getMerchantType();
|
||||
|
||||
void setMerchantType(String merchantType);
|
||||
|
||||
|
||||
}
|
||||
+34
-1
@@ -1,8 +1,41 @@
|
||||
package com.bsd.pjcloud.wallet.api.vo.mch;
|
||||
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseUserDeptInterface;
|
||||
import com.bsd.pjcloud.wallet.api.entity.mch.MchCheckoutEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.base.BaseMchInterface;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class MchCheckoutVo extends MchCheckoutEntity {
|
||||
public class MchCheckoutVo extends MchCheckoutEntity implements BaseMchInterface, BaseUserDeptInterface {
|
||||
|
||||
/**
|
||||
* 店铺相关
|
||||
*/
|
||||
private Long merchantId;
|
||||
|
||||
private String merchantName;
|
||||
|
||||
private String logoPic;
|
||||
|
||||
/**
|
||||
* 用户部门相关
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
private String username;
|
||||
|
||||
private String userMobile;
|
||||
|
||||
private String userAvatar;
|
||||
|
||||
private Long userDeptId;
|
||||
|
||||
private String userDeptName;
|
||||
|
||||
private String merchantType;
|
||||
|
||||
|
||||
}
|
||||
+2
@@ -17,6 +17,8 @@ public class MchDeptVo extends MchDeptEntity implements BaseMchInterface, BaseDe
|
||||
|
||||
private String logoPic;
|
||||
|
||||
private String merchantType;
|
||||
|
||||
/**
|
||||
* 部门相关
|
||||
*/
|
||||
|
||||
+12
-5
@@ -6,9 +6,15 @@ 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.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
import com.bsd.pjcloud.wallet.api.dto.mch.MchCheckoutDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.mch.MchCheckoutEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.mch.MchCheckoutVo;
|
||||
import com.bsd.pjcloud.wallet.service.MchCheckoutService;
|
||||
import lombok.Data;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
@@ -35,11 +41,11 @@ public class MchCheckoutController {
|
||||
private final MchCheckoutService mchCheckoutService;
|
||||
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PostMapping("/page-join")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_mchCheckout_view')")
|
||||
public R getMchCheckoutPage(@ParameterObject Page page, @ParameterObject MchCheckoutEntity mchCheckout) {
|
||||
LambdaQueryWrapper<MchCheckoutEntity> wrapper = Wrappers.lambdaQuery();
|
||||
return R.ok(mchCheckoutService.page(page, wrapper));
|
||||
public R<Page<MchCheckoutVo>> getMchCheckoutPage(@ParameterObject Page page, @RequestBody MchCheckoutDto dto) {
|
||||
DataScope dataScope = DataScope.of();
|
||||
return R.ok(mchCheckoutService.scopPageList(page, dto, dataScope));
|
||||
}
|
||||
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@@ -54,7 +60,8 @@ public class MchCheckoutController {
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_mchCheckout_add')")
|
||||
public R save(@RequestBody MchCheckoutEntity mchCheckout) {
|
||||
return R.ok(mchCheckoutService.save(mchCheckout));
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
return R.ok(mchCheckoutService.create(mchCheckout, user));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改商户结账", description = "修改商户结账")
|
||||
|
||||
+6
-1
@@ -1,11 +1,16 @@
|
||||
package com.bsd.pjcloud.wallet.mapper.mch;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.wallet.api.dto.mch.MchCheckoutDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.mch.MchCheckoutEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.mch.MchCheckoutVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface MchCheckoutMapper extends PjcloudBaseMapper<MchCheckoutEntity> {
|
||||
|
||||
|
||||
Page<MchCheckoutVo> scopPageList(Page page, @Param("dto") MchCheckoutDto dto, DataScope dataScope);
|
||||
}
|
||||
+8
@@ -1,8 +1,16 @@
|
||||
package com.bsd.pjcloud.wallet.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.wallet.api.dto.mch.MchCheckoutDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.mch.MchCheckoutEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.mch.MchCheckoutVo;
|
||||
|
||||
public interface MchCheckoutService extends IService<MchCheckoutEntity> {
|
||||
|
||||
Page<MchCheckoutVo> scopPageList(Page page, MchCheckoutDto dto, DataScope dataScope);
|
||||
|
||||
Long create(MchCheckoutEntity mchCheckout, PjcloudUser user);
|
||||
}
|
||||
+49
@@ -1,13 +1,62 @@
|
||||
package com.bsd.pjcloud.wallet.service.impl.mch;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteUserService;
|
||||
import com.bsd.pjcloud.admin.api.utils.DataUtil;
|
||||
import com.bsd.pjcloud.admin.api.vo.UserVO;
|
||||
import com.bsd.pjcloud.common.core.util.CollectionUtils;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.wallet.api.dto.mch.MchCheckoutDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.mch.MchCheckoutEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.mch.MchCheckoutVo;
|
||||
import com.bsd.pjcloud.wallet.mapper.mch.MchCheckoutMapper;
|
||||
import com.bsd.pjcloud.wallet.service.MchCheckoutService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 商户结账
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class MchCheckoutServiceImpl extends ServiceImpl<MchCheckoutMapper, MchCheckoutEntity> implements MchCheckoutService {
|
||||
|
||||
private final RemoteUserService remoteUserService;
|
||||
|
||||
@Override
|
||||
public Page<MchCheckoutVo> scopPageList(Page page, MchCheckoutDto dto, DataScope dataScope) {
|
||||
Page<MchCheckoutVo> pageList = baseMapper.scopPageList(page, dto, dataScope);
|
||||
disposeList(pageList.getRecords(), dto);
|
||||
return pageList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long create(MchCheckoutEntity mchCheckout, PjcloudUser user) {
|
||||
mchCheckout.setCheckoutUserId(user.getId());
|
||||
baseMapper.insert(mchCheckout);
|
||||
return mchCheckout.getId();
|
||||
}
|
||||
|
||||
private void disposeList(List<MchCheckoutVo> list, MchCheckoutDto dto) {
|
||||
if (ObjectUtil.isEmpty(list)) return;
|
||||
// 用户部门
|
||||
list.forEach(v -> v.setUserId(v.getCheckoutUserId()));
|
||||
List<Long> userIds = list.stream().map(MchCheckoutVo::getCheckoutUserId).filter(ObjectUtil::isNotEmpty).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(userIds)) {
|
||||
List<UserVO> userDeptList = remoteUserService.getUserDeptByIds(userIds).getData();
|
||||
if (ObjectUtil.isNotEmpty(userDeptList)) {
|
||||
DataUtil.convertUserDeptList(list, CollectionUtils.convertMap(userDeptList, UserVO::getUserId));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,4 +17,51 @@
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
</resultMap>
|
||||
<sql id="selectA">
|
||||
select a.id,
|
||||
a.checkout_time,
|
||||
a.checkout_user_id,
|
||||
a.merchant_id,
|
||||
a.price,
|
||||
a.pic,
|
||||
a.remark,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,
|
||||
a.del_flag,
|
||||
a.tenant_id,
|
||||
</sql>
|
||||
<sql id="whereA">
|
||||
<if test="dto.id != null">
|
||||
and a.id = #{dto.id}
|
||||
</if>
|
||||
<if test="dto.checkoutUserId != null">
|
||||
and a.checkout_user_id = #{dto.checkoutUserId}
|
||||
</if>
|
||||
<if test="dto.merchantId != null">
|
||||
and a.merchant_id = #{dto.merchantId}
|
||||
</if>
|
||||
<if test="dto.merchantId != null">
|
||||
and a.merchant_id = #{dto.merchantId}
|
||||
</if>
|
||||
<if test="dto.createTimeList != null and dto.createTimeList.length == 2">
|
||||
and a.create_time between #{dto.createTimeList[0]} and #{dto.createTimeList[1]}
|
||||
</if>
|
||||
<if test="dto.checkoutTimeList != null and dto.checkoutTimeList.length == 2">
|
||||
and a.checkout_time between #{dto.checkoutTimeList[0]} and #{dto.checkoutTimeList[1]}
|
||||
</if>
|
||||
</sql>
|
||||
<select id="scopPageList" resultType="com.bsd.pjcloud.wallet.api.vo.mch.MchCheckoutVo">
|
||||
<include refid="selectA"/>
|
||||
m.id as merchantId,
|
||||
m.name as merchantName,
|
||||
m.logo_pic as logoPic
|
||||
from mch_checkout a
|
||||
left join mch_manage m on a.merchant_id = m.id
|
||||
<where>
|
||||
<include refid="whereA"/>
|
||||
</where>
|
||||
group by a.create_time,a.id
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in new issue
Block a user