1/9
This commit is contained in:
105
src/main/java/com/yxt/yyth/api/empcard/EmpAppletNewVo.java
Normal file
105
src/main/java/com/yxt/yyth/api/empcard/EmpAppletNewVo.java
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
package com.yxt.yyth.api.empcard;
|
||||||
|
|
||||||
|
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.EmpCardGiftVo;
|
||||||
|
import com.yxt.yyth.api.lpkgiftcard.GoodsVo;
|
||||||
|
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 2024/1/9 15:26
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class EmpAppletNewVo {
|
||||||
|
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<EmpCardGiftVo> empCardGiftVos;
|
||||||
|
private String value;
|
||||||
|
private String serialNumber;
|
||||||
|
private String giftCode;
|
||||||
|
private String giftCodeKey;
|
||||||
|
private String qrCode;
|
||||||
|
private List<LpkReserveOrderCardVo> orderCardVoList;
|
||||||
|
private String isTransfer;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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 if(isTransfer.equals("1")){
|
||||||
|
state="已转赠";
|
||||||
|
showBtn=false;
|
||||||
|
this.notRese=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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
106
src/main/java/com/yxt/yyth/api/empcardgift/EmpGiftAppletNVo.java
Normal file
106
src/main/java/com/yxt/yyth/api/empcardgift/EmpGiftAppletNVo.java
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
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.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 2024/1/9 15:29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class EmpGiftAppletNVo {
|
||||||
|
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<LpkReserveOrderCardVo> orderCardVoList;
|
||||||
|
private List<EmpCardGift> empCardGifts;
|
||||||
|
private String value;
|
||||||
|
private String serialNumber;
|
||||||
|
private String isEnable;
|
||||||
|
private String isTransfer;//是否转增 0 未转赠 1 转赠
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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 if(isEnable.equals("2")){
|
||||||
|
state="已作废";
|
||||||
|
showBtn=false;
|
||||||
|
}
|
||||||
|
else if(isTransfer.equals("1")){
|
||||||
|
state="已转赠";
|
||||||
|
showBtn=false;
|
||||||
|
this.notRese=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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -8,13 +8,13 @@ import lombok.Data;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class LpkGifGoodsVo {
|
public class LpkGifGoodsVo {
|
||||||
private String goodsName;
|
private String goodsName;//商品名
|
||||||
private String goodsSid;
|
private String goodsSid;
|
||||||
private double goodsNumber;
|
private double goodsNumber;
|
||||||
private double residue;
|
private double residue;
|
||||||
private String unitName;
|
private String unitName;
|
||||||
private String specificationUnit;
|
private String specificationUnit;
|
||||||
private String weight;
|
private String weight;
|
||||||
private String remarks;
|
private String remarks; //5斤每份
|
||||||
private String content;
|
private String content;//剩余
|
||||||
}
|
}
|
||||||
|
|||||||
108
src/main/java/com/yxt/yyth/api/lpkgiftcard/AppletNewVo.java
Normal file
108
src/main/java/com/yxt/yyth/api/lpkgiftcard/AppletNewVo.java
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
package com.yxt.yyth.api.lpkgiftcard;
|
||||||
|
|
||||||
|
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.EmpCardGift;
|
||||||
|
import com.yxt.yyth.api.lpkgiftbaggoods.LpkGifGoodsVo;
|
||||||
|
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 2024/1/9 15:24
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class AppletNewVo {
|
||||||
|
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<LpkReserveOrderCardVo> orderCardVoList;
|
||||||
|
private List<EmpCardGift> empCardGifts;
|
||||||
|
private String value;
|
||||||
|
private String serialNumber;
|
||||||
|
private String goods;
|
||||||
|
private String isEnable;
|
||||||
|
private String isTransfer;//是否转增 0 未转赠 1 转赠
|
||||||
|
private String type;//是否转增 1亲情卡 2家庭 3 企业
|
||||||
|
private String logo;//查询标识 1亲情卡 2家庭 3 企业
|
||||||
|
private List<LpkGifGoodsVo> list;
|
||||||
|
|
||||||
|
|
||||||
|
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 if(isEnable.equals("2")){
|
||||||
|
state="已作废";
|
||||||
|
showBtn=false;
|
||||||
|
}
|
||||||
|
else if(isTransfer.equals("1")){
|
||||||
|
state="已转赠";
|
||||||
|
showBtn=false;
|
||||||
|
this.notRese=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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil;
|
|||||||
import com.yxt.common.base.utils.StringUtils;
|
import com.yxt.common.base.utils.StringUtils;
|
||||||
import com.yxt.yyth.api.empcardgift.EmpCardGift;
|
import com.yxt.yyth.api.empcardgift.EmpCardGift;
|
||||||
import com.yxt.yyth.api.empcardgift.EmpCardGiftVo;
|
import com.yxt.yyth.api.empcardgift.EmpCardGiftVo;
|
||||||
|
import com.yxt.yyth.api.lpkgiftbaggoods.LpkGifGoodsVo;
|
||||||
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderCardVo;
|
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderCardVo;
|
||||||
import com.yxt.yyth.api.lpkstore.StoreSelect;
|
import com.yxt.yyth.api.lpkstore.StoreSelect;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -34,7 +35,7 @@ public class AppletVo {
|
|||||||
private boolean showBtn=true;
|
private boolean showBtn=true;
|
||||||
private boolean showRecord=true;
|
private boolean showRecord=true;
|
||||||
private String time;
|
private String time;
|
||||||
private String name="卡号:";
|
private String name="窖号:";
|
||||||
private String pName;
|
private String pName;
|
||||||
private String start;
|
private String start;
|
||||||
private String end;
|
private String end;
|
||||||
@@ -55,6 +56,7 @@ public class AppletVo {
|
|||||||
private String isTransfer;//是否转增 0 未转赠 1 转赠
|
private String isTransfer;//是否转增 0 未转赠 1 转赠
|
||||||
private String type;//是否转增 1亲情卡 2家庭 3 企业
|
private String type;//是否转增 1亲情卡 2家庭 3 企业
|
||||||
private String logo;//查询标识 1亲情卡 2家庭 3 企业
|
private String logo;//查询标识 1亲情卡 2家庭 3 企业
|
||||||
|
private List<LpkGifGoodsVo> list;
|
||||||
|
|
||||||
public String getStart() {
|
public String getStart() {
|
||||||
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ public interface EmpCardMapper extends BaseMapper<EmpCard> {
|
|||||||
IPage<EmpCardVo> recordDetails(IPage<EmpCard> page, @Param(Constants.WRAPPER) QueryWrapper<EmpCard> qw);
|
IPage<EmpCardVo> recordDetails(IPage<EmpCard> page, @Param(Constants.WRAPPER) QueryWrapper<EmpCard> qw);
|
||||||
|
|
||||||
EmpAppletVo getEmpCardBySid(@Param("sid") String sid);
|
EmpAppletVo getEmpCardBySid(@Param("sid") String sid);
|
||||||
|
EmpAppletNewVo getEmpCardsBySid(@Param("sid") String sid);
|
||||||
|
|
||||||
List<EmpCardExport> exportExcel(@Param(Constants.WRAPPER) QueryWrapper<LpkGiftCard> qw);
|
List<EmpCardExport> exportExcel(@Param(Constants.WRAPPER) QueryWrapper<LpkGiftCard> qw);
|
||||||
@Select("select count(id) from emp_card where recordSid=#{recordSid} and grantRecordSid is not null")
|
@Select("select count(id) from emp_card where recordSid=#{recordSid} and grantRecordSid is not null")
|
||||||
|
|||||||
@@ -103,6 +103,27 @@
|
|||||||
LEFT JOIN lpk_giftbag bag ON card.giftbagSid = bag.sid
|
LEFT JOIN lpk_giftbag bag ON card.giftbagSid = bag.sid
|
||||||
where card.sid = #{sid}
|
where card.sid = #{sid}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getEmpCardsBySid" resultType="com.yxt.yyth.api.empcard.EmpAppletNewVo">
|
||||||
|
SELECT card.*,
|
||||||
|
CASE
|
||||||
|
card.state
|
||||||
|
WHEN 3 THEN
|
||||||
|
'未提货'
|
||||||
|
WHEN 4 THEN
|
||||||
|
'已经预约提货(预约部分提货)'
|
||||||
|
WHEN 5 THEN
|
||||||
|
'已经提取完成'
|
||||||
|
END stateValue,
|
||||||
|
bag.dateStart AS dateStart,
|
||||||
|
bag.dateEnd AS dateEnd,
|
||||||
|
bag.NAME AS pname,
|
||||||
|
card.state AS states,
|
||||||
|
card.serialNumber AS serialNumber,
|
||||||
|
card.isTransfer as isTransfer
|
||||||
|
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 id="getEmpCardByCustomerSid" resultType="com.yxt.yyth.api.empcard.EmpAppletVo">
|
||||||
SELECT
|
SELECT
|
||||||
card.*,
|
card.*,
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import com.yxt.yyth.api.empcardgift.EmpCardGiftVo;
|
|||||||
import com.yxt.yyth.api.empcardgiftgoods.EmpCardGiftGoodsVo;
|
import com.yxt.yyth.api.empcardgiftgoods.EmpCardGiftGoodsVo;
|
||||||
import com.yxt.yyth.api.empcardgrantlog.EmpCardGrantLogVo;
|
import com.yxt.yyth.api.empcardgrantlog.EmpCardGrantLogVo;
|
||||||
import com.yxt.yyth.api.empreserveorder.EmpReserveOrder;
|
import com.yxt.yyth.api.empreserveorder.EmpReserveOrder;
|
||||||
|
import com.yxt.yyth.api.lpkgiftbaggoods.LpkGifGoodsVo;
|
||||||
import com.yxt.yyth.api.lpkgiftbaggoods.LpkGiftBagGoodsVo;
|
import com.yxt.yyth.api.lpkgiftbaggoods.LpkGiftBagGoodsVo;
|
||||||
import com.yxt.yyth.api.lpkgiftcard.*;
|
import com.yxt.yyth.api.lpkgiftcard.*;
|
||||||
import com.yxt.yyth.api.lpkgoods.LpkGoods;
|
import com.yxt.yyth.api.lpkgoods.LpkGoods;
|
||||||
@@ -322,6 +323,44 @@ public class EmpCardService extends MybatisBaseService<EmpCardMapper, EmpCard> {
|
|||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
return rb.success().setData(p);
|
return rb.success().setData(p);
|
||||||
}
|
}
|
||||||
|
public ResultBean<List<LpkGifGoodsVo>> getEmpCardsBySid(String sid) {
|
||||||
|
ResultBean rb = new ResultBean().fail();
|
||||||
|
EmpAppletNewVo vo = baseMapper.getEmpCardsBySid(sid);
|
||||||
|
List<LpkGifGoodsVo> list=lpkGiftBagGoodsService.getGoodsByEmpGiftSid(sid);
|
||||||
|
List<LpkGifGoodsVo> list1=new ArrayList<>();
|
||||||
|
list.forEach(s -> {
|
||||||
|
LpkGifGoodsVo g=new LpkGifGoodsVo();
|
||||||
|
EmpCardGiftVo goods = empCardGiftService.getEmpCardGoods(vo.getSid(), s.getGoodsSid()).getData();
|
||||||
|
LpkReserveOrderGoods goodsOne = lpkReserveOrderGoodsService.getReserveByCardSid(vo.getSid(), s.getGoodsSid()).getData();
|
||||||
|
GoodsVo goodsVo = new GoodsVo();
|
||||||
|
if (vo.getState().equals("已过期")) {
|
||||||
|
goodsVo.setLNum(0);
|
||||||
|
} else if (!vo.isShowBtn()) {
|
||||||
|
goodsVo.setLNum(0);
|
||||||
|
} else {
|
||||||
|
if (null != goods && null != goodsOne) {
|
||||||
|
if ((goods.getGoodsNumber()+goodsOne.getGoodsNumber()) != s.getGoodsNumber()) {
|
||||||
|
goodsVo.setLNum(s.getGoodsNumber() - goods.getGoodsNumber()- goodsOne.getGoodsNumber());
|
||||||
|
}
|
||||||
|
} else if(null != goodsOne){
|
||||||
|
if (goodsOne.getGoodsNumber() != s.getGoodsNumber()) {
|
||||||
|
goodsVo.setLNum(s.getGoodsNumber()- goodsOne.getGoodsNumber());
|
||||||
|
}
|
||||||
|
}else if(null != goods){
|
||||||
|
if (goods.getGoodsNumber() != s.getGoodsNumber()) {
|
||||||
|
goodsVo.setLNum(s.getGoodsNumber() - goods.getGoodsNumber());
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
goodsVo.setLNum(s.getGoodsNumber());
|
||||||
|
}
|
||||||
|
g.setContent("剩余"+goodsVo.getLNum()+"份/"+"共"+s.getGoodsNumber()+"份");
|
||||||
|
g.setRemarks(s.getWeight()+s.getSpecificationUnit()+"/"+s.getUnitName());
|
||||||
|
g.setGoodsName(s.getGoodsName());
|
||||||
|
list1.add(g);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return rb.success().setData(list1);
|
||||||
|
}
|
||||||
public ResultBean<EmpAppletVo> getEmpCardBySid(String sid) {
|
public ResultBean<EmpAppletVo> getEmpCardBySid(String sid) {
|
||||||
ResultBean rb = new ResultBean().fail();
|
ResultBean rb = new ResultBean().fail();
|
||||||
EmpAppletVo vo = baseMapper.getEmpCardBySid(sid);
|
EmpAppletVo vo = baseMapper.getEmpCardBySid(sid);
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ public interface EmpCardGiftMapper extends BaseMapper<EmpCardGift> {
|
|||||||
IPage<EmpGiftAppletVo> getGifCardByCustomerSid(IPage<EmpCardGift> page, @Param(Constants.WRAPPER) QueryWrapper<EmpCardGift> qw);
|
IPage<EmpGiftAppletVo> getGifCardByCustomerSid(IPage<EmpCardGift> page, @Param(Constants.WRAPPER) QueryWrapper<EmpCardGift> qw);
|
||||||
|
|
||||||
EmpGiftAppletVo getGifCardBySid(@Param("sid") String sid);
|
EmpGiftAppletVo getGifCardBySid(@Param("sid") String sid);
|
||||||
|
EmpGiftAppletNVo getGifCardsBySid(@Param("sid") String sid);
|
||||||
|
|
||||||
|
|
||||||
String selctMaxSerNum(@Param("cardArea") String cardArea);
|
String selctMaxSerNum(@Param("cardArea") String cardArea);
|
||||||
|
|||||||
@@ -53,6 +53,29 @@
|
|||||||
WHERE
|
WHERE
|
||||||
gi.sid = #{sid}
|
gi.sid = #{sid}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getGifCardsBySid" resultType="com.yxt.yyth.api.empcardgift.EmpGiftAppletNVo">
|
||||||
|
SELECT
|
||||||
|
gi.*,
|
||||||
|
gi.state AS states,
|
||||||
|
gi.serialNumber AS serialNumber,
|
||||||
|
gi.startDate as dateStart,
|
||||||
|
gi.endDate as dateEnd,
|
||||||
|
CASE
|
||||||
|
gi.state
|
||||||
|
WHEN 3 THEN
|
||||||
|
'未提货'
|
||||||
|
WHEN 4 THEN
|
||||||
|
'已经预约提货(预约部分提货)'
|
||||||
|
WHEN 5 THEN
|
||||||
|
'已经提取完成'
|
||||||
|
END stateValue
|
||||||
|
FROM
|
||||||
|
emp_card_gift gi
|
||||||
|
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 id="selctMaxSerNum" resultType="java.lang.String">
|
||||||
SELECT MAX(serialNumber) as sNo
|
SELECT MAX(serialNumber) as sNo
|
||||||
FROM emp_card_gift
|
FROM emp_card_gift
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import com.yxt.yyth.api.empcardgiftgoods.EmpCardGiftGoodsVo;
|
|||||||
import com.yxt.yyth.api.empcardgrantlog.EmpCardGrantLog;
|
import com.yxt.yyth.api.empcardgrantlog.EmpCardGrantLog;
|
||||||
import com.yxt.yyth.api.empcardgrantlog.EmpCardGrantLogVo;
|
import com.yxt.yyth.api.empcardgrantlog.EmpCardGrantLogVo;
|
||||||
import com.yxt.yyth.api.lpkgiftbag.LpkGiftBag;
|
import com.yxt.yyth.api.lpkgiftbag.LpkGiftBag;
|
||||||
|
import com.yxt.yyth.api.lpkgiftbaggoods.LpkGifGoodsVo;
|
||||||
import com.yxt.yyth.api.lpkgiftcard.*;
|
import com.yxt.yyth.api.lpkgiftcard.*;
|
||||||
import com.yxt.yyth.api.lpkgoods.LpkGoods;
|
import com.yxt.yyth.api.lpkgoods.LpkGoods;
|
||||||
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderCardVo;
|
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderCardVo;
|
||||||
@@ -187,55 +188,44 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em
|
|||||||
// return rb.success();
|
// return rb.success();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
public ResultBean<EmpGiftAppletVo> getGifCardsBySid(String sid) {
|
public ResultBean<List<LpkGifGoodsVo>> getGifCardsBySid(String sid) {
|
||||||
ResultBean rb = new ResultBean().fail();
|
ResultBean rb = new ResultBean().fail();
|
||||||
EmpGiftAppletVo vo = baseMapper.getGifCardBySid(sid);
|
EmpGiftAppletNVo vo = baseMapper.getGifCardsBySid(sid);
|
||||||
List<EmpCardGiftGoodsVo> list = empCardGiftGoodsService.getGoodsByEmpCardGiftSid(vo.getSid()).getData();
|
List<LpkGifGoodsVo> list=empCardGiftGoodsService.getGoodsByGiftSid(sid).getData();
|
||||||
|
List<LpkGifGoodsVo> list1=new ArrayList<>();
|
||||||
List<GoodsVo> goodsVos = new ArrayList<>();
|
List<GoodsVo> goodsVos = new ArrayList<>();
|
||||||
list.forEach(s -> {
|
list.forEach(s -> {
|
||||||
// EmpReserveOrderGoods goods = empReserveOrderGoodsService.getReserveByCardSid(vo.getSid(), s.getGoodsSid()).getData();
|
LpkGifGoodsVo g=new LpkGifGoodsVo();
|
||||||
LpkReserveOrderGoods goods = lpkReserveOrderGoodsService.getReserveByCardSid(vo.getSid(), s.getGoodsSid()).getData();
|
LpkReserveOrderGoods goods = lpkReserveOrderGoodsService.getReserveByCardSid(vo.getSid(), s.getGoodsSid()).getData();
|
||||||
EmpCardGiftVo vo1=baseMapper.getEmpCardGoods(vo.getSid(),s.getGoodsSid());
|
EmpCardGiftVo vo1=baseMapper.getEmpCardGoods(vo.getSid(),s.getGoodsSid());
|
||||||
GoodsVo goodsVo = new GoodsVo();
|
GoodsVo goodsVo = new GoodsVo();
|
||||||
goodsVo.setGoods(s.getName());
|
|
||||||
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("已过期")) {
|
if (vo.getState().equals("已过期")) {
|
||||||
goodsVo.setLNum(0);
|
goodsVo.setLNum(0);
|
||||||
goodsVos.add(goodsVo);
|
|
||||||
} else if (!vo.isShowBtn()) {
|
} else if (!vo.isShowBtn()) {
|
||||||
goodsVo.setLNum(0);
|
goodsVo.setLNum(0);
|
||||||
goodsVos.add(goodsVo);
|
|
||||||
} else {
|
} else {
|
||||||
if (null != goods && null!=vo1) {
|
if (null != goods && null!=vo1) {
|
||||||
if (goods.getGoodsNumber() != s.getGoodsNumber()) {
|
if (goods.getGoodsNumber() != s.getGoodsNumber()) {
|
||||||
goodsVo.setLNum(s.getGoodsNumber() - goods.getGoodsNumber()-vo1.getGoodsNumber());
|
goodsVo.setLNum(s.getGoodsNumber() - goods.getGoodsNumber()-vo1.getGoodsNumber());
|
||||||
// goodsVo.setSelect(s.getGoodsNumber() - goods.getGoodsNumber());
|
|
||||||
goodsVo.setSelect(0);
|
|
||||||
}
|
}
|
||||||
}else if(null != vo1){
|
}else if(null != vo1){
|
||||||
if (vo1.getGoodsNumber() != s.getGoodsNumber()) {
|
if (vo1.getGoodsNumber() != s.getGoodsNumber()) {
|
||||||
goodsVo.setLNum(s.getGoodsNumber()- vo1.getGoodsNumber());
|
goodsVo.setLNum(s.getGoodsNumber()- vo1.getGoodsNumber());
|
||||||
goodsVo.setSelect(0);
|
|
||||||
}
|
}
|
||||||
}else if(null != goods) {
|
}else if(null != goods) {
|
||||||
if (goods.getGoodsNumber() != s.getGoodsNumber()) {
|
if (goods.getGoodsNumber() != s.getGoodsNumber()) {
|
||||||
goodsVo.setLNum(s.getGoodsNumber() - goods.getGoodsNumber());
|
goodsVo.setLNum(s.getGoodsNumber() - goods.getGoodsNumber());
|
||||||
goodsVo.setSelect(0);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
goodsVo.setLNum(s.getGoodsNumber());
|
goodsVo.setLNum(s.getGoodsNumber());
|
||||||
// goodsVo.setSelect(s.getGoodsNumber());
|
|
||||||
goodsVo.setSelect(0);
|
|
||||||
}
|
}
|
||||||
goodsVos.add(goodsVo);
|
g.setContent("剩余"+goodsVo.getLNum()+"份/"+"共"+s.getGoodsNumber()+"份");
|
||||||
|
g.setRemarks(s.getWeight()+s.getSpecificationUnit()+"/"+s.getUnitName());
|
||||||
|
g.setGoodsName(s.getGoodsName());
|
||||||
|
list1.add(g);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
vo.setGoodsVos(goodsVos);
|
return rb.success().setData(list1);
|
||||||
return rb.success().setData(vo);
|
|
||||||
}
|
}
|
||||||
public ResultBean<EmpGiftAppletVo> getGifCardBySid(String sid) {
|
public ResultBean<EmpGiftAppletVo> getGifCardBySid(String sid) {
|
||||||
ResultBean rb = new ResultBean().fail();
|
ResultBean rb = new ResultBean().fail();
|
||||||
|
|||||||
@@ -37,5 +37,5 @@ public interface EmpCardGiftGoodsMapper extends BaseMapper<EmpCardGiftGoods> {
|
|||||||
"\tLEFT JOIN lpk_goods l ON l.sid = s.goodsSid \n" +
|
"\tLEFT JOIN lpk_goods l ON l.sid = s.goodsSid \n" +
|
||||||
"WHERE\n" +
|
"WHERE\n" +
|
||||||
"\tg.sid =#{sid}")
|
"\tg.sid =#{sid}")
|
||||||
List<EmpCardGoodsVo> getGoodsByGiftSid(String sid);
|
List<LpkGifGoodsVo> getGoodsByGiftSid(String sid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import com.yxt.yyth.api.empcardgiftgoods.EmpCardGiftGoodsVo;
|
|||||||
import com.yxt.yyth.api.empcardgiftgoods.EmpCardGoodsVo;
|
import com.yxt.yyth.api.empcardgiftgoods.EmpCardGoodsVo;
|
||||||
import com.yxt.yyth.api.empcardgrantlog.EmpCardGrantLog;
|
import com.yxt.yyth.api.empcardgrantlog.EmpCardGrantLog;
|
||||||
import com.yxt.yyth.api.lpkbank.LpkBank;
|
import com.yxt.yyth.api.lpkbank.LpkBank;
|
||||||
|
import com.yxt.yyth.api.lpkgiftbaggoods.LpkGifGoodsVo;
|
||||||
import com.yxt.yyth.biz.empcard.EmpCardService;
|
import com.yxt.yyth.biz.empcard.EmpCardService;
|
||||||
import com.yxt.yyth.biz.empcardgrantlog.EmpCardGrantLogService;
|
import com.yxt.yyth.biz.empcardgrantlog.EmpCardGrantLogService;
|
||||||
import com.yxt.yyth.biz.lpkgiftcard.generateRule.UniqueIdGenerator;
|
import com.yxt.yyth.biz.lpkgiftcard.generateRule.UniqueIdGenerator;
|
||||||
@@ -59,9 +60,9 @@ public class EmpCardGiftGoodsService extends MybatisBaseService<EmpCardGiftGoods
|
|||||||
EmpCardGiftGoodsVo list= baseMapper.recordListGoods(empCardSid,goodsSid);
|
EmpCardGiftGoodsVo list= baseMapper.recordListGoods(empCardSid,goodsSid);
|
||||||
return rb.success().setData(list);
|
return rb.success().setData(list);
|
||||||
}
|
}
|
||||||
public ResultBean<List<EmpCardGoodsVo>> getGoodsByGiftSid(String sid) {
|
public ResultBean<List<LpkGifGoodsVo>> getGoodsByGiftSid(String sid) {
|
||||||
ResultBean rb = ResultBean.fireFail();
|
ResultBean rb = ResultBean.fireFail();
|
||||||
List<EmpCardGoodsVo> list= baseMapper.getGoodsByGiftSid(sid);
|
List<LpkGifGoodsVo> list= baseMapper.getGoodsByGiftSid(sid);
|
||||||
return rb.success().setData(list);
|
return rb.success().setData(list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,16 @@ public interface LpkGiftBagGoodsMapper extends BaseMapper<LpkGiftBagGoods> {
|
|||||||
"WHERE\n" +
|
"WHERE\n" +
|
||||||
"\tcard.sid =#{sid}")
|
"\tcard.sid =#{sid}")
|
||||||
List<LpkGifGoodsVo> getGoodsByGiftSid(String sid);
|
List<LpkGifGoodsVo> getGoodsByGiftSid(String sid);
|
||||||
|
|
||||||
|
@Select("SELECT\n" +
|
||||||
|
"\tgs.name as goodsName ,gs.sid as goodsSid, gs.weight ,gs.specificationUnit ,gs.unitName,g.goodsNumber \n" +
|
||||||
|
"FROM\n" +
|
||||||
|
"\temp_card card\n" +
|
||||||
|
"\tLEFT JOIN lpk_giftbag_goods g ON card.giftbagSid = g.giftbagSid\n" +
|
||||||
|
"\tLEFT JOIN lpk_goods gs ON g.goodsSid = gs.sid \n" +
|
||||||
|
"WHERE\n" +
|
||||||
|
"\tcard.sid =#{sid}")
|
||||||
|
List<LpkGifGoodsVo> getGoodsByEmpGiftSid(String sid);
|
||||||
List<LpkGiftBagGoods> getRecordsByBagSid(@Param("sid") String sid);
|
List<LpkGiftBagGoods> getRecordsByBagSid(@Param("sid") String sid);
|
||||||
|
|
||||||
int saveBagGoods(@Param("bagGoods") List<LpkGiftBagGoods> bagGoods);
|
int saveBagGoods(@Param("bagGoods") List<LpkGiftBagGoods> bagGoods);
|
||||||
|
|||||||
@@ -31,7 +31,9 @@ public class LpkGiftBagGoodsService extends MybatisBaseService<LpkGiftBagGoodsMa
|
|||||||
public List<LpkGifGoodsVo> getGoodsByGiftSid(String sid) {
|
public List<LpkGifGoodsVo> getGoodsByGiftSid(String sid) {
|
||||||
return baseMapper.getGoodsByGiftSid(sid);
|
return baseMapper.getGoodsByGiftSid(sid);
|
||||||
}
|
}
|
||||||
|
public List<LpkGifGoodsVo> getGoodsByEmpGiftSid(String sid) {
|
||||||
|
return baseMapper.getGoodsByEmpGiftSid(sid);
|
||||||
|
}
|
||||||
|
|
||||||
public int saveBagGoods(List<LpkGiftBagGoods> bagGoods) {
|
public int saveBagGoods(List<LpkGiftBagGoods> bagGoods) {
|
||||||
return baseMapper.saveBagGoods(bagGoods);
|
return baseMapper.saveBagGoods(bagGoods);
|
||||||
|
|||||||
@@ -38,7 +38,21 @@ public interface LpkGiftCardMapper extends BaseMapper<LpkGiftCard> {
|
|||||||
" LEFT JOIN lpk_giftbag bag on card.giftbagSid=bag.sid" +
|
" LEFT JOIN lpk_giftbag bag on card.giftbagSid=bag.sid" +
|
||||||
" where card.sid=#{sid}")
|
" where card.sid=#{sid}")
|
||||||
AppletVo getGifCardBySid(@Param("sid") String sid);
|
AppletVo getGifCardBySid(@Param("sid") String sid);
|
||||||
|
@Select(" SELECT\n" +
|
||||||
|
" card.*,\n" +
|
||||||
|
" case card.state\n" +
|
||||||
|
" WHEN 3 then '未提货'\n" +
|
||||||
|
" WHEN 4 then '已经预约提货(预约部分提货)'\n" +
|
||||||
|
" WHEN 5 then '已经提取完成'\n" +
|
||||||
|
" end stateValue,\n" +
|
||||||
|
" bag.dateStart as dateStart\n" +
|
||||||
|
" ,bag.dateEnd as dateEnd\n" +
|
||||||
|
" ,bag.name as pname,card.state as states,card.serialNumber as serialNumber\n" +
|
||||||
|
" FROM\n" +
|
||||||
|
" lpk_giftcard card\n" +
|
||||||
|
" LEFT JOIN lpk_giftbag bag on card.giftbagSid=bag.sid" +
|
||||||
|
" where card.sid=#{sid}")
|
||||||
|
AppletNewVo getGifCardsBySid(@Param("sid") String sid);
|
||||||
|
|
||||||
String selctMaxSerNum(@Param("cardArea") String cardArea);
|
String selctMaxSerNum(@Param("cardArea") String cardArea);
|
||||||
|
|
||||||
|
|||||||
@@ -27,10 +27,9 @@ import com.yxt.common.base.utils.StringUtils;
|
|||||||
import com.yxt.common.core.query.PagerQuery;
|
import com.yxt.common.core.query.PagerQuery;
|
||||||
import com.yxt.common.core.result.ResultBean;
|
import com.yxt.common.core.result.ResultBean;
|
||||||
import com.yxt.common.core.vo.PagerVo;
|
import com.yxt.common.core.vo.PagerVo;
|
||||||
import com.yxt.yyth.api.empcardgift.EmpCardGift;
|
import com.yxt.yyth.api.empcard.EmpAppletNewVo;
|
||||||
import com.yxt.yyth.api.empcardgift.EmpCardGiftDto;
|
import com.yxt.yyth.api.empcard.EmpAppletVo;
|
||||||
import com.yxt.yyth.api.empcardgift.EmpCardGiftVo;
|
import com.yxt.yyth.api.empcardgift.*;
|
||||||
import com.yxt.yyth.api.empcardgift.EmpGiftAppletVo;
|
|
||||||
import com.yxt.yyth.api.empcardgiftgoods.EmpCardGiftGoods;
|
import com.yxt.yyth.api.empcardgiftgoods.EmpCardGiftGoods;
|
||||||
import com.yxt.yyth.api.empcardgiftgoods.EmpCardGiftGoodsVo;
|
import com.yxt.yyth.api.empcardgiftgoods.EmpCardGiftGoodsVo;
|
||||||
import com.yxt.yyth.api.empcardgiftgoods.EmpCardGoodsVo;
|
import com.yxt.yyth.api.empcardgiftgoods.EmpCardGoodsVo;
|
||||||
@@ -45,6 +44,7 @@ import com.yxt.yyth.api.lpkgiftbaggoods.LpkGifGoodsVo;
|
|||||||
import com.yxt.yyth.api.lpkgiftbaggoods.LpkGiftBagGoods;
|
import com.yxt.yyth.api.lpkgiftbaggoods.LpkGiftBagGoods;
|
||||||
import com.yxt.yyth.api.lpkgiftbaggoods.LpkGiftBagGoodsVo;
|
import com.yxt.yyth.api.lpkgiftbaggoods.LpkGiftBagGoodsVo;
|
||||||
import com.yxt.yyth.api.lpkgiftcard.*;
|
import com.yxt.yyth.api.lpkgiftcard.*;
|
||||||
|
import com.yxt.yyth.api.lpkgiftcard.GoodsVo;
|
||||||
import com.yxt.yyth.api.lpkgoods.LpkGoods;
|
import com.yxt.yyth.api.lpkgoods.LpkGoods;
|
||||||
import com.yxt.yyth.api.lpkgiftcard.CardStatisticsExportVo;
|
import com.yxt.yyth.api.lpkgiftcard.CardStatisticsExportVo;
|
||||||
import com.yxt.yyth.api.lpkreserveorder.*;
|
import com.yxt.yyth.api.lpkreserveorder.*;
|
||||||
@@ -220,91 +220,64 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
|||||||
System.out.println(query.getCustomerSid());
|
System.out.println(query.getCustomerSid());
|
||||||
IPage<LpkGiftCard> page = PagerUtil.queryToPage(pq);
|
IPage<LpkGiftCard> page = PagerUtil.queryToPage(pq);
|
||||||
IPage<AppletVo> list = baseMapper.getGifCardsByCustomerSid(page, query.getCustomerSid());
|
IPage<AppletVo> list = baseMapper.getGifCardsByCustomerSid(page, query.getCustomerSid());
|
||||||
// list.getRecords().forEach(s->{
|
list.getRecords().forEach(s->{
|
||||||
// if(s.getLogo().equals("1")){
|
if(s.getLogo().equals("1")){
|
||||||
// //家庭卡
|
//家庭卡
|
||||||
// List<LpkGifGoodsVo> list1=LpkGiftBagGoodsService.getGoodsByGiftSid(s.getSid());
|
List<LpkGifGoodsVo> vo= getGifCardsBySid(s.getSid()).getData();
|
||||||
// list1.forEach(l->{
|
s.setList(vo);
|
||||||
// AppletVo vo= getGifCardsBySid(s.getSid()).getData();
|
}else if(s.getLogo().equals("2")){
|
||||||
// List<GoodsVo> vos=vo.getGoodsVos();
|
//亲情卡
|
||||||
// vos.forEach(d->{
|
List<LpkGifGoodsVo> vo= empCardGiftService.getGifCardsBySid(s.getSid()).getData();
|
||||||
// if(l.getGoodsSid().equals(d.getGoodsSid())){
|
s.setList(vo);
|
||||||
// l.setContent("剩余"+d.getLNum()+"份/"+"共"+l.getGoodsNumber()+"份");
|
} else if (s.getLogo().equals("3")) {
|
||||||
// }
|
//企业卡
|
||||||
// });
|
List<LpkGifGoodsVo> list1=empCardService.getEmpCardsBySid(s.getSid()).getData();
|
||||||
// l.setRemarks(l.getWeight()+l.getSpecificationUnit()+"/"+l.getUnitName());
|
s.setList(list1);
|
||||||
// });
|
}
|
||||||
// }else if(s.getLogo().equals("2")){
|
});
|
||||||
// //亲情卡
|
|
||||||
// List<EmpCardGoodsVo> list1=empCardGiftGoodsService.getGoodsByGiftSid(s.getSid()).getData();
|
|
||||||
// list1.forEach(l->{
|
|
||||||
// EmpGiftAppletVo vo=empCardGiftService.getGifCardsBySid(s.getSid()).getData();
|
|
||||||
// List<com.yxt.yyth.api.empcardgift.GoodsVo> vos=vo.getGoodsVos();
|
|
||||||
// vos.forEach(d->{
|
|
||||||
// if(l.getGoodsSid().equals(d.getGoodsSid())){
|
|
||||||
// l.setContent("剩余"+d.getLNum()+"份/"+"共"+l.getGoodsNumber()+"份");
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// l.setRemarks(l.getWeight()+l.getSpecificationUnit()+"/"+l.getUnitName());
|
|
||||||
// });
|
|
||||||
// EmpGiftAppletVo vo=empCardGiftService.getGifCardsBySid(s.getSid()).getData();
|
|
||||||
// } else if (s.getLogo().equals("3")) {
|
|
||||||
// //企业卡
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
PagerVo<AppletVo> p = PagerUtil.pageToVo(list, null);
|
PagerVo<AppletVo> p = PagerUtil.pageToVo(list, null);
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
return rb.success().setData(p);
|
return rb.success().setData(p);
|
||||||
}
|
}
|
||||||
public ResultBean<AppletVo> getGifCardsBySid(String sid) {
|
public ResultBean<List<LpkGifGoodsVo>> getGifCardsBySid(String sid) {
|
||||||
ResultBean rb = new ResultBean().fail();
|
ResultBean rb = new ResultBean().fail();
|
||||||
AppletVo vo = baseMapper.getGifCardBySid(sid);
|
AppletNewVo vo = baseMapper.getGifCardsBySid(sid);
|
||||||
List<LpkGiftBagGoodsVo> list = LpkGiftBagGoodsService.getGoodsByBagSid(vo.getGiftbagSid());
|
List<LpkGifGoodsVo> list=LpkGiftBagGoodsService.getGoodsByGiftSid(sid);
|
||||||
|
List<LpkGifGoodsVo> list1=new ArrayList<>();
|
||||||
List<GoodsVo> goodsVos = new ArrayList<>();
|
List<GoodsVo> goodsVos = new ArrayList<>();
|
||||||
list.forEach(s -> {
|
list.forEach(s -> {
|
||||||
|
LpkGifGoodsVo g=new LpkGifGoodsVo();
|
||||||
LpkReserveOrderGoods goods = lpkReserveOrderGoodsService.getReserveByCardSid(vo.getSid(), s.getGoodsSid()).getData();
|
LpkReserveOrderGoods goods = lpkReserveOrderGoodsService.getReserveByCardSid(vo.getSid(), s.getGoodsSid()).getData();
|
||||||
EmpCardGiftVo vo1=empCardGiftService.getEmpCardGoods(vo.getSid(),s.getGoodsSid()).getData();
|
EmpCardGiftVo vo1=empCardGiftService.getEmpCardGoods(vo.getSid(),s.getGoodsSid()).getData();
|
||||||
GoodsVo goodsVo = new GoodsVo();
|
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("已过期")) {
|
if (vo.getState().equals("已过期")) {
|
||||||
goodsVo.setLNum(0);
|
goodsVo.setLNum(0);
|
||||||
goodsVos.add(goodsVo);
|
|
||||||
} else if (!vo.isShowBtn()) {
|
} else if (!vo.isShowBtn()) {
|
||||||
goodsVo.setLNum(0);
|
goodsVo.setLNum(0);
|
||||||
goodsVos.add(goodsVo);
|
|
||||||
} else {
|
} else {
|
||||||
if (null != goods && null!=vo1) {
|
if (null != goods && null!=vo1) {
|
||||||
if (goods.getGoodsNumber() != s.getGoodsNumber()) {
|
if (goods.getGoodsNumber() != s.getGoodsNumber()) {
|
||||||
goodsVo.setLNum(s.getGoodsNumber() - goods.getGoodsNumber()-vo1.getGoodsNumber());
|
goodsVo.setLNum(s.getGoodsNumber() - goods.getGoodsNumber()-vo1.getGoodsNumber());
|
||||||
// goodsVo.setSelect(s.getGoodsNumber() - goods.getGoodsNumber());
|
|
||||||
goodsVo.setSelect(0);
|
|
||||||
}
|
}
|
||||||
} else if(null != vo1){
|
} else if(null != vo1){
|
||||||
if (vo1.getGoodsNumber() != s.getGoodsNumber()) {
|
if (vo1.getGoodsNumber() != s.getGoodsNumber()) {
|
||||||
goodsVo.setLNum(s.getGoodsNumber()- vo1.getGoodsNumber());
|
goodsVo.setLNum(s.getGoodsNumber()- vo1.getGoodsNumber());
|
||||||
goodsVo.setSelect(0);
|
|
||||||
}
|
}
|
||||||
}else if(null != goods) {
|
}else if(null != goods) {
|
||||||
if (goods.getGoodsNumber() != s.getGoodsNumber()) {
|
if (goods.getGoodsNumber() != s.getGoodsNumber()) {
|
||||||
goodsVo.setLNum(s.getGoodsNumber() - goods.getGoodsNumber());
|
goodsVo.setLNum(s.getGoodsNumber() - goods.getGoodsNumber());
|
||||||
goodsVo.setSelect(0);
|
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
goodsVo.setLNum(s.getGoodsNumber());
|
goodsVo.setLNum(s.getGoodsNumber());
|
||||||
// goodsVo.setSelect(s.getGoodsNumber());
|
|
||||||
goodsVo.setSelect(0);
|
|
||||||
}
|
}
|
||||||
goodsVos.add(goodsVo);
|
g.setContent("剩余"+goodsVo.getLNum()+"份/"+"共"+s.getGoodsNumber()+"份");
|
||||||
|
g.setRemarks(s.getWeight()+s.getSpecificationUnit()+"/"+s.getUnitName());
|
||||||
|
g.setGoodsName(s.getGoodsName());
|
||||||
|
list1.add(g);
|
||||||
}
|
}
|
||||||
|
// goodsVos.add(goodsVo);
|
||||||
});
|
});
|
||||||
vo.setGoodsVos(goodsVos);
|
return rb.success().setData(list1);
|
||||||
return rb.success().setData(vo);
|
|
||||||
}
|
}
|
||||||
public ResultBean<AppletVo> getGifCardBySid(String sid) {
|
public ResultBean<AppletVo> getGifCardBySid(String sid) {
|
||||||
ResultBean rb = new ResultBean().fail();
|
ResultBean rb = new ResultBean().fail();
|
||||||
|
|||||||
Reference in New Issue
Block a user