Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
fe5cf30c51
@ -319,7 +319,7 @@ public class AllOrderInfoController extends BaseController {
|
|||||||
@GetMapping("queryByPageUni")
|
@GetMapping("queryByPageUni")
|
||||||
public ResponseObject queryByPageUni(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
|
public ResponseObject queryByPageUni(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
|
||||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
|
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
|
||||||
@Param("integralDetail") AllOrderInfo allOrderInfo) {
|
@Param("integralDetail") AllOrderInfoUniVo allOrderInfo) {
|
||||||
Page page = new Page(pageNo, pageSize);
|
Page page = new Page(pageNo, pageSize);
|
||||||
IPage<AllOrderInfoUniVo> iPageList = this.allOrderInfoService.queryByPageUni(page, allOrderInfo);
|
IPage<AllOrderInfoUniVo> iPageList = this.allOrderInfoService.queryByPageUni(page, allOrderInfo);
|
||||||
return getSuccessResult(iPageList);
|
return getSuccessResult(iPageList);
|
||||||
@ -330,9 +330,9 @@ public class AllOrderInfoController extends BaseController {
|
|||||||
* @param storeId
|
* @param storeId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("getConsumptionMoney/{storeId}")
|
@GetMapping("getConsumptionMoney")
|
||||||
public ResponseObject getConsumptionMoney(@PathVariable Integer storeId){
|
public ResponseObject getConsumptionMoney(AllOrderInfoUniVo allOrderInfo){
|
||||||
return getSuccessResult(allOrderInfoService.getConsumptionMoney(storeId));
|
return getSuccessResult(allOrderInfoService.getConsumptionMoney(allOrderInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -102,5 +102,5 @@ public interface AllOrderInfoMapper extends BaseMapper<AllOrderInfo> {
|
|||||||
|
|
||||||
// IPage<CardValueOrdersVo> getBlanceANdOrder(Page page, @Param("order") CardValueOrdersDTO allOrderInfo);
|
// IPage<CardValueOrdersVo> getBlanceANdOrder(Page page, @Param("order") CardValueOrdersDTO allOrderInfo);
|
||||||
|
|
||||||
IPage<AllOrderInfoUniVo> queryAllByLimit(Page page, @Param("allOrderInfo") AllOrderInfo allOrderInfo);
|
IPage<AllOrderInfoUniVo> queryAllByLimit(Page page, @Param("allOrderInfo") AllOrderInfoUniVo allOrderInfo);
|
||||||
}
|
}
|
@ -800,15 +800,20 @@
|
|||||||
join mt_store m
|
join mt_store m
|
||||||
on a.store_id = m.id
|
on a.store_id = m.id
|
||||||
<where>
|
<where>
|
||||||
|
a.status = "paid"
|
||||||
<if test="allOrderInfo.storeId != null">
|
<if test="allOrderInfo.storeId != null">
|
||||||
a.store_id = #{allOrderInfo.storeId}
|
and a.store_id = #{allOrderInfo.storeId}
|
||||||
</if>
|
</if>
|
||||||
<if test="allOrderInfo.userId != null">
|
<if test="allOrderInfo.userId != null">
|
||||||
and a.user_id = #{allOrderInfo.userId}
|
and a.user_id = #{allOrderInfo.userId}
|
||||||
</if>
|
</if>
|
||||||
<if test="allOrderInfo.status != null">
|
<if test="allOrderInfo.startTime != null">
|
||||||
and a.status = #{allOrderInfo.status}
|
and a.pay_time between #{allOrderInfo.startTime} and #{allOrderInfo.endTime}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="allOrderInfo.content != null and allOrderInfo.content != ''">
|
||||||
|
and a.content like concat('%',#{allOrderInfo.content},'%')
|
||||||
|
</if>
|
||||||
|
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
<select id="getOneByOrderId" resultType="com.fuint.business.order.vo.AllOrderActivityVo">
|
<select id="getOneByOrderId" resultType="com.fuint.business.order.vo.AllOrderActivityVo">
|
||||||
|
@ -159,14 +159,14 @@ public interface AllOrderInfoService {
|
|||||||
* @param allOrderInfo
|
* @param allOrderInfo
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
IPage<AllOrderInfoUniVo> queryByPageUni(Page page, AllOrderInfo allOrderInfo);
|
IPage<AllOrderInfoUniVo> queryByPageUni(Page page, AllOrderInfoUniVo allOrderInfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取消费金额(小程序)
|
* 获取消费金额(小程序)
|
||||||
* @param storeId
|
* @param storeId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Double getConsumptionMoney(Integer storeId);
|
Double getConsumptionMoney(AllOrderInfoUniVo allOrderInfo);
|
||||||
|
|
||||||
// 根据订单id 查询订单 并且有且只有一个关联油品订单
|
// 根据订单id 查询订单 并且有且只有一个关联油品订单
|
||||||
AllOrderActivityVo getOneByOrderId(Integer orderId);
|
AllOrderActivityVo getOneByOrderId(Integer orderId);
|
||||||
|
@ -1662,30 +1662,46 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public IPage<AllOrderInfoUniVo> queryByPageUni(Page page, AllOrderInfo allOrderInfo) {
|
public IPage<AllOrderInfoUniVo> queryByPageUni(Page page, AllOrderInfoUniVo allOrderInfo) {
|
||||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
allOrderInfo.setUserId(nowAccountInfo.getId());
|
allOrderInfo.setUserId(nowAccountInfo.getId());
|
||||||
allOrderInfo.setStatus("paid");
|
if (ObjectUtil.isNotEmpty(allOrderInfo.getStartTime())) {
|
||||||
|
DateTime parse = DateUtil.parse(allOrderInfo.getStartTime(), "yyyy-MM");
|
||||||
|
allOrderInfo.setStartTime(DateUtil.beginOfMonth(parse).toString());
|
||||||
|
allOrderInfo.setEndTime(DateUtil.endOfMonth(parse).toString());
|
||||||
|
}
|
||||||
|
// allOrderInfo.setStatus("paid");
|
||||||
return this.allOrderInfoMapper.queryAllByLimit(page, allOrderInfo);
|
return this.allOrderInfoMapper.queryAllByLimit(page, allOrderInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取消费金额(小程序)
|
* 获取消费金额(小程序)
|
||||||
*
|
*
|
||||||
* @param storeId
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Double getConsumptionMoney(Integer storeId) {
|
public Double getConsumptionMoney(AllOrderInfoUniVo allOrderInfo) {
|
||||||
Integer id = TokenUtil.getNowAccountInfo().getId();
|
Integer id = TokenUtil.getNowAccountInfo().getId();
|
||||||
List<AllOrderInfo> paid = baseMapper.selectList(new LambdaQueryWrapper<AllOrderInfo>()
|
LambdaQueryWrapper<AllOrderInfo> allOrderInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
.eq(AllOrderInfo::getStoreId, storeId)
|
allOrderInfoLambdaQueryWrapper.eq(AllOrderInfo::getStoreId, allOrderInfo.getStoreId())
|
||||||
.ne(AllOrderInfo::getPayType, "refund")
|
.eq(AllOrderInfo::getStatus, "paid")
|
||||||
.eq(AllOrderInfo::getUserId, id));
|
.eq(AllOrderInfo::getUserId, id);
|
||||||
|
if (ObjectUtil.isNotEmpty(allOrderInfo.getStartTime())) {
|
||||||
|
DateTime parse = DateUtil.parse(allOrderInfo.getStartTime(), "yyyy-MM");
|
||||||
|
allOrderInfo.setStartTime(DateUtil.beginOfMonth(parse).toString());
|
||||||
|
allOrderInfo.setEndTime(DateUtil.endOfMonth(parse).toString());
|
||||||
|
allOrderInfoLambdaQueryWrapper.between(AllOrderInfo::getPayTime, allOrderInfo.getStartTime(), allOrderInfo.getEndTime());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(allOrderInfo.getContent())) {
|
||||||
|
allOrderInfoLambdaQueryWrapper.like(AllOrderInfo::getContent, allOrderInfo.getContent());
|
||||||
|
}
|
||||||
|
List<AllOrderInfo> paid = baseMapper.selectList(allOrderInfoLambdaQueryWrapper);
|
||||||
|
|
||||||
//计算实付金额
|
//计算实付金额
|
||||||
double sum = paid.stream()
|
double sum = paid.stream()
|
||||||
.mapToDouble(order -> Optional.ofNullable(order.getPayMoney()).orElse(0.0))
|
.filter(order -> !Optional.ofNullable(order.getContent()).orElse("").contains("充值"))
|
||||||
|
.mapToDouble(order -> order.getPayMoney() != null ? order.getPayMoney() : 0.0)
|
||||||
.sum();
|
.sum();
|
||||||
return sum;
|
return sum;
|
||||||
}
|
}
|
||||||
|
@ -8,4 +8,6 @@ import weixin.popular.bean.pay.OrderInfo;
|
|||||||
public class AllOrderInfoUniVo extends AllOrderInfo {
|
public class AllOrderInfoUniVo extends AllOrderInfo {
|
||||||
private String typeName;
|
private String typeName;
|
||||||
private String storeName;
|
private String storeName;
|
||||||
|
private String startTime;
|
||||||
|
private String endTime;
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
<view style="width: 85%;">
|
<view style="width: 85%;">
|
||||||
<view class="right-box">
|
<view class="right-box">
|
||||||
<view class="l-text">{{ item.typeName }}</view>
|
<view class="l-text">{{ item.typeName }}</view>
|
||||||
<view class="r-text" v-if="item.updateBy!=null">+{{ item.payMoney }}</view>
|
<view class="r-text" v-if="item.content && item.content.includes('充值')">{{ item.payMoney }}</view>
|
||||||
<view class="r-text" v-else>-{{ item.payMoney }}</view>
|
<view class="r-text" v-else>-{{ item.payMoney }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="right-box">
|
<view class="right-box">
|
||||||
@ -109,45 +109,20 @@ export default {
|
|||||||
label: '全部类型',
|
label: '全部类型',
|
||||||
value: null
|
value: null
|
||||||
}, {
|
}, {
|
||||||
label: '消费有礼',
|
label: '油品',
|
||||||
value: ''
|
value: '订单'
|
||||||
}, {
|
}, {
|
||||||
label: '充值有礼',
|
label: '会员充值',
|
||||||
value: ''
|
value: '充值'
|
||||||
}, {
|
}, {
|
||||||
label: '积分兑换',
|
label: '积分兑换',
|
||||||
value: ''
|
value: '积分'
|
||||||
}, {
|
}]
|
||||||
label: '开卡有礼',
|
|
||||||
value: ''
|
|
||||||
}, {
|
|
||||||
label: '邀请有礼',
|
|
||||||
value: ''
|
|
||||||
}, {
|
|
||||||
label: '生日有礼',
|
|
||||||
value: ''
|
|
||||||
}, {
|
|
||||||
label: '推荐会员充值有礼',
|
|
||||||
value: ''
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '推荐会员推荐有礼',
|
|
||||||
value: ''
|
|
||||||
}, {
|
|
||||||
label: '每日签到',
|
|
||||||
value: ''
|
|
||||||
}, {
|
|
||||||
label: '大转盘抽奖',
|
|
||||||
value: ''
|
|
||||||
}, {
|
|
||||||
label: '九宫格抽奖',
|
|
||||||
value: ''
|
|
||||||
}
|
|
||||||
]
|
|
||||||
],
|
],
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 30,
|
pageSize: 30,
|
||||||
|
content: "",
|
||||||
type: "",
|
type: "",
|
||||||
storeId: uni.getStorageSync("storeId"),
|
storeId: uni.getStorageSync("storeId"),
|
||||||
changeReason: "",
|
changeReason: "",
|
||||||
@ -187,8 +162,9 @@ export default {
|
|||||||
getUserBalance() {
|
getUserBalance() {
|
||||||
console.log('this.queryParams:', this.queryParams.storeId)
|
console.log('this.queryParams:', this.queryParams.storeId)
|
||||||
request({
|
request({
|
||||||
url: '/business/allOrderInfo/getConsumptionMoney/' + this.queryParams.storeId,
|
url: 'business/allOrderInfo/getConsumptionMoney',
|
||||||
method: 'get'
|
method: 'get',
|
||||||
|
params: this.queryParams
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.cardBalance = res.data
|
this.cardBalance = res.data
|
||||||
@ -196,6 +172,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
getList() {
|
getList() {
|
||||||
|
console.log('this.queryParams:', this.queryParams)
|
||||||
request({
|
request({
|
||||||
url: '/business/allOrderInfo/queryByPageUni',
|
url: '/business/allOrderInfo/queryByPageUni',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
@ -210,11 +187,13 @@ export default {
|
|||||||
confirm(e) {
|
confirm(e) {
|
||||||
this.queryParams.pageNo = 1
|
this.queryParams.pageNo = 1
|
||||||
if (e.value[0] == '全部类型') {
|
if (e.value[0] == '全部类型') {
|
||||||
this.queryParams.type = null
|
this.queryParams.content = null
|
||||||
} else {
|
} else {
|
||||||
this.queryParams.type = e.value[0].type
|
this.queryParams.content = e.value[0].value
|
||||||
}
|
}
|
||||||
|
console.log('this.queryParams:', this.queryParams.content)
|
||||||
this.getList()
|
this.getList()
|
||||||
|
this.getUserBalance()
|
||||||
this.show1 = false
|
this.show1 = false
|
||||||
},
|
},
|
||||||
cancel() {
|
cancel() {
|
||||||
@ -232,7 +211,9 @@ export default {
|
|||||||
confirm1(e) {
|
confirm1(e) {
|
||||||
this.queryParams.startTime = this.timestampToString(e.value)
|
this.queryParams.startTime = this.timestampToString(e.value)
|
||||||
this.queryParams.pageNo = 1
|
this.queryParams.pageNo = 1
|
||||||
|
console.log('this.queryParams:', this.queryParams)
|
||||||
this.getList()
|
this.getList()
|
||||||
|
this.getUserBalance()
|
||||||
this.show = false
|
this.show = false
|
||||||
},
|
},
|
||||||
cancel1() {
|
cancel1() {
|
||||||
|
Loading…
Reference in New Issue
Block a user