| | |
| | | |
| | | |
| | | SHOP_ORDER(21,"消费返积分","会员${param}交易成功,获得${param1}积分",0,0),//${param}昵称-手机号 |
| | | SHOP_ORDER_CANCEL(22,"退单扣除","交易退款退回,消耗100积分",0,0), |
| | | SHOP_ORDER_CANCEL(22,"订单取消退回","订单取消退回,退回${param}积分",0,0), |
| | | SHOP_SYSTEM_RECHARGE(23,"积分发放","平台奖励,获得${param}积分",0,0), |
| | | SHOP_SYSTEM_DEDUCT(24,"积分扣除","平台扣减,消耗${param}积分",0,0), |
| | | |
| | |
| | | " where g.ISDELETED = 0 and g.id = #{id} ") |
| | | GoodsInfoResponse getGoodsInfo(@Param("id") Integer id); |
| | | |
| | | |
| | | @Select(" select g.* , gs.price as minPrice " + |
| | | " ifnull( ( select sgr.PRICE from shop_goods_relation sgr where sgr.GOODS_SKU_ID = gs.ID and sgr.ISDELETED = 0 and sgr.`STATUS` = 0 and sgr.SHOP_ID = #{shopId} ) ,0) as exFactoryPrice " + |
| | | " ifnull(( select sum(gd.NAME) from goodsorder_detail gd inner join goodsorder go on gd.ORDER_ID = go.id where gd.GOODS_SKU_ID = gs.`id` and go.DISTRIBUTION_SHOP_ID = 1 ),0) as realSaleNum " + |
| | | " from goods g left join goods_sku gs on g.id = gs.GOODS_ID " + |
| | | " ${ew.customSqlSegment} ") |
| | | IPage<GoodsInfoResponse> goodsPageForShop(IPage<GoodsRequest> page, @Param(Constants.WRAPPER) Wrapper wrapper,@Param("shopId") Integer shopId); |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "核销码", example = "1") |
| | | private String exchangeCode; |
| | | |
| | | @ApiModelProperty(value = "订单结算金额") |
| | | private BigDecimal shopSettlement; |
| | | |
| | | @ApiModelProperty(value = "文件地址") |
| | | @TableField(exist = false) |
| | | private String resourcePath; |
| | |
| | | @ApiModelProperty(value = "日期 ") |
| | | @TableField(exist = false) |
| | | private String everyDay; |
| | | |
| | | @ApiModelProperty(value = "订单结算金额") |
| | | @TableField(exist = false) |
| | | private BigDecimal shopSettlement; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "排序方式:0=综合排序;1=销量由低到高 ;2=价格由低到高;3=销量由高到低;4=价格由高到低") |
| | | private Integer sortInfo; |
| | | |
| | | @ApiModelProperty(value = "经销商主键") |
| | | private Integer shopId; |
| | | |
| | | @ApiModelProperty(value = "一级分类编码") |
| | | private Integer parentCategoryId; |
| | |
| | | * @create 2023/3/23 9:50 |
| | | */ |
| | | @Data |
| | | @ApiModel("我的客户请求类") |
| | | @ApiModel("我的客户返回类") |
| | | public class MyCustomerResponse { |
| | | |
| | | @ApiModelProperty(value = "用户头像") |
| | |
| | | @ApiModelProperty(value = "最低价") |
| | | private BigDecimal minPrice; |
| | | |
| | | @ApiModelProperty(value = "供货价") |
| | | private BigDecimal exFactoryPrice; |
| | | |
| | | @ApiModelProperty(value = "商品详情") |
| | | private String content; |
| | | |
| | |
| | | PageData<Integral> findIntegralRecordPage(PageWrap<IntegralRecordDTO> pageWrap); |
| | | |
| | | /** |
| | | * 获取用户剩余积分与待情况积分信息 |
| | | * 获取用户剩余积分与待清空积分信息 |
| | | * @param model |
| | | * @return |
| | | */ |
| | |
| | | * @param shopId |
| | | * @return |
| | | */ |
| | | SaleReportResponse saleReport(SaleReportRequest request, String shopId); |
| | | SaleReportResponse saleReport(SaleReportRequest request, Integer shopId); |
| | | |
| | | |
| | | String setGoodsPrice(Shop shop); |
| | |
| | | .eq("g.ISDELETED",Constants.ZERO) |
| | | .eq(!Objects.isNull(model) && Objects.nonNull(model.getCategoryId()), |
| | | "g.CATEGORY_ID", model.getCategoryId()) |
| | | |
| | | //TODO 适用品牌 适用系列 |
| | | // .eq(!Objects.isNull(model) && Objects.nonNull(model.getApplicableBrandId()), |
| | | // "","") |
| | | // .eq(!Objects.isNull(model) && Objects.nonNull(model.getSeriesBrandId()), |
| | | // "","") |
| | | |
| | | //适用品牌 适用系列 |
| | | .apply(!Objects.isNull(model) && Objects.nonNull(model.getApplicableBrandId()), |
| | | " find_in_set( '["+model.getApplicableBrandId()+"]' , g.BRAND_IDS ) ") |
| | | .apply(!Objects.isNull(model) && Objects.nonNull(model.getSeriesBrandId()), |
| | | " find_in_set( '["+model.getSeriesBrandId()+"]' , g.SERIAL_IDS ) ") |
| | | .eq("g.STATUS", Constants.ZERO) |
| | | .like(StringUtils.isNotBlank(model.getGoodsName()),"g.NAME",model.getGoodsName()); |
| | | |
| | |
| | | wrapper.orderByDesc("g.price"); |
| | | } |
| | | } |
| | | |
| | | // for(PageWrap.SortData sortData:pageWrap.getSorts1()){ |
| | | // if ("CREATE_DATE".equalsIgnoreCase(sortData.getProperty())){ |
| | | // if (PageWrap.ASC.equalsIgnoreCase(sortData.getDirection())){ |
| | | // wrapper.orderByAsc("g.CREATE_DATE"); |
| | | // } |
| | | // wrapper.orderByDesc("g.CREATE_DATE"); |
| | | // |
| | | // } |
| | | // if ("realSaleNum".equalsIgnoreCase(sortData.getProperty())){ |
| | | // |
| | | // if (PageWrap.ASC.equalsIgnoreCase(sortData.getDirection())){ |
| | | // wrapper.orderByAsc("realSaleNum"); |
| | | // } |
| | | // wrapper.orderByDesc("realSaleNum"); |
| | | // } |
| | | // if ("PRICE".equalsIgnoreCase(sortData.getProperty())){ |
| | | // if (PageWrap.ASC.equalsIgnoreCase(sortData.getDirection())){ |
| | | // wrapper.orderByAsc("g.PRICE"); |
| | | // } |
| | | // wrapper.orderByDesc("g.PRICE"); |
| | | // } |
| | | // |
| | | // } |
| | | |
| | | IPage<GoodsInfoResponse> page = goodsMapper.goodsPage(pageWrap.toPage(),wrapper); |
| | | IPage<GoodsInfoResponse> page = |
| | | Objects.isNull(model.getShopId())? |
| | | goodsMapper.goodsPage(pageWrap.toPage(),wrapper) |
| | | : |
| | | goodsMapper.goodsPageForShop(pageWrap.toPage(),wrapper,model.getShopId()) ; |
| | | if (!CollectionUtils.isEmpty(page.getRecords())){ |
| | | String preFixPath = systemDictDataBiz.getPreFixPath(Constants.RESOURCE_PATH, Constants.GOODS_FILE); |
| | | page.getRecords().forEach(s->s.setImgurl(preFixPath+s.getImgurl())); |
| | | |
| | | } |
| | | |
| | | |
| | | // if (pageWrap.getModel().getType().equals(Constants.TWO)) { |
| | | // for (GoodsInfoResponse goodsResponse : page.getRecords()) { |
| | | // //查询商品的分类 |
| | | // goodsResponse.setCategoryLabels(labelsMapper.selectById(goodsResponse.getCategoryId())); |
| | | // //查询商品的品牌 |
| | | // goodsResponse.setBrandLabels(labelsMapper.selectById(goodsResponse.getBrandId())); |
| | | // //查询商品的标签信息 |
| | | // if (StringUtils.isNotBlank(goodsResponse.getLabels())) { |
| | | // goodsResponse.setLabelsList(labelsMapper.selectList(new QueryWrapper<Labels>() |
| | | // .apply(" find_in_set( id, " + goodsResponse.getLabels().split(",") + " ) "))); |
| | | // } |
| | | // //查询是否已订阅 |
| | | // goodsResponse.setIsSubscribe(goodsorderDetailMapper.selectCount(new QueryWrapper<GoodsorderDetail>() |
| | | // .eq("CREATOR", pageWrap.getModel().getMemberId()) |
| | | // .apply(" GOODS_SKU_ID in ( SELECT g.id FROM goods_sku g where g.GOODS_ID = " + goodsResponse.getId() + " ) ") |
| | | // )); |
| | | // //sku基础信息 |
| | | // this.getSkuInfo(goodsResponse); |
| | | // } |
| | | // } |
| | | return page; |
| | | } |
| | | |
| | |
| | | import com.github.binarywang.wxpay.exception.WxPayException; |
| | | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import okhttp3.Address; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.checkerframework.checker.units.qual.C; |
| | |
| | | private ShopMapper shopMapper; |
| | | |
| | | @Autowired |
| | | private LabelsMapper labelsMapper; |
| | | |
| | | @Autowired |
| | | private ShopGoodsRelationMapper relationMapper; |
| | | |
| | | @Autowired |
| | |
| | | |
| | | @Autowired |
| | | private AreasService areasService; |
| | | |
| | | @Autowired |
| | | private AreasMapper areasMapper; |
| | | |
| | | @Autowired |
| | | private GoodsorderDetailJoinMapper goodsorderDetailJoinMapper; |
| | |
| | | member.setImgFullUrl(memberfullUrl + member.getImgurl()); |
| | | memberOrderResponse.setMember(member); |
| | | } |
| | | |
| | | return memberOrderResponse; |
| | | } |
| | | |
| | |
| | | //邮费金额 |
| | | if(Objects.nonNull(request.getReceiveType())){ |
| | | if(Constants.equalsInteger(request.getReceiveType(),Constants.ZERO)){ |
| | | if(Objects.nonNull(request.getAddressId())){ |
| | | Addr addr = addrMapper.selectById(request.getAddressId()); |
| | | if(Objects.isNull(addr)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到收货地址信息"); |
| | | } |
| | | Areas areas = areasMapper.selectOne(new QueryWrapper<Areas>().lambda() |
| | | .eq(Areas::getIsdeleted,Constants.ZERO) |
| | | .eq(Areas::getId,StringUtils.leftPad(addr.getAreaId().toString().substring(0,2),6,"0")) |
| | | .isNotNull(Areas::getYunFeeId) |
| | | .last(" limit 1 ") |
| | | ); |
| | | if(Objects.nonNull(areas)){ |
| | | Labels labels = labelsMapper.selectById(areas.getYunFeeId()); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | //TODO 根据收货地址 查询运费配置 |
| | | |
| | | |
| | | |
| | | //计算商品信息总重量 |
| | | BigDecimal totalWeight = goodsCalculateList.stream().map(i-> |
| | | i.getWeight().multiply(new BigDecimal(i.getGoodsNum().toString())) |
| | |
| | | |
| | | |
| | | @Override |
| | | public SaleReportResponse saleReport(SaleReportRequest request,String shopId){ |
| | | public SaleReportResponse saleReport(SaleReportRequest request,Integer shopId){ |
| | | SaleReportResponse saleReportResponse = new SaleReportResponse(); |
| | | saleReportResponse.setSaleTotal(BigDecimal.ZERO); |
| | | saleReportResponse.setOrderNum(Constants.ZERO); |
| | |
| | | .selectAll(Goodsorder.class) |
| | | .selectAs(Member::getPhone,Goodsorder::getPhone) |
| | | .selectAs(Member::getNickname,Goodsorder::getNickName) |
| | | .select(" select ifnull(sum(g.SHOP_SETTLEMENT),0) from goodsorder_detail g where t.id = g.ORDER_ID ",Goodsorder::getShopSettlement) |
| | | .leftJoin(Member.class,Member::getId,Goodsorder::getMemberId) |
| | | .eq(Goodsorder::getIsdeleted,Constants.ZERO) |
| | | .eq(Goodsorder::getDistributionShopId,shopId) |
| | |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.Shop; |
| | | import com.doumee.dao.business.model.WithdrawRecord; |
| | | import com.doumee.dao.web.dto.ShopLoginDTO; |
| | | import com.doumee.dao.web.dto.shop.*; |
| | | import com.doumee.dao.web.request.MyCustomerRequest; |
| | | import com.doumee.dao.web.request.SaleReportRequest; |
| | | import com.doumee.dao.web.request.WithdrawApplyRequest; |
| | | import com.doumee.dao.web.response.AccountResponse; |
| | | import com.doumee.dao.web.response.MyCustomerResponse; |
| | | import com.doumee.dao.web.response.SaleReportResponse; |
| | | import com.doumee.dao.web.response.ShopInfoResponse; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | |
| | | |
| | | @LoginShopRequired |
| | | @ApiOperation(value = "提现申请 - 经销商", notes = "小程序端") |
| | | @ApiOperation(value = "经销商 - 提现申请", notes = "小程序端") |
| | | @PostMapping("/withdrawApply") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), |
| | |
| | | |
| | | |
| | | @LoginShopRequired |
| | | @ApiOperation("查询提现申请详情") |
| | | @ApiOperation("经销商 - 查询提现申请详情") |
| | | @GetMapping("/withdrawDetail") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), |
| | |
| | | } |
| | | |
| | | |
| | | @ApiOperation("经销商 - 账号密码登录") |
| | | @PostMapping("/shopPasswordLogin") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), |
| | | }) |
| | | public ApiResponse<AccountResponse> shopPasswordLogin(@RequestBody ShopLoginDTO dto) { |
| | | return ApiResponse.success(shopService.shopPasswordLogin(dto)); |
| | | } |
| | | |
| | | @ApiOperation("经销商 - 静默登录") |
| | | @PostMapping("/shopOpenidLogin") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), |
| | | }) |
| | | public ApiResponse<AccountResponse> shopOpenidLogin(@RequestBody ShopLoginDTO dto) { |
| | | return ApiResponse.success(shopService.shopOpenidLogin(dto)); |
| | | } |
| | | |
| | | @LoginShopRequired |
| | | @ApiOperation("经销商 - 店铺详情") |
| | | @GetMapping("/getShopInfo") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), |
| | | }) |
| | | public ApiResponse<ShopInfoResponse> getShopInfo() { |
| | | return ApiResponse.success(shopService.getShopInfo(getShopId())); |
| | | } |
| | | |
| | | |
| | | @LoginShopRequired |
| | | @ApiOperation("经销商 - 我的客户信息") |
| | | @GetMapping("/myCustomer") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), |
| | | }) |
| | | public ApiResponse<List<MyCustomerResponse>> myCustomer(MyCustomerRequest request) { |
| | | return ApiResponse.success(shopService.myCustomer(request,getShopId())); |
| | | } |
| | | |
| | | @LoginShopRequired |
| | | @ApiOperation("经销商 - 销售明细") |
| | | @GetMapping("/saleReport") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), |
| | | }) |
| | | public ApiResponse<SaleReportResponse> saleReport(SaleReportRequest request) { |
| | | return ApiResponse.success(shopService.saleReport(request,getShopId())); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @RequestMapping("/web/goods") |
| | | @Slf4j |
| | | public class GoodsApi extends ApiController { |
| | | // @LoginRequired |
| | | |
| | | |
| | | @ApiOperation("商品列表") |
| | | @PostMapping("/goodsPage") |
| | | @ApiImplicitParams({ |
| | |
| | | return ApiResponse.success("查询成功",page); |
| | | } |
| | | |
| | | // @LoginRequired |
| | | @ApiOperation("商品详情") |
| | | @GetMapping("/goodsInfo") |
| | | @ApiImplicitParams({ |
| | |
| | | return ApiResponse.success(integralService.findIntegralRecordPage(pageWrap)); |
| | | } |
| | | |
| | | |
| | | @LoginRequired |
| | | @ApiOperation("获取用户剩余积分与待情况积分信息") |
| | | @ApiOperation("获取用户剩余积分与待清空积分信息") |
| | | @PostMapping("/getIntegralData") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), |