|
@ -814,6 +814,35 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
public JSONObject checkOrderComplete(String orderId) {
|
|
|
JSONObject result = new JSONObject();
|
|
|
if (orderId == null || StringUtils.isEmpty(orderId)) {
|
|
|
result.put("msg", "parameter orderId is null or empty");
|
|
|
result.put("response", ConstantUtils.FAIL);
|
|
|
return result;
|
|
|
}
|
|
|
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);
|
|
|
result.put("msg", "order was completed");
|
|
|
result.put("response", ConstantUtils.SUCCESS);
|
|
|
return result;
|
|
|
}
|
|
|
result.put("response", ConstantUtils.FAIL);
|
|
|
result.put("msg", "订单未完成,请联系管理员!");
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 检查订单&返回订单出货单列表 deviceId ---->equNum
|