parent
1675e5d45b
commit
6746a6c3f3
|
|
@ -1,37 +1,19 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.controller.shop;
|
||||
|
||||
import cn.ysk.cashier.dto.shop.TbShopUserQueryCriteria;
|
||||
import cn.ysk.cashier.pojo.shop.TbShopUser;
|
||||
import cn.ysk.cashier.service.shop.TbShopUserService;
|
||||
import cn.ysk.cashier.dto.shop.TbShopUserQueryCriteria;
|
||||
import cn.ysk.cashier.vo.ShopUserInfoVo;
|
||||
import com.alipay.api.domain.PageInfo;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public interface TbOrderDetailRepository extends JpaRepository<TbOrderDetail, In
|
|||
|
||||
|
||||
@Query("SELECT new cn.ysk.cashier.vo.TbOrderSalesCountByDayVo(" +
|
||||
"info.productName, info.productSkuName, cate.name, unit.name," +
|
||||
"info.productName, info.productSkuName, cate.name, unit.name,info.price," +
|
||||
"SUM(CASE WHEN orders.orderType!='return' THEN info.num ELSE 0 END) as salesNum, " +
|
||||
"SUM(CASE WHEN orders.orderType='return' THEN info.num ELSE 0 END), " +
|
||||
"SUM(info.num), " +
|
||||
|
|
@ -56,7 +56,7 @@ public interface TbOrderDetailRepository extends JpaRepository<TbOrderDetail, In
|
|||
|
||||
|
||||
@Query("SELECT new cn.ysk.cashier.vo.TbOrderSalesCountByDayVo(" +
|
||||
"info.productName, info.productSkuName, cate.name, unit.name," +
|
||||
"info.productName, info.productSkuName, cate.name, unit.name,info.price," +
|
||||
"SUM(CASE WHEN orders.orderType!='return' THEN info.num ELSE 0 END) as salesNum, " +
|
||||
"SUM(CASE WHEN orders.orderType='return' THEN info.num ELSE 0 END), " +
|
||||
"SUM(info.num), " +
|
||||
|
|
|
|||
|
|
@ -429,10 +429,11 @@ public class SummaryServiceImpl implements SummaryService {
|
|||
map.put("单 位", all.getUnitName());
|
||||
map.put("商品规格", StringUtils.isBlank(all.getProductSkuName()) ? "" : all.getProductSkuName());
|
||||
map.put("销 量", all.getSalesNum());
|
||||
map.put("退单量", all.getRefNum());
|
||||
map.put("销售额", all.getSalesAmount());
|
||||
map.put("退单额", all.getRefAmount());
|
||||
map.put("总 量", all.getNum());
|
||||
map.put("单 价", all.getPrice());
|
||||
map.put("退 单 量", all.getRefNum());
|
||||
map.put("销 售 额", all.getSalesAmount().subtract(all.getRefAmount()));
|
||||
map.put("退 单 额", all.getRefAmount().compareTo(BigDecimal.ZERO) == 0 ? BigDecimal.ZERO : "-" + all.getRefAmount());
|
||||
map.put("总 量", all.getNum());
|
||||
list.add(map);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -127,7 +127,9 @@ public class TbOrderInfoServiceImpl implements TbOrderInfoService {
|
|||
}
|
||||
}
|
||||
List<TbOrderPayCountVo> payCountVoList = tbOrderInfoRepository.queryTbOrderPayCount(criteria.getShopId(), start, end);
|
||||
BigDecimal totalPayAmount = BigDecimal.ZERO;
|
||||
for (TbOrderPayCountVo payCount : payCountVoList) {
|
||||
totalPayAmount = totalPayAmount.add(new BigDecimal(payCount.getPayAmount().toString()));
|
||||
if (StringUtils.isNotBlank(payCount.getPayType())) {
|
||||
TbShopPayType byPayType = payTypeRepository.findByPayType(payCount.getPayType(), criteria.getShopId());
|
||||
if (byPayType != null) {
|
||||
|
|
@ -143,10 +145,12 @@ public class TbOrderInfoServiceImpl implements TbOrderInfoService {
|
|||
}
|
||||
TbOrderPayCountVo payRufund = tbOrderInfoRepository.queryTbOrderRefund(criteria.getShopId(), start, end);
|
||||
if (payRufund != null) {
|
||||
totalPayAmount = totalPayAmount.subtract(new BigDecimal(payRufund.getPayAmount().toString()));
|
||||
payRufund.setPayType("退单");
|
||||
payRufund.setIcon("https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/20240319/5741608662244b878762c61bb37c95c9.png");
|
||||
result.add(payRufund);
|
||||
}
|
||||
payCountVoList.add(0,new TbOrderPayCountVo("el-icon-s-goods","总金额",null,totalPayAmount));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,26 +1,9 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.service.impl.shopimpl;
|
||||
|
||||
import cn.ysk.cashier.dto.shop.TbShopUserDto;
|
||||
import cn.ysk.cashier.dto.shop.TbShopUserQueryCriteria;
|
||||
import cn.ysk.cashier.mapper.shop.TbShopUserMapper;
|
||||
import cn.ysk.cashier.mybatis.entity.TbUserStorage;
|
||||
import cn.ysk.cashier.mybatis.mapper.ShopUserMapper;
|
||||
import cn.ysk.cashier.mybatis.mapper.TagProductDeptsMapper;
|
||||
import cn.ysk.cashier.pojo.shop.TbShopUser;
|
||||
import cn.ysk.cashier.repository.shop.TbShopUserRepository;
|
||||
import cn.ysk.cashier.service.shop.TbShopUserService;
|
||||
|
|
@ -29,7 +12,6 @@ import cn.ysk.cashier.utils.PageUtil;
|
|||
import cn.ysk.cashier.utils.QueryHelp;
|
||||
import cn.ysk.cashier.utils.ValidationUtil;
|
||||
import cn.ysk.cashier.vo.ShopUserInfoVo;
|
||||
import com.alipay.api.domain.PageInfo;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
|
|||
|
|
@ -1,26 +1,8 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.service.shop;
|
||||
|
||||
import cn.ysk.cashier.pojo.shop.TbShopUser;
|
||||
import cn.ysk.cashier.dto.shop.TbShopUserDto;
|
||||
import cn.ysk.cashier.dto.shop.TbShopUserQueryCriteria;
|
||||
import cn.ysk.cashier.vo.ShopUserInfoVo;
|
||||
import com.alipay.api.domain.PageInfo;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ public class TbOrderSalesCountByDayVo {
|
|||
private String productSkuName;
|
||||
private String cateName;
|
||||
private String unitName;
|
||||
private BigDecimal price;
|
||||
private Long salesNum;
|
||||
private Long refNum;
|
||||
private BigDecimal salesAmount;
|
||||
|
|
@ -86,16 +87,26 @@ public class TbOrderSalesCountByDayVo {
|
|||
this.unitName = unitName;
|
||||
}
|
||||
|
||||
|
||||
public BigDecimal getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(BigDecimal price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public TbOrderSalesCountByDayVo(Long salesNum, Long refNum) {
|
||||
this.salesNum = salesNum;
|
||||
this.refNum = refNum;
|
||||
}
|
||||
|
||||
public TbOrderSalesCountByDayVo(String productName, String productSkuName, String cateName,String unitName, Long salesNum, Long refNum, Long num, BigDecimal salesAmount, BigDecimal refAmount) {
|
||||
public TbOrderSalesCountByDayVo(String productName, String productSkuName, String cateName,String unitName,BigDecimal price, Long salesNum, Long refNum, Long num, BigDecimal salesAmount, BigDecimal refAmount) {
|
||||
this.productName = productName;
|
||||
this.productSkuName = productSkuName;
|
||||
this.cateName = cateName;
|
||||
this.unitName = unitName;
|
||||
this.price = price;
|
||||
this.salesNum = salesNum;
|
||||
this.refNum = refNum;
|
||||
this.salesAmount = salesAmount;
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@
|
|||
<groupId>cn.ysk.cashier</groupId>
|
||||
<artifactId>oss-service</artifactId>
|
||||
<version>2.6</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<!--支付宝依赖-->
|
||||
<dependency>
|
||||
|
|
@ -44,11 +45,5 @@
|
|||
<artifactId>alipay-sdk-java</artifactId>
|
||||
<version>${alipay.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.ysk.cashier</groupId>
|
||||
<artifactId>oss-service</artifactId>
|
||||
<version>2.6</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
|||
Loading…
Reference in New Issue