@Override
public int checkNotPay(List<String> epcList,String code) {
logger.warn("send msg data:" + epcList);
int result = 0;
DreamResponse<PublishResultVO> dreamResponse = new DreamResponse<PublishResultVO>();
if (epcList == null || epcList.isEmpty()) {
// FIXME("是否需要發(fā)消息")
dreamResponse.setType(MsgType.ALL_PAY.value());
rabbitMqSend.sendMsg(JsonUtil.objectToJson(dreamResponse),code);
return result;
}
// 獲取庫存
StockDTO stockDTO = new StockDTO();
stockDTO.setTags(epcList);
// 未在支付表中,切在庫存中 未考慮過期商品
List<StockItem> noPayList = this.stockItemMapper.selectNoPayByTags(stockDTO.getTags());
if (!noPayList.isEmpty()) {
result = 1;
dreamResponse.setStatus("fail");
dreamResponse.setData(groupByAssetId(noPayList));
dreamResponse.setTotal(noPayList.size());
dreamResponse.setType(MsgType.CHECK_NO_PAY.value());
AlarmLog record = null;
for (StockItem stockEx : noPayList) {
record = new AlarmLog();
//record.setAssetClassifyId(stockEx.getAssetClassifyId());
record.setAssetName(stockEx.getName());
record.setAssetNum(stockEx.getNum());
record.setSpecification(stockEx.getSpecification());
// record.setClientId(getClientId());
record.setCreateDate(new Date());
// record.setCreater(getCreater());
record.setEpc(stockEx.getEpc());
record.setId(null);
record.setLastUpdate(new Date());
record.setQuantity(1l);
record.setWarehouseCode(stockEx.getWarehouseCode());
this.alarmLogMapper.insertSelective(record);
}
}
// FIXME("是否需要發(fā)消息")
logger.warn("send msg type:" + dreamResponse.getType());
rabbitMqSend.sendMsg(JsonUtil.objectToJson(dreamResponse),code);
return result;
}
所有攜帶的商品均已付款,返回給前端未付款商品的sku以及對應的數量,如果所有商品均已付款吁伺,則向mq發(fā)送消息進行開門服務的消息逞带,.net端收到消息進行消費欺矫。