Merge remote-tracking branch 'origin/master'
This commit is contained in:
41
src/main/java/com/yxt/yythmall/adminapi/AdminBankRest.java
Normal file
41
src/main/java/com/yxt/yythmall/adminapi/AdminBankRest.java
Normal file
@@ -0,0 +1,41 @@
|
||||
package com.yxt.yythmall.adminapi;
|
||||
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.yythmall.adminapi.vo.PmsBrandVo;
|
||||
import com.yxt.yythmall.adminapi.vo.PmsProductCategoryVo;
|
||||
import com.yxt.yythmall.adminservice.AdminMallService;
|
||||
import com.yxt.yythmall.api.lpkbank.LpkBank;
|
||||
import com.yxt.yythmall.api.lpkstore.LpkStore;
|
||||
import com.yxt.yythmall.biz.lpkbank.LpkBankService;
|
||||
import com.yxt.yythmall.biz.lpkstore.LpkStoreService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController("com.yxt.yythmall.adminapi.AdminBankRest")
|
||||
@RequestMapping("/adminapi/bank")
|
||||
public class AdminBankRest {
|
||||
|
||||
@Autowired
|
||||
private LpkBankService lpkBankService;
|
||||
@Autowired
|
||||
private LpkStoreService lpkStoreService;
|
||||
|
||||
@GetMapping(value = "/listBankAll")
|
||||
public ResultBean<List<LpkBank>> listBankAll() {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
List<LpkBank> list = lpkBankService.listAllBank();
|
||||
return rb.success().setData(list);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/listStoreOfBank")
|
||||
public ResultBean<List<LpkStore>> listStoreOfBank(@RequestParam(name = "bankSid", required = false) String bankSid) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
List<LpkStore> list = lpkStoreService.listStoreOfBank(bankSid);
|
||||
return rb.success().setData(list);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.yxt.yythmall.adminapi;
|
||||
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.yythmall.api.lpkreserveorder.LpkReserveOrderQuery;
|
||||
import com.yxt.yythmall.biz.vegecallerreserveorder.ReserveOrderVo;
|
||||
import com.yxt.yythmall.biz.vegecallerreserveorder.VegeCellarReserveOrderService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController("com.yxt.yythmall.adminapi.AdminReserveRest")
|
||||
@RequestMapping("/adminapi/reserve")
|
||||
public class AdminReserveRest {
|
||||
|
||||
@Autowired
|
||||
private VegeCellarReserveOrderService vegeCellarReserveOrderService;
|
||||
|
||||
@ApiOperation("精确到客户的预约单列表")
|
||||
@PostMapping("/pageOfCustomer")
|
||||
public ResultBean<PagerVo<ReserveOrderVo>> orderList(@RequestBody PagerQuery<LpkReserveOrderQuery> pq) {
|
||||
return vegeCellarReserveOrderService.pageOfCustomer(pq);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.yxt.yythmall.api.appletgiftbag;
|
||||
|
||||
import com.yxt.common.core.vo.Vo;
|
||||
import com.yxt.yythmall.api.newcomerrecorecord.NewcomerRecoRecordVo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -21,6 +22,7 @@ public class AppletGiftBagVo implements Vo {
|
||||
private String dateStart;
|
||||
private String dateEnd;
|
||||
private String price;//礼包总价格
|
||||
private String prefPrice;//优惠价格
|
||||
private String iconUrl;//图片
|
||||
private String isEnable;
|
||||
private String isGrounding;
|
||||
@@ -28,8 +30,10 @@ public class AppletGiftBagVo implements Vo {
|
||||
private String remarks;
|
||||
private String count;//
|
||||
private String goodsSid;
|
||||
private String weight="0";//重量
|
||||
private List<GiftBagGoods> giftBagGoods;
|
||||
private List<recommendRecord> recordList;
|
||||
private List<RecommendRecord> recordList;
|
||||
private List<NewcomerRecoRecordVo> newcomerRecoRecordVos;
|
||||
|
||||
public String getPrice() {
|
||||
DecimalFormat decimalFormat = new DecimalFormat("#0.00");
|
||||
|
||||
@@ -20,12 +20,14 @@ public class GiftBagGoodss {
|
||||
private String weight; //每份的重量
|
||||
private String jPrice; //每斤单价
|
||||
private String specificationUnit; //规格单位
|
||||
private String prefPrice;//优惠价格
|
||||
private String bagPrice;//礼包价格
|
||||
private String totalValue; //总价值
|
||||
private String spec; //总价值
|
||||
private String count="0"; //总价值
|
||||
private String mefenPrice="0";
|
||||
private boolean showCart=false;
|
||||
private String prefPrice;//优惠价格
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,6 @@ import lombok.Data;
|
||||
* @date 2024/1/11 9:29
|
||||
*/
|
||||
@Data
|
||||
public class recommendRecord {
|
||||
public class RecommendRecord {
|
||||
private String content;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.yxt.yythmall.api.lpkreserveorder;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -11,6 +12,7 @@ import java.util.UUID;
|
||||
* @date 2023/11/23 10:29
|
||||
*/
|
||||
@Data
|
||||
@TableName("lpk_reserve_order")
|
||||
public class LpkReserveOrder{
|
||||
private String id;
|
||||
private String sid= UUID.randomUUID().toString();
|
||||
|
||||
@@ -18,4 +18,5 @@ public class LpkReserveOrderQuery implements Query {
|
||||
private String bankSid;
|
||||
private String bankName;
|
||||
private String serialNumber;
|
||||
private String cardType; //1 家庭 2 亲情卡 3 企业
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.yxt.yythmall.api.lpkreserveordergoods;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -11,6 +12,7 @@ import java.util.UUID;
|
||||
* @date 2023/11/23 10:29
|
||||
*/
|
||||
@Data
|
||||
@TableName("lpk_reserve_order_goods")
|
||||
public class LpkReserveOrderGoods {
|
||||
private String id;
|
||||
private String sid= UUID.randomUUID().toString();
|
||||
|
||||
@@ -26,4 +26,6 @@ public class NewcomerRecoRecordDto implements Dto {
|
||||
private Date assistanceDate;//助力时间
|
||||
private String state;
|
||||
private String giftName;//礼包名
|
||||
private String customerSid;//礼包名
|
||||
private String orderSid;
|
||||
}
|
||||
|
||||
@@ -18,18 +18,20 @@ public class OrdOrder {
|
||||
private Date createTime;
|
||||
private String remarks;
|
||||
private String mainSid;
|
||||
private String outTradeNo;
|
||||
private int payStatus;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date payTime;
|
||||
private int cardNumber;
|
||||
private int source;
|
||||
private String totalTee;
|
||||
private String totalTee;//实际价格
|
||||
private String openId;
|
||||
private String userSid;
|
||||
private String name;
|
||||
private int timeRemarks;
|
||||
private String returnUrl;
|
||||
private String vegeCellarType;
|
||||
private String meet;
|
||||
// private String receivablePrice;//应收价格
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -23,15 +23,19 @@ public class OrdOrderDto implements Dto {
|
||||
private int payStatus;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date payTime;
|
||||
private int cardNumber;
|
||||
private int source;
|
||||
private String totalTee;
|
||||
private String openId;
|
||||
private String userSid;
|
||||
private int cardNumber;//卡的张数
|
||||
private int source;//来源:0、云菜窖
|
||||
private String totalTee;//金额
|
||||
private String openId;//微信唯一标识openid
|
||||
private String userSid;//用户sid
|
||||
private String name;
|
||||
private int timeRemarks;
|
||||
private String returnUrl;
|
||||
private String customerSid;
|
||||
private String vegeCellarType; //菜窖类型 0 百姓菜窖 1 精品菜窖 2 企业菜窖
|
||||
private String brandId;
|
||||
private String bagSid;
|
||||
private String meet;
|
||||
// private String receivablePrice;
|
||||
|
||||
private List<OrdOrderDetailVo> ordOrderDetailsVoList;
|
||||
}
|
||||
|
||||
@@ -11,5 +11,6 @@ import lombok.Data;
|
||||
public class OrdOrderQuery implements Query {
|
||||
private String startDate; //开始时间
|
||||
private String endDate; //结束时间
|
||||
private String countNumber; //总数
|
||||
private String customerSid; //总数
|
||||
private String state;
|
||||
}
|
||||
|
||||
@@ -2,9 +2,11 @@ package com.yxt.yythmall.api.ordorder;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.yxt.common.core.vo.Vo;
|
||||
import com.yxt.yythmall.api.ordorderdetails.OrdOrderDetail;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
@@ -18,15 +20,24 @@ public class OrdOrderVo implements Vo {
|
||||
private Date createTime;
|
||||
private String remarks;
|
||||
private String mainSid;
|
||||
private int payStatus;
|
||||
private String outTradeNo;
|
||||
private int payStatus;//状态
|
||||
private String payType="微信支付";
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date payTime;
|
||||
private int cardNumber;
|
||||
private int source;
|
||||
private String totalTee;
|
||||
private String totalTee;//实付金额
|
||||
private String meet="0";//应付价格
|
||||
private String surcharge="0";//附加费
|
||||
private String openId;
|
||||
private String userSid;
|
||||
private String name;
|
||||
private int timeRemarks;
|
||||
private String returnUrl;
|
||||
private String count;//商品数
|
||||
private List<String> picUrls;//图片
|
||||
List<OrdOrderDetail> ordOrderDetails;
|
||||
private String endTime;
|
||||
private PayResult result;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.yxt.yythmall.api.ordorderdetails;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
@@ -19,11 +21,14 @@ public class OrdOrderDetail {
|
||||
private String remarks;
|
||||
private String orderSid;
|
||||
private String goodsSid;
|
||||
private String goodsName;
|
||||
private int partNumber;
|
||||
private double numofPart;
|
||||
private double priceUnit;
|
||||
private double pricePart;
|
||||
private String goodsName;//商品名
|
||||
private int partNumber; //份数
|
||||
private double numofPart;//每份数量
|
||||
private double priceUnit;//
|
||||
private double pricePart;//每份价格
|
||||
|
||||
@TableField(exist = false)
|
||||
private String picUrl;//图片
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -18,10 +18,10 @@ public class OrdOrderDetailVo implements Vo {
|
||||
private Date createTime;
|
||||
private String remarks;
|
||||
private String orderSid;
|
||||
private String goodsSid;
|
||||
private String goodsName;
|
||||
private int partNumber;
|
||||
private double numofPart;
|
||||
private double priceUnit;
|
||||
private double pricePart;
|
||||
private String goodsSid;//商品Sid
|
||||
private String goodsName;//商品名称
|
||||
private int partNumber;//份数
|
||||
private double numofPart;//每份数量
|
||||
private double priceUnit;//商品单价
|
||||
private double pricePart;//每份价格
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.yxt.yythmall.api.recommendnewuserbag;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:06
|
||||
*/
|
||||
@ApiModel(value = "礼包信息", description = "礼包信息")
|
||||
@TableName("applet_giftbag")
|
||||
@Data
|
||||
public class RecommendNewUserBag {
|
||||
private String id;
|
||||
private String sid = UUID.randomUUID().toString();
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
private String remarks;
|
||||
private String isEnable;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date dateStart;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date dateEnd;
|
||||
private String name;
|
||||
private String price;
|
||||
private String iconUrl;
|
||||
private String isGrounding;
|
||||
private String isRecommend;
|
||||
private String preferentialPrice;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.yxt.yythmall.api.recommendnewuserbag;
|
||||
|
||||
import com.yxt.yythmall.api.appletgiftbag.GiftBagGoods;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2024/1/6 15:39
|
||||
*/
|
||||
@Data
|
||||
public class RecommendNewUserBagDetailVo {
|
||||
private String sid;
|
||||
private String name;
|
||||
private String dateStart;
|
||||
private String dateEnd;
|
||||
private String price;
|
||||
private String iconUrl;
|
||||
private String isEnable;
|
||||
private String isGrounding;
|
||||
private String isRecommend;
|
||||
private String remark;
|
||||
private String count;
|
||||
private List<GiftBagGoods> goods = new ArrayList<>();
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.yxt.yythmall.api.recommendnewuserbag;
|
||||
|
||||
import com.yxt.common.core.dto.Dto;
|
||||
import com.yxt.yythmall.api.appletgiftbag.GiftBagGoods;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:13
|
||||
*/
|
||||
@ApiModel(value = "礼包信息 数据传输对象", description = "礼包信息 数据传输对象")
|
||||
@Data
|
||||
public class RecommendNewUserBagDto implements Dto {
|
||||
|
||||
private String sid;
|
||||
private String remarks;
|
||||
private String dateStart;
|
||||
private String dateEnd;
|
||||
private String name;
|
||||
private String price;
|
||||
private String iconUrl;
|
||||
private String isGrounding;
|
||||
private String isRecommend;
|
||||
private String preferentialPrice;
|
||||
//商品sid
|
||||
private List<GiftBagGoods> goods = new ArrayList<>();
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.yxt.yythmall.api.recommendnewuserbag;
|
||||
|
||||
import com.yxt.common.core.vo.Vo;
|
||||
import com.yxt.yythmall.api.appletgiftbag.GiftBagGoods;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
* @description
|
||||
* @date 2023/11/22 11:15
|
||||
*/
|
||||
@Data
|
||||
public class RecommendNewUserBagInitVo implements Vo {
|
||||
private String sid;
|
||||
private String remarks;
|
||||
private String dateStart;
|
||||
private String dateEnd;
|
||||
private String name;
|
||||
private String price;
|
||||
private String iconUrl;
|
||||
private String isRecommend;
|
||||
private String preferentialPrice;
|
||||
//商品sid
|
||||
private List<GiftBagGoods> goods = new ArrayList<>();
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.yxt.yythmall.api.recommendnewuserbag;
|
||||
|
||||
import com.yxt.common.core.query.Query;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:31
|
||||
*/
|
||||
@ApiModel(value = "礼包信息 查询条件", description = "礼包信息 查询条件")
|
||||
@Data
|
||||
public class RecommendNewUserBagQuery implements Query {
|
||||
private String name;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.yxt.yythmall.api.recommendnewuserbag;
|
||||
|
||||
import com.yxt.common.core.vo.Vo;
|
||||
import com.yxt.yythmall.api.appletgiftbag.GiftBagGoods;
|
||||
import com.yxt.yythmall.api.appletgiftbag.RecommendRecord;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:12
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "礼包信息 视图数据对象", description = "礼包信息 视图数据对象")
|
||||
@NoArgsConstructor
|
||||
public class RecommendNewUserBagVo implements Vo {
|
||||
private String sid;
|
||||
private String name;//
|
||||
private String dateStart;
|
||||
private String dateEnd;
|
||||
private String price;//礼包总价格
|
||||
private String prefPrice;//优惠价格
|
||||
private String iconUrl;//图片
|
||||
private String isEnable;
|
||||
private String isGrounding;
|
||||
private String isRecommend;//是否推荐 1 推荐 0 默认
|
||||
private String remarks;
|
||||
private String count;//
|
||||
private String goodsSid;
|
||||
private String weight="0";//重量
|
||||
private List<GiftBagGoods> giftBagGoods;
|
||||
private List<RecommendRecord> recordList;
|
||||
|
||||
public String getPrice() {
|
||||
DecimalFormat decimalFormat = new DecimalFormat("#0.00");
|
||||
if(null==price){
|
||||
price="0";
|
||||
}
|
||||
return price=decimalFormat.format(Double.valueOf(price));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.yxt.yythmall.api.recommendnewuserbagdetails;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:06
|
||||
*/
|
||||
@ApiModel(value = "礼包包含商品信息", description = "礼包包含商品信息")
|
||||
@TableName("applet_giftbag_goods")
|
||||
@Data
|
||||
public class RecommendNewUserBagDetails {
|
||||
private String id;
|
||||
private String sid = UUID.randomUUID().toString();
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
private String remarks;
|
||||
private String giftbagSid;
|
||||
private String goodsSid;
|
||||
private String goodsNumber;
|
||||
// private String isGrounding;
|
||||
private double price;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.yxt.yythmall.api.recommendnewuserbagdetails;
|
||||
|
||||
import com.yxt.common.core.dto.Dto;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:13
|
||||
*/
|
||||
@ApiModel(value = "礼包包含商品信息 数据传输对象", description = "礼包包含商品信息 数据传输对象")
|
||||
@Data
|
||||
public class RecommendNewUserBagDetailsDto implements Dto {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.yxt.yythmall.api.recommendnewuserbagdetails;
|
||||
|
||||
import com.yxt.common.core.query.Query;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:31
|
||||
*/
|
||||
@ApiModel(value = "礼包包含商品信息 查询条件", description = "礼包包含商品信息 查询条件")
|
||||
@Data
|
||||
public class RecommendNewUserBagDetailsQuery implements Query {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.yxt.yythmall.api.recommendnewuserbagdetails;
|
||||
|
||||
import com.yxt.common.core.vo.Vo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:12
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "礼包包含商品信息 视图数据对象", description = "礼包包含商品信息 视图数据对象")
|
||||
@NoArgsConstructor
|
||||
public class RecommendNewUserBagDetailsVo implements Vo {
|
||||
private String goodsName;
|
||||
private double goodsNumber;
|
||||
private String picUrl;
|
||||
private String goodsSid;
|
||||
private String price;
|
||||
private String unitName;
|
||||
private String remarks;
|
||||
}
|
||||
@@ -29,6 +29,7 @@ public class ShoppingCartVo implements Vo {
|
||||
private String unitName;
|
||||
private String iconUrl;
|
||||
private String specificationUnit;
|
||||
// private String text;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -24,6 +24,8 @@ public class TransferRecords {
|
||||
private String affiliation;//所属菜窖
|
||||
private String state;//
|
||||
private String recipientSid;//领取人
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||
private Date recipientTime;//领取人
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ public class TransferRecordsDto implements Dto {
|
||||
private String state;//
|
||||
private String recipientSid;//领取人
|
||||
private String orderSid;
|
||||
private String remarks;
|
||||
private List<GoodsVo> vos;
|
||||
|
||||
}
|
||||
|
||||
@@ -27,4 +27,6 @@ public class TransferRecordsVo implements Vo {
|
||||
private String goodss;
|
||||
private String createTime;
|
||||
private String remarks;
|
||||
private String fxNick;
|
||||
private String lqNick;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ public interface AppletGiftBagMapper extends BaseMapper<AppletGiftBag> {
|
||||
IPage<AppletGiftBagVo> giftBagListPage(IPage<AppletGiftBag> page, @Param(Constants.WRAPPER) QueryWrapper<AppletGiftBag> qw);
|
||||
List<AppletGiftBagVo> giftBagList();
|
||||
|
||||
List<GiftBagGoodss> giftBagGoodsList(@Param("sid")String sid );
|
||||
List<AppletGiftBagVo> giftBagGoodsList();
|
||||
List<GiftBagGoodss> getGoodsByBagSid(@Param("bagSid") String bagSid);
|
||||
int saveBags(@Param("bags") List<AppletGiftBag> bags);
|
||||
}
|
||||
|
||||
@@ -35,22 +35,28 @@
|
||||
where isGrounding=1
|
||||
order by isRecommend desc,createTime desc
|
||||
</select>
|
||||
<select id="giftBagGoodsList" resultType="com.yxt.yythmall.api.appletgiftbag.GiftBagGoodss">
|
||||
<select id="giftBagGoodsList" resultType="com.yxt.yythmall.api.appletgiftbag.AppletGiftBagVo">
|
||||
select
|
||||
s.goodsNumber as goodsNumber,
|
||||
d.`name` ,
|
||||
d.unitName,
|
||||
d.price as jPrice,
|
||||
d.price as price,
|
||||
d.picUrl as iconUrl,
|
||||
d.specificationUnit,
|
||||
d.isAppletGrounding,
|
||||
d.content as remark,
|
||||
d.weight,
|
||||
d.sid as goodsSid
|
||||
a.sid,
|
||||
a.name ,
|
||||
a.iconUrl,
|
||||
a.price ,
|
||||
a.preferentialPrice as prefPrice
|
||||
from applet_giftbag a
|
||||
left join applet_giftbag_goods s on s.giftbagSid=a.sid
|
||||
left join lpk_goods d on d.sid=s.goodsSid
|
||||
where a.sid=#{sid}
|
||||
</select>
|
||||
<select id="getGoodsByBagSid" resultType="com.yxt.yythmall.api.appletgiftbag.GiftBagGoodss">
|
||||
select
|
||||
a.preferentialPrice as prefPrice,
|
||||
c.name as name,
|
||||
c.sid as goodsSid,
|
||||
c.specificationUnit as specificationUnit,
|
||||
c.unitName as unitName,
|
||||
b.goodsNumber as goodsNumber,
|
||||
c.weight as weight
|
||||
from applet_giftbag a
|
||||
left join applet_giftbag_goods b on b.giftbagSid=a.sid
|
||||
left join lpk_goods c on c.sid =b.goodsSid
|
||||
where a.sid=#{bagSid}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -71,7 +71,7 @@ public class AppletGiftBagRest {
|
||||
public ResultBean getGiftBagBySid(@PathVariable String sid) {
|
||||
return AppletGiftBagService.getGiftBagBySid(sid);
|
||||
}
|
||||
@ApiOperation("共享家庭卡蔬菜详情")
|
||||
@ApiOperation("")
|
||||
@GetMapping("/recommendRecord/{sid}")
|
||||
public ResultBean recommendRecord(@PathVariable("sid") String sid) {
|
||||
return AppletGiftBagService.recommendRecord(sid);
|
||||
|
||||
@@ -14,8 +14,7 @@ import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.yythmall.api.appletgiftbag.*;
|
||||
import com.yxt.yythmall.api.appletgiftbaggoods.AppletGiftBagGoods;
|
||||
import com.yxt.yythmall.api.appletgiftbag.GiftBagGoods;
|
||||
import com.yxt.yythmall.api.appletgiftbag.recommendRecord;
|
||||
import com.yxt.yythmall.api.lpkgiftcard.LpkGiftCardQuery;
|
||||
import com.yxt.yythmall.api.appletgiftbag.RecommendRecord;
|
||||
import com.yxt.yythmall.api.lpkgoods.LpkGoods;
|
||||
import com.yxt.yythmall.biz.appletgiftbaggoods.AppletGiftBagGoodsService;
|
||||
import com.yxt.yythmall.biz.lpkgoods.LpkGoodsService;
|
||||
@@ -24,7 +23,6 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
@@ -253,13 +251,13 @@ public class AppletGiftBagService extends MybatisBaseService<AppletGiftBagMapper
|
||||
AppletGiftBag bag=baseMapper.selectOne(new QueryWrapper<AppletGiftBag>().eq("sid","e49555f2-5370-45b0-9637-aa4d54c22e31"));
|
||||
vo.setRemarks(bag.getRemarks());
|
||||
vo.setIconUrl(fileUploadComponent.getUrlPrefix() +bag.getIconUrl());
|
||||
recommendRecord recommendRecord=new recommendRecord();
|
||||
RecommendRecord recommendRecord=new RecommendRecord();
|
||||
recommendRecord.setContent("梧桐居助力您获得7斤白菜");
|
||||
recommendRecord recommendRecord1=new recommendRecord();
|
||||
RecommendRecord recommendRecord1=new RecommendRecord();
|
||||
recommendRecord1.setContent("龙助力您获得7斤白菜");
|
||||
recommendRecord recommendRecord2=new recommendRecord();
|
||||
RecommendRecord recommendRecord2=new RecommendRecord();
|
||||
recommendRecord2.setContent("美人助力您获得15斤土豆");
|
||||
List<recommendRecord> list=new ArrayList<>();
|
||||
List<RecommendRecord> list=new ArrayList<>();
|
||||
list.add(recommendRecord);
|
||||
list.add(recommendRecord1);
|
||||
list.add(recommendRecord2);
|
||||
@@ -268,18 +266,22 @@ public class AppletGiftBagService extends MybatisBaseService<AppletGiftBagMapper
|
||||
}
|
||||
public ResultBean newUserQuota() {
|
||||
ResultBean rb=new ResultBean().fail();
|
||||
// List<GiftBagGoodss> giftBagGoodss=baseMapper.getAllGoodsApplets(query);
|
||||
|
||||
List<GiftBagGoodss> s=baseMapper.giftBagGoodsList("e49555f2-5370-45b0-9637-aa4d54c22e31");
|
||||
for (GiftBagGoodss giftBagGoodss : s) {
|
||||
giftBagGoodss.setIconUrl(fileUploadComponent.getUrlPrefix() +giftBagGoodss.getIconUrl());
|
||||
giftBagGoodss.setMefenPrice(String.valueOf((int)(Double.valueOf(giftBagGoodss.getPrice())*Double.valueOf(giftBagGoodss.getWeight()))));
|
||||
giftBagGoodss.setPrefPrice(String.valueOf((Integer.valueOf(giftBagGoodss.getMefenPrice())*0.5)));
|
||||
giftBagGoodss.setPrefPrice(removeZeros(giftBagGoodss.getPrefPrice()));
|
||||
List<AppletGiftBagVo> s=baseMapper.giftBagGoodsList();
|
||||
for (AppletGiftBagVo appletGiftBagVo : s) {
|
||||
List<AppletGiftBagGoods> giftBagGoods=appletGiftBagGoodsService.list(new QueryWrapper<AppletGiftBagGoods>().eq("giftbagSid",appletGiftBagVo.getSid()));
|
||||
for(AppletGiftBagGoods goods:giftBagGoods){
|
||||
LpkGoods lpkGoods=lpkGoodsService.getOne(new QueryWrapper<LpkGoods>().eq("sid",goods.getGoodsSid()));
|
||||
appletGiftBagVo.setWeight(removeZeros(String.valueOf(Double.valueOf(lpkGoods.getWeight())*Double.valueOf(goods.getGoodsNumber())+Double.valueOf(appletGiftBagVo.getWeight()))));
|
||||
}
|
||||
appletGiftBagVo.setIconUrl(fileUploadComponent.getUrlPrefix() +appletGiftBagVo.getIconUrl());
|
||||
}
|
||||
return rb.success().setData(s);
|
||||
}
|
||||
|
||||
public ResultBean<List<GiftBagGoodss>> getGoodsByBagSid(String bagSid) {
|
||||
ResultBean rb=new ResultBean().fail();
|
||||
List<GiftBagGoodss> s=baseMapper.getGoodsByBagSid(bagSid);
|
||||
return rb.success().setData(s);
|
||||
}
|
||||
/**
|
||||
* 去除多余.0
|
||||
* @param num
|
||||
|
||||
@@ -43,8 +43,6 @@ public class CustomerStoreService extends MybatisBaseService<CustomerStoreMapper
|
||||
vo1.setStoreSid(list.getSid());
|
||||
vo1.setBusinessHours(list.getBusinessHours());
|
||||
vo1.setStoreName(list.getName());
|
||||
vo1.setName("张三");
|
||||
vo1.setPhone("11111111111");
|
||||
vo1=getStart(vo1);
|
||||
return rb.success().setData(vo1);
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
bag.NAME AS pname,
|
||||
card.state AS states,
|
||||
card.serialNumber AS serialNumber,
|
||||
card.isTransfer as isTransfer
|
||||
card.isTransfer as isTransfer
|
||||
FROM emp_card card
|
||||
LEFT JOIN lpk_giftbag bag ON card.giftbagSid = bag.sid
|
||||
where card.sid = #{sid}
|
||||
@@ -119,7 +119,7 @@
|
||||
bag.NAME AS pname,
|
||||
card.state AS states,
|
||||
card.serialNumber AS serialNumber,
|
||||
card.isTransfer as isTransfer
|
||||
card.isTransfer as isTransfer
|
||||
FROM emp_card card
|
||||
LEFT JOIN lpk_giftbag bag ON card.giftbagSid = bag.sid
|
||||
where card.sid = #{sid}
|
||||
@@ -154,12 +154,13 @@
|
||||
</select>
|
||||
<select id="getBagGoods" resultType="com.yxt.yythmall.api.empcard.EmpCardVo">
|
||||
SELECT card.*,
|
||||
s.sid as goodsSid,
|
||||
s.sid as goodsSid,
|
||||
s.goodsNumber as goodsNumber
|
||||
FROM emp_card card
|
||||
LEFT JOIN lpk_giftbag bag on card.giftbagSid = bag.sid
|
||||
left join lpk_giftbag_goods s on bag.sid = s.giftbagSid
|
||||
where card.sid = #{sid} and s.goodsSid=#{goodsSid}
|
||||
where card.sid = #{sid}
|
||||
and s.goodsSid = #{goodsSid}
|
||||
</select>
|
||||
<select id="cardStatisticsList" resultType="com.yxt.yythmall.api.empcard.EmpCardVo">
|
||||
SELECT
|
||||
@@ -232,16 +233,14 @@
|
||||
</where>
|
||||
</select>
|
||||
<select id="getGoodsList" resultType="com.yxt.yythmall.api.vegetablecellar.vegeVo">
|
||||
SELECT
|
||||
e.sid as goodsSid,
|
||||
e.name as goodsName,
|
||||
d.goodsNumber as goodsNumber,
|
||||
e.brandId as e.brandId,
|
||||
e.cetegoryId as cetegoryId
|
||||
FROM
|
||||
emp_card_gift gi
|
||||
left join emp_card_gift_goods d on d.empCardGiftSid=gi.sid
|
||||
left join lpk_goods e on e.sid =d.goodsSid
|
||||
where gi.sid=#{sid}
|
||||
SELECT e.sid AS goodsSid,
|
||||
e.NAME AS goodsName,
|
||||
d.goodsNumber AS goodsNumber,
|
||||
e.brandId AS brandId,
|
||||
e.categoryId AS categoryId
|
||||
FROM emp_card gi
|
||||
left join lpk_giftbag_goods d on d.giftbagSid = gi.giftbagSid
|
||||
left join lpk_goods e on e.sid = d.goodsSid
|
||||
where gi.sid = #{sid}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -139,7 +139,7 @@ public class EmpCardService extends MybatisBaseService<EmpCardMapper, EmpCard> {
|
||||
return rb.setMsg("该卡已绑定");
|
||||
}
|
||||
lpkGiftCard.setCustomerSid(bindCardDto.getCustomerSid());
|
||||
lpkGiftCard.setState("2");
|
||||
lpkGiftCard.setState("3");
|
||||
lpkGiftCard.setBindDate(new Date());
|
||||
baseMapper.updateById(lpkGiftCard);
|
||||
List<vegeVo> k = baseMapper.getGoodsList(lpkGiftCard.getSid());
|
||||
|
||||
@@ -244,12 +244,12 @@
|
||||
e.sid as goodsSid,
|
||||
e.name as goodsName,
|
||||
d.goodsNumber as goodsNumber,
|
||||
e.brandId as e.brandId,
|
||||
e.cetegoryId as cetegoryId
|
||||
e.brandId as brandId,
|
||||
e.categoryId as categoryId
|
||||
FROM
|
||||
emp_card gi
|
||||
left join lpk_giftbag_goods d on d.giftbagSid=gi.giftbagSid
|
||||
left join lpk_goods e on e.sid =d.goodsSid
|
||||
emp_card_gift gi
|
||||
left join emp_card_gift_goods d on d.empCardGiftSid=gi.sid
|
||||
left join lpk_goods e on e.sid =d.goodsSid
|
||||
where gi.sid=#{sid}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -120,7 +120,7 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em
|
||||
return rb.setMsg("该卡已绑定");
|
||||
}
|
||||
empCardGift.setCustomerSid(bindCardDto.getCustomerSid());
|
||||
empCardGift.setState("2");
|
||||
empCardGift.setState("3");
|
||||
empCardGift.setIsShare("3");
|
||||
empCardGift.setBindDate(new Date());
|
||||
baseMapper.updateById(empCardGift);
|
||||
@@ -1175,6 +1175,9 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em
|
||||
}
|
||||
}
|
||||
}
|
||||
order.setPayStatus(4);
|
||||
order.setPayTime(new Date());
|
||||
ordOrderService.updateById(order);
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.yxt.yythmall.biz.lpkbank;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
@@ -68,4 +69,7 @@ public class LpkBankService extends MybatisBaseService<LpkBankMapper, LpkBank> {
|
||||
}
|
||||
|
||||
|
||||
public List<LpkBank> listAllBank() {
|
||||
return baseMapper.selectList(null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ public class LpkCustomerService extends MybatisBaseService<LpkCustomerMapper, Lp
|
||||
newCustomer.setIsNewUser("1");
|
||||
newCustomer.setPhoto("headImage.png");
|
||||
LpkCustomer lpkCustomer1 = baseMapper.selectOwn();
|
||||
newCustomer.setNick("小主000"+ (Integer.valueOf(lpkCustomer1.getId()).intValue() +1));
|
||||
newCustomer.setNick("惠享客户000"+ (Integer.valueOf(lpkCustomer1.getId()).intValue() +1));
|
||||
baseMapper.insert(newCustomer);
|
||||
// return rb.setData(newCustomer).setCode("110");
|
||||
StpUtil.login(newCustomer.getId());
|
||||
@@ -124,7 +124,7 @@ public class LpkCustomerService extends MybatisBaseService<LpkCustomerMapper, Lp
|
||||
lpkCustomer = fetchBySid(lpkCustomer.getSid());
|
||||
}
|
||||
if(StringUtils.isBlank(lpkCustomer.getNick())){
|
||||
lpkCustomer.setNick("小主000"+lpkCustomer.getId());
|
||||
lpkCustomer.setNick("惠享客户000"+lpkCustomer.getId());
|
||||
baseMapper.updateById(lpkCustomer);
|
||||
lpkCustomer = fetchBySid(lpkCustomer.getSid());
|
||||
}
|
||||
|
||||
@@ -17,99 +17,96 @@
|
||||
|
||||
|
||||
<select id="getGifCardsByCustomerSid" resultType="com.yxt.yythmall.api.lpkgiftcard.AppletVo">
|
||||
SELECT
|
||||
card.sid as sid,
|
||||
card.state AS state,
|
||||
CASE
|
||||
card.state
|
||||
WHEN 3 THEN '未提货'
|
||||
WHEN 4 THEN '已经预约提货(预约部分提货)'
|
||||
WHEN 5 THEN '已经提取完成'
|
||||
END stateValue,
|
||||
CASE
|
||||
WHEN card.sid IS NOT NULL THEN '1'
|
||||
END logo,
|
||||
CASE
|
||||
WHEN card.sid IS NOT NULL THEN '1'
|
||||
END type,
|
||||
CASE
|
||||
WHEN card.sid IS NOT NULL THEN '家庭菜窖'
|
||||
END pName,
|
||||
bag.dateStart AS dateStart,
|
||||
bag.dateEnd AS dateEnd,
|
||||
card.state AS states,
|
||||
card.serialNumber AS serialNumber,
|
||||
card.isItInvalid,
|
||||
card.bindDate,
|
||||
card.isTransfer,
|
||||
card.isEnable,
|
||||
card.`code`,
|
||||
card.isReservation
|
||||
SELECT card.sid as sid,
|
||||
card.state AS state,
|
||||
CASE
|
||||
card.state
|
||||
WHEN 3 THEN '未提货'
|
||||
WHEN 4 THEN '已经预约提货(预约部分提货)'
|
||||
WHEN 5 THEN '已经提取完成'
|
||||
END stateValue,
|
||||
CASE
|
||||
WHEN card.sid IS NOT NULL THEN '1'
|
||||
END logo,
|
||||
CASE
|
||||
WHEN card.sid IS NOT NULL THEN '1'
|
||||
END type,
|
||||
CASE
|
||||
WHEN card.sid IS NOT NULL THEN '家庭菜窖'
|
||||
END pName,
|
||||
bag.dateStart AS dateStart,
|
||||
bag.dateEnd AS dateEnd,
|
||||
card.state AS states,
|
||||
card.serialNumber AS serialNumber,
|
||||
card.isItInvalid,
|
||||
card.bindDate,
|
||||
card.isTransfer,
|
||||
card.isEnable,
|
||||
card.`code`,
|
||||
card.isReservation
|
||||
FROM lpk_giftcard card
|
||||
LEFT JOIN lpk_giftbag bag ON card.giftbagSid = bag.sid
|
||||
WHERE card.customerSid = #{customerSid}
|
||||
UNION
|
||||
SELECT
|
||||
card.sid as sid,
|
||||
card.state AS state,
|
||||
CASE card.state
|
||||
WHEN 3 THEN '未提货'
|
||||
WHEN 4 THEN '已经预约提货(预约部分提货)'
|
||||
WHEN 5 THEN '已经提取完成'
|
||||
END stateValue,
|
||||
CASE
|
||||
WHEN card.sid IS NOT NULL THEN '2'
|
||||
END logo,
|
||||
CASE
|
||||
when card.sid IS NOT NULL THEN '2'
|
||||
END type,
|
||||
CASE card.isSenior
|
||||
WHEN 1 THEN '家庭菜窖'
|
||||
WHEN 2 THEN '亲情菜窖'
|
||||
END pName,
|
||||
card.startDate AS dateStart,
|
||||
card.endDate AS dateEnd,
|
||||
card.state AS states,
|
||||
card.serialNumber AS serialNumber,
|
||||
card.isItInvalid,
|
||||
card.bindDate,
|
||||
card.isTransfer,
|
||||
card.isEnable,
|
||||
card.`code`,
|
||||
card.isReservation
|
||||
SELECT card.sid as sid,
|
||||
card.state AS state,
|
||||
CASE card.state
|
||||
WHEN 3 THEN '未提货'
|
||||
WHEN 4 THEN '已经预约提货(预约部分提货)'
|
||||
WHEN 5 THEN '已经提取完成'
|
||||
END stateValue,
|
||||
CASE
|
||||
WHEN card.sid IS NOT NULL THEN '2'
|
||||
END logo,
|
||||
CASE
|
||||
when card.sid IS NOT NULL THEN '2'
|
||||
END type,
|
||||
CASE card.isSenior
|
||||
WHEN 1 THEN '家庭菜窖'
|
||||
WHEN 2 THEN '亲情菜窖'
|
||||
END pName,
|
||||
card.startDate AS dateStart,
|
||||
card.endDate AS dateEnd,
|
||||
card.state AS states,
|
||||
card.serialNumber AS serialNumber,
|
||||
card.isItInvalid,
|
||||
card.bindDate,
|
||||
card.isTransfer,
|
||||
card.isEnable,
|
||||
card.`code`,
|
||||
card.isReservation
|
||||
FROM emp_card_gift card
|
||||
LEFT JOIN emp_card emp ON emp.sid = card.empCardSid
|
||||
LEFT JOIN lpk_giftbag gif ON gif.sid = emp.giftbagSid
|
||||
WHERE card.customerSid = #{customerSid}
|
||||
UNION
|
||||
SELECT
|
||||
card.sid as sid,
|
||||
card.state AS state,
|
||||
CASE
|
||||
card.state
|
||||
WHEN 3 THEN '未提货'
|
||||
WHEN 4 THEN '已经预约提货(预约部分提货)'
|
||||
WHEN 5 THEN '已经提取完成'
|
||||
END stateValue,
|
||||
CASE
|
||||
WHEN card.sid IS NOT NULL THEN '3'
|
||||
END logo,
|
||||
CASE
|
||||
WHEN card.sid IS NOT NULL THEN '3'
|
||||
END type,
|
||||
CASE
|
||||
WHEN card.sid IS NOT NULL THEN '企业菜窖'
|
||||
END pName,
|
||||
bag.dateStart AS dateStart,
|
||||
bag.dateEnd AS dateEnd,
|
||||
card.state AS states,
|
||||
card.serialNumber AS serialNumber,
|
||||
card.isItInvalid,
|
||||
card.bindDate,
|
||||
card.isTransfer,
|
||||
card.isEnable,
|
||||
card.`code`,
|
||||
card.isReservation
|
||||
SELECT card.sid as sid,
|
||||
card.state AS state,
|
||||
CASE
|
||||
card.state
|
||||
WHEN 3 THEN '未提货'
|
||||
WHEN 4 THEN '已经预约提货(预约部分提货)'
|
||||
WHEN 5 THEN '已经提取完成'
|
||||
END stateValue,
|
||||
CASE
|
||||
WHEN card.sid IS NOT NULL THEN '3'
|
||||
END logo,
|
||||
CASE
|
||||
WHEN card.sid IS NOT NULL THEN '3'
|
||||
END type,
|
||||
CASE
|
||||
WHEN card.sid IS NOT NULL THEN '企业菜窖'
|
||||
END pName,
|
||||
bag.dateStart AS dateStart,
|
||||
bag.dateEnd AS dateEnd,
|
||||
card.state AS states,
|
||||
card.serialNumber AS serialNumber,
|
||||
card.isItInvalid,
|
||||
card.bindDate,
|
||||
card.isTransfer,
|
||||
card.isEnable,
|
||||
card.`code`,
|
||||
card.isReservation
|
||||
FROM emp_card card
|
||||
LEFT JOIN lpk_giftbag bag ON card.giftbagSid = bag.sid
|
||||
WHERE card.customerSid = #{customerSid}
|
||||
@@ -325,16 +322,14 @@
|
||||
</where>
|
||||
</select>
|
||||
<select id="getGoodsList" resultType="com.yxt.yythmall.api.vegetablecellar.vegeVo">
|
||||
SELECT
|
||||
e.sid as goodsSid,
|
||||
e.name as goodsName,
|
||||
d.goodsNumber as goodsNumber,
|
||||
e.brandId as e.brandId,
|
||||
e.cetegoryId as cetegoryId
|
||||
FROM
|
||||
lpk_giftcard gi
|
||||
left join emp_card_gift_goods d on d.empCardGiftSid=gi.sid
|
||||
left join lpk_goods e on e.sid =d.goodsSid
|
||||
where gi.sid=#{sid}
|
||||
SELECT e.sid as goodsSid,
|
||||
e.name as goodsName,
|
||||
d.goodsNumber as goodsNumber,
|
||||
e.brandId as brandId,
|
||||
e.categoryId as categoryId
|
||||
FROM lpk_giftcard gi
|
||||
left join lpk_giftbag_goods d on d.giftbagSid = gi.giftbagSid
|
||||
left join lpk_goods e on e.sid = d.goodsSid
|
||||
where gi.sid = #{sid}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -201,12 +201,11 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
||||
baseMapper.updateById(lpkGiftCard);
|
||||
List<vegeVo> k = baseMapper.getGoodsList(lpkGiftCard.getSid());
|
||||
VegetableCellarDto dto = new VegetableCellarDto();
|
||||
//生成绑卡流水
|
||||
|
||||
//加入菜窖
|
||||
dto.setCustomerSid(dto.getCustomerSid());
|
||||
dto.setCustomerSid(bindCardDto.getCustomerSid());
|
||||
dto.setVos(k);
|
||||
vegetableCellarService.save1Goods(dto);
|
||||
//生成绑卡流水
|
||||
vegeReplenishService.saveBindRecord(bindCardDto, "0");
|
||||
return rb.success().setMsg("绑定成功");
|
||||
}
|
||||
|
||||
@@ -94,8 +94,8 @@
|
||||
s.weight ,
|
||||
r.goodsNumber as goodsNumber
|
||||
FROM
|
||||
lpk_goods s
|
||||
LEFT JOIN vegetable_cellar r ON s.sid = r.goodsSid
|
||||
vegetable_cellar r
|
||||
LEFT JOIN lpk_goods s ON s.sid = r.goodsSid
|
||||
WHERE
|
||||
r.customerSid =#{query.customerSid} and r.affiliation =#{query.affiliation}
|
||||
</select>
|
||||
@@ -125,6 +125,6 @@
|
||||
order by createTime desc
|
||||
</select>
|
||||
<select id="getType" resultType="com.yxt.yythmall.api.lpkgoods.GoodsTypeVo">
|
||||
select name , id as id from pms_product_category where parent_id=0
|
||||
select name , id as id from pms_product_category where parent_id=0 and show_status=1
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -266,7 +266,7 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods
|
||||
if(l.size()==0){
|
||||
giftBagGoodss.forEach(d->{
|
||||
// d.setIconUrl(fileUploadComponent.getUrlPrefix()+d.getIconUrl());
|
||||
d.setMefenPrice(String.valueOf((int)(Double.valueOf(d.getPrice())* Double.valueOf(d.getWeight()))));
|
||||
d.setMefenPrice(removeZeros(String.valueOf((Double.valueOf(d.getPrice())* Double.valueOf(d.getWeight())))));
|
||||
});
|
||||
}else{
|
||||
l.forEach(s->{
|
||||
@@ -275,11 +275,25 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods
|
||||
d.setGoodsNumber(s.getGoodsNumber());
|
||||
}
|
||||
// d.setIconUrl(fileUploadComponent.getUrlPrefix()+d.getIconUrl());
|
||||
d.setMefenPrice(String.valueOf((int)(Double.valueOf(d.getPrice())* Double.valueOf(d.getWeight()))));
|
||||
d.setMefenPrice(removeZeros(String.valueOf((Double.valueOf(d.getPrice())* Double.valueOf(d.getWeight())))));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return rb.success().setData(giftBagGoodss);
|
||||
}
|
||||
/**
|
||||
* 去除多余.0
|
||||
* @param num
|
||||
* @return
|
||||
*/
|
||||
public static String removeZeros(String num) {
|
||||
if (num.indexOf(".") > 0) {
|
||||
// 去掉多余的0
|
||||
num = num.replaceAll("0+?$", "");
|
||||
// 如果最后一位是. 则去掉
|
||||
num = num.replaceAll("[.]$", "");
|
||||
}
|
||||
return num;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,15 +18,21 @@ import java.util.List;
|
||||
@Mapper
|
||||
public interface LpkReserveOrderMapper extends BaseMapper<LpkReserveOrder> {
|
||||
IPage<LpkReserveOrderVo> orderList(IPage<LpkReserveOrder> page,@Param("qw") LpkReserveOrderQuery qw);
|
||||
IPage<LpkReserveOrderVo> orderList1(IPage<LpkReserveOrder> page,@Param("qw") LpkReserveOrderQuery qw);
|
||||
IPage<LpkReserveOrderVo> orderList2(IPage<LpkReserveOrder> page,@Param("qw") LpkReserveOrderQuery qw);
|
||||
IPage<LpkReserveOrderVo> orderList3(IPage<LpkReserveOrder> page,@Param("qw") LpkReserveOrderQuery qw);
|
||||
IPage<LpkReserveOrderVo> orderListByStore(IPage<LpkReserveOrder> page, @Param(Constants.WRAPPER) QueryWrapper<LpkReserveOrder> qw);
|
||||
IPage<LpkReserveOrderVo> orderListByBank(IPage<LpkReserveOrder> page, @Param(Constants.WRAPPER) QueryWrapper<LpkReserveOrder> qw);
|
||||
IPage<LpkReserveOrderVo> orderListByZ(IPage<LpkReserveOrder> page, @Param(Constants.WRAPPER) QueryWrapper<LpkReserveOrder> qw);
|
||||
List<LpkReserveOrderCardVo> orderByCardSid(String sid);
|
||||
|
||||
// IPage<LpkReserveOrderCardVo> orderListByUserSid(IPage<LpkReserveOrder> page, @Param(Constants.WRAPPER) QueryWrapper<LpkReserveOrder> qw);
|
||||
// IPage<LpkReserveOrderCardVo> orderListByUserSid(IPage<LpkReserveOrder> page, @Param(Constants.WRAPPER) QueryWrapper<LpkReserveOrder> qw);
|
||||
IPage<LpkReserveOrderCardVo> orderListByUserSid(IPage<LpkReserveOrder> page, @Param("userSid")String userSid);
|
||||
|
||||
List<ReserveOrderExport> exportExcel(@Param("qw") LpkReserveOrderQuery qw);
|
||||
List<ReserveOrderExport> exportExcel1(@Param("qw") LpkReserveOrderQuery qw);
|
||||
List<ReserveOrderExport> exportExcel2(@Param("qw") LpkReserveOrderQuery qw);
|
||||
List<ReserveOrderExport> exportExcel3(@Param("qw") LpkReserveOrderQuery qw);
|
||||
List<ReserveOrderExportByStore> exportExcelByStore(@Param(Constants.WRAPPER) QueryWrapper<LpkReserveOrderQuery> qw);
|
||||
List<ReserveOrderExportByBank> exportExcelByBank(@Param(Constants.WRAPPER) QueryWrapper<LpkReserveOrderQuery> qw);
|
||||
List<ReserveOrderExportByZ> exportExcelByZ(@Param(Constants.WRAPPER) QueryWrapper<LpkReserveOrderQuery> qw);
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
s.sid as ssid,
|
||||
c.serialNumber,
|
||||
case o.cardType
|
||||
when 1 then '家庭卡'
|
||||
when 1 then '家庭菜窖'
|
||||
end cardType
|
||||
FROM
|
||||
lpk_reserve_order AS o
|
||||
@@ -42,9 +42,6 @@
|
||||
LEFT JOIN lpk_bank AS d ON d.sid = s.bankSid
|
||||
<where>
|
||||
o.cardType='1'
|
||||
<if test="qw.bankSid !='' and qw.bankSid!=null">
|
||||
and s.bankSid=#{qw.bankSid}
|
||||
</if>
|
||||
<if test="qw.store !='' and qw.store!=null">
|
||||
and s.name=#{qw.store}
|
||||
</if>
|
||||
@@ -69,7 +66,7 @@
|
||||
s.sid as ssid,
|
||||
c.serialNumber,
|
||||
case o.cardType
|
||||
when 2 then '亲情卡'
|
||||
when 2 then '亲情菜窖'
|
||||
end cardType
|
||||
FROM
|
||||
lpk_reserve_order AS o
|
||||
@@ -106,7 +103,7 @@
|
||||
s.sid as ssid,
|
||||
c.serialNumber,
|
||||
case o.cardType
|
||||
when 3 then '企业卡'
|
||||
when 3 then '企业菜窖'
|
||||
end cardType
|
||||
FROM
|
||||
lpk_reserve_order AS o
|
||||
@@ -114,7 +111,129 @@
|
||||
LEFT JOIN emp_card AS c ON o.cardSid = c.sid
|
||||
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
||||
LEFT JOIN lpk_bank AS d ON d.sid = s.bankSid
|
||||
WHERE o.cardType='3'
|
||||
<where>
|
||||
o.cardType='3'
|
||||
<if test="qw.bankSid !='' and qw.bankSid!=null">
|
||||
and s.bankSid=#{qw.bankSid}
|
||||
</if>
|
||||
<if test="qw.store !='' and qw.store!=null">
|
||||
and s.name=#{qw.store}
|
||||
</if>
|
||||
<if test="qw.startDate !='' and qw.startDate!=null">
|
||||
and date_format(o.reserveDate,'%Y-%m-%d')>=date_format(#{qw.startDate},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="qw.endDate !='' and qw.endDate!=null">
|
||||
and date_format(o.reserveDate,'%Y-%m-%d') <= date_format(#{qw.endDate},'%Y-%m-%d')
|
||||
</if>
|
||||
</where>
|
||||
order by reserveDate asc,dsid desc,ssid desc,serialNumber asc
|
||||
</select>
|
||||
<select id="orderList1" resultType="com.yxt.yythmall.api.lpkreserveorder.LpkReserveOrderVo">
|
||||
SELECT
|
||||
o.sid,
|
||||
date_format( o.reserveDate, '%Y-%m-%d' ) AS reserveDate,
|
||||
o.userName,
|
||||
o.userPhone,
|
||||
s.`name` AS store,
|
||||
b.`name` AS bagName,
|
||||
d.NAME AS bankName,
|
||||
c.`code`,
|
||||
d.sid as dsid,
|
||||
s.sid as ssid,
|
||||
c.serialNumber,
|
||||
case o.cardType
|
||||
when 1 then '家庭菜窖'
|
||||
end cardType
|
||||
FROM
|
||||
lpk_reserve_order AS o
|
||||
LEFT JOIN lpk_store AS s ON o.storeSid = s.sid
|
||||
LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid
|
||||
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
||||
LEFT JOIN lpk_bank AS d ON d.sid = s.bankSid
|
||||
<where>
|
||||
o.cardType='1'
|
||||
<if test="qw.store !='' and qw.store!=null">
|
||||
and s.name=#{qw.store}
|
||||
</if>
|
||||
<if test="qw.startDate !='' and qw.startDate!=null">
|
||||
and date_format(o.reserveDate,'%Y-%m-%d')>=date_format(#{qw.startDate},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="qw.endDate !='' and qw.endDate!=null">
|
||||
and date_format(o.reserveDate,'%Y-%m-%d') <= date_format(#{qw.endDate},'%Y-%m-%d')
|
||||
</if>
|
||||
</where>
|
||||
order by reserveDate asc,dsid desc,ssid desc,serialNumber asc
|
||||
</select>
|
||||
<select id="orderList2" resultType="com.yxt.yythmall.api.lpkreserveorder.LpkReserveOrderVo">
|
||||
SELECT
|
||||
o.sid,
|
||||
date_format( o.reserveDate, '%Y-%m-%d' ) AS reserveDate,
|
||||
o.userName,
|
||||
o.userPhone,
|
||||
s.`name` AS store,
|
||||
b.`name` AS bagName,
|
||||
d.NAME AS bankName,
|
||||
c.`code`,
|
||||
d.sid as dsid,
|
||||
s.sid as ssid,
|
||||
c.serialNumber,
|
||||
case o.cardType
|
||||
when 2 then '亲情菜窖'
|
||||
end cardType
|
||||
FROM
|
||||
lpk_reserve_order AS o
|
||||
LEFT JOIN lpk_store AS s ON o.storeSid = s.sid
|
||||
LEFT JOIN emp_card_gift AS c ON o.cardSid = c.sid
|
||||
LEFT JOIN lpk_giftbag AS b ON c.sid = b.sid
|
||||
LEFT JOIN lpk_bank AS d ON d.sid = s.bankSid
|
||||
<where>
|
||||
o.cardType='2'
|
||||
<if test="qw.store !='' and qw.store!=null">
|
||||
and s.name=#{qw.store}
|
||||
</if>
|
||||
<if test="qw.startDate !='' and qw.startDate!=null">
|
||||
and date_format(o.reserveDate,'%Y-%m-%d')>=date_format(#{qw.startDate},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="qw.endDate !='' and qw.endDate!=null">
|
||||
and date_format(o.reserveDate,'%Y-%m-%d') <= date_format(#{qw.endDate},'%Y-%m-%d')
|
||||
</if>
|
||||
</where>
|
||||
order by reserveDate asc,dsid desc,ssid desc,serialNumber asc
|
||||
</select>
|
||||
<select id="orderList3" resultType="com.yxt.yythmall.api.lpkreserveorder.LpkReserveOrderVo">
|
||||
SELECT
|
||||
o.sid,
|
||||
date_format( o.reserveDate, '%Y-%m-%d' ) AS reserveDate,
|
||||
o.userName,
|
||||
o.userPhone,
|
||||
s.`name` AS store,
|
||||
b.`name` AS bagName,
|
||||
d.NAME AS bankName,
|
||||
c.`code`,
|
||||
d.sid as dsid,
|
||||
s.sid as ssid,
|
||||
c.serialNumber,
|
||||
case o.cardType
|
||||
when 3 then '企业菜窖'
|
||||
end cardType
|
||||
FROM
|
||||
lpk_reserve_order AS o
|
||||
LEFT JOIN lpk_store AS s ON o.storeSid = s.sid
|
||||
LEFT JOIN emp_card AS c ON o.cardSid = c.sid
|
||||
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
||||
LEFT JOIN lpk_bank AS d ON d.sid = s.bankSid
|
||||
<where>
|
||||
o.cardType='3'
|
||||
<if test="qw.store !='' and qw.store!=null">
|
||||
and s.name=#{qw.store}
|
||||
</if>
|
||||
<if test="qw.startDate !='' and qw.startDate!=null">
|
||||
and date_format(o.reserveDate,'%Y-%m-%d')>=date_format(#{qw.startDate},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="qw.endDate !='' and qw.endDate!=null">
|
||||
and date_format(o.reserveDate,'%Y-%m-%d') <= date_format(#{qw.endDate},'%Y-%m-%d')
|
||||
</if>
|
||||
</where>
|
||||
order by reserveDate asc,dsid desc,ssid desc,serialNumber asc
|
||||
</select>
|
||||
<select id="orderListByStore" resultType="com.yxt.yythmall.api.lpkreserveorder.LpkReserveOrderVo">
|
||||
@@ -126,20 +245,18 @@
|
||||
d.name as bankName,
|
||||
t.goodsSid as goodsSid,
|
||||
sum(t.goodsNumber) as goodsNumber,
|
||||
d.linker,
|
||||
d.linkPhone,
|
||||
d.address,
|
||||
s.linker,
|
||||
s.phone as linkPhone,
|
||||
s.address,
|
||||
e.`name` as goodsName,
|
||||
case o.cardType
|
||||
when 1 then '家庭卡'
|
||||
when 2 then '亲情卡'
|
||||
when 3 then '企业卡'
|
||||
when 1 then '家庭菜窖'
|
||||
when 2 then '亲情菜窖'
|
||||
when 3 then '企业菜窖'
|
||||
end cardType
|
||||
from lpk_reserve_order as o
|
||||
LEFT JOIN lpk_reserve_order_goods AS t ON t.orderSid = o.sid
|
||||
left join lpk_store as s on o.storeSid = s.sid
|
||||
LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid
|
||||
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
||||
left join lpk_bank as d on d.sid =s.bankSid
|
||||
left join lpk_goods e on e.sid= t.goodsSid
|
||||
<where>
|
||||
@@ -155,20 +272,18 @@
|
||||
d.name as bankName,
|
||||
t.goodsSid as goodsSid,
|
||||
sum(t.goodsNumber) as goodsNumber,
|
||||
s.linker,
|
||||
s.phone as linkPhone,
|
||||
s.address,
|
||||
d.linker,
|
||||
d.linkPhone as linkPhone,
|
||||
d.address,
|
||||
case o.cardType
|
||||
when 1 then '家庭卡'
|
||||
when 2 then '亲情卡'
|
||||
when 3 then '企业卡'
|
||||
when 1 then '家庭菜窖'
|
||||
when 2 then '亲情菜窖'
|
||||
when 3 then '企业菜窖'
|
||||
end cardType,
|
||||
e.`name` as goodsName
|
||||
from lpk_reserve_order as o
|
||||
LEFT JOIN lpk_reserve_order_goods AS t ON t.orderSid = o.sid
|
||||
left join lpk_store as s on o.storeSid = s.sid
|
||||
LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid
|
||||
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
||||
left join lpk_bank as d on d.sid =s.bankSid
|
||||
left join lpk_goods e on e.sid= t.goodsSid
|
||||
<where>
|
||||
@@ -185,17 +300,15 @@
|
||||
t.goodsSid as goodsSid,
|
||||
sum(t.goodsNumber) as goodsNumber,
|
||||
case o.cardType
|
||||
when 1 then '家庭卡'
|
||||
when 2 then '亲情卡'
|
||||
when 3 then '企业卡'
|
||||
when 1 then '家庭菜窖'
|
||||
when 2 then '亲情菜窖'
|
||||
when 3 then '企业菜窖'
|
||||
end cardType,
|
||||
e.`name` as goodsName
|
||||
FROM
|
||||
lpk_reserve_order AS o
|
||||
LEFT JOIN lpk_reserve_order_goods AS t ON t.orderSid = o.sid
|
||||
LEFT JOIN lpk_store AS s ON o.storeSid = s.sid
|
||||
LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid
|
||||
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
||||
LEFT JOIN lpk_bank AS d ON d.sid = s.bankSid
|
||||
LEFT JOIN lpk_goods e on e.sid =t.goodsSid
|
||||
<where>
|
||||
@@ -215,41 +328,42 @@
|
||||
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
||||
WHERE o.cardSid = #{sid}
|
||||
</select>
|
||||
<!-- <select id="orderListByUserSid" resultType="com.yxt.yythmall.api.lpkreserveorder.LpkReserveOrderCardVo">-->
|
||||
<!-- SELECT date_format(o.reserveDate, '%Y-%m-%d') as reserveDate,-->
|
||||
<!-- c.`code`,-->
|
||||
<!-- case-->
|
||||
<!-- when o.reserveDate IS NOT NULL then 1-->
|
||||
<!-- end as type,-->
|
||||
<!-- s.`name` as store,-->
|
||||
<!-- b.`name` as bagName,-->
|
||||
<!-- o.cardSid as cardSid,-->
|
||||
<!-- o.sid as orderSid,-->
|
||||
<!-- o.userName,-->
|
||||
<!-- o.userPhone,c.serialNumber as serialNumber,-->
|
||||
<!-- o.sid-->
|
||||
<!-- FROM lpk_reserve_order AS o-->
|
||||
<!-- LEFT JOIN lpk_store AS s ON o.storeSid = s.sid-->
|
||||
<!-- LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid-->
|
||||
<!-- LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid-->
|
||||
<!-- <where>-->
|
||||
<!-- ${ew.sqlSegment}-->
|
||||
<!-- </where>-->
|
||||
<!-- ORDER BY reserveDate DESC-->
|
||||
<!-- </select>-->
|
||||
<!-- <select id="orderListByUserSid" resultType="com.yxt.yythmall.api.lpkreserveorder.LpkReserveOrderCardVo">-->
|
||||
<!-- SELECT date_format(o.reserveDate, '%Y-%m-%d') as reserveDate,-->
|
||||
<!-- c.`code`,-->
|
||||
<!-- case-->
|
||||
<!-- when o.reserveDate IS NOT NULL then 1-->
|
||||
<!-- end as type,-->
|
||||
<!-- s.`name` as store,-->
|
||||
<!-- b.`name` as bagName,-->
|
||||
<!-- o.cardSid as cardSid,-->
|
||||
<!-- o.sid as orderSid,-->
|
||||
<!-- o.userName,-->
|
||||
<!-- o.userPhone,c.serialNumber as serialNumber,-->
|
||||
<!-- o.sid-->
|
||||
<!-- FROM lpk_reserve_order AS o-->
|
||||
<!-- LEFT JOIN lpk_store AS s ON o.storeSid = s.sid-->
|
||||
<!-- LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid-->
|
||||
<!-- LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid-->
|
||||
<!-- <where>-->
|
||||
<!-- ${ew.sqlSegment}-->
|
||||
<!-- </where>-->
|
||||
<!-- ORDER BY reserveDate DESC-->
|
||||
<!-- </select>-->
|
||||
<select id="orderListByUserSid" resultType="com.yxt.yythmall.api.lpkreserveorder.LpkReserveOrderCardVo">
|
||||
SELECT date_format(o.reserveDate, '%Y-%m-%d') as reserveDate,
|
||||
c.`code`,
|
||||
o.cardType as type,
|
||||
s.`name` as store,
|
||||
case
|
||||
when o.sid is not null then '家庭菜窖'
|
||||
when o.sid is not null then '家庭菜窖'
|
||||
end as bagName,
|
||||
o.cardSid as cardSid,
|
||||
o.sid as orderSid,
|
||||
o.userName,
|
||||
o.userPhone,c.serialNumber as serialNumber,
|
||||
o.sid
|
||||
o.sid,
|
||||
s.phone
|
||||
FROM lpk_reserve_order AS o
|
||||
LEFT JOIN lpk_store AS s ON o.storeSid = s.sid
|
||||
LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid
|
||||
@@ -269,7 +383,8 @@
|
||||
o.sid as orderSid,
|
||||
o.userName,
|
||||
o.userPhone,c.serialNumber as serialNumber,
|
||||
o.sid
|
||||
o.sid,
|
||||
s.phone
|
||||
FROM lpk_reserve_order AS o
|
||||
LEFT JOIN lpk_store AS s ON o.storeSid = s.sid
|
||||
LEFT JOIN emp_card_gift AS c ON o.cardSid = c.sid
|
||||
@@ -289,7 +404,8 @@
|
||||
o.sid as orderSid,
|
||||
o.userName,
|
||||
o.userPhone,c.serialNumber as serialNumber,
|
||||
o.sid
|
||||
o.sid,
|
||||
s.phone
|
||||
FROM lpk_reserve_order AS o
|
||||
LEFT JOIN lpk_store AS s ON o.storeSid = s.sid
|
||||
LEFT JOIN emp_card AS c ON o.cardSid = c.sid
|
||||
@@ -300,33 +416,36 @@
|
||||
ORDER BY reserveDate DESC
|
||||
</select>
|
||||
<select id="exportExcel" resultType="com.yxt.yythmall.api.lpkreserveorder.ReserveOrderExport">
|
||||
select
|
||||
SELECT
|
||||
o.sid,
|
||||
date_format(o.reserveDate, '%Y-%m-%d') as reserveDate,
|
||||
date_format( o.reserveDate, '%Y-%m-%d' ) AS reserveDate,
|
||||
o.userName,
|
||||
o.userPhone,
|
||||
s.`name` AS store,
|
||||
b.`name` AS bagName,
|
||||
d.NAME AS bankName,
|
||||
c.`code`,
|
||||
d.sid as dsid,
|
||||
s.sid as ssid,
|
||||
s.`name` as store,
|
||||
b.`name` as bagName,
|
||||
d.name as bankName,
|
||||
c.`code`,c.serialNumber,
|
||||
c.serialNumber,
|
||||
case o.cardType
|
||||
when 1 then '家庭菜窖'
|
||||
end cardType,
|
||||
t.goodsSid as goodsSid,
|
||||
t.goodsNumber as goodsNumber,
|
||||
case o.cardType
|
||||
when 1 then '家庭卡'
|
||||
end cardType
|
||||
from lpk_reserve_order as o
|
||||
e.name as goodsName
|
||||
FROM
|
||||
lpk_reserve_order AS o
|
||||
LEFT JOIN lpk_reserve_order_goods AS t ON t.orderSid = o.sid
|
||||
left join lpk_store as s on o.storeSid = s.sid
|
||||
LEFT JOIN lpk_store AS s ON o.storeSid = s.sid
|
||||
LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid
|
||||
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
||||
left join lpk_bank as d on d.sid =s.bankSid
|
||||
LEFT JOIN lpk_bank AS d ON d.sid = s.bankSid
|
||||
left join lpk_goods e on e.sid= t.goodsSid
|
||||
<where>
|
||||
o.cardType='1'
|
||||
<if test="qw.bankSid !='' and qw.bankSid!=null">
|
||||
and s.bankSid=#{qw.bankSid}
|
||||
</if>
|
||||
1=1
|
||||
and o.cardType='1'
|
||||
|
||||
<if test="qw.store !='' and qw.store!=null">
|
||||
and s.name=#{qw.store}
|
||||
</if>
|
||||
@@ -338,30 +457,36 @@
|
||||
</if>
|
||||
</where>
|
||||
union
|
||||
select
|
||||
SELECT
|
||||
o.sid,
|
||||
date_format(o.reserveDate, '%Y-%m-%d') as reserveDate,
|
||||
date_format( o.reserveDate, '%Y-%m-%d' ) AS reserveDate,
|
||||
o.userName,
|
||||
o.userPhone,
|
||||
s.`name` AS store,
|
||||
b.`name` AS bagName,
|
||||
d.NAME AS bankName,
|
||||
c.`code`,
|
||||
d.sid as dsid,
|
||||
s.sid as ssid,
|
||||
s.`name` as store,
|
||||
b.`name` as bagName,
|
||||
d.name as bankName,
|
||||
c.`code`,c.serialNumber,
|
||||
c.serialNumber,
|
||||
case o.cardType
|
||||
when 2 then '亲情菜窖'
|
||||
end cardType,
|
||||
t.goodsSid as goodsSid,
|
||||
t.goodsNumber as goodsNumber,
|
||||
case o.cardType
|
||||
when 2 then '亲情卡'
|
||||
end cardType
|
||||
from lpk_reserve_order as o
|
||||
e.name as goodsName
|
||||
FROM
|
||||
lpk_reserve_order AS o
|
||||
LEFT JOIN lpk_reserve_order_goods AS t ON t.orderSid = o.sid
|
||||
left join lpk_store as s on o.storeSid = s.sid
|
||||
LEFT JOIN lpk_store AS s ON o.storeSid = s.sid
|
||||
LEFT JOIN emp_card_gift AS c ON o.cardSid = c.sid
|
||||
LEFT JOIN lpk_giftbag AS b ON c.sid = b.sid
|
||||
left join lpk_bank as d on d.sid =s.bankSid
|
||||
LEFT JOIN lpk_bank AS d ON d.sid = s.bankSid
|
||||
left join lpk_goods e on e.sid= t.goodsSid
|
||||
<where>
|
||||
o.cardType='2'
|
||||
1=1
|
||||
and o.cardType='2'
|
||||
|
||||
<if test="qw.bankSid !='' and qw.bankSid!=null">
|
||||
and s.bankSid=#{qw.bankSid}
|
||||
</if>
|
||||
@@ -389,15 +514,174 @@
|
||||
s.sid as ssid,
|
||||
c.serialNumber,
|
||||
case o.cardType
|
||||
when 3 then '企业卡'
|
||||
end cardType
|
||||
when 3 then '企业菜窖'
|
||||
end cardType,
|
||||
t.goodsSid as goodsSid,
|
||||
t.goodsNumber as goodsNumber,
|
||||
e.name as goodsName
|
||||
FROM
|
||||
lpk_reserve_order AS o
|
||||
LEFT JOIN lpk_reserve_order_goods AS t ON t.orderSid = o.sid
|
||||
LEFT JOIN lpk_store AS s ON o.storeSid = s.sid
|
||||
LEFT JOIN emp_card AS c ON o.cardSid = c.sid
|
||||
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
||||
LEFT JOIN lpk_bank AS d ON d.sid = s.bankSid
|
||||
WHERE o.cardType='3'
|
||||
left join lpk_goods e on e.sid= t.goodsSid
|
||||
<where>
|
||||
1=1
|
||||
and o.cardType='3'
|
||||
|
||||
<if test="qw.bankSid !='' and qw.bankSid!=null">
|
||||
and s.bankSid=#{qw.bankSid}
|
||||
</if>
|
||||
<if test="qw.store !='' and qw.store!=null">
|
||||
and s.name=#{qw.store}
|
||||
</if>
|
||||
<if test="qw.startDate !='' and qw.startDate!=null">
|
||||
and date_format(o.reserveDate,'%Y-%m-%d')>=date_format(#{qw.startDate},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="qw.endDate !='' and qw.endDate!=null">
|
||||
and date_format(o.reserveDate,'%Y-%m-%d') <= date_format(#{qw.endDate},'%Y-%m-%d')
|
||||
</if>
|
||||
|
||||
</where>
|
||||
order by reserveDate asc,dsid desc,ssid desc,serialNumber asc
|
||||
</select>
|
||||
<select id="exportExcel1" resultType="com.yxt.yythmall.api.lpkreserveorder.ReserveOrderExport">
|
||||
SELECT
|
||||
o.sid,
|
||||
date_format( o.reserveDate, '%Y-%m-%d' ) AS reserveDate,
|
||||
o.userName,
|
||||
o.userPhone,
|
||||
s.`name` AS store,
|
||||
b.`name` AS bagName,
|
||||
d.NAME AS bankName,
|
||||
c.`code`,
|
||||
d.sid as dsid,
|
||||
s.sid as ssid,
|
||||
c.serialNumber,
|
||||
case o.cardType
|
||||
when 1 then '家庭菜窖'
|
||||
end cardType,
|
||||
t.goodsSid as goodsSid,
|
||||
t.goodsNumber as goodsNumber,
|
||||
e.name as goodsName
|
||||
FROM
|
||||
lpk_reserve_order AS o
|
||||
LEFT JOIN lpk_reserve_order_goods AS t ON t.orderSid = o.sid
|
||||
LEFT JOIN lpk_store AS s ON o.storeSid = s.sid
|
||||
LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid
|
||||
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
||||
LEFT JOIN lpk_bank AS d ON d.sid = s.bankSid
|
||||
left join lpk_goods e on e.sid= t.goodsSid
|
||||
<where>
|
||||
1=1
|
||||
and o.cardType='1'
|
||||
|
||||
<if test="qw.store !='' and qw.store!=null">
|
||||
and s.name=#{qw.store}
|
||||
</if>
|
||||
<if test="qw.startDate !='' and qw.startDate!=null">
|
||||
and date_format(o.reserveDate,'%Y-%m-%d')>=date_format(#{qw.startDate},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="qw.endDate !='' and qw.endDate!=null">
|
||||
and date_format(o.reserveDate,'%Y-%m-%d') <= date_format(#{qw.endDate},'%Y-%m-%d')
|
||||
</if>
|
||||
</where>
|
||||
order by reserveDate asc,dsid desc,ssid desc,serialNumber asc
|
||||
</select>
|
||||
<select id="exportExcel2" resultType="com.yxt.yythmall.api.lpkreserveorder.ReserveOrderExport">
|
||||
|
||||
SELECT
|
||||
o.sid,
|
||||
date_format( o.reserveDate, '%Y-%m-%d' ) AS reserveDate,
|
||||
o.userName,
|
||||
o.userPhone,
|
||||
s.`name` AS store,
|
||||
b.`name` AS bagName,
|
||||
d.NAME AS bankName,
|
||||
c.`code`,
|
||||
d.sid as dsid,
|
||||
s.sid as ssid,
|
||||
c.serialNumber,
|
||||
case o.cardType
|
||||
when 2 then '亲情菜窖'
|
||||
end cardType,
|
||||
t.goodsSid as goodsSid,
|
||||
t.goodsNumber as goodsNumber,
|
||||
e.name as goodsName
|
||||
FROM
|
||||
lpk_reserve_order AS o
|
||||
LEFT JOIN lpk_reserve_order_goods AS t ON t.orderSid = o.sid
|
||||
LEFT JOIN lpk_store AS s ON o.storeSid = s.sid
|
||||
LEFT JOIN emp_card_gift AS c ON o.cardSid = c.sid
|
||||
LEFT JOIN lpk_giftbag AS b ON c.sid = b.sid
|
||||
LEFT JOIN lpk_bank AS d ON d.sid = s.bankSid
|
||||
left join lpk_goods e on e.sid= t.goodsSid
|
||||
<where>
|
||||
1=1
|
||||
and o.cardType='2'
|
||||
|
||||
<if test="qw.bankSid !='' and qw.bankSid!=null">
|
||||
and s.bankSid=#{qw.bankSid}
|
||||
</if>
|
||||
<if test="qw.store !='' and qw.store!=null">
|
||||
and s.name=#{qw.store}
|
||||
</if>
|
||||
<if test="qw.startDate !='' and qw.startDate!=null">
|
||||
and date_format(o.reserveDate,'%Y-%m-%d')>=date_format(#{qw.startDate},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="qw.endDate !='' and qw.endDate!=null">
|
||||
and date_format(o.reserveDate,'%Y-%m-%d') <= date_format(#{qw.endDate},'%Y-%m-%d')
|
||||
</if>
|
||||
</where>
|
||||
order by reserveDate asc,dsid desc,ssid desc,serialNumber asc
|
||||
</select>
|
||||
<select id="exportExcel3" resultType="com.yxt.yythmall.api.lpkreserveorder.ReserveOrderExport">
|
||||
SELECT
|
||||
o.sid,
|
||||
date_format( o.reserveDate, '%Y-%m-%d' ) AS reserveDate,
|
||||
o.userName,
|
||||
o.userPhone,
|
||||
s.`name` AS store,
|
||||
b.`name` AS bagName,
|
||||
d.NAME AS bankName,
|
||||
c.`code`,
|
||||
d.sid as dsid,
|
||||
s.sid as ssid,
|
||||
c.serialNumber,
|
||||
case o.cardType
|
||||
when 3 then '企业菜窖'
|
||||
end cardType,
|
||||
t.goodsSid as goodsSid,
|
||||
t.goodsNumber as goodsNumber,
|
||||
e.name as goodsName
|
||||
FROM
|
||||
lpk_reserve_order AS o
|
||||
LEFT JOIN lpk_reserve_order_goods AS t ON t.orderSid = o.sid
|
||||
LEFT JOIN lpk_store AS s ON o.storeSid = s.sid
|
||||
LEFT JOIN emp_card AS c ON o.cardSid = c.sid
|
||||
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
||||
LEFT JOIN lpk_bank AS d ON d.sid = s.bankSid
|
||||
left join lpk_goods e on e.sid= t.goodsSid
|
||||
<where>
|
||||
1=1
|
||||
and o.cardType='3'
|
||||
|
||||
<if test="qw.bankSid !='' and qw.bankSid!=null">
|
||||
and s.bankSid=#{qw.bankSid}
|
||||
</if>
|
||||
<if test="qw.store !='' and qw.store!=null">
|
||||
and s.name=#{qw.store}
|
||||
</if>
|
||||
<if test="qw.startDate !='' and qw.startDate!=null">
|
||||
and date_format(o.reserveDate,'%Y-%m-%d')>=date_format(#{qw.startDate},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="qw.endDate !='' and qw.endDate!=null">
|
||||
and date_format(o.reserveDate,'%Y-%m-%d') <= date_format(#{qw.endDate},'%Y-%m-%d')
|
||||
</if>
|
||||
|
||||
</where>
|
||||
order by reserveDate asc,dsid desc,ssid desc,serialNumber asc
|
||||
</select>
|
||||
<select id="exportExcelByStore" resultType="com.yxt.yythmall.api.lpkreserveorder.ReserveOrderExportByStore">
|
||||
@@ -409,20 +693,18 @@
|
||||
d.name as bankName,
|
||||
t.goodsSid as goodsSid,
|
||||
sum(t.goodsNumber) as goodsNumber,
|
||||
d.linker,
|
||||
d.linkPhone,
|
||||
d.address,
|
||||
s.linker,
|
||||
s.phone as linkPhone,
|
||||
s.address,
|
||||
case o.cardType
|
||||
when 1 then '家庭卡'
|
||||
when 2 then '亲情卡'
|
||||
when 3 then '企业卡'
|
||||
when 1 then '家庭菜窖'
|
||||
when 2 then '亲情菜窖'
|
||||
when 3 then '企业菜窖'
|
||||
end cardType,
|
||||
e.name as goodsName
|
||||
from lpk_reserve_order as o
|
||||
LEFT JOIN lpk_reserve_order_goods AS t ON t.orderSid = o.sid
|
||||
left join lpk_store as s on o.storeSid = s.sid
|
||||
LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid
|
||||
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
||||
left join lpk_bank as d on d.sid =s.bankSid
|
||||
left join lpk_goods e on e.sid= t.goodsSid
|
||||
<where>
|
||||
@@ -438,20 +720,18 @@
|
||||
d.name as bankName,
|
||||
t.goodsSid as goodsSid,
|
||||
sum(t.goodsNumber) as goodsNumber,
|
||||
s.linker,
|
||||
s.phone as linkPhone,
|
||||
s.address,
|
||||
d.linker,
|
||||
d.linkPhone as linkPhone,
|
||||
d.address,
|
||||
case o.cardType
|
||||
when 1 then '家庭卡'
|
||||
when 2 then '亲情卡'
|
||||
when 3 then '企业卡'
|
||||
when 1 then '家庭菜窖'
|
||||
when 2 then '亲情菜窖'
|
||||
when 3 then '企业菜窖'
|
||||
end cardType,
|
||||
e.name as goodsName
|
||||
from lpk_reserve_order as o
|
||||
LEFT JOIN lpk_reserve_order_goods AS t ON t.orderSid = o.sid
|
||||
left join lpk_store as s on o.storeSid = s.sid
|
||||
LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid
|
||||
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
||||
left join lpk_bank as d on d.sid =s.bankSid
|
||||
left join lpk_goods e on e.sid= t.goodsSid
|
||||
<where>
|
||||
@@ -468,17 +748,15 @@
|
||||
t.goodsSid as goodsSid,
|
||||
sum(t.goodsNumber) as goodsNumber,
|
||||
case o.cardType
|
||||
when 1 then '家庭卡'
|
||||
when 2 then '亲情卡'
|
||||
when 3 then '企业卡'
|
||||
when 1 then '家庭菜窖'
|
||||
when 2 then '亲情菜窖'
|
||||
when 3 then '企业菜窖'
|
||||
end cardType,
|
||||
e.name as goodsName
|
||||
FROM
|
||||
lpk_reserve_order AS o
|
||||
LEFT JOIN lpk_reserve_order_goods AS t ON t.orderSid = o.sid
|
||||
LEFT JOIN lpk_store AS s ON o.storeSid = s.sid
|
||||
LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid
|
||||
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
||||
LEFT JOIN lpk_bank AS d ON d.sid = s.bankSid
|
||||
left join lpk_goods e on e.sid= t.goodsSid
|
||||
<where>
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.alibaba.excel.write.metadata.style.WriteCellStyle;
|
||||
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.yxt.common.base.config.component.FileUploadComponent;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.base.utils.PagerUtil;
|
||||
@@ -108,7 +109,16 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
LpkReserveOrderQuery query = pq.getParams();
|
||||
IPage<LpkReserveOrder> page = PagerUtil.queryToPage(pq);
|
||||
IPage<LpkReserveOrderVo> pagging = baseMapper.orderList(page, query);
|
||||
IPage<LpkReserveOrderVo> pagging=new Page<>();
|
||||
if(StringUtils.isBlank(query.getCardType())){
|
||||
pagging= baseMapper.orderList(page, query);
|
||||
}else if(query.getCardType().equals("1")){
|
||||
pagging= baseMapper.orderList1(page, query);
|
||||
}else if(query.getCardType().equals("2")){
|
||||
pagging= baseMapper.orderList2(page, query);
|
||||
}else if(query.getCardType().equals("3")){
|
||||
pagging= baseMapper.orderList3(page, query);
|
||||
}
|
||||
List<LpkReserveOrderVo> records = pagging.getRecords();
|
||||
if (!records.isEmpty()) {
|
||||
records.forEach(s -> {
|
||||
@@ -354,12 +364,22 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa
|
||||
|
||||
public void exportExcel(LpkReserveOrderQuery query) {
|
||||
//得到所有要导出的数据
|
||||
List<ReserveOrderExport> exportList = baseMapper.exportExcel(query);
|
||||
List<ReserveOrderExport> exportList = new ArrayList<>();
|
||||
|
||||
List<ReserveOrderExport> exportList1 = new ArrayList<>();
|
||||
if (!exportList.isEmpty()) {
|
||||
exportList.forEach(s -> {
|
||||
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(s.getGoodsSid());
|
||||
s.setGoodsName(lpkGoods.getName());
|
||||
if(StringUtils.isBlank(query.getCardType())){
|
||||
exportList= baseMapper.exportExcel( query);
|
||||
}else if(query.getCardType().equals("1")){
|
||||
exportList= baseMapper.exportExcel1( query);
|
||||
}else if(query.getCardType().equals("2")){
|
||||
exportList= baseMapper.exportExcel2( query);
|
||||
}else if(query.getCardType().equals("3")){
|
||||
exportList= baseMapper.exportExcel3( query);
|
||||
}
|
||||
// if (!exportList.isEmpty()) {
|
||||
// exportList.forEach(s -> {
|
||||
// LpkGoods lpkGoods = lpkGoodsService.fetchBySid(s.getGoodsSid());
|
||||
// s.setGoodsName(lpkGoods.getName());
|
||||
// if (StringUtils.isNotBlank(s.getUserPhone())) {
|
||||
//// String phone = s.getUserPhone().substring(0, 3) + "****" + s.getUserPhone().substring(7);
|
||||
// String phone = s.getUserPhone();
|
||||
@@ -398,8 +418,8 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
});
|
||||
}
|
||||
// });
|
||||
// }
|
||||
//定义导出的excel名字
|
||||
//定义导出的excel名字
|
||||
String excelName = "订单明细.xlsx";
|
||||
|
||||
@@ -47,34 +47,34 @@ public class LpkReserveOrderGoodsService extends MybatisBaseService<LpkReserveOr
|
||||
baseMapper.insert(goods);
|
||||
}
|
||||
}
|
||||
AppletVo vo = lpkGiftCardService.getGifCardBySid(dto.getSid()).getData();
|
||||
int i=0;
|
||||
for (com.yxt.yythmall.api.lpkgiftcard.GoodsVo vo1 : vo.getGoodsVos()) {
|
||||
EmpCardGiftGoodsVo goods1=empCardGiftGoodsService.recordListGoods(dto.getSid(),vo1.getGoodsSid()).getData();
|
||||
LpkReserveOrderGoods goods2 = baseMapper.getReserveByCardSid(dto.getSid(), vo1.getGoodsSid());
|
||||
double c=0;
|
||||
if(goods1==null){
|
||||
if(goods2==null){
|
||||
c=0;
|
||||
}else{
|
||||
c=goods2.getGoodsNumber();
|
||||
}
|
||||
}else{
|
||||
if(goods2==null){
|
||||
c=goods1.getGoodsNumber();
|
||||
}else{
|
||||
c=goods2.getGoodsNumber()+goods1.getGoodsNumber();
|
||||
}
|
||||
}
|
||||
if (vo1.getNum() <= c) {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
if (vo.getGoodsVos().size() == i) {
|
||||
lpkGiftCardService.changState(dto.getSid(), "5");
|
||||
} else {
|
||||
lpkGiftCardService.changState(dto.getSid(), "4");
|
||||
}
|
||||
// AppletVo vo = lpkGiftCardService.getGifCardBySid(dto.getSid()).getData();
|
||||
// int i=0;
|
||||
// for (com.yxt.yythmall.api.lpkgiftcard.GoodsVo vo1 : vo.getGoodsVos()) {
|
||||
// EmpCardGiftGoodsVo goods1=empCardGiftGoodsService.recordListGoods(dto.getSid(),vo1.getGoodsSid()).getData();
|
||||
// LpkReserveOrderGoods goods2 = baseMapper.getReserveByCardSid(dto.getSid(), vo1.getGoodsSid());
|
||||
// double c=0;
|
||||
// if(goods1==null){
|
||||
// if(goods2==null){
|
||||
// c=0;
|
||||
// }else{
|
||||
// c=goods2.getGoodsNumber();
|
||||
// }
|
||||
// }else{
|
||||
// if(goods2==null){
|
||||
// c=goods1.getGoodsNumber();
|
||||
// }else{
|
||||
// c=goods2.getGoodsNumber()+goods1.getGoodsNumber();
|
||||
// }
|
||||
// }
|
||||
// if (vo1.getNum() <= c) {
|
||||
// i++;
|
||||
// }
|
||||
// }
|
||||
// if (vo.getGoodsVos().size() == i) {
|
||||
// lpkGiftCardService.changState(dto.getSid(), "5");
|
||||
// } else {
|
||||
// lpkGiftCardService.changState(dto.getSid(), "4");
|
||||
// }
|
||||
return rb.success().setData("预约成功");
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.yxt.yythmall.biz.lpkstore;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
@@ -26,7 +27,7 @@ public class LpkStoreService extends MybatisBaseService<LpkStoreMapper, LpkStore
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
LpkStoreQuery query = pq.getParams();
|
||||
QueryWrapper<LpkStore> qw = new QueryWrapper<>();
|
||||
qw.eq("1","1");
|
||||
qw.eq("1", "1");
|
||||
if (StringUtils.isNotBlank(query.getName())) {
|
||||
qw.like("st.name", query.getName());
|
||||
}
|
||||
@@ -69,36 +70,45 @@ public class LpkStoreService extends MybatisBaseService<LpkStoreMapper, LpkStore
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public ResultBean<List<StoreSelect>> getAllStore(){
|
||||
ResultBean rb=new ResultBean();
|
||||
List<StoreSelect> vos= baseMapper.getAllStore();
|
||||
public ResultBean<List<StoreSelect>> getAllStore() {
|
||||
ResultBean rb = new ResultBean();
|
||||
List<StoreSelect> vos = baseMapper.getAllStore();
|
||||
return rb.success().setData(vos);
|
||||
}
|
||||
public ResultBean<List<LpkStoreVo>> getAllStoreByQuery(LpkStoreQuery query){
|
||||
ResultBean rb=new ResultBean();
|
||||
|
||||
public ResultBean<List<LpkStoreVo>> getAllStoreByQuery(LpkStoreQuery query) {
|
||||
ResultBean rb = new ResultBean();
|
||||
QueryWrapper<LpkStore> qw = new QueryWrapper<>();
|
||||
if (StringUtils.isNotBlank(query.getName())) {
|
||||
qw.like("name", query.getName());
|
||||
}
|
||||
qw.eq("isEnable", "1");
|
||||
qw.orderByDesc("sort");
|
||||
List<LpkStoreVo> vos= baseMapper.getAllStoreByQuery(qw);
|
||||
List<LpkStoreVo> vos = baseMapper.getAllStoreByQuery(qw);
|
||||
return rb.success().setData(vos);
|
||||
}
|
||||
public ResultBean updateIsEnable(String sid,String isEnable){
|
||||
ResultBean rb=new ResultBean();
|
||||
|
||||
public ResultBean updateIsEnable(String sid, String isEnable) {
|
||||
ResultBean rb = new ResultBean();
|
||||
LpkStore lpkStore = fetchBySid(sid);
|
||||
lpkStore.setIsEnable(isEnable);
|
||||
int i= baseMapper.updateById(lpkStore);
|
||||
int i = baseMapper.updateById(lpkStore);
|
||||
return rb.success().setMsg("修改成功");
|
||||
}
|
||||
|
||||
public ResultBean<List<StoreSelect>> getSelectStore() {
|
||||
ResultBean rb=new ResultBean();
|
||||
List<StoreSelect> vos= baseMapper.getSelectStore();
|
||||
ResultBean rb = new ResultBean();
|
||||
List<StoreSelect> vos = baseMapper.getSelectStore();
|
||||
return rb.success().setData(vos);
|
||||
}
|
||||
|
||||
public List<LpkStore> listStoreOfBank(String bankSid) {
|
||||
if (StrUtil.isBlank(bankSid))
|
||||
return this.list();
|
||||
QueryWrapper<LpkStore> qw = new QueryWrapper<>();
|
||||
qw.eq("bankSid", bankSid);
|
||||
return baseMapper.selectList(qw);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,6 @@ public interface NewcomerRecoRecordMapper extends BaseMapper<NewcomerRecoRecord>
|
||||
List<NewcomerRecoRecord> selInOrderSid(@Param("orderSids") List<String> orderSids);
|
||||
@Select("select *,goodsNumber as num from lpk_reserve_order_goods where orderSid=#{orderSid}")
|
||||
List<NewcomerRecoRecord> selByOrderSids(String orderSid);
|
||||
@Select("select * from newcomer_reco_record r where customerSid =#{customerSid} limit 5")
|
||||
@Select("select * from newcomer_reco_record r where r.customerSid =#{customerSid} and recommendedSid is not null limit 5")
|
||||
List<NewcomerRecoRecordVo> recordList(@Param("customerSid")String customerSid);
|
||||
}
|
||||
|
||||
@@ -5,10 +5,8 @@ import com.yxt.yythmall.api.newcomerrecorecord.NewcomerRecoRecordDto;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
@@ -24,15 +22,15 @@ public class NewcomerRecoRecordRest {
|
||||
|
||||
@ApiOperation("推荐新人用户")
|
||||
@PostMapping("/recommendNewUsers")
|
||||
public ResultBean recommendNewUsers(NewcomerRecoRecordDto dto){
|
||||
public ResultBean recommendNewUsers(@RequestBody NewcomerRecoRecordDto dto){
|
||||
return newcomerRecoRecordService.recommendNewUsers(dto);
|
||||
}
|
||||
@ApiOperation("新人助力")
|
||||
@PostMapping("/recommendedAssistance")
|
||||
public ResultBean recommendedAssistance(NewcomerRecoRecordDto dto){
|
||||
public ResultBean recommendedAssistance(@RequestBody NewcomerRecoRecordDto dto){
|
||||
return newcomerRecoRecordService.recommendedAssistance(dto);
|
||||
}
|
||||
@ApiOperation("新人助力")
|
||||
@ApiOperation("新人推荐列表")
|
||||
@PostMapping("/recordList/{customerSid}")
|
||||
public ResultBean recordList(@PathVariable("customerSid") String customerSid){
|
||||
return newcomerRecoRecordService.recordList(customerSid);
|
||||
|
||||
@@ -4,15 +4,23 @@ import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.base.utils.StringUtils;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.yythmall.api.appletgiftbag.AppletGiftBag;
|
||||
import com.yxt.yythmall.api.appletgiftbag.AppletGiftBagVo;
|
||||
import com.yxt.yythmall.api.appletgiftbag.RecommendRecord;
|
||||
import com.yxt.yythmall.api.appletgiftbaggoods.AppletGiftBagGoods;
|
||||
import com.yxt.yythmall.api.empcardgiftgoods.EmpCardGiftGoodsVo;
|
||||
import com.yxt.yythmall.api.lpkcustomer.LpkCustomer;
|
||||
import com.yxt.yythmall.api.lpkgiftcard.AppletVo;
|
||||
import com.yxt.yythmall.api.lpkgiftcard.GoodsVo;
|
||||
import com.yxt.yythmall.api.lpkgoods.LpkGoods;
|
||||
import com.yxt.yythmall.api.newcomerrecorecord.NewcomerRecoRecord;
|
||||
import com.yxt.yythmall.api.newcomerrecorecord.NewcomerRecoRecordDto;
|
||||
import com.yxt.yythmall.api.newcomerrecorecord.NewcomerRecoRecordVo;
|
||||
import com.yxt.yythmall.api.recommendnewuserbag.RecommendNewUserBag;
|
||||
import com.yxt.yythmall.api.recommendnewuserbag.RecommendNewUserBagVo;
|
||||
import com.yxt.yythmall.api.recommendnewuserbagdetails.RecommendNewUserBagDetails;
|
||||
import com.yxt.yythmall.api.vegetablecellar.VegetableCellarDto;
|
||||
import com.yxt.yythmall.api.vegetablecellar.vegeVo;
|
||||
import com.yxt.yythmall.biz.appletgiftbag.AppletGiftBagService;
|
||||
@@ -21,9 +29,12 @@ import com.yxt.yythmall.biz.empcardgiftgoods.EmpCardGiftGoodsService;
|
||||
import com.yxt.yythmall.biz.lpkcustomer.LpkCustomerService;
|
||||
import com.yxt.yythmall.biz.lpkgiftcard.LpkGiftCardService;
|
||||
import com.yxt.yythmall.biz.lpkgoods.LpkGoodsService;
|
||||
import com.yxt.yythmall.biz.recommendnewuserbag.RecommendNewUserBagService;
|
||||
import com.yxt.yythmall.biz.recommendnewuserbagdetails.RecommendNewUserBagDetailsService;
|
||||
import com.yxt.yythmall.biz.vegetablecellar.VegetableCellarService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
@@ -45,6 +56,10 @@ public class NewcomerRecoRecordService extends MybatisBaseService<NewcomerRecoRe
|
||||
VegetableCellarService vegetableCellarService;
|
||||
@Autowired
|
||||
LpkGoodsService lpkGoodsService;
|
||||
@Autowired
|
||||
RecommendNewUserBagService recommendNewUserBagService;
|
||||
@Autowired
|
||||
RecommendNewUserBagDetailsService recommendNewUserBagDetailsService;
|
||||
public ResultBean<NewcomerRecoRecord> getReserveByCardSid(String carSid, String goodsSid) {
|
||||
ResultBean rb = new ResultBean();
|
||||
NewcomerRecoRecord goods = baseMapper.getReserveByCardSid(carSid, goodsSid);
|
||||
@@ -54,23 +69,35 @@ public class NewcomerRecoRecordService extends MybatisBaseService<NewcomerRecoRe
|
||||
public ResultBean recommendNewUsers(NewcomerRecoRecordDto dto) {
|
||||
ResultBean rb = new ResultBean();
|
||||
NewcomerRecoRecord newcomerRecoRecord = new NewcomerRecoRecord();
|
||||
|
||||
List<RecommendNewUserBag> bags=recommendNewUserBagService.list();
|
||||
dto.setGiftBagSid(bags.get(0).getSid());
|
||||
dto.setGiftName(bags.get(0).getName());
|
||||
BeanUtil.copyProperties(dto, newcomerRecoRecord, "id", "sid");
|
||||
newcomerRecoRecord.setCreateTime(new Date());
|
||||
newcomerRecoRecord.setRecommendSid(dto.getCustomerSid());
|
||||
baseMapper.insert(newcomerRecoRecord);
|
||||
return rb.success().setData("推荐成功");
|
||||
return rb.success().setData(newcomerRecoRecord);
|
||||
}
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResultBean recommendedAssistance(NewcomerRecoRecordDto dto) {
|
||||
ResultBean rb = new ResultBean();
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
LpkCustomer customer=lpkCustomerService.getOne(new QueryWrapper<LpkCustomer>().eq("sid",dto.getCustomerSid()));
|
||||
if(null==customer){
|
||||
return rb.setMsg("参数不全");
|
||||
}
|
||||
if(!customer.getIsNewUser().equals("1")){
|
||||
return rb.setMsg("您不是新人");
|
||||
}
|
||||
NewcomerRecoRecord newcomerRecoRecord = baseMapper.selectOne(new QueryWrapper<NewcomerRecoRecord>().eq("sid",dto.getSid()));
|
||||
newcomerRecoRecord.setRecommendedSid(dto.getRecommendedSid());
|
||||
newcomerRecoRecord.setRecommendedSid(dto.getCustomerSid());
|
||||
newcomerRecoRecord.setAssistanceDate(new Date());
|
||||
baseMapper.updateById(newcomerRecoRecord);
|
||||
List<AppletGiftBagGoods>list=appletGiftBagGoodsService.list(new QueryWrapper<AppletGiftBagGoods>().eq("giftbagSid",dto.getGiftBagSid()));
|
||||
List<RecommendNewUserBagDetails>list=recommendNewUserBagDetailsService.list(new QueryWrapper<RecommendNewUserBagDetails>().eq("giftbagSid",dto.getGiftBagSid()));
|
||||
// List<AppletGiftBagGoods>list=appletGiftBagGoodsService.list(new QueryWrapper<AppletGiftBagGoods>().eq("giftbagSid",dto.getGiftBagSid()));
|
||||
VegetableCellarDto dto1=new VegetableCellarDto();
|
||||
dto1.setCustomerSid(dto.getRecommendSid());
|
||||
dto1.setCustomerSid(customer.getSid());
|
||||
List<vegeVo> vos=new ArrayList<>();
|
||||
for (AppletGiftBagGoods appletGiftBagGoods : list) {
|
||||
for (RecommendNewUserBagDetails appletGiftBagGoods : list) {
|
||||
LpkGoods a=lpkGoodsService.getOne(new QueryWrapper<LpkGoods>().eq("sid",appletGiftBagGoods.getGoodsSid()));
|
||||
vegeVo vo=new vegeVo();
|
||||
vo.setGoodsSid(appletGiftBagGoods.getGoodsSid());
|
||||
@@ -80,16 +107,23 @@ public class NewcomerRecoRecordService extends MybatisBaseService<NewcomerRecoRe
|
||||
}
|
||||
dto1.setVos(vos);
|
||||
vegetableCellarService.save1Goods(dto1);
|
||||
//改变新人状态
|
||||
customer.setIsNewUser("0");
|
||||
lpkCustomerService.updateById(customer);
|
||||
return rb.success().setData("助力成功");
|
||||
}
|
||||
public ResultBean recordList(String customerSid) {
|
||||
ResultBean rb = new ResultBean();
|
||||
|
||||
RecommendNewUserBagVo vo=new RecommendNewUserBagVo();
|
||||
List<NewcomerRecoRecordVo> vos=baseMapper.recordList(customerSid);
|
||||
|
||||
// vos.forEach(s->{
|
||||
// s.
|
||||
// });
|
||||
for (NewcomerRecoRecordVo newcomerRecoRecordVo : vos) {
|
||||
RecommendNewUserBag r= recommendNewUserBagService.getOne(new QueryWrapper<RecommendNewUserBag>().eq("sid",newcomerRecoRecordVo.getGiftBagSid()));
|
||||
//被推荐人的信息
|
||||
LpkCustomer l= lpkCustomerService.getOne(new QueryWrapper<LpkCustomer>().eq("sid",newcomerRecoRecordVo.getRecommendedSid()));
|
||||
//推荐人信息
|
||||
LpkCustomer p=lpkCustomerService.getOne(new QueryWrapper<LpkCustomer>().eq("sid",newcomerRecoRecordVo.getRecommendSid()));
|
||||
newcomerRecoRecordVo.setRemarks(l.getNick()+"助力您获得"+r.getName());
|
||||
}
|
||||
return rb.success().setData("助力成功");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,17 @@
|
||||
package com.yxt.yythmall.biz.ordorder;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.yythmall.api.lpkstore.LpkStore;
|
||||
import com.yxt.yythmall.api.ordorder.OrdOrder;
|
||||
import com.yxt.yythmall.api.ordorder.OrdOrderVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
@@ -10,5 +19,7 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrdOrderMapper extends BaseMapper<OrdOrder> {
|
||||
IPage<OrdOrderVo> orderList(IPage<OrdOrder> page, @Param(Constants.WRAPPER) QueryWrapper<OrdOrder> qw);
|
||||
OrdOrderVo getOrderDetails(@Param("sid")String sid);
|
||||
|
||||
}
|
||||
|
||||
@@ -4,111 +4,23 @@
|
||||
<!-- <where> ${ew.sqlSegment} </where>-->
|
||||
<!-- ${ew.customSqlSegment} -->
|
||||
|
||||
<select id="storeListPage" resultType="com.yxt.yythmall.api.lpkstore.LpkStoreVo">
|
||||
<select id="orderList" resultType="com.yxt.yythmall.api.ordorder.OrdOrderVo">
|
||||
select
|
||||
sid,
|
||||
date_format(createTime, '%Y-%m-%d') as createTime,
|
||||
code,
|
||||
`name`,
|
||||
address,
|
||||
phone,
|
||||
businessHours
|
||||
from lpk_store
|
||||
*
|
||||
from ord_order
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
</select>
|
||||
<select id="orderList" resultType="com.yxt.yythmall.api.lpkreserveorder.LpkReserveOrderVo">
|
||||
<select id="getOrderDetails" resultType="com.yxt.yythmall.api.ordorder.OrdOrderVo">
|
||||
select
|
||||
o.sid,
|
||||
date_format(o.reserveDate, '%Y-%m-%d') as reserveDate,
|
||||
o.userName,
|
||||
o.userPhone,
|
||||
s.`name` as store,
|
||||
b.`name` as bagName,
|
||||
c.`code`
|
||||
from lpk_reserve_order as o
|
||||
left join lpk_store as s on o.storeSid = s.sid
|
||||
LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid
|
||||
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
</select>
|
||||
<select id="orderListByStore" resultType="com.yxt.yythmall.api.lpkreserveorder.LpkReserveOrderVo">
|
||||
select
|
||||
o.sid,
|
||||
date_format(o.reserveDate, '%Y-%m-%d') as reserveDate,
|
||||
s.`name` as store,
|
||||
s.sid as storeSid
|
||||
from lpk_reserve_order as o
|
||||
left join lpk_store as s on o.storeSid = s.sid
|
||||
LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid
|
||||
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
</select>
|
||||
<select id="orderByCardSid" resultType="com.yxt.yythmall.api.lpkreserveorder.LpkReserveOrderCardVo">
|
||||
SELECT date_format(o.reserveDate, '%Y-%m-%d') as reserveDate,
|
||||
c.`code`,
|
||||
s.`name` as store,
|
||||
b.`name` as bagName,
|
||||
o.sid as orderSid
|
||||
FROM lpk_reserve_order AS o
|
||||
LEFT JOIN lpk_store AS s ON o.storeSid = s.sid
|
||||
LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid
|
||||
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
||||
WHERE o.cardSid = #{sid}
|
||||
</select>
|
||||
<select id="orderListByUserSid" resultType="com.yxt.yythmall.api.lpkreserveorder.LpkReserveOrderCardVo">
|
||||
SELECT date_format(o.reserveDate, '%Y-%m-%d') as reserveDate,
|
||||
c.`code`,
|
||||
s.`name` as store,
|
||||
b.`name` as bagName,
|
||||
o.cardSid as cardSid,
|
||||
o.sid as orderSid,
|
||||
o.userName,
|
||||
o.userPhone,c.serialNumber as serialNumber,
|
||||
o.sid
|
||||
FROM lpk_reserve_order AS o
|
||||
LEFT JOIN lpk_store AS s ON o.storeSid = s.sid
|
||||
LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid
|
||||
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
</select>
|
||||
<select id="exportExcel" resultType="com.yxt.yythmall.api.lpkreserveorder.ReserveOrderExport">
|
||||
select
|
||||
o.sid,
|
||||
date_format(o.reserveDate, '%Y-%m-%d') as reserveDate,
|
||||
o.userName,
|
||||
o.userPhone,
|
||||
s.`name` as store,
|
||||
b.`name` as bagName,
|
||||
c.`code`
|
||||
from lpk_reserve_order as o
|
||||
left join lpk_store as s on o.storeSid = s.sid
|
||||
LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid
|
||||
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
</select>
|
||||
<select id="exportExcelByStore" resultType="com.yxt.yythmall.api.lpkreserveorder.ReserveOrderExportByStore">
|
||||
select
|
||||
o.sid,
|
||||
date_format(o.reserveDate, '%Y-%m-%d') as reserveDate,
|
||||
s.`name` as store,
|
||||
s.sid as storeSid
|
||||
from lpk_reserve_order as o
|
||||
left join lpk_store as s on o.storeSid = s.sid
|
||||
LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid
|
||||
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
*
|
||||
from ord_order
|
||||
where sid=#{sid}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -1,7 +1,12 @@
|
||||
package com.yxt.yythmall.biz.ordorder;
|
||||
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.yythmall.api.lpkstore.LpkStoreVo;
|
||||
import com.yxt.yythmall.api.ordorder.OrdOrderDto;
|
||||
import com.yxt.yythmall.api.ordorder.OrdOrderQuery;
|
||||
import com.yxt.yythmall.api.ordorder.OrdOrderVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -25,8 +30,28 @@ public class OrdOrderRest {
|
||||
return ordOrderService.createOrder(dto);
|
||||
}
|
||||
@PostMapping("/createVegeOrder")
|
||||
@ApiOperation(value = "创建订单")
|
||||
@ApiOperation(value = "创建菜窖账户订单")
|
||||
public ResultBean createVegeOrder(@RequestBody OrdOrderDto dto) {
|
||||
return ordOrderService.createVegeOrder(dto);
|
||||
}
|
||||
@PostMapping("/createNewUserBagOrder")
|
||||
@ApiOperation(value = "创建新人限购礼包订单")
|
||||
public ResultBean createNewUserBagOrder(@RequestBody OrdOrderDto dto) {
|
||||
return ordOrderService.createNewUserBagOrder(dto);
|
||||
}
|
||||
@PostMapping("/ordersList")
|
||||
@ApiOperation(value = "支付记录")
|
||||
public ResultBean<PagerVo<OrdOrderVo>> orderList(@RequestBody PagerQuery<OrdOrderQuery> query) {
|
||||
return ordOrderService.orderList(query);
|
||||
}
|
||||
@GetMapping("/OrderDetails/{sid}")
|
||||
@ApiOperation(value = "支付记录明细")
|
||||
public ResultBean<OrdOrderVo> getOrderDetails(@PathVariable("sid") String sid) {
|
||||
return ordOrderService.getOrderDetails(sid);
|
||||
}
|
||||
@GetMapping("/changePayState/{sid}")
|
||||
@ApiOperation(value = "改变订单状态")
|
||||
public ResultBean changePayState(@PathVariable("sid") String sid) {
|
||||
return ordOrderService.changePayState(sid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,42 @@
|
||||
package com.yxt.yythmall.biz.ordorder;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yxt.common.base.config.component.FileUploadComponent;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.base.utils.PagerUtil;
|
||||
import com.yxt.common.base.utils.StringUtils;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.yythmall.api.appletgiftbag.GiftBagGoodss;
|
||||
import com.yxt.yythmall.api.lpkcustomer.LpkCustomer;
|
||||
import com.yxt.yythmall.api.lpkcustomer.LpkCustomerVo;
|
||||
import com.yxt.yythmall.api.lpkgoods.LpkGoods;
|
||||
import com.yxt.yythmall.api.lpkstore.LpkStore;
|
||||
import com.yxt.yythmall.api.lpkstore.LpkStoreQuery;
|
||||
import com.yxt.yythmall.api.lpkstore.LpkStoreVo;
|
||||
import com.yxt.yythmall.api.ordorder.*;
|
||||
import com.yxt.yythmall.api.ordorderdetails.OrdOrderDetail;
|
||||
import com.yxt.yythmall.api.ordorderdetails.OrdOrderDetailVo;
|
||||
import com.yxt.yythmall.api.shoppingcart.ShoppingCart;
|
||||
import com.yxt.yythmall.api.shoppingcart.ShoppingCartQuery;
|
||||
import com.yxt.yythmall.api.shoppingcart.ShoppingCartVo;
|
||||
import com.yxt.yythmall.biz.appletgiftbag.AppletGiftBagService;
|
||||
import com.yxt.yythmall.biz.lpkcustomer.LpkCustomerService;
|
||||
import com.yxt.yythmall.biz.lpkgoods.LpkGoodsService;
|
||||
import com.yxt.yythmall.biz.ordorderdetails.OrdOrderDetailService;
|
||||
import com.yxt.yythmall.biz.shoppingcart.ShoppingCartService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
@@ -25,10 +47,21 @@ import java.util.*;
|
||||
public class OrdOrderService extends MybatisBaseService<OrdOrderMapper, OrdOrder> {
|
||||
|
||||
private static final String OrderUrl="https://supervise.yxtsoft.com/lpkapi/empcardgift/generateTopEmpCard?mainSid=";
|
||||
private static final String or="https://supervise.yxtsoft.com/lpkapi/vegetablecellar/addGoods?mainSid=";
|
||||
@Autowired
|
||||
OrdOrderDetailService ordOrderDetailsService;
|
||||
@Autowired
|
||||
LpkCustomerService lpkCustomerService;
|
||||
@Autowired
|
||||
ShoppingCartService shoppingCartService;
|
||||
@Autowired
|
||||
LpkGoodsService lpkGoodsService;
|
||||
@Autowired
|
||||
AppletGiftBagService appletGiftBagService;
|
||||
@Autowired
|
||||
OrdOrderDetailService ordOrderDetailService;
|
||||
@Autowired
|
||||
private FileUploadComponent fileUploadComponent;
|
||||
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -47,9 +80,10 @@ public class OrdOrderService extends MybatisBaseService<OrdOrderMapper, OrdOrder
|
||||
}
|
||||
OrdOrder order=new OrdOrder();
|
||||
BeanUtil.copyProperties(dto, order, "id", "sid");
|
||||
|
||||
order.setCreateTime(new Date());
|
||||
order.setMainSid(rb2.get("mainSid").toString());
|
||||
order.setPayStatus(1);
|
||||
order.setOutTradeNo(rb2.get("outTradeNo").toString());
|
||||
order.setPayStatus(2);
|
||||
order.setPayTime(new Date());
|
||||
order.setCardNumber(dto.getCardNumber());
|
||||
order.setSource(0);
|
||||
@@ -115,9 +149,30 @@ public class OrdOrderService extends MybatisBaseService<OrdOrderMapper, OrdOrder
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResultBean createVegeOrder(OrdOrderDto dto) {
|
||||
String or="";
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
PayResult result=new PayResult();
|
||||
List<OrdOrderDetailVo> ordOrderDetailVos=new ArrayList<>();
|
||||
|
||||
ShoppingCartQuery query=new ShoppingCartQuery();
|
||||
query.setCustomerSid(dto.getCustomerSid());
|
||||
query.setBrandId(dto.getBrandId());
|
||||
List<ShoppingCartVo> vos=shoppingCartService.shoppingCartList(query).getData();
|
||||
List<String> strings=new ArrayList<>();
|
||||
double totalAmount=0;
|
||||
for (ShoppingCartVo vo : vos) {
|
||||
OrdOrderDetailVo vo1 =new OrdOrderDetailVo();
|
||||
LpkGoods goods = lpkGoodsService.getOne(new QueryWrapper<LpkGoods>().eq("sid", vo.getGoodsSid()));
|
||||
vo1.setGoodsSid(vo.getGoodsSid());
|
||||
vo1.setGoodsName(vo.getGoodsName());
|
||||
vo1.setPartNumber(Integer.parseInt(vo.getGoodsNumber()));
|
||||
vo1.setNumofPart(Double.valueOf(vo.getWeight()));
|
||||
vo1.setPriceUnit(Double.valueOf(goods.getPrice()));
|
||||
vo1.setPricePart((Double.valueOf(goods.getPrice())*Double.valueOf(goods.getWeight())));
|
||||
totalAmount= Double.valueOf(vo1.getPricePart())*Double.valueOf(vo1.getPartNumber())+totalAmount;
|
||||
ordOrderDetailVos.add(vo1);
|
||||
strings.add(vo.getSid());
|
||||
}
|
||||
dto.setOrdOrderDetailsVoList(ordOrderDetailVos);
|
||||
Map<String,Object>map =new HashMap<>();
|
||||
LpkCustomerVo vo= lpkCustomerService.getCustomerInfo(dto.getCustomerSid()).getData();
|
||||
Map<String, Object> sendBody=buildMessageBody( vo.getSid(), vo.getWxMpOpenid(),dto.getTotalTee(),dto.getOrdOrderDetailsVoList(),or);
|
||||
@@ -130,16 +185,17 @@ public class OrdOrderService extends MybatisBaseService<OrdOrderMapper, OrdOrder
|
||||
}
|
||||
OrdOrder order=new OrdOrder();
|
||||
BeanUtil.copyProperties(dto, order, "id", "sid");
|
||||
|
||||
order.setCreateTime(new Date());
|
||||
order.setMainSid(rb2.get("mainSid").toString());
|
||||
order.setPayStatus(1);
|
||||
order.setOutTradeNo(rb2.get("outTradeNo").toString());
|
||||
order.setPayStatus(2);
|
||||
order.setPayTime(new Date());
|
||||
order.setCardNumber(dto.getCardNumber());
|
||||
order.setSource(0);
|
||||
order.setUserSid(vo.getSid());
|
||||
order.setOpenId(vo.getWxMpOpenid());
|
||||
order.setTotalTee(dto.getTotalTee());
|
||||
order.setVegeCellarType(dto.getVegeCellarType());
|
||||
order.setTotalTee(dto.getTotalTee());//实付金额
|
||||
order.setMeet(removeZeros(String.valueOf(totalAmount)));//应付金额
|
||||
if(dto.getOrdOrderDetailsVoList().size()>1){
|
||||
order.setName(dto.getOrdOrderDetailsVoList().get(0).getGoodsName().toString()+"等"+(dto.getOrdOrderDetailsVoList().size()-1)+"件商品");
|
||||
}else{
|
||||
@@ -160,6 +216,9 @@ public class OrdOrderService extends MybatisBaseService<OrdOrderMapper, OrdOrder
|
||||
|
||||
});
|
||||
ordOrderDetailsService.saveBatch(ordOrders);
|
||||
//生成订单 删除购物车
|
||||
String [] sids=strings.toArray(new String [0]);
|
||||
shoppingCartService.delBySids(sids);
|
||||
if(dto.getOrdOrderDetailsVoList().size()>1){
|
||||
result.setGoods(dto.getOrdOrderDetailsVoList().get(0).getGoodsName().toString()+"等"+(dto.getOrdOrderDetailsVoList().size()-1)+"件商品");
|
||||
}else{
|
||||
@@ -193,6 +252,115 @@ public class OrdOrderService extends MybatisBaseService<OrdOrderMapper, OrdOrder
|
||||
result.setTrade_no_url(tradeNoUrl);
|
||||
String [] a =new String []{"pay"};
|
||||
result.setBus(a);
|
||||
//新人限购礼包 该状态
|
||||
LpkCustomer customer=lpkCustomerService.getOne(new QueryWrapper<LpkCustomer>().eq("sid",dto.getCustomerSid()));
|
||||
customer.setIsPurchase("0");
|
||||
lpkCustomerService.updateById(customer);
|
||||
return rb.success().setData(result);
|
||||
}
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResultBean createNewUserBagOrder(OrdOrderDto dto) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
PayResult result=new PayResult();
|
||||
List<OrdOrderDetailVo> ordOrderDetailVos=new ArrayList<>();
|
||||
|
||||
List<GiftBagGoodss> vos=appletGiftBagService.getGoodsByBagSid(dto.getBagSid()).getData();
|
||||
dto.setTotalTee(vos.get(0).getPrefPrice());
|
||||
dto.setCardNumber(1);
|
||||
double totalAmount=0;
|
||||
for (GiftBagGoodss vo : vos) {
|
||||
OrdOrderDetailVo vo1 =new OrdOrderDetailVo();
|
||||
LpkGoods goods = lpkGoodsService.getOne(new QueryWrapper<LpkGoods>().eq("sid", vo.getGoodsSid()));
|
||||
vo1.setGoodsSid(vo.getGoodsSid());
|
||||
vo1.setGoodsName(vo.getName());
|
||||
vo1.setPartNumber(Integer.parseInt(vo.getGoodsNumber()));
|
||||
vo1.setNumofPart(Double.valueOf(vo.getWeight()));
|
||||
vo1.setPriceUnit(Double.valueOf(goods.getPrice()));
|
||||
vo1.setPricePart((Double.valueOf(goods.getPrice())*Double.valueOf(goods.getWeight())));
|
||||
totalAmount= Double.valueOf(vo1.getPricePart())*Double.valueOf(vo1.getPartNumber())+totalAmount;
|
||||
ordOrderDetailVos.add(vo1);
|
||||
}
|
||||
dto.setOrdOrderDetailsVoList(ordOrderDetailVos);
|
||||
|
||||
Map<String,Object>map =new HashMap<>();
|
||||
LpkCustomerVo vo= lpkCustomerService.getCustomerInfo(dto.getCustomerSid()).getData();
|
||||
Map<String, Object> sendBody=buildMessageBody( vo.getSid(), vo.getWxMpOpenid(),dto.getTotalTee(),dto.getOrdOrderDetailsVoList(),or);
|
||||
ResponseEntity<ResultBean> postForEntity=new RestTemplate().postForEntity("https://supervise.yxtsoft.com/wxPay/order/createOrder", sendBody,ResultBean.class);
|
||||
|
||||
ResultBean<PayOrderVo> rb1= postForEntity.getBody();
|
||||
LinkedHashMap rb2= (LinkedHashMap)postForEntity.getBody().getData();
|
||||
if(!rb1.getCode().equals("200")){
|
||||
return rb1;
|
||||
}
|
||||
OrdOrder order=new OrdOrder();
|
||||
BeanUtil.copyProperties(dto, order, "id", "sid");
|
||||
order.setCreateTime(new Date());
|
||||
order.setMainSid(rb2.get("mainSid").toString());
|
||||
order.setOutTradeNo(rb2.get("outTradeNo").toString());
|
||||
order.setPayStatus(2);
|
||||
order.setPayTime(new Date());
|
||||
order.setCardNumber(dto.getCardNumber());
|
||||
order.setSource(0);
|
||||
order.setUserSid(vo.getSid());
|
||||
order.setOpenId(vo.getWxMpOpenid());
|
||||
order.setTotalTee(dto.getTotalTee());
|
||||
order.setMeet(removeZeros(String.valueOf(totalAmount)));//应付金额
|
||||
if(dto.getOrdOrderDetailsVoList().size()>1){
|
||||
order.setName(dto.getOrdOrderDetailsVoList().get(0).getGoodsName().toString()+"等"+(dto.getOrdOrderDetailsVoList().size()-1)+"件商品");
|
||||
}else{
|
||||
order.setName(dto.getOrdOrderDetailsVoList().get(0).getGoodsName().toString()+"商品");
|
||||
}
|
||||
// order.setName("商品");
|
||||
order.setTimeRemarks(10);
|
||||
order.setReturnUrl(or);
|
||||
baseMapper.insert(order);
|
||||
List<OrdOrderDetail> ordOrders=new ArrayList<>();
|
||||
dto.getOrdOrderDetailsVoList().forEach(s->{
|
||||
OrdOrderDetail ordOrderDetails=new OrdOrderDetail();
|
||||
BeanUtil.copyProperties(s, ordOrderDetails, "id", "sid");
|
||||
ordOrderDetails.setOrderSid(order.getSid());
|
||||
ordOrders.add(ordOrderDetails);
|
||||
|
||||
});
|
||||
ordOrderDetailsService.saveBatch(ordOrders);
|
||||
//生成订单 删除购物车
|
||||
if(dto.getOrdOrderDetailsVoList().size()>1){
|
||||
result.setGoods(dto.getOrdOrderDetailsVoList().get(0).getGoodsName().toString()+"等"+(dto.getOrdOrderDetailsVoList().size()-1)+"件商品");
|
||||
}else{
|
||||
result.setGoods(dto.getOrdOrderDetailsVoList().get(0).getGoodsName().toString()+"商品");
|
||||
}
|
||||
|
||||
result.setPrice(dto.getTotalTee());
|
||||
// result.setOrderId(rbData.getOutTradeNo());
|
||||
result.setOrderId(rb2.get("outTradeNo").toString());
|
||||
result.setRemainder(String.valueOf(10*60));
|
||||
|
||||
PayUrl payUrl=new PayUrl();
|
||||
payUrl.setUrl("https://supervise.yxtsoft.com/wxPay/order/pay");
|
||||
PayParams aVoid=new PayParams();
|
||||
aVoid.setMainSid(rb2.get("mainSid").toString());
|
||||
payUrl.setParams(aVoid);
|
||||
|
||||
OrderUrl orderUrl=new OrderUrl();
|
||||
OrderParams orderParams=new OrderParams();
|
||||
orderParams.setMainSid("");
|
||||
orderUrl.setParams(orderParams);
|
||||
|
||||
TradeNoUrl tradeNoUrl=new TradeNoUrl();
|
||||
tradeNoUrl.setUrl("https://supervise.yxtsoft.com/wxPay/order/orderQuery");
|
||||
TradeParams tradeParams=new TradeParams();
|
||||
tradeParams.setMainSid(rb2.get("mainSid").toString());
|
||||
tradeNoUrl.setParams(tradeParams);
|
||||
|
||||
// result.setOrder_url(orderUrl);
|
||||
result.setPay_url(payUrl);
|
||||
result.setTrade_no_url(tradeNoUrl);
|
||||
String [] a =new String []{"pay"};
|
||||
result.setBus(a);
|
||||
//新人限购礼包 该状态
|
||||
LpkCustomer customer=lpkCustomerService.getOne(new QueryWrapper<LpkCustomer>().eq("sid",dto.getCustomerSid()));
|
||||
customer.setIsPurchase("0");
|
||||
lpkCustomerService.updateById(customer);
|
||||
return rb.success().setData(result);
|
||||
}
|
||||
private static Map<String, Object> buildMessageBody(String userSid, String openId, String totalTee, List<OrdOrderDetailVo> detailVos,String returnUrl){
|
||||
@@ -214,4 +382,111 @@ public class OrdOrderService extends MybatisBaseService<OrdOrderMapper, OrdOrder
|
||||
return mp_template_msg;
|
||||
}
|
||||
|
||||
public ResultBean<PagerVo<OrdOrderVo>> orderList(PagerQuery<OrdOrderQuery> pq) {
|
||||
ResultBean rb=new ResultBean().fail();
|
||||
OrdOrderQuery query = pq.getParams();
|
||||
IPage<OrdOrder> page = PagerUtil.queryToPage(pq);
|
||||
QueryWrapper<OrdOrder> qw = new QueryWrapper<>();
|
||||
if (StringUtils.isBlank(query.getCustomerSid())){
|
||||
return rb.setMsg("参数不全");
|
||||
}
|
||||
if(StringUtils.isNotBlank(query.getState())){
|
||||
qw.eq("payStatus",query.getState());
|
||||
}
|
||||
qw.eq("userSid",query.getCustomerSid());
|
||||
qw.orderByDesc("createTime");
|
||||
IPage<OrdOrderVo> pagging = baseMapper.orderList(page, qw);
|
||||
for (OrdOrderVo record : pagging.getRecords()) {
|
||||
List<OrdOrderDetail> details=ordOrderDetailService.list(new QueryWrapper<OrdOrderDetail>().eq("orderSid",record.getSid()));
|
||||
List<String> urls=new ArrayList<>();
|
||||
for (OrdOrderDetail detail : details) {
|
||||
LpkGoods lpkGoods=lpkGoodsService.getOne(new QueryWrapper<LpkGoods>().eq("sid",detail.getGoodsSid()));
|
||||
urls.add(fileUploadComponent.getUrlPrefix()+lpkGoods.getPicUrl());
|
||||
}
|
||||
record.setCount(String.valueOf(details.size()));
|
||||
record.setPicUrls(urls);
|
||||
}
|
||||
PagerVo<LpkStoreVo> p = PagerUtil.pageToVo(pagging, null);
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
public ResultBean<OrdOrderVo> getOrderDetails(String sid) {
|
||||
ResultBean rb=new ResultBean().fail();
|
||||
OrdOrderVo pagging = baseMapper.getOrderDetails(sid);
|
||||
List<OrdOrderDetail> details=ordOrderDetailService.list(new QueryWrapper<OrdOrderDetail>().eq("orderSid",pagging.getSid()));
|
||||
if(StringUtils.isBlank(pagging.getMeet())){
|
||||
pagging.setMeet(pagging.getTotalTee());
|
||||
}
|
||||
DecimalFormat decimalFormat = new DecimalFormat("#0.00");
|
||||
pagging.setSurcharge(removeZeros(String.valueOf(decimalFormat.format(Double.valueOf(pagging.getTotalTee())-Double.valueOf(pagging.getMeet())))));
|
||||
for (OrdOrderDetail detail : details) {
|
||||
LpkGoods lpkGoods=lpkGoodsService.getOne(new QueryWrapper<LpkGoods>().eq("sid",detail.getGoodsSid()));
|
||||
detail.setPicUrl(fileUploadComponent.getUrlPrefix()+lpkGoods.getPicUrl());
|
||||
detail.setRemarks(removeZeros(String.valueOf(detail.getNumofPart()))+"斤/份,"+"共"+detail.getPartNumber()+"份");
|
||||
}
|
||||
pagging.setOrdOrderDetails(details);
|
||||
SimpleDateFormat sdf1 =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
pagging.setEndTime(sdf1.format(DateUtil.offsetMinute(pagging.getCreateTime(),pagging.getTimeRemarks())));
|
||||
if(pagging.getPayStatus()==2){
|
||||
PayResult result=new PayResult();
|
||||
if(details.size()>1){
|
||||
result.setGoods(details.get(0).getGoodsName().toString()+"等"+(details.size()-1)+"件商品");
|
||||
}else{
|
||||
result.setGoods(details.get(0).getGoodsName().toString()+"商品");
|
||||
}
|
||||
result.setPrice(pagging.getTotalTee());
|
||||
// result.setOrderId(rbData.getOutTradeNo());
|
||||
result.setOrderId(pagging.getOutTradeNo());
|
||||
result.setRemainder(String.valueOf(10*60));
|
||||
|
||||
PayUrl payUrl=new PayUrl();
|
||||
payUrl.setUrl("https://supervise.yxtsoft.com/wxPay/order/pay");
|
||||
PayParams aVoid=new PayParams();
|
||||
aVoid.setMainSid(pagging.getMainSid());
|
||||
payUrl.setParams(aVoid);
|
||||
|
||||
OrderUrl orderUrl=new OrderUrl();
|
||||
OrderParams orderParams=new OrderParams();
|
||||
orderParams.setMainSid("");
|
||||
orderUrl.setParams(orderParams);
|
||||
|
||||
TradeNoUrl tradeNoUrl=new TradeNoUrl();
|
||||
tradeNoUrl.setUrl("https://supervise.yxtsoft.com/wxPay/order/orderQuery");
|
||||
TradeParams tradeParams=new TradeParams();
|
||||
tradeParams.setMainSid(pagging.getMainSid());
|
||||
tradeNoUrl.setParams(tradeParams);
|
||||
|
||||
// result.setOrder_url(orderUrl);
|
||||
result.setPay_url(payUrl);
|
||||
result.setTrade_no_url(tradeNoUrl);
|
||||
String [] a =new String []{"pay"};
|
||||
result.setBus(a);
|
||||
pagging.setResult(result);
|
||||
}
|
||||
return rb.success().setData(pagging);
|
||||
}
|
||||
public ResultBean changePayState(String sid) {
|
||||
ResultBean rb=new ResultBean().fail();
|
||||
OrdOrder order=baseMapper.selectOne(new QueryWrapper<OrdOrder>().eq("sid",sid));
|
||||
if(order.getPayStatus()==2){
|
||||
order.setPayStatus(3);
|
||||
baseMapper.updateById(order);
|
||||
}
|
||||
return rb.success().setData(order);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 去除多余.0
|
||||
* @param num
|
||||
* @return
|
||||
*/
|
||||
public static String removeZeros(String num) {
|
||||
if (num.indexOf(".") > 0) {
|
||||
// 去掉多余的0
|
||||
num = num.replaceAll("0+?$", "");
|
||||
// 如果最后一位是. 则去掉
|
||||
num = num.replaceAll("[.]$", "");
|
||||
}
|
||||
return num;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.yxt.yythmall.biz.recommendnewuserbag;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.yxt.yythmall.api.appletgiftbag.GiftBagGoodss;
|
||||
import com.yxt.yythmall.api.recommendnewuserbag.RecommendNewUserBag;
|
||||
import com.yxt.yythmall.api.recommendnewuserbag.RecommendNewUserBagVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:03
|
||||
*/
|
||||
@Mapper
|
||||
public interface RecommendNewUserBagMapper extends BaseMapper<RecommendNewUserBag> {
|
||||
|
||||
|
||||
IPage<RecommendNewUserBagVo> giftBagListPage(IPage<RecommendNewUserBag> page, @Param(Constants.WRAPPER) QueryWrapper<RecommendNewUserBag> qw);
|
||||
List<RecommendNewUserBagVo> giftBagList();
|
||||
|
||||
List<RecommendNewUserBagVo> giftBagGoodsList();
|
||||
List<GiftBagGoodss> getGoodsByBagSid(@Param("bagSid") String bagSid);
|
||||
int saveBags(@Param("bags") List<RecommendNewUserBag> bags);
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yxt.yythmall.biz.recommendnewuserbag.RecommendNewUserBagMapper">
|
||||
<!-- <where> ${ew.sqlSegment} </where>-->
|
||||
<!-- ${ew.customSqlSegment} -->
|
||||
|
||||
<insert id="saveBags" parameterType="java.util.List">
|
||||
insert into lpk_giftbag(sid,createTime,`name`,dateStart,dateEnd)
|
||||
values
|
||||
<foreach collection="bags" item="item" index="index" separator=",">
|
||||
(#{item.sid},#{item.createTime},#{item.name},#{item.dateStart},#{item.dateEnd})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="giftBagListPage" resultType="com.yxt.yythmall.api.recommendnewuserbag.RecommendNewUserBagVo">
|
||||
select
|
||||
sid,
|
||||
`name`,
|
||||
date_format(dateStart, '%Y-%m-%d') as dateStart,
|
||||
date_format(dateEnd, '%Y-%m-%d') as dateEnd,
|
||||
price,
|
||||
iconUrl,
|
||||
isEnable,
|
||||
isGrounding,
|
||||
isRecommend
|
||||
from recommend_newuser_bag
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
</select>
|
||||
<select id="giftBagList" resultType="com.yxt.yythmall.api.recommendnewuserbag.RecommendNewUserBagVo">
|
||||
select
|
||||
*
|
||||
from recommend_newuser_bag
|
||||
where isGrounding=1
|
||||
order by isRecommend desc,createTime desc
|
||||
</select>
|
||||
<select id="giftBagGoodsList" resultType="com.yxt.yythmall.api.recommendnewuserbag.RecommendNewUserBagVo">
|
||||
select
|
||||
a.sid,
|
||||
a.name ,
|
||||
a.iconUrl,
|
||||
a.price ,
|
||||
a.preferentialPrice as prefPrice
|
||||
from recommend_newuser_bag a
|
||||
</select>
|
||||
<select id="getGoodsByBagSid" resultType="com.yxt.yythmall.api.appletgiftbag.GiftBagGoodss">
|
||||
select
|
||||
a.preferentialPrice as prefPrice,
|
||||
c.name as name,
|
||||
c.sid as goodsSid,
|
||||
c.specificationUnit as specificationUnit,
|
||||
c.unitName as unitName,
|
||||
b.goodsNumber as goodsNumber,
|
||||
c.weight as weight
|
||||
from recommend_newuser_bag a
|
||||
left join recommend_newuser_bag_details b on b.giftbagSid=a.sid
|
||||
left join lpk_goods c on c.sid =b.goodsSid
|
||||
where a.sid=#{bagSid}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.yxt.yythmall.biz.recommendnewuserbag;
|
||||
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.yythmall.api.recommendnewuserbag.RecommendNewUserBagDto;
|
||||
import com.yxt.yythmall.api.recommendnewuserbag.RecommendNewUserBagQuery;
|
||||
import com.yxt.yythmall.api.recommendnewuserbag.RecommendNewUserBagVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:03
|
||||
*/
|
||||
|
||||
@Api(tags = "小程序礼包信息")
|
||||
@RestController
|
||||
@RequestMapping("ecommendnewuserbag")
|
||||
public class RecommendNewUserBagRest {
|
||||
|
||||
@Autowired
|
||||
RecommendNewUserBagService recommendNewUserBagService;
|
||||
|
||||
|
||||
@ApiOperation("礼包信息列表")
|
||||
@PostMapping("/giftBagListPage")
|
||||
public ResultBean<PagerVo<RecommendNewUserBagVo>> giftBagListPage(@RequestBody PagerQuery<RecommendNewUserBagQuery> pq) {
|
||||
return recommendNewUserBagService.giftBagListPage(pq);
|
||||
}
|
||||
|
||||
@ApiOperation("保存修改")
|
||||
@PostMapping("/saveGiftBag")
|
||||
public ResultBean<String> saveGiftBag(@RequestBody RecommendNewUserBagDto dto) {
|
||||
return recommendNewUserBagService.saveGiftBag(dto);
|
||||
}
|
||||
|
||||
@ApiOperation("礼包初始化")
|
||||
@GetMapping("/giftBagInit/{sid}")
|
||||
public ResultBean giftBagInit(@PathVariable String sid) {
|
||||
return recommendNewUserBagService.giftBagInit(sid);
|
||||
}
|
||||
|
||||
@ApiOperation("删除礼包")
|
||||
@DeleteMapping("/deleteBag/{sid}")
|
||||
public ResultBean deleteBag(@PathVariable("sid") String sid) {
|
||||
return recommendNewUserBagService.deleteBag(sid);
|
||||
}
|
||||
@ApiOperation("礼包信息列表")
|
||||
@GetMapping("/giftBagList")
|
||||
public ResultBean giftBagList() {
|
||||
return recommendNewUserBagService.giftBagList();
|
||||
}
|
||||
@GetMapping("/isGrounding/{sid}/{state}")
|
||||
@ApiOperation(value = "设置是否上下架")
|
||||
public ResultBean isGrounding(@PathVariable("sid")String sid,@PathVariable("state") String state) {
|
||||
return recommendNewUserBagService.isGrounding(sid, state);
|
||||
}
|
||||
@ApiOperation("小程序礼包信息列表")
|
||||
@GetMapping("/recommendNewUserBagList")
|
||||
public ResultBean<List<RecommendNewUserBagVo>> recommendNewUserBagList() {
|
||||
return recommendNewUserBagService.recommendNewUserBagList();
|
||||
}
|
||||
@ApiOperation("礼包初始化")
|
||||
@GetMapping("/getGiftBagBySid/{sid}")
|
||||
public ResultBean getGiftBagBySid(@PathVariable String sid) {
|
||||
return recommendNewUserBagService.getGiftBagBySid(sid);
|
||||
}
|
||||
|
||||
@ApiOperation("新人专属购买礼包")
|
||||
@PostMapping("/newUserQuota")
|
||||
public ResultBean newUserQuota() {
|
||||
return recommendNewUserBagService.newUserQuota();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,302 @@
|
||||
package com.yxt.yythmall.biz.recommendnewuserbag;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yxt.common.base.config.component.FileUploadComponent;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.base.utils.PagerUtil;
|
||||
import com.yxt.common.base.utils.StringUtils;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.yythmall.api.appletgiftbag.GiftBagGoods;
|
||||
import com.yxt.yythmall.api.appletgiftbag.GiftBagGoodss;
|
||||
import com.yxt.yythmall.api.appletgiftbag.RecommendRecord;
|
||||
import com.yxt.yythmall.api.lpkgoods.LpkGoods;
|
||||
import com.yxt.yythmall.api.recommendnewuserbag.*;
|
||||
import com.yxt.yythmall.api.recommendnewuserbagdetails.RecommendNewUserBagDetails;
|
||||
import com.yxt.yythmall.biz.lpkgoods.LpkGoodsService;
|
||||
import com.yxt.yythmall.biz.recommendnewuserbagdetails.RecommendNewUserBagDetailsService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:03
|
||||
*/
|
||||
@Service
|
||||
public class RecommendNewUserBagService extends MybatisBaseService<RecommendNewUserBagMapper, RecommendNewUserBag> {
|
||||
|
||||
@Autowired
|
||||
private FileUploadComponent fileUploadComponent;
|
||||
@Autowired
|
||||
private RecommendNewUserBagDetailsService recommendNewUserBagDetailsService;
|
||||
@Autowired
|
||||
private LpkGoodsService lpkGoodsService;
|
||||
|
||||
public ResultBean<PagerVo<RecommendNewUserBagVo>> giftBagListPage(PagerQuery<RecommendNewUserBagQuery> pq) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
RecommendNewUserBagQuery query = pq.getParams();
|
||||
QueryWrapper<RecommendNewUserBag> qw = new QueryWrapper<>();
|
||||
qw.eq("1", "1");
|
||||
if (StringUtils.isNotBlank(query.getName())) {
|
||||
qw.like("name", query.getName());
|
||||
}
|
||||
qw.orderByDesc("isRecommend");
|
||||
qw.orderByDesc("createTime");
|
||||
IPage<RecommendNewUserBag> page = PagerUtil.queryToPage(pq);
|
||||
IPage<RecommendNewUserBagVo> pagging = baseMapper.giftBagListPage(page, qw);
|
||||
PagerVo<RecommendNewUserBagVo> p = PagerUtil.pageToVo(pagging, null);
|
||||
List<RecommendNewUserBagVo> records = pagging.getRecords();
|
||||
records.removeAll(Collections.singleton(null));
|
||||
if (!records.isEmpty()) {
|
||||
for (RecommendNewUserBagVo record : records) {
|
||||
if (StringUtils.isNotBlank(record.getIconUrl())) {
|
||||
record.setIconUrl(fileUploadComponent.getUrlPrefix() + record.getIconUrl());
|
||||
}
|
||||
}
|
||||
}
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResultBean<String> saveGiftBag(RecommendNewUserBagDto dto) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
String sid = "";
|
||||
if (StringUtils.isNotBlank(dto.getSid())) {
|
||||
sid = dto.getSid();
|
||||
recommendNewUserBagDetailsService.deleteGoodsByBagSid(dto.getSid());
|
||||
RecommendNewUserBag RecommendNewUserBag = fetchBySid(dto.getSid());
|
||||
BeanUtil.copyProperties(dto, RecommendNewUserBag, "id", "sid");
|
||||
RecommendNewUserBag.setCreateTime(new DateTime());
|
||||
if (StringUtils.isNotBlank(dto.getIconUrl())) {
|
||||
String urlPrefix = fileUploadComponent.getUrlPrefix();
|
||||
String path = dto.getIconUrl().substring(urlPrefix.length());
|
||||
RecommendNewUserBag.setIconUrl(path);
|
||||
}
|
||||
baseMapper.updateById(RecommendNewUserBag);
|
||||
if (!dto.getGoods().isEmpty()) {
|
||||
List<GiftBagGoods> goodsList = dto.getGoods();
|
||||
for (GiftBagGoods goods : goodsList) {
|
||||
RecommendNewUserBagDetails RecommendNewUserBagGoods = new RecommendNewUserBagDetails();
|
||||
RecommendNewUserBagGoods.setCreateTime(new DateTime());
|
||||
RecommendNewUserBagGoods.setGoodsSid(goods.getGoodsSid());
|
||||
RecommendNewUserBagGoods.setGiftbagSid(RecommendNewUserBag.getSid());
|
||||
RecommendNewUserBagGoods.setGoodsNumber(goods.getGoodsNumber());
|
||||
RecommendNewUserBagGoods.setPrice(Double.valueOf(goods.getPrice()));
|
||||
recommendNewUserBagDetailsService.insert(RecommendNewUserBagGoods);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
RecommendNewUserBag RecommendNewUserBag = new RecommendNewUserBag();
|
||||
sid = RecommendNewUserBag.getSid();
|
||||
BeanUtil.copyProperties(dto, RecommendNewUserBag, "id", "sid");
|
||||
RecommendNewUserBag.setCreateTime(new DateTime());
|
||||
if (StringUtils.isNotBlank(dto.getIconUrl())) {
|
||||
String urlPrefix = fileUploadComponent.getUrlPrefix();
|
||||
String path = dto.getIconUrl().substring(urlPrefix.length());
|
||||
RecommendNewUserBag.setIconUrl(path);
|
||||
}
|
||||
baseMapper.insert(RecommendNewUserBag);
|
||||
if (!dto.getGoods().isEmpty()) {
|
||||
List<GiftBagGoods> goodsList = dto.getGoods();
|
||||
for (GiftBagGoods goods : goodsList) {
|
||||
RecommendNewUserBagDetails RecommendNewUserBagGoods = new RecommendNewUserBagDetails();
|
||||
RecommendNewUserBagGoods.setCreateTime(new DateTime());
|
||||
RecommendNewUserBagGoods.setGoodsSid(goods.getGoodsSid());
|
||||
RecommendNewUserBagGoods.setGiftbagSid(RecommendNewUserBag.getSid());
|
||||
RecommendNewUserBagGoods.setGoodsNumber(goods.getGoodsNumber());
|
||||
RecommendNewUserBagGoods.setPrice(Double.valueOf(goods.getPrice()));
|
||||
recommendNewUserBagDetailsService.insert(RecommendNewUserBagGoods);
|
||||
}
|
||||
}
|
||||
}
|
||||
return rb.success().setData(sid);
|
||||
}
|
||||
|
||||
public ResultBean giftBagInit(String sid) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
RecommendNewUserBagInitVo vo = new RecommendNewUserBagInitVo();
|
||||
RecommendNewUserBag entity = fetchBySid(sid);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
if (null != entity) {
|
||||
BeanUtil.copyProperties(entity, vo);
|
||||
if (null != entity.getDateStart()) {
|
||||
vo.setDateStart(sdf.format(entity.getDateStart()));
|
||||
}
|
||||
if (null != entity.getDateEnd()) {
|
||||
vo.setDateEnd(sdf.format(entity.getDateEnd()));
|
||||
}
|
||||
if (StringUtils.isNotBlank(entity.getIconUrl())) {
|
||||
vo.setIconUrl(fileUploadComponent.getUrlPrefix() + entity.getIconUrl());
|
||||
}
|
||||
List<GiftBagGoods> goods = new ArrayList<>();
|
||||
List<RecommendNewUserBagDetails> records = recommendNewUserBagDetailsService.getRecordsByBagSid(sid);
|
||||
if (!records.isEmpty()) {
|
||||
for (RecommendNewUserBagDetails record : records) {
|
||||
GiftBagGoods bagGoods = new GiftBagGoods();
|
||||
if (StringUtils.isNotBlank(record.getGoodsNumber())) {
|
||||
bagGoods.setGoodsNumber(record.getGoodsNumber());
|
||||
}
|
||||
if (StringUtils.isNotBlank(record.getGoodsSid())) {
|
||||
bagGoods.setGoodsSid(record.getGoodsSid());
|
||||
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(record.getGoodsSid());
|
||||
if (null != lpkGoods) {
|
||||
if (StringUtils.isNotBlank(lpkGoods.getName())) {
|
||||
bagGoods.setName(lpkGoods.getName());
|
||||
}
|
||||
if (StringUtils.isNotBlank(lpkGoods.getPicUrl())) {
|
||||
bagGoods.setIconUrl(lpkGoods.getPicUrl());
|
||||
}
|
||||
if (StringUtils.isNotBlank(lpkGoods.getUnitName())) {
|
||||
bagGoods.setUnitName(lpkGoods.getUnitName());
|
||||
}
|
||||
if (StringUtils.isNotBlank(lpkGoods.getPrice())) {
|
||||
bagGoods.setPrice(lpkGoods.getPrice());
|
||||
}
|
||||
bagGoods.setWeight(lpkGoods.getWeight());
|
||||
bagGoods.setSpecificationUnit(lpkGoods.getSpecificationUnit());
|
||||
}
|
||||
}
|
||||
goods.add(bagGoods);
|
||||
}
|
||||
}
|
||||
vo.setGoods(goods);
|
||||
}
|
||||
return rb.success().setData(vo);
|
||||
}
|
||||
|
||||
public ResultBean deleteBag(String sid) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
RecommendNewUserBag RecommendNewUserBag = fetchBySid(sid);
|
||||
if (null != RecommendNewUserBag) {
|
||||
baseMapper.deleteById(RecommendNewUserBag.getId());
|
||||
recommendNewUserBagDetailsService.deleteGoodsByBagSid(sid);
|
||||
}
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
public ResultBean giftBagList() {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
List<RecommendNewUserBagVo> pagging = baseMapper.giftBagList();
|
||||
return rb.success().setData(pagging);
|
||||
}
|
||||
public ResultBean isGrounding(String sid,String state) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
RecommendNewUserBag bag=baseMapper.selectOne(new QueryWrapper<RecommendNewUserBag>().eq("sid",sid));
|
||||
bag.setIsGrounding(state);
|
||||
baseMapper.updateById(bag);
|
||||
return rb.success().setMsg("修改成功");
|
||||
}
|
||||
|
||||
public int saveBags(List<RecommendNewUserBag> bags) {
|
||||
return baseMapper.saveBags(bags);
|
||||
}
|
||||
public ResultBean<List<RecommendNewUserBagVo>> recommendNewUserBagList() {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
List<RecommendNewUserBagVo> list=baseMapper.giftBagList();
|
||||
list.forEach(s->{
|
||||
// s.setPrice(Double.valueOf(aa(s.getPrice())));
|
||||
List<com.yxt.yythmall.api.appletgiftbag.GiftBagGoods> list1=recommendNewUserBagDetailsService.getGoodsByBagSidB(s.getSid());
|
||||
list1.forEach(l->{
|
||||
l.setCount("共"+Integer.valueOf(l.getGoodsNumber())+l.getUnitName());
|
||||
l.setSpec(l.getWeight()+l.getSpecificationUnit()+"/"+l.getUnitName());
|
||||
|
||||
});
|
||||
// List<RecommendNewUserBagGoods> RecommendNewUserBagGoods=RecommendNewUserBagGoodsService.list(new QueryWrapper<RecommendNewUserBagGoods>().eq("giftbagSid",s.getSid()));
|
||||
s.setCount(list1.size()+"种蔬菜");
|
||||
s.setIconUrl(fileUploadComponent.getUrlPrefix() +s.getIconUrl());
|
||||
s.setGiftBagGoods(list1);
|
||||
});
|
||||
|
||||
return rb.success().setData(list);
|
||||
}
|
||||
public ResultBean<RecommendNewUserBagDetailVo> getGiftBagBySid(String sid ) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
List<com.yxt.yythmall.api.appletgiftbag.GiftBagGoods> goodsList=recommendNewUserBagDetailsService.getGoodsByBagSidA(sid);
|
||||
RecommendNewUserBagDetailVo RecommendNewUserBagVo=new RecommendNewUserBagDetailVo();
|
||||
RecommendNewUserBag s= baseMapper.selectOne(new QueryWrapper<RecommendNewUserBag>().eq("sid",sid));
|
||||
double i=0;
|
||||
DecimalFormat decimalFormat = new DecimalFormat("#0.00");
|
||||
for(com.yxt.yythmall.api.appletgiftbag.GiftBagGoods goods:goodsList){
|
||||
// i=i+Double.valueOf(goods.getJPrice())*Double.valueOf(goods.getGoodsNumber());
|
||||
i=i+Double.valueOf(goods.getJPrice())*Double.valueOf(goods.getWeight())*Double.valueOf(goods.getGoodsNumber());
|
||||
goods.setIconUrl(fileUploadComponent.getUrlPrefix() +goods.getIconUrl());
|
||||
goods.setTotalValue(String.valueOf(decimalFormat.format(Double.valueOf(goods.getGoodsNumber())*Double.valueOf(goods.getJPrice())*Double.valueOf(goods.getWeight()))));
|
||||
// goods.setJPrice(String.valueOf(decimalFormat.format(Double.valueOf(goods.getPrice())*Double.valueOf(goods.getWeight()))));
|
||||
goods.setPrice(String.valueOf(decimalFormat.format(Double.valueOf(goods.getJPrice())*Double.valueOf(goods.getWeight()))));
|
||||
}
|
||||
RecommendNewUserBagVo.setPrice(decimalFormat.format(i));
|
||||
RecommendNewUserBagVo.setGoods(goodsList);
|
||||
RecommendNewUserBagVo.setName(s.getName());
|
||||
return rb.success().setData(RecommendNewUserBagVo);
|
||||
}
|
||||
public static String aa(double a){
|
||||
BigDecimal d=new BigDecimal(a);
|
||||
String c= d.setScale(2,BigDecimal.ROUND_HALF_UP).toString();
|
||||
return String.valueOf(c);
|
||||
}
|
||||
public ResultBean recommendRecord(String sid ) {
|
||||
ResultBean rb=new ResultBean().fail();
|
||||
RecommendNewUserBagVo vo=new RecommendNewUserBagVo();
|
||||
RecommendNewUserBag bag=baseMapper.selectOne(new QueryWrapper<RecommendNewUserBag>().eq("sid","e49555f2-5370-45b0-9637-aa4d54c22e31"));
|
||||
vo.setRemarks(bag.getRemarks());
|
||||
vo.setIconUrl(fileUploadComponent.getUrlPrefix() +bag.getIconUrl());
|
||||
RecommendRecord recommendRecord=new RecommendRecord();
|
||||
recommendRecord.setContent("梧桐居助力您获得7斤白菜");
|
||||
RecommendRecord recommendRecord1=new RecommendRecord();
|
||||
recommendRecord1.setContent("龙助力您获得7斤白菜");
|
||||
RecommendRecord recommendRecord2=new RecommendRecord();
|
||||
recommendRecord2.setContent("美人助力您获得15斤土豆");
|
||||
List<RecommendRecord> list=new ArrayList<>();
|
||||
list.add(recommendRecord);
|
||||
list.add(recommendRecord1);
|
||||
list.add(recommendRecord2);
|
||||
vo.setRecordList(list);
|
||||
return rb.success().setData(vo);
|
||||
}
|
||||
public ResultBean newUserQuota() {
|
||||
ResultBean rb=new ResultBean().fail();
|
||||
List<RecommendNewUserBagVo> s=baseMapper.giftBagGoodsList();
|
||||
for (RecommendNewUserBagVo RecommendNewUserBagVo : s) {
|
||||
List<RecommendNewUserBagDetails> giftBagGoods=recommendNewUserBagDetailsService.list(new QueryWrapper<RecommendNewUserBagDetails>().eq("giftbagSid",RecommendNewUserBagVo.getSid()));
|
||||
for(RecommendNewUserBagDetails goods:giftBagGoods){
|
||||
LpkGoods lpkGoods=lpkGoodsService.getOne(new QueryWrapper<LpkGoods>().eq("sid",goods.getGoodsSid()));
|
||||
RecommendNewUserBagVo.setWeight(removeZeros(String.valueOf(Double.valueOf(lpkGoods.getWeight())*Double.valueOf(goods.getGoodsNumber())+Double.valueOf(RecommendNewUserBagVo.getWeight()))));
|
||||
}
|
||||
RecommendNewUserBagVo.setIconUrl(fileUploadComponent.getUrlPrefix() +RecommendNewUserBagVo.getIconUrl());
|
||||
}
|
||||
return rb.success().setData(s);
|
||||
}
|
||||
public ResultBean<List<GiftBagGoodss>> getGoodsByBagSid(String bagSid) {
|
||||
ResultBean rb=new ResultBean().fail();
|
||||
List<GiftBagGoodss> s=baseMapper.getGoodsByBagSid(bagSid);
|
||||
return rb.success().setData(s);
|
||||
}
|
||||
/**
|
||||
* 去除多余.0
|
||||
* @param num
|
||||
* @return
|
||||
*/
|
||||
public static String removeZeros(String num) {
|
||||
if (num.indexOf(".") > 0) {
|
||||
// 去掉多余的0
|
||||
num = num.replaceAll("0+?$", "");
|
||||
// 如果最后一位是. 则去掉
|
||||
num = num.replaceAll("[.]$", "");
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.yxt.yythmall.biz.recommendnewuserbagdetails;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.yythmall.api.appletgiftbag.GiftBagGoods;
|
||||
import com.yxt.yythmall.api.recommendnewuserbagdetails.RecommendNewUserBagDetails;
|
||||
import com.yxt.yythmall.api.recommendnewuserbagdetails.RecommendNewUserBagDetailsVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:03
|
||||
*/
|
||||
@Mapper
|
||||
public interface RecommendNewUserBagDetailsMapper extends BaseMapper<RecommendNewUserBagDetails> {
|
||||
|
||||
|
||||
int deleteGoodsByBagSid(@Param("sid") String sid);
|
||||
|
||||
@Select("select goods.name as goodsName,bads.goodsNumber ,bads.goodsSid,goods.picUrl,goods.price,goods.unitName,goods.remarks " +
|
||||
" from applet_giftbag_goods bads left join lpk_goods goods on goods.sid =bads.goodsSid where bads.giftbagSid=#{sid}")
|
||||
List<RecommendNewUserBagDetailsVo> getGoodsByBagSid(String sid);
|
||||
|
||||
@Select("select goods.name as name,bads.goodsNumber ,bads.goodsSid,goods.picUrl as iconUrl,goods.price as jPrice,goods.unitName,goods.content as remark " +
|
||||
" ,goods.weight, goods.specificationUnit from applet_giftbag_goods bads left join lpk_goods goods on goods.sid =bads.goodsSid where bads.giftbagSid=#{sid}")
|
||||
List<GiftBagGoods> getGoodsByBagSidA(String sid);
|
||||
@Select("select goods.name as name,bads.goodsNumber ,bads.goodsSid,goods.picUrl as iconUrl,goods.price as jPrice,goods.unitName,goods.content as remark " +
|
||||
" ,goods.weight, goods.specificationUnit from applet_giftbag_goods bads left join lpk_goods goods on goods.sid =bads.goodsSid where bads.giftbagSid=#{sid}")
|
||||
List<GiftBagGoods> getGoodsByBagSidB(String sid);
|
||||
List<RecommendNewUserBagDetails> getRecordsByBagSid(@Param("sid") String sid);
|
||||
|
||||
int saveBagGoods(@Param("bagGoods") List<RecommendNewUserBagDetails> bagGoods);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yxt.yythmall.biz.recommendnewuserbagdetails.RecommendNewUserBagDetailsMapper">
|
||||
<!-- <where> ${ew.sqlSegment} </where>-->
|
||||
<!-- ${ew.customSqlSegment} -->
|
||||
|
||||
<delete id="deleteGoodsByBagSid">
|
||||
DELETE
|
||||
FROM recommend_newuser_bag_details
|
||||
WHERE giftbagSid = #{sid}
|
||||
</delete>
|
||||
<select id="getRecordsByBagSid" resultType="com.yxt.yythmall.api.recommendnewuserbagdetails.RecommendNewUserBagDetails">
|
||||
select *
|
||||
from recommend_newuser_bag_details
|
||||
WHERE giftbagSid = #{sid}
|
||||
</select>
|
||||
<insert id="saveBagGoods" parameterType="java.util.List">
|
||||
insert into recommend_newuser_bag_details(sid,createTime,giftbagSid,goodsSid,goodsNumber)
|
||||
values
|
||||
<foreach collection="bagGoods" item="item" index="index" separator=",">
|
||||
(#{item.sid},#{item.createTime},#{item.giftbagSid},#{item.goodsSid},#{item.goodsNumber})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.yxt.yythmall.biz.recommendnewuserbagdetails;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:03
|
||||
*/
|
||||
|
||||
@Api(tags = "礼包包含商品信息")
|
||||
@RestController
|
||||
@RequestMapping("recobagdetails")
|
||||
public class RecommendNewUserBagDetailsRest {
|
||||
|
||||
@Autowired
|
||||
RecommendNewUserBagDetailsService recommendNewUserBagDetailsService;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.yxt.yythmall.biz.recommendnewuserbagdetails;
|
||||
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.yythmall.api.appletgiftbag.GiftBagGoods;
|
||||
import com.yxt.yythmall.api.recommendnewuserbagdetails.RecommendNewUserBagDetails;
|
||||
import com.yxt.yythmall.api.recommendnewuserbagdetails.RecommendNewUserBagDetailsVo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:03
|
||||
*/
|
||||
@Service
|
||||
public class RecommendNewUserBagDetailsService extends MybatisBaseService<RecommendNewUserBagDetailsMapper, RecommendNewUserBagDetails> {
|
||||
|
||||
public int deleteGoodsByBagSid(String sid) {
|
||||
return baseMapper.deleteGoodsByBagSid(sid);
|
||||
}
|
||||
|
||||
public List<RecommendNewUserBagDetails> getRecordsByBagSid(String sid) {
|
||||
return baseMapper.getRecordsByBagSid(sid);
|
||||
}
|
||||
|
||||
public List<RecommendNewUserBagDetailsVo> getGoodsByBagSid(String sid) {
|
||||
return baseMapper.getGoodsByBagSid(sid);
|
||||
}
|
||||
public List<GiftBagGoods> getGoodsByBagSidA(String sid) {
|
||||
return baseMapper.getGoodsByBagSidA(sid);
|
||||
}
|
||||
public List<GiftBagGoods> getGoodsByBagSidB(String sid) {
|
||||
return baseMapper.getGoodsByBagSidB(sid);
|
||||
}
|
||||
|
||||
public int saveBagGoods(List<RecommendNewUserBagDetails> bagGoods) {
|
||||
return baseMapper.saveBagGoods(bagGoods);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,16 +13,21 @@ import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.yythmall.api.empcardbuildrecord.EmpCardBuildRecord;
|
||||
import com.yxt.yythmall.api.empcardbuildrecord.EmpCardBuildRecordQuery;
|
||||
import com.yxt.yythmall.api.empcardbuildrecord.EmpCardBuildRecordVo;
|
||||
import com.yxt.yythmall.api.lpkcustomer.LpkCustomer;
|
||||
import com.yxt.yythmall.api.lpkgiftcard.LpkGiftCardQuery;
|
||||
import com.yxt.yythmall.api.ordorder.OrdOrderDto;
|
||||
import com.yxt.yythmall.api.ordorderdetails.OrdOrderDetailVo;
|
||||
import com.yxt.yythmall.api.shoppingcart.ShoppingCart;
|
||||
import com.yxt.yythmall.api.shoppingcart.ShoppingCartDto;
|
||||
import com.yxt.yythmall.api.shoppingcart.ShoppingCartQuery;
|
||||
import com.yxt.yythmall.api.shoppingcart.ShoppingCartVo;
|
||||
import com.yxt.yythmall.biz.empcard.EmpCardService;
|
||||
import com.yxt.yythmall.biz.lpkcustomer.LpkCustomerService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -34,6 +39,8 @@ import java.util.List;
|
||||
public class ShoppingCartService extends MybatisBaseService<ShoppingCartMapper, ShoppingCart> {
|
||||
@Autowired
|
||||
private FileUploadComponent fileUploadComponent;
|
||||
@Autowired
|
||||
LpkCustomerService lpkCustomerService;
|
||||
|
||||
public ResultBean save(ShoppingCartDto dto) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
@@ -62,7 +69,7 @@ public class ShoppingCartService extends MybatisBaseService<ShoppingCartMapper,
|
||||
ShoppingCart entity=new ShoppingCart();
|
||||
List<ShoppingCartVo> list= baseMapper.ShoppingCartList(query.getCustomerSid(),query.getBrandId());
|
||||
list.forEach(s->{
|
||||
s.setTotalPrice(String.valueOf((int)(Double.valueOf(s.getPrice())* Double.valueOf(s.getGoodsNumber()))));
|
||||
s.setTotalPrice(removeZeros(String.valueOf((Double.valueOf(s.getPrice())* Double.valueOf(s.getGoodsNumber())))));
|
||||
s.setIconUrl(fileUploadComponent.getUrlPrefix() +s.getIconUrl());
|
||||
});
|
||||
|
||||
@@ -100,8 +107,92 @@ public class ShoppingCartService extends MybatisBaseService<ShoppingCartMapper,
|
||||
weight=Double.valueOf(vo.getWeight())*Double.valueOf(vo.getGoodsNumber())+weight;
|
||||
}
|
||||
ShoppingCartVo vo =new ShoppingCartVo();
|
||||
// vo.setText("1.20斤起订量。\n" +
|
||||
// "2.新用户正好20斤5折。\n" +
|
||||
// "3.20-100斤加10%附加额。\n" +
|
||||
// "4.101斤-200斤加5%附加额。");
|
||||
vo.setCustomerSid(query.getCustomerSid());
|
||||
vo.setTotalPrice(String.valueOf((int) price));
|
||||
vo.setTotalWeight(String.valueOf((int)weight));
|
||||
vo=price(vo);
|
||||
return rb.success().setData(vo);
|
||||
}
|
||||
private ShoppingCartVo price(ShoppingCartVo vo){
|
||||
int weight=Integer.parseInt(vo.getTotalWeight());
|
||||
LpkCustomer lpkCustomer=lpkCustomerService.getOne(new QueryWrapper<LpkCustomer>().eq("sid",vo.getCustomerSid()));
|
||||
vo.setRemarks("已减免附加费");
|
||||
if(weight<=99){
|
||||
if(weight<=20){
|
||||
vo.setRemarks("不足20斤,请继续选菜");
|
||||
}else{
|
||||
double a =1.1;
|
||||
double d=Double.valueOf(vo.getTotalPrice());
|
||||
double t=Double.valueOf(vo.getTotalPrice())*a;
|
||||
BigDecimal bg = new BigDecimal(t);
|
||||
vo.setTotalPrice(String.valueOf(bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()));
|
||||
// String c =String.valueOf(Double.valueOf(vo.getTotalPrice())-d);
|
||||
double f=Double.valueOf(vo.getTotalPrice())-d;
|
||||
BigDecimal bgd = new BigDecimal(f);
|
||||
String c =String.valueOf(bgd.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
|
||||
vo.setRemarks("包含附加费"+removeZeros(c)+"元");
|
||||
}
|
||||
// if(weight==20){
|
||||
// if(lpkCustomer.getIsPurchase().equals("1")){
|
||||
// double a =0.5;
|
||||
// double t=Double.valueOf(vo.getTotalPrice())*a;
|
||||
// BigDecimal bg = new BigDecimal(t);
|
||||
// vo.setTotalPrice(String.valueOf(bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()));
|
||||
// vo.setRemarks("已享受新人专享5折优惠");
|
||||
// }else{
|
||||
// double a =1.1;
|
||||
// double d=Double.valueOf(vo.getTotalPrice());
|
||||
// double t=Double.valueOf(vo.getTotalPrice())*a;
|
||||
// BigDecimal bg = new BigDecimal(t);
|
||||
// vo.setTotalPrice(String.valueOf(bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()));
|
||||
// double f=Double.valueOf(vo.getTotalPrice())-d;
|
||||
// BigDecimal bgd = new BigDecimal(f);
|
||||
// String c =String.valueOf(bgd.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
|
||||
// vo.setRemarks("包含附加费"+removeZeros(c)+"元");
|
||||
// }
|
||||
// }else{
|
||||
// double a =1.1;
|
||||
// double d=Double.valueOf(vo.getTotalPrice());
|
||||
// double t=Double.valueOf(vo.getTotalPrice())*a;
|
||||
// BigDecimal bg = new BigDecimal(t);
|
||||
// vo.setTotalPrice(String.valueOf(bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()));
|
||||
//// String c =String.valueOf(Double.valueOf(vo.getTotalPrice())-d);
|
||||
// double f=Double.valueOf(vo.getTotalPrice())-d;
|
||||
// BigDecimal bgd = new BigDecimal(f);
|
||||
// String c =String.valueOf(bgd.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
|
||||
// vo.setRemarks("包含附加费"+removeZeros(c)+"元");
|
||||
// }
|
||||
|
||||
}else if(weight>=100 && weight<=199){
|
||||
double a =1.05;
|
||||
double d=Double.valueOf(vo.getTotalPrice());
|
||||
double t=Double.valueOf(vo.getTotalPrice())*a;
|
||||
BigDecimal bg = new BigDecimal(t);
|
||||
vo.setTotalPrice(String.valueOf(bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()));
|
||||
// String c =String.valueOf(Double.valueOf(vo.getTotalPrice())-d);
|
||||
double f=Double.valueOf(vo.getTotalPrice())-d;
|
||||
BigDecimal bgd = new BigDecimal(f);
|
||||
String c =String.valueOf(bgd.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
|
||||
vo.setRemarks("包含附加费"+removeZeros(c)+"元");
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
/**
|
||||
* 去除多余.0
|
||||
* @param num
|
||||
* @return
|
||||
*/
|
||||
public static String removeZeros(String num) {
|
||||
if (num.indexOf(".") > 0) {
|
||||
// 去掉多余的0
|
||||
num = num.replaceAll("0+?$", "");
|
||||
// 如果最后一位是. 则去掉
|
||||
num = num.replaceAll("[.]$", "");
|
||||
}
|
||||
return num;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,9 +5,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yxt.yythmall.api.transferrecords.TransferRecords;
|
||||
import com.yxt.yythmall.api.transferrecords.TransferRecordsQuery;
|
||||
import com.yxt.yythmall.api.transferrecords.TransferRecordsVo;
|
||||
import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrder;
|
||||
import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrderQuery;
|
||||
import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrderVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
@@ -6,38 +6,53 @@
|
||||
|
||||
<select id="orderListByUserSid" resultType="com.yxt.yythmall.api.transferrecords.TransferRecordsVo">
|
||||
SELECT
|
||||
sid ,
|
||||
'转赠' as type,
|
||||
transferCode,
|
||||
createTime ,
|
||||
remarks,
|
||||
case state
|
||||
when 1 then '已分享'
|
||||
when 2 then '已领取'
|
||||
end stateValue
|
||||
s.sid,
|
||||
'转赠' AS type,
|
||||
s.transferCode,
|
||||
s.createTime,
|
||||
s.remarks,
|
||||
r.nick as fxNick,
|
||||
d.nick as lqNick,
|
||||
s.state,
|
||||
CASE
|
||||
state
|
||||
WHEN 1 THEN
|
||||
'已分享'
|
||||
WHEN 2 THEN
|
||||
'已领取'
|
||||
END stateValue
|
||||
FROM
|
||||
transfer_records
|
||||
transfer_records s
|
||||
LEFT JOIN lpk_customer r on r.sid =s.customerSid
|
||||
left join lpk_customer d on d.sid =s.recipientSid
|
||||
WHERE
|
||||
customerSid=#{query.customerSid}
|
||||
|
||||
|
||||
order by s.createTime desc
|
||||
</select>
|
||||
<select id="orderListByUserSid1" resultType="com.yxt.yythmall.api.transferrecords.TransferRecordsVo">
|
||||
SELECT
|
||||
sid,
|
||||
'领取' as type,
|
||||
transferCode,
|
||||
createTime ,
|
||||
remarks,
|
||||
case state
|
||||
when 1 then '已分享'
|
||||
when 2 then '已领取'
|
||||
end stateValue
|
||||
s.sid,
|
||||
'转赠' AS type,
|
||||
s.transferCode,
|
||||
s.createTime,
|
||||
s.remarks,
|
||||
r.nick as fxNick,
|
||||
d.nick as lqNick,
|
||||
s.state,
|
||||
CASE
|
||||
state
|
||||
WHEN 1 THEN
|
||||
'已分享'
|
||||
WHEN 2 THEN
|
||||
'已领取'
|
||||
END stateValue
|
||||
FROM
|
||||
transfer_records
|
||||
transfer_records s
|
||||
LEFT JOIN lpk_customer r on r.sid =s.customerSid
|
||||
left join lpk_customer d on d.sid =s.recipientSid
|
||||
WHERE
|
||||
recipientSid =#{query.customerSid}
|
||||
|
||||
order by s.createTime desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -10,6 +10,7 @@ import com.yxt.common.base.utils.PagerUtil;
|
||||
import com.yxt.common.base.utils.StringUtils;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.yythmall.api.customerstore.CustomerStoreDto;
|
||||
import com.yxt.yythmall.api.lpkgiftcard.GoodsVo;
|
||||
import com.yxt.yythmall.api.lpkgoods.LpkGoods;
|
||||
@@ -22,9 +23,6 @@ import com.yxt.yythmall.api.transferrecordsgoodsdetails.TransferRecordsGoodsDeta
|
||||
import com.yxt.yythmall.api.vegecallerreservedetails.VegeCellarReserveDetails;
|
||||
import com.yxt.yythmall.api.vegecallerreserveorder.OrderGoodsVo;
|
||||
import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrder;
|
||||
import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrderQuery;
|
||||
import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrderVo;
|
||||
import com.yxt.yythmall.api.vegetablecellar.VegetableCellar;
|
||||
import com.yxt.yythmall.biz.customerstore.CustomerStoreService;
|
||||
import com.yxt.yythmall.biz.lpkgiftcard.LpkGiftCardService;
|
||||
import com.yxt.yythmall.biz.lpkgiftcard.generateRule.UniqueIdGenerator;
|
||||
@@ -90,14 +88,28 @@ public class TransferRecordsService extends MybatisBaseService<TransferRecordsMa
|
||||
// orderGoodsVo.setUnitName(lpkGoods.getUnitName());
|
||||
// goodsVo.add(orderGoodsVo);
|
||||
if(StringUtils.isBlank(vo.getGoodss())){
|
||||
vo.setGoodss(lpkGoods.getName()+":"+goods1.getGoodsNumber()+lpkGoods.getUnitName());
|
||||
vo.setGoodss(lpkGoods.getName()+":"+removeZeros(String.valueOf(goods1.getGoodsNumber()))+lpkGoods.getUnitName());
|
||||
}else{
|
||||
vo.setGoodss(vo.getGoodss()+" "+lpkGoods.getName()+":"+goods1.getGoodsNumber()+lpkGoods.getUnitName());
|
||||
vo.setGoodss(vo.getGoodss()+" "+lpkGoods.getName()+":"+removeZeros(String.valueOf(goods1.getGoodsNumber()))+lpkGoods.getUnitName());
|
||||
}
|
||||
}
|
||||
// vo.setGoodsVo(goodsVo);
|
||||
}
|
||||
return rb.success().setData(1);
|
||||
PagerVo<TransferRecordsVo> p = PagerUtil.pageToVo(pagging, null);
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
/**
|
||||
* 去除多余.0
|
||||
* @param num
|
||||
* @return
|
||||
*/
|
||||
public static String removeZeros(String num) {
|
||||
if (num.indexOf(".") > 0) {
|
||||
// 去掉多余的0
|
||||
num = num.replaceAll("0+?$", "");
|
||||
// 如果最后一位是. 则去掉
|
||||
num = num.replaceAll("[.]$", "");
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,6 +23,6 @@ public interface TransferRecordsGoodsDetailsMapper extends BaseMapper<TransferRe
|
||||
List<TransferRecordsGoodsDetails> selByOrderSid(String orderSid);
|
||||
|
||||
List<TransferRecordsGoodsDetails> selInOrderSid(@Param("orderSids") List<String> orderSids);
|
||||
@Select("select *,goodsNumber as goodsNumber from lpk_reserve_order_goods where orderSid=#{orderSid}")
|
||||
@Select("select *,goodsNumber as goodsNumber from transfer_records_goods_details where orderSid=#{orderSid}")
|
||||
List<TransferRecordsGoodsDetails> selByOrderSids(String orderSid);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
*/
|
||||
@Api(tags = "预约订单信息")
|
||||
@RestController
|
||||
@RequestMapping("lpksreservoordersss")
|
||||
@RequestMapping("vegecellarreservedetails")
|
||||
public class VegeCellarReserveDetailsRest {
|
||||
@Autowired
|
||||
VegeCellarReserveDetailsService vegeCellarReserveOrderService;
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.yxt.yythmall.biz.vegecallerreserveorder;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.yxt.common.core.vo.Vo;
|
||||
import com.yxt.yythmall.api.lpkreserveorder.OrderGoodsVo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Fan
|
||||
* @description
|
||||
* @date 2023/11/27 15:11
|
||||
*/
|
||||
@Data
|
||||
public class ReserveOrderVo implements Vo {
|
||||
private String reserveDate;
|
||||
private String customerSid;
|
||||
private String storeSid;
|
||||
private String storeName;
|
||||
private String storeLinker;
|
||||
private String storePhone;
|
||||
private String storeAddress;
|
||||
private String affiliation;
|
||||
private String userName;
|
||||
private String userPhone;
|
||||
private String bankSid;
|
||||
private String bankName;
|
||||
private String bankLinker;
|
||||
private String bankPhone;
|
||||
private String bankAddress;
|
||||
private String goodsSid;
|
||||
private String goodsName;
|
||||
private String goodsNumber;
|
||||
}
|
||||
@@ -3,16 +3,13 @@ package com.yxt.yythmall.biz.vegecallerreserveorder;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrder;
|
||||
import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrderQuery;
|
||||
import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrderVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
@@ -28,6 +25,8 @@ public interface VegeCellarReserveOrderMapper extends BaseMapper<VegeCellarReser
|
||||
//
|
||||
//// IPage<VegeCellarReserveOrderCardVo> orderListByUserSid(IPage<VegeCellarReserveOrder> page, @Param(Constants.WRAPPER) QueryWrapper<VegeCellarReserveOrder> qw);
|
||||
IPage<VegeCellarReserveOrderVo> orderListByUserSid(IPage<VegeCellarReserveOrder> page, @Param("query") VegeCellarReserveOrderQuery query);
|
||||
|
||||
PagerVo<ReserveOrderVo> pageOfCustomer(IPage<VegeCellarReserveOrder> page,QueryWrapper<VegeCellarReserveOrder> qw);
|
||||
//
|
||||
// List<ReserveOrderExport> exportExcel(@Param("qw") VegeCellarReserveOrderQuery qw);
|
||||
// List<ReserveOrderExportByStore> exportExcelByStore(@Param(Constants.WRAPPER) QueryWrapper<VegeCellarReserveOrderQuery> qw);
|
||||
|
||||
@@ -259,6 +259,7 @@
|
||||
<where>
|
||||
o.customerSid=#{query.customerSid} and state=#{query.state}
|
||||
</where>
|
||||
order by o.reserveDate desc
|
||||
</select>
|
||||
<select id="exportExcel" resultType="com.yxt.yythmall.api.lpkreserveorder.ReserveOrderExport">
|
||||
select
|
||||
@@ -446,4 +447,35 @@
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="pageOfCustomer" resultType="com.yxt.yythmall.biz.vegecallerreserveorder.ReserveOrderVo">
|
||||
select
|
||||
date_format(vo.reserveDate,'%Y-%m-%d') reserveDate,
|
||||
vo.customerSid,
|
||||
vo.storeSid,
|
||||
max(ls.name) storeName,
|
||||
max(ls.linker) storeLinker,
|
||||
max(ls.phone) storePhone,
|
||||
max(ls.address) storeAddress,
|
||||
max(vo.affiliation) affiliation,
|
||||
max(vo.userName) userName,
|
||||
max(vo.userPhone) userPhone,
|
||||
max(lb.sid) bankSid,
|
||||
max(lb.name) bankName,
|
||||
max(lb.linker) bankLinker,
|
||||
max(lb.linkPhone) bankPhone,
|
||||
max(lb.address) bankAddress,
|
||||
vd.goodsSid,
|
||||
max(vd.goodsName) goodsName,
|
||||
sum(vd.goodsNumber) goodsNumber
|
||||
from vege_cellar_reserve_order vo
|
||||
LEFT JOIN lpk_store ls ON ls.sid=vo.storeSid
|
||||
LEFT JOIN lpk_bank lb ON lb.sid=ls.bankSid
|
||||
left join vege_cellar_reserve_details vd on vo.sid=vd.orderSid
|
||||
left join lpk_goods lg on vd.goodsSid=lg.sid
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
GROUP BY vo.reserveDate,vo.storeSid,vo.customerSid,vd.goodsSid
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -3,47 +3,29 @@ package com.yxt.yythmall.biz.vegecallerreserveorder;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.write.metadata.style.WriteCellStyle;
|
||||
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yxt.common.base.config.component.FileUploadComponent;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.base.utils.PagerUtil;
|
||||
import com.yxt.common.base.utils.StringUtils;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.yythmall.api.lpkgiftbaggoods.LpkGiftBagGoodsVo;
|
||||
import com.yxt.yythmall.api.lpkgiftcard.AppletVo;
|
||||
import com.yxt.yythmall.api.lpkgiftcard.GoodsVo;
|
||||
import com.yxt.yythmall.api.lpkgoods.LpkGoods;
|
||||
import com.yxt.yythmall.api.lpkreserveorder.LpkReserveOrderQuery;
|
||||
import com.yxt.yythmall.api.lpkstore.LpkStore;
|
||||
import com.yxt.yythmall.api.lpkstore.StoreSelect;
|
||||
import com.yxt.yythmall.api.vegecallerreservedetails.VegeCellarReserveDetails;
|
||||
import com.yxt.yythmall.api.vegecallerreserveorder.*;
|
||||
import com.yxt.yythmall.biz.lpkgiftbaggoods.LpkGiftBagGoodsService;
|
||||
import com.yxt.yythmall.biz.lpkgiftcard.LpkGiftCardMapper;
|
||||
import com.yxt.yythmall.biz.lpkgiftcard.generateRule.UniqueIdGenerator;
|
||||
import com.yxt.yythmall.biz.lpkgoods.LpkGoodsService;
|
||||
import com.yxt.yythmall.biz.lpkstore.LpkStoreService;
|
||||
import com.yxt.yythmall.biz.vegecallerreservedetail.VegeCellarReserveDetailsService;
|
||||
import com.yxt.yythmall.utils.StyleUtils;
|
||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -54,28 +36,29 @@ import java.util.List;
|
||||
public class VegeCellarReserveOrderService extends MybatisBaseService<VegeCellarReserveOrderMapper, VegeCellarReserveOrder> {
|
||||
@Autowired
|
||||
VegeCellarReserveDetailsService vegeCellarReserveDetailsService;
|
||||
// @Autowired
|
||||
// @Autowired
|
||||
// LpkGiftCardMapper lpkGiftCardMapper;
|
||||
// @Autowired
|
||||
// LpkGiftBagGoodsService lpkGiftBagGoodsService;
|
||||
@Autowired
|
||||
LpkStoreService lpkStoreService;
|
||||
// @Autowired
|
||||
// @Autowired
|
||||
// private FileUploadComponent fileUploadComponent;
|
||||
@Autowired
|
||||
private LpkGoodsService lpkGoodsService;
|
||||
// @Autowired
|
||||
|
||||
// @Autowired
|
||||
// private HttpServletResponse response;
|
||||
//
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResultBean submission(VegeCellarReserveOrderDto dto) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
boolean b=isSatAndSun(dto.getReserveDate());
|
||||
if(!b){
|
||||
boolean b = isSatAndSun(dto.getReserveDate());
|
||||
if (!b) {
|
||||
return rb.setMsg("周六、周日不能预约提货");
|
||||
}
|
||||
VegeCellarReserveOrder order = new VegeCellarReserveOrder();
|
||||
LpkStore lpkStore= lpkStoreService.getOne(new QueryWrapper<LpkStore>().eq("sid",dto.getStoreSid()));
|
||||
LpkStore lpkStore = lpkStoreService.getOne(new QueryWrapper<LpkStore>().eq("sid", dto.getStoreSid()));
|
||||
BeanUtil.copyProperties(dto, order, "id", "sid");
|
||||
order.setStoreSid(dto.getStoreSid());
|
||||
// order.setCardSid(dto.getSid());
|
||||
@@ -85,19 +68,20 @@ public class VegeCellarReserveOrderService extends MybatisBaseService<VegeCellar
|
||||
order.setStoreName(lpkStore.getName());
|
||||
baseMapper.insert(order);
|
||||
dto.setOrderSid(order.getSid());
|
||||
vegeCellarReserveDetailsService.submissionDetail(dto);
|
||||
return rb.success().setData("预约成功");
|
||||
rb = vegeCellarReserveDetailsService.submissionDetail(dto);
|
||||
return rb;
|
||||
}
|
||||
|
||||
public ResultBean addGoodsOrder(VegeCellarReserveOrderDto dto) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
boolean b=isSatAndSun(dto.getReserveDate());
|
||||
if(!b){
|
||||
boolean b = isSatAndSun(dto.getReserveDate());
|
||||
if (!b) {
|
||||
return rb.setMsg("周六、周日不能预约提货");
|
||||
}
|
||||
VegeCellarReserveOrder order = new VegeCellarReserveOrder();
|
||||
order=baseMapper.selectList(new QueryWrapper<VegeCellarReserveOrder>().eq("customerSid",dto.getCustomerSid())
|
||||
.eq("affiliation",dto.getAffiliation()).eq("state","0")).get(0);
|
||||
if(order==null){
|
||||
order = baseMapper.selectList(new QueryWrapper<VegeCellarReserveOrder>().eq("customerSid", dto.getCustomerSid())
|
||||
.eq("affiliation", dto.getAffiliation()).eq("state", "0")).get(0);
|
||||
if (order == null) {
|
||||
BeanUtil.copyProperties(dto, order, "id", "sid");
|
||||
order.setStoreSid(dto.getStoreSid());
|
||||
// order.setCardSid(dto.getSid());
|
||||
@@ -108,16 +92,17 @@ public class VegeCellarReserveOrderService extends MybatisBaseService<VegeCellar
|
||||
vegeCellarReserveDetailsService.addDetail(dto);
|
||||
return rb.success().setData("预约成功");
|
||||
}
|
||||
|
||||
public ResultBean minusGoodsOrder(VegeCellarReserveOrderDto dto) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
boolean b=isSatAndSun(dto.getReserveDate());
|
||||
if(!b){
|
||||
boolean b = isSatAndSun(dto.getReserveDate());
|
||||
if (!b) {
|
||||
return rb.setMsg("周六、周日不能预约提货");
|
||||
}
|
||||
VegeCellarReserveOrder order = new VegeCellarReserveOrder();
|
||||
order=baseMapper.selectList(new QueryWrapper<VegeCellarReserveOrder>().eq("customerSid",dto.getCustomerSid())
|
||||
.eq("affiliation",dto.getAffiliation()).eq("state","0")).get(0);
|
||||
if(order==null){
|
||||
order = baseMapper.selectList(new QueryWrapper<VegeCellarReserveOrder>().eq("customerSid", dto.getCustomerSid())
|
||||
.eq("affiliation", dto.getAffiliation()).eq("state", "0")).get(0);
|
||||
if (order == null) {
|
||||
BeanUtil.copyProperties(dto, order, "id", "sid");
|
||||
order.setStoreSid(dto.getStoreSid());
|
||||
// order.setCardSid(dto.getSid());
|
||||
@@ -130,9 +115,9 @@ public class VegeCellarReserveOrderService extends MybatisBaseService<VegeCellar
|
||||
}
|
||||
|
||||
|
||||
|
||||
public boolean isSatAndSun(String date){
|
||||
DateTime dateTime = DateUtil.parse(date);; // 获取当前时间
|
||||
public boolean isSatAndSun(String date) {
|
||||
DateTime dateTime = DateUtil.parse(date);
|
||||
; // 获取当前时间
|
||||
int dayOfWeek = dateTime.dayOfWeekEnum().getValue();// 获取星期几(1-7)
|
||||
System.out.println(dayOfWeek);
|
||||
if (dayOfWeek == 1 || dayOfWeek == 7) {
|
||||
@@ -141,7 +126,8 @@ public class VegeCellarReserveOrderService extends MybatisBaseService<VegeCellar
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// @Test
|
||||
|
||||
// @Test
|
||||
// public void isSatAndSun(){
|
||||
// String date="2023-12-11";
|
||||
// DateTime dateTime = DateUtil.parse(date);; // 获取当前时间
|
||||
@@ -324,28 +310,28 @@ public class VegeCellarReserveOrderService extends MybatisBaseService<VegeCellar
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
VegeCellarReserveOrderQuery query = pq.getParams();
|
||||
QueryWrapper<VegeCellarReserveOrder> qw = new QueryWrapper<>();
|
||||
if(StringUtils.isBlank(query.getCustomerSid())){
|
||||
if (StringUtils.isBlank(query.getCustomerSid())) {
|
||||
return rb.setMsg("参数不全");
|
||||
}
|
||||
qw.eq("o.customerSid", query.getUserSid());
|
||||
qw.eq("o.state",query.getState());
|
||||
qw.eq("o.state", query.getState());
|
||||
qw.orderByDesc("reserveDate");
|
||||
IPage<VegeCellarReserveOrder> page = PagerUtil.queryToPage(pq);
|
||||
IPage<VegeCellarReserveOrderVo> pagging = baseMapper.orderListByUserSid(page, query);
|
||||
List<OrderGoodsVo> goodsVo = new ArrayList<>();
|
||||
for(VegeCellarReserveOrderVo vo:pagging.getRecords()){
|
||||
List<VegeCellarReserveDetails> goods =vegeCellarReserveDetailsService.selByOrderSids(vo.getSid());
|
||||
for(VegeCellarReserveDetails goods1:goods){
|
||||
LpkGoods lpkGoods=lpkGoodsService.getOne(new QueryWrapper<LpkGoods>().eq("sid",goods1.getGoodsSid()));
|
||||
List<OrderGoodsVo> goodsVo = new ArrayList<>();
|
||||
for (VegeCellarReserveOrderVo vo : pagging.getRecords()) {
|
||||
List<VegeCellarReserveDetails> goods = vegeCellarReserveDetailsService.selByOrderSids(vo.getSid());
|
||||
for (VegeCellarReserveDetails goods1 : goods) {
|
||||
LpkGoods lpkGoods = lpkGoodsService.getOne(new QueryWrapper<LpkGoods>().eq("sid", goods1.getGoodsSid()));
|
||||
// OrderGoodsVo orderGoodsVo=new OrderGoodsVo();
|
||||
// orderGoodsVo.setGoodName(lpkGoods.getName());
|
||||
// orderGoodsVo.setNum(Integer.parseInt(goods1.getNum()));
|
||||
// orderGoodsVo.setUnitName(lpkGoods.getUnitName());
|
||||
// goodsVo.add(orderGoodsVo);
|
||||
if(StringUtils.isBlank(vo.getGoodss())){
|
||||
vo.setGoodss(lpkGoods.getName()+":"+goods1.getNum()+lpkGoods.getUnitName());
|
||||
}else{
|
||||
vo.setGoodss(vo.getGoodss()+" "+lpkGoods.getName()+":"+goods1.getNum()+lpkGoods.getUnitName());
|
||||
if (StringUtils.isBlank(vo.getGoodss())) {
|
||||
vo.setGoodss(lpkGoods.getName() + ":" + goods1.getNum() + lpkGoods.getUnitName());
|
||||
} else {
|
||||
vo.setGoodss(vo.getGoodss() + " " + lpkGoods.getName() + ":" + goods1.getNum() + lpkGoods.getUnitName());
|
||||
}
|
||||
}
|
||||
vo.setGoodsVo(goodsVo);
|
||||
@@ -722,4 +708,36 @@ public class VegeCellarReserveOrderService extends MybatisBaseService<VegeCellar
|
||||
// return new ResultBean().success().setData(baseMapper.selOrderByCardSid(sid));
|
||||
// }
|
||||
|
||||
|
||||
private QueryWrapper<VegeCellarReserveOrder> buildQuery(LpkReserveOrderQuery query) {
|
||||
QueryWrapper<VegeCellarReserveOrder> qw = new QueryWrapper<>();
|
||||
if (StrUtil.isNotBlank(query.getStartDate())) {
|
||||
qw.ge("date_format(vo.reserveDate,'%Y-%m-%d')", query.getStartDate());
|
||||
}
|
||||
if (StrUtil.isNotBlank(query.getEndDate())) {
|
||||
qw.le("date_format(vo.reserveDate,'%Y-%m-%d')", query.getEndDate());
|
||||
}
|
||||
if (StrUtil.isNotBlank(query.getBankSid())) {
|
||||
qw.eq("lb.sid", query.getBankSid());
|
||||
}
|
||||
if (StrUtil.isNotBlank(query.getStore())) {
|
||||
qw.eq("vo.storeSid", query.getStore());
|
||||
}
|
||||
if (StrUtil.isNotBlank(query.getCardType())) {
|
||||
qw.eq("vo.affiliation", query.getCardType());
|
||||
}
|
||||
|
||||
qw.orderByAsc("vo.reserveDate");
|
||||
return qw;
|
||||
}
|
||||
|
||||
public ResultBean<PagerVo<ReserveOrderVo>> pageOfCustomer(PagerQuery<LpkReserveOrderQuery> pq) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
LpkReserveOrderQuery query = pq.getParams();
|
||||
QueryWrapper<VegeCellarReserveOrder> qw = buildQuery(query);
|
||||
|
||||
IPage<VegeCellarReserveOrder> page = PagerUtil.queryToPage(pq);
|
||||
PagerVo<ReserveOrderVo> pagerVo = baseMapper.pageOfCustomer(page,qw);
|
||||
return rb.success().setData(pagerVo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +55,8 @@ public class VegeReplenishService extends MybatisBaseService<VegeReplenishMapper
|
||||
private EmpCardGiftService empCardGiftService;
|
||||
@Autowired
|
||||
private EmpCardGiftGoodsService empCardGiftGoodsService;
|
||||
@Autowired
|
||||
private LpkGoodsService lpkGoodsService;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResultBean<String> saveBindRecord(BindCardDto dto, String type) {
|
||||
@@ -83,6 +85,9 @@ public class VegeReplenishService extends MybatisBaseService<VegeReplenishMapper
|
||||
detail.setGoodsNumber(Integer.parseInt(g.getGoodsNumber()));
|
||||
detail.setOrderSid(entity.getSid());
|
||||
detail.setCreateTime(new DateTime());
|
||||
if (StringUtils.isNotBlank(g.getName())) {
|
||||
detail.setGoodsName(g.getName());
|
||||
}
|
||||
vegeReplenishDetailService.insert(detail);
|
||||
});
|
||||
}
|
||||
@@ -102,6 +107,9 @@ public class VegeReplenishService extends MybatisBaseService<VegeReplenishMapper
|
||||
detail.setGoodsNumber(Integer.parseInt(g.getGoodsNumber()));
|
||||
detail.setOrderSid(entity.getSid());
|
||||
detail.setCreateTime(new DateTime());
|
||||
if (StringUtils.isNotBlank(g.getName())) {
|
||||
detail.setGoodsName(g.getName());
|
||||
}
|
||||
vegeReplenishDetailService.insert(detail);
|
||||
});
|
||||
}
|
||||
@@ -116,6 +124,10 @@ public class VegeReplenishService extends MybatisBaseService<VegeReplenishMapper
|
||||
goods.stream().forEach(g -> {
|
||||
VegeReplenishDetail detail = new VegeReplenishDetail();
|
||||
detail.setGoodsSid(g.getGoodsSid());
|
||||
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(g.getGoodsSid());
|
||||
if (null != lpkGoods) {
|
||||
detail.setGoodsName(lpkGoods.getName());
|
||||
}
|
||||
detail.setGoodsNumber(g.getGoodsNumber());
|
||||
detail.setOrderSid(entity.getSid());
|
||||
detail.setCreateTime(new DateTime());
|
||||
|
||||
@@ -22,7 +22,7 @@ public class VegetableCellarRest {
|
||||
@Autowired
|
||||
VegetableCellarService VegetableCellarService;
|
||||
@ApiOperation("创建记录列表")
|
||||
@PostMapping("/addGoods")
|
||||
@GetMapping("/addGoods")
|
||||
public ResultBean addGoods(@RequestParam("mainSid") String mainSid) {
|
||||
return VegetableCellarService.addGoods(mainSid);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.yxt.common.base.utils.StringUtils;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.yythmall.api.lpkcustomer.LpkCustomer;
|
||||
import com.yxt.yythmall.api.lpkgoods.LpkGoods;
|
||||
import com.yxt.yythmall.api.ordorder.OrdOrder;
|
||||
import com.yxt.yythmall.api.ordorderdetails.OrdOrderDetail;
|
||||
@@ -16,6 +17,7 @@ import com.yxt.yythmall.api.transferrecords.TransferRecords;
|
||||
import com.yxt.yythmall.api.transferrecordsgoodsdetails.TransferRecordsGoodsDetails;
|
||||
import com.yxt.yythmall.api.vegetablecellar.*;
|
||||
import com.yxt.yythmall.biz.empcard.EmpCardService;
|
||||
import com.yxt.yythmall.biz.lpkcustomer.LpkCustomerService;
|
||||
import com.yxt.yythmall.biz.lpkgoods.LpkGoodsService;
|
||||
import com.yxt.yythmall.biz.ordorder.OrdOrderService;
|
||||
import com.yxt.yythmall.biz.ordorderdetails.OrdOrderDetailService;
|
||||
@@ -24,7 +26,9 @@ import com.yxt.yythmall.biz.transferrecords.TransferRecordsService;
|
||||
import com.yxt.yythmall.biz.transferrecordsgoodsdetails.TransferRecordsGoodsDetailsService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -46,16 +50,20 @@ public class VegetableCellarService extends MybatisBaseService<VegetableCellarMa
|
||||
TransferRecordsGoodsDetailsService transferRecordsGoodsDetailsService;
|
||||
@Autowired
|
||||
LpkGoodsService lpkGoodsService;
|
||||
@Autowired
|
||||
LpkCustomerService lpkCustomerService;
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResultBean addGoods(String mainSid) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
OrdOrder ordOrder=ordOrderService.getOne(new QueryWrapper<OrdOrder>().eq("mainSid",mainSid));
|
||||
List<OrdOrderDetail> detailList=ordOrderDetailService.list(new QueryWrapper<OrdOrderDetail>().eq("orderSid",ordOrder.getSid()));
|
||||
for(OrdOrderDetail detail:detailList){
|
||||
LpkGoods cl=lpkGoodsService.getOne(new QueryWrapper<LpkGoods>().eq("sid",detail.getGoodsSid()));
|
||||
VegetableCellar vegetableCellar=baseMapper.selectOne(new QueryWrapper<VegetableCellar>().eq("customerSid",ordOrder.getUserSid())
|
||||
.eq("goodsSid",detail.getGoodsSid()).eq("affiliation",ordOrder.getVegeCellarType()));
|
||||
.eq("goodsSid",detail.getGoodsSid()).eq("affiliation",cl.getBrandId()));
|
||||
if(vegetableCellar==null){
|
||||
VegetableCellar vegetable=new VegetableCellar();
|
||||
vegetable.setAffiliation(ordOrder.getVegeCellarType());
|
||||
vegetable.setAffiliation(String.valueOf(cl.getBrandId()));
|
||||
vegetable.setGoodsSid(detail.getGoodsSid());
|
||||
vegetable.setGoodsNumber(String.valueOf(detail.getPartNumber()));
|
||||
vegetable.setCustomerSid(ordOrder.getUserSid());
|
||||
@@ -65,8 +73,15 @@ public class VegetableCellarService extends MybatisBaseService<VegetableCellarMa
|
||||
baseMapper.updateById(vegetableCellar);
|
||||
}
|
||||
}
|
||||
LpkCustomer customer=lpkCustomerService.getOne(new QueryWrapper<LpkCustomer>().eq("sid",ordOrder.getUserSid()));
|
||||
customer.setIsPurchase("0");
|
||||
lpkCustomerService.updateById(customer);
|
||||
ordOrder.setPayStatus(4);
|
||||
ordOrder.setPayTime(new Date());
|
||||
ordOrderService.updateById(ordOrder);
|
||||
return rb.success().setMsg("成功");
|
||||
}
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResultBean saveGoods(VegetableCellarDto dto) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
|
||||
@@ -87,11 +102,12 @@ public class VegetableCellarService extends MybatisBaseService<VegetableCellarMa
|
||||
baseMapper.updateById(vegetableCellar);
|
||||
}
|
||||
ShoppingCart shoppingCart=shoppingCartService.getOne((new QueryWrapper<ShoppingCart>().eq("customerSid",dto.getCustomerSid())
|
||||
.eq("goodsSid",detail.getGoodsSid()).eq("affiliation",dto.getBrandId())));
|
||||
.eq("goodsSid",detail.getGoodsSid()).eq("affiliation",dto.getBrandId())));
|
||||
shoppingCartService.delShoppingCart(shoppingCart.getSid());
|
||||
}
|
||||
return rb.success().setMsg("成功");
|
||||
}
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResultBean save1Goods(VegetableCellarDto dto) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
for(vegeVo detail:dto.getVos()){
|
||||
@@ -111,9 +127,10 @@ public class VegetableCellarService extends MybatisBaseService<VegetableCellarMa
|
||||
}
|
||||
return rb.success().setMsg("成功");
|
||||
}
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResultBean receiveTransferGoods(VegetableCellarDto dto) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
TransferRecords transferRecords=transferRecordsService.getOne(new QueryWrapper<TransferRecords>().eq("sid",dto.getTransferSid()).eq("state","0"));
|
||||
TransferRecords transferRecords=transferRecordsService.getOne(new QueryWrapper<TransferRecords>().eq("sid",dto.getTransferSid()).eq("state","1"));
|
||||
if(transferRecords==null){
|
||||
return rb.setMsg("已经被领取");
|
||||
}
|
||||
@@ -121,7 +138,7 @@ public class VegetableCellarService extends MybatisBaseService<VegetableCellarMa
|
||||
for(TransferRecordsGoodsDetails detail:list){
|
||||
LpkGoods cl=lpkGoodsService.getOne(new QueryWrapper<LpkGoods>().eq("sid",detail.getGoodsSid()));
|
||||
VegetableCellar vegetableCellar=baseMapper.selectOne(new QueryWrapper<VegetableCellar>().eq("customerSid",dto.getCustomerSid())
|
||||
.eq("goodsSid",detail.getGoodsSid()).eq("affiliation",transferRecords.getAffiliation()));
|
||||
.eq("goodsSid",detail.getGoodsSid()).eq("affiliation",cl.getBrandId()));
|
||||
if(vegetableCellar==null){
|
||||
VegetableCellar vegetable=new VegetableCellar();
|
||||
vegetable.setAffiliation(String.valueOf(cl.getBrandId()));
|
||||
@@ -135,6 +152,7 @@ public class VegetableCellarService extends MybatisBaseService<VegetableCellarMa
|
||||
}
|
||||
transferRecords.setState("2");
|
||||
transferRecords.setRecipientSid(dto.getCustomerSid());
|
||||
transferRecords.setRecipientTime(new Date());
|
||||
transferRecordsService.updateById(transferRecords);
|
||||
}
|
||||
return rb.success().setMsg("成功");
|
||||
|
||||
@@ -34,7 +34,10 @@ public class SaTokenConfigure implements WebMvcConfigurer {
|
||||
.excludePathPatterns("/empcard/isSaturAndSun/**")
|
||||
.excludePathPatterns("/lpkgiftcard/getReservationBySid/**")
|
||||
.excludePathPatterns("/lpksreservoorder/submission")
|
||||
.excludePathPatterns("/lpksreservoorder/exportExcelByStore")
|
||||
.excludePathPatterns("/empsreservoorder/createNewUserBagOrder")
|
||||
.excludePathPatterns("/lpksreservoorders/submission")
|
||||
.excludePathPatterns("/empsreservoorder/ordersList")
|
||||
.excludePathPatterns("/empsreservoorder/submission")
|
||||
.excludePathPatterns("/empsreservoorder/submissionEmp")
|
||||
.excludePathPatterns("/empcardgift/generateCard")
|
||||
@@ -43,6 +46,13 @@ public class SaTokenConfigure implements WebMvcConfigurer {
|
||||
.excludePathPatterns("/lpksreservoorder/orderByCardSid/**")
|
||||
.excludePathPatterns("/lpksreservoorder/orderListByUserSid/**")
|
||||
.excludePathPatterns("/lpksreservoorder/orderDetails/**")
|
||||
.excludePathPatterns("/newcomerrecorecord/recommendNewUsers")
|
||||
.excludePathPatterns("/newcomerrecorecord/recommendedAssistance")
|
||||
.excludePathPatterns("/newcomerrecorecord/recordList/**")
|
||||
.excludePathPatterns("/transferrecords/transferRecordsList")
|
||||
.excludePathPatterns("/empsreservoorder/createVegeOrder")
|
||||
.excludePathPatterns("/empsreservoorder/OrderDetails/**")
|
||||
.excludePathPatterns("/empsreservoorder/changePayState/**")
|
||||
.excludePathPatterns("/lpkgoods/goodsDetails/**")
|
||||
.excludePathPatterns("/lpkstore/getAllStoreByQuery")
|
||||
.excludePathPatterns("/vegetablecellar/receiveTransferGoods")
|
||||
|
||||
@@ -22,7 +22,7 @@ spring:
|
||||
timeout: 0 # 连接超时时间(毫秒)
|
||||
image:
|
||||
upload:
|
||||
path: D:/webapps/lipinka/yyth-ui/upload/
|
||||
path: D:/webapps/lipinka/yythmall-ui/upload/
|
||||
url:
|
||||
prefix: https://supervise.yxtsoft.com/lpk/upload/
|
||||
import:
|
||||
|
||||
Reference in New Issue
Block a user