| | |
| | | @ApiModelProperty(value = "下单时间结束查询") |
| | | private String endTime; |
| | | |
| | | @ApiModelProperty(value = "是否是小程序查询(1.是 2.否)") |
| | | @ApiModelProperty(value = "是否是小程序查询(1.是 2.否)",hidden = true) |
| | | private Integer isApplets; |
| | | |
| | | @ApiModelProperty(value = "是否是后台查询(1.是 2.否)",hidden = true) |
| | | private Integer isAdmin; |
| | | |
| | | } |
| | | |
| | |
| | | @ApiModelProperty(value = "关键词") |
| | | private String keyWord; |
| | | |
| | | @ApiModelProperty(value = "商品状态(1.上架 2.下架)") |
| | | private Integer status; |
| | | } |
| | | |
| | |
| | | @PostMapping("/page") |
| | | public R queryByPage(@RequestBody PageComBatteryCommodityOrderDto comBatteryCommodityOrder) { |
| | | comBatteryCommodityOrder.setStoreId(this.getCommunityId()); |
| | | comBatteryCommodityOrder.setIsAdmin(1); |
| | | return this.comBatteryCommodityOrderService.queryByPage(comBatteryCommodityOrder); |
| | | } |
| | | |
| | |
| | | * @return 电动车商户用户账号数量 |
| | | */ |
| | | Integer getStoreUserCountByPhone(@Param("regPhone") String regPhone); |
| | | |
| | | /** |
| | | * 删除商家并同步删除后台用户数据 |
| | | * @param storeId 商家id |
| | | */ |
| | | void deleteStoreUserByStoreId(@Param("storeId") Long storeId); |
| | | } |
| | | |
| | |
| | | */ |
| | | R batteryActivityPayNotify(WxPayNotifyOrderDTO notifyOrderDTO); |
| | | |
| | | /** |
| | | * 创建秒杀订单 |
| | | * @param orderDto 请求参数 |
| | | * @return 创建订单结果 |
| | | */ |
| | | R startSeckill(StartSeckillOrderDto orderDto); |
| | | } |
| | |
| | | ComBatteryCommodityOrder commodityOrder = getCreateOrder(commodity,userAddress,user,commoditySpecs,orderDto,nowDate,commodityActivity); |
| | | Map<String,Object> resultMap = new HashMap<>(2); |
| | | if(commodityOrderMapper.insert(commodityOrder) > 0){ |
| | | //更新活动商品库存 |
| | | commodityActivity.setCommoditySaleNum(commodityActivity.getCommoditySaleNum() + orderDto.getCount()); |
| | | commodityActivityMapper.updateById(commodityActivity); |
| | | //更新商品库存 |
| | | commoditySpecs.setStock(commoditySpecs.getStock() - orderDto.getCount()); |
| | | commoditySpecsMapper.updateById(commoditySpecs); |
| | |
| | | return orderBargain; |
| | | } |
| | | |
| | | /** |
| | | * 创建秒杀订单 |
| | | * @param orderDto 请求参数 |
| | | * @return 创建订单结果 |
| | | */ |
| | | @Override |
| | | public R startSeckill(StartSeckillOrderDto orderDto) { |
| | | ComBatteryCommodityActivity commodityActivity = commodityActivityMapper.selectById(orderDto.getActivityId()); |
| | |
| | | ComBatteryCommodityOrder commodityOrder = getCreateActivityOrder(commodity,userAddress,user,commoditySpecs,orderDto,nowDate,commodityActivity); |
| | | Map<String,Object> resultMap = new HashMap<>(2); |
| | | if(this.baseMapper.insert(commodityOrder) > 0){ |
| | | //更新活动商品库存 |
| | | commodityActivity.setCommoditySaleNum(commodityActivity.getCommoditySaleNum() + orderDto.getCount()); |
| | | commodityActivityMapper.updateById(commodityActivity); |
| | | //更新商品库存 |
| | | commoditySpecs.setStock(commoditySpecs.getStock() - orderDto.getCount()); |
| | | commoditySpecsMapper.updateById(commoditySpecs); |
| | |
| | | entity.setId(id); |
| | | entity.setIsDel(ComBatteryStore.IsDel.YES); |
| | | if (this.baseMapper.updateById(entity) > 0) { |
| | | //同时删除账号 |
| | | this.baseMapper.deleteStoreUserByStoreId(id); |
| | | return R.ok(); |
| | | } |
| | | return R.fail("删除失败"); |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.panzhihua.service_community.dao.ComChangeCarModelRelationMapper; |
| | | import com.panzhihua.service_community.entity.ComChangeCarModelRelation; |
| | | import com.panzhihua.service_community.entity.ComChangeCarModelSpecsChildren; |
| | | import com.panzhihua.service_community.dao.ComChangeCarModelSpecsChildrenMapper; |
| | | import com.panzhihua.service_community.service.ComChangeCarModelSpecsChildrenService; |
| | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * title: 换新车-车型子规格表表服务实现类 |
| | |
| | | */ |
| | | @Service("comChangeCarModelSpecsChildrenService") |
| | | public class ComChangeCarModelSpecsChildrenServiceImpl extends ServiceImpl<ComChangeCarModelSpecsChildrenMapper, ComChangeCarModelSpecsChildren> implements ComChangeCarModelSpecsChildrenService { |
| | | |
| | | @Resource |
| | | private ComChangeCarModelRelationMapper modelRelationMapper; |
| | | |
| | | /** |
| | | * description queryByPage 分页查询 |
| | |
| | | */ |
| | | @Override |
| | | public R deleteById(Long id) { |
| | | //判断当前规格是否有被引用 |
| | | Integer count = modelRelationMapper.selectCount(new QueryWrapper<ComChangeCarModelRelation>().lambda() |
| | | .eq(ComChangeCarModelRelation::getModelSpecsChildrenId,id)); |
| | | if(count > 0){ |
| | | return R.fail("该规格已被引用,不可删除"); |
| | | } |
| | | ComChangeCarModelSpecsChildren entity = new ComChangeCarModelSpecsChildren(); |
| | | entity.setId(id); |
| | | entity.setIsDel(ComChangeCarModelSpecsChildren.IsDel.YES); |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.panzhihua.common.model.vos.common.ComChangeCarModelSpecsChildrenVo; |
| | | import com.panzhihua.common.model.vos.common.ComChangeCarModelSpecsVo; |
| | | import com.panzhihua.service_community.dao.ComChangeCarModelRelationMapper; |
| | | import com.panzhihua.service_community.dao.ComChangeCarModelSpecsChildrenMapper; |
| | | import com.panzhihua.service_community.entity.ComChangeCarModelRelation; |
| | | import com.panzhihua.service_community.entity.ComChangeCarModelSpecs; |
| | | import com.panzhihua.service_community.dao.ComChangeCarModelSpecsMapper; |
| | | import com.panzhihua.service_community.entity.ComChangeCarModelSpecsChildren; |
| | |
| | | |
| | | @Resource |
| | | private ComChangeCarModelSpecsChildrenMapper carModelSpecsChildrenMapper; |
| | | @Resource |
| | | private ComChangeCarModelRelationMapper modelRelationMapper; |
| | | |
| | | /** |
| | | * description queryByPage 分页查询 |
| | |
| | | */ |
| | | @Override |
| | | public R deleteById(Long id) { |
| | | //判断当前规格是否有被引用 |
| | | Integer count = modelRelationMapper.selectCount(new QueryWrapper<ComChangeCarModelRelation>().lambda() |
| | | .eq(ComChangeCarModelRelation::getModelSpecsId,id)); |
| | | if(count > 0){ |
| | | return R.fail("该规格已被引用,不可删除"); |
| | | } |
| | | ComChangeCarModelSpecs entity = new ComChangeCarModelSpecs(); |
| | | entity.setId(id); |
| | | entity.setIsDel(ComChangeCarModelSpecs.IsDel.YES); |
| | |
| | | <if test="dto.isApplets != null and dto.isApplets == 1"> |
| | | and cbco.status in (2,3,4) |
| | | </if> |
| | | <if test="dto.isAdmin != null and dto.isAdmin == 1"> |
| | | and cbco.status in (2,3,4) |
| | | </if> |
| | | <if test="dto.payNo != null and dto.payNo != ''"> |
| | | and cbco.pay_no = #{dto.payNo} |
| | | </if> |
| | |
| | | <if test="dto.storeId != null"> |
| | | and cbcs.store_id = #{dto.storeId} |
| | | </if> |
| | | <if test="dto.status != null"> |
| | | and cbc.status = #{dto.status} |
| | | </if> |
| | | <if test="dto.commodityId != null"> |
| | | and cbcs.commodity_id = #{dto.commodityId} |
| | | </if> |
| | | <if test="dto.keyWord != null and dto.keyWord != ''"> |
| | | and cbcs.`name` like concat('%',#{dto.keyWord},'%') |
| | | and ( |
| | | cbcs.`name` like concat('%',#{dto.keyWord},'%') or |
| | | cbc.`name` like concat('%',#{dto.keyWord},'%') or |
| | | cbcs.commodity_id like concat('%',#{dto.keyWord},'%') |
| | | ) |
| | | </if> |
| | | </where> |
| | | order by cbcs.create_at desc |
| | |
| | | select count(user_id) from sys_user where `type` = 20 and phone = #{regPhone} |
| | | </select> |
| | | |
| | | <delete id="deleteStoreUserByStoreId"> |
| | | delete sys_user where `type` = 20 and community_id = #{storeId} |
| | | </delete> |
| | | |
| | | </mapper> |
| | | |
| | |
| | | LEFT JOIN com_change_car_model_specs_children AS cccmsc ON cccmsc.id = cccmr.model_specs_children_id |
| | | LEFT JOIN com_change_car_brand AS cccb ON cccb.id = cccm.brand_id |
| | | <where> |
| | | and cccm.is_del = 2 and cccm.status = 1 |
| | | <if test="dto.brandIds != null and dto.brandIds.size > 0"> |
| | | and cccm.brand_id in |
| | | <foreach collection='dto.brandIds' item='id' index='index' open='(' close=')' separator=',' > |