|
|
@ -45,6 +45,7 @@ import com.yxt.yyth.biz.lpkgiftcard.LpkGiftCardService; |
|
|
|
import com.yxt.yyth.biz.lpkgiftcard.generateRule.UniqueIdGenerator; |
|
|
|
import com.yxt.yyth.biz.lpkgoods.LpkGoodsService; |
|
|
|
import com.yxt.yyth.biz.lpkreserveorder.LpkReserveOrderService; |
|
|
|
import com.yxt.yyth.biz.lpkreserveordergoods.LpkReserveOrderGoodsMapper; |
|
|
|
import com.yxt.yyth.biz.lpkreserveordergoods.LpkReserveOrderGoodsService; |
|
|
|
import com.yxt.yyth.biz.lpkstore.LpkStoreService; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
@ -97,6 +98,8 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em |
|
|
|
@Autowired |
|
|
|
LpkGiftBagService lpkGiftBagService; |
|
|
|
@Autowired |
|
|
|
private LpkReserveOrderGoodsMapper lpkReserveOrderGoodsMapper; |
|
|
|
@Autowired |
|
|
|
private FileUploadComponent fileUploadComponent; |
|
|
|
|
|
|
|
@Autowired |
|
|
@ -412,9 +415,17 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em |
|
|
|
record.setEmpCardSid(dto.getEmpCardSid()); |
|
|
|
record.setCode(dto.getCode()); |
|
|
|
empCardGrantLogService.updateById(record); |
|
|
|
|
|
|
|
EmpAppletVo vo = empCardService.getEmpCardBySid(empCard.getSid()).getData(); |
|
|
|
int i = 0; |
|
|
|
/*EmpAppletVo voss =empCardService.getEmpCardBySid(empCard.getSid()).getData(); |
|
|
|
for (com.yxt.yyth.api.lpkgiftcard.GoodsVo vo1 : voss.getGoodsVos()) { |
|
|
|
LpkReserveOrderGoods goods1 = lpkReserveOrderGoodsMapper.getReserveByCardSid(empCard.getSid(), vo1.getGoodsSid()); |
|
|
|
if (null != goods1) { |
|
|
|
if (vo1.getNum() <= goods1.getGoodsNumber()) { |
|
|
|
i++; |
|
|
|
} |
|
|
|
} |
|
|
|
}*/ |
|
|
|
EmpAppletVo vo = empCardService.getEmpCardBySid(empCard.getSid()).getData(); |
|
|
|
for (com.yxt.yyth.api.lpkgiftcard.GoodsVo vo1 : vo.getGoodsVos()) { |
|
|
|
EmpCardGrantLogVo goods1 = empCardGrantLogService.recordListGoods(dto.getEmpCardSid(), vo1.getGoodsSid()).getData(); |
|
|
|
if (null != goods1) { |
|
|
@ -426,6 +437,11 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em |
|
|
|
empCardService.changState(dto.getEmpCardSid(), "3"); |
|
|
|
} |
|
|
|
} |
|
|
|
/* if (vo.getGoodsVos().size() == i) { |
|
|
|
empCardService.changState(empCard.getSid(), "5"); |
|
|
|
} else { |
|
|
|
empCardService.changState(empCard.getSid(), "4"); |
|
|
|
}*/ |
|
|
|
} |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|