@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("是否需要发消息")
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("是否需要发消息")
logger.warn("send msg type:" + dreamResponse.getType());
rabbitMqSend.sendMsg(JsonUtil.objectToJson(dreamResponse),code);
return result;
}
所有携带的商品均已付款,返回给前端未付款商品的sku以及对应的数量,如果所有商品均已付款,则向mq发送消息进行开门服务的消息,.net端收到消息进行消费。