订单修改
This commit is contained in:
@ -38,4 +38,10 @@ public class StoreOrderPageVO extends PageParam {
|
|||||||
@Schema(description = "时间段", example = "1722")
|
@Schema(description = "时间段", example = "1722")
|
||||||
private String timePeriod;
|
private String timePeriod;
|
||||||
|
|
||||||
|
private String startDate;
|
||||||
|
|
||||||
|
private String endDate;
|
||||||
|
|
||||||
|
@Schema(description = "门店", example = "1722")
|
||||||
|
private Long carteenId;
|
||||||
}
|
}
|
@ -57,4 +57,6 @@ public class StoreOrderRespVO {
|
|||||||
@Schema(description = "订单详情")
|
@Schema(description = "订单详情")
|
||||||
private List<AppStoreOrderDetailVo> detailDOS;
|
private List<AppStoreOrderDetailVo> detailDOS;
|
||||||
|
|
||||||
|
private Long carteenId;
|
||||||
|
|
||||||
}
|
}
|
@ -15,6 +15,7 @@ import cn.iocoder.yudao.module.member.dal.dataobject.storeorder.StoreOrderDO;
|
|||||||
import cn.iocoder.yudao.module.member.dal.dataobject.storeorderdetail.StoreOrderDetailDO;
|
import cn.iocoder.yudao.module.member.dal.dataobject.storeorderdetail.StoreOrderDetailDO;
|
||||||
import cn.iocoder.yudao.module.member.service.storeorder.StoreOrderService;
|
import cn.iocoder.yudao.module.member.service.storeorder.StoreOrderService;
|
||||||
import cn.iocoder.yudao.module.member.service.storeorderdetail.StoreOrderDetailService;
|
import cn.iocoder.yudao.module.member.service.storeorderdetail.StoreOrderDetailService;
|
||||||
|
import cn.iocoder.yudao.module.system.api.carteen.CarteenApi;
|
||||||
import cn.iocoder.yudao.module.system.api.cashregisterinfo.CashregisterinfoApi;
|
import cn.iocoder.yudao.module.system.api.cashregisterinfo.CashregisterinfoApi;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
@ -43,7 +44,7 @@ public class AppStoreOrderController {
|
|||||||
@Resource
|
@Resource
|
||||||
private StoreOrderDetailService orderDetailService;
|
private StoreOrderDetailService orderDetailService;
|
||||||
@Resource
|
@Resource
|
||||||
private CashregisterinfoApi cashregisterinfoApi;
|
private CarteenApi carteenApi;
|
||||||
|
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
@Operation(summary = "获得商品订单分页")
|
@Operation(summary = "获得商品订单分页")
|
||||||
@ -54,7 +55,7 @@ public class AppStoreOrderController {
|
|||||||
for (StoreOrderRespVO vo: bean.getList()) {
|
for (StoreOrderRespVO vo: bean.getList()) {
|
||||||
List<AppStoreOrderDetailVo> listByOrderNo = orderDetailService.getListByOrderNo(vo.getOrderId());
|
List<AppStoreOrderDetailVo> listByOrderNo = orderDetailService.getListByOrderNo(vo.getOrderId());
|
||||||
vo.setDetailDOS(listByOrderNo);
|
vo.setDetailDOS(listByOrderNo);
|
||||||
vo.setStoresName(cashregisterinfoApi.getStoreName(vo.getEquipmentCode()));
|
vo.setStoresName(carteenApi.getCarteenById(vo.getCarteenId()).getStoresName());
|
||||||
}
|
}
|
||||||
return success(bean);
|
return success(bean);
|
||||||
}
|
}
|
||||||
|
@ -59,4 +59,9 @@ public class StoreOrderDO extends BaseDO {
|
|||||||
*/
|
*/
|
||||||
private Double reductionPrice;
|
private Double reductionPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 门店ID
|
||||||
|
*/
|
||||||
|
private Long carteenId;
|
||||||
|
|
||||||
}
|
}
|
@ -227,9 +227,6 @@ public class StoreOrderServiceImpl implements StoreOrderService {
|
|||||||
Page<StoreOrderPageVO> page = Page.of(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
Page<StoreOrderPageVO> page = Page.of(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||||
IPage<StoreOrderPageVO> pageNew = storeOrderMapper.getStoreOrderPageNew(page, pageReqVO);
|
IPage<StoreOrderPageVO> pageNew = storeOrderMapper.getStoreOrderPageNew(page, pageReqVO);
|
||||||
List<StoreOrderPageVO> records = pageNew.getRecords();
|
List<StoreOrderPageVO> records = pageNew.getRecords();
|
||||||
// for (StoreOrderPageVO record : records) {
|
|
||||||
// record.setTimePeriod(TimePeriodEnum.getTimeName(record.getCreateTime()));
|
|
||||||
// }
|
|
||||||
return new PageResult<>(records, pageNew.getTotal());
|
return new PageResult<>(records, pageNew.getTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@ -44,7 +46,7 @@ public class StoreSaleGoodsServiceImpl implements StoreSaleGoodsService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer createStoreSaleGoods(StoreSaleGoodsSaveBatchVO createReqVO) {
|
public Integer createStoreSaleGoods(StoreSaleGoodsSaveBatchVO createReqVO) {
|
||||||
List<StoreSaleGoodsDO> addList = new ArrayList<>();
|
List<StoreSaleGoodsDO> addList = new ArrayList<>();
|
||||||
|
|
||||||
List<Long> carteenIds = createReqVO.getCarteenIds();
|
List<Long> carteenIds = createReqVO.getCarteenIds();
|
||||||
List<Integer> goodsIds = createReqVO.getGoodsIds();
|
List<Integer> goodsIds = createReqVO.getGoodsIds();
|
||||||
@ -53,7 +55,7 @@ public class StoreSaleGoodsServiceImpl implements StoreSaleGoodsService {
|
|||||||
.eq(StoreSaleGoodsDO::getCarteenId, carteenId));
|
.eq(StoreSaleGoodsDO::getCarteenId, carteenId));
|
||||||
List<Integer> saleGoods = storeSaleGoodsDOS.stream().map(StoreSaleGoodsDO::getGoodsId).collect(Collectors.toList());
|
List<Integer> saleGoods = storeSaleGoodsDOS.stream().map(StoreSaleGoodsDO::getGoodsId).collect(Collectors.toList());
|
||||||
for (Integer goodsId : goodsIds) {
|
for (Integer goodsId : goodsIds) {
|
||||||
if(saleGoods.contains(goodsId)){
|
if (saleGoods.contains(goodsId)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// 插入
|
// 插入
|
||||||
@ -103,22 +105,23 @@ public class StoreSaleGoodsServiceImpl implements StoreSaleGoodsService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean bindGoods(StoreSaleGoodsDto dto) {
|
public Boolean bindGoods(StoreSaleGoodsDto dto) {
|
||||||
|
|
||||||
if(CollectionUtil.isEmpty(dto.getEquipmentGoodsCustoms())){
|
|
||||||
throw exception(STORE_SALE_GOODS_NOT_NULL);
|
|
||||||
}
|
|
||||||
Long storeId = cashregisterinfoApi.getStoreId(dto.getEquipmentCode());
|
Long storeId = cashregisterinfoApi.getStoreId(dto.getEquipmentCode());
|
||||||
//清空
|
//清空
|
||||||
storeSaleGoodsMapper.delete(new LambdaQueryWrapper<StoreSaleGoodsDO>().eq(StoreSaleGoodsDO::getCarteenId, storeId));
|
storeSaleGoodsMapper.delete(new LambdaQueryWrapper<StoreSaleGoodsDO>().eq(StoreSaleGoodsDO::getCarteenId, storeId));
|
||||||
ArrayList<StoreSaleGoodsDO> list = new ArrayList<>();
|
Boolean b = true;
|
||||||
for (StoreGoodsDto storeGoodsDto : dto.getEquipmentGoodsCustoms()) {
|
if (CollectionUtil.isNotEmpty(dto.getEquipmentGoodsCustoms())) {
|
||||||
StoreSaleGoodsDO storeSaleGoodsDO = new StoreSaleGoodsDO();
|
ArrayList<StoreSaleGoodsDO> list = new ArrayList<>();
|
||||||
BeanUtil.copyProperties(storeGoodsDto, storeSaleGoodsDO);
|
for (StoreGoodsDto storeGoodsDto : dto.getEquipmentGoodsCustoms()) {
|
||||||
storeSaleGoodsDO.setEquipmentCode(dto.getEquipmentCode());
|
StoreSaleGoodsDO storeSaleGoodsDO = new StoreSaleGoodsDO();
|
||||||
storeSaleGoodsDO.setCarteenId(storeId);
|
BeanUtil.copyProperties(storeGoodsDto, storeSaleGoodsDO);
|
||||||
list.add(storeSaleGoodsDO);
|
storeSaleGoodsDO.setEquipmentCode(dto.getEquipmentCode());
|
||||||
|
storeSaleGoodsDO.setCarteenId(storeId);
|
||||||
|
list.add(storeSaleGoodsDO);
|
||||||
|
}
|
||||||
|
b = storeSaleGoodsMapper.insertBatch(list);
|
||||||
}
|
}
|
||||||
return storeSaleGoodsMapper.insertBatch(list);
|
|
||||||
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -127,9 +130,9 @@ public class StoreSaleGoodsServiceImpl implements StoreSaleGoodsService {
|
|||||||
Long storeId = cashregisterinfoApi.getStoreId(equipmentCode);
|
Long storeId = cashregisterinfoApi.getStoreId(equipmentCode);
|
||||||
|
|
||||||
List<StoreSaleGoodsDO> storeSaleGoodsDOS = storeSaleGoodsMapper.selectList(new LambdaQueryWrapper<StoreSaleGoodsDO>().eq(StoreSaleGoodsDO::getCarteenId, storeId));
|
List<StoreSaleGoodsDO> storeSaleGoodsDOS = storeSaleGoodsMapper.selectList(new LambdaQueryWrapper<StoreSaleGoodsDO>().eq(StoreSaleGoodsDO::getCarteenId, storeId));
|
||||||
if (CollectionUtil.isEmpty(storeSaleGoodsDOS)){
|
if (CollectionUtil.isEmpty(storeSaleGoodsDOS)) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}else {
|
} else {
|
||||||
return storeSaleGoodsDOS.stream().map(StoreSaleGoodsDO::getGoodsId).collect(Collectors.toList());
|
return storeSaleGoodsDOS.stream().map(StoreSaleGoodsDO::getGoodsId).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,11 +11,9 @@
|
|||||||
|
|
||||||
<select id="getStoreOrderPageNew"
|
<select id="getStoreOrderPageNew"
|
||||||
resultType="cn.iocoder.yudao.module.member.controller.admin.storeorder.vo.StoreOrderPageVO">
|
resultType="cn.iocoder.yudao.module.member.controller.admin.storeorder.vo.StoreOrderPageVO">
|
||||||
select so.order_id,so.total_price,so.create_time,mu.nickname,mu.mobile,tc.stores_name,so.reduction_price
|
select so.order_id,so.total_price,so.create_time,mu.nickname,mu.mobile,so.reduction_price,so.carteen_id
|
||||||
from member_store_order so
|
from member_store_order so
|
||||||
left join member_user mu on so.user_id = mu.id
|
left join member_user mu on so.user_id = mu.id
|
||||||
left join t_cash_register_info tr on tr.equipment_code = so.equipment_code
|
|
||||||
left join t_carteen tc on tr.carteen_id = tc.id
|
|
||||||
<where>
|
<where>
|
||||||
so.deleted = false
|
so.deleted = false
|
||||||
<if test="vo.orderId != null">
|
<if test="vo.orderId != null">
|
||||||
@ -27,6 +25,12 @@
|
|||||||
<if test="vo.mobile != null and vo.mobile != ''">
|
<if test="vo.mobile != null and vo.mobile != ''">
|
||||||
and mu.mobile like concat('%',#{vo.mobile},'%')
|
and mu.mobile like concat('%',#{vo.mobile},'%')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="vo.startDate != null and vo.startDate != '' and vo.endDate != null and vo.endDate != '' ">
|
||||||
|
and date_format(so.create_time,'%Y-%m-%d') between #{vo.startDate} and #{vo.endDate}
|
||||||
|
</if>
|
||||||
|
<if test="vo.carteenId != null ">
|
||||||
|
and so.carteen_id = #{vo.carteenId}
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
order by so.order_id DESC
|
order by so.order_id DESC
|
||||||
</select>
|
</select>
|
||||||
|
Reference in New Issue
Block a user