Commit 5b287dad by 吕明尚

Merge branch 'refs/heads/dev-cs' into test

parents 1e1710af d9286e68
...@@ -6,8 +6,9 @@ public enum PositionEnum { ...@@ -6,8 +6,9 @@ public enum PositionEnum {
CLEANER(1, "保洁人员"), CLEANER(1, "保洁人员"),
ADMIN(2, "管理员"), ADMIN(2, "管理员"),
//客服 //客服
CUSTOMER_SERVICE(3, "客服"); CUSTOMER_SERVICE(3, "客服"),
; //门店管理
MANAGE(4, "门店管理");
private Integer code; private Integer code;
private String name; private String name;
......
...@@ -17,8 +17,10 @@ import share.system.domain.vo.SOrderVo; ...@@ -17,8 +17,10 @@ import share.system.domain.vo.SOrderVo;
import share.system.request.CreateOrderRequest; import share.system.request.CreateOrderRequest;
import share.system.request.OrderComputedPriceRequest; import share.system.request.OrderComputedPriceRequest;
import share.system.request.OrderRefundRequest; import share.system.request.OrderRefundRequest;
import share.system.request.OrderStatisticsRequest;
import share.system.response.ComputedOrderPriceResponse; import share.system.response.ComputedOrderPriceResponse;
import share.system.response.OrderPayResultResponse; import share.system.response.OrderPayResultResponse;
import share.system.response.OrderStatisticsResponse;
import share.system.service.ISOrderService; import share.system.service.ISOrderService;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
...@@ -140,9 +142,9 @@ public class SOrderController extends BaseController ...@@ -140,9 +142,9 @@ public class SOrderController extends BaseController
return R.ok(sOrderService.autoRefund(request)); return R.ok(sOrderService.autoRefund(request));
} }
@GetMapping("/statistics") @PostMapping("/statistics")
public R<Object> statistics() { public R<OrderStatisticsResponse> statistics(@RequestBody OrderStatisticsRequest request) {
return R.ok(sOrderService.statistics()); return R.ok(sOrderService.statistics(request));
} }
} }
...@@ -81,6 +81,12 @@ public class SStoreController extends BaseController ...@@ -81,6 +81,12 @@ public class SStoreController extends BaseController
return success(sStoreService.storeList()); return success(sStoreService.storeList());
} }
//用户管理的门店
@GetMapping("/manageList")
@ApiOperation(value = "门店管理负责的门店")
public AjaxResult manageList() {
return success(sStoreService.manageList());
}
@PostMapping("/queryByStoreIds") @PostMapping("/queryByStoreIds")
public R<List<SStoreVo>> queryByStoreIds(@RequestBody SStoreDto dto) { public R<List<SStoreVo>> queryByStoreIds(@RequestBody SStoreDto dto) {
return R.ok(sStoreService.queryByStoreIds(dto)); return R.ok(sStoreService.queryByStoreIds(dto));
......
...@@ -20,6 +20,8 @@ public class SConsumerVo extends SConsumer { ...@@ -20,6 +20,8 @@ public class SConsumerVo extends SConsumer {
private Boolean isCleaner; private Boolean isCleaner;
private Boolean isManage;
private Boolean isAdmin; private Boolean isAdmin;
private Long consumerId; private Long consumerId;
......
...@@ -77,4 +77,6 @@ public interface SConsumerCouponMapper extends BaseMapper<SConsumerCoupon> ...@@ -77,4 +77,6 @@ public interface SConsumerCouponMapper extends BaseMapper<SConsumerCoupon>
List<SConsumerCoupon> selectOrderList(); List<SConsumerCoupon> selectOrderList();
SConsumerCoupon sumPayPrice(@Param("couponIds") List<Long> ids); SConsumerCoupon sumPayPrice(@Param("couponIds") List<Long> ids);
List<SConsumerCoupon> selectByIds(@Param("couponIds") List<Long> ids);
} }
package share.system.request;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
@Data
public class OrderStatisticsRequest {
//门店id
private Long storeId;
//开始时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date startTime;
//结束时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endTime;
}
package share.system.response;
import lombok.Data;
import share.system.domain.SOrder;
import java.math.BigDecimal;
import java.util.List;
@Data
public class OrderStatisticsResponse {
//累计流水
private BigDecimal totalFee = BigDecimal.ZERO;
//实际收入
private BigDecimal actualFee = BigDecimal.ZERO;
//门店交易
private BigDecimal storeFee = BigDecimal.ZERO;
//门店交易退款
private BigDecimal storeRefundFee = BigDecimal.ZERO;
//团购金额
private BigDecimal groupFee = BigDecimal.ZERO;
//团购退款
private BigDecimal groupRefundFee = BigDecimal.ZERO;
//平台支付
private BigDecimal platformFee = BigDecimal.ZERO;
//平台退款
private BigDecimal platformRefundFee = BigDecimal.ZERO;
//用户充值
private BigDecimal rechargeFee = BigDecimal.ZERO;
//用户充值退款
private BigDecimal rechargeRefundFee = BigDecimal.ZERO;
//充值余额支付
private BigDecimal rechargeBalance = BigDecimal.ZERO;
//充值余额退款
private BigDecimal rechargeBalanceRefundFee = BigDecimal.ZERO;
//其他消费
private BigDecimal otherFee = BigDecimal.ZERO;
//其他退款
private BigDecimal otherRefundFee = BigDecimal.ZERO;
//美团团购金额
private BigDecimal meituanFee = BigDecimal.ZERO;
//美团团购退款
private BigDecimal meituanRefundFee = BigDecimal.ZERO;
//抖音团购金额
private BigDecimal douyinFee = BigDecimal.ZERO;
//抖音团购退款
private BigDecimal douyinRefundFee = BigDecimal.ZERO;
//积分消费
private BigDecimal integralFee = BigDecimal.ZERO;
//积分退款
private BigDecimal integralRefundFee = BigDecimal.ZERO;
//订单集合
private List<SOrder> orderList;
}
...@@ -95,4 +95,6 @@ public interface ISConsumerCouponService extends IService<SConsumerCoupon> ...@@ -95,4 +95,6 @@ public interface ISConsumerCouponService extends IService<SConsumerCoupon>
List<SConsumerCoupon> selectOrderList(); List<SConsumerCoupon> selectOrderList();
SConsumerCoupon sumPayPrice(List<Long> ids); SConsumerCoupon sumPayPrice(List<Long> ids);
List<SConsumerCoupon> selectByIds(List<Long> ids);
} }
...@@ -8,12 +8,10 @@ import share.system.domain.SOrder; ...@@ -8,12 +8,10 @@ import share.system.domain.SOrder;
import share.system.domain.vo.SOrderDto; import share.system.domain.vo.SOrderDto;
import share.system.domain.vo.SOrderVo; import share.system.domain.vo.SOrderVo;
import share.system.domain.vo.SRoomVo; import share.system.domain.vo.SRoomVo;
import share.system.request.AdminRefundRequest; import share.system.request.*;
import share.system.request.CreateOrderRequest;
import share.system.request.OrderComputedPriceRequest;
import share.system.request.OrderRefundRequest;
import share.system.response.ComputedOrderPriceResponse; import share.system.response.ComputedOrderPriceResponse;
import share.system.response.OrderPayResultResponse; import share.system.response.OrderPayResultResponse;
import share.system.response.OrderStatisticsResponse;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -216,7 +214,7 @@ public interface ISOrderService extends IService<SOrder> ...@@ -216,7 +214,7 @@ public interface ISOrderService extends IService<SOrder>
List<SOrder> selectSOrderByStoreIdAndMaxTime(SOrder orderQuery); List<SOrder> selectSOrderByStoreIdAndMaxTime(SOrder orderQuery);
Object statistics(); OrderStatisticsResponse statistics(OrderStatisticsRequest request);
List<Long> couponIds(SOrder sOrder); List<Long> couponIds(SOrder sOrder);
......
...@@ -115,4 +115,6 @@ public interface ISStoreService extends IService<SStore> ...@@ -115,4 +115,6 @@ public interface ISStoreService extends IService<SStore>
List<SStore> storeNameByIds(List<Long> ids); List<SStore> storeNameByIds(List<Long> ids);
List<SStore> manageList();
} }
...@@ -157,6 +157,20 @@ public class OrderRefundServiceImpl extends ServiceImpl<SOrderMapper, SOrder> im ...@@ -157,6 +157,20 @@ public class OrderRefundServiceImpl extends ServiceImpl<SOrderMapper, SOrder> im
} }
} }
// private boolean rechargeRefundSaobei(OrderRefundRequest request, Recharge recharge){
// WechatPayInfo wechatPayInfo = wechatPayInfoService.getByNo(recharge.getTerminalTrace());
// if (ObjectUtil.isNull(wechatPayInfo)) {
// throw new BaseException("微信订单不存在!");
// }
// SaobeiRefundVo vo = new SaobeiRefundVo();
// vo.setRefund_fee(String.valueOf(request.getAmount().multiply(BigDecimal.TEN).multiply(BigDecimal.TEN).intValue()));
// vo.setTerminal_trace(BaseUtil.getOrderNo("WXNO"));
// vo.setTerminal_time(DateUtil.nowDate(Constants.DATE_TIME_FORMAT_NUM));
// vo.setOut_trade_no(wechatPayInfo.getTransactionId());
// SaobeiTradeRefundResponse response = saobeiService.refund(vo);
// return ObjectUtil.isNotEmpty(response);
// }
/** /**
* 扫呗退款-微信(人工退款) * 扫呗退款-微信(人工退款)
* @param request * @param request
......
...@@ -610,6 +610,11 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe ...@@ -610,6 +610,11 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
return baseMapper.sumPayPrice(ids); return baseMapper.sumPayPrice(ids);
} }
@Override
public List<SConsumerCoupon> selectByIds(List<Long> ids) {
return baseMapper.selectByIds(ids);
}
private void extracted(SConsumerCoupon item, BigDecimal bigDecimal, SRoom byId, BigDecimal subtract, SStore sStore) { private void extracted(SConsumerCoupon item, BigDecimal bigDecimal, SRoom byId, BigDecimal subtract, SStore sStore) {
//计算价格 //计算价格
BigDecimal multiply = bigDecimal.multiply(byId.getPrice()); BigDecimal multiply = bigDecimal.multiply(byId.getPrice());
......
...@@ -246,6 +246,12 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer ...@@ -246,6 +246,12 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
} else { } else {
vo.setIsAdmin(true); vo.setIsAdmin(true);
} }
List<Long> managerList = storeConsumerMapper.selectByConsumerId(currentUser.getId(), PositionEnum.MANAGE.getCode());
if (CollectionUtils.isEmpty(managerList)) {
vo.setIsManage(false);
} else {
vo.setIsManage(true);
}
if (ObjectUtil.isNull(currentUser)) { if (ObjectUtil.isNull(currentUser)) {
throw new BaseException("您的登录已过期,请先登录"); throw new BaseException("您的登录已过期,请先登录");
......
...@@ -376,6 +376,19 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme ...@@ -376,6 +376,19 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
return this.list(queryWrapper); return this.list(queryWrapper);
} }
@Override
public List<SStore> manageList() {
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
if (!user.getRoleType().equals(RoleTypeEnum.CLEANER.getCode())) {
throw new BaseException("当前用户不是店员!");
}
List<Long> storeIdList = storeConsumerMapper.selectByConsumerId(user.getId(), PositionEnum.MANAGE.getCode());
if (CollectionUtils.isEmpty(storeIdList)) {
throw new RuntimeException("当前用户不是门店管理人员");
}
return baseMapper.selectList(new LambdaQueryWrapper<SStore>().in(SStore::getId, storeIdList));
}
/** /**
* 门店DO集合转换VO集合,按距离排序 * 门店DO集合转换VO集合,按距离排序
* *
......
...@@ -181,6 +181,13 @@ ...@@ -181,6 +181,13 @@
#{id} #{id}
</foreach> </foreach>
</select> </select>
<select id="selectByIds" resultType="share.system.domain.SConsumerCoupon">
<include refid="selectSConsumerCouponVo"/>
where id in
<foreach item="id" collection="couponIds" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<insert id="insertSConsumerCoupon" parameterType="SConsumerCoupon" useGeneratedKeys="true" keyProperty="id"> <insert id="insertSConsumerCoupon" parameterType="SConsumerCoupon" useGeneratedKeys="true" keyProperty="id">
insert into s_consumer_coupon insert into s_consumer_coupon
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment