|
@ -742,10 +742,10 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
|
|
//表示已出货
|
|
//表示已出货
|
|
if ("2".equals(status)) {
|
|
if ("2".equals(status)) {
|
|
//更新药柜库存
|
|
//更新药柜库存
|
|
MediicinecabinetInventory inventory = inventoryDao.findMediicinecabinetInventoryByIdDeviceAndLayerNoAndWayerNo(
|
|
|
|
medicineShipmentLog.getDeviceId(),
|
|
|
|
|
|
MediicinecabinetInventory inventory = inventoryDao.findMediicinecabinetInventoryByEquNumAndLayerNoAndWayerNo(
|
|
|
|
medicineShipmentLog.getDeviceId(), //equNum
|
|
medicineShipmentLog.getLayerNo(),
|
|
medicineShipmentLog.getLayerNo(),
|
|
medicineShipmentLog.getWayerNo());
|
|
|
|
|
|
medicineShipmentLog.getWayerNo().split(",")[0]);
|
|
inventory.setQty(String.valueOf(Integer.parseInt(inventory.getQty()) - 1));
|
|
inventory.setQty(String.valueOf(Integer.parseInt(inventory.getQty()) - 1));
|
|
if (Integer.parseInt(inventory.getQty()) < Integer.parseInt(inventory.getNum())) {
|
|
if (Integer.parseInt(inventory.getQty()) < Integer.parseInt(inventory.getNum())) {
|
|
Mediicinedevice mediicinedevice = deviceDao.findOne(inventory.getIdDevice());
|
|
Mediicinedevice mediicinedevice = deviceDao.findOne(inventory.getIdDevice());
|
|
@ -861,6 +861,7 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
|
|
}
|
|
}
|
|
|
|
|
|
//生成出货单
|
|
//生成出货单
|
|
|
|
DmHospitalDO dmHospitalDO = hospitalDao.findOne(Integer.parseInt(mediicineorder.getBelongCommunity()));
|
|
int count = jdbcTemplate.queryForObject(
|
|
int count = jdbcTemplate.queryForObject(
|
|
"SELECT\n" +
|
|
"SELECT\n" +
|
|
"\tcount(DISTINCT(id))\n" +
|
|
"\tcount(DISTINCT(id))\n" +
|
|
@ -900,6 +901,13 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
|
|
"WHERE \n" +
|
|
"WHERE \n" +
|
|
"\tt.order_id = '" + mediicineorder.getId()+"'";
|
|
"\tt.order_id = '" + mediicineorder.getId()+"'";
|
|
List<Map<String, Object>> tempList = hibenateUtils.createSQLQuery(tempSql);
|
|
List<Map<String, Object>> tempList = hibenateUtils.createSQLQuery(tempSql);
|
|
|
|
jsonObject.put("community", dmHospitalDO == null ? "" : dmHospitalDO.getName());
|
|
|
|
jsonObject.put("phone", "123456");
|
|
|
|
jsonObject.put("num", mediicineorder.getPrescribeNum());
|
|
|
|
jsonObject.put("date", DateUtil.dateToStr(new Date(), "yyyy-MM-dd"));
|
|
|
|
jsonObject.put("time", DateUtil.dateToStr(new Date(), "HH:mm:ss"));
|
|
|
|
jsonObject.put("remark", "若未取到货物,请您扫描小票二维码申请退款。\n谢谢慢走,祝您生活愉快!");
|
|
|
|
jsonObject.put("qrCodeContent", "谢谢慢走,祝您生活愉快!");
|
|
jsonObject.put("list", tempList);
|
|
jsonObject.put("list", tempList);
|
|
jsonObject.put("status", 1);
|
|
jsonObject.put("status", 1);
|
|
result.put("response", ConstantUtils.SUCCESS);
|
|
result.put("response", ConstantUtils.SUCCESS);
|
|
@ -957,7 +965,6 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
DmHospitalDO dmHospitalDO = hospitalDao.findOne(Integer.parseInt(mediicineorder.getBelongCommunity()));
|
|
|
|
jsonObject.put("community", dmHospitalDO == null ? "" : dmHospitalDO.getName());
|
|
jsonObject.put("community", dmHospitalDO == null ? "" : dmHospitalDO.getName());
|
|
jsonObject.put("phone", "123456");
|
|
jsonObject.put("phone", "123456");
|
|
jsonObject.put("num", mediicineorder.getPrescribeNum());
|
|
jsonObject.put("num", mediicineorder.getPrescribeNum());
|