Commit 152c3237 by wxh

修改了房间接口的问题

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