springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActQuestnaireDAO.java
@@ -22,7 +22,7 @@ " com_act_questnaire aq \n" + " LEFT JOIN sys_user u on aq.create_by = u.user_id \n" + " where aq.is_hide=0 " + "<if test='communityId != null and communityId!=0 '>\n" + "<if test='communityId != null and communityId!=0l '>\n" + " and aq.community_id = #{communityId}\n" + " </if> " + "<if test='pageQuestnaireDTO.state != null '>\n" + springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComOpsAdvDAO.java
@@ -86,6 +86,7 @@ "JOIN com_ops_adv_pos po on a.pos_id=po.id\n" + "LEFT JOIN com_ops_adv_jump p on a.jump_id=p.id\n" + "WHERE\n" + "a.id=#{id} ") "a.id=#{id} " + "order by a.create_at desc") ComOpsAdvVO detailAdvertisement(Long id); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComShopStoreDAO.java
@@ -22,7 +22,7 @@ "select id,`name`,store_password,contacts,store_account,classify_id,logo,phone,delivery_type,remark,`status`," + "sale,sale_volume,store_detail,create_at from com_shop_store c" + " <where>" + "c.delete_status=1 and status = 1" + "c.delete_status=1 and c.status = 1" + "<if test='pageComShopStoreDTO.contacts != null and pageComShopStoreDTO.contacts.trim() != ""'>" + "and c.contacts like concat('%',#{pageComShopStoreDTO.contacts},'%') \n" + " </if> " + springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngRealCompanyServiceImpl.java
@@ -1,4 +1,5 @@ package com.panzhihua.service_community.service.impl; import java.util.Date; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -119,13 +120,18 @@ BeanUtils.copyProperties(l, comMngRealCompanyDO); comMngRealCompanyDO.setCommunityId(communityId); comMngRealCompanyDOS.add(comMngRealCompanyDO); }else{ BeanUtils.copyProperties(l, realCompany); realCompany.setCommunityId(communityId); realCompany.setId(communityId); comMngRealCompanyDOS.add(realCompany); } }); boolean batch = this.saveBatch(comMngRealCompanyDOS); boolean batch = this.saveOrUpdateBatch(comMngRealCompanyDOS); if (batch) { return R.ok(); } return R.fail("请检查数据是否重复,格合是否正确"); return R.fail("请检查格式是否正确"); } @Override springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopStoreServiceImpl.java
@@ -19,7 +19,9 @@ import com.panzhihua.service_community.dao.ComShopStoreDAO; import com.panzhihua.service_community.model.dos.ComShopGoodsAttrDO; import com.panzhihua.service_community.model.dos.ComShopGoodsDO; import com.panzhihua.service_community.model.dos.ComShopOrderDO; import com.panzhihua.service_community.model.dos.ComShopStoreDO; import com.panzhihua.service_community.service.ComShopOrderService; import com.panzhihua.service_community.service.ComShopStoreService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; @@ -27,6 +29,8 @@ import javax.annotation.Resource; import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; /** * @auther lyq @@ -41,9 +45,6 @@ private ComShopGoodsDAO shopGoodsDAO; @Resource private ComShopGoodsAttrDAO comShopGoodsAttrDAO; @Resource private UserService userService; /** * 查询店铺列表 * @@ -57,6 +58,11 @@ IPage<PageShopStoreVO> comShopStoreVOIPage = this.baseMapper.pageShopStore(page, pageComShopStoreDTO); return R.ok(comShopStoreVOIPage); } @Resource private UserService userService; @Resource private ComShopOrderService orderService; /** * 查询店铺详情 @@ -185,11 +191,22 @@ .lambda().eq(ComShopGoodsDO::getStoreId,shopStoreDO.getId()) .eq(ComShopGoodsDO::getDeleteStatus,ComShopGoodsDO.deleteStatus.no) .eq(ComShopGoodsDO::getStatus,ComShopGoodsDO.status.sell)); if(!shopGoodsList.isEmpty()){//如果有正常商品则提示无法删除 return R.fail("店铺下有商品正在出售,无法删除店铺"); } List<ComShopOrderDO> comShopOrderDOS = orderService.getBaseMapper().selectList(new LambdaQueryWrapper<ComShopOrderDO>() .eq(ComShopOrderDO::getStoreId,shopStoreDO.getId())); List<ComShopOrderDO> filterOrder = comShopOrderDOS.stream() .filter(order -> order.getStatus() < ComShopOrderDO.status.dpj) .collect(Collectors.toList()); if(!filterOrder.isEmpty()){ return R.fail("店铺下还有订单未完成"); } //删除商家下的订单 comShopOrderDOS.forEach(order->{ order.setDeleteStatus(ComShopOrderDO.deleteStatus.yes); orderService.getBaseMapper().updateById(order); }); shopStoreDO.setDeleteStatus(2); this.baseMapper.updateById(shopStoreDO); }