| | |
| | | @ApiOperation("æ ¹æ®IDä¿®æ¹") |
| | | @PostMapping("/updateById") |
| | | @RequiresPermissions("business:shop:update") |
| | | public ApiResponse updateById(@RequestBody Shop shop) { |
| | | public ApiResponse updateById(@RequestBody Shop shop) throws Exception { |
| | | shopService.updateById(shop); |
| | | return ApiResponse.success(null); |
| | | } |
| | |
| | | |
| | | import cn.binarywang.wx.miniapp.bean.WxMaCodeLineColor; |
| | | import com.doumee.core.wx.WxMiniConfig; |
| | | import com.doumee.dao.business.model.Areas; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import java.io.ByteArrayInputStream; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.net.URLDecoder; |
| | | import java.util.*; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | |
| | | @Slf4j |
| | | public class Constants { |
| | |
| | | ORDER_DONE_AMOUNT(16,"订åç»ç®","${param1}订åç»ç®æåï¼è·å¾ï¿¥${param}",0,1),//${param}订åç¼å·ï¼${param1}éé¢ |
| | | WITHDRAW_APPLY(17,"ä½é¢æç°","ä½é¢æç°å·²æäº¤ï¼æ¶èï¿¥${param}",0,1), |
| | | WITHDRAW_APPLY_BACK(19,"æç°éå","ä½é¢æç°å¤±è´¥ï¼è·å¾ï¿¥${param}",0,1), |
| | | // ORDER_DONE_AMOUNT_BACK(20,"订åç»ç®éå","${param1}订åç»ç®éåï¼æ¶èï¿¥${param}å
",0,1),//${param}订åç¼å·ï¼${param1}éé¢ |
| | | SHOP_ORDER_REFUND_CASH(25,"订å鿬¾","${param1}订å鿬¾ï¼æ£é¤ç»ç®éé¢ï¿¥${param}",0,0), |
| | | |
| | | |
| | |
| | | // åºæ¯ç ï¼ä¸å端约å®ï¼æç»æ¯éè¦å端解æ |
| | | body.put("scene", scene); |
| | | // æ£å¼ç为 "release"ï¼ä½éªç为 "trial"ï¼å¼åç为 "develop"ãé»è®¤æ¯æ£å¼çã |
| | | String env_version = "release"; |
| | | String env_version = "develop"; |
| | | body.put("env_version", env_version); |
| | | if(isUsePage){ |
| | | body.put("page", page); |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public static String getBankInfo(String bankName, String bankAccount){ |
| | | return bankName + "("+ |
| | | bankAccount. |
| | | replaceAll("^.*(.{4})$", "$1") |
| | | + ")"; |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * çæå享å¾ç |
| | | * @param headImg 头é¨å¾ç |
| | | * @param wxQrCodeImg 微信å°ç¨åºäºç»´ç |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static InputStream generateShopImg(String headImg,InputStream wxQrCodeImg) throws Exception { |
| | | BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); |
| | | //å¾å°å®çç»å¶ç¯å¢(è¿å¼ å¾ççç¬) |
| | | Graphics2D g2 = (Graphics2D) bi.getGraphics(); |
| | | g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON); |
| | | g2.fillRect(0, 0, width, height); |
| | | |
| | | //èæ¯å¾ç |
| | | // BufferedImage titles = ImageIO.read(new URL(bg)); |
| | | // g2.drawImage(titles, 1, 1, 894, 1305, null); |
| | | // g2.drawRect(0, 0, width - 1, height - 1); |
| | | //头é¨å¾ç |
| | | BufferedImage headBg = ImageIO.read(new URL(headImg)); |
| | | // BufferedImage headBg = getImgIO(imgurl); |
| | | g2.drawImage(headBg, 1, 1, 894, 1080, null); |
| | | g2.drawRect(0, 0, width - 1, height - 1); |
| | | |
| | | g2.setColor(Color.black); |
| | | g2.setFont(new Font("é»ä½", Font.PLAIN, 40)); |
| | | g2.drawString("é¿æè¯å«å°ç¨åº", 46, 1180); |
| | | |
| | | g2.setColor(Color.gray); |
| | | g2.setFont(new Font("é»ä½", Font.PLAIN, 32)); |
| | | g2.drawString("æ¥çæ´å¤ç²¾å½©å
容", 48, 1230); |
| | | |
| | | //设置äºç»´ç å¾ç |
| | | // BufferedImage barcodeCode = ImageIO.read(new URL(wxQrCodeImg)); |
| | | BufferedImage barcodeCode = getImgIO(wxQrCodeImg); |
| | | g2.drawImage(barcodeCode, 670, 1100, 180, 180,null); |
| | | g2.drawRect(0, 0, width - 1, height - 1); |
| | | InputStream inputStream = bufferedImageToInputStream(bi); |
| | | return inputStream; |
| | | // String fileName = "8701EAC36DEC405A94C530F0E6796589.jpg"; //ID.nextGUID() + ".jpg"; |
| | | // GeneratePicUtil.saveFile(inputStream, filePath+ File.separator+fileName); |
| | | // return filePath + File.separator+ fileName; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * å¾ç设置åè§ |
| | | * @param srcImage |
| | | * @return |
| | |
| | | |
| | | |
| | | @Select(" select g.* , " + |
| | | "(( select sum(gd.goods_num) from goodsorder_detail gd inner join goods_sku gs on gd.GOODS_SKU_ID = gs.id where gs.GOODS_ID = g.`id` )+ g.SALENUM) as realSaleNum ," + |
| | | "(( select count(1) from goodsorder_detail gd inner join goods_sku gs on gd.GOODS_SKU_ID = gs.id where gs.GOODS_ID = g.`id` )+ g.SALENUM) as realSaleNum ," + |
| | | //"( select gs.id from goods_sku gs where gs.GOODS_ID = g.id limit 1 ) as realSaleNum ," + |
| | | " ifnull(( select min(gs.PRICE) from goods_sku gs where gs.GOODS_ID = g.id ),0) as minPrice " + |
| | | " from goods g " + |
| | |
| | | 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.goods_num) from goodsorder_detail gd left 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 " + |
| | | @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 = #{shopId} ),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); |
| | |
| | | * @param goodsId |
| | | * @return |
| | | */ |
| | | @Select(" select s.* , g.IMGURL as goodsImgUrl from goods_sku s left join goods g on s.GOODS_ID = g.id where s.goods_Id = #{goodsId} ") |
| | | @Select(" select s.* , g.IMGURL as goodsImgUrl from goods_sku s left join goods g on s.GOODS_ID = g.id where s.isdeleted = 0 and s.goods_Id = #{goodsId} ") |
| | | List<GoodsSkuResponse> getSkuResponseList(@Param("goodsId") Integer goodsId); |
| | | |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | private Integer zanCount; |
| | | |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦ç¹èµï¼0=å¦ï¼1=æ¯") |
| | | @TableField(exist = false) |
| | | private Integer zanStatus; |
| | |
| | | private String content; |
| | | |
| | | |
| | | @ApiModelProperty(value = "社åºå°é¢å¾") |
| | | @TableField(exist = false) |
| | | private String activityImgurl; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | private Date endtime; |
| | | |
| | | @ApiModelProperty(value = "交æç±»å") |
| | | @TableField(exist = false) |
| | | @ExcelColumn(name="交æç±»å",index =5,width = 10) |
| | | private String strObjType; |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "æç°ç¶æ:ï¼0=审æ¹ä¸ï¼1=审æ¹éè¿ï¼2=审æ¹é©³å") |
| | | private Integer withdrawStatus; |
| | | |
| | | |
| | | @ApiModelProperty(value = "æ»æ¶å
¥ ") |
| | | @TableField(exist = false) |
| | | private BigDecimal inAmount; |
| | | @ApiModelProperty(value = "æ»æ¯åº ") |
| | | @TableField(exist = false) |
| | | private BigDecimal outAmount; |
| | | |
| | | |
| | | |
| | | |
| | | // public static Integral createIntegral(Integer memberId, Constants.INTEGRAL_TYPE integralType,Integer objId){ |
| | | // Integral integral = new Integral(); |
| | |
| | | @ExcelColumn(name="积å累计è·å¾",width = 10,index = 6) |
| | | private BigDecimal totalIntegral; |
| | | |
| | | @ApiModelProperty(value = "ç¶æ0æ£å¸¸ 1å¼å¸¸", example = "1") |
| | | @ApiModelProperty(value = "ç¶æ0æ£å¸¸ 1å¼å¸¸ 2注é", example = "1") |
| | | @ExcelColumn(name="ç¶æ",width = 10,index =9,valueMapping = "0=å¯ç¨;1=ç¦ç¨") |
| | | private Integer status; |
| | | |
| | |
| | | package com.doumee.dao.business.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.doumee.core.annotation.excel.ExcelColumn; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | @ExcelColumn(name="æ¯å¦é»è®¤ 0å¦ 1æ¯") |
| | | private Integer isDefault; |
| | | |
| | | |
| | | @ApiModelProperty(value = "é¶è¡åç§°ä¿¡æ¯") |
| | | @TableField(exist = false) |
| | | private String bankInfo; |
| | | |
| | | |
| | | } |
| | |
| | | @ExcelColumn(name="é¶è¡åç§°") |
| | | private String bankName; |
| | | |
| | | |
| | | |
| | | @ApiModelProperty(value = "é¶è¡è´¦æ·") |
| | | @ExcelColumn(name="é¶è¡è´¦æ·") |
| | | private String bankAccount; |
| | |
| | | @ApiModelProperty(value = "ç»ææ¶é´ ") |
| | | @TableField(exist = false) |
| | | private Date endtime; |
| | | |
| | | @ApiModelProperty(value = "é¶è¡åç§°ä¿¡æ¯") |
| | | @TableField(exist = false) |
| | | private String bankInfo; |
| | | } |
| | |
| | | package com.doumee.dao.web.dto; |
| | | |
| | | import com.doumee.core.annotation.excel.ExcelColumn; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @ApiModelProperty(value = "æ°æ®ç±»åï¼0=æ¶è´¹è
积åï¼1=ç»éå积åï¼2=ç»éåç»ç®éé¢ï¼") |
| | | private Integer userType; |
| | | |
| | | @ApiModelProperty(value = "è·åç±»åï¼16=订åç»ç®ï¼17=ä½é¢æç°ï¼19=æç°éåï¼25=订å鿬¾ï¼") |
| | | private Integer objType; |
| | | |
| | | @ApiModelProperty(value = "ç¨æ·ä¸»é®æåæ·ä¸»é®",hidden = true) |
| | | private Integer memberId; |
| | | |
| | | |
| | | @ApiModelProperty(value = "å¼å§æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private String startDate; |
| | | |
| | | @ApiModelProperty(value = "ç»ææ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private String endDate; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | private Integer memberId; |
| | | |
| | | @ApiModelProperty(value = "ç¨æ·æµç§°" ) |
| | | private String memberNikeName; |
| | | private String nikeName; |
| | | |
| | | @ApiModelProperty(value = "ç¨æ·æµç§°" ) |
| | | private String memberImgUrl; |
| | |
| | | @ApiModel("å°ç¨åº éæ©åæ·è¯·æ±ç±»") |
| | | public class ShopListDTO { |
| | | |
| | | @ApiModelProperty(value = "åå¸ä¸»é®", example = "1") |
| | | private Integer cityId; |
| | | @ApiModelProperty(value = "åå¸åç§°", example = "1") |
| | | private String cityName; |
| | | @ApiModelProperty(value = "å®ä½ç»´åº¦", example = "1") |
| | | private String lat; |
| | | @ApiModelProperty(value = "å®ä½ç»åº¦", example = "1") |
| | |
| | | |
| | | |
| | | @ApiModelProperty(value = "é请ç ") |
| | | private String recId; |
| | | private Integer recId; |
| | | |
| | | @ApiModelProperty(value = "忷䏻é®") |
| | | private Integer shopId; |
| | | } |
| | |
| | | @ApiModelProperty(value = "伿 å¸ä¸»é®", example = "1") |
| | | private Integer couponId; |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦ä½¿ç¨ç§¯å", example = "1") |
| | | @ApiModelProperty(value = "æ¯å¦ä½¿ç¨ç§¯åï¼0=å¦ï¼1=æ¯ï¼", example = "1") |
| | | private Integer useIntegral; |
| | | |
| | | @ApiModelProperty(value = "ç¨æ·ä¸»é®" ,hidden = true) |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.web.response; |
| | | |
| | | import com.doumee.dao.business.model.Member; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * Created by IntelliJ IDEA. |
| | | * |
| | | * @Author : Rk |
| | | * @create 2023/3/23 9:25 |
| | | */ |
| | | @Data |
| | | @ApiModel("æ¶èæ°éè¿åä¿¡æ¯") |
| | | public class CollectResponse implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "ååæ°é") |
| | | private Long goodsNum; |
| | | |
| | | @ApiModelProperty(value = "ç¤¾åºæ°é") |
| | | private Long activityNum; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "积å说æ") |
| | | private String info; |
| | | |
| | | @ApiModelProperty(value = "å·²æç°ä½é¢") |
| | | private BigDecimal withdrawAmount; |
| | | |
| | | @ApiModelProperty(value = "å¾
ç»ç®ä½é¢") |
| | | private BigDecimal waitPayAmount; |
| | | |
| | | @ApiModelProperty(value = "æç°ä¸ä½é¢") |
| | | private BigDecimal withdrawIngAmount; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "çå¸åº") |
| | | private Areas areas; |
| | | |
| | | @ApiModelProperty(value = "坿ç°ä½é¢") |
| | | private BigDecimal amount; |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "æ¶èç¶æï¼0=æªæ¶èï¼1=å·²æ¶è") |
| | | private Integer collectStatus; |
| | | |
| | | @ApiModelProperty(value = "éç¨åçIDéåï¼ï¼[1],[2]ï¼") |
| | | private String brandIds ; |
| | | |
| | | @ApiModelProperty(value = "éç¨åçåç§°") |
| | | private String brandNames ; |
| | | |
| | | // @ApiModelProperty(value = "ååæ ç¾") |
| | | // private List<Labels> labelsList; |
| | |
| | | private BigDecimal skuAmount; |
| | | |
| | | @ApiModelProperty(value = "skuå®ä»æ»éé¢") |
| | | private BigDecimal skuPayAmount; |
| | | private BigDecimal skuPayAmount = BigDecimal.ZERO; |
| | | |
| | | @ApiModelProperty(value = "skuId") |
| | | private Integer skuId; |
| | | |
| | | @ApiModelProperty(value = "订åä¸ä¼æ å¸éé¢å æ¯", hidden = true) |
| | | private BigDecimal orderCouponRata; |
| | | private BigDecimal orderCouponRata = BigDecimal.ZERO; |
| | | |
| | | @ApiModelProperty(value = "伿 叿µæ£éé¢", hidden = true) |
| | | private BigDecimal couponDeductCash; |
| | | private BigDecimal couponDeductCash = BigDecimal.ZERO; |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦å¯ä»¥ä½¿ç¨ä¼æ å¸", hidden = true) |
| | | private Boolean useCoupon; |
| | | |
| | | |
| | | |
| | | @ApiModelProperty(value = "skuå¾ç") |
| | | private String skuImg; |
| | | |
| | | @ApiModelProperty(value = "积åæå¤§å¯æµæ£éé¢", hidden = true) |
| | | private BigDecimal integralMaxDeductCash; |
| | | private BigDecimal integralMaxDeductCash = BigDecimal.ZERO; |
| | | |
| | | @ApiModelProperty(value = "积åå®é
æµæ£éé¢", hidden = true) |
| | | private BigDecimal integralDeductCash; |
| | | |
| | | private BigDecimal integralDeductCash = BigDecimal.ZERO; |
| | | |
| | | @ApiModelProperty(value = "å®é
使ç¨ç§¯å", hidden = true) |
| | | private BigDecimal integralDeduct; |
| | | private BigDecimal integralDeduct = BigDecimal.ZERO; |
| | | |
| | | @ApiModelProperty(value = "订åä¸ç§¯åéé¢å®é
å æ¯", hidden = true) |
| | | private BigDecimal orderIntegralRata; |
| | | |
| | | |
| | | private BigDecimal orderIntegralRata = BigDecimal.ZERO; |
| | | |
| | | @ApiModelProperty(value = "åºåé") |
| | | private BigDecimal stockNum; |
| | |
| | | @ApiModelProperty(value = "å©ä½ç§¯åå¼", example = "1") |
| | | private BigDecimal surplusIntegral; |
| | | |
| | | |
| | | |
| | | |
| | | @ApiModelProperty(value = "é®è´¹éé¢", example = "1") |
| | | private BigDecimal mailAmount; |
| | | |
| | |
| | | import com.doumee.dao.business.model.Collect; |
| | | import com.doumee.dao.web.dto.CollectDTO; |
| | | import com.doumee.dao.web.request.CollectSaveRequest; |
| | | import com.doumee.dao.web.response.CollectResponse; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | |
| | | void saveCollect(CollectSaveRequest request, Integer memberId); |
| | | |
| | | List<Collect> myCollect(Integer memberId,Integer type); |
| | | PageData<Collect> myCollectPage(PageWrap<Collect> pageWrap,Integer memberId); |
| | | |
| | | CollectResponse getCollectNum(Integer memberId); |
| | | } |
| | |
| | | |
| | | InviteInfoResponse getInviteInfo(Integer memberId); |
| | | |
| | | String createShareImg(Integer userType,Integer memberId) throws Exception; |
| | | String createShareImg(Integer userType,Integer memberId,String posterImg) throws Exception; |
| | | |
| | | String createShopMiniProgramCode(Integer shopId) throws Exception; |
| | | /** |
| | |
| | | void logOut(String token,Integer memberId); |
| | | |
| | | void logOff(String token,Integer memberId); |
| | | |
| | | void bindShopInfo(Integer memberId,Integer recId); |
| | | } |
| | |
| | | * |
| | | * @param shop å®ä½å¯¹è±¡ |
| | | */ |
| | | void updateById(Shop shop); |
| | | void updateById(Shop shop) throws Exception; |
| | | |
| | | void updateIsRecById(Shop shop); |
| | | |
| | |
| | | * |
| | | * @param shops å®ä½é |
| | | */ |
| | | void updateByIdInBatch(List<Shop> shops); |
| | | // void updateByIdInBatch(List<Shop> shops); |
| | | |
| | | /** |
| | | * æ¯æç»´æ¤åºéºä¿¡æ¯ |
| | |
| | | * @param request |
| | | * @param integralService |
| | | */ |
| | | void withdrawApply(WithdrawApplyRequest request, IntegralService integralService); |
| | | Integer withdrawApply(WithdrawApplyRequest request, IntegralService integralService); |
| | | } |
| | |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.web.dto.CollectDTO; |
| | | import com.doumee.dao.web.request.CollectSaveRequest; |
| | | import com.doumee.dao.web.request.ShopOrderRequest; |
| | | import com.doumee.dao.web.response.CollectResponse; |
| | | import com.doumee.service.business.CollectService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | |
| | | |
| | | |
| | | @Override |
| | | public List<Collect> myCollect(Integer memberId,Integer type){ |
| | | List<Collect> collectList = new ArrayList<>(); |
| | | if(Constants.equalsInteger(type,Constants.ZERO)){ |
| | | collectList = collectMapper.selectJoinList(Collect.class,new MPJLambdaWrapper<Collect>() |
| | | public PageData<Collect> myCollectPage(PageWrap<Collect> pageWrap,Integer memberId){ |
| | | IPage<Collect> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | Collect model = pageWrap.getModel(); |
| | | if(Constants.equalsInteger(model.getObjType(),Constants.ONE)){ |
| | | IPage<Collect> result = collectMapper.selectJoinPage(page, Collect.class, new MPJLambdaWrapper<Collect>() |
| | | .selectAll(Collect.class) |
| | | .selectAs(Goods::getName,Collect::getName) |
| | | .selectAs(Goods::getPrice,Collect::getPrice) |
| | | .selectAs(Goods::getImgurl,Collect::getImgurl) |
| | | .selectAs(Goods::getImgurl,Collect::getActivityImgurl) |
| | | .select(" ifnull(( select min(gs.PRICE) from goods_sku gs where gs.GOODS_ID = t1.id ),0) ", Collect::getLinePrice) |
| | | .leftJoin(Goods.class,Goods::getId,Collect::getObjId) |
| | | .eq(Collect::getIsdeleted,Constants.ZERO) |
| | | .eq(Collect::getMemberId,memberId) |
| | | .eq(Collect::getObjType,type) |
| | | .orderByDesc(Collect::getId) |
| | | ); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(collectList)){ |
| | | .eq(Collect::getObjType,Constants.ONE) |
| | | .orderByDesc(Collect::getId)); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(result.getRecords())){ |
| | | String preFixPath = systemDictDataBiz.getPreFixPath(Constants.RESOURCE_PATH, Constants.GOODS_FILE); |
| | | collectList.forEach(s->s.setImgurl(preFixPath+s.getImgurl())); |
| | | result.getRecords().forEach(s->s.setImgurl(StringUtils.isNotBlank(s.getActivityImgurl())?preFixPath+s.getActivityImgurl():null)); |
| | | } |
| | | return PageData.from(result); |
| | | }else{ |
| | | collectList = collectMapper.selectJoinList(Collect.class,new MPJLambdaWrapper<Collect>() |
| | | IPage<Collect> result = collectMapper.selectJoinPage(page, Collect.class, new MPJLambdaWrapper<Collect>() |
| | | .selectAll(Collect.class) |
| | | .selectAs(Activity::getName,Collect::getName) |
| | | .selectAs(Activity::getCreateDate,Collect::getReleaseDate) |
| | | .selectAs(Activity::getLooknum,Collect::getReadNum) |
| | | .selectAs(Activity::getImgurl,Collect::getImgurl) |
| | | .selectAs(Activity::getImgurl,Collect::getActivityImgurl) |
| | | .selectAs(Labels::getName,Collect::getLabelName) |
| | | .selectAs(Activity::getContent,Collect::getContent) |
| | | .leftJoin(Activity.class,Activity::getId,Collect::getObjId) |
| | | .leftJoin(Labels.class,Labels::getId,Activity::getLabelId) |
| | | .eq(Collect::getIsdeleted,Constants.ZERO) |
| | | .eq(Collect::getMemberId,memberId) |
| | | .eq(Collect::getObjType,type) |
| | | .orderByDesc(Collect::getId) |
| | | ); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(collectList)){ |
| | | .eq(Collect::getObjType,Constants.ZERO) |
| | | .orderByDesc(Collect::getId)); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(result.getRecords())){ |
| | | String preFixPath = systemDictDataBiz.getPreFixPath(Constants.RESOURCE_PATH, Constants.ACTIVITY_FILE); |
| | | collectList.forEach(s->s.setImgurl(preFixPath+s.getImgurl())); |
| | | collectList.stream().filter(s-> StringUtils.isNotBlank(s.getContent())).forEach(s->s.setContent(RichTextProcessor.extractPlainTextFromHtml(s.getContent()))); |
| | | result.getRecords().forEach(s->s.setImgurl(StringUtils.isNotBlank(s.getActivityImgurl())?preFixPath+s.getActivityImgurl():null)); |
| | | result.getRecords().stream().filter(s-> StringUtils.isNotBlank(s.getContent())).forEach(s->s.setContent(RichTextProcessor.extractPlainTextFromHtml(s.getContent()))); |
| | | } |
| | | return PageData.from(result); |
| | | } |
| | | return collectList; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public CollectResponse getCollectNum(Integer memberId){ |
| | | CollectResponse response = new CollectResponse(); |
| | | response.setGoodsNum( collectMapper.selectCount(new QueryWrapper<Collect>().lambda() |
| | | .eq(Collect::getObjType,Constants.ONE) |
| | | .eq(Collect::getMemberId,memberId) |
| | | )); |
| | | response.setActivityNum( collectMapper.selectCount(new QueryWrapper<Collect>().lambda() |
| | | .eq(Collect::getObjType,Constants.ZERO) |
| | | .eq(Collect::getMemberId,memberId) |
| | | )); |
| | | return response; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | target.setReplyId(reply.getId()); |
| | | target.setReplyMemberId(reply.getMemberId()); |
| | | target.setCommentId(reply.getId()); |
| | | target.setCommentMemberId(reply.getMemberId()); |
| | | target.setType(Constants.ONE); |
| | | } |
| | | |
| | |
| | | replyWrapper.selectAs(Comment::getCommentId,ActivityReplyCommentDTO::getCommentId); |
| | | replyWrapper.selectAs(Comment::getMemberId,ActivityReplyCommentDTO::getMemberId); |
| | | replyWrapper.selectAs(Comment::getContent,ActivityReplyCommentDTO::getContent); |
| | | replyWrapper.selectAs(Member::getNickname,ActivityReplyCommentDTO::getMemberNikeName); |
| | | replyWrapper.selectAs(Member::getNickname,ActivityReplyCommentDTO::getNikeName); |
| | | replyWrapper.selectAs(Member::getImgurl,ActivityReplyCommentDTO::getMemberImgUrl); |
| | | replyWrapper.selectCount(Comment::getId,ActivityReplyCommentDTO::getReplyCount); |
| | | replyWrapper.selectMin(Comment::getCreateDate,ActivityReplyCommentDTO::getCreateDate); |
| | |
| | | MPJLambdaWrapper<Comment> queryWrapper = new MPJLambdaWrapper<>(); |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | queryWrapper.selectAll(Comment.class); |
| | | queryWrapper.selectAs(Member::getNickname,ActivityReplyCommentDTO::getMemberNikeName); |
| | | queryWrapper.selectAs(Member::getNickname,ActivityReplyCommentDTO::getNikeName); |
| | | queryWrapper.selectAs(Member::getImgurl,ActivityReplyCommentDTO::getMemberImgUrl); |
| | | if(Objects.isNull(pageWrap.getModel().getMemberId())){ |
| | | queryWrapper.select(" 0 ",ActivityReplyCommentDTO::getZanStatus); |
| | |
| | | goodsMapper.goodsPageForShop(pageWrap.toPage(),wrapper,model.getShopId()) ; |
| | | if (!CollectionUtils.isEmpty(page.getRecords())){ |
| | | String preFixPath = systemDictDataBiz.getPreFixPath(Constants.RESOURCE_PATH, Constants.GOODS_FILE); |
| | | |
| | | |
| | | for (GoodsInfoResponse goodsInfoResponse:page.getRecords() |
| | | ) { |
| | | goodsInfoResponse.setImgurl(StringUtils.isNotBlank(goodsInfoResponse.getImgurl())?(preFixPath+goodsInfoResponse.getImgurl()):null); |
| | | if(Objects.isNull(model.getShopId())){ |
| | | //skuåºç¡ä¿¡æ¯ |
| | | this.getSkuInfo(goodsInfoResponse); |
| | | } |
| | | if(StringUtils.isNotBlank(goodsInfoResponse.getBrandIds())){ |
| | | List<Labels> allBrands = labelsMapper.selectList(new QueryWrapper<Labels>().lambda() |
| | | .in(Labels::getId,getNumIdByIdsString(goodsInfoResponse.getBrandIds())) |
| | | .eq(Labels::getType,Constants.LabelsType.APPLICABLE_BRAND.getKey()) |
| | | .eq(Labels::getIsdeleted,Constants.ZERO) |
| | | ); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(allBrands)){ |
| | | goodsInfoResponse.setBrandNames(String.join("/",allBrands.stream().map(i->i.getName()).collect(Collectors.toList()))); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if(StringUtils.isNotBlank(model.getGoodsName())&&Objects.nonNull(model.getMemberId())){ |
| | | searchHistoryMapper.delete(new QueryWrapper<SearchHistory>().lambda() |
| | | .eq(SearchHistory::getMemberId,model.getMemberId()) |
| | | .eq(SearchHistory::getContent,model.getGoodsName()) |
| | | ); |
| | | SearchHistory searchHistory = new SearchHistory(); |
| | | searchHistory.setIsdeleted(Constants.ZERO); |
| | | searchHistory.setContent(model.getGoodsName()); |
| | |
| | | goodsorder.setMemberId(member.getId()); |
| | | goodsorder.setType(Constants.ZERO); |
| | | goodsorder.setStatus(Constants.ZERO); |
| | | goodsorder.setReceiveType(orderPayRequest.getReceiveType()); |
| | | goodsorder.setCouponPrice(BigDecimal.ZERO); |
| | | Shop shop = null; |
| | | if(Constants.equalsInteger(orderPayRequest.getReceiveType(),Constants.ZERO)){ |
| | | //æ¥è¯¢æ¶è´§å°å |
| | |
| | | payConfirmRequest.setAddressId(orderPayRequest.getAddressId()); |
| | | payConfirmRequest.setMemberId(member.getId()); |
| | | payConfirmRequest.setCouponId(orderPayRequest.getCouponId()); |
| | | payConfirmRequest.setUseIntegral(orderPayRequest.getUseIntegral()); |
| | | //éè¿æ¯ä»ç¡®è®¤æ¥å£è·åçææ¯ä»ä¿¡æ¯ |
| | | OrderPayConfirmResponse orderPayConfirmResponse = this.orderPayConfirm(payConfirmRequest,memberCouponService); |
| | | if(Objects.isNull(orderPayConfirmResponse)){ |
| | |
| | | goodsorder.setIntegral(orderPayConfirmResponse.getIntegralAmount()); |
| | | goodsorder.setMailPrice(orderPayConfirmResponse.getMailAmount()); |
| | | goodsorder.setPayMethod(goodsorder.getPrice().compareTo(BigDecimal.ZERO)>Constants.ZERO?Constants.ZERO:Constants.ONE); |
| | | goodsorder.setGoodsNum(orderPayRequest.getPayDetailRequestList().stream().mapToInt(PayDetailRequest::getGoodsNum).sum()); |
| | | if(Objects.nonNull(orderPayConfirmResponse.getMemberCoupon())){ |
| | | sumPrice = sumPrice.subtract(orderPayConfirmResponse.getMemberCoupon().getPrice()); |
| | | goodsorder.setCouponId(orderPayConfirmResponse.getMemberCoupon().getId()); |
| | |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æ æç»æ°æ®,è¯·æ£æ¥éæ©æ°æ®ï¼"); |
| | | } |
| | | List<GoodsorderDetail> goodsOrderDetailList = new ArrayList<>(); |
| | | BigDecimal shopSettlement = BigDecimal.ZERO; |
| | | for (OrderGoodsCalculateResponse payDetailRequest:goodsCalculateList) { |
| | | //æ¥è¯¢åå |
| | | GoodsSku goodsSku = goodsSkuMapper.selectById(payDetailRequest.getSkuId()); |
| | |
| | | goodsOrderDetail.setCouponDeduct(payDetailRequest.getCouponDeductCash()); |
| | | goodsOrderDetail.setIntegralDeduct(payDetailRequest.getIntegralDeductCash()); |
| | | goodsOrderDetail.setOrderId(goodsorder.getId()); |
| | | goodsOrderDetail.setGoodsId(goodsSku.getGoodsId()); |
| | | |
| | | //夿é¨åºæ¯å¦è®¾ç½®ååçä»·æ ¼ä¿¡æ¯ |
| | | if(Objects.nonNull(goodsorder.getDistributionShopId())){ |
| | |
| | | if(Objects.isNull(shopGoodsRelation)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对ä¸èµ·ï¼ç»éåæªç»å®["+goods.getName()+"]ååï¼è¯·è系管çåï¼"); |
| | | } |
| | | |
| | | PlatformConfigDTO platformConfigDTO = systemDictDataService.getPlatformConfigDTO(); |
| | | //ç»éå伿 æ¿æ
å æ¯ |
| | | BigDecimal shopRate = new BigDecimal("100").subtract(platformConfigDTO.getTotalRate()); |
| | |
| | | if(shop.getSaleType().equals(Constants.ONE)){ |
| | | goodsOrderDetail.setShopSettlement(goodsOrderDetail.getPrice().subtract(shopDeductAmount)); |
| | | }else { |
| | | //å¹³å°éºè´§ |
| | | goodsOrderDetail.setShopSettlement( |
| | | shopGoodsRelation.getPrice().subtract(shopGoodsRelation.getPrice()).subtract(shopDeductAmount)); |
| | | goodsOrderDetail.getPrice() |
| | | .subtract(shopGoodsRelation.getPrice()) |
| | | .subtract(shopDeductAmount)); |
| | | } |
| | | if(goodsOrderDetail.getShopSettlement().compareTo(BigDecimal.ZERO)<Constants.ZERO){ |
| | | goodsOrderDetail.setShopSettlement(BigDecimal.ZERO); |
| | |
| | | }else{ |
| | | goodsOrderDetail.setShopSettlement(BigDecimal.ZERO); |
| | | } |
| | | shopSettlement = shopSettlement.add(goodsOrderDetail.getShopSettlement()); |
| | | goodsOrderDetailList.add(goodsOrderDetail); |
| | | //å é¤è´ç©è½¦åå |
| | | shopcartMapper.delete(new QueryWrapper<Shopcart>().lambda() |
| | | .eq(Shopcart::getMemberId,member.getId()) |
| | | .eq(Shopcart::getGoodsSkuId,goodsOrderDetail.getGoodsSkuId()) |
| | | ); |
| | | } |
| | | if(CollectionUtils.isNotEmpty(goodsOrderDetailList)){ |
| | | goodsorderDetailMapper.insert(goodsOrderDetailList); |
| | | } |
| | | //积ååå¨è®°å½ |
| | | if(goodsorder.getUseIntegral().compareTo(BigDecimal.ZERO)>Constants.ZERO){ |
| | |
| | | if(goodsorder.getPrice().compareTo(orderPayRequest.getTitlePrice())!=Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"ååä»·æ ¼åçååï¼è¯·å·æ°åéæ°æ¯ä»ï¼"); |
| | | } |
| | | |
| | | |
| | | //åå¨ç°éæ¯ä» |
| | | if(Constants.equalsInteger(goodsorder.getPayMethod(),Constants.ZERO)){ |
| | | return this.wxPay(goodsorder,member); |
| | |
| | | //æ ç°éæ¯ä» |
| | | goodsorderMapper.update(null,new UpdateWrapper<Goodsorder>().lambda() |
| | | .set(Goodsorder::getStatus,Constants.ONE) |
| | | .set(Goodsorder::getShopSettlement,shopSettlement) |
| | | .set(Goodsorder::getPayStatus,Constants.OrderStatus.PAY_DONE.getKey()) |
| | | .set(Goodsorder::getPayDate,DateUtil.getCurrDateTime()) |
| | | .set(Goodsorder::getId,goodsorder.getId()) |
| | |
| | | request.setBody("å¹³å°åå"); |
| | | request.setAttach("shopGoods"); |
| | | request.setOutTradeNo(goodsorder.getCode().toString()); |
| | | request.setTotalFee(BaseWxPayRequest.yuanToFen(goodsorder.getPrice().toString())); |
| | | request.setTotalFee(1);//BaseWxPayRequest.yuanToFen(goodsorder.getPrice().toString())); |
| | | // request.setTotalFee(2); |
| | | request.setTimeStart(DateUtil.DateToString(new Date(), "yyyyMMddHHmmss")); |
| | | request.setSpbillCreateIp(this.getIpAddr()); |
| | |
| | | fundMapper.insert(fund); |
| | | } |
| | | //订åå·²æ¯ä»ç¶æ ï¼ ä½¿ç¨äºç§¯å ä¸ç§¯å使ç¨å¤§äº0 |
| | | if(goodsorder.getIntegral().compareTo(BigDecimal.ZERO)>Constants.ZERO |
| | | &&Constants.equalsInteger(goodsorder.getStatus(),Constants.OrderStatus.PAY_DONE.getKey())){ |
| | | if(goodsorder.getIntegral().compareTo(BigDecimal.ZERO)>Constants.ZERO){ |
| | | //æ´æ°ä½é¢ä¿¡æ¯ æ·»å 积ååå¨è®°å½ |
| | | DealIntegralRequest dealIntegralRequest = new DealIntegralRequest(); |
| | | dealIntegralRequest.setIntegralNum(goodsorder.getIntegral()); |
| | |
| | | memberCouponMapper.updateById(memberCoupon); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | public BigDecimal getDeductAmount(List<PayDetailRequest> requestList){ |
| | |
| | | OrderPayConfirmResponse orderPayConfirmResponse = new OrderPayConfirmResponse(); |
| | | List<Goods> goodsList = goodsMapper.selectJoinList(Goods.class, |
| | | new MPJLambdaWrapper<Goods>() |
| | | .selectAll(Goods.class) |
| | | .selectAs(GoodsSku::getPrice,Goods::getSkuPrice) |
| | | .selectAs(GoodsSku::getId,Goods::getSkuId) |
| | | .selectAs(GoodsSku::getIntegralRate,Goods::getDeductRata) |
| | |
| | | if(CollectionUtils.isEmpty(goodsList)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"æªå¹é
å°ååä¿¡æ¯"); |
| | | } |
| | | List<OrderGoodsCalculateResponse> goodsCalculateList = ListUtil.copyProperties(goodsList,OrderGoodsCalculateResponse::new); |
| | | |
| | | List<OrderGoodsCalculateResponse> goodsCalculateList = ListUtil.copyProperties(goodsList,OrderGoodsCalculateResponse::new); |
| | | String fullUrl = systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode()+ |
| | | systemDictDataBiz.queryByCode(Constants.OSS,Constants.GOODS_FILE).getCode(); |
| | | for (OrderGoodsCalculateResponse orderGoodsCalculateResponse:goodsCalculateList) { |
| | | orderGoodsCalculateResponse.setSkuImg(StringUtils.isNotBlank(orderGoodsCalculateResponse.getSkuImg())?fullUrl+orderGoodsCalculateResponse.getSkuImg():null); |
| | | if(Objects.isNull(orderGoodsCalculateResponse.getCouponDeductCash())){ |
| | | orderGoodsCalculateResponse.setCouponDeductCash(BigDecimal.ZERO); |
| | | } |
| | | // orderGoodsCalculateResponse.setIntegralDeductCash(BigDecimal.ZERO); |
| | | } |
| | | //è®¢åæ»éé¢ |
| | | BigDecimal amount = BigDecimal.ZERO; |
| | | //伿 叿µæ£éé¢ |
| | |
| | | if(CollectionUtils.isEmpty(memberCoupons)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"éæ©ç伿 叿 æï¼è¯·å·æ°éè¯"); |
| | | } |
| | | memberCoupon = memberCouponList.get(Constants.ZERO); |
| | | memberCoupon = memberCoupons.get(Constants.ZERO); |
| | | couponAmount = memberCoupon.getValidAmount(); |
| | | memberCouponService.calculateCouponRata(memberCoupon,goodsCalculateList,amount); |
| | | orderPayConfirmResponse.setMemberCoupon(memberCoupon); |
| | |
| | | if(Constants.equalsInteger(type,Constants.ZERO)){ |
| | | if( Constants.equalsInteger(platformConfigDTO.getReturnMemberIntegralStatus(),Constants.ZERO) |
| | | && Objects.nonNull(platformConfigDTO.getReturnMemberIntegral())){ |
| | | integralBack = payAmount.divide(platformConfigDTO.getReturnMemberIntegral(),0,BigDecimal.ROUND_DOWN); |
| | | integralBack = payAmount.multiply(platformConfigDTO.getReturnMemberIntegral()).divide(BigDecimal.ONE,0,BigDecimal.ROUND_DOWN); |
| | | } |
| | | }else{ |
| | | if( Constants.equalsInteger(platformConfigDTO.getReturnShopIntegralStatus(),Constants.ZERO) |
| | | && Objects.nonNull(platformConfigDTO.getReturnShopIntegral())){ |
| | | integralBack = payAmount.divide(platformConfigDTO.getReturnShopIntegral(),0,BigDecimal.ROUND_DOWN); |
| | | integralBack = payAmount.multiply(platformConfigDTO.getReturnShopIntegral()).divide(BigDecimal.ONE,0,BigDecimal.ROUND_DOWN); |
| | | } |
| | | } |
| | | return integralBack; |
| | |
| | | */ |
| | | public BigDecimal calculateIntegralRata(OrderPayConfirmResponse orderPayConfirmResponse,List<OrderGoodsCalculateResponse> goodsCalculateList,BigDecimal totalIntegral){ |
| | | //å½åéæ©ååæå¤§å¯ç¨ç§¯åæµæ£çéé¢ |
| | | BigDecimal maxDeductionCash = goodsCalculateList.stream().map(i->i.getSkuAmount().subtract(i.getCouponDeductCash()) |
| | | BigDecimal maxDeductionCash = goodsCalculateList.stream().map(i->i.getSkuAmount().subtract(Objects.isNull(i.getCouponDeductCash())?BigDecimal.ZERO:i.getCouponDeductCash()) |
| | | .multiply(i.getDeductRata()).multiply(new BigDecimal("0.01"))).reduce(BigDecimal.ZERO,BigDecimal::add); |
| | | //积å - ç°é æ¯ä¾ |
| | | //积å-ç°éå
æ¢æ¯ä¾ï¼XXXç§¯åæµæ£1å
ï¼ |
| | | BigDecimal cashToIntegralRata = new BigDecimal(systemDictDataBiz.queryByCode(Constants.SHOP_CONFIG,Constants.INTEGRAL_EXCHANGE_CASH_RATA).getCode()); |
| | | //å½åéæ©ååæµæ£éè¦ä½¿ç¨ç积å |
| | | BigDecimal maxDeductionIntegral = maxDeductionCash.multiply(cashToIntegralRata).multiply(new BigDecimal("100")); |
| | | BigDecimal maxDeductionIntegral = maxDeductionCash.multiply(cashToIntegralRata); |
| | | //è·åå½åéè¦æ¯ä»çç°éæ»é¢ |
| | | BigDecimal payCash = goodsCalculateList.stream().map(i->i.getSkuAmount().subtract(i.getCouponDeductCash())).reduce(BigDecimal.ZERO,BigDecimal::add); |
| | | BigDecimal payCash = goodsCalculateList.stream().map(i->i.getSkuAmount().subtract(Objects.isNull(i.getCouponDeductCash())?BigDecimal.ZERO:i.getCouponDeductCash())).reduce(BigDecimal.ZERO,BigDecimal::add); |
| | | |
| | | //妿å®é
积åå°äºæå¤§éè¦ç§¯å éè¦è®¡ç®æ¯ä¾å æ¯ å»å¯¹åºæ·»å è³å¯¹åºçååé |
| | | //循ç¯ä¸åååå表 计ç®åºè¯¥ä½¿ç¨ç积åå¼ |
| | |
| | | //å©ä½ç§¯åå¼ |
| | | orderPayConfirmResponse.setSurplusIntegral(totalIntegral); |
| | | //å®é
æµæ£ä½¿ç¨ç§¯å |
| | | orderPayConfirmResponse.setDeductIntegral(totalIntegral.compareTo(maxDeductionCash)<=Constants.ZERO?totalIntegral:maxDeductionIntegral); |
| | | orderPayConfirmResponse.setDeductIntegral(totalIntegral.compareTo(maxDeductionIntegral)<=Constants.ZERO?totalIntegral:maxDeductionIntegral); |
| | | return realDeductionCash; |
| | | |
| | | } |
| | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.IntegralMapper; |
| | | import com.doumee.dao.business.MemberMapper; |
| | | import com.doumee.dao.business.ShopMapper; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.join.IntegralJoinMapper; |
| | | import com.doumee.dao.business.model.Fund; |
| | | import com.doumee.dao.business.model.Integral; |
| | | import com.doumee.dao.business.model.Member; |
| | | import com.doumee.dao.business.model.Shop; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.system.model.SystemDictData; |
| | | import com.doumee.dao.web.dto.IntegralDTO; |
| | | import com.doumee.dao.web.dto.IntegralRecordDTO; |
| | |
| | | |
| | | @Autowired |
| | | private ShopMapper shopMapper; |
| | | |
| | | @Autowired |
| | | private WithdrawRecordMapper withdrawRecordMapper; |
| | | |
| | | @Autowired |
| | | private GoodsorderMapper goodsorderMapper; |
| | | |
| | | @Autowired |
| | | private NoticeService noticeService; |
| | |
| | | .lambda() |
| | | .eq(Objects.nonNull(model.getUserType()),Integral::getUserType,model.getUserType()) |
| | | .eq(Objects.nonNull(model.getType()),Integral::getType,model.getType()) |
| | | .eq(Objects.nonNull(model.getObjType()),Integral::getObjType,model.getObjType()) |
| | | .ge(Objects.nonNull(model.getStartDate()),Integral::getCreateDate, model.getStartDate()+" 00:00:00") |
| | | .le(Objects.nonNull(model.getEndDate()),Integral::getCreateDate, model.getEndDate()+" 23:59:59") |
| | | .eq(Objects.nonNull(model.getObjType()),Integral::getObjType,model.getObjType()) |
| | | .eq(Integral::getMemberId,model.getMemberId()) |
| | | .orderByDesc(Integral::getCreateDate) |
| | | ); |
| | |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(result.getRecords())){ |
| | | for (Integral integral:result.getRecords()) { |
| | | integral.setStrObjType(Constants.IntegralObjType.getName(integral.getObjType())); |
| | | //ä½é¢æç° å
³è æç°è®°å½ |
| | | if(Constants.equalsInteger(integral.getObjType(),Constants.IntegralObjType.WITHDRAW_APPLY.getKey())){ |
| | | WithdrawRecord withdrawRecord = withdrawRecordMapper.selectById(integral.getObjId()); |
| | | if(Objects.nonNull(withdrawRecord)){ |
| | | integral.setWithdrawStatus(withdrawRecord.getStatus()); |
| | | } |
| | | } |
| | | return PageData.from(result); |
| | | } |
| | | } |
| | | PageData<Integral> rr = PageData.from(result); |
| | | if(pageWrap.getPage() == 1 && Constants.equalsInteger(model.getUserType(),Constants.TWO)){ |
| | | //妿æ¥è¯¢ç¬¬ä¸é¡µï¼åæ°æ®ç»è®¡ |
| | | rr.setCountData(dealCountIntegralNum(pageWrap)); |
| | | } |
| | | |
| | | return rr; |
| | | } |
| | | |
| | | private Integral dealCountIntegralNum(PageWrap<IntegralRecordDTO> pageWrap) { |
| | | IntegralRecordDTO model = pageWrap.getModel(); |
| | | List<Integral> result = integralMapper.selectList(new QueryWrapper<Integral>() |
| | | .lambda() |
| | | .eq(Objects.nonNull(model.getUserType()),Integral::getUserType,model.getUserType()) |
| | | .eq(Objects.nonNull(model.getType()),Integral::getType,model.getType()) |
| | | .eq(Objects.nonNull(model.getObjType()),Integral::getObjType,model.getObjType()) |
| | | .ge(Objects.nonNull(model.getStartDate()),Integral::getCreateDate, model.getStartDate()+" 00:00:00") |
| | | .le(Objects.nonNull(model.getEndDate()),Integral::getCreateDate, model.getEndDate()+" 23:59:59") |
| | | .eq(Objects.nonNull(model.getObjType()),Integral::getObjType,model.getObjType()) |
| | | .eq(Integral::getMemberId,model.getMemberId()) |
| | | .orderByDesc(Integral::getCreateDate) |
| | | ); |
| | | Integral integral = new Integral(); |
| | | integral.setInAmount(BigDecimal.ZERO); |
| | | integral.setOutAmount(BigDecimal.ZERO); |
| | | if(CollectionUtils.isEmpty( result)){ |
| | | return integral; |
| | | } |
| | | integral.setInAmount(result.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.ZERO)).map(i->i.getNum()).reduce(BigDecimal.ZERO,BigDecimal::add)); |
| | | integral.setOutAmount(result.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.ONE)).map(i->i.getNum()).reduce(BigDecimal.ZERO,BigDecimal::add)); |
| | | return integral; |
| | | } |
| | | |
| | | @Override |
| | |
| | | IntegralDataResponse integralDataResponse = new IntegralDataResponse(); |
| | | integralDataResponse.setSurplusIntegral(BigDecimal.ZERO); |
| | | integralDataResponse.setExpiredIntegral(BigDecimal.ZERO); |
| | | Shop shop = shopMapper.selectById(model.getMemberId()); |
| | | if (Objects.nonNull(shop)) { |
| | | integralDataResponse.setSurplusIntegral( |
| | | Constants.equalsInteger(model.getUserType(),Constants.TWO)?shop.getAmount():shop.getIntegral()); |
| | | } |
| | | List<Integral> list = integralMapper.selectList(new QueryWrapper<Integral>().lambda() |
| | | .eq(Objects.nonNull(model.getUserType()),Integral::getUserType,model.getUserType()) |
| | | // .eq(Objects.nonNull(model.getType()),Integral::getType,model.getType()) |
| | | .eq(Integral::getMemberId,model.getMemberId()) |
| | | .orderByDesc(Integral::getCreateDate)); |
| | | |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(list)){ |
| | | integralDataResponse.setSurplusIntegral( |
| | | list.stream().map(i->i.getNum().multiply(new BigDecimal(i.getType().toString())) |
| | | ).reduce(BigDecimal.ZERO, BigDecimal::add) |
| | | //æç°ä¸å¡æ°æ® |
| | | if(Constants.equalsInteger(model.getUserType(),Constants.TWO)){ |
| | | integralDataResponse.setWithdrawAmount( |
| | | withdrawRecordMapper.selectList(new QueryWrapper<WithdrawRecord>().lambda() |
| | | .eq(WithdrawRecord::getMemberId,model.getMemberId()) |
| | | .eq(WithdrawRecord::getStatus,Constants.ONE) |
| | | ).stream().map(WithdrawRecord::getAmount) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add) |
| | | ); |
| | | |
| | | integralDataResponse.setWithdrawIngAmount( |
| | | withdrawRecordMapper.selectList(new QueryWrapper<WithdrawRecord>().lambda() |
| | | .eq(WithdrawRecord::getMemberId,model.getMemberId()) |
| | | .eq(WithdrawRecord::getStatus,Constants.ZERO) |
| | | ).stream().map(WithdrawRecord::getAmount) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add) |
| | | ); |
| | | integralDataResponse.setWaitPayAmount( |
| | | goodsorderMapper.selectList(new QueryWrapper<Goodsorder>().lambda() |
| | | .eq(Goodsorder::getDistributionShopId,model.getMemberId()) |
| | | .in(Goodsorder::getStatus,Constants.OrderStatus.WAIT_PAY.getKey(), |
| | | Constants.OrderStatus.PAY_DONE.getKey(), |
| | | Constants.OrderStatus.WAIT_RECEIVE.getKey()) |
| | | ).stream().map(Goodsorder::getShopSettlement) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add) |
| | | ); |
| | | } |
| | | //积åå¤±ææ¹å¼ 0é¿æææ 1æç§¯åäº§çæ¶é´å¤±æ |
| | | Integer type = Integer.valueOf(systemDictDataBiz.queryByCode(Constants.INTEGRAL_SET, Constants.INTERALSET_INTEGRALINVALIDTYPE).getCode()); |
| | | //æ¶è´¹è
积å éè¦æ¥è¯¢å³å°è¿æç§¯å |
| | | if(Constants.equalsInteger(type,Constants.ONE)){ |
| | | if(Constants.equalsInteger(type,Constants.ONE)&& Constants.equalsInteger(model.getUserType(),Constants.ONE)){ |
| | | Integer validYear = Integer.valueOf(systemDictDataBiz.queryByCode(Constants.INTEGRAL_SET, Constants.INTERALSET_INTEGRALINVALIDCIRCLE).getCode()); |
| | | if(validYear.compareTo(Constants.ZERO)>Constants.ZERO){ |
| | | list = integralMapper.selectList(new QueryWrapper<Integral>().lambda() |
| | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | |
| | | @Autowired |
| | | private ShopMapper shopMapper; |
| | | |
| | | @Override |
| | | public InviteInfoResponse getInviteInfo(Integer memberId){ |
| | |
| | | .selectAs(Member::getImgurl,InviteRecord::getImgUrl) |
| | | .leftJoin(Member.class,Member::getId,InviteRecord::getMemberId) |
| | | .eq(InviteRecord::getIsdeleted,Constants.ZERO) |
| | | .eq(InviteRecord::getMemberId,memberId) |
| | | .eq(InviteRecord::getInviteId,memberId) |
| | | .orderByDesc(InviteRecord::getId) |
| | | ); |
| | | |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public String createShareImg(Integer userType,Integer memberId) throws Exception { |
| | | public String createShareImg(Integer userType,Integer memberId,String posterImg) throws Exception { |
| | | String imgUrl = systemDictDataBiz.queryByCode(Constants.ORDER_SET,Constants.INVITE_IMG_URL).getCode(); |
| | | String suffix = "m_" + memberId; |
| | | String suffix = "uid_"+ memberId; |
| | | if(Constants.equalsInteger(Constants.ONE,userType)){ |
| | | Shop shop = shopMapper.selectById(memberId); |
| | | if(Objects.nonNull(shop) |
| | | && StringUtils.isNotBlank(shop.getPosterImg())){ |
| | | if(StringUtils.isNotBlank(posterImg)){ |
| | | String path = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode() |
| | | + systemDictDataBiz.queryByCode(Constants.OSS, Constants.SHOP_FILE).getCode(); |
| | | imgUrl = path + shop.getPosterImg(); |
| | | imgUrl = path + posterImg; |
| | | suffix = "sid_"+ memberId; |
| | | } |
| | | suffix = "s_"+memberId; |
| | | } |
| | | BufferedImage img1 = GeneratePicUtil.transfromToImage(imgUrl,imgUrl.substring(imgUrl.lastIndexOf(".") + 1)); |
| | | if (img1 == null) { |
| | | return imgUrl; |
| | | } |
| | | String url = null; |
| | | String scene = "trial"; |
| | | String url = "/pages/index/index"; |
| | | String scene = suffix; |
| | | //å
容å享海æ¥å¾ç |
| | | InputStream mpCode = Constants.generateWxMiniImgStream( |
| | | scene, |
| | | "", |
| | | url, |
| | | false);//å°ç¨åº |
| | | InputStream inputStream = GeneratePicUtil.generateShareWithUserImg( |
| | | img1 |
| | | InputStream inputStream = GeneratePicUtil.generateShopImg( |
| | | imgUrl |
| | | , mpCode); |
| | | ALiYunUtil obs = new ALiYunUtil( |
| | | systemDictDataBiz.queryByCode(Constants.OSS,Constants.ENDPOINT).getCode() |
| | |
| | | String fileName = shareFolder + key; |
| | | if (obs.uploadOnlineObject(inputStream,systemDictDataBiz.queryByCode(Constants.OSS, Constants.BUCKETNAME).getCode(), fileName,null)) { |
| | | url = systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode() + fileName; |
| | | return key; |
| | | } |
| | | return url; |
| | | return null; |
| | | } |
| | | |
| | | |
| | |
| | | public String createShopMiniProgramCode(Integer shopId) throws Exception { |
| | | //å
容å享海æ¥å¾ç |
| | | InputStream inputStream = Constants.generateWxMiniImgStream( |
| | | "trial", |
| | | "/page/index/?shopId="+shopId, |
| | | "sid_"+shopId, |
| | | "/pages/index/index", |
| | | true);//å°ç¨åº |
| | | String url = null; |
| | | ALiYunUtil obs = new ALiYunUtil( |
| | |
| | | String fileName = shareFolder + key; |
| | | if (obs.uploadOnlineObject(inputStream,systemDictDataBiz.queryByCode(Constants.OSS, Constants.BUCKETNAME).getCode(), fileName,null)) { |
| | | url = systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode() + fileName; |
| | | return key; |
| | | } |
| | | return url; |
| | | return null; |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | @Override |
| | | public void deleteById(Integer id) { |
| | | memberBankMapper.deleteById(id); |
| | | memberBankMapper.update(new UpdateWrapper<MemberBank>().lambda().set(MemberBank::getIsdeleted,Constants.ONE).eq(MemberBank::getId,id)); |
| | | } |
| | | |
| | | @Override |
| | |
| | | if(Objects.isNull(request) |
| | | ||Objects.isNull(request.getIsDefault()) |
| | | ||Objects.isNull(request.getMemberId()) |
| | | || StringUtils.isNotBlank(request.getBankName()) |
| | | || StringUtils.isNotBlank(request.getBankAccount()) |
| | | || StringUtils.isNotBlank(request.getName()) |
| | | || StringUtils.isBlank(request.getBankName()) |
| | | || StringUtils.isBlank(request.getBankAccount()) |
| | | || StringUtils.isBlank(request.getName()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | |
| | | BeanUtils.copyProperties(request,memberBank); |
| | | memberBank.setCreateDate(new Date()); |
| | | memberBank.setEditDate(new Date()); |
| | | memberBank.setIsdeleted(Constants.ZERO); |
| | | memberBankMapper.insert(memberBank); |
| | | } else { |
| | | MemberBank memberBank = memberBankMapper.selectById(request.getId()); |
| | |
| | | .eq(MemberBank::getMemberId,shopId) |
| | | .orderByDesc(MemberBank::getIsDefault,MemberBank::getId) |
| | | ); |
| | | for (MemberBank memberBank:memberBanks) { |
| | | memberBank.setBankInfo(Constants.getBankInfo(memberBank.getBankName(),memberBank.getBankAccount())); |
| | | } |
| | | return memberBanks; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | .apply(Objects.nonNull(status)&&Constants.equalsInteger(status,Constants.TWO),"m.STATUS = 0 and m.END_DATE < now() " ) |
| | | .eq("TYPE",couponType) |
| | | .apply(!Objects.isNull(price)," m.LIMIT_PRICE >= "+price+" ") |
| | | .apply(" now() between m.START_DATE and m.END_DATE ") |
| | | // .apply(" now() between m.START_DATE and m.END_DATE ") |
| | | .orderByDesc(" m.PRICE ") |
| | | ); |
| | | return page; |
| | |
| | | //æ¥è¯¢ååå表 |
| | | List<Goods> goodsList = goodsMapper.selectJoinList(Goods.class, |
| | | new MPJLambdaWrapper<Goods>() |
| | | .selectAll(Goods.class) |
| | | .selectAs(GoodsSku::getPrice,Goods::getSkuPrice) |
| | | .selectAs(GoodsSku::getId,Goods::getSkuId) |
| | | .leftJoin(GoodsSku.class,GoodsSku::getGoodsId,Goods::getId) |
| | |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"è·åopenid失败ï¼è¯·è系管çå"); |
| | | } |
| | | Member member = memberMapper.selectOne(new QueryWrapper<Member>().lambda().eq(Member::getOpenId, openId) |
| | | .eq(Member::getIsdeleted,Constants.ZERO) |
| | | .eq(Member::getIsdeleted,Constants.ZERO).eq(Member::getStatus,Constants.ZERO) |
| | | .last(" limit 1")); |
| | | AccountResponse accountResponse = new AccountResponse(); |
| | | if(Objects.nonNull(member)){ |
| | |
| | | if(Objects.isNull(phone)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"æªè·åå°ææºå·"); |
| | | } |
| | | Member member = memberMapper.selectOne(new QueryWrapper<Member>().lambda().eq(Member::getOpenId, wxPhoneRequest.getOpenid()) |
| | | .eq(Member::getIsdeleted,Constants.ZERO) |
| | | Member member = memberMapper.selectOne(new QueryWrapper<Member>().lambda().eq(Member::getPhone, phone) |
| | | .eq(Member::getIsdeleted,Constants.ZERO).eq(Member::getStatus,Constants.ZERO) |
| | | .last(" limit 1")); |
| | | if (member == null) { |
| | | member = new Member(); |
| | | member.setImgurl("20230410/4010b821-2137-4e6d-86e4-5ab9c06184a4.png"); |
| | | member.setNickname("å¾®ä¿¡ç¨æ·"+ CodeVerifyUtils.createVerificationCode(4)); |
| | | member.setCreateDate(new Date()); |
| | | member.setIsdeleted(Constants.ZERO); |
| | | member.setType(Constants.ZERO); |
| | | member.setOrigin(Constants.ZERO); |
| | | if(!this.checkIsCreateInvite(phone)){ |
| | | member.setRecId(Constants.getInviteCode(wxPhoneRequest.getRecId())); |
| | | member.setRecId(wxPhoneRequest.getRecId()); |
| | | } |
| | | member.setIntegral(BigDecimal.ZERO); |
| | | member.setPhone(phone); |
| | | } |
| | | member.setOpenId(wxPhoneRequest.getOpenid()); |
| | | member.setIntegral(BigDecimal.ZERO); |
| | | } |
| | | member.setPhone(phone); |
| | | member.setEditDate(new Date()); |
| | | member.setImgFullUrl(systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode()+ |
| | | systemDictDataBiz.queryByCode(Constants.OSS,Constants.MEMBER_FILE).getCode()+member.getImgurl()); |
| | | if(Objects.isNull(member.getId())){ |
| | | memberMapper.insert(member); |
| | | |
| | | PlatformConfigDTO platformConfigDTO = systemDictDataService.getPlatformConfigDTO(); |
| | | this.createRegionReward(member,platformConfigDTO); |
| | | //å建éè¯·è®°å½ |
| | | this.createInviteRecord(member,platformConfigDTO); |
| | | member.setSharingCode(this.createShareCode(member.getId())); |
| | | // member.setSharingCode(this.createShareCode(member.getId())); |
| | | memberMapper.updateById(member); |
| | | }else{ |
| | | if(StringUtils.isBlank(member.getSharingCode())){ |
| | | member.setSharingCode(this.createShareCode(member.getId())); |
| | | } |
| | | // if(StringUtils.isBlank(member.getSharingCode())){ |
| | | // member.setSharingCode(this.createShareCode(member.getId())); |
| | | // } |
| | | memberMapper.updateById(member); |
| | | } |
| | | // JwtPayLoad payLoad = new JwtPayLoad(Constants.MEMBER_PREFIX+member.getId()); |
| | | // String token = JwtTokenUtil.generateToken(payLoad); |
| | | if(Objects.nonNull(wxPhoneRequest.getShopId())){ |
| | | this.bindShopInfo(member.getId(),wxPhoneRequest.getShopId()); |
| | | } |
| | | String token = JwtTokenUtil.generateTokenForRedis(member.getId(), Constants.ZERO, JSONObject.toJSONString(member), redisTemplate); |
| | | AccountResponse accountResponse = new AccountResponse(); |
| | | accountResponse.setToken(token); |
| | |
| | | Member member = memberMapper.selectById(memberId); |
| | | if(Objects.nonNull(member)&&StringUtils.isNotBlank(member.getOpenId())){ |
| | | memberMapper.update(new UpdateWrapper<Member>().lambda() |
| | | .set(Member::getOpenId,null) |
| | | .set(Member::getPhone,null) |
| | | // .set(Member::getOpenId,null) |
| | | .set(Member::getStatus,Constants.TWO) |
| | | .eq(Member::getId,member.getId()) |
| | | ); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void bindShopInfo(Integer memberId,Integer recId){ |
| | | Member member = memberMapper.selectById(memberId); |
| | | if(Objects.isNull(member)){ |
| | | return; |
| | | } |
| | | if (Objects.nonNull(member.getBindShopId())) { |
| | | return; |
| | | } |
| | | Shop shop = shopMapper.selectById(recId); |
| | | if(Objects.nonNull(shop)){ |
| | | memberMapper.update(new UpdateWrapper<Member>().lambda() |
| | | .set(Member::getBindShopId,recId) |
| | | .set(Member::getBindShopDate,new Date()) |
| | | .eq(Member::getId,member.getId()) |
| | | ); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | shop.setPassword(Utils.Secure.encryptPassword(shop.getPassword(), salt)); |
| | | shop.setSalt(salt); |
| | | shopMapper.insert(shop); |
| | | //å享ç |
| | | String url = inviteRecordService.createShopMiniProgramCode(shop.getId()); |
| | | if(StringUtils.isNotBlank(url)){ |
| | | shopMapper.update(null,new UpdateWrapper<Shop>().lambda() |
| | | .set(Shop::getProgramCode,url) |
| | | .eq(Shop::getId,shop.getId())); |
| | | } |
| | | //åäº«æµ·æ¥ |
| | | String posterUrl = inviteRecordService.createShareImg(Constants.ONE,shop.getId(),shop.getPosterImg()); |
| | | if(StringUtils.isNotBlank(posterUrl)){ |
| | | shopMapper.update(null,new UpdateWrapper<Shop>().lambda() |
| | | .set(Shop::getPosterImgCode,posterUrl) |
| | | .eq(Shop::getId,shop.getId())); |
| | | } |
| | | return shop.getId(); |
| | |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void updateById(Shop shop) { |
| | | public void updateById(Shop shop) throws Exception { |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(shop.getId()==null ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), ResponseStatus.BAD_REQUEST.getMessage()); |
| | |
| | | shop.setEditor(user.getId()); |
| | | shop.setEditDate(new Date()); |
| | | |
| | | if(StringUtils.isBlank(model.getProgramCode())){ |
| | | //å享ç |
| | | String url = inviteRecordService.createShopMiniProgramCode(shop.getId()); |
| | | if(StringUtils.isNotBlank(url)){ |
| | | shop.setProgramCode(url); |
| | | } |
| | | } |
| | | if(StringUtils.isNotBlank(shop.getPosterImg())){ |
| | | //åäº«æµ·æ¥ |
| | | String posterUrl = inviteRecordService.createShareImg(Constants.ONE,shop.getId(),shop.getPosterImg()); |
| | | if(StringUtils.isNotBlank(posterUrl)){ |
| | | shop.setPosterImgCode(posterUrl); |
| | | } |
| | | } |
| | | shopMapper.updateById(shop); |
| | | if(shop.getSaleType() !=null && !Constants.equalsInteger(shop.getSaleType(),model.getSaleType())){ |
| | | //妿é宿¨¡å¼åçç¼ç ï¼è®°å½åæ´è®°å½ |
| | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void updateByIdInBatch(List<Shop> shops) { |
| | | if (CollectionUtils.isEmpty(shops)) { |
| | | return; |
| | | } |
| | | for (Shop shop: shops) { |
| | | this.updateById(shop); |
| | | } |
| | | } |
| | | // @Override |
| | | // public void updateByIdInBatch(List<Shop> shops) { |
| | | // if (CollectionUtils.isEmpty(shops)) { |
| | | // return; |
| | | // } |
| | | // for (Shop shop: shops) { |
| | | // this.updateById(shop); |
| | | // } |
| | | // } |
| | | |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | | @Override |
| | |
| | | && StringUtils.isNotBlank(dto.getLgt())){ |
| | | isArea = true; |
| | | } |
| | | |
| | | List<Shop> shopList = shopJoinMapper.selectList(new MPJLambdaWrapper<Shop>() |
| | | List<Shop> shopList = shopJoinMapper.selectJoinList(Shop.class,new MPJLambdaWrapper<Shop>() |
| | | .selectAll(Shop.class) |
| | | .select(" CONVERT( ST_Distance_Sphere ( POINT ( LONGITUDE, LATITUDE ), POINT ( "+dto.getLgt()+", "+dto.getLat()+" )) /1000,DECIMAL(15,2))",Shop::getDistance) |
| | | .leftJoin(Areas.class,Areas::getId,Shop::getAreaId) |
| | | .eq(Objects.nonNull(dto.getCityId()),Areas::getParentId,dto.getCityId()) |
| | | .like(Objects.nonNull(dto.getShopName()),Shop::getName,dto.getShopName()) |
| | | .select(" CONVERT( ST_Distance_Sphere ( POINT ( LONGITUDE, LATITUDE ), POINT ( '"+dto.getLgt()+"' , '"+dto.getLat()+"' )) /1000,DECIMAL(15,2))",Shop::getDistance) |
| | | .leftJoin(SystemUser.class,SystemUser::getId,Shop::getCreator) |
| | | .like(StringUtils.isNotBlank(dto.getCityName()),Shop::getAddr,dto.getCityName()) |
| | | .like(StringUtils.isNotBlank(dto.getShopName()),Shop::getName,dto.getShopName()) |
| | | .orderByDesc(!isArea,Shop::getId) |
| | | .orderByAsc(isArea,Shop::getDistance) |
| | | .orderByAsc(isArea," distance ") |
| | | ); |
| | | String path = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode() |
| | | + systemDictDataBiz.queryByCode(Constants.OSS, Constants.SHOP_FILE).getCode(); |
| | | for(Shop model:shopList){ |
| | | model.setImgFullUrl(path+model.getImgurl()); |
| | | |
| | | model.setImgFullUrl(StringUtils.isNotBlank(model.getImgurl())?path+model.getImgurl():null); |
| | | |
| | | } |
| | | return shopList; |
| | |
| | | if (Objects.isNull(withdrawRecord) ) { |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | withdrawRecord.setBankInfo(Constants.getBankInfo(withdrawRecord.getBankName(),withdrawRecord.getBankAccount())); |
| | | if(!Constants.equalsInteger(withdrawRecord.getStatus(), Constants.ZERO)){ |
| | | String path = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode() + |
| | | systemDictDataBiz.queryByCode(Constants.OSS, Constants.TRANSFER_FILE).getCode(); |
| | |
| | | |
| | | |
| | | @Override |
| | | public void withdrawApply(WithdrawApplyRequest request, IntegralService integralService){ |
| | | public Integer withdrawApply(WithdrawApplyRequest request, IntegralService integralService){ |
| | | if (Objects.isNull( request) |
| | | || request.getMemberId() == null |
| | | || request.getBankId() == null |
| | |
| | | dealIntegralRequest.setMemberId(request.getMemberId()); |
| | | dealIntegralRequest.setDealType(Constants.ONE); |
| | | integralService.dealShopAmount(dealIntegralRequest); |
| | | return withdrawRecord.getId(); |
| | | } |
| | | |
| | | |
| | |
| | | appSecret: 3462fa186da7cb06c544df8d8664b63a |
| | | mchId: 1229817002 |
| | | mchKey: u4TSNtv0wFP7WRfnxBgijYOtRhS9FvlM |
| | | notifyUrl: https://dmtest.ahapp.net/dmmall_interface/web/api/wxPayNotify |
| | | notifyUrl: http://xiaopiqiu2.natapp1.cc/web/api/wxPayNotify #https://dmtest.ahapp.net/dmmall_interface/web/api/wxPayNotify |
| | | keyPath: /usr/local/apiclient_cert.p12 |
| | | |
| | | tencent: |
| | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.models.auth.In; |
| | | import lombok.extern.java.Log; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | |
| | | |
| | | @LoginRequired |
| | | @ApiOperation(value = "åæ·ç»å®", notes = "å°ç¨åºç«¯") |
| | | @GetMapping("/bindShopInfo") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "recId", value = "忷䏻é®", required = true) |
| | | }) |
| | | public ApiResponse bindShopInfo(@RequestParam Integer recId) { |
| | | memberService.bindShopInfo(getMemberId(),recId); |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.doumee.api.web; |
| | | |
| | | import com.doumee.config.annotation.LoginRequired; |
| | | import com.doumee.config.annotation.LoginShopRequired; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.business.model.Collect; |
| | | import com.doumee.dao.business.model.Goodsorder; |
| | | import com.doumee.dao.web.request.CollectSaveRequest; |
| | | import com.doumee.dao.web.request.ShopOrderRequest; |
| | | import com.doumee.dao.web.response.CollectResponse; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | |
| | | @LoginRequired |
| | | @ApiOperation("æçæ¶è") |
| | | @GetMapping("/myCollectList") |
| | | @PostMapping("/myCollectPage") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | }) |
| | | public ApiResponse myCollectList(@RequestParam Integer type) { |
| | | return ApiResponse.success(collectService.myCollect(getMemberId(),type)); |
| | | public ApiResponse<PageData<Collect>> myCollectPage(@RequestBody PageWrap<Collect> pageWrap) { |
| | | PageData<Collect> page = collectService.myCollectPage(pageWrap,getMemberId()); |
| | | return ApiResponse.success("æ¥è¯¢æå",page); |
| | | } |
| | | |
| | | |
| | | |
| | | @LoginRequired |
| | | @ApiOperation("æçæ¶èæ°é") |
| | | @GetMapping("/getCollectNum") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | }) |
| | | public ApiResponse<CollectResponse> getCollectNum() { |
| | | return ApiResponse.success("æ¥è¯¢æå",collectService.getCollectNum(getMemberId())); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @LoginShopRequired |
| | | @ApiOperation(value = "é¶è¡å¡å é¤", notes = "å°ç¨åºç«¯") |
| | | @GetMapping("/deleteById") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | }) |
| | | public ApiResponse deleteById(@RequestParam Integer id){ |
| | | memberBankService.deleteById(id); |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | |
| | | |
| | | @LoginShopRequired |
| | | @ApiOperation(value = "è·åæçæç°é¶è¡å¡", notes = "å°ç¨åºç«¯") |
| | | @GetMapping("/getBankList") |
| | | @ApiImplicitParams({ |
| | |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true) |
| | | }) |
| | | public ApiResponse<String> getMemberShareImg() throws Exception{ |
| | | return ApiResponse.success(inviteRecordService.createShareImg(Constants.ZERO,getMemberId())); |
| | | return ApiResponse.success(inviteRecordService.createShareImg(Constants.ZERO,getMemberId(),null)); |
| | | } |
| | | |
| | | |
| | |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true) |
| | | }) |
| | | public ApiResponse<String> getShareImg() throws Exception{ |
| | | return ApiResponse.success(inviteRecordService.createShareImg(Constants.ONE,getShopId())); |
| | | return ApiResponse.success(inviteRecordService.createShareImg(Constants.ONE,getShopId(),"20251210/6dd8880d-30d1-49d3-8192-99a4127cf785.png")); |
| | | } |
| | | } |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | }) |
| | | public ApiResponse getShopList(@RequestBody ShopListDTO dto){ |
| | | public ApiResponse<List<Shop>> getShopList(@RequestBody ShopListDTO dto){ |
| | | return ApiResponse.success(shopService.getShopList(dto)); |
| | | } |
| | | |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | }) |
| | | public ApiResponse withdrawApply(@RequestBody WithdrawApplyRequest request){ |
| | | public ApiResponse<Integer> withdrawApply(@RequestBody WithdrawApplyRequest request){ |
| | | request.setMemberId(getShopId()); |
| | | withdrawRecordService.withdrawApply(request,integralService); |
| | | return ApiResponse.success("æä½æå"); |
| | | return ApiResponse.success("æä½æå",withdrawRecordService.withdrawApply(request,integralService)); |
| | | } |
| | | |
| | | |
| | | |
| | | @LoginShopRequired |
| | |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * Created by IntelliJ IDEA. |
| | |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | }) |
| | | public ApiResponse<List<Areas>> getCityInfoList(@RequestBody Areas areas) { |
| | | return ApiResponse.success("æ¥è¯¢æå",areasService.getCityList(areas)); |
| | | List<Areas> list = areasService.getCityList(areas); |
| | | |
| | | if(Objects.nonNull(areas)&&StringUtils.isNotBlank(areas.getName())){ |
| | | list = |
| | | list.stream().filter(item -> item.getName().contains(areas.getName())).collect(Collectors.toList()); |
| | | } |
| | | |
| | | return ApiResponse.success("æ¥è¯¢æå",list); |
| | | } |
| | | |
| | | @ApiOperation("å
¨é¨åºåæ å½¢æ¥è¯¢") |
| | |
| | | |
| | | @ApiOperation("ååå表") |
| | | @PostMapping("/goodsPage") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true) |
| | | }) |
| | | public ApiResponse<IPage<GoodsInfoResponse>> goodsPage(@RequestBody PageWrap<GoodsRequest> pageWrap) { |
| | | IPage<GoodsInfoResponse> page = goodsService.getGoodsPage(pageWrap); |
| | | return ApiResponse.success("æ¥è¯¢æå",page); |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | }) |
| | | public ApiResponse<List<SearchHistory>> searchHistoryList(@RequestParam Integer type) { |
| | | public ApiResponse<List<SearchHistory>> searchHistoryList() { |
| | | return ApiResponse.success(searchHistoryService.findListByType(Constants.ZERO,getMemberId())); |
| | | } |
| | | |
| | |
| | | import com.doumee.dao.web.request.goods.DealOrderRequest; |
| | | import com.doumee.dao.web.request.goods.MemberOrderRequest; |
| | | import com.doumee.dao.web.request.goods.OrderCommentRequest; |
| | | import com.doumee.dao.web.request.goods.OrderPayConfirmRequest; |
| | | import com.doumee.dao.web.response.MemberCouponResponse; |
| | | import com.doumee.dao.web.response.MyPageResponse; |
| | | import com.doumee.dao.web.response.OrderCommentResponse; |
| | | import com.doumee.dao.web.response.OrderDetailResponse; |
| | | import com.doumee.dao.web.response.goods.MemberOrderResponse; |
| | | import com.doumee.dao.web.response.goods.OrderPayConfirmResponse; |
| | | import com.doumee.dao.web.response.goods.PayResponse; |
| | | import com.doumee.service.business.HotCityService; |
| | | import com.doumee.service.business.impl.MemberCouponServiceImpl; |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true) |
| | | }) |
| | | public ApiResponse<PayResponse> orderPay(@RequestParam Integer orderId) { |
| | | public ApiResponse<PayResponse> replayPay(@RequestParam Integer orderId) { |
| | | return ApiResponse.success("æä½æå", goodsorderService.replayPay(orderId)); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @LoginRequired |
| | | @ApiOperation("订åå¾
æ¯ä»ä¿¡æ¯") |
| | | @PostMapping("/orderPayConfirm") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | }) |
| | | public ApiResponse<OrderPayConfirmResponse> orderPayConfirm(@RequestBody OrderPayConfirmRequest request) { |
| | | request.setMemberId(getMemberId()); |
| | | return ApiResponse.success("æä½æå",goodsorderService.orderPayConfirm(request,memberCouponServiceImpl)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @LoginRequired |
| | | @ApiOperation("订åç»è®¡") |
| | | @GetMapping("/ordersStatistics") |
| | | @ApiImplicitParams({ |
| | |
| | | return ApiResponse.success("æä½æå",goodsorderService.ordersStatistics(getMemberId())); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @LoginRequired |
| | | @ApiOperation("ç©æµæ¥è¯¢") |
| | | @GetMapping("/queryExpress") |