|
@ -577,24 +577,33 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
|
|
result.put("msg", "orderId is null or empty");
|
|
result.put("msg", "orderId is null or empty");
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
String sql = "SELECT\n" +
|
|
|
|
" t.id,\n" +
|
|
|
|
" t.device_id,\n" +
|
|
|
|
" t.order_id,\n" +
|
|
|
|
" t.drug_id,\n" +
|
|
|
|
" t.`status`,\n" +
|
|
|
|
" t.out_time,\n" +
|
|
|
|
" t.layer_no,\n" +
|
|
|
|
" t.wayer_no,\n" +
|
|
|
|
" t.description,\n" +
|
|
|
|
" t.create_time,\n" +
|
|
|
|
" t.create_user,\n" +
|
|
|
|
" t.create_user_name,\n" +
|
|
|
|
" t.update_time,\n" +
|
|
|
|
" t.update_user,\n" +
|
|
|
|
" t.update_user_name\n" +
|
|
|
|
" FROM\n" +
|
|
|
|
" t_medicine_shipment_log AS t \n" +
|
|
|
|
|
|
String sql = "SELECT\n" +
|
|
|
|
" t.id AS id,\n" +
|
|
|
|
" t.device_id AS deviceId,\n" +
|
|
|
|
" t.order_id AS orderId,\n" +
|
|
|
|
" t.drug_id AS drugId,\n" +
|
|
|
|
" t.`status` AS `status`,\n" +
|
|
|
|
" t.out_time AS outTime,\n" +
|
|
|
|
" t.layer_no AS layerNo,\n" +
|
|
|
|
" t.wayer_no AS wayerNo,\n" +
|
|
|
|
" t.description AS description,\n" +
|
|
|
|
" t.create_time AS createTime,\n" +
|
|
|
|
" t.create_user AS createUser,\n" +
|
|
|
|
" t.create_user_name AS createUserName,\n" +
|
|
|
|
" t.update_time AS updateTime,\n" +
|
|
|
|
" t.update_user AS updateUser,\n" +
|
|
|
|
" t.update_user_name AS updateUserName,\n" +
|
|
|
|
" t.drug_bar_code AS drugBarCode,\n" +
|
|
|
|
" t.drug_code AS drugCode,\n" +
|
|
|
|
" t.drug_name AS drugName,\n" +
|
|
|
|
" t.pic AS pic,\n" +
|
|
|
|
" t.price AS price,\n" +
|
|
|
|
" t.specif AS specif,\n" +
|
|
|
|
" t.unit AS unit,\n" +
|
|
|
|
" t.org_code AS orgCode,\n" +
|
|
|
|
" t.org_name AS orgName\n" +
|
|
|
|
" FROM\n" +
|
|
|
|
" t_medicine_shipment_log AS t" +
|
|
" WHERE \n" +
|
|
" WHERE \n" +
|
|
" t.order_id = '" + orderId + "'";
|
|
" t.order_id = '" + orderId + "'";
|
|
List<Map<String,Object >> list = null;
|
|
List<Map<String,Object >> list = null;
|
|
@ -628,6 +637,36 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
|
|
medicineShipmentLog.setStatus(status);
|
|
medicineShipmentLog.setStatus(status);
|
|
|
|
|
|
shipmentLogDao.save(medicineShipmentLog);
|
|
shipmentLogDao.save(medicineShipmentLog);
|
|
|
|
|
|
|
|
//表示已出货
|
|
|
|
if ("2".equals(status)) {
|
|
|
|
//更新药柜库存
|
|
|
|
MediicinecabinetInventory inventory = inventoryDao.findMediicinecabinetInventoryByIdDeviceAndLayerNoAndWayerNo(
|
|
|
|
medicineShipmentLog.getDeviceId(),
|
|
|
|
medicineShipmentLog.getLayerNo(),
|
|
|
|
medicineShipmentLog.getWayerNo());
|
|
|
|
inventory.setQty(String.valueOf(Integer.parseInt(inventory.getQty()) - 1));
|
|
|
|
inventoryDao.save(inventory);
|
|
|
|
}
|
|
|
|
//查询更新订单信息start
|
|
|
|
//订单id
|
|
|
|
String orderId = medicineShipmentLog.getOrderId();
|
|
|
|
String sql = "SELECT\n" +
|
|
|
|
"\tcount(DISTINCT(id))\n" +
|
|
|
|
"FROM\n" +
|
|
|
|
"\tt_medicine_shipment_log\n" +
|
|
|
|
"WHERE\n" +
|
|
|
|
"\torder_id = '" + orderId + "'\n" +
|
|
|
|
"AND `status` = 1\n" +
|
|
|
|
"OR `status` = 3";
|
|
|
|
int count = jdbcTemplate.queryForObject(sql,Integer.class);
|
|
|
|
if (count == 0) {
|
|
|
|
Mediicineorder order = orderDao.findOne(orderId);
|
|
|
|
order.setSellState("1");
|
|
|
|
orderDao.save(order);
|
|
|
|
}
|
|
|
|
|
|
|
|
//end
|
|
result.put("msg", ConstantUtils.SUCCESS);
|
|
result.put("msg", ConstantUtils.SUCCESS);
|
|
result.put("response", ConstantUtils.SUCCESS);
|
|
result.put("response", ConstantUtils.SUCCESS);
|
|
return result;
|
|
return result;
|
|
@ -804,7 +843,16 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
|
|
"\tt.create_user_name AS createUserName,\n" +
|
|
"\tt.create_user_name AS createUserName,\n" +
|
|
"\tt.update_time AS updateTime,\n" +
|
|
"\tt.update_time AS updateTime,\n" +
|
|
"\tt.update_user AS updateUser,\n" +
|
|
"\tt.update_user AS updateUser,\n" +
|
|
"\tt.update_user_name AS updateUserName\n" +
|
|
|
|
|
|
"\tt.update_user_name AS updateUserName,\n" +
|
|
|
|
"\tt.drug_bar_code AS drugBarCode,\n" +
|
|
|
|
"\tt.drug_code AS drugCode,\n" +
|
|
|
|
"\tt.drug_name AS drugName,\n" +
|
|
|
|
"\tt.pic AS pic,\n" +
|
|
|
|
"\tt.price AS price,\n" +
|
|
|
|
"\tt.specif AS specif,\n" +
|
|
|
|
"\tt.unit AS unit,\n" +
|
|
|
|
"\tt.org_code AS orgCode,\n" +
|
|
|
|
"\tt.org_name AS orgName\n" +
|
|
"FROM\n" +
|
|
"FROM\n" +
|
|
"\tt_medicine_shipment_log AS t\n" +
|
|
"\tt_medicine_shipment_log AS t\n" +
|
|
"WHERE \n" +
|
|
"WHERE \n" +
|
|
@ -848,6 +896,15 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
|
|
shipmentLog.setStatus("1");
|
|
shipmentLog.setStatus("1");
|
|
shipmentLog.setLayerNo(objectMap.get("layerNo").toString());
|
|
shipmentLog.setLayerNo(objectMap.get("layerNo").toString());
|
|
shipmentLog.setWayerNo(objectMap.get("wayerNo").toString());
|
|
shipmentLog.setWayerNo(objectMap.get("wayerNo").toString());
|
|
|
|
shipmentLog.setDrugBarCode(mediicinedrugs.getDrugBarCode());
|
|
|
|
shipmentLog.setDrugCode(mediicinedrugs.getDrugCode());
|
|
|
|
shipmentLog.setDrugName(mediicinedrugs.getDrugName());
|
|
|
|
shipmentLog.setOrgCode(mediicinedrugs.getOrgCode());
|
|
|
|
shipmentLog.setOrgName(mediicinedrugs.getOrgName());
|
|
|
|
shipmentLog.setPic(mediicinedrugs.getPic());
|
|
|
|
shipmentLog.setPrice(mediicinedrugs.getPrice());
|
|
|
|
shipmentLog.setSpecif(mediicinedrugs.getSpecif());
|
|
|
|
shipmentLog.setUnit(mediicinedrugs.getUnit());
|
|
shipmentLogDao.save(shipmentLog);
|
|
shipmentLogDao.save(shipmentLog);
|
|
shipmentLogs.add(shipmentLog);
|
|
shipmentLogs.add(shipmentLog);
|
|
}
|
|
}
|