diff --git a/eladmin-common/src/main/java/cn/ysk/cashier/utils/PageUtil.java b/eladmin-common/src/main/java/cn/ysk/cashier/utils/PageUtil.java index e4d5593c..6b73b4cf 100644 --- a/eladmin-common/src/main/java/cn/ysk/cashier/utils/PageUtil.java +++ b/eladmin-common/src/main/java/cn/ysk/cashier/utils/PageUtil.java @@ -50,7 +50,7 @@ public class PageUtil extends cn.hutool.core.util.PageUtil { map.put("totalElements",page.getTotalElements()); return map; } - public static Map toPlusPage(List list, Integer total) { + public static Map toPlusPage(List list, Integer total) { Map map = new LinkedHashMap<>(2); map.put("content",list); map.put("totalElements",total); diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/TbShopStorageGoodController.java b/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/TbShopStorageGoodController.java index ca44152a..2118c2ef 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/TbShopStorageGoodController.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/TbShopStorageGoodController.java @@ -1,6 +1,7 @@ package cn.ysk.cashier.controller.shop; import cn.ysk.cashier.annotation.Log; +import cn.ysk.cashier.dto.shop.ShopStorageGoodDto; import cn.ysk.cashier.pojo.shop.TbShopStorageGood; import cn.ysk.cashier.dto.shop.TbShopStorageGoodQueryCriteria; import cn.ysk.cashier.service.shop.TbShopStorageGoodService; @@ -14,6 +15,7 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import io.swagger.annotations.*; import java.io.IOException; +import java.util.List; import javax.servlet.http.HttpServletResponse; /** @@ -45,8 +47,9 @@ public class TbShopStorageGoodController { @PostMapping @Log("新增酒品") @ApiOperation("新增酒品") - public ResponseEntity createTbShopStorageGood(@Validated @RequestBody TbShopStorageGood resources){ - return new ResponseEntity<>(tbShopStorageGoodService.create(resources),HttpStatus.CREATED); + public ResponseEntity createTbShopStorageGood(@Validated @RequestBody ShopStorageGoodDto resources){ + tbShopStorageGoodService.create(resources); + return new ResponseEntity<>(HttpStatus.CREATED); } @PutMapping diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/TbShopUserController.java b/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/TbShopUserController.java index 5443c0df..92f32a6b 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/TbShopUserController.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/TbShopUserController.java @@ -18,6 +18,9 @@ package cn.ysk.cashier.controller.shop; 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 lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; @@ -57,14 +60,8 @@ public class TbShopUserController { @GetMapping("queryAllShopUser") @ApiOperation("查询商家用户") - public ResponseEntity queryAllShopUser(TbShopUserQueryCriteria criteria, Pageable pageable){ - Map stringObjectMap=new HashMap<>(); - if (criteria.getShopId().equals("1")) { - stringObjectMap = tbShopUserService.queryAllShopUser(criteria, pageable); - }else { - stringObjectMap = tbShopUserService.queryShopUser(criteria, pageable); - } - return new ResponseEntity<>(stringObjectMap,HttpStatus.OK); + public ResponseEntity queryAllShopUser(TbShopUserQueryCriteria criteria){ + return new ResponseEntity<>(tbShopUserService.queryShopUser(criteria),HttpStatus.OK); } diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/dto/shop/ShopStorageGoodDto.java b/eladmin-system/src/main/java/cn/ysk/cashier/dto/shop/ShopStorageGoodDto.java new file mode 100644 index 00000000..f81d7b76 --- /dev/null +++ b/eladmin-system/src/main/java/cn/ysk/cashier/dto/shop/ShopStorageGoodDto.java @@ -0,0 +1,24 @@ +package cn.ysk.cashier.dto.shop; + +import lombok.Data; + +import java.util.List; + +@Data +public class ShopStorageGoodDto { + /** 单位 */ + private String unit; + /** 有效期(天) */ + private Integer period; + /** 0:手动;1:商品; */ + private Integer source; + /** 商户Id */ + private Integer shopId; + + private List goods; + @Data + public static class DetailInfo { + private String name; + private String imgUrl; + } +} diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/dto/shop/TbShopInfoDto.java b/eladmin-system/src/main/java/cn/ysk/cashier/dto/shop/TbShopInfoDto.java index 4a11dfaa..4e8ed426 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/dto/shop/TbShopInfoDto.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/dto/shop/TbShopInfoDto.java @@ -175,6 +175,7 @@ public class TbShopInfoDto implements Serializable { private String profiles; private String isOpenYhq; + private Integer isUseVip; /** * 商家二维码 */ diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/dto/shop/TbShopStorageDto.java b/eladmin-system/src/main/java/cn/ysk/cashier/dto/shop/TbShopStorageDto.java index c872ef07..ae096c8e 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/dto/shop/TbShopStorageDto.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/dto/shop/TbShopStorageDto.java @@ -31,6 +31,7 @@ public class TbShopStorageDto implements Serializable { /** 用户Id */ private Integer userid; + private String headImg; /** 用户昵称 */ private String nickname; diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/dto/shop/TbShopStorageGoodQueryCriteria.java b/eladmin-system/src/main/java/cn/ysk/cashier/dto/shop/TbShopStorageGoodQueryCriteria.java index 8c05b14f..f07964c2 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/dto/shop/TbShopStorageGoodQueryCriteria.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/dto/shop/TbShopStorageGoodQueryCriteria.java @@ -8,17 +8,24 @@ import cn.ysk.cashier.annotation.Query; * @date 2024-05-21 **/ @Data -public class TbShopStorageGoodQueryCriteria{ +public class TbShopStorageGoodQueryCriteria { - /** 模糊 */ + /** + * 模糊 + */ @Query(type = Query.Type.INNER_LIKE) private String name; - /** 精确 */ + /** + * 精确 + */ @Query private Integer shopId; + @Query + private Integer isDel = 0; - private Integer page=0; - private Integer size=10; + + private Integer page = 0; + private Integer size = 10; } \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/dto/shop/TbShopUserQueryCriteria.java b/eladmin-system/src/main/java/cn/ysk/cashier/dto/shop/TbShopUserQueryCriteria.java index 47fe9b85..ccf432cd 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/dto/shop/TbShopUserQueryCriteria.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/dto/shop/TbShopUserQueryCriteria.java @@ -1,41 +1,32 @@ /* -* 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. -*/ + * 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.dto.shop; import lombok.Data; -import cn.ysk.cashier.annotation.Query; -/** -* @website https://eladmin.vip -* @author lyf -* @date 2024-03-01 -**/ @Data -public class TbShopUserQueryCriteria{ +public class TbShopUserQueryCriteria { - /** 模糊 */ - @Query(type = Query.Type.INNER_LIKE) private String name; - /** 模糊 */ - @Query(type = Query.Type.INNER_LIKE) - private String telephone; - - @Query private String shopId; - @Query + private Integer isVip; + + private Long page=1L; + private Long size=10L; + } \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TagProductDepts.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TagProductDepts.java new file mode 100644 index 00000000..c2285535 --- /dev/null +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TagProductDepts.java @@ -0,0 +1,61 @@ +package cn.ysk.cashier.mybatis.entity; + +import java.util.Date; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.extension.activerecord.Model; +import lombok.Data; + +import java.io.Serializable; + + +@SuppressWarnings("serial") +public class TagProductDepts extends Model { + //标签id + private Integer tagId; + //商品id + private Integer productId; + + //创建时间 + private Date createTime=new Date(); + + public TagProductDepts() { + } + + public TagProductDepts(Integer tagId, Integer productId) { + this.tagId = tagId; + this.productId = productId; + } + + public TagProductDepts(Integer tagId, Integer productId, Date createTime) { + this.tagId = tagId; + this.productId = productId; + this.createTime = createTime; + } + + public Integer getTagId() { + return tagId; + } + + public void setTagId(Integer tagId) { + this.tagId = tagId; + } + + public Integer getProductId() { + return productId; + } + + public void setProductId(Integer productId) { + this.productId = productId; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + +} + diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/ShopUserMapper.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/ShopUserMapper.java new file mode 100644 index 00000000..a480351f --- /dev/null +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/ShopUserMapper.java @@ -0,0 +1,33 @@ +package cn.ysk.cashier.mybatis.mapper; + +import cn.ysk.cashier.dto.shop.TbShopUserQueryCriteria; +import cn.ysk.cashier.pojo.shop.TbShopUser; +import cn.ysk.cashier.vo.ShopUserInfoVo; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.ibatis.annotations.Select; + +public interface ShopUserMapper extends BaseMapper { + + @Select("") + IPage queryUser(TbShopUserQueryCriteria param, Page pageInfo); +} + diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TagProductDeptsMapper.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TagProductDeptsMapper.java new file mode 100644 index 00000000..6ceef36a --- /dev/null +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TagProductDeptsMapper.java @@ -0,0 +1,23 @@ +package cn.ysk.cashier.mybatis.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import cn.ysk.cashier.mybatis.entity.TagProductDepts; +import org.apache.ibatis.annotations.Delete; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +/** + * (TagProductDepts)表数据库访问层 + * + * @author ww + * @since 2024-05-23 14:21:29 + */ +public interface TagProductDeptsMapper extends BaseMapper { + @Delete("delete FROM tag_product_depts WHERE product_id = #{productId}") + int delByProductIdAfter(Integer productId); + + @Select("SELECT * FROM tag_product_depts WHERE product_id = #{productId}") + List queryAllByProductId(Integer productId); +} + diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbShopUserMapper.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbShopUserMapper.java new file mode 100644 index 00000000..98b8833d --- /dev/null +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbShopUserMapper.java @@ -0,0 +1,8 @@ +package cn.ysk.cashier.mybatis.mapper; + +import cn.ysk.cashier.pojo.shop.TbShopUser; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +public interface TbShopUserMapper extends BaseMapper { + +} diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/rest/StorageController.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/rest/StorageController.java index 302afadc..3e663cb2 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/rest/StorageController.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/rest/StorageController.java @@ -20,24 +20,7 @@ import org.springframework.web.bind.annotation.*; public class StorageController { @Autowired private ShopService shopService; - @PostMapping("/findStorage") - public ResponseEntity findStorage(@RequestParam Integer shopId,String account,Pageable pageable){ - return new ResponseEntity<>(shopService.findStorage(shopId,account,pageable), HttpStatus.OK); - } - @PostMapping("/outStorage") - @Log("商品出库") - public ResponseEntity outStorage(@RequestParam Integer id,@RequestParam Integer num){ - String userName = SecurityUtils.getCurrentUsername(); - shopService.outStorage(id,userName,num); - return new ResponseEntity<>( HttpStatus.OK); - } - @PostMapping("/inStorage") - @Log("商品入库") - public ResponseEntity inStorage(@RequestBody StorageVo storageVo){ - String userName = SecurityUtils.getCurrentUsername(); - shopService.inStorage(storageVo,userName); - return new ResponseEntity<>(HttpStatus.OK); - } + @GetMapping("/findActivate") public ResponseEntity findActivate(@RequestParam String shopId){ String userName = SecurityUtils.getCurrentUsername(); diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TagProductDeptsService.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TagProductDeptsService.java new file mode 100644 index 00000000..2aa974cf --- /dev/null +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TagProductDeptsService.java @@ -0,0 +1,21 @@ +package cn.ysk.cashier.mybatis.service; + +import cn.ysk.cashier.mybatis.entity.TagProductDepts; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** + * (TagProductDepts)表服务接口 + * + * @author ww + * @since 2024-05-23 14:21:29 + */ +public interface TagProductDeptsService extends IService { + + void setTag(Integer tagId,Integer productId); + + List queryAllByProductId(Integer productId); + +} + diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TagProductDeptsServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TagProductDeptsServiceImpl.java new file mode 100644 index 00000000..a7a654aa --- /dev/null +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TagProductDeptsServiceImpl.java @@ -0,0 +1,37 @@ +package cn.ysk.cashier.mybatis.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import cn.ysk.cashier.mybatis.mapper.TagProductDeptsMapper; +import cn.ysk.cashier.mybatis.entity.TagProductDepts; +import cn.ysk.cashier.mybatis.service.TagProductDeptsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * (TagProductDepts)表服务实现类 + * + * @author ww + * @since 2024-05-23 14:21:29 + */ +@Service +public class TagProductDeptsServiceImpl extends ServiceImpl implements TagProductDeptsService { + + @Autowired + private TagProductDeptsMapper productDeptsMapper; + + @Override + public void setTag(Integer tagId,Integer productId) { + productDeptsMapper.delByProductIdAfter(productId); + TagProductDepts tagProduct=new TagProductDepts(tagId,productId); + productDeptsMapper.insert(tagProduct); + } + @Override + public List queryAllByProductId(Integer productId){ +// productDeptsMapper.select + return productDeptsMapper.queryAllByProductId(productId); + } +} + diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbShopInfo.java b/eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbShopInfo.java index 6926d096..b8eded9c 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbShopInfo.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbShopInfo.java @@ -228,7 +228,9 @@ public class TbShopInfo implements Serializable { @Column(name = "is_open_yhq") @ApiModelProperty(value = "是否参与优惠券活动 true false") private String isOpenYhq; - + @Column(name = "is_use_vip") + @ApiModelProperty(value = "是否支持会员支付 0否1是") + private Integer isUseVip; @Column(name = "shop_qrcode") @ApiModelProperty(value = "商家二维码") private String shopQrcode; diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbShopStorage.java b/eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbShopStorage.java index 807caa60..3d7e9658 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbShopStorage.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbShopStorage.java @@ -51,6 +51,10 @@ public class TbShopStorage implements Serializable { @ApiModelProperty(value = "用户Id") private Integer userid; + @Column(name = "`head_img`") + @ApiModelProperty(value = "用户头像") + private String headImg; + @Column(name = "`nick_name`") @ApiModelProperty(value = "用户昵称") private String nickname; diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/repository/shop/TbPurchaseNoticeRepository.java b/eladmin-system/src/main/java/cn/ysk/cashier/repository/shop/TbPurchaseNoticeRepository.java index 9adf24c6..137cd599 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/repository/shop/TbPurchaseNoticeRepository.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/repository/shop/TbPurchaseNoticeRepository.java @@ -13,9 +13,9 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor; public interface TbPurchaseNoticeRepository extends JpaRepository, JpaSpecificationExecutor { /** - * 根据 couponId 查询 - * @param couponId couponId + * 根据 proId 查询 + * @param proId * @return / */ - TbPurchaseNotice findByCouponId(Integer couponId); + TbPurchaseNotice findByCouponId(Integer proId); } \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/repository/shop/TbShopUserRepository.java b/eladmin-system/src/main/java/cn/ysk/cashier/repository/shop/TbShopUserRepository.java index 12a2b93c..77362245 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/repository/shop/TbShopUserRepository.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/repository/shop/TbShopUserRepository.java @@ -35,26 +35,6 @@ import java.util.List; **/ public interface TbShopUserRepository extends JpaRepository,JpaSpecificationExecutor { - - @Query("SELECT NEW cn.ysk.cashier.vo.ShopUserInfoVo(su.id, u.headImg, u.nickName, u.sex, u.amount, u.totalScore, u.telephone, u.birthDay, u.isVip, su.createdAt, u.lastLogInAt) " + - "FROM TbShopUser su " + - "LEFT JOIN TbUserInfo u " + - "on su.userId = CAST(u.id AS string) " + - "WHERE su.isVip = IFNULL(:isVip, su.isVip)" + - "AND (u.telephone = IFNULL(:phone, u.telephone))" + - "AND su.shopId = :shopId " + - "order by su.createdAt desc ") - Page findShopUserJoinUserInfo(String shopId,Integer isVip,String phone, Pageable pageable); - - @Query("SELECT NEW cn.ysk.cashier.vo.ShopUserInfoVo(su.id, u.headImg, u.nickName, u.sex, u.amount, u.totalScore, u.telephone, u.birthDay, u.isVip, su.createdAt, u.lastLogInAt) " + - "FROM TbShopUser su " + - "LEFT JOIN TbUserInfo u " + - "on su.userId = CAST(u.id AS string) " + - "WHERE su.isVip = IFNULL(:isVip, su.isVip)" + - "AND (u.telephone = IFNULL(:phone, u.telephone))" + - "order by su.createdAt desc ") - Page findAllShopUserJoinUserInfo(Integer isVip,String phone, Pageable pageable); - @Query("SELECT count(0) from TbShopUser user where user.shopId = :shopId") Tuple searchByCount(@Param("shopId") String shopId); diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/TbPlatformDictService.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/TbPlatformDictService.java index 45b7afd6..5ae2bd8a 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/TbPlatformDictService.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/TbPlatformDictService.java @@ -25,6 +25,8 @@ public interface TbPlatformDictService { List queryByType(String type); + List queryByIds(List ids); + /** * 根据ID查询 * @param id ID diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/TbPlatformDictServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/TbPlatformDictServiceImpl.java index 53321119..374e8d90 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/TbPlatformDictServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/TbPlatformDictServiceImpl.java @@ -55,6 +55,11 @@ public class TbPlatformDictServiceImpl implements TbPlatformDictService { return tbPlatformDictMapper.toDto(tbPlatformDictRepository.findAllByTypeAndIsShowCash(type,1)); } + @Override + public List queryByIds(List ids){ + return tbPlatformDictRepository.findAllById(ids); + } + @Override @Transactional public TbPlatformDictDto findById(Integer id) { diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/order/TbGroupOrderInfoServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/order/TbGroupOrderInfoServiceImpl.java index af685937..a6728cef 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/order/TbGroupOrderInfoServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/order/TbGroupOrderInfoServiceImpl.java @@ -15,6 +15,7 @@ import cn.ysk.cashier.service.order.TbGroupOrderCouponService; import cn.ysk.cashier.service.order.TbGroupOrderInfoService; import cn.ysk.cashier.service.shop.TbMerchantThirdApplyService; import cn.ysk.cashier.mybatis.service.TbOrderPaymentService; +import cn.ysk.cashier.thirdpay.resp.GroupOrderReturnResp; import cn.ysk.cashier.thirdpay.resp.OrderReturnResp; import cn.ysk.cashier.thirdpay.resp.PublicResp; import cn.ysk.cashier.thirdpay.service.ThirdPayService; @@ -181,10 +182,11 @@ public class TbGroupOrderInfoServiceImpl implements TbGroupOrderInfoService { thirdApply.getAppToken()); if (ObjectUtil.isNotNull(publicResp) && ObjectUtil.isNotEmpty(publicResp)) { + GroupOrderReturnResp returnInfo = JSONUtil.parseJSONStr2T(publicResp.getBizData(), GroupOrderReturnResp.class); if ("000000".equals(publicResp.getCode())) { //TRADE_REFUND - if (!"TRADE_SUCCESS".equals(publicResp.getObjData().getState()) && !publicResp.getObjData().getState().equals("ING")) { - throw new BadRequestException("退款渠道调用失败"); + if (!"SUCCESS".equals(returnInfo.getState()) && !"TRADE_SUCCESS".equals(returnInfo.getState()) && !returnInfo.getState().equals("ING")) { + throw new BadRequestException("退款渠道调用失败,"+returnInfo.getNote()); } } else { throw new BadRequestException("退款渠道调用失败:" + publicResp.getMsg()); diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/productimpl/TbProductServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/productimpl/TbProductServiceImpl.java index 7bc5916c..ca35d7d3 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/productimpl/TbProductServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/productimpl/TbProductServiceImpl.java @@ -17,18 +17,25 @@ package cn.ysk.cashier.service.impl.productimpl; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; +import cn.ysk.cashier.dto.TbPlatformDictDto; import cn.ysk.cashier.dto.product.TbProductDto; import cn.ysk.cashier.dto.product.TbProductQueryCriteria; import cn.ysk.cashier.dto.shop.TbCouponCategoryDto; import cn.ysk.cashier.exception.BadRequestException; import cn.ysk.cashier.mapper.product.TbProductMapper; +import cn.ysk.cashier.mybatis.entity.TagProductDepts; +import cn.ysk.cashier.mybatis.service.TagProductDeptsService; import cn.ysk.cashier.pojo.product.*; +import cn.ysk.cashier.pojo.shop.TbPurchaseNotice; import cn.ysk.cashier.pojo.shop.TbShopUnit; import cn.ysk.cashier.repository.product.*; +import cn.ysk.cashier.repository.shop.TbPurchaseNoticeRepository; import cn.ysk.cashier.repository.shop.TbShopUnitRepository; import cn.ysk.cashier.repository.shop.TbShopUserDutyDetailRepository; +import cn.ysk.cashier.service.TbPlatformDictService; import cn.ysk.cashier.service.product.TbProductService; import cn.ysk.cashier.service.shop.TbCouponCategoryService; +import cn.ysk.cashier.service.shop.TbPurchaseNoticeService; import cn.ysk.cashier.utils.*; import cn.ysk.cashier.vo.TbProductVo; import com.alibaba.fastjson.JSONArray; @@ -72,6 +79,9 @@ public class TbProductServiceImpl implements TbProductService { private final TbShopCategoryRepository tbShopCategoryRepository; private final TbShopUserDutyDetailRepository tbShopUserDutyDetailRe; private final TbCouponCategoryService tbCouponCategoryService; + private final TbPlatformDictService tbPlatformDictService; + private final TagProductDeptsService tagProductService; + private final TbPurchaseNoticeRepository noticeRepository; private final RedisUtils redisUtils; @@ -116,13 +126,13 @@ public class TbProductServiceImpl implements TbProductService { } //分类 List tbShopCategory = new ArrayList<>(); - if (!categoryId.isEmpty()){ + if (!categoryId.isEmpty()) { List categoryIdInt = ListUtil.stringChangeIntegerList(categoryId); tbShopCategory = tbShopCategoryRepository.searchCategory(categoryIdInt); } //销量 List objects = new ArrayList<>(); - if (!productIdInt.isEmpty()){ + if (!productIdInt.isEmpty()) { objects = tbShopUserDutyDetailRe.searchUUserDutyDetail(productIdInt); } //组装 @@ -164,24 +174,24 @@ public class TbProductServiceImpl implements TbProductService { } } //分类 - if (tbShopCategory.isEmpty()){ + if (tbShopCategory.isEmpty()) { tbProductVo.setCategoryName(""); - }else { - for (TbShopCategory shopCategory :tbShopCategory) { - if (shopCategory.getId().toString().equals(product.getCategoryId())){ + } else { + for (TbShopCategory shopCategory : tbShopCategory) { + if (shopCategory.getId().toString().equals(product.getCategoryId())) { tbProductVo.setCategoryName(shopCategory.getName()); } } } //销量 - if (objects.isEmpty()){ + if (objects.isEmpty()) { tbProductVo.setRealSalesNumber(0.00); - }else { - for (Object[] o :objects) { - if (((Integer) o[1]).equals(product.getId())){ - BigDecimal bigDecimal = (BigDecimal) o[0]; - tbProductVo.setRealSalesNumber(bigDecimal.doubleValue()); - } + } else { + for (Object[] o : objects) { + if (((Integer) o[1]).equals(product.getId())) { + BigDecimal bigDecimal = (BigDecimal) o[0]; + tbProductVo.setRealSalesNumber(bigDecimal.doubleValue()); + } } } BeanUtils.copyProperties(product, tbProductVo); @@ -208,7 +218,7 @@ public class TbProductServiceImpl implements TbProductService { Threads.call(tbProductSkus, tbProductSpec); //组装 TbProductVo tbProductVo = new TbProductVo(); - tbProductVo.setCategoryId(tbProduct.getCategoryId()); + tbProductVo.setCategoryId(StringUtils.isNotBlank(tbProduct.getCategoryId())?Integer.valueOf(tbProduct.getCategoryId()):null); //单位 // if (tbProduct.getUnitId() == null) { // tbProductVo.setUnitId(null); @@ -221,9 +231,9 @@ public class TbProductServiceImpl implements TbProductService { tbProductVo.setGroupSnap(ListUtil.stringChangeList(tbProduct.getGroupSnap())); } BeanUtils.copyProperties(tbProduct, tbProductVo); - if(!org.apache.commons.lang3.StringUtils.isBlank(tbProduct.getImages())){ + if (!org.apache.commons.lang3.StringUtils.isBlank(tbProduct.getImages())) { tbProductVo.setImages(ListUtil.stringChangeList(tbProduct.getImages())); - }else{ + } else { tbProductVo.setImages(new JSONArray()); } HashMap map = new HashMap<>(); @@ -252,6 +262,16 @@ public class TbProductServiceImpl implements TbProductService { tbProductVo.getGroupCategoryId().add(byId); } } + List tagProductDepts = tagProductService.queryAllByProductId(tbProductVo.getId()); + if (!CollectionUtils.isEmpty(tagProductDepts)) { + List collect = tagProductDepts.stream().map(TagProductDepts::getTagId).collect(Collectors.toList()); + List tags = tbPlatformDictService.queryByIds(collect); + tbProductVo.setTags(tags); + } + TbPurchaseNotice notice = noticeRepository.findByCouponId(id); + if (notice != null) { + tbProductVo.setNotices(notice); + } } return tbProductVo; } @@ -286,20 +306,22 @@ public class TbProductServiceImpl implements TbProductService { TbProduct product = new TbProduct(); //组装 BeanUtil.copyProperties(resources, product, CopyOptions.create().setIgnoreNullValue(true)); - if (resources.getCategoryId() == null) { - throw new BadRequestException("必填内容未填写"); - } - if (resources.getIsShowMall() == 1) { - for (TbProductSku sku : resources.getSkuList()) { - if (sku.getStockNumber() <= 0) { - throw new BadRequestException("上架区域包括小程序时,库存数量必须大于0。"); + if (!"group".equals(resources.getTypeEnum())) { + if (resources.getCategoryId() == null) { + throw new BadRequestException("必填内容未填写"); + } + if (resources.getIsShowMall() == 1) { + for (TbProductSku sku : resources.getSkuList()) { + if (sku.getStockNumber() <= 0) { + throw new BadRequestException("上架区域包括小程序时,库存数量必须大于0。"); + } } } + product.setCategoryId(String.valueOf(resources.getCategoryId())); } - if(!CollectionUtils.isEmpty(resources.getImages())){ + if (!CollectionUtils.isEmpty(resources.getImages())) { product.setImages(resources.getImages().toString()); } - product.setCategoryId(String.valueOf(resources.getCategoryId())); product.setIsDel(0); product.setIsDelete(0); product.setIsFreeFreight(1); @@ -309,16 +331,21 @@ public class TbProductServiceImpl implements TbProductService { if (resources.getUnitId() != null) { product.setUnitId(resources.getUnitId()); } - if("group".equals(resources.getTypeEnum())){ + if ("group".equals(resources.getTypeEnum())) { //套餐内容 if (!resources.getGroupSnap().isEmpty()) { product.setGroupSnap(ListUtil.JSONArrayChangeString(resources.getGroupSnap())); product.setIsCombo(1); } - if(!CollectionUtils.isEmpty(resources.getGroupCategoryId())){ + if (!CollectionUtils.isEmpty(resources.getGroupCategoryId())) { List collect = resources.getGroupCategoryId().stream().map(TbCouponCategoryDto::getId).collect(Collectors.toList()); product.setGroupCategoryId(collect.toString()); } + if (!CollectionUtils.isEmpty(resources.getTags())) { + for (TbPlatformDictDto tag : resources.getTags()) { + tagProductService.setTag(tag.getId(), resources.getId()); + } + } } TbProduct save = tbProductRepository.save(product); @@ -348,6 +375,16 @@ public class TbProductServiceImpl implements TbProductService { productSkuResult.setTagSnap(resources.getSkuSnap()); productSkuResult.setId(save.getId()); tbProductSkuResultRepository.save(productSkuResult); + } else if ("group".equals(resources.getTypeEnum())) { + TbPurchaseNotice notices = resources.getNotices(); + if (StringUtils.isBlank(notices.getDateUsed()) + && StringUtils.isBlank(notices.getAvailableTime()) + && StringUtils.isBlank(notices.getBookingType()) + && StringUtils.isBlank(notices.getRefundPolicy())) { + throw new BadRequestException("添加购买须知失败,必填项未填写"); + } + resources.getNotices().setCouponId(save.getId()); + noticeRepository.save(resources.getNotices()); } return resources; } @@ -366,16 +403,23 @@ public class TbProductServiceImpl implements TbProductService { product.setUpdatedAt(Instant.now().toEpochMilli()); product.setCategoryId(resources.getCategoryId().toString()); product.setImages(resources.getImages().toString()); - if("group".equals(resources.getTypeEnum())){ + if ("group".equals(resources.getTypeEnum())) { //套餐内容 if (!resources.getGroupSnap().isEmpty()) { product.setGroupSnap(ListUtil.JSONArrayChangeString(resources.getGroupSnap())); product.setIsCombo(1); } - if(!CollectionUtils.isEmpty(resources.getGroupCategoryId())){ + if (!CollectionUtils.isEmpty(resources.getGroupCategoryId())) { List collect = resources.getGroupCategoryId().stream().map(TbCouponCategoryDto::getId).collect(Collectors.toList()); product.setGroupCategoryId(collect.toString()); } + if (!CollectionUtils.isEmpty(resources.getTags())) { + for (TbPlatformDictDto tag : resources.getTags()) { + tagProductService.setTag(tag.getId(), resources.getId()); + } + } + noticeRepository.save(resources.getNotices()); + } TbProduct save = tbProductRepository.save(product); @@ -384,10 +428,10 @@ public class TbProductServiceImpl implements TbProductService { List skuList = new ArrayList<>(); for (TbProductSku sku : resources.getSkuList()) { TbProductSku tbProductSku = tbProductSkuRepository.searchBarCode(sku.getBarCode()); - if (tbProductSku != null){ - tbProductSkuRepository.updateByBarCode(sku.getBarCode(),sku.getCostPrice(),sku.getCoverImg(),sku.getFirstShared(),sku.getMemberPrice(), - sku.getOriginPrice(),sku.getSalePrice(),sku.getSpecSnap(),tbProductSku.getId()); - }else { + if (tbProductSku != null) { + tbProductSkuRepository.updateByBarCode(sku.getBarCode(), sku.getCostPrice(), sku.getCoverImg(), sku.getFirstShared(), sku.getMemberPrice(), + sku.getOriginPrice(), sku.getSalePrice(), sku.getSpecSnap(), tbProductSku.getId()); + } else { if ("sku".equals(save.getTypeEnum())) { tbProductSkuRepository.deleteByProductId(String.valueOf(save.getId())); } diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopStorageGoodServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopStorageGoodServiceImpl.java index d5c7aafe..a5e5ac28 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopStorageGoodServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopStorageGoodServiceImpl.java @@ -1,5 +1,6 @@ package cn.ysk.cashier.service.impl.shopimpl; +import cn.ysk.cashier.dto.shop.ShopStorageGoodDto; import cn.ysk.cashier.dto.shop.TbShopStorageGoodDto; import cn.ysk.cashier.dto.shop.TbShopStorageGoodQueryCriteria; import cn.ysk.cashier.mapper.shop.TbShopStorageGoodMapper; @@ -25,9 +26,9 @@ import java.util.ArrayList; import java.util.LinkedHashMap; /** + * @author ww * @website https://eladmin.vip * @description 服务实现 - * @author ww * @date 2024-05-21 **/ @Service @@ -38,36 +39,56 @@ public class TbShopStorageGoodServiceImpl implements TbShopStorageGoodService { private final TbShopStorageGoodMapper tbShopStorageGoodMapper; @Override - public Map queryAll(TbShopStorageGoodQueryCriteria criteria, Pageable pageable){ - Page page = tbShopStorageGoodRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + public Map queryAll(TbShopStorageGoodQueryCriteria criteria, Pageable pageable) { + Page page = tbShopStorageGoodRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder), pageable); return PageUtil.toPage(page.map(tbShopStorageGoodMapper::toDto)); } @Override - public List queryAll(TbShopStorageGoodQueryCriteria criteria){ - return tbShopStorageGoodMapper.toDto(tbShopStorageGoodRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + public List queryAll(TbShopStorageGoodQueryCriteria criteria) { + return tbShopStorageGoodMapper.toDto(tbShopStorageGoodRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder))); } @Override @Transactional public TbShopStorageGoodDto findById(Integer id) { TbShopStorageGood tbShopStorageGood = tbShopStorageGoodRepository.findById(id).orElseGet(TbShopStorageGood::new); - ValidationUtil.isNull(tbShopStorageGood.getId(),"TbShopStorageGood","id",id); + ValidationUtil.isNull(tbShopStorageGood.getId(), "TbShopStorageGood", "id", id); return tbShopStorageGoodMapper.toDto(tbShopStorageGood); } @Override @Transactional(rollbackFor = Exception.class) public TbShopStorageGoodDto create(TbShopStorageGood resources) { + resources.setIsDel(0); resources.setCreateTime(new Timestamp(System.currentTimeMillis())); return tbShopStorageGoodMapper.toDto(tbShopStorageGoodRepository.save(resources)); } + @Override + @Transactional(rollbackFor = Exception.class) + public void create(ShopStorageGoodDto resources) { + List storageGoodList = new ArrayList<>(); + for (ShopStorageGoodDto.DetailInfo good : resources.getGoods()) { + TbShopStorageGood storageGood = new TbShopStorageGood(); + storageGood.setIsDel(0); + storageGood.setCreateTime(new Timestamp(System.currentTimeMillis())); + storageGood.setName(good.getName()); + storageGood.setImgUrl(good.getImgUrl()); + storageGood.setPeriod(resources.getPeriod()); + storageGood.setSource(resources.getSource()); + storageGood.setUnit(resources.getUnit()); + storageGood.setShopId(resources.getShopId()); + storageGoodList.add(storageGood); + } + tbShopStorageGoodRepository.saveAll(storageGoodList); + } + @Override @Transactional(rollbackFor = Exception.class) public void update(TbShopStorageGood resources) { TbShopStorageGood tbShopStorageGood = tbShopStorageGoodRepository.findById(resources.getId()).orElseGet(TbShopStorageGood::new); - ValidationUtil.isNull( tbShopStorageGood.getId(),"TbShopStorageGood","id",resources.getId()); + ValidationUtil.isNull(tbShopStorageGood.getId(), "TbShopStorageGood", "id", resources.getId()); tbShopStorageGood.copy(resources); tbShopStorageGoodRepository.save(tbShopStorageGood); } @@ -83,13 +104,13 @@ public class TbShopStorageGoodServiceImpl implements TbShopStorageGoodService { public void download(List all, HttpServletResponse response) throws IOException { List> list = new ArrayList<>(); for (TbShopStorageGoodDto tbShopStorageGood : all) { - Map map = new LinkedHashMap<>(); + Map map = new LinkedHashMap<>(); map.put("酒品名", tbShopStorageGood.getName()); map.put("图片地址", tbShopStorageGood.getImgUrl()); map.put("单位", tbShopStorageGood.getUnit()); map.put("有效期(天)", tbShopStorageGood.getPeriod()); map.put("0:未删除;1:已删除", tbShopStorageGood.getIsDel()); - map.put(" createTime", tbShopStorageGood.getCreateTime()); + map.put(" createTime", tbShopStorageGood.getCreateTime()); map.put("0:手动;1:商品;", tbShopStorageGood.getSource()); map.put("商户Id", tbShopStorageGood.getShopId()); list.add(map); diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopStorageServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopStorageServiceImpl.java index 1f30c790..3f763c30 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopStorageServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopStorageServiceImpl.java @@ -64,6 +64,7 @@ public class TbShopStorageServiceImpl implements TbShopStorageService { @Override @Transactional(rollbackFor = Exception.class) public TbShopStorageDto create(TbShopStorage resources) { + resources.setStatus(1); resources.setSavTime(new Timestamp(System.currentTimeMillis())); resources.setExpTime(new Timestamp(System.currentTimeMillis() + 86400000 * resources.getExpDay())); return tbShopStorageMapper.toDto(tbShopStorageRepository.save(resources)); diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopUserServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopUserServiceImpl.java index c8ba9744..15e41626 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopUserServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopUserServiceImpl.java @@ -18,6 +18,9 @@ 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; @@ -26,7 +29,10 @@ 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; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; @@ -52,25 +58,14 @@ public class TbShopUserServiceImpl implements TbShopUserService { private final TbShopUserRepository tbShopUserRepository; private final TbShopUserMapper tbShopUserMapper; - @Override - public Map queryShopUser(TbShopUserQueryCriteria criteria, Pageable pageable) { - Page shopUserJoinUserInfo = - tbShopUserRepository.findShopUserJoinUserInfo( - criteria.getShopId(), - criteria.getIsVip(), - criteria.getTelephone(), - pageable); - return PageUtil.toPage(shopUserJoinUserInfo); - } + @Autowired + private ShopUserMapper shopUserMapper; @Override - public Map queryAllShopUser(TbShopUserQueryCriteria criteria, Pageable pageable) { - Page shopUserJoinUserInfo = - tbShopUserRepository.findAllShopUserJoinUserInfo( - criteria.getIsVip(), - criteria.getTelephone(), - pageable); - return PageUtil.toPage(shopUserJoinUserInfo); + public Map queryShopUser(TbShopUserQueryCriteria criteria) { + IPage iPage = shopUserMapper.queryUser(criteria, + new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(criteria.getPage(), criteria.getSize())); + return PageUtil.toPlusPage(iPage.getRecords(),Integer.valueOf(iPage.getTotal()+"")); } @Override diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/shop/TbShopStorageGoodService.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/shop/TbShopStorageGoodService.java index 26086ca2..695bff1f 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/shop/TbShopStorageGoodService.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/shop/TbShopStorageGoodService.java @@ -1,5 +1,6 @@ package cn.ysk.cashier.service.shop; +import cn.ysk.cashier.dto.shop.ShopStorageGoodDto; import cn.ysk.cashier.dto.shop.TbShopStorageGoodDto; import cn.ysk.cashier.dto.shop.TbShopStorageGoodQueryCriteria; import cn.ysk.cashier.pojo.shop.TbShopStorageGood; @@ -43,6 +44,7 @@ public interface TbShopStorageGoodService { * @return TbShopStorageGoodDto */ TbShopStorageGoodDto create(TbShopStorageGood resources); + void create(ShopStorageGoodDto resources); /** * 编辑 diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/shop/TbShopUserService.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/shop/TbShopUserService.java index 1e709a12..ab2fd2bd 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/shop/TbShopUserService.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/shop/TbShopUserService.java @@ -18,6 +18,9 @@ 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; @@ -36,12 +39,10 @@ public interface TbShopUserService { /** * 商家后台 用户管理 * @param criteria 条件 - * @param pageable 分页参数 + * @return Map */ - Map queryShopUser(TbShopUserQueryCriteria criteria, Pageable pageable); - - Map queryAllShopUser(TbShopUserQueryCriteria criteria, Pageable pageable); + Map queryShopUser(TbShopUserQueryCriteria criteria); /** * 会员管理 diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/system/repository/DictRepository.java b/eladmin-system/src/main/java/cn/ysk/cashier/system/repository/DictRepository.java index 080f1c5c..75afaf42 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/system/repository/DictRepository.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/system/repository/DictRepository.java @@ -40,9 +40,10 @@ public interface DictRepository extends JpaRepository, JpaSpecificat void deleteByReleId(Integer releId); List findByReleId(Integer releId); + int countDictByReleId(Integer releId); @Modifying - @Query("update Dict dict set dict.isChild=1 where dict.id =:id") - void updateByReleId(@Param("id")Integer id); + @Query("update Dict dict set dict.isChild=:isChild where dict.id =:id") + void updateByReleId(@Param("id")Integer id,@Param("isChild")Integer isChild); /** * 查询 diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/system/service/impl/DictServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/system/service/impl/DictServiceImpl.java index 5705d9f5..5ea16256 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/system/service/impl/DictServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/system/service/impl/DictServiceImpl.java @@ -77,7 +77,7 @@ public class DictServiceImpl implements DictService { public void create(Dict resources) { resources.setIsChild(0); if (resources.getReleId() != null) { - dictRepository.updateByReleId(resources.getReleId()); + dictRepository.updateByReleId(resources.getReleId(), 1); } dictRepository.save(resources); } @@ -94,13 +94,19 @@ public class DictServiceImpl implements DictService { @Transactional(rollbackFor = Exception.class) public void delete(Set ids) { List dicts = dictRepository.findByIdIn(ids); + dictRepository.deleteByIdIn(ids); for (Dict dict : dicts) { - if (dict.getIsChild()==1) { + if (dict.getIsChild() == 1) { dictRepository.deleteByReleId(dict.getId()); + } else { + int x = dictRepository.countDictByReleId(dict.getReleId()); + if (x != 0) { + dictRepository.updateByReleId(dict.getReleId(), 0); + } } delCaches(dict); } - dictRepository.deleteByIdIn(ids); + } public void delCaches(Dict dict) { diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/thirdpay/resp/GroupOrderReturnResp.java b/eladmin-system/src/main/java/cn/ysk/cashier/thirdpay/resp/GroupOrderReturnResp.java new file mode 100644 index 00000000..cc2a8393 --- /dev/null +++ b/eladmin-system/src/main/java/cn/ysk/cashier/thirdpay/resp/GroupOrderReturnResp.java @@ -0,0 +1,22 @@ +package cn.ysk.cashier.thirdpay.resp; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class GroupOrderReturnResp implements Serializable { + + private String ifCode; + private String mchRefundNo; + private String mercNo; + private String note; + private Integer oriAmount; + private String oriPayOrderId; + private String payType; + private Integer refundAmt; + private String refundOrderId; + private String refundReason; + private Integer refundType; + private String state; +} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/vo/ShopUserInfoVo.java b/eladmin-system/src/main/java/cn/ysk/cashier/vo/ShopUserInfoVo.java index 00e22a01..e50ecdc3 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/vo/ShopUserInfoVo.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/vo/ShopUserInfoVo.java @@ -49,17 +49,21 @@ public class ShopUserInfoVo implements Serializable { } } - public ShopUserInfoVo(Integer id, String headImg, String nickName, Object sex, BigDecimal amount, Integer totalScore, String telephone, String birthDay, Integer isVip, long createAt, long lastLoginAt) { - this.id = id; - this.headImg = headImg; - this.nickName = nickName; - setSex(sex); - this.amount = amount; - this.totalScore = totalScore; - this.telephone = telephone; - this.birthDay = birthDay; - this.isVip = isVip; - this.createAt = createAt; - this.lastLoginAt = lastLoginAt; + // 无参构造函数 + public ShopUserInfoVo() { } + +// private ShopUserInfoVo(Integer id, String headImg, String nickName, Object sex, BigDecimal amount, Integer totalScore, String telephone, String birthDay, Integer isVip, long createAt, long lastLoginAt) { +// this.id = id; +// this.headImg = headImg; +// this.nickName = nickName; +// setSex(sex); +// this.amount = amount; +// this.totalScore = totalScore; +// this.telephone = telephone; +// this.birthDay = birthDay; +// this.isVip = isVip; +// this.createAt = createAt; +// this.lastLoginAt = lastLoginAt; +// } } \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/vo/TbProductVo.java b/eladmin-system/src/main/java/cn/ysk/cashier/vo/TbProductVo.java index a24ad4f2..6676cfb7 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/vo/TbProductVo.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/vo/TbProductVo.java @@ -1,6 +1,8 @@ package cn.ysk.cashier.vo; +import cn.ysk.cashier.dto.TbPlatformDictDto; import cn.ysk.cashier.dto.shop.TbCouponCategoryDto; +import cn.ysk.cashier.pojo.shop.TbPurchaseNotice; import com.alibaba.fastjson.JSONArray; import lombok.Data; import cn.ysk.cashier.pojo.product.TbProductSku; @@ -45,8 +47,7 @@ public class TbProductVo { private String coverImg; - @NotNull(message ="缺少商品类信息") - private String categoryId; + private Integer categoryId; private String categoryName; @@ -208,7 +209,7 @@ public class TbProductVo { private List skuList; - private HashMap specsInfo; + private HashMap specsInfo; private String specInfo; @@ -218,5 +219,7 @@ public class TbProductVo { private String skuSnap; + private TbPurchaseNotice notices=new TbPurchaseNotice(); private List groupCategoryId = new ArrayList<>(); + private List tags = new ArrayList<>(); }