Merge branch 'master' into dev
This commit is contained in:
@@ -2,6 +2,7 @@ package com.chaozhanggui.system.cashierservice.dao;
|
||||
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbOrderInfo;
|
||||
import com.chaozhanggui.system.cashierservice.entity.po.OrderPo;
|
||||
import com.chaozhanggui.system.cashierservice.entity.po.SkuInfoPo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -42,4 +43,6 @@ public interface TbOrderInfoMapper {
|
||||
|
||||
|
||||
Map<String,String> selectByOrderId(String orderId);
|
||||
|
||||
List<SkuInfoPo> selectSkuByOrderId(String orderId);
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.chaozhanggui.system.cashierservice.entity.TbOrderDetail;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class OrderPo {
|
||||
@@ -21,5 +22,9 @@ public class OrderPo {
|
||||
private Integer productNum;
|
||||
private BigDecimal orderAmount;
|
||||
private TbOrderDetail orderDetail;
|
||||
private String outNumber;
|
||||
private String tableName;
|
||||
private List<SkuInfoPo> skuInfos;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.chaozhanggui.system.cashierservice.entity.po;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SkuInfoPo {
|
||||
|
||||
private String productName;
|
||||
private String productSkuName;
|
||||
private Integer num;
|
||||
private String categoryId;
|
||||
}
|
||||
@@ -14,10 +14,7 @@ import com.chaozhanggui.system.cashierservice.thirdpay.resp.MainScanResp;
|
||||
import com.chaozhanggui.system.cashierservice.thirdpay.resp.OrderStatusQueryResp;
|
||||
import com.chaozhanggui.system.cashierservice.thirdpay.resp.PublicResp;
|
||||
import com.chaozhanggui.system.cashierservice.thirdpay.service.ThirdPayService;
|
||||
import com.chaozhanggui.system.cashierservice.util.BeanUtil;
|
||||
import com.chaozhanggui.system.cashierservice.util.DateUtils;
|
||||
import com.chaozhanggui.system.cashierservice.util.MD5Util;
|
||||
import com.chaozhanggui.system.cashierservice.util.SnowFlakeUtil;
|
||||
import com.chaozhanggui.system.cashierservice.util.*;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
@@ -78,7 +75,7 @@ public class MemberService {
|
||||
|
||||
public Result queryMember(String shopId, String phone, int page, int pageSize) {
|
||||
|
||||
PageHelper.startPage(page, pageSize);
|
||||
PageHelperUtil.startPage(page, pageSize);
|
||||
List<TbShopUser> tbShopUsers = tbShopUserMapper.selectByShopId(shopId, phone);
|
||||
PageInfo pageInfo = new PageInfo(tbShopUsers);
|
||||
return Result.success(CodeEnum.SUCCESS, pageInfo);
|
||||
@@ -616,7 +613,7 @@ public class MemberService {
|
||||
if (ObjectUtil.isEmpty(memberId)) {
|
||||
return Result.fail(CodeEnum.PARAM);
|
||||
}
|
||||
PageHelper.startPage(page, pageSize);
|
||||
PageHelperUtil.startPage(page, pageSize);
|
||||
List<Map<String, Object>> list = tbShopUserFlowMapper.selectByMemberAccountFlow(memberId);
|
||||
PageInfo pageInfo = new PageInfo(list);
|
||||
return Result.success(CodeEnum.SUCCESS, pageInfo);
|
||||
|
||||
@@ -6,10 +6,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.chaozhanggui.system.cashierservice.dao.*;
|
||||
import com.chaozhanggui.system.cashierservice.entity.*;
|
||||
import com.chaozhanggui.system.cashierservice.entity.po.CartPo;
|
||||
import com.chaozhanggui.system.cashierservice.entity.po.OrderPo;
|
||||
import com.chaozhanggui.system.cashierservice.entity.po.ProductSkuPo;
|
||||
import com.chaozhanggui.system.cashierservice.entity.po.QueryCartPo;
|
||||
import com.chaozhanggui.system.cashierservice.entity.po.*;
|
||||
import com.chaozhanggui.system.cashierservice.entity.vo.CartVo;
|
||||
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
|
||||
import com.chaozhanggui.system.cashierservice.sign.Result;
|
||||
@@ -702,7 +699,7 @@ public class OrderService {
|
||||
|
||||
public Result findOrder(Integer shopId, String status, Integer page, Integer size, String orderNo) {
|
||||
String day = DateUtils.getDay();
|
||||
PageHelper.startPage(page, size);
|
||||
PageHelperUtil.startPage(page, size);
|
||||
String orderType = "";
|
||||
if (StringUtils.isNotEmpty(status)) {
|
||||
if (status.equals("refund")) {
|
||||
@@ -718,6 +715,14 @@ public class OrderService {
|
||||
if (StringUtils.isEmpty(orderInfo.getImgUrl())) {
|
||||
orderInfo.setImgUrl("https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/20240223/a04e0d3beef74d099ebd0fd1f7c41873.jpg");
|
||||
}
|
||||
|
||||
List<SkuInfoPo> skuInfoPos=tbOrderInfoMapper.selectSkuByOrderId(orderInfo.getId().toString());
|
||||
if(Objects.isNull(skuInfoPos)||skuInfoPos.size()<0){
|
||||
skuInfoPos=new ArrayList<>();
|
||||
}
|
||||
orderInfo.setSkuInfos(skuInfoPos);
|
||||
|
||||
|
||||
orderInfo.setZdNo("POS");
|
||||
orderInfo.setNames(orderInfo.getProductName().split(","));
|
||||
}
|
||||
@@ -1065,7 +1070,7 @@ public class OrderService {
|
||||
|
||||
|
||||
public Result getOutNumber(String shopId,Integer page,Integer pageSize){
|
||||
PageHelper.startPage(page, pageSize);
|
||||
PageHelperUtil.startPage(page, pageSize);
|
||||
List<TbOrderOutNumber> list= tbOrderOutNumberMapper.selectAll(shopId);
|
||||
PageInfo pageInfo=new PageInfo(list);
|
||||
return Result.success(CodeEnum.SUCCESS,pageInfo);
|
||||
|
||||
@@ -1104,7 +1104,7 @@ public class PayService {
|
||||
|
||||
String shopId = info.getString("shopId");
|
||||
String staffId = info.getString("staffId");
|
||||
PageHelper.startPage(pageNo, pageSize);
|
||||
PageHelperUtil.startPage(pageNo, pageSize);
|
||||
|
||||
|
||||
List<TbQuickPay> list = tbQuickPayMapper.selectByShopIdAndStaffId(Integer.valueOf(shopId), Integer.valueOf(staffId));
|
||||
|
||||
@@ -7,14 +7,13 @@ import com.chaozhanggui.system.cashierservice.entity.vo.ShopCategoryVo;
|
||||
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
|
||||
import com.chaozhanggui.system.cashierservice.sign.Result;
|
||||
import com.chaozhanggui.system.cashierservice.util.DateUtils;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.chaozhanggui.system.cashierservice.util.PageHelperUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
@@ -39,14 +38,14 @@ public class ProductService {
|
||||
|
||||
|
||||
public Result queryCategory(String shopId,Integer page,Integer pageSize){
|
||||
PageHelper.startPage(page, pageSize);
|
||||
PageHelperUtil.startPage(page, pageSize);
|
||||
List<TbShopCategory> list=tbShopCategoryMapper.selectByAll(shopId);
|
||||
PageInfo pageInfo=new PageInfo(list);
|
||||
return Result.success(CodeEnum.SUCCESS,pageInfo);
|
||||
}
|
||||
|
||||
public Result queryAllCategory(String shopId,Integer page,Integer pageSize){
|
||||
PageHelper.startPage(page, pageSize);
|
||||
PageHelperUtil.startPage(page, pageSize);
|
||||
List<ShopCategoryVo> list=tbShopCategoryMapper.queryAllCategory(shopId);
|
||||
PageInfo pageInfo=new PageInfo(list);
|
||||
return Result.success(CodeEnum.SUCCESS,pageInfo);
|
||||
@@ -95,11 +94,10 @@ public class ProductService {
|
||||
|
||||
public Result queryNewCommodityInfo(String shopId, String categoryId, String commdityName, int page, int pageSize, String masterId) {
|
||||
List<TbProductWithBLOBs> tbProductWithBLOBs=null;
|
||||
PageHelperUtil.startPage(page,pageSize);
|
||||
if(ObjectUtil.isEmpty(categoryId)){
|
||||
PageHelper.startPage(page, pageSize);
|
||||
tbProductWithBLOBs=tbProductMapper.selectByShopId(shopId,commdityName);
|
||||
}else {
|
||||
PageHelper.startPage(page, pageSize);
|
||||
tbProductWithBLOBs=tbProductMapper.selectByShopIdAndShopType(shopId,categoryId,commdityName);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.chaozhanggui.system.cashierservice.entity.*;
|
||||
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
|
||||
import com.chaozhanggui.system.cashierservice.sign.Result;
|
||||
import com.chaozhanggui.system.cashierservice.util.DateUtils;
|
||||
import com.chaozhanggui.system.cashierservice.util.PageHelperUtil;
|
||||
import com.chaozhanggui.system.cashierservice.util.TokenUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
@@ -44,7 +45,7 @@ public class ShopInfoService {
|
||||
return Result.fail(CodeEnum.PARAM);
|
||||
}
|
||||
|
||||
PageHelper.startPage(page, pageSize);
|
||||
PageHelperUtil.startPage(page, pageSize);
|
||||
List<TbShopTable> shopTables=tbShopTableMapper.selectByShopIdAndStatus(shopId,areaId,status);
|
||||
PageInfo pageInfo=new PageInfo(shopTables);
|
||||
return Result.success(CodeEnum.SUCCESS,pageInfo);
|
||||
@@ -64,7 +65,7 @@ public class ShopInfoService {
|
||||
// ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByShopIdAndTrade(shopId,day);
|
||||
// List<String> list = shopUserDutyMapper.selectByShopIdAndTradeAll(shopId,day,tbToken.getId());
|
||||
if (Objects.nonNull(shopUserDuty)){
|
||||
// PageHelper.startPage(page, pageSize);
|
||||
// PageHelperUtil.startPage(page, pageSize);
|
||||
List<ShopUserDutyDetail> shopTables=shopUserDutyDetailMapper.selectAllByDuctId(shopUserDuty.getId());
|
||||
// PageInfo pageInfo=new PageInfo(shopTables);
|
||||
shopUserDuty.setDetailList(shopTables);
|
||||
@@ -82,7 +83,7 @@ public class ShopInfoService {
|
||||
public Result queryDutyFlow(String token, String shopId, int page, int pageSize) {
|
||||
// JSONObject jsonObject = TokenUtil.parseParamFromToken(token);
|
||||
// String userId = jsonObject.getString("accountId");
|
||||
PageHelper.startPage(page, pageSize);
|
||||
PageHelperUtil.startPage(page, pageSize);
|
||||
PageHelper.orderBy("login_out_time desc");
|
||||
List<ShopUserDuty> list = shopUserDutyMapper.selectByShopId(shopId);
|
||||
PageInfo pageInfo=new PageInfo(list);
|
||||
|
||||
@@ -13,7 +13,7 @@ import com.chaozhanggui.system.cashierservice.entity.vo.ProductVo;
|
||||
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
|
||||
import com.chaozhanggui.system.cashierservice.sign.Result;
|
||||
import com.chaozhanggui.system.cashierservice.util.JSONUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.chaozhanggui.system.cashierservice.util.PageHelperUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -109,7 +109,7 @@ public class TbGroupOrderInfoService {
|
||||
}
|
||||
|
||||
public Result queryByPage(GroupOrderDto param) {
|
||||
PageHelper.startPage(param.getPage(), param.getSize());
|
||||
PageHelperUtil.startPage(param.getPage(), param.getSize());
|
||||
return Result.success(CodeEnum.SUCCESS, new PageInfo(tbGroupOrderInfoMapper.queryList(param)));
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.chaozhanggui.system.cashierservice.entity.dto.PrintMachineDto;
|
||||
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
|
||||
import com.chaozhanggui.system.cashierservice.sign.Result;
|
||||
import com.chaozhanggui.system.cashierservice.util.JSONUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.chaozhanggui.system.cashierservice.util.PageHelperUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
@@ -60,7 +60,7 @@ public class TbPrintPCMachineService {
|
||||
* @return 查询结果
|
||||
*/
|
||||
public Result queryByPage(TbPrintPCMachine tbPrintMachine) {
|
||||
PageHelper.startPage(tbPrintMachine.getPage(), tbPrintMachine.getPageSize());
|
||||
PageHelperUtil.startPage(tbPrintMachine.getPage(), tbPrintMachine.getPageSize());
|
||||
tbPrintMachine.setContentType("local");
|
||||
List<TbPrintPCMachine> tbPrintMachines = this.tbPrintMachineMapper.queryAll(tbPrintMachine);
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.chaozhanggui.system.cashierservice.util;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
|
||||
public class PageHelperUtil {
|
||||
|
||||
/**
|
||||
* 解决页数超限 仍返回数据问题
|
||||
*/
|
||||
public static void startPage(int page, int pageSize) {
|
||||
PageHelper.startPage(page, pageSize, true, false, false);
|
||||
}
|
||||
}
|
||||
@@ -65,11 +65,24 @@
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<select id="selectAllByShop" resultType="com.chaozhanggui.system.cashierservice.entity.po.OrderPo">
|
||||
select toi.created_at as createAt,toi.id,toi.order_no as orderNo,toi.order_amount as orderAmount,count(*) as
|
||||
productNum,toi.order_type as orderType,
|
||||
ifnull(TRIM(TRAILING ', ' FROM GROUP_CONCAT(tod.product_name ORDER BY tod.id SEPARATOR ', ')),'') AS productName,
|
||||
toi.status from tb_order_info toi left join tb_order_detail tod on tod.order_id = toi.id
|
||||
where toi.shop_id = #{shopId}
|
||||
SELECT
|
||||
toi.created_at AS createAt,
|
||||
toi.id,
|
||||
toi.order_no AS orderNo,
|
||||
toi.order_amount AS orderAmount,
|
||||
count(*) AS productNum,
|
||||
toi.order_type AS orderType,
|
||||
GROUP_CONCAT(tod.product_name) AS productName,
|
||||
toi.STATUS,
|
||||
toi.out_number AS outNumber,
|
||||
toi.table_name AS tableName
|
||||
|
||||
FROM
|
||||
tb_order_info toi
|
||||
LEFT JOIN tb_order_detail tod ON tod.order_id = toi.id
|
||||
|
||||
WHERE
|
||||
toi.shop_id = #{shopId}
|
||||
<choose>
|
||||
<when test="orderType == 'return'">
|
||||
and toi.order_type = 'return' and toi.status in ('refund','closed')
|
||||
@@ -87,7 +100,7 @@
|
||||
<if test="orderNo != null and orderNo != ''">
|
||||
and toi.order_no = #{orderNo}
|
||||
</if>
|
||||
group by toi.shop_id,toi.order_no
|
||||
group by toi.id,toi.shop_id
|
||||
order by toi.id desc
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
@@ -566,4 +579,17 @@ select * from tb_order_info where trade_day = #{day} and table_id = #{masterId}
|
||||
GROUP BY
|
||||
d.order_id
|
||||
</select>
|
||||
|
||||
<select id="selectSkuByOrderId" resultType="com.chaozhanggui.system.cashierservice.entity.po.SkuInfoPo">
|
||||
SELECT
|
||||
|
||||
d.product_name as productName,
|
||||
d.num ,
|
||||
d.product_sku_name as productSkuName,
|
||||
c.category_id as categoryId
|
||||
FROM
|
||||
tb_order_detail d
|
||||
left join tb_cashier_cart c on d.order_id=c.order_id and d.product_id=c.product_id
|
||||
where c.order_id=#{orderId}
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user