12/15
This commit is contained in:
@@ -2,6 +2,7 @@ package com.yxt.yyth.api.empcard;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.yxt.common.base.utils.StringUtils;
|
||||
import com.yxt.yyth.api.empcardgrantlog.EmpCardGrantLogVo;
|
||||
import com.yxt.yyth.api.lpkgiftcard.GoodsVo;
|
||||
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderCardVo;
|
||||
import com.yxt.yyth.api.lpkstore.StoreSelect;
|
||||
@@ -40,10 +41,12 @@ public class EmpAppletVo {
|
||||
private String addressName;
|
||||
private String isReservation;//是否超过预约时间 0 否 1是
|
||||
private boolean notRese=true; //是否能预约
|
||||
private List<LpkReserveOrderCardVo> orderCardVoList;
|
||||
private List<EmpCardGrantLogVo> empCardGrantLogVos;
|
||||
private String value;
|
||||
private String serialNumber;
|
||||
|
||||
private String giftCode;
|
||||
private String giftCodeKey;
|
||||
private String qrCode;
|
||||
|
||||
public String getStart() {
|
||||
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd");
|
||||
@@ -83,7 +86,6 @@ public class EmpAppletVo {
|
||||
}
|
||||
return showBtn;
|
||||
}
|
||||
|
||||
public String getState() {
|
||||
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd");
|
||||
if(StringUtils.isNotBlank(dateEnd)){
|
||||
@@ -93,33 +95,58 @@ public class EmpAppletVo {
|
||||
showBtn=false;
|
||||
}else{
|
||||
state="待提货";
|
||||
if(states.equals("5")){
|
||||
if(isReservation.equals("0")){
|
||||
this.state="已预约";
|
||||
this.notRese=false;
|
||||
}else{
|
||||
if(states.equals("2")){
|
||||
this.state="已绑定";
|
||||
|
||||
}else if(states.equals("3")){
|
||||
this.state="已完成";
|
||||
showBtn=false;
|
||||
}
|
||||
}else if(states.equals("4")){
|
||||
if(isReservation.equals("0")){
|
||||
}
|
||||
}else{
|
||||
state="已绑定";
|
||||
if(states.equals("2")){
|
||||
this.state="已预约";
|
||||
}else{
|
||||
this.state="待提货";
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
state="待提货";
|
||||
if(states.equals("5")){
|
||||
if(isReservation.equals("0")){
|
||||
this.state="已预约";
|
||||
}else{
|
||||
this.state="已完成";
|
||||
showBtn=false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return state;
|
||||
}
|
||||
// public String getState() {
|
||||
// SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd");
|
||||
// if(StringUtils.isNotBlank(dateEnd)){
|
||||
// int i=DateUtil.parse(sdf.format(DateUtil.parse(dateEnd))).compareTo(DateUtil.parse(sdf.format(DateUtil.date())));
|
||||
// if( String.valueOf(i).equals("-1")){
|
||||
// state="已过期";
|
||||
// showBtn=false;
|
||||
// }else{
|
||||
// state="待提货";
|
||||
// if(states.equals("5")){
|
||||
// if(isReservation.equals("0")){
|
||||
// this.state="已预约";
|
||||
// this.notRese=false;
|
||||
// }else{
|
||||
// this.state="已完成";
|
||||
// showBtn=false;
|
||||
// }
|
||||
// }else if(states.equals("4")){
|
||||
// if(isReservation.equals("0")){
|
||||
// this.state="已预约";
|
||||
// }else{
|
||||
// this.state="待提货";
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }else{
|
||||
// state="待提货";
|
||||
// if(states.equals("5")){
|
||||
// if(isReservation.equals("0")){
|
||||
// this.state="已预约";
|
||||
// }else{
|
||||
// this.state="已完成";
|
||||
// showBtn=false;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return state;
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -15,4 +15,5 @@ public class EmpCardQuery implements Query {
|
||||
|
||||
private String number;
|
||||
private String sid;
|
||||
private String customerSid;
|
||||
}
|
||||
|
||||
40
src/main/java/com/yxt/yyth/api/empcardgift/EmpCardGift.java
Normal file
40
src/main/java/com/yxt/yyth/api/empcardgift/EmpCardGift.java
Normal file
@@ -0,0 +1,40 @@
|
||||
package com.yxt.yyth.api.empcardgift;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/12/11 16:54
|
||||
*/
|
||||
@Data
|
||||
public class EmpCardGift {
|
||||
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;
|
||||
private String empCardSid;
|
||||
private String empCardSerialNumber;
|
||||
private String empCardCode;
|
||||
private String empCardCustomerSid;
|
||||
private String serialNumber;
|
||||
private String code;
|
||||
private String codeKey;
|
||||
private String state;
|
||||
private String grantName;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date grantDate;
|
||||
private String customerSid;
|
||||
private String customerMobile;
|
||||
private String recordSid;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date bindDate;
|
||||
private String isItlnvalid;
|
||||
private String isReservation;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.yxt.yyth.api.empcardgift;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.yxt.common.core.dto.Dto;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/12/11 16:58
|
||||
*/
|
||||
@Data
|
||||
public class EmpCardGiftDto implements Dto {
|
||||
private String id;
|
||||
private String sid;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
private String remarks;
|
||||
private String isEnable;
|
||||
private String empCardSid;
|
||||
private String empCardSerialNumber;
|
||||
private String empCardCode;
|
||||
private String empCardCustomerSid;
|
||||
private String serialNumber;
|
||||
private String code;
|
||||
private String codeKey;
|
||||
private String state;
|
||||
private String grantName;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date grantDate;
|
||||
private String customerSid;
|
||||
private String customerMobile;
|
||||
private String recordSid;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date bindDate;
|
||||
private String isItlnvalid;
|
||||
private String iReservation;
|
||||
private List<GoodsVo> goodsVoList;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.yxt.yyth.api.empcardgift;
|
||||
|
||||
import com.yxt.common.core.utils.ExportEntityMap;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Fan
|
||||
* @description
|
||||
* @date 2023/11/27 10:34
|
||||
*/
|
||||
@Data
|
||||
public class EmpCardGiftExport {
|
||||
@ExportEntityMap(CnName = "提货二维码", EnName = "pic")
|
||||
private String pic;
|
||||
@ExportEntityMap(CnName = "提货编码第一行", EnName = "code1")
|
||||
private String code1;
|
||||
@ExportEntityMap(CnName = "提货编码第二行", EnName = "code2")
|
||||
private String code2;
|
||||
@ExportEntityMap(CnName = "提货密码", EnName = "codeKey")
|
||||
private String codeKey;
|
||||
@ExportEntityMap(CnName = "序列号", EnName = "serialNumber")
|
||||
private String serialNumber;
|
||||
private String code;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.yxt.yyth.api.empcardgift;
|
||||
|
||||
import com.yxt.common.core.query.Query;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Fan
|
||||
* @description
|
||||
* @date 2023/11/24 10:07
|
||||
*/
|
||||
@Data
|
||||
public class EmpCardGiftListQuery implements Query {
|
||||
private String state;
|
||||
private String noStart; //序列号开始
|
||||
private String noEnd; //序列号结束
|
||||
private String sid;
|
||||
private String number;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.yxt.yyth.api.empcardgift;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/12/11 17:09
|
||||
*/
|
||||
public class EmpCardGiftListVo {
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.yxt.yyth.api.empcardgift;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.yxt.common.core.query.Query;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/12/11 16:57
|
||||
*/
|
||||
@Data
|
||||
public class EmpCardGiftQuery implements Query {
|
||||
private String id;
|
||||
private String sid;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
private String remarks;
|
||||
private String isEnable;
|
||||
private String empCardSid;
|
||||
private String empCardSerialNumber;
|
||||
private String empCardCode;
|
||||
private String empCardCustomerSid;
|
||||
private String serialNumber;
|
||||
private String code;
|
||||
private String codeKey;
|
||||
private String state;
|
||||
private String grantName;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date grantDate;
|
||||
private String customerSid;
|
||||
private String customerMobile;
|
||||
private String recordSid;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date bindDate;
|
||||
private String isItlnvalid;
|
||||
private String iReservation;
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.yxt.yyth.api.empcardgift;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.yxt.common.core.vo.Vo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/12/11 16:57
|
||||
*/
|
||||
@Data
|
||||
public class EmpCardGiftVo implements Vo {
|
||||
private String id;
|
||||
private String sid;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
private String remarks;
|
||||
private String isEnable;
|
||||
private String empCardSid;
|
||||
private String empCardSerialNumber;
|
||||
private String empCardCode;
|
||||
private String empCardCustomerSid;
|
||||
private String serialNumber;
|
||||
private String code;
|
||||
private String codeKey;
|
||||
private String state;
|
||||
private String grantName;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date grantDate;
|
||||
private String customerSid;
|
||||
private String customerMobile;
|
||||
private String recordSid;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date bindDate;
|
||||
private String isItlnvalid;
|
||||
private String iReservation;
|
||||
private double goodsNumber=0;
|
||||
private String qrCode;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.yxt.yyth.api.empcardgift;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/12/6 15:49
|
||||
*/
|
||||
@Data
|
||||
public class EmpCardGiftWordVo {
|
||||
private String qrCode;//二维码
|
||||
private String bagName;//礼包名
|
||||
private String serialNumber;//序列号
|
||||
private String code;//卡号
|
||||
private String codeKey;//密码
|
||||
|
||||
}
|
||||
158
src/main/java/com/yxt/yyth/api/empcardgift/EmpGiftAppletVo.java
Normal file
158
src/main/java/com/yxt/yyth/api/empcardgift/EmpGiftAppletVo.java
Normal file
@@ -0,0 +1,158 @@
|
||||
package com.yxt.yyth.api.empcardgift;
|
||||
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.yxt.common.base.utils.StringUtils;
|
||||
import com.yxt.yyth.api.empcardgift.GoodsVo;
|
||||
import com.yxt.yyth.api.empreserveorder.EmpReserveOrderCardVo;
|
||||
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderCardVo;
|
||||
import com.yxt.yyth.api.lpkstore.StoreSelect;
|
||||
import lombok.Data;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.ZoneId;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/12/11 17:14
|
||||
*/
|
||||
@Data
|
||||
public class EmpGiftAppletVo {
|
||||
|
||||
private String dateStart;
|
||||
private String dateEnd;
|
||||
private String customerSid;
|
||||
private String giftbagSid;
|
||||
private String code;
|
||||
private String sid;
|
||||
private String state;
|
||||
private String states;
|
||||
private boolean showBtn = true;
|
||||
private boolean showRecord = true;
|
||||
private String time;
|
||||
private String name = "卡号:";
|
||||
private String pName;
|
||||
private String start;
|
||||
private String end;
|
||||
private String store; //门店
|
||||
private String reserveDate; //预约时间
|
||||
private List<GoodsVo> goodsVos;
|
||||
private List<StoreSelect> select;
|
||||
private String storeSid;//上次提货地点
|
||||
private String addressName;
|
||||
private String isReservation;//是否超过预约时间 0 否 1是
|
||||
private boolean notRese = true; //是否能预约
|
||||
private List<EmpReserveOrderCardVo> orderCardVoList;
|
||||
private String value;
|
||||
private String serialNumber;
|
||||
|
||||
|
||||
public String getStart() {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
LocalDate today = LocalDate.now(); // 获取今天的日期
|
||||
LocalTime timeOfDay = LocalTime.of(16, 0); // 设置下午4点的小时数为16,分钟数为0
|
||||
LocalDateTime dateAndTime = LocalDateTime.of(today, timeOfDay); // 将日期和时间合并成完整的日期时间对象
|
||||
|
||||
ZoneId zoneId = ZoneId.systemDefault();
|
||||
Date date = Date.from(dateAndTime.atZone(zoneId).toInstant());
|
||||
System.out.println(date);
|
||||
//1>2 1 、1<2 -1 、1=2 0
|
||||
int k = DateUtil.parse(sdf1.format(DateUtil.parse(sdf1.format(new Date())))).compareTo(DateUtil.parse(sdf1.format(DateUtil.parse(sdf1.format(date)))));
|
||||
if (String.valueOf(k).equals("1")) {
|
||||
start = sdf.format(DateUtil.offsetDay(new Date(), +2));
|
||||
} else {
|
||||
start = sdf.format(DateUtil.offsetDay(new Date(), +1));
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(dateEnd)) {
|
||||
int i = DateUtil.parse(sdf.format(DateUtil.parse(start))).compareTo(DateUtil.parse(sdf.format(DateUtil.parse(dateEnd))));
|
||||
if (String.valueOf(i).equals("-1")) {
|
||||
long o = DateUtil.between(DateUtil.parse(start), DateUtil.parse(dateEnd), DateUnit.DAY);
|
||||
if (o < 10) {
|
||||
end = sdf.format(DateUtil.offsetDay(DateUtil.parse(dateEnd), 10));
|
||||
} else {
|
||||
end = sdf.format(DateUtil.parse(dateEnd));
|
||||
}
|
||||
} else {
|
||||
if (String.valueOf(k).equals("1")) {
|
||||
end = sdf.format(DateUtil.offsetDay(DateUtil.parse(dateEnd), 2));
|
||||
} else {
|
||||
end = sdf.format(DateUtil.offsetDay(DateUtil.parse(dateEnd), 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
reserveDate = start;
|
||||
return start;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
name = name + code;
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getTime() {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd");
|
||||
if (StringUtils.isNotBlank(dateStart)) {
|
||||
if (StringUtils.isNotBlank(dateEnd)) {
|
||||
time = sdf.format(DateUtil.parse(dateStart)) + "~" + sdf.format(DateUtil.parse(dateEnd));
|
||||
}
|
||||
}
|
||||
return time;
|
||||
}
|
||||
|
||||
public boolean isShowBtn() {
|
||||
if (states.equals("5")) {
|
||||
if (isReservation.equals("1")) {
|
||||
this.state = "已完成";
|
||||
showBtn = false;
|
||||
}
|
||||
}
|
||||
return showBtn;
|
||||
}
|
||||
|
||||
public String getState() {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
if (StringUtils.isNotBlank(dateEnd)) {
|
||||
int i = DateUtil.parse(sdf.format(DateUtil.parse(dateEnd))).compareTo(DateUtil.parse(sdf.format(DateUtil.date())));
|
||||
if (String.valueOf(i).equals("-1")) {
|
||||
state = "已过期";
|
||||
showBtn = false;
|
||||
} else {
|
||||
state = "待提货";
|
||||
if (states.equals("5")) {
|
||||
System.out.println("isReservation"+isReservation);
|
||||
if (isReservation.equals("0")) {
|
||||
this.state = "已预约";
|
||||
this.notRese = false;
|
||||
} else {
|
||||
this.state = "已完成";
|
||||
showBtn = false;
|
||||
}
|
||||
} else if (states.equals("4")) {
|
||||
if (isReservation.equals("0")) {
|
||||
this.state = "已预约";
|
||||
} else {
|
||||
this.state = "待提货";
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
state = "待提货";
|
||||
if (states.equals("5")) {
|
||||
if (isReservation.equals("0")) {
|
||||
this.state = "已预约";
|
||||
} else {
|
||||
this.state = "已完成";
|
||||
showBtn = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return state;
|
||||
}
|
||||
}
|
||||
21
src/main/java/com/yxt/yyth/api/empcardgift/GoodsVo.java
Normal file
21
src/main/java/com/yxt/yyth/api/empcardgift/GoodsVo.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package com.yxt.yyth.api.empcardgift;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/22 15:35
|
||||
*/
|
||||
@Data
|
||||
public class GoodsVo {
|
||||
private String goods;
|
||||
private String pic;
|
||||
private double num;
|
||||
private double lNum;
|
||||
private double select = 0;
|
||||
private String goodsSid;
|
||||
private double orderNum; //预约数量
|
||||
private String price; //预约数量
|
||||
private String unitName; //预约数量
|
||||
private String remarks; //预约数量
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.yxt.yyth.api.empcardgiftgoods;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/12/8 9:10
|
||||
*/
|
||||
@Data
|
||||
public class EmpCardGiftGoods {
|
||||
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 empCardGiftSid;
|
||||
private String goodsSid;
|
||||
private String goodsNumber;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.yxt.yyth.api.empcardgiftgoods;
|
||||
|
||||
import com.yxt.common.core.dto.Dto;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/12/8 9:11
|
||||
*/
|
||||
@Data
|
||||
public class EmpCardGiftGoodsDto implements Dto {
|
||||
private String id;
|
||||
private String sid;
|
||||
private String createTime;
|
||||
private String remarks;
|
||||
private String isEnable;
|
||||
private String empCardGiftSid;
|
||||
private String goodsSid;
|
||||
private double goodsNumber;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.yxt.yyth.api.empcardgiftgoods;
|
||||
|
||||
import com.yxt.common.core.query.Query;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/12/8 9:11
|
||||
*/
|
||||
@Data
|
||||
public class EmpCardGiftGoodsQuery implements Query {
|
||||
private String empCardGiftSid;
|
||||
private String goodsSid;
|
||||
private String goodsNumber;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.yxt.yyth.api.empcardgiftgoods;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.yxt.common.core.vo.Vo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/12/8 9:11
|
||||
*/
|
||||
@Data
|
||||
public class EmpCardGiftGoodsVo implements Vo {
|
||||
private String id;
|
||||
private String sid;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
private String remarks;
|
||||
private String empCardGiftSid;
|
||||
private String goodsSid;
|
||||
private Integer goodsNumber;
|
||||
private String name;
|
||||
private String unitName;
|
||||
private String picUrl;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.yxt.yyth.api.empcardgrantlog;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/12/8 9:10
|
||||
*/
|
||||
@Data
|
||||
public class EmpCardGrantLog {
|
||||
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 empCardSid;
|
||||
private String empCardCustomerSid;
|
||||
private String serialNumber;
|
||||
private String code;
|
||||
private String isShare;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.yxt.yyth.api.empcardgrantlog;
|
||||
|
||||
import com.yxt.common.core.dto.Dto;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/12/8 9:11
|
||||
*/
|
||||
@Data
|
||||
public class EmpCardGrantLogDto implements Dto {
|
||||
private String id;
|
||||
private String sid;
|
||||
private String createTime;
|
||||
private String remarks;
|
||||
private String isEnable;
|
||||
private String recordId;
|
||||
private String recordSid;
|
||||
private String giftbagSid;
|
||||
private String serialNumber;
|
||||
private String code;
|
||||
private String codeKey;
|
||||
private String state;
|
||||
private String grantName;
|
||||
private String grantDate;
|
||||
private String customerSid;
|
||||
private String customerMobile;
|
||||
private String Num;
|
||||
private String cardArea;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.yxt.yyth.api.empcardgrantlog;
|
||||
|
||||
import com.yxt.common.core.query.Query;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/12/8 9:11
|
||||
*/
|
||||
@Data
|
||||
public class EmpCardGrantLogQuery implements Query {
|
||||
private String startDate; //开始时间
|
||||
private String endDate; //结束时间
|
||||
private String countNumber; //总数
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.yxt.yyth.api.empcardgrantlog;
|
||||
|
||||
import com.yxt.common.core.vo.Vo;
|
||||
import com.yxt.yyth.api.empcardgift.GoodsVo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/12/8 9:11
|
||||
*/
|
||||
@Data
|
||||
public class EmpCardGrantLogVo implements Vo {
|
||||
private String sid;
|
||||
private String buildDate; //创建时间
|
||||
private String countNumber; //总数
|
||||
private String startNumber; //起始号
|
||||
private String endNumber; //结束号
|
||||
private String bagName;
|
||||
private String grantCountNumber; //发放总数
|
||||
private List<GoodsVo> goodsVos;
|
||||
private String cardSid;
|
||||
private String goods;
|
||||
private double goodsNumber;
|
||||
private String code;
|
||||
private String codeKey;
|
||||
private String remarks;
|
||||
private String isShare;
|
||||
private boolean share=false;
|
||||
|
||||
public boolean isShare() {
|
||||
if(isShare.equals("2")){
|
||||
return share=true;
|
||||
}
|
||||
return share;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.yxt.yyth.api.empreserveorder;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/23 10:29
|
||||
*/
|
||||
@Data
|
||||
public class EmpReserveOrder {
|
||||
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 reserveType;
|
||||
private String cardSid;
|
||||
private String cardCode;
|
||||
private String isCustomer;
|
||||
private String customerSid;
|
||||
private String userName;
|
||||
private String userPhone;
|
||||
private String userAddress;
|
||||
private String storeSid;
|
||||
private String reserveDate;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.yxt.yyth.api.empreserveorder;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.yxt.common.core.vo.Vo;
|
||||
import com.yxt.yyth.api.lpkgiftcard.GoodsVo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Fan
|
||||
* @description
|
||||
* @date 2023/11/27 16:53
|
||||
*/
|
||||
@Data
|
||||
public class EmpReserveOrderCardVo implements Vo {
|
||||
private String code; //卡号
|
||||
private String sid;
|
||||
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
|
||||
private Date reserveDate; //预约时间
|
||||
private String store; //提货门店
|
||||
private String storeSid; //提货门店
|
||||
private String bagName; //礼包
|
||||
private String cardSid; // 提货卡sid
|
||||
private String orderSid; //预约订单sid
|
||||
private String userName;
|
||||
private String userPhone;
|
||||
private String state;//提货状态
|
||||
private List<GoodsVo> goodsVos;
|
||||
private String goods;
|
||||
private String serialNumber;
|
||||
|
||||
public String getState() {
|
||||
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd");
|
||||
int c= DateUtil.parse(sdf.format(reserveDate)).compareTo(DateUtil.parse(sdf.format(new Date())));
|
||||
if(String.valueOf(c).equals("-1")){
|
||||
this.state="已提货";
|
||||
}else{
|
||||
this.state="未提货";
|
||||
}
|
||||
return state;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.yxt.yyth.api.empreserveorder;
|
||||
|
||||
import com.yxt.common.core.dto.Dto;
|
||||
import com.yxt.yyth.api.empcardgift.GoodsVo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/23 10:29
|
||||
*/
|
||||
@Data
|
||||
public class EmpReserveOrderDto implements Dto {
|
||||
private String cardSid;//礼包卡sid
|
||||
private String sid;
|
||||
private String value;
|
||||
private String storeSid;//发放点
|
||||
private String customerSid;//客户sid
|
||||
private String reserveDate;//发放时间
|
||||
private String userName;//用户名
|
||||
private String userPhone;//用户联系方式
|
||||
private List<GoodsVo> goodsVos;
|
||||
private String orderSid;
|
||||
private String addressName;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.yxt.yyth.api.empreserveorder;
|
||||
|
||||
import com.yxt.common.core.query.Query;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/23 10:30
|
||||
*/
|
||||
@Data
|
||||
public class EmpReserveOrderQuery implements Query {
|
||||
private String userName; //用户名
|
||||
private String store; // 门店
|
||||
private String startDate; //预约开始日期
|
||||
private String endDate; // 预约结束日期
|
||||
private String userSid;
|
||||
private String storeSid;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.yxt.yyth.api.empreserveorder;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.yxt.common.core.vo.Vo;
|
||||
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 EmpReserveOrderVo implements Vo {
|
||||
private String sid; //预约订单sid
|
||||
private String userName; //用户名
|
||||
private String userPhone; //用户电话
|
||||
private String store; //门店
|
||||
private String storeSid; //门店
|
||||
@JsonFormat(pattern = "yyyy-MM-dd ",timezone="GMT+8")
|
||||
private Date reserveDate; //预约时间
|
||||
private String bagName; //礼包
|
||||
private String code; //卡号
|
||||
private String goodsInfo;
|
||||
private List<OrderGoodsVo> goodsVo = new ArrayList<>();
|
||||
}
|
||||
14
src/main/java/com/yxt/yyth/api/empreserveorder/Goods.java
Normal file
14
src/main/java/com/yxt/yyth/api/empreserveorder/Goods.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package com.yxt.yyth.api.empreserveorder;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/23 14:34
|
||||
*/
|
||||
@Data
|
||||
public class Goods {
|
||||
private double goodsNumber;//数量
|
||||
private String goodsSid;//商品sid
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.yxt.yyth.api.empreserveorder;
|
||||
|
||||
import com.yxt.common.core.vo.Vo;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Fan
|
||||
* @description
|
||||
* @date 2023/11/28 10:11
|
||||
*/
|
||||
@Data
|
||||
public class OrderGoodsVo implements Vo {
|
||||
private int num;
|
||||
private String goodName;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.yxt.yyth.api.empreserveorder;
|
||||
|
||||
import com.yxt.common.core.utils.ExportEntityMap;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Fan
|
||||
* @description
|
||||
* @date 2023/11/28 10:26
|
||||
*/
|
||||
@Data
|
||||
public class ReserveOrderExport {
|
||||
@ExportEntityMap(CnName = "预约时间", EnName = "reserveDate")
|
||||
private String reserveDate;
|
||||
@ExportEntityMap(CnName = "提货门店", EnName = "store")
|
||||
private String store;
|
||||
@ExportEntityMap(CnName = "姓名", EnName = "userName")
|
||||
private String userName;
|
||||
@ExportEntityMap(CnName = "联系方式", EnName = "userPhone")
|
||||
private String userPhone;
|
||||
@ExportEntityMap(CnName = "提货卡号", EnName = "code")
|
||||
private String code;
|
||||
@ExportEntityMap(CnName = "礼包名称", EnName = "bagName")
|
||||
private String bagName;
|
||||
@ExportEntityMap(CnName = "商品明细", EnName = "goodsInfo")
|
||||
private String goodsInfo;
|
||||
private String sid;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.yxt.yyth.api.empreserveorder;
|
||||
|
||||
import com.yxt.common.core.utils.ExportEntityMap;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/12/11 13:58
|
||||
*/
|
||||
@Data
|
||||
public class ReserveOrderExportByStore {
|
||||
@ExportEntityMap(CnName = "预约时间", EnName = "reserveDate")
|
||||
private String reserveDate;
|
||||
@ExportEntityMap(CnName = "提货门店", EnName = "store")
|
||||
private String store;
|
||||
private String storeSid;
|
||||
@ExportEntityMap(CnName = "商品明细", EnName = "goodsInfo")
|
||||
private String goodsInfo;
|
||||
private String sid;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.yxt.yyth.api.empreserveordergoods;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/23 10:29
|
||||
*/
|
||||
@Data
|
||||
public class EmpReserveOrderGoods {
|
||||
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 cardSid;
|
||||
private String goodsSid;
|
||||
private double goodsNumber;
|
||||
private String num;
|
||||
private String orderSid;
|
||||
private String goodsName;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.yxt.yyth.api.empreserveordergoods;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/23 10:29
|
||||
*/
|
||||
@Data
|
||||
public class EmpReserveOrderGoodsDto {
|
||||
private String cardSid;
|
||||
private String goodsSid;
|
||||
private String goodsNumber;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.yxt.yyth.api.empreserveordergoods;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/23 10:30
|
||||
*/
|
||||
public class EmpReserveOrderGoodsQuery {
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.yxt.yyth.api.lpkreserveorder;
|
||||
|
||||
import com.yxt.common.core.utils.ExportEntityMap;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@@ -10,5 +11,7 @@ import lombok.Data;
|
||||
public class Goods {
|
||||
private double goodsNumber;//数量
|
||||
private String goodsSid;//商品sid
|
||||
@ExportEntityMap(CnName = "商品明细", EnName = "goodsInfo")
|
||||
private String goodsInfo;
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.yxt.yyth.api.lpkreserveorder;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.yxt.common.base.utils.StringUtils;
|
||||
import com.yxt.common.core.vo.Vo;
|
||||
import com.yxt.yyth.api.lpkgiftcard.GoodsVo;
|
||||
import lombok.Data;
|
||||
@@ -34,6 +35,13 @@ public class LpkReserveOrderCardVo implements Vo {
|
||||
private String goods;
|
||||
private String serialNumber;
|
||||
|
||||
public String getBagName() {
|
||||
if(StringUtils.isBlank(bagName)){
|
||||
bagName="福礼卡";
|
||||
}
|
||||
return bagName;
|
||||
}
|
||||
|
||||
public String getState() {
|
||||
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd");
|
||||
int c= DateUtil.parse(sdf.format(reserveDate)).compareTo(DateUtil.parse(sdf.format(new Date())));
|
||||
|
||||
@@ -15,4 +15,5 @@ public class LpkReserveOrderQuery implements Query {
|
||||
private String endDate; // 预约结束日期
|
||||
private String userSid;
|
||||
private String storeSid;
|
||||
private String bankSid;
|
||||
}
|
||||
|
||||
@@ -26,4 +26,5 @@ public class LpkReserveOrderVo implements Vo {
|
||||
private String code; //卡号
|
||||
private String goodsInfo;
|
||||
private List<OrderGoodsVo> goodsVo = new ArrayList<>();
|
||||
private List<String> goods=new ArrayList<>();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.yxt.yyth.api.lpkreserveorder;
|
||||
|
||||
import com.alibaba.excel.metadata.Head;
|
||||
import com.alibaba.excel.write.merge.AbstractMergeStrategy;
|
||||
import org.apache.commons.collections.map.HashedMap;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/12/15 13:43
|
||||
*/
|
||||
public class MergeStrategy extends AbstractMergeStrategy {
|
||||
|
||||
// 合并的列编号,从0开始,指定的index或自己按字段顺序数
|
||||
private Set<Integer> mergeCellIndex = new HashSet<>();
|
||||
|
||||
// 数据集大小,用于区别结束行位置
|
||||
private Integer maxRow = 0;
|
||||
|
||||
// 禁止无参声明
|
||||
private MergeStrategy() {
|
||||
}
|
||||
|
||||
public MergeStrategy(Integer maxRow, int... mergeCellIndex) {
|
||||
Arrays.stream(mergeCellIndex).forEach(item -> {
|
||||
this.mergeCellIndex.add(item);
|
||||
});
|
||||
this.maxRow = maxRow;
|
||||
}
|
||||
|
||||
// 记录上一次合并的信息
|
||||
private Map<Integer, MergeRange> lastRow = new HashedMap();
|
||||
|
||||
// 每行每列都会进入,绝对不要在这写循环
|
||||
@Override
|
||||
protected void merge(Sheet sheet, Cell cell, Head head, Integer relativeRowIndex) {
|
||||
int currentCellIndex = cell.getColumnIndex();
|
||||
// 判断该行是否需要合并
|
||||
if (mergeCellIndex.contains(currentCellIndex)) {
|
||||
String currentCellValue = cell.getStringCellValue();
|
||||
int currentRowIndex = cell.getRowIndex();
|
||||
if (!lastRow.containsKey(currentCellIndex)) {
|
||||
// 记录首行起始位置
|
||||
lastRow.put(currentCellIndex, new MergeRange(currentCellValue, currentRowIndex, currentRowIndex, currentCellIndex, currentCellIndex));
|
||||
return;
|
||||
}
|
||||
//有上行这列的值了,拿来对比.
|
||||
MergeRange mergeRange = lastRow.get(currentCellIndex);
|
||||
if (!(mergeRange.lastValue != null && mergeRange.lastValue.equals(currentCellValue))) {
|
||||
// 结束的位置触发下合并.
|
||||
// 同行同列不能合并,会抛异常
|
||||
if (mergeRange.startRow != mergeRange.endRow || mergeRange.startCell != mergeRange.endCell) {
|
||||
sheet.addMergedRegionUnsafe(new CellRangeAddress(mergeRange.startRow, mergeRange.endRow, mergeRange.startCell, mergeRange.endCell));
|
||||
}
|
||||
// 更新当前列起始位置
|
||||
lastRow.put(currentCellIndex, new MergeRange(currentCellValue, currentRowIndex, currentRowIndex, currentCellIndex, currentCellIndex));
|
||||
}
|
||||
// 合并行 + 1
|
||||
mergeRange.endRow += 1;
|
||||
// 结束的位置触发下最后一次没完成的合并
|
||||
if (relativeRowIndex.equals(maxRow - 1)) {
|
||||
MergeRange lastMergeRange = lastRow.get(currentCellIndex);
|
||||
// 同行同列不能合并,会抛异常
|
||||
if (lastMergeRange.startRow != lastMergeRange.endRow || lastMergeRange.startCell != lastMergeRange.endCell) {
|
||||
sheet.addMergedRegionUnsafe(new CellRangeAddress(lastMergeRange.startRow, lastMergeRange.endRow, lastMergeRange.startCell, lastMergeRange.endCell));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
class MergeRange {
|
||||
public int startRow;
|
||||
public int endRow;
|
||||
public int startCell;
|
||||
public int endCell;
|
||||
public String lastValue;
|
||||
|
||||
public MergeRange(String lastValue, int startRow, int endRow, int startCell, int endCell) {
|
||||
this.startRow = startRow;
|
||||
this.endRow = endRow;
|
||||
this.startCell = startCell;
|
||||
this.endCell = endCell;
|
||||
this.lastValue = lastValue;
|
||||
}
|
||||
}
|
||||
@@ -1,28 +1,51 @@
|
||||
package com.yxt.yyth.api.lpkreserveorder;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.yxt.common.core.utils.ExportEntityMap;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author Fan
|
||||
* @description
|
||||
* @date 2023/11/28 10:26
|
||||
*/
|
||||
@Data
|
||||
@Getter
|
||||
@Setter
|
||||
@EqualsAndHashCode
|
||||
public class ReserveOrderExport {
|
||||
@ExportEntityMap(CnName = "预约时间", EnName = "reserveDate")
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "预约时间",index = 0)
|
||||
private String reserveDate;
|
||||
@ExportEntityMap(CnName = "提货门店", EnName = "store")
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "提货门店",index = 1)
|
||||
private String store;
|
||||
@ExportEntityMap(CnName = "姓名", EnName = "userName")
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "姓名",index = 2)
|
||||
private String userName;
|
||||
@ExportEntityMap(CnName = "联系方式", EnName = "userPhone")
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "联系方式",index = 3)
|
||||
private String userPhone;
|
||||
@ExportEntityMap(CnName = "提货卡号", EnName = "code")
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "提货卡号",index = 4)
|
||||
private String code;
|
||||
@ExportEntityMap(CnName = "礼包名称", EnName = "bagName")
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "礼包名称",index = 5)
|
||||
private String bagName;
|
||||
@ExportEntityMap(CnName = "商品明细", EnName = "goodsInfo")
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "商品明细",index = 6)
|
||||
private String goodsInfo;
|
||||
|
||||
@ExcelIgnore
|
||||
private String sid;
|
||||
}
|
||||
|
||||
@@ -1,20 +1,33 @@
|
||||
package com.yxt.yyth.api.lpkreserveorder;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.yxt.common.core.utils.ExportEntityMap;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/12/11 13:58
|
||||
*/
|
||||
@Data
|
||||
@Getter
|
||||
@Setter
|
||||
@EqualsAndHashCode
|
||||
public class ReserveOrderExportByStore {
|
||||
@ExportEntityMap(CnName = "预约时间", EnName = "reserveDate")
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "预约时间",index = 0)
|
||||
private String reserveDate;
|
||||
@ExportEntityMap(CnName = "提货门店", EnName = "store")
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "提货门店",index = 1)
|
||||
private String store;
|
||||
private String storeSid;
|
||||
@ExportEntityMap(CnName = "商品明细", EnName = "goodsInfo")
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "商品明细",index = 2)
|
||||
private String goodsInfo;
|
||||
private String sid;
|
||||
@ExcelIgnore
|
||||
private String storeSid;
|
||||
}
|
||||
|
||||
@@ -31,4 +31,5 @@ public class LpkStore {
|
||||
private String linker;
|
||||
private String picUrl;
|
||||
private String lonAndLat;
|
||||
private String bankSid;
|
||||
}
|
||||
|
||||
@@ -26,4 +26,5 @@ public class LpkStoreDto implements Dto {
|
||||
private String linker;
|
||||
private String picUrl;
|
||||
private String lonAndLat;
|
||||
private String bankSid;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ import java.util.UUID;
|
||||
@NoArgsConstructor
|
||||
public class LpkStoreVo implements Vo {
|
||||
private String sid;
|
||||
private String createTime;
|
||||
private Date createTime;
|
||||
private String remarks;//备注信息
|
||||
private String code;//编号
|
||||
private String name;//名称
|
||||
@@ -29,4 +29,6 @@ public class LpkStoreVo implements Vo {
|
||||
private String sort;//排序
|
||||
private String isEnable;//排序
|
||||
private String lonAndLat;
|
||||
private String bankName;
|
||||
private String bankSid;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import com.yxt.yyth.api.empcard.EmpCardExport;
|
||||
import com.yxt.yyth.api.empcard.EmpCardVo;
|
||||
import com.yxt.yyth.api.lpkgiftcard.AppletVo;
|
||||
import com.yxt.yyth.api.lpkgiftcard.LpkGiftCard;
|
||||
import com.yxt.yyth.api.lpkgiftcard.LpkGiftCardListVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
@@ -26,14 +25,12 @@ public interface EmpCardMapper extends BaseMapper<EmpCard> {
|
||||
String selctMaxSerNum(@Param("cardArea") String cardArea);
|
||||
IPage<EmpCardVo> cardList(IPage<EmpCard> page, @Param(Constants.WRAPPER) QueryWrapper<EmpCard> qw);
|
||||
IPage<EmpCardVo> recordDetails(IPage<EmpCard> page, @Param(Constants.WRAPPER) QueryWrapper<EmpCard> qw);
|
||||
@Select("SELECT card.*, case card.state WHEN 3 then '未提货' WHEN 4 then '已经预约提货(预约部分提货)' WHEN 5 then '已经提取完成' end stateValue,\n" +
|
||||
"bag.dateStart as dateStart,bag.dateEnd as dateEnd,bag.name as pname,card.state as states,card.serialNumber as serialNumber\n" +
|
||||
"FROM emp_card card LEFT JOIN lpk_giftbag bag on card.giftbagSid=bag.sid where card.sid=#{sid}")
|
||||
|
||||
EmpAppletVo getEmpCardBySid(@Param("sid") String sid);
|
||||
|
||||
List<EmpCardExport> exportExcel(@Param(Constants.WRAPPER) QueryWrapper<LpkGiftCard> qw);
|
||||
@Select("select count(id) from emp_card where recordSid=#{recordSid} and grantRecordSid is not null")
|
||||
Integer cardGrantCount(@Param("recordSid") String recordSid);
|
||||
|
||||
IPage<AppletVo> getGifCardByCustomerSid(IPage<LpkGiftCard> page, @Param(Constants.WRAPPER) QueryWrapper<LpkGiftCard> qw);
|
||||
IPage<EmpAppletVo> getEmpCardByCustomerSid(IPage<EmpCard> page, @Param(Constants.WRAPPER) QueryWrapper<EmpCard> qw);
|
||||
}
|
||||
|
||||
@@ -80,8 +80,28 @@
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getGifCardByCustomerSid" resultType="com.yxt.yyth.api.lpkgiftcard.AppletVo">
|
||||
<select id="getEmpCardBySid" resultType="com.yxt.yyth.api.empcard.EmpAppletVo">
|
||||
SELECT
|
||||
card.*,
|
||||
CASE
|
||||
card.state
|
||||
WHEN 2 THEN
|
||||
'已绑定'
|
||||
WHEN 3 THEN
|
||||
'已完成'
|
||||
END stateValue,
|
||||
bag.dateStart AS dateStart,
|
||||
bag.dateEnd AS dateEnd,
|
||||
bag.NAME AS pname,
|
||||
card.state AS states,
|
||||
card.serialNumber AS serialNumber
|
||||
FROM
|
||||
emp_card card
|
||||
LEFT JOIN lpk_giftbag bag ON card.giftbagSid = bag.sid
|
||||
where
|
||||
card.sid = #{sid}
|
||||
</select>
|
||||
<select id="getEmpCardByCustomerSid" resultType="com.yxt.yyth.api.empcard.EmpAppletVo">
|
||||
SELECT
|
||||
card.*,
|
||||
case card.state
|
||||
@@ -99,6 +119,5 @@
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
ORDER BY card.state desc,card.bindDate desc
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -13,10 +13,7 @@ import com.yxt.yyth.api.lpkgiftcard.LpkGiftCardQuery;
|
||||
import io.swagger.annotations.Api;
|
||||
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;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
@@ -59,9 +56,14 @@ public class EmpCardRest {
|
||||
empCardService.exportExcel(query);
|
||||
}
|
||||
|
||||
@PostMapping("/gifCardByCustomerSid")
|
||||
@PostMapping("/getEmpCardByCustomerSid")
|
||||
@ApiOperation(value = "获取客户绑定的礼包卡")
|
||||
public ResultBean gifCardByCustomerSid(@RequestBody PagerQuery<LpkGiftCardQuery> query) {
|
||||
return empCardService.getGifCardByCustomerSid(query);
|
||||
public ResultBean getEmpCardByCustomerSid(@RequestBody PagerQuery<EmpCardQuery> query) {
|
||||
return empCardService.getEmpCardByCustomerSid(query);
|
||||
}
|
||||
@GetMapping("/getEmpCardBySid/{sid}")
|
||||
@ApiOperation(value = "获取企业卡的详情信息")
|
||||
public ResultBean getEmpCardBySid(@PathVariable("sid") String sid) {
|
||||
return empCardService.getEmpCardBySid(sid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,15 +12,25 @@ import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.yyth.api.empcard.*;
|
||||
import com.yxt.yyth.api.empcardbuildrecord.EmpCardBuildRecord;
|
||||
import com.yxt.yyth.api.empcardgift.EmpCardGiftVo;
|
||||
import com.yxt.yyth.api.empcardgiftgoods.EmpCardGiftGoodsVo;
|
||||
import com.yxt.yyth.api.empcardgrantlog.EmpCardGrantLogVo;
|
||||
import com.yxt.yyth.api.lpkgiftbaggoods.LpkGiftBagGoodsVo;
|
||||
import com.yxt.yyth.api.lpkgiftcard.*;
|
||||
import com.yxt.yyth.biz.empcardbuildrecord.EmpCardBuildRecordService;
|
||||
import com.yxt.yyth.biz.empcardgift.EmpCardGiftService;
|
||||
import com.yxt.yyth.biz.empcardgiftgoods.EmpCardGiftGoodsService;
|
||||
import com.yxt.yyth.biz.empcardgrantlog.EmpCardGrantLogService;
|
||||
import com.yxt.yyth.biz.lpkgiftbaggoods.LpkGiftBagGoodsService;
|
||||
import com.yxt.yyth.biz.lpkgiftcard.generateRule.UniqueIdGenerator;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
@@ -32,10 +42,20 @@ import java.util.Random;
|
||||
@Service
|
||||
public class EmpCardService extends MybatisBaseService<EmpCardMapper, EmpCard> {
|
||||
|
||||
@Autowired
|
||||
LpkGiftBagGoodsService lpkGiftBagGoodsService;
|
||||
@Autowired
|
||||
EmpCardBuildRecordService empCardBuildRecordService;
|
||||
@Autowired
|
||||
EmpCardGiftService empCardGiftService;
|
||||
@Autowired
|
||||
EmpCardGrantLogService empCardGrantLogService;
|
||||
@Autowired
|
||||
EmpCardGiftGoodsService empCardGiftGoodsService;
|
||||
@Autowired
|
||||
private HttpServletResponse response;
|
||||
@Value("${image.url.prefix:http://127.0.0.1:8080/upload/}")
|
||||
private String urlPrefix;
|
||||
|
||||
|
||||
|
||||
@@ -207,21 +227,87 @@ public class EmpCardService extends MybatisBaseService<EmpCardMapper, EmpCard> {
|
||||
Integer i = baseMapper.cardGrantCount(recordSid);
|
||||
return rb.success().setData(i);
|
||||
}
|
||||
public ResultBean getGifCardByCustomerSid(PagerQuery<LpkGiftCardQuery> pq) {
|
||||
public ResultBean getEmpCardByCustomerSid(PagerQuery<EmpCardQuery> pq) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
LpkGiftCardQuery query = pq.getParams();
|
||||
EmpCardQuery query = pq.getParams();
|
||||
if (StringUtils.isBlank(query.getCustomerSid())) {
|
||||
return rb.setMsg("参数不能为空");
|
||||
}
|
||||
QueryWrapper<LpkGiftCard> qw = new QueryWrapper<>();
|
||||
QueryWrapper<EmpCard> qw = new QueryWrapper<>();
|
||||
// updateIsItInvalid(query.getCustomerSid());
|
||||
if (StringUtils.isNotBlank(query.getCustomerSid())) {
|
||||
qw.eq("customerSid", query.getCustomerSid());
|
||||
}
|
||||
IPage<LpkGiftCard> page = PagerUtil.queryToPage(pq);
|
||||
IPage<AppletVo> list = baseMapper.getGifCardByCustomerSid(page, qw);
|
||||
PagerVo<AppletVo> p = PagerUtil.pageToVo(list, null);
|
||||
qw.orderByAsc("state").orderByDesc("bindDate");
|
||||
IPage<EmpCard> page = PagerUtil.queryToPage(pq);
|
||||
IPage<EmpAppletVo> list = baseMapper.getEmpCardByCustomerSid(page, qw);
|
||||
PagerVo<EmpAppletVo> p = PagerUtil.pageToVo(list, null);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
public ResultBean<EmpAppletVo> getEmpCardBySid(String sid) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
EmpAppletVo vo = baseMapper.getEmpCardBySid(sid);
|
||||
List<LpkGiftBagGoodsVo> list = lpkGiftBagGoodsService.getGoodsByBagSid(vo.getGiftbagSid());
|
||||
List<GoodsVo> goodsVos = new ArrayList<>();
|
||||
|
||||
list.forEach(s -> {
|
||||
EmpCardGiftVo goods = empCardGiftService.getEmpCardGoods(vo.getSid(), s.getGoodsSid()).getData();
|
||||
GoodsVo goodsVo = new GoodsVo();
|
||||
goodsVo.setGoods(s.getGoodsName());
|
||||
goodsVo.setNum(s.getGoodsNumber());
|
||||
goodsVo.setGoodsSid(s.getGoodsSid());
|
||||
goodsVo.setRemarks(s.getRemarks());
|
||||
goodsVo.setUnitName(s.getUnitName());
|
||||
goodsVo.setPic(urlPrefix + s.getPicUrl());
|
||||
if (vo.getState().equals("已过期")) {
|
||||
goodsVo.setLNum(0);
|
||||
goodsVos.add(goodsVo);
|
||||
} else if (!vo.isShowBtn()) {
|
||||
goodsVo.setLNum(0);
|
||||
goodsVos.add(goodsVo);
|
||||
} else {
|
||||
if (null != goods) {
|
||||
if (goods.getGoodsNumber() != s.getGoodsNumber()) {
|
||||
goodsVo.setLNum(s.getGoodsNumber() - goods.getGoodsNumber());
|
||||
goodsVo.setSelect(s.getGoodsNumber() - goods.getGoodsNumber());
|
||||
}
|
||||
} else {
|
||||
goodsVo.setLNum(s.getGoodsNumber());
|
||||
goodsVo.setSelect(s.getGoodsNumber());
|
||||
}
|
||||
goodsVo.setLNum(s.getGoodsNumber());
|
||||
goodsVo.setSelect(s.getGoodsNumber());
|
||||
goodsVos.add(goodsVo);
|
||||
}
|
||||
});
|
||||
List<EmpCardGrantLogVo> empCardGrantLogVos= empCardGrantLogService.recordList(vo.getSid()).getData();
|
||||
empCardGrantLogVos.forEach(s->{
|
||||
List<EmpCardGiftGoodsVo> l=empCardGiftGoodsService.getGoodsByEmpCardGiftSid(s.getCardSid()).getData();
|
||||
l.forEach(c->{
|
||||
if (StringUtils.isBlank(s.getGoods())) {
|
||||
s.setGoods(c.getName() + ":" + c.getGoodsNumber() + c.getUnitName());
|
||||
} else {
|
||||
s.setGoods(s.getGoods() + " " + c.getName() + ":" + c.getGoodsNumber() + c.getUnitName());
|
||||
}
|
||||
});
|
||||
});
|
||||
vo.setEmpCardGrantLogVos(empCardGrantLogVos);
|
||||
vo.setGoodsVos(goodsVos);
|
||||
String uuid = UniqueIdGenerator.generateUniqueID();
|
||||
int randomNumber = new Random().nextInt(900000) + 100000;
|
||||
|
||||
vo.setGiftCodeKey(String.valueOf(randomNumber));
|
||||
vo.setGiftCode("99"+uuid.substring(2));
|
||||
vo.setQrCode("https://supervise.yxtsoft.com/lpkapi?qy="+vo.getGiftCode());
|
||||
return rb.success().setData(vo);
|
||||
}
|
||||
public ResultBean changState(String cardSid, String state) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
EmpCard card = baseMapper.selectOne(new QueryWrapper<EmpCard>().eq("sid", cardSid));
|
||||
card.setState(state);
|
||||
// card.setIsReservation("0");
|
||||
baseMapper.updateById(card);
|
||||
return rb.success().setData("成功");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* @author wangpengfei
|
||||
* @date 2023/12/8 9:19
|
||||
*/
|
||||
@Api(tags = "礼品卡信息")
|
||||
@Api(tags = "企业卡生成记录")
|
||||
@RestController
|
||||
@RequestMapping("empcardbuildrecord")
|
||||
public class EmpCardBuildRecordRest {
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.yxt.yyth.biz.empcardgift;
|
||||
|
||||
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.yyth.api.empcardgift.*;
|
||||
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 EmpCardGiftMapper extends BaseMapper<EmpCardGift> {
|
||||
|
||||
IPage<EmpGiftAppletVo> getGifCardByCustomerSid(IPage<EmpCardGift> page, @Param(Constants.WRAPPER) QueryWrapper<EmpCardGift> qw);
|
||||
|
||||
EmpGiftAppletVo getGifCardBySid(@Param("sid") String sid);
|
||||
|
||||
|
||||
String selctMaxSerNum(@Param("cardArea") String cardArea);
|
||||
|
||||
IPage<EmpCardGiftListVo> cardList(IPage<EmpCardGift> page, @Param(Constants.WRAPPER) QueryWrapper<EmpCardGift> qw);
|
||||
|
||||
List<EmpCardGiftListVo> selAllByRecordSid(@Param("sid") String sid);
|
||||
|
||||
IPage<EmpCardGiftListVo> recordDetails(IPage<EmpCardGift> page, @Param(Constants.WRAPPER) QueryWrapper<EmpCardGift> qw);
|
||||
|
||||
List<EmpCardGiftExport> exportExcel(@Param(Constants.WRAPPER) QueryWrapper<EmpCardGift> qw);
|
||||
|
||||
Integer updateState(@Param("serialNumbers") List<Integer> serialNumbers, @Param("state") String state, @Param("bankSid") String bankSid, @Param("recordSid") String recordSid);
|
||||
|
||||
@Select("select count(id) from lpk_giftcard where recordSid=#{recordSid} and grantRecordSid is not null")
|
||||
Integer cardGrantCount(@Param("recordSid") String recordSid);
|
||||
|
||||
@Select("update lpk_giftcard set isItInvalid='1' where giftbagSid=#{giftbagSid} and state!=#{state} ")
|
||||
Integer updateIsItInvalid(@Param("giftbagSid") String giftbagSid, @Param("state") String state);
|
||||
|
||||
// List<EmpCardGiftWordVo> selGiftCard(@Param("serialNumbers") List<Integer> serialNumbers);
|
||||
IPage<EmpCardGiftWordVo> selGiftCard(IPage<EmpCardGift> page, @Param(Constants.WRAPPER) QueryWrapper<EmpCardGift> qw);
|
||||
EmpCardGiftVo getEmpCardGoods(@Param("empCardSid")String empCardSid,@Param("goodsSid")String goodsSid);
|
||||
|
||||
}
|
||||
177
src/main/java/com/yxt/yyth/biz/empcardgift/EmpCardGiftMapper.xml
Normal file
177
src/main/java/com/yxt/yyth/biz/empcardgift/EmpCardGiftMapper.xml
Normal file
@@ -0,0 +1,177 @@
|
||||
<?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.yyth.biz.empcardgift.EmpCardGiftMapper">
|
||||
<!-- <where> ${ew.sqlSegment} </where>-->
|
||||
<!-- ${ew.customSqlSegment} -->
|
||||
|
||||
|
||||
<select id="getGifCardByCustomerSid" resultType="com.yxt.yyth.api.empcardgift.EmpGiftAppletVo">
|
||||
SELECT
|
||||
gi.*,
|
||||
gi.state AS states,
|
||||
gi.serialNumber AS serialNumber,
|
||||
go.goodsNumber,
|
||||
gif.dateStart,
|
||||
gif.dateEnd,
|
||||
CASE
|
||||
gi.state
|
||||
WHEN 3 THEN
|
||||
'未提货'
|
||||
WHEN 4 THEN
|
||||
'已经预约提货(预约部分提货)'
|
||||
WHEN 5 THEN
|
||||
'已经提取完成'
|
||||
END stateValue
|
||||
FROM
|
||||
emp_card_gift gi
|
||||
LEFT JOIN emp_card_gift_goods go ON go.empCardGiftSid = gi.sid
|
||||
LEFT JOIN emp_card emp ON emp.sid = gi.empCardSid
|
||||
LEFT JOIN lpk_giftbag gif ON gif.sid = emp.giftbagSid
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
ORDER BY gi.isItlnvalid asc,gi.bindDate desc
|
||||
</select>
|
||||
<select id="getGifCardBySid" resultType="com.yxt.yyth.api.empcardgift.EmpGiftAppletVo">
|
||||
SELECT
|
||||
gi.*,
|
||||
gi.state AS states,
|
||||
gi.serialNumber AS serialNumber,
|
||||
go.goodsNumber,
|
||||
gif.dateStart,
|
||||
gif.dateEnd,
|
||||
CASE
|
||||
gi.state
|
||||
WHEN 3 THEN
|
||||
'未提货'
|
||||
WHEN 4 THEN
|
||||
'已经预约提货(预约部分提货)'
|
||||
WHEN 5 THEN
|
||||
'已经提取完成'
|
||||
END stateValue
|
||||
FROM
|
||||
emp_card_gift gi
|
||||
LEFT JOIN emp_card_gift_goods go ON go.empCardGiftSid = gi.sid
|
||||
LEFT JOIN emp_card emp ON emp.sid = gi.empCardSid
|
||||
LEFT JOIN lpk_giftbag gif ON gif.sid = emp.giftbagSid
|
||||
WHERE
|
||||
gi.sid = #{sid}
|
||||
</select>
|
||||
<select id="selctMaxSerNum" resultType="java.lang.String">
|
||||
SELECT MAX(serialNumber) as sNo
|
||||
FROM emp_card_gift
|
||||
WHERE LENGTH(serialNumber) = 8
|
||||
AND LEFT (serialNumber
|
||||
, 1) = #{cardArea}
|
||||
</select>
|
||||
<select id="cardList" resultType="com.yxt.yyth.api.lpkgiftcard.LpkGiftCardListVo">
|
||||
SELECT
|
||||
sid,
|
||||
date_format(createTime, '%Y-%m-%d') as createTime,
|
||||
remarks,
|
||||
giftbagSid,
|
||||
serialNumber,
|
||||
code,
|
||||
codeKey,
|
||||
CASE `state`
|
||||
WHEN 1 THEN '未发放'
|
||||
WHEN 2 THEN '未绑定客户'
|
||||
WHEN 3 THEN '未提货'
|
||||
WHEN 4 THEN '已经预约提货(预约部分提货)'
|
||||
WHEN 5 THEN '已经提取完成' END AS `state`,
|
||||
grantName,
|
||||
date_format(grantDate, '%Y-%m-%d') as grantDate,
|
||||
customerMobile,
|
||||
customerSid
|
||||
FROM
|
||||
lpk_giftcard
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
</select>
|
||||
<select id="selAllByRecordSid" resultType="com.yxt.yyth.api.lpkgiftcard.LpkGiftCardListVo">
|
||||
SELECT sid,
|
||||
date_format(createTime, '%Y-%m-%d') as createTime,
|
||||
remarks,
|
||||
giftbagSid,
|
||||
serialNumber,
|
||||
code,
|
||||
codeKey,
|
||||
`state`,
|
||||
grantName,
|
||||
date_format(grantDate, '%Y-%m-%d') as grantDate,
|
||||
customerMobile,
|
||||
customerSid
|
||||
FROM lpk_giftcard
|
||||
where recordSid = #{sid}
|
||||
</select>
|
||||
<select id="recordDetails" resultType="com.yxt.yyth.api.lpkgiftcard.LpkGiftCardListVo">
|
||||
SELECT
|
||||
card.sid,
|
||||
card.recordId,
|
||||
date_format(card.createTime, '%Y-%m-%d') as createTime,
|
||||
card.remarks,
|
||||
card.giftbagSid,
|
||||
card.serialNumber,
|
||||
card.code,
|
||||
card.codeKey,
|
||||
CASE card.state
|
||||
WHEN 1 THEN '未发放'
|
||||
WHEN 2 THEN '未绑定客户'
|
||||
WHEN 3 THEN '未提货'
|
||||
WHEN 4 THEN '已经预约提货(预约部分提货)'
|
||||
WHEN 5 THEN '已经提取完成' END AS `state`,
|
||||
grantName,
|
||||
date_format(card.grantDate, '%Y-%m-%d') as grantDate,
|
||||
card.customerMobile,
|
||||
card.customerSid,
|
||||
bank.name as name,
|
||||
date_format(rr.buildDate, '%Y-%m-%d') as buildDate
|
||||
FROM
|
||||
lpk_giftcard card
|
||||
left join lpk_bank bank on bank.sid=card.bankSid
|
||||
left join lpk_card_grant_record rr on rr.sid =card.grantRecordSid
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
</select>
|
||||
<select id="exportExcel" resultType="com.yxt.yyth.api.lpkgiftcard.LpkGiftCardExport">
|
||||
SELECT
|
||||
serialNumber,
|
||||
code,
|
||||
codeKey
|
||||
FROM
|
||||
lpk_giftcard
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
</select>
|
||||
<update id="updateState">
|
||||
update lpk_giftcard set state=#{state}, bankSid=#{bankSid},grantRecordSid =#{recordSid} where serialNumber in
|
||||
<foreach collection="serialNumbers" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</update>
|
||||
<!-- <select id="selGiftCard" resultType="com.yxt.yyth.api.lpkgiftcard.LpkGiftCardWordVo">-->
|
||||
<!-- select card.*,bag.name as bagName from lpk_giftcard card left join lpk_giftbag bag on bag.sid =card.giftbagSid where card.serialNumber in-->
|
||||
<!-- <foreach collection="serialNumbers" item="item" index="index" open="(" close=")" separator=",">-->
|
||||
<!-- #{item}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </select>-->
|
||||
<select id="selGiftCard" resultType="com.yxt.yyth.api.lpkgiftcard.LpkGiftCardWordVo">
|
||||
select card.*,bag.name as bagName from lpk_giftcard card left join lpk_giftbag bag on bag.sid =card.giftbagSid
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
</select>
|
||||
<select id="getEmpCardGoods" resultType="com.yxt.yyth.api.empcardgift.EmpCardGiftVo">
|
||||
SELECT
|
||||
sum(goodsNumber) as goodsNumber
|
||||
FROM
|
||||
emp_card_gift gift
|
||||
LEFT JOIN emp_card_gift_goods goods ON gift.sid = goods.empCardGiftSid
|
||||
WHERE
|
||||
gift.empCardSid = #{empCardSid}
|
||||
AND goods.goodsSid = #{goodsSid};
|
||||
</select>
|
||||
</mapper>
|
||||
112
src/main/java/com/yxt/yyth/biz/empcardgift/EmpCardGiftRest.java
Normal file
112
src/main/java/com/yxt/yyth/biz/empcardgift/EmpCardGiftRest.java
Normal file
@@ -0,0 +1,112 @@
|
||||
package com.yxt.yyth.biz.empcardgift;
|
||||
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.yyth.api.empcardgift.EmpCardGiftDto;
|
||||
import com.yxt.yyth.api.empcardgift.EmpCardGiftListVo;
|
||||
import com.yxt.yyth.api.empcardgift.EmpCardGiftQuery;
|
||||
import com.yxt.yyth.api.lpkgiftcard.BindCardDto;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:03
|
||||
*/
|
||||
|
||||
@Api(tags = "礼品卡信息")
|
||||
@RestController
|
||||
@RequestMapping("empcardgift")
|
||||
public class EmpCardGiftRest {
|
||||
|
||||
@Autowired
|
||||
EmpCardGiftService EmpCardGiftService;
|
||||
|
||||
|
||||
@PostMapping("/bindCard")
|
||||
@ApiOperation(value = "客户绑定礼包卡")
|
||||
public ResultBean wxBindMobile(@RequestBody BindCardDto bindCardDto) {
|
||||
return EmpCardGiftService.bindCard(bindCardDto);
|
||||
}
|
||||
|
||||
@PostMapping("/gifCardByCustomerSid")
|
||||
@ApiOperation(value = "获取客户绑定的福利卡")
|
||||
public ResultBean gifCardByCustomerSid(@RequestBody PagerQuery<EmpCardGiftQuery> query) {
|
||||
return EmpCardGiftService.getGifCardByCustomerSid(query);
|
||||
}
|
||||
@GetMapping("/isSaturAndSun/{cardSid}")
|
||||
@ApiOperation(value = "获取时间段的周六日")
|
||||
public ResultBean isSaturAndSun(@PathVariable("cardSid") String cardSid) {
|
||||
return EmpCardGiftService.isSaturAndSun(cardSid);
|
||||
}
|
||||
|
||||
@GetMapping("/getGifCardBySid/{sid}")
|
||||
@ApiOperation(value = "获取礼包卡的详情信息")
|
||||
public ResultBean getGifCardBySid(@PathVariable("sid") String sid) {
|
||||
return EmpCardGiftService.getGifCardBySid(sid);
|
||||
}
|
||||
|
||||
// @GetMapping("/getReservationBySid/{sid}")
|
||||
// @ApiOperation(value = "查询可预约取货的详情")
|
||||
// public ResultBean getReservationBySid(@PathVariable("sid") String sid) {
|
||||
// return EmpCardGiftService.getReservationBySid(sid);
|
||||
// }
|
||||
|
||||
@PostMapping("/generateCard")
|
||||
@ApiOperation(value = "生成礼包卡信息")
|
||||
public ResultBean generateCard(@RequestBody EmpCardGiftDto dto) {
|
||||
return EmpCardGiftService.generateCard(dto);
|
||||
}
|
||||
// @GetMapping("/getCardByBank")
|
||||
// @ApiOperation(value = "生成礼包卡信息")
|
||||
// public JSONObject getCardByBank(@RequestParam(value = "pageNo",defaultValue = "1")Integer pageNo,
|
||||
// @RequestParam(value = "pageSize",defaultValue = "8")Integer pageSize,
|
||||
// @RequestParam(value = "printAll",required = false) String printAll,
|
||||
// @RequestParam(value = "end",defaultValue = "") String end,
|
||||
// @RequestParam(value = "start",defaultValue = "") String start) {
|
||||
// PagerQuery<EmpCardGiftListQuery> pq=new PagerQuery<>();
|
||||
// EmpCardGiftListQuery q=new EmpCardGiftListQuery();
|
||||
// pq.setCurrent(pageNo);
|
||||
// pq.setSize(pageSize);
|
||||
//
|
||||
// q.setNoEnd(end);
|
||||
// q.setNoStart(start);
|
||||
// pq.setParams(q);
|
||||
//
|
||||
// PagerVo<EmpCardGiftWordVo> p=EmpCardGiftService.getCardByBank(pq).getData();
|
||||
// JSONObject jsonObject=new JSONObject();
|
||||
// jsonObject.put("date",p.getRecords());
|
||||
// jsonObject.put("total",p.getPages());
|
||||
// jsonObject.put("count",p.getTotal());
|
||||
// return jsonObject;
|
||||
// }
|
||||
|
||||
// @PostMapping("/cardList")
|
||||
// @ApiOperation(value = "礼包卡信息列表")
|
||||
// public ResultBean<PagerVo<EmpCardGiftListVo>> cardList(@RequestBody PagerQuery<EmpCardGiftQuery> pq) {
|
||||
// return EmpCardGiftService.cardList(pq);
|
||||
// }
|
||||
|
||||
// @ApiOperation("查看记录详情列表")
|
||||
// @PostMapping("/recordDetails")
|
||||
// public ResultBean<PagerVo<EmpCardGiftListVo>> recordDetails(@RequestBody PagerQuery<EmpCardGiftQuery> pq) {
|
||||
// return EmpCardGiftService.recordDetails(pq);
|
||||
// }
|
||||
|
||||
|
||||
// @ApiOperation(value = "礼包卡信息列表导出")
|
||||
// @PostMapping("/exportExcel")
|
||||
// public void exportExcel(@RequestBody EmpCardGiftListQuery query) {
|
||||
// EmpCardGiftService.exportExcel(query);
|
||||
// }
|
||||
|
||||
// @ApiOperation(value = "礼包卡发放信息")
|
||||
// @PostMapping("/cardGrant")
|
||||
// public ResultBean cardGrant(@RequestBody CardGrantDto dto) {
|
||||
// return EmpCardGiftService.cardGrant(dto);
|
||||
// }
|
||||
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,24 @@
|
||||
package com.yxt.yyth.biz.empcardgiftgoods;
|
||||
|
||||
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.yyth.api.empcardgift.*;
|
||||
import com.yxt.yyth.api.empcardgiftgoods.EmpCardGiftGoods;
|
||||
import com.yxt.yyth.api.empcardgiftgoods.EmpCardGiftGoodsVo;
|
||||
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 EmpCardGiftGoodsMapper extends BaseMapper<EmpCardGiftGoods> {
|
||||
List<EmpCardGiftGoodsVo> getGoodsByEmpCardGiftSid(@Param("empCardGiftSid")String empCardGiftSid );
|
||||
List<EmpCardGiftGoodsVo> getGoodsBySid(@Param("empCardGiftSid")String empCardGiftSid );
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?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.yyth.biz.empcardgiftgoods.EmpCardGiftGoodsMapper">
|
||||
<!-- <where> ${ew.sqlSegment} </where>-->
|
||||
<!-- ${ew.customSqlSegment} -->
|
||||
<select id="getGoodsByEmpCardGiftSid" resultType="com.yxt.yyth.api.empcardgiftgoods.EmpCardGiftGoodsVo">
|
||||
select gg.*,goods.name as name,goods.unitName as unitName,goods.picUrl as picUrl
|
||||
from emp_card_gift_goods gg left join lpk_goods goods on gg.goodsSid=goods.sid
|
||||
where gg.empCardGiftSid =#{empCardGiftSid}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.yxt.yyth.biz.empcardgiftgoods;
|
||||
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.yyth.api.empcardgift.EmpCardGiftDto;
|
||||
import io.swagger.annotations.Api;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:03
|
||||
*/
|
||||
|
||||
@Api(tags = "企业福利卡商品")
|
||||
@RestController
|
||||
@RequestMapping("empcardgiftgoods")
|
||||
public class EmpCardGiftGoodsRest {
|
||||
|
||||
@Autowired
|
||||
EmpCardGiftGoodsService EmpCardGiftService;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.yxt.yyth.biz.empcardgiftgoods;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.yxt.common.base.config.component.FileUploadComponent;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.base.utils.StringUtils;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.yyth.api.empcard.EmpCard;
|
||||
import com.yxt.yyth.api.empcardgift.EmpCardGift;
|
||||
import com.yxt.yyth.api.empcardgift.EmpCardGiftDto;
|
||||
import com.yxt.yyth.api.empcardgiftgoods.EmpCardGiftGoods;
|
||||
import com.yxt.yyth.api.empcardgiftgoods.EmpCardGiftGoodsDto;
|
||||
import com.yxt.yyth.api.empcardgiftgoods.EmpCardGiftGoodsVo;
|
||||
import com.yxt.yyth.api.empcardgrantlog.EmpCardGrantLog;
|
||||
import com.yxt.yyth.api.lpkbank.LpkBank;
|
||||
import com.yxt.yyth.biz.empcard.EmpCardService;
|
||||
import com.yxt.yyth.biz.empcardgrantlog.EmpCardGrantLogService;
|
||||
import com.yxt.yyth.biz.lpkgiftcard.generateRule.UniqueIdGenerator;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:03
|
||||
*/
|
||||
@Service
|
||||
public class EmpCardGiftGoodsService extends MybatisBaseService<EmpCardGiftGoodsMapper, EmpCardGiftGoods> {
|
||||
|
||||
|
||||
|
||||
public ResultBean save(EmpCardGiftGoodsDto dto) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
EmpCardGiftGoods entity=new EmpCardGiftGoods();
|
||||
BeanUtil.copyProperties(dto, entity, "id", "sid");
|
||||
baseMapper.insert(entity);
|
||||
return rb.success();
|
||||
}
|
||||
public ResultBean<List<EmpCardGiftGoodsVo>> getGoodsByEmpCardGiftSid(String empCardGiftSid) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
List<EmpCardGiftGoodsVo> list= baseMapper.getGoodsByEmpCardGiftSid(empCardGiftSid);
|
||||
return rb.success().setData(list);
|
||||
}
|
||||
public ResultBean<List<EmpCardGiftGoodsVo>> getGoodsBySid(String empCardGiftSid) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
List<EmpCardGiftGoodsVo> list= baseMapper.getGoodsBySid(empCardGiftSid);
|
||||
return rb.success().setData(list);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.yxt.yyth.biz.empcardgrantlog;
|
||||
|
||||
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.yyth.api.empcardgrantlog.EmpCardGrantLog;
|
||||
import com.yxt.yyth.api.empcardgrantlog.EmpCardGrantLogVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/12/8 9:19
|
||||
*/
|
||||
@Mapper
|
||||
public interface EmpCardGrantLogMapper extends BaseMapper<EmpCardGrantLog> {
|
||||
IPage<EmpCardGrantLogVo> recordListPage(IPage<EmpCardGrantLog> page, @Param(Constants.WRAPPER) QueryWrapper<EmpCardGrantLog> qw);
|
||||
List<EmpCardGrantLogVo> recordList(@Param("empCardSid")String empCardSid);
|
||||
EmpCardGrantLogVo recordListGoods(@Param("empCardSid")String empCardSid,@Param("goodsSid")String goodsSid);
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?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.yyth.biz.empcardgrantlog.EmpCardGrantLogMapper">
|
||||
<!-- <where> ${ew.sqlSegment} </where>-->
|
||||
<!-- ${ew.customSqlSegment} -->
|
||||
|
||||
|
||||
<select id="recordListPage" resultType="com.yxt.yyth.api.empcardgrantlog.EmpCardGrantLogVo">
|
||||
select
|
||||
r.sid,
|
||||
date_format(r.buildDate, '%Y-%m-%d') as buildDate,
|
||||
r.countNumber,
|
||||
r.startNumber,
|
||||
r.endNumber,
|
||||
g.name as bagName
|
||||
from emp_card_build_record as r
|
||||
left join lpk_giftbag as g on r.giftbagSid = g.sid
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
</select>
|
||||
<select id="recordList" resultType="com.yxt.yyth.api.empcardgrantlog.EmpCardGrantLogVo">
|
||||
SELECT
|
||||
log.*,
|
||||
gi.sid as cardSid,
|
||||
gi.code as code,
|
||||
gi.codeKey as codeKey,
|
||||
gi.remarks as remakrs
|
||||
FROM
|
||||
emp_card_grant_log log
|
||||
LEFT JOIN emp_card_gift gi ON gi.CODE = log.CODE
|
||||
where log.empCardSid=#{empCardSid}
|
||||
|
||||
</select>
|
||||
<select id="recordListGoods" resultType="com.yxt.yyth.api.empcardgrantlog.EmpCardGrantLogVo">
|
||||
SELECT
|
||||
log.sid,
|
||||
sum( go.goodsNumber ) AS goodsNumber
|
||||
FROM
|
||||
emp_card_grant_log log
|
||||
LEFT JOIN emp_card_gift gi ON gi.CODE = log.
|
||||
CODE LEFT JOIN emp_card_gift_goods go on go.empCardGiftSid = gi.sid
|
||||
where log.empCardSid=#{empCardSid} and go.goodsSid=#{goodsSid}
|
||||
GROUP BY go.goodsSid
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.yxt.yyth.biz.empcardgrantlog;
|
||||
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.yyth.api.empcardgrantlog.EmpCardGrantLogQuery;
|
||||
import com.yxt.yyth.api.empcardgrantlog.EmpCardGrantLogVo;
|
||||
import io.swagger.annotations.Api;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/12/8 9:19
|
||||
*/
|
||||
@Api(tags = "礼品卡信息")
|
||||
@RestController
|
||||
@RequestMapping("empcardgrantlog")
|
||||
public class EmpCardGrantLogRest {
|
||||
@Autowired
|
||||
EmpCardGrantLogService EmpCardGrantLogService;
|
||||
@ApiOperation("创建记录列表")
|
||||
@PostMapping("/recordListPage")
|
||||
public ResultBean<PagerVo<EmpCardGrantLogVo>> recordListPage(@RequestBody PagerQuery<EmpCardGrantLogQuery> pq) {
|
||||
return EmpCardGrantLogService.recordListPage(pq);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.yxt.yyth.biz.empcardgrantlog;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.yyth.api.empcardgrantlog.EmpCardGrantLog;
|
||||
import com.yxt.yyth.api.empcardgrantlog.EmpCardGrantLogQuery;
|
||||
import com.yxt.yyth.api.empcardgrantlog.EmpCardGrantLogVo;
|
||||
import com.yxt.yyth.biz.empcard.EmpCardService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/12/8 9:19
|
||||
*/
|
||||
@Service
|
||||
public class EmpCardGrantLogService extends MybatisBaseService<EmpCardGrantLogMapper, EmpCardGrantLog> {
|
||||
|
||||
@Autowired
|
||||
EmpCardService empCardService;
|
||||
public ResultBean<PagerVo<EmpCardGrantLogVo>> recordListPage(PagerQuery<EmpCardGrantLogQuery> pq) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
EmpCardGrantLogQuery query = pq.getParams();
|
||||
QueryWrapper<EmpCardGrantLog> qw = new QueryWrapper<>();
|
||||
qw.eq("1", "1");
|
||||
if (StringUtils.isNotBlank(query.getCountNumber())) {
|
||||
qw.eq("r.countNumber", query.getCountNumber());
|
||||
}
|
||||
String startDate = query.getStartDate();
|
||||
String effEndTime = query.getEndDate();
|
||||
qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(startDate), "date_format (r.buildDate,'%Y-%m-%d') >= date_format('" + startDate + "','%Y-%m-%d')").
|
||||
apply(org.apache.commons.lang3.StringUtils.isNotEmpty(effEndTime), "date_format (r.buildDate,'%Y-%m-%d') <= date_format('" + effEndTime + "','%Y-%m-%d')"
|
||||
);
|
||||
qw.orderByDesc("r.createTime");
|
||||
IPage<EmpCardGrantLog> page = PagerUtil.queryToPage(pq);
|
||||
IPage<EmpCardGrantLogVo> pagging = baseMapper.recordListPage(page, qw);
|
||||
// for(EmpCardGrantLogVo vo:pagging.getRecords()){
|
||||
// vo.setGrantCountNumber(String.valueOf(empCardService.cardGrantCount(vo.getSid()).getData()));
|
||||
// }
|
||||
PagerVo<EmpCardGrantLogVo> p = PagerUtil.pageToVo(pagging, null);
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
|
||||
public ResultBean<List<EmpCardGrantLogVo>> recordList(String empCardSid) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
List<EmpCardGrantLogVo> pagging = baseMapper.recordList(empCardSid);
|
||||
return rb.success().setData(pagging);
|
||||
}
|
||||
public ResultBean<EmpCardGrantLogVo> recordListGoods(String empCardSid,String goodsSid) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
EmpCardGrantLogVo pagging = baseMapper.recordListGoods(empCardSid,goodsSid);
|
||||
return rb.success().setData(pagging);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.yxt.yyth.biz.empreserveorder;
|
||||
|
||||
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.yyth.api.empreserveorder.*;
|
||||
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/23 10:36
|
||||
*/
|
||||
@Mapper
|
||||
public interface EmpReserveOrderMapper extends BaseMapper<EmpReserveOrder> {
|
||||
IPage<EmpReserveOrderVo> orderList(IPage<EmpReserveOrder> page, @Param(Constants.WRAPPER) QueryWrapper<EmpReserveOrder> qw);
|
||||
IPage<EmpReserveOrderVo> orderListByStore(IPage<EmpReserveOrder> page, @Param(Constants.WRAPPER) QueryWrapper<EmpReserveOrder> qw);
|
||||
List<EmpReserveOrderCardVo> orderByCardSid(String sid);
|
||||
|
||||
IPage<EmpReserveOrderCardVo> orderListByUserSid(IPage<EmpReserveOrder> page, @Param(Constants.WRAPPER) QueryWrapper<EmpReserveOrder> qw);
|
||||
|
||||
List<ReserveOrderExport> exportExcel(@Param(Constants.WRAPPER) QueryWrapper<EmpReserveOrderQuery> qw);
|
||||
List<ReserveOrderExportByStore> exportExcelByStore(@Param(Constants.WRAPPER) QueryWrapper<EmpReserveOrderQuery> qw);
|
||||
@Select("select sid from lpk_reserve_order where storeSid=#{storeSid}")
|
||||
List<String> getOrderByStore(@Param("storeSid")String storeSid);
|
||||
@Select("select * from emp_reserve_order where customerSid =#{sid} order by createTime desc limit 1")
|
||||
EmpReserveOrderVo getStoreByCustomerSid(@Param("sid") String sid);
|
||||
@Select("select * from lpk_reserve_order where cardSid =#{sid} order by reserveDate desc limit 1")
|
||||
EmpReserveOrderVo selByCardSid(@Param("sid") String sid);
|
||||
@Select("SELECT o.*,st.`name` AS store FROM emp_reserve_order o LEFT JOIN lpk_store st ON o.storeSid = st.sid where o.cardSid =#{sid} ORDER BY o.reserveDate desc")
|
||||
List<EmpReserveOrderCardVo> selOrderByCardSid(@Param("sid") String sid);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
<?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.yyth.biz.empreserveorder.EmpReserveOrderMapper">
|
||||
<!-- <where> ${ew.sqlSegment} </where>-->
|
||||
<!-- ${ew.customSqlSegment} -->
|
||||
|
||||
<select id="storeListPage" resultType="com.yxt.yyth.api.lpkstore.LpkStoreVo">
|
||||
select
|
||||
sid,
|
||||
date_format(createTime, '%Y-%m-%d') as createTime,
|
||||
code,
|
||||
`name`,
|
||||
address,
|
||||
phone,
|
||||
businessHours
|
||||
from lpk_store
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
</select>
|
||||
<select id="orderList" resultType="com.yxt.yyth.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,
|
||||
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.yyth.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.yyth.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.yyth.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.yyth.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.yyth.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>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.yxt.yyth.biz.empreserveorder;
|
||||
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.yyth.api.empreserveorder.EmpReserveOrderCardVo;
|
||||
import com.yxt.yyth.api.empreserveorder.EmpReserveOrderDto;
|
||||
import com.yxt.yyth.api.empreserveorder.EmpReserveOrderQuery;
|
||||
import com.yxt.yyth.api.empreserveorder.EmpReserveOrderVo;
|
||||
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderDto;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/23 10:35
|
||||
*/
|
||||
@Api(tags = "预约订单信息")
|
||||
@RestController
|
||||
@RequestMapping("/empsreservoorder")
|
||||
public class EmpReserveOrderRest {
|
||||
@Autowired
|
||||
EmpReserveOrderService empReserveOrderService;
|
||||
|
||||
|
||||
@ApiOperation("预约提交")
|
||||
@PostMapping("/submission")
|
||||
public ResultBean submission(@RequestBody EmpReserveOrderDto dto) {
|
||||
return empReserveOrderService.submission(dto);
|
||||
}
|
||||
|
||||
@ApiOperation("订单列表")
|
||||
@PostMapping("/orderList")
|
||||
public ResultBean<PagerVo<EmpReserveOrderVo>> orderList(@RequestBody PagerQuery<EmpReserveOrderQuery> pq) {
|
||||
return empReserveOrderService.orderList(pq);
|
||||
}
|
||||
@ApiOperation("订单门店汇总列表")
|
||||
@PostMapping("/orderListByStore")
|
||||
public ResultBean<PagerVo<EmpReserveOrderVo>> orderListByStore(@RequestBody PagerQuery<EmpReserveOrderQuery> pq) {
|
||||
return empReserveOrderService.orderListByStore(pq);
|
||||
}
|
||||
@ApiOperation("根据提货卡查询预约记录")
|
||||
@GetMapping("/orderByCardSid/{sid}")
|
||||
public ResultBean orderByCardSid(@PathVariable("sid") String sid) {
|
||||
return empReserveOrderService.orderByCardSid(sid);
|
||||
}
|
||||
|
||||
@ApiOperation("移动端预约订单列表")
|
||||
@PostMapping("/orderListByUserSid")
|
||||
public ResultBean<PagerVo<EmpReserveOrderCardVo>> orderListByUserSid(@RequestBody PagerQuery<EmpReserveOrderQuery> pq) {
|
||||
return empReserveOrderService.orderListByUserSid(pq);
|
||||
}
|
||||
|
||||
@ApiOperation("预约记录详情")
|
||||
@GetMapping("/orderDetails/{orderSid}")
|
||||
public ResultBean orderDetails(@PathVariable("orderSid") String orderSid) {
|
||||
return empReserveOrderService.orderDetails(orderSid);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "预约订单信息列表导出")
|
||||
@PostMapping("/exportExcel")
|
||||
public void exportExcel(@RequestBody EmpReserveOrderQuery query) {
|
||||
empReserveOrderService.exportExcel(query);
|
||||
}
|
||||
@ApiOperation(value = "预约订单门店汇总导出")
|
||||
@PostMapping("/exportExcelByStore")
|
||||
public void exportExcelByStore(@RequestBody EmpReserveOrderQuery query) {
|
||||
empReserveOrderService.exportExcelByStore(query);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,439 @@
|
||||
package com.yxt.yyth.biz.empreserveorder;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
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.ExportExcelUtils;
|
||||
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.yyth.api.empreserveorder.*;
|
||||
import com.yxt.yyth.api.empreserveordergoods.EmpReserveOrderGoods;
|
||||
import com.yxt.yyth.api.lpkgiftbaggoods.LpkGiftBagGoodsVo;
|
||||
import com.yxt.yyth.api.lpkgiftcard.AppletVo;
|
||||
import com.yxt.yyth.api.lpkgiftcard.GoodsVo;
|
||||
import com.yxt.yyth.api.lpkgoods.LpkGoods;
|
||||
import com.yxt.yyth.api.lpkstore.LpkStore;
|
||||
import com.yxt.yyth.api.lpkstore.StoreSelect;
|
||||
import com.yxt.yyth.biz.empreserveordergoods.EmpReserveOrderGoodsService;
|
||||
import com.yxt.yyth.biz.lpkgiftbaggoods.LpkGiftBagGoodsService;
|
||||
import com.yxt.yyth.biz.lpkgiftcard.LpkGiftCardMapper;
|
||||
import com.yxt.yyth.biz.lpkgoods.LpkGoodsService;
|
||||
import com.yxt.yyth.biz.lpkstore.LpkStoreService;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/23 10:36
|
||||
*/
|
||||
@Service
|
||||
public class EmpReserveOrderService extends MybatisBaseService<EmpReserveOrderMapper, EmpReserveOrder> {
|
||||
@Autowired
|
||||
EmpReserveOrderGoodsService empReserveOrderGoodsService;
|
||||
@Autowired
|
||||
LpkGiftCardMapper lpkGiftCardMapper;
|
||||
@Autowired
|
||||
LpkGiftBagGoodsService lpkGiftBagGoodsService;
|
||||
@Autowired
|
||||
LpkStoreService lpkStoreService;
|
||||
@Autowired
|
||||
private FileUploadComponent fileUploadComponent;
|
||||
@Autowired
|
||||
private LpkGoodsService lpkGoodsService;
|
||||
@Autowired
|
||||
private HttpServletResponse response;
|
||||
|
||||
public ResultBean submission(EmpReserveOrderDto dto) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
boolean b=isSatAndSun(dto.getReserveDate());
|
||||
if(!b){
|
||||
return rb.setMsg("周六、周日不能预约提货");
|
||||
}
|
||||
EmpReserveOrder order = new EmpReserveOrder();
|
||||
BeanUtil.copyProperties(dto, order, "id", "sid");
|
||||
order.setStoreSid(dto.getValue());
|
||||
order.setCardSid(dto.getSid());
|
||||
order.setCreateTime(new DateTime());
|
||||
baseMapper.insert(order);
|
||||
dto.setOrderSid(order.getSid());
|
||||
empReserveOrderGoodsService.submissionDetail(dto);
|
||||
return rb.success().setData("预约成功");
|
||||
}
|
||||
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) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@Test
|
||||
public void isSatAndSun(){
|
||||
String date="2023-12-11";
|
||||
DateTime dateTime = DateUtil.parse(date);; // 获取当前时间
|
||||
int dayOfWeek = dateTime.dayOfWeekEnum().getValue();// 获取星期几(1-7)
|
||||
|
||||
System.out.println(dayOfWeek);
|
||||
if (dayOfWeek == 1 || dayOfWeek == 7) {
|
||||
System.out.println(dayOfWeek);
|
||||
} else {
|
||||
System.out.println(11111);
|
||||
}
|
||||
}
|
||||
public ResultBean<PagerVo<EmpReserveOrderVo>> orderList(PagerQuery<EmpReserveOrderQuery> pq) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
EmpReserveOrderQuery query = pq.getParams();
|
||||
QueryWrapper<EmpReserveOrder> qw = new QueryWrapper<>();
|
||||
qw.eq("1", "1");
|
||||
if (StringUtils.isNotBlank(query.getStore())) {
|
||||
qw.like("s.name", query.getStore());
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getUserName())) {
|
||||
qw.like("o.userName", query.getUserName());
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getUserSid())) {
|
||||
qw.like("o.customerSid", query.getUserSid());
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getStartDate())) {
|
||||
|
||||
String startDate = query.getStartDate();
|
||||
qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(startDate), "date_format (o.reserveDate,'%Y-%m-%d') >= date_format('" + startDate + "','%Y-%m-%d')");
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getEndDate())) {
|
||||
String endDate = query.getEndDate();
|
||||
qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(endDate), "date_format (o.reserveDate,'%Y-%m-%d') <= date_format('" + endDate + "','%Y-%m-%d')");
|
||||
}
|
||||
|
||||
|
||||
qw.orderByDesc("o.reserveDate");
|
||||
IPage<EmpReserveOrder> page = PagerUtil.queryToPage(pq);
|
||||
IPage<EmpReserveOrderVo> pagging = baseMapper.orderList(page, qw);
|
||||
List<EmpReserveOrderVo> records = pagging.getRecords();
|
||||
if (!records.isEmpty()) {
|
||||
records.forEach(s -> {
|
||||
List<EmpReserveOrderGoods> orderGoods = empReserveOrderGoodsService.selByOrderSid(s.getSid());
|
||||
List<OrderGoodsVo> goodsVoList = new ArrayList<>();
|
||||
if (!orderGoods.isEmpty()) {
|
||||
for (EmpReserveOrderGoods orderGood : orderGoods) {
|
||||
OrderGoodsVo goodsVo = new OrderGoodsVo();
|
||||
if (StringUtils.isNotBlank(orderGood.getGoodsSid())) {
|
||||
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(orderGood.getGoodsSid());
|
||||
if (null != lpkGoods) {
|
||||
goodsVo.setGoodName(lpkGoods.getName());
|
||||
}
|
||||
}
|
||||
if (orderGood.getGoodsNumber() != 0) {
|
||||
goodsVo.setNum((int) orderGood.getGoodsNumber());
|
||||
}
|
||||
goodsVoList.add(goodsVo);
|
||||
}
|
||||
}
|
||||
s.setGoodsVo(goodsVoList);
|
||||
});
|
||||
}
|
||||
PagerVo<EmpReserveOrderVo> p = PagerUtil.pageToVo(pagging, null);
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
public ResultBean<PagerVo<EmpReserveOrderVo>> orderListByStore(PagerQuery<EmpReserveOrderQuery> pq) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
EmpReserveOrderQuery query = pq.getParams();
|
||||
QueryWrapper<EmpReserveOrder> qw = new QueryWrapper<>();
|
||||
qw.eq("1", "1");
|
||||
if (StringUtils.isNotBlank(query.getStore())) {
|
||||
qw.like("s.name", query.getStore());
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getUserName())) {
|
||||
qw.like("o.userName", query.getUserName());
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getUserSid())) {
|
||||
qw.like("o.customerSid", query.getUserSid());
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getStartDate())) {
|
||||
|
||||
String startDate = query.getStartDate();
|
||||
qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(startDate), "date_format (o.reserveDate,'%Y-%m-%d') >= date_format('" + startDate + "','%Y-%m-%d')");
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getEndDate())) {
|
||||
String endDate = query.getEndDate();
|
||||
qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(endDate), "date_format (o.reserveDate,'%Y-%m-%d') <= date_format('" + endDate + "','%Y-%m-%d')");
|
||||
}
|
||||
|
||||
qw.orderByDesc("o.reserveDate");
|
||||
IPage<EmpReserveOrder> page = PagerUtil.queryToPage(pq);
|
||||
IPage<EmpReserveOrderVo> pagging = baseMapper.orderListByStore(page, qw);
|
||||
List<EmpReserveOrderVo> records = pagging.getRecords();
|
||||
if (!records.isEmpty()) {
|
||||
records.forEach(s -> {
|
||||
List<String> list=baseMapper.getOrderByStore(s.getStoreSid());
|
||||
List<EmpReserveOrderGoods> orderGoods = empReserveOrderGoodsService.selInOrderSid(list);
|
||||
if (!orderGoods.isEmpty()) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
for (EmpReserveOrderGoods orderGood : orderGoods) {
|
||||
String num = "";
|
||||
String goodsName = "";
|
||||
String finWord = "";
|
||||
String unitName = "";
|
||||
if (StringUtils.isNotBlank(orderGood.getGoodsSid())) {
|
||||
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(orderGood.getGoodsSid());
|
||||
if (null != lpkGoods) {
|
||||
goodsName = lpkGoods.getName();
|
||||
if (StringUtils.isNotBlank(lpkGoods.getUnitName())) {
|
||||
unitName = lpkGoods.getUnitName();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (orderGood.getGoodsNumber() != 0) {
|
||||
num = String.valueOf((int) orderGood.getGoodsNumber());
|
||||
}
|
||||
finWord = num + unitName + goodsName;
|
||||
sb.append(finWord).append("、");
|
||||
}
|
||||
if (sb.length() > 0) {
|
||||
sb.delete(sb.length() - 1, sb.length());
|
||||
s.setGoodsInfo(sb.toString());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
PagerVo<EmpReserveOrderVo> p = PagerUtil.pageToVo(pagging, null);
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
public ResultBean orderByCardSid(String sid) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
List<EmpReserveOrderCardVo> list = baseMapper.orderByCardSid(sid);
|
||||
return rb.success().setData(list);
|
||||
}
|
||||
|
||||
public ResultBean<PagerVo<EmpReserveOrderCardVo>> orderListByUserSid(PagerQuery<EmpReserveOrderQuery> pq) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
EmpReserveOrderQuery query = pq.getParams();
|
||||
QueryWrapper<EmpReserveOrder> qw = new QueryWrapper<>();
|
||||
qw.eq("o.customerSid", query.getUserSid());
|
||||
qw.orderByDesc("o.reserveDate");
|
||||
IPage<EmpReserveOrder> page = PagerUtil.queryToPage(pq);
|
||||
IPage<EmpReserveOrderCardVo> pagging = baseMapper.orderListByUserSid(page, qw);
|
||||
for(EmpReserveOrderCardVo vo:pagging.getRecords()){
|
||||
List<EmpReserveOrderGoods> goods =empReserveOrderGoodsService.selByOrderSids(vo.getSid());
|
||||
for(EmpReserveOrderGoods goods1:goods){
|
||||
LpkGoods lpkGoods=lpkGoodsService.getOne(new QueryWrapper<LpkGoods>().eq("sid",goods1.getGoodsSid()));
|
||||
if(StringUtils.isBlank(vo.getGoods())){
|
||||
vo.setGoods(lpkGoods.getName()+":"+goods1.getNum()+lpkGoods.getUnitName());
|
||||
}else{
|
||||
vo.setGoods(vo.getGoods()+" "+lpkGoods.getName()+":"+goods1.getNum()+lpkGoods.getUnitName());
|
||||
}
|
||||
}
|
||||
}
|
||||
PagerVo<EmpReserveOrderCardVo> p = PagerUtil.pageToVo(pagging, null);
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
|
||||
public ResultBean orderDetails(String orderSid) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
EmpReserveOrder EmpReserveOrder = fetchBySid(orderSid);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
if (null != EmpReserveOrder) {
|
||||
AppletVo vo = lpkGiftCardMapper.getGifCardBySid(EmpReserveOrder.getCardSid());
|
||||
if (StringUtils.isNotBlank(EmpReserveOrder.getStoreSid())) {
|
||||
LpkStore lpkStore = lpkStoreService.fetchBySid(EmpReserveOrder.getStoreSid());
|
||||
if (null != lpkStore) {
|
||||
if (StringUtils.isNotBlank(lpkStore.getName())) {
|
||||
vo.setStore(lpkStore.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(EmpReserveOrder.getReserveDate())) {
|
||||
try {
|
||||
Date parse = sdf.parse(EmpReserveOrder.getReserveDate());
|
||||
vo.setReserveDate(sdf.format(parse));
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
List<LpkGiftBagGoodsVo> list = lpkGiftBagGoodsService.getGoodsByBagSid(vo.getGiftbagSid());
|
||||
List<StoreSelect> l = lpkStoreService.getAllStore().getData();
|
||||
List<GoodsVo> goodsVos = new ArrayList<>();
|
||||
list.forEach(s -> {
|
||||
EmpReserveOrderGoods goods = empReserveOrderGoodsService.getReserveByCardSid(vo.getSid(), s.getGoodsSid()).getData();
|
||||
EmpReserveOrderGoods orderGoods = empReserveOrderGoodsService.selByOrderSidAndGoodSid(orderSid, s.getGoodsSid());
|
||||
GoodsVo goodsVo = new GoodsVo();
|
||||
goodsVo.setGoods(s.getGoodsName());
|
||||
goodsVo.setNum(s.getGoodsNumber());
|
||||
goodsVo.setGoodsSid(s.getGoodsSid());
|
||||
goodsVo.setPic(fileUploadComponent.getUrlPrefix() + s.getPicUrl());
|
||||
if (null != goods) {
|
||||
if (goods.getGoodsNumber() != s.getGoodsNumber()) {
|
||||
goodsVo.setLNum(s.getGoodsNumber() - goods.getGoodsNumber());
|
||||
goodsVo.setSelect(s.getGoodsNumber() - goods.getGoodsNumber());
|
||||
if (null != orderGoods) {
|
||||
goodsVo.setOrderNum(orderGoods.getGoodsNumber());
|
||||
}
|
||||
goodsVos.add(goodsVo);
|
||||
}
|
||||
} else {
|
||||
goodsVo.setLNum(s.getGoodsNumber());
|
||||
goodsVo.setSelect(s.getGoodsNumber());
|
||||
goodsVos.add(goodsVo);
|
||||
}
|
||||
});
|
||||
vo.setGoodsVos(goodsVos);
|
||||
vo.setSelect(l);
|
||||
return rb.success().setData(vo);
|
||||
}
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
public void exportExcel(EmpReserveOrderQuery query) {
|
||||
QueryWrapper<EmpReserveOrderQuery> qw = new QueryWrapper<>();
|
||||
qw.eq("1", "1");
|
||||
if (StringUtils.isNotBlank(query.getStore())) {
|
||||
qw.like("s.name", query.getStore());
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getUserName())) {
|
||||
qw.like("o.userName", query.getUserName());
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getStartDate())) {
|
||||
String startDate = query.getStartDate();
|
||||
qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(startDate), "date_format (o.reserveDate,'%Y-%m-%d') >= date_format('" + startDate + "','%Y-%m-%d')");
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getEndDate())) {
|
||||
String endDate = query.getEndDate();
|
||||
qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(endDate), "date_format (o.reserveDate,'%Y-%m-%d') <= date_format('" + endDate + "','%Y-%m-%d')");
|
||||
}
|
||||
qw.orderByDesc("o.createTime");
|
||||
//得到所有要导出的数据
|
||||
List<ReserveOrderExport> exportList = baseMapper.exportExcel(qw);
|
||||
if (!exportList.isEmpty()) {
|
||||
exportList.forEach(s -> {
|
||||
if (StringUtils.isNotBlank(s.getUserPhone())) {
|
||||
// String phone = s.getUserPhone().substring(0, 3) + "****" + s.getUserPhone().substring(7);
|
||||
String phone = s.getUserPhone();
|
||||
s.setUserPhone(phone);
|
||||
}
|
||||
List<EmpReserveOrderGoods> orderGoods = empReserveOrderGoodsService.selByOrderSid(s.getSid());
|
||||
if (!orderGoods.isEmpty()) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
for (EmpReserveOrderGoods orderGood : orderGoods) {
|
||||
String num = "";
|
||||
String goodsName = "";
|
||||
String finWord = "";
|
||||
String unitName = "";
|
||||
if (StringUtils.isNotBlank(orderGood.getGoodsSid())) {
|
||||
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(orderGood.getGoodsSid());
|
||||
if (null != lpkGoods) {
|
||||
goodsName = lpkGoods.getName();
|
||||
if (StringUtils.isNotBlank(lpkGoods.getUnitName())) {
|
||||
unitName = lpkGoods.getUnitName();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (orderGood.getGoodsNumber() != 0) {
|
||||
num = String.valueOf((int) orderGood.getGoodsNumber());
|
||||
}
|
||||
finWord = num + unitName + goodsName;
|
||||
sb.append(finWord).append("、");
|
||||
}
|
||||
if (sb.length() > 0) {
|
||||
sb.delete(sb.length() - 1, sb.length());
|
||||
s.setGoodsInfo(sb.toString());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
//定义导出的excel名字
|
||||
String excelName = "1";
|
||||
String fileNameURL = "1";
|
||||
// try {
|
||||
// fileNameURL = URLEncoder.encode(excelName, "UTF-8");
|
||||
// fileNameURL = URLEncoder.encode(excelName, "UTF-8");
|
||||
// } catch (UnsupportedEncodingException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
//导出预约订单信息列表
|
||||
ExportExcelUtils.export(fileNameURL, exportList, ReserveOrderExport.class, response);
|
||||
}
|
||||
public void exportExcelByStore(EmpReserveOrderQuery query) {
|
||||
QueryWrapper<EmpReserveOrderQuery> qw = new QueryWrapper<>();
|
||||
qw.eq("1", "1");
|
||||
if (StringUtils.isNotBlank(query.getStartDate())) {
|
||||
String startDate = query.getStartDate();
|
||||
qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(startDate), "date_format (o.reserveDate,'%Y-%m-%d') >= date_format('" + startDate + "','%Y-%m-%d')");
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getEndDate())) {
|
||||
String endDate = query.getEndDate();
|
||||
qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(endDate), "date_format (o.reserveDate,'%Y-%m-%d') <= date_format('" + endDate + "','%Y-%m-%d')");
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getStore())) {
|
||||
qw.like("s.name", query.getStore());
|
||||
}
|
||||
qw.orderByDesc("o.createTime");
|
||||
qw.groupBy("s.name");
|
||||
//得到所有要导出的数据
|
||||
List<ReserveOrderExportByStore> exportList = baseMapper.exportExcelByStore(qw);
|
||||
if (!exportList.isEmpty()) {
|
||||
exportList.forEach(s -> {
|
||||
List<String> list=baseMapper.getOrderByStore(s.getStoreSid());
|
||||
List<EmpReserveOrderGoods> orderGoods = empReserveOrderGoodsService.selInOrderSid(list);
|
||||
if (!orderGoods.isEmpty()) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
for (EmpReserveOrderGoods orderGood : orderGoods) {
|
||||
String num = "";
|
||||
String goodsName = "";
|
||||
String finWord = "";
|
||||
String unitName = "";
|
||||
if (StringUtils.isNotBlank(orderGood.getGoodsSid())) {
|
||||
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(orderGood.getGoodsSid());
|
||||
if (null != lpkGoods) {
|
||||
goodsName = lpkGoods.getName();
|
||||
if (StringUtils.isNotBlank(lpkGoods.getUnitName())) {
|
||||
unitName = lpkGoods.getUnitName();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (orderGood.getGoodsNumber() != 0) {
|
||||
num = String.valueOf((int) orderGood.getGoodsNumber());
|
||||
}
|
||||
finWord = num + unitName + goodsName;
|
||||
sb.append(finWord).append("、");
|
||||
}
|
||||
if (sb.length() > 0) {
|
||||
sb.delete(sb.length() - 1, sb.length());
|
||||
s.setGoodsInfo(sb.toString());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
//定义导出的excel名字
|
||||
String excelName = "1";
|
||||
String fileNameURL = "1";
|
||||
//导出预约订单信息列表
|
||||
ExportExcelUtils.export(fileNameURL, exportList, ReserveOrderExportByStore.class, response);
|
||||
}
|
||||
|
||||
|
||||
public ResultBean<EmpReserveOrderVo> getStoreByCustomerSid(String sid) {
|
||||
return new ResultBean().success().setData(baseMapper.getStoreByCustomerSid(sid));
|
||||
}
|
||||
public ResultBean<EmpReserveOrderVo> selByCardSid(String sid) {
|
||||
return new ResultBean().success().setData(baseMapper.selByCardSid(sid));
|
||||
}
|
||||
public ResultBean<List<EmpReserveOrderCardVo>> selOrderByCardSid(String sid) {
|
||||
return new ResultBean().success().setData(baseMapper.selOrderByCardSid(sid));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.yxt.yyth.biz.empreserveordergoods;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.yyth.api.empreserveordergoods.EmpReserveOrderGoods;
|
||||
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/23 10:36
|
||||
*/
|
||||
@Mapper
|
||||
public interface EmpReserveOrderGoodsMapper extends BaseMapper<EmpReserveOrderGoods> {
|
||||
@Select("select sum(goodsNumber) as goodsNumber , goodsSid as goodsSid from emp_reserve_order_goods where cardSid=#{cardSid} and goodsSid=#{goodsSid}")
|
||||
EmpReserveOrderGoods getReserveByCardSid(@Param("cardSid") String cardSid, @Param("goodsSid") String goodsSid);
|
||||
|
||||
EmpReserveOrderGoods selByOrderSidAndGoodSid(@Param("orderSid") String orderSid, @Param("goodsSid") String goodsSid);
|
||||
|
||||
@Select("select * from lpk_reserve_order_goods where orderSid=#{orderSid}")
|
||||
List<EmpReserveOrderGoods> selByOrderSid(String orderSid);
|
||||
|
||||
List<EmpReserveOrderGoods> selInOrderSid(@Param("orderSids") List<String> orderSids);
|
||||
@Select("select *,goodsNumber as num from emp_reserve_order_goods where orderSid=#{orderSid}")
|
||||
List<EmpReserveOrderGoods> selByOrderSids(String orderSid);
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?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.yyth.biz.empreserveordergoods.EmpReserveOrderGoodsMapper">
|
||||
<!-- <where> ${ew.sqlSegment} </where>-->
|
||||
<!-- ${ew.customSqlSegment} -->
|
||||
|
||||
<select id="storeListPage" resultType="com.yxt.yyth.api.lpkstore.LpkStoreVo">
|
||||
select
|
||||
sid,
|
||||
date_format(createTime, '%Y-%m-%d') as createTime,
|
||||
code,
|
||||
`name`,
|
||||
address,
|
||||
phone,
|
||||
businessHours
|
||||
from lpk_store
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
</select>
|
||||
<select id="selByOrderSidAndGoodSid"
|
||||
resultType="com.yxt.yyth.api.lpkreserveordergoods.LpkReserveOrderGoods">
|
||||
select *
|
||||
from lpk_reserve_order_goods
|
||||
where orderSid = #{orderSid}
|
||||
and goodsSid = #{goodsSid}
|
||||
</select>
|
||||
<select id="selInOrderSid" resultType="com.yxt.yyth.api.lpkreserveordergoods.LpkReserveOrderGoods">
|
||||
select s.*
|
||||
from lpk_reserve_order_goods s
|
||||
where orderSid in
|
||||
<foreach collection="orderSids" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.yxt.yyth.biz.empreserveordergoods;
|
||||
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.yyth.api.empreserveordergoods.EmpReserveOrderGoodsDto;
|
||||
import io.swagger.annotations.Api;
|
||||
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.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/23 10:35
|
||||
*/
|
||||
@Api(tags = "预约订单信息")
|
||||
@RestController
|
||||
@RequestMapping("empsreservoorder")
|
||||
public class EmpReserveOrderGoodsRest {
|
||||
@Autowired
|
||||
EmpReserveOrderGoodsService empReserveOrderGoodsService;
|
||||
|
||||
|
||||
// @ApiOperation("预约提交")
|
||||
// @PostMapping("/submissionDetail")
|
||||
// public ResultBean submissionDetail(EmpReserveOrderGoodsDto dto){
|
||||
// return empReserveOrderGoodsService.submissionDetail(dto);
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.yxt.yyth.biz.empreserveordergoods;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.yyth.api.empcardgift.EmpGiftAppletVo;
|
||||
import com.yxt.yyth.api.empreserveorder.EmpReserveOrderDto;
|
||||
import com.yxt.yyth.api.empreserveordergoods.EmpReserveOrderGoods;
|
||||
import com.yxt.yyth.api.lpkgiftcard.AppletVo;
|
||||
import com.yxt.yyth.api.empcardgift.GoodsVo;
|
||||
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderDto;
|
||||
import com.yxt.yyth.biz.empcardgift.EmpCardGiftService;
|
||||
import com.yxt.yyth.biz.lpkgiftcard.LpkGiftCardService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/23 10:36
|
||||
*/
|
||||
@Service
|
||||
public class EmpReserveOrderGoodsService extends MybatisBaseService<EmpReserveOrderGoodsMapper, EmpReserveOrderGoods> {
|
||||
@Autowired
|
||||
EmpCardGiftService empCardGiftService;
|
||||
public ResultBean<EmpReserveOrderGoods> getReserveByCardSid(String carSid, String goodsSid) {
|
||||
ResultBean rb = new ResultBean();
|
||||
EmpReserveOrderGoods goods = baseMapper.getReserveByCardSid(carSid, goodsSid);
|
||||
return rb.success().setData(goods);
|
||||
}
|
||||
|
||||
public ResultBean submissionDetail(EmpReserveOrderDto dto) {
|
||||
ResultBean rb = new ResultBean();
|
||||
EmpReserveOrderGoods goods = new EmpReserveOrderGoods();
|
||||
BeanUtil.copyProperties(dto, goods, "id", "sid");
|
||||
goods.setCardSid(dto.getSid());
|
||||
for (GoodsVo goods1 : dto.getGoodsVos()) {
|
||||
if (goods1.getSelect() != 0) {
|
||||
goods.setCardSid(dto.getSid());
|
||||
goods.setGoodsSid(goods1.getGoodsSid());
|
||||
goods.setGoodsNumber(goods1.getSelect());
|
||||
goods.setCreateTime(new DateTime());
|
||||
baseMapper.insert(goods);
|
||||
}
|
||||
}
|
||||
EmpGiftAppletVo vo = empCardGiftService.getGifCardBySid(dto.getSid()).getData();
|
||||
int i = 0;
|
||||
for (GoodsVo vo1 : vo.getGoodsVos()) {
|
||||
EmpReserveOrderGoods goods1 = baseMapper.getReserveByCardSid(dto.getSid(), vo1.getGoodsSid());
|
||||
if (null != goods1) {
|
||||
if (vo1.getNum() <= goods1.getGoodsNumber()) {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
if (vo.getGoodsVos().size() == i) {
|
||||
empCardGiftService.changState(dto.getSid(), "5");
|
||||
} else {
|
||||
empCardGiftService.changState(dto.getSid(), "4");
|
||||
}
|
||||
}
|
||||
return rb.success().setData("预约成功");
|
||||
}
|
||||
|
||||
public EmpReserveOrderGoods selByOrderSidAndGoodSid(String orderSid, String goodsSid) {
|
||||
return baseMapper.selByOrderSidAndGoodSid(orderSid,goodsSid);
|
||||
}
|
||||
public List<EmpReserveOrderGoods> selByOrderSid(String orderSid) {
|
||||
return baseMapper.selByOrderSid(orderSid);
|
||||
}
|
||||
public List<EmpReserveOrderGoods> selInOrderSid(List<String> orderSids) {
|
||||
return baseMapper.selInOrderSid(orderSids);
|
||||
}
|
||||
public List<EmpReserveOrderGoods> selByOrderSids(String orderSid) {
|
||||
return baseMapper.selByOrderSids(orderSid);
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,8 @@ public interface LpkGiftBagGoodsMapper extends BaseMapper<LpkGiftBagGoods> {
|
||||
|
||||
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 lpk_giftbag_goods bads left join lpk_goods goods on goods.sid =bads.goodsSid where bads.giftbagSid=#{sid}")
|
||||
@Select("select goods.name as goodsName,bads.goodsNumber ,bads.goodsSid,goods.picUrl,goods.price,goods.unitName,goods.remarks " +
|
||||
" from lpk_giftbag_goods bads left join lpk_goods goods on goods.sid =bads.goodsSid where bads.giftbagSid=#{sid}")
|
||||
List<LpkGiftBagGoodsVo> getGoodsByBagSid(String sid);
|
||||
List<LpkGiftBagGoods> getRecordsByBagSid(@Param("sid") String sid);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderVo;
|
||||
import com.yxt.yyth.api.lpkreserveordergoods.LpkReserveOrderGoods;
|
||||
import com.yxt.yyth.api.lpkstore.LpkStoreDetailsVo;
|
||||
import com.yxt.yyth.api.lpkstore.StoreSelect;
|
||||
import com.yxt.yyth.biz.empcardgift.EmpCardGiftService;
|
||||
import com.yxt.yyth.biz.lpkcardbuildrecord.LpkCardBuildRecordService;
|
||||
import com.yxt.yyth.biz.lpkcardgrantrecord.LpkCardGrantRecordService;
|
||||
import com.yxt.yyth.biz.lpkcardqrcode.LpkCardQrcodeService;
|
||||
@@ -84,10 +85,17 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
||||
@Autowired
|
||||
LpkGoodsService lpkGoodsService;
|
||||
@Autowired
|
||||
EmpCardGiftService empCardGiftService;
|
||||
@Autowired
|
||||
LpkCardQrcodeService lpkCardQrcodeService;
|
||||
|
||||
public ResultBean bindCard(BindCardDto bindCardDto) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
LpkGiftCard lpkGiftCard1 = baseMapper.selectOne(new QueryWrapper<LpkGiftCard>().eq("code", bindCardDto.getCode()));
|
||||
if(null==lpkGiftCard1){
|
||||
ResultBean rb1=empCardGiftService.bindCard(bindCardDto);
|
||||
return rb1;
|
||||
}
|
||||
LpkGiftCard lpkGiftCard = baseMapper.selectOne(new QueryWrapper<LpkGiftCard>().eq("code", bindCardDto.getCode())
|
||||
.eq("codeKey", bindCardDto.getCodeKey()));
|
||||
if (null == lpkGiftCard) {
|
||||
|
||||
@@ -75,6 +75,20 @@
|
||||
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
|
||||
UNION
|
||||
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 emp_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
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
|
||||
@@ -73,4 +73,9 @@ public class LpkReserveOrderRest {
|
||||
public void exportExcelByStore(@RequestBody LpkReserveOrderQuery query) {
|
||||
lpkReserveOrderService.exportExcelByStore(query);
|
||||
}
|
||||
@ApiOperation(value = "预约订单支行汇总导出")
|
||||
@PostMapping("/exportExcelByStore")
|
||||
public void exportExcelByBank(@RequestBody LpkReserveOrderQuery query) {
|
||||
lpkReserveOrderService.exportExcelByBank(query);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,9 @@ package com.yxt.yyth.biz.lpkreserveorder;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
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.yxt.common.base.config.component.FileUploadComponent;
|
||||
@@ -17,8 +19,6 @@ import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.yyth.api.lpkgiftbaggoods.LpkGiftBagGoodsVo;
|
||||
import com.yxt.yyth.api.lpkgiftcard.AppletVo;
|
||||
import com.yxt.yyth.api.lpkgiftcard.GoodsVo;
|
||||
import com.yxt.yyth.api.lpkgiftcard.LpkGiftCard;
|
||||
import com.yxt.yyth.api.lpkgiftcard.LpkGiftCardExport;
|
||||
import com.yxt.yyth.api.lpkgoods.LpkGoods;
|
||||
import com.yxt.yyth.api.lpkreserveorder.*;
|
||||
import com.yxt.yyth.api.lpkreserveordergoods.LpkReserveOrderGoods;
|
||||
@@ -29,16 +29,15 @@ import com.yxt.yyth.biz.lpkgiftcard.LpkGiftCardMapper;
|
||||
import com.yxt.yyth.biz.lpkgoods.LpkGoodsService;
|
||||
import com.yxt.yyth.biz.lpkreserveordergoods.LpkReserveOrderGoodsService;
|
||||
import com.yxt.yyth.biz.lpkstore.LpkStoreService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.collections.list.AbstractLinkedList;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
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.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
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;
|
||||
@@ -130,7 +129,7 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa
|
||||
}
|
||||
|
||||
|
||||
qw.orderByDesc("o.createTime");
|
||||
qw.orderByDesc("o.reserveDate");
|
||||
IPage<LpkReserveOrder> page = PagerUtil.queryToPage(pq);
|
||||
IPage<LpkReserveOrderVo> pagging = baseMapper.orderList(page, qw);
|
||||
List<LpkReserveOrderVo> records = pagging.getRecords();
|
||||
@@ -183,7 +182,8 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa
|
||||
qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(endDate), "date_format (o.reserveDate,'%Y-%m-%d') <= date_format('" + endDate + "','%Y-%m-%d')");
|
||||
}
|
||||
|
||||
qw.orderByDesc("o.createTime");
|
||||
qw.orderByDesc("o.reserveDate");
|
||||
qw.groupBy("s.name");
|
||||
IPage<LpkReserveOrder> page = PagerUtil.queryToPage(pq);
|
||||
IPage<LpkReserveOrderVo> pagging = baseMapper.orderListByStore(page, qw);
|
||||
List<LpkReserveOrderVo> records = pagging.getRecords();
|
||||
@@ -191,6 +191,7 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa
|
||||
records.forEach(s -> {
|
||||
List<String> list=baseMapper.getOrderByStore(s.getStoreSid());
|
||||
List<LpkReserveOrderGoods> orderGoods = lpkReserveOrderGoodsService.selInOrderSid(list);
|
||||
List<String> a=new ArrayList<>();
|
||||
if (!orderGoods.isEmpty()) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
for (LpkReserveOrderGoods orderGood : orderGoods) {
|
||||
@@ -210,14 +211,16 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa
|
||||
if (orderGood.getGoodsNumber() != 0) {
|
||||
num = String.valueOf((int) orderGood.getGoodsNumber());
|
||||
}
|
||||
finWord = num + unitName + goodsName;
|
||||
sb.append(finWord).append("、");
|
||||
finWord = goodsName + num + unitName ;
|
||||
a.add(finWord);
|
||||
// sb.append(finWord).append("、");
|
||||
}
|
||||
if (sb.length() > 0) {
|
||||
sb.delete(sb.length() - 1, sb.length());
|
||||
s.setGoodsInfo(sb.toString());
|
||||
}
|
||||
}
|
||||
s.setGoods(a);
|
||||
});
|
||||
}
|
||||
PagerVo<LpkReserveOrderVo> p = PagerUtil.pageToVo(pagging, null);
|
||||
@@ -327,6 +330,7 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa
|
||||
qw.orderByDesc("o.createTime");
|
||||
//得到所有要导出的数据
|
||||
List<ReserveOrderExport> exportList = baseMapper.exportExcel(qw);
|
||||
List<ReserveOrderExport> exportList1 = new ArrayList<>();
|
||||
if (!exportList.isEmpty()) {
|
||||
exportList.forEach(s -> {
|
||||
if (StringUtils.isNotBlank(s.getUserPhone())) {
|
||||
@@ -336,7 +340,7 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa
|
||||
}
|
||||
List<LpkReserveOrderGoods> orderGoods = lpkReserveOrderGoodsService.selByOrderSid(s.getSid());
|
||||
if (!orderGoods.isEmpty()) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
int i=0;
|
||||
for (LpkReserveOrderGoods orderGood : orderGoods) {
|
||||
String num = "";
|
||||
String goodsName = "";
|
||||
@@ -354,27 +358,50 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa
|
||||
if (orderGood.getGoodsNumber() != 0) {
|
||||
num = String.valueOf((int) orderGood.getGoodsNumber());
|
||||
}
|
||||
finWord = num + unitName + goodsName;
|
||||
sb.append(finWord).append("、");
|
||||
finWord = goodsName+num + unitName ;
|
||||
i++;
|
||||
if(i>1){
|
||||
ReserveOrderExport en=new ReserveOrderExport();
|
||||
BeanUtil.copyProperties(s,en , "id");
|
||||
en.setGoodsInfo(finWord);
|
||||
exportList1.add(en);
|
||||
}else{
|
||||
s.setGoodsInfo(finWord);
|
||||
exportList1.add(s);
|
||||
}
|
||||
if (sb.length() > 0) {
|
||||
sb.delete(sb.length() - 1, sb.length());
|
||||
s.setGoodsInfo(sb.toString());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
//定义导出的excel名字
|
||||
String excelName = "1";
|
||||
//定义导出的excel名字
|
||||
String excelName = "订单明细.xlsx";
|
||||
String fileNameURL = "1";
|
||||
// try {
|
||||
// fileNameURL = URLEncoder.encode(excelName, "UTF-8");
|
||||
// fileNameURL = URLEncoder.encode(excelName, "UTF-8");
|
||||
// } catch (UnsupportedEncodingException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
//导出预约订单信息列表
|
||||
ExportExcelUtils.export(fileNameURL, exportList, ReserveOrderExport.class, response);
|
||||
response.setContentType( "application/vnd.ms-excel");
|
||||
response.setCharacterEncoding("utf8");
|
||||
response.setHeader("Content-disposition","attachment;filename="+ excelName );
|
||||
ServletOutputStream outputStream = null;
|
||||
try {
|
||||
WriteCellStyle headWriteCellStyle = new WriteCellStyle();
|
||||
|
||||
//设置头居中
|
||||
headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
|
||||
|
||||
//内容策略
|
||||
WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
|
||||
//设置 水平居中
|
||||
contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
|
||||
HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle,contentWriteCellStyle);
|
||||
|
||||
EasyExcel//将数据映射到DownloadDTO实体类并响应到浏览器
|
||||
.write(new BufferedOutputStream(response.getOutputStream()), ReserveOrderExport.class)
|
||||
//是否自动关闭输入流
|
||||
.autoCloseStream(Boolean.TRUE)
|
||||
.registerWriteHandler(new MergeStrategy(exportList1.size(),1,5)).registerWriteHandler(horizontalCellStyleStrategy)
|
||||
.sheet().doWrite(exportList1);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
public void exportExcelByStore(LpkReserveOrderQuery query) {
|
||||
QueryWrapper<LpkReserveOrderQuery> qw = new QueryWrapper<>();
|
||||
@@ -394,12 +421,13 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa
|
||||
qw.groupBy("s.name");
|
||||
//得到所有要导出的数据
|
||||
List<ReserveOrderExportByStore> exportList = baseMapper.exportExcelByStore(qw);
|
||||
List<ReserveOrderExportByStore> exportList1 = new ArrayList<>();
|
||||
if (!exportList.isEmpty()) {
|
||||
exportList.forEach(s -> {
|
||||
List<String> list=baseMapper.getOrderByStore(s.getStoreSid());
|
||||
List<LpkReserveOrderGoods> orderGoods = lpkReserveOrderGoodsService.selInOrderSid(list);
|
||||
if (!orderGoods.isEmpty()) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
int i=0;
|
||||
for (LpkReserveOrderGoods orderGood : orderGoods) {
|
||||
String num = "";
|
||||
String goodsName = "";
|
||||
@@ -417,23 +445,139 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa
|
||||
if (orderGood.getGoodsNumber() != 0) {
|
||||
num = String.valueOf((int) orderGood.getGoodsNumber());
|
||||
}
|
||||
finWord = num + unitName + goodsName;
|
||||
sb.append(finWord).append("、");
|
||||
finWord = goodsName+ num + unitName;
|
||||
i++;
|
||||
if(i>1){
|
||||
ReserveOrderExportByStore en=new ReserveOrderExportByStore();
|
||||
BeanUtil.copyProperties(s,en , "id");
|
||||
en.setGoodsInfo(finWord);
|
||||
exportList1.add(en);
|
||||
}else{
|
||||
s.setGoodsInfo(finWord);
|
||||
exportList1.add(s);
|
||||
}
|
||||
if (sb.length() > 0) {
|
||||
sb.delete(sb.length() - 1, sb.length());
|
||||
s.setGoodsInfo(sb.toString());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
//定义导出的excel名字
|
||||
String excelName = "1";
|
||||
String excelName = "配货信息.xlsx";
|
||||
String fileNameURL = "1";
|
||||
//导出预约订单信息列表
|
||||
ExportExcelUtils.export(fileNameURL, exportList, ReserveOrderExportByStore.class, response);
|
||||
}
|
||||
response.setContentType( "application/vnd.ms-excel");
|
||||
response.setCharacterEncoding("utf8");
|
||||
response.setHeader("Content-disposition","attachment;filename="+ excelName );
|
||||
ServletOutputStream outputStream = null;
|
||||
try {
|
||||
WriteCellStyle headWriteCellStyle = new WriteCellStyle();
|
||||
|
||||
//设置头居中
|
||||
headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
|
||||
|
||||
//内容策略
|
||||
WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
|
||||
//设置 水平居中
|
||||
contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
|
||||
HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle,contentWriteCellStyle);
|
||||
|
||||
EasyExcel//将数据映射到DownloadDTO实体类并响应到浏览器
|
||||
.write(new BufferedOutputStream(response.getOutputStream()), ReserveOrderExportByStore.class)
|
||||
//是否自动关闭输入流
|
||||
.autoCloseStream(Boolean.TRUE)
|
||||
.registerWriteHandler(new MergeStrategy(exportList1.size(),1,1)).registerWriteHandler(horizontalCellStyleStrategy)
|
||||
.sheet().doWrite(exportList1);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
public void exportExcelByBank(LpkReserveOrderQuery query) {
|
||||
QueryWrapper<LpkReserveOrderQuery> qw = new QueryWrapper<>();
|
||||
qw.eq("1", "1");
|
||||
if (StringUtils.isNotBlank(query.getStartDate())) {
|
||||
String startDate = query.getStartDate();
|
||||
qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(startDate), "date_format (o.reserveDate,'%Y-%m-%d') >= date_format('" + startDate + "','%Y-%m-%d')");
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getEndDate())) {
|
||||
String endDate = query.getEndDate();
|
||||
qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(endDate), "date_format (o.reserveDate,'%Y-%m-%d') <= date_format('" + endDate + "','%Y-%m-%d')");
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getStore())) {
|
||||
qw.like("s.name", query.getStore());
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getBankSid())) {
|
||||
qw.like("s.bankSid", query.getBankSid());
|
||||
}
|
||||
qw.orderByDesc("o.createTime");
|
||||
qw.groupBy("s.name");
|
||||
//得到所有要导出的数据
|
||||
List<ReserveOrderExportByStore> exportList = baseMapper.exportExcelByStore(qw);
|
||||
List<ReserveOrderExportByStore> exportList1 = new ArrayList<>();
|
||||
if (!exportList.isEmpty()) {
|
||||
exportList.forEach(s -> {
|
||||
List<String> list=baseMapper.getOrderByStore(s.getStoreSid());
|
||||
List<LpkReserveOrderGoods> orderGoods = lpkReserveOrderGoodsService.selInOrderSid(list);
|
||||
if (!orderGoods.isEmpty()) {
|
||||
int i=0;
|
||||
for (LpkReserveOrderGoods orderGood : orderGoods) {
|
||||
String num = "";
|
||||
String goodsName = "";
|
||||
String finWord = "";
|
||||
String unitName = "";
|
||||
if (StringUtils.isNotBlank(orderGood.getGoodsSid())) {
|
||||
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(orderGood.getGoodsSid());
|
||||
if (null != lpkGoods) {
|
||||
goodsName = lpkGoods.getName();
|
||||
if (StringUtils.isNotBlank(lpkGoods.getUnitName())) {
|
||||
unitName = lpkGoods.getUnitName();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (orderGood.getGoodsNumber() != 0) {
|
||||
num = String.valueOf((int) orderGood.getGoodsNumber());
|
||||
}
|
||||
finWord = goodsName+ num + unitName;
|
||||
i++;
|
||||
if(i>1){
|
||||
ReserveOrderExportByStore en=new ReserveOrderExportByStore();
|
||||
BeanUtil.copyProperties(s,en , "id");
|
||||
en.setGoodsInfo(finWord);
|
||||
exportList1.add(en);
|
||||
}else{
|
||||
s.setGoodsInfo(finWord);
|
||||
exportList1.add(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
//定义导出的excel名字
|
||||
String excelName = "配货信息.xlsx";
|
||||
String fileNameURL = "1";
|
||||
response.setContentType( "application/vnd.ms-excel");
|
||||
response.setCharacterEncoding("utf8");
|
||||
response.setHeader("Content-disposition","attachment;filename="+ excelName );
|
||||
ServletOutputStream outputStream = null;
|
||||
try {
|
||||
WriteCellStyle headWriteCellStyle = new WriteCellStyle();
|
||||
|
||||
//设置头居中
|
||||
headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
|
||||
|
||||
//内容策略
|
||||
WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
|
||||
//设置 水平居中
|
||||
contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
|
||||
HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle,contentWriteCellStyle);
|
||||
|
||||
EasyExcel//将数据映射到DownloadDTO实体类并响应到浏览器
|
||||
.write(new BufferedOutputStream(response.getOutputStream()), ReserveOrderExportByStore.class)
|
||||
//是否自动关闭输入流
|
||||
.autoCloseStream(Boolean.TRUE)
|
||||
.registerWriteHandler(new MergeStrategy(exportList1.size(),1,1)).registerWriteHandler(horizontalCellStyleStrategy)
|
||||
.sheet().doWrite(exportList1);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public ResultBean<LpkReserveOrderVo> getStoreByCustomerSid(String sid) {
|
||||
return new ResultBean().success().setData(baseMapper.getStoreByCustomerSid(sid));
|
||||
|
||||
@@ -26,11 +26,12 @@
|
||||
and goodsSid = #{goodsSid}
|
||||
</select>
|
||||
<select id="selInOrderSid" resultType="com.yxt.yyth.api.lpkreserveordergoods.LpkReserveOrderGoods">
|
||||
select s.*
|
||||
select s.sid,s.createTime,s.remarks,s.cardSid,s.goodsSid,s.orderSid,sum(s.goodsNumber) as goodsNumber
|
||||
from lpk_reserve_order_goods s
|
||||
where orderSid in
|
||||
<foreach collection="orderSids" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
GROUP BY s.goodsSid
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -28,4 +28,6 @@ public interface LpkStoreMapper extends BaseMapper<LpkStore> {
|
||||
List<LpkStoreVo> getAllStoreByQuery(@Param(Constants.WRAPPER) QueryWrapper<LpkStore> qw);
|
||||
@Select("select sid as value,name as text from lpk_store where isEnable=1")
|
||||
List<StoreSelect> getSelectStore();
|
||||
|
||||
LpkStoreVo storeInit(@Param("sid") String sid);
|
||||
}
|
||||
|
||||
@@ -6,16 +6,17 @@
|
||||
|
||||
<select id="storeListPage" resultType="com.yxt.yyth.api.lpkstore.LpkStoreVo">
|
||||
select
|
||||
sid,
|
||||
date_format(createTime, '%Y-%m-%d') as createTime,
|
||||
code,
|
||||
`name`,
|
||||
address,
|
||||
phone,
|
||||
businessHours,
|
||||
isEnable,
|
||||
sort
|
||||
from lpk_store
|
||||
st.sid,
|
||||
date_format(st.createTime, '%Y-%m-%d') as createTime,
|
||||
st.code,
|
||||
st.name,
|
||||
st.address,
|
||||
st.phone,
|
||||
st.businessHours,
|
||||
st.isEnable,
|
||||
st.sort,
|
||||
bk.name as bankName
|
||||
from lpk_store st left join lpk_bank bk on bk.sid =st.bankSid
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
@@ -28,4 +29,20 @@
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
</select>
|
||||
<select id="storeInit" resultType="com.yxt.yyth.api.lpkstore.LpkStoreVo">
|
||||
select
|
||||
st.sid,
|
||||
date_format(st.createTime, '%Y-%m-%d') as createTime,
|
||||
st.code,
|
||||
st.name,
|
||||
st.address,
|
||||
st.phone,
|
||||
st.businessHours,
|
||||
st.isEnable,
|
||||
st.sort,
|
||||
bk.name as bankName,bk.sid as bankSid
|
||||
from lpk_store st left join lpk_bank bk on bk.sid =st.bankSid
|
||||
where
|
||||
st.sid=#{sid}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -55,14 +55,9 @@ public class LpkStoreService extends MybatisBaseService<LpkStoreMapper, LpkStore
|
||||
|
||||
public ResultBean<LpkStoreDetailsVo> storeInit(String sid) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
LpkStoreDetailsVo vo = new LpkStoreDetailsVo();
|
||||
LpkStore lpkStore = fetchBySid(sid);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
if (null != lpkStore) {
|
||||
BeanUtil.copyProperties(lpkStore, vo);
|
||||
vo.setCreateTime(sdf.format(lpkStore.getCreateTime()));
|
||||
}
|
||||
return rb.success().setData(vo);
|
||||
LpkStoreVo lpkStore = baseMapper.storeInit(sid);
|
||||
|
||||
return rb.success().setData(lpkStore);
|
||||
}
|
||||
|
||||
public ResultBean deleteStore(String sid) {
|
||||
|
||||
Reference in New Issue
Block a user