Commit 152c3237 by wxh

修改了房间接口的问题

parent 655e11f6
......@@ -26,6 +26,8 @@ public class RoomEntity {
private Integer room_number;
@Column(name = "room_name", nullable = false)
private String room_name;
@Column(name = "room_user", nullable = false)
private String room_user;
@Column(name = "room_status", nullable = false)
private Integer room_status;
@Column(name = "add_id", nullable = false)
......
......@@ -31,7 +31,7 @@ public class BuildingsListFetcher implements DataFetcher {
public Object get(DataFetchingEnvironment env) throws Exception {
// + schoolId
String hql = "from Buildings 1=1 ";
String hql = "from Buildings where 1=1 ";
GQLPageParam page = EnvArgsMapper.MAPPER.fromArgs(env);
......
......@@ -28,7 +28,7 @@ public class GoodsManageListFetcher implements DataFetcher {
public Object get(DataFetchingEnvironment env) throws Exception {
// + schoolId
String hql = "from GoodsManage 1=1 ";
String hql = "from GoodsManage where 1=1 ";
GQLPageParam page = EnvArgsMapper.MAPPER.fromArgs(env);
......@@ -40,8 +40,8 @@ public class GoodsManageListFetcher implements DataFetcher {
if(map.get("goods_name")!=null) {
hql += " and goods_name " + Util.decide("like_" +map.get("goods_name"));
}
if(map.get("good_status")!=null) {
hql += " and good_status " + Util.decide(map.get("good_status"));
if(map.get("goods_status")!=null) {
hql += " and goods_status " + Util.decide(map.get("goods_status"));
}
}
hql += " ORDER BY created_at DESC ";
......
......@@ -31,7 +31,7 @@ public class SeleFloorListFetcher implements DataFetcher {
public Object get(DataFetchingEnvironment env) throws Exception {
// + schoolId
String hql = "from FloorEntity 1=1 ";
String hql = "from FloorEntity where 1=1 ";
GQLPageParam page = EnvArgsMapper.MAPPER.fromArgs(env);
......
......@@ -31,7 +31,7 @@ public class SeleRoomListFetcher implements DataFetcher {
public Object get(DataFetchingEnvironment env) throws Exception {
// + schoolId
String hql = "from RoomEntity 1=1 ";
String hql = "from RoomEntity where 1=1 ";
GQLPageParam page = EnvArgsMapper.MAPPER.fromArgs(env);
......
......@@ -32,7 +32,7 @@ public class SiteListFetcher implements DataFetcher {
public Object get(DataFetchingEnvironment env) throws Exception {
// + schoolId
String hql = "from RootEntity 1=1 ";
String hql = "from RootEntity where 1=1 ";
GQLPageParam page = EnvArgsMapper.MAPPER.fromArgs(env);
......
......@@ -27,7 +27,7 @@ public class UnitListFetcher implements DataFetcher {
public Object get(DataFetchingEnvironment env) throws Exception {
// + schoolId
String hql = "from Unit 1=1 ";
String hql = "from Unit where 1=1 ";
GQLPageParam page = EnvArgsMapper.MAPPER.fromArgs(env);
......@@ -36,10 +36,10 @@ public class UnitListFetcher implements DataFetcher {
if (map.get("id") != null) {
hql += " and id " + Util.decide(map.get("id"));
}
if (map.get("building_id") != null) {
if (map.get("unit_name") != null) {
hql += " and unit_name " + Util.decide("like_" +map.get("unit_name"));
}
if (map.get("floor_status") != null) {
if (map.get("unit_status") != null) {
hql += " and unit_status " + Util.decide(map.get("unit_status"));
}
}
......
......@@ -12,6 +12,7 @@ public class GQLRoomInput {
private Integer room_key;
private Integer room_number;
private String room_name;
private String room_user;
private Integer room_status;
private String add_id;
......
......@@ -14,6 +14,7 @@ public class RoomGqlModel {
private Integer room_number;
private String room_name;
private Integer room_status;
private String room_user;
private String add_id;
private Date created_at;
private Date updated_at;
......
......@@ -72,9 +72,7 @@ public class AddBuildingsMutation implements DataFetcher {
if(input.getBuildings_status() != null){
buildings.setBuildings_status(input.getBuildings_status());
}
if(input.getAdd_id() != null){
buildings.setAdd_id(String.valueOf(userId));
}
try {
buildingsDao.saveOrUpdate(buildings);
} catch (Exception e) {
......
......@@ -68,9 +68,7 @@ public class AddFloorMutation implements DataFetcher {
if(input.getFloor_status() != null){
roomEntity.setFloor_status(input.getFloor_status());
}
if(input.getAdd_id() != null){
roomEntity.setAdd_id(String.valueOf(userId));
}
try {
floorDao.saveOrUpdate(roomEntity);
} catch (Exception e) {
......
......@@ -66,12 +66,8 @@ public class AddGoodsClassifyMutation implements DataFetcher {
if(input.getSort_order() != null){
goodsClassify.setSort_order(input.getSort_order());
}
if(input.getSchool_id() != null){
goodsClassify.setSchool_id(String.valueOf(schoolId));
}
if(input.getAdd_id() != null){
goodsClassify.setAdd_id(String.valueOf(userId));
}
try {
goodsClassifyDao.saveOrUpdate(goodsClassify);
} catch (Exception e) {
......
......@@ -18,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.UUID;
@Component
public class AddGoodsManageMutation implements DataFetcher {
......@@ -71,9 +72,7 @@ public class AddGoodsManageMutation implements DataFetcher {
if(input.getGoods_price() != null){
goodsManage.setGoods_price(input.getGoods_price());
}
if(input.getGoods_number() != null){
goodsManage.setGoods_number(input.getGoods_number());
}
goodsManage.setGoods_number(UUID.randomUUID().toString().substring(24));
if(input.getGoods_stock() != null){
goodsManage.setGoods_stock(input.getGoods_stock());
}
......@@ -83,9 +82,7 @@ public class AddGoodsManageMutation implements DataFetcher {
if(input.getGoods_status() != null){
goodsManage.setGoods_status(input.getGoods_status());
}
if(input.getAdd_id() != null){
goodsManage.setAdd_id(String.valueOf(userId));
}
if(input.getEmploy_time() != null){
goodsManage.setEmploy_time(input.getEmploy_time());
}
......
......@@ -70,12 +70,13 @@ public class AddRoomMutation implements DataFetcher {
if(input.getRoom_name() != null){
roomEntity.setRoom_name(input.getRoom_name());
}
if(input.getRoom_user() != null){
roomEntity.setRoom_user(input.getRoom_user());
}
if(input.getRoom_status() != null){
roomEntity.setRoom_status(input.getRoom_status());
}
if(input.getAdd_id() != null){
roomEntity.setAdd_id(String.valueOf(userId));
}
try {
roomDao.saveOrUpdate(roomEntity);
} catch (Exception e) {
......
......@@ -117,12 +117,8 @@ public class AddRootSiteMutation implements DataFetcher {
if(input.getSort_order() != null){
rootEntity.setSort_order(input.getSort_order());
}
if(input.getSchool_id() != null){
rootEntity.setSchool_id(String.valueOf(schoolId));
}
if(input.getAdd_id() != null){
rootEntity.setAdd_id(String.valueOf(userId));
}
try {
rootDao.saveOrUpdate(rootEntity);
} catch (Exception e) {
......
......@@ -72,9 +72,7 @@ public class AddUnitMutation implements DataFetcher {
if(input.getFloor_end() != null){
unit.setFloor_end(input.getFloor_end());
}
if(input.getAdd_id() != null){
unit.setAdd_id(String.valueOf(userId));
}
try {
unitDao.saveOrUpdate(unit);
} catch (Exception e) {
......
......@@ -8,6 +8,7 @@ server:
port: 8088
connection-timeout: 5000
spring:
application:
name: smartcampus-material
......
......@@ -88,7 +88,7 @@ input GoodsManageInput {
input GoodsManageCondition {
id:Int
goods_name:String
good_status:Int
goods_status:Int
}
type GoodsManageResponse {
code:Int
......
......@@ -7,6 +7,7 @@ input MaterialRoomAdd{
room_name:String
room_status:Int
add_id:String
room_user:String
}
type MaterialRoomListResult {
code:Int
......@@ -25,8 +26,10 @@ type MaterialRoomBean{
room_key:Int
"房间人数"
room_number:Int
"房间人数名称"
"房间名称"
room_name:String
"房间人数名称"
room_user:String
"房间状态"
room_status:Int
"添加人ID"
......@@ -43,6 +46,7 @@ type MaterialRoomResultType{
room_key:Int
room_number:Int
room_name:String
room_user:String
room_status:Int
add_id:String
created_at:Date
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment