Commit 6fb688b8 by sunyunfeng

API提交

parent 1d2a57f0
...@@ -48,6 +48,9 @@ public class SpringBootStart { ...@@ -48,6 +48,9 @@ public class SpringBootStart {
// public final static String SCHEMA_STUDENT = "graphql/student.graphqls"; // public final static String SCHEMA_STUDENT = "graphql/student.graphqls";
// public final static String SCHEMA_ECLASS = "graphql/eclass.graphqls"; // public final static String SCHEMA_ECLASS = "graphql/eclass.graphqls";
public final static String SCHEMA_MATERIAL = "graphql/material.graphqls"; public final static String SCHEMA_MATERIAL = "graphql/material.graphqls";
public final static String SCHEMA_SITE = "graphql/site.graphqls";
public final static String SCHEMA_ROOM = "graphql/room.graphqls";
public final static String SCHEMA_FLOOR = "graphql/floor.graphqls";
// public final static String SCHEMA_SCHOOLBASEINFO= "graphql/schoolbaseinfo.graphqls"; // public final static String SCHEMA_SCHOOLBASEINFO= "graphql/schoolbaseinfo.graphqls";
// public final static String SCHEMA_SYSTEMCTL= "graphql/systemctl.graphqls"; // public final static String SCHEMA_SYSTEMCTL= "graphql/systemctl.graphqls";
// public final static String SCHEMA_STATISTICS= "graphql/teacherstatistics.graphqls"; // public final static String SCHEMA_STATISTICS= "graphql/teacherstatistics.graphqls";
...@@ -89,7 +92,7 @@ public class SpringBootStart { ...@@ -89,7 +92,7 @@ public class SpringBootStart {
* 定义schema文件列表... * 定义schema文件列表...
*/ */
protected String[] getSchemas(){ protected String[] getSchemas(){
return new String[]{SCHEMA_ROOT , SCHEMA_BASIC ,SCHEMA_MATERIAL}; return new String[]{SCHEMA_ROOT , SCHEMA_BASIC ,SCHEMA_MATERIAL,SCHEMA_SITE,SCHEMA_ROOM,SCHEMA_FLOOR};
//return new String[]{SCHEMA_ROOT , SCHEMA_BASIC ,SCHEMA_USER , SCHEMA_TEACHER ,SCHEMA_STUDENT, SCHEMA_ECLASS,SCHEMA_MATERIAL, SCHEMA_SCHOOLBASEINFO,SCHEMA_SYSTEMCTL,SCHEMA_STATISTICS }; //return new String[]{SCHEMA_ROOT , SCHEMA_BASIC ,SCHEMA_USER , SCHEMA_TEACHER ,SCHEMA_STUDENT, SCHEMA_ECLASS,SCHEMA_MATERIAL, SCHEMA_SCHOOLBASEINFO,SCHEMA_SYSTEMCTL,SCHEMA_STATISTICS };
} }
......
package com.orhon.smartcampus.material.modules.management.dao;
import com.orhon.smartcampus.material.basicComponents.baseDao.BaseDaoImpl;
import com.orhon.smartcampus.material.modules.management.entity.FloorEntity;
import com.orhon.smartcampus.material.modules.management.entity.GoodsClassify;
import org.springframework.stereotype.Component;
@Component
public class FloorDao extends BaseDaoImpl<FloorEntity> {
}
package com.orhon.smartcampus.material.modules.management.dao;
import com.orhon.smartcampus.material.basicComponents.baseDao.BaseDaoImpl;
import com.orhon.smartcampus.material.modules.management.entity.RoomEntity;
import com.orhon.smartcampus.material.modules.management.entity.RootEntity;
import org.springframework.stereotype.Component;
@Component
public class RoomDao extends BaseDaoImpl<RoomEntity> {
}
package com.orhon.smartcampus.material.modules.management.dao;
import com.orhon.smartcampus.material.basicComponents.baseDao.BaseDaoImpl;
import com.orhon.smartcampus.material.modules.base.gqlModel.GQLPageParam;
import com.orhon.smartcampus.material.modules.base.mm.EnvArgsMapper;
import com.orhon.smartcampus.material.modules.management.entity.RootEntity;
import graphql.schema.DataFetcher;
import graphql.schema.DataFetchingEnvironment;
import org.springframework.stereotype.Component;
@Component
public class RootDao extends BaseDaoImpl<RootEntity> {
}
package com.orhon.smartcampus.material.modules.management.entity;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import javax.persistence.*;
import java.util.Date;
@Setter
@Getter
@EqualsAndHashCode
@Entity
@Table(name = "material_floor", schema = "material", catalog = "")
public class FloorEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@Column(name = "unit_id", nullable = false)
private int unit_id;
@Column(name = "floor_number", nullable = false)
private int floor_number;
@Column(name = "floor_head", nullable = false)
private String floor_head;
@Column(name = "add_id", nullable = false)
private String add_id;
@Column(name = "created_at", nullable = false)
private Date created_at;
@Column(name = "updated_at", nullable = false)
private Date updated_at;
}
...@@ -20,11 +20,11 @@ public class GoodsClassify { ...@@ -20,11 +20,11 @@ public class GoodsClassify {
@Column(name = "classify_name", nullable = false) @Column(name = "classify_name", nullable = false)
private String classify_name; private String classify_name;
@Column(name = "classify_status", nullable = false) @Column(name = "classify_status", nullable = false)
private Integer classify_status; private String classify_status;
@Column(name = "classify_campus_id", nullable = false) @Column(name = "school_id", nullable = false)
private String classify_campus_id; private String school_id;
@Column(name = "classify_userid", nullable = false) @Column(name = "add_id", nullable = false)
private String classify_userid; private String add_id;
@Column(name = "created_at", nullable = false) @Column(name = "created_at", nullable = false)
private Date created_at; private Date created_at;
@Column(name = "updated_at", nullable = false) @Column(name = "updated_at", nullable = false)
......
package com.orhon.smartcampus.material.modules.management.entity;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import javax.persistence.*;
import java.util.Date;
@Setter
@Getter
@EqualsAndHashCode
@Entity
@Table(name = "material_floor", schema = "material", catalog = "")
public class RoomEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@Column(name = "unit_id", nullable = false)
private int unit_id;
@Column(name = "room_head", nullable = false)
private String room_head;
@Column(name = "room_key_number", nullable = false)
private int room_key_number;
@Column(name = "room_number_of", nullable = false)
private int room_number_of;
@Column(name = "room_list_name", nullable = false)
private String room_list_name;
@Column(name = "room_status", nullable = false)
private String room_status;
@Column(name = "add_id", nullable = false)
private String add_id;
@Column(name = "created_at", nullable = false)
private Date created_at;
@Column(name = "updated_at", nullable = false)
private Date updated_at;
}
package com.orhon.smartcampus.material.modules.management.entity;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import javax.persistence.*;
import java.util.Date;
@Setter
@Getter
@EqualsAndHashCode
@Entity
@Table(name = "material_site_type", schema = "material", catalog = "")
public class RootEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@Column(name = "site_name", nullable = false)
private String site_name;
@Column(name = "site_status", nullable = false)
private String site_status;
@Column(name = "school_id", nullable = false)
private String school_id;
@Column(name = "add_id", nullable = false)
private String add_id;
@Column(name = "created_at", nullable = false)
private Date created_at;
@Column(name = "updated_at", nullable = false)
private Date updated_at;
}
package com.orhon.smartcampus.material.modules.management.fetcher; package com.orhon.smartcampus.material.modules.management.fetcher;
import com.orhon.smartcampus.material.modules.management.mutation.AddFloorMutation;
import com.orhon.smartcampus.material.modules.management.mutation.AddGoodsClassifyMutation; import com.orhon.smartcampus.material.modules.management.mutation.AddGoodsClassifyMutation;
import com.orhon.smartcampus.material.modules.management.mutation.AddRoomMutation;
import com.orhon.smartcampus.material.modules.management.mutation.AddRootSiteMutation;
import graphql.schema.idl.RuntimeWiring; import graphql.schema.idl.RuntimeWiring;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -16,6 +19,32 @@ public class MaterialFetchersLoader { ...@@ -16,6 +19,32 @@ public class MaterialFetchersLoader {
@Autowired @Autowired
GoodsClassifyFetcher goodsClassifyFetcher; GoodsClassifyFetcher goodsClassifyFetcher;
@Autowired
AddRootSiteMutation addRootSiteMutation;
@Autowired
RootBeanFetcher rootBeanFetcher;
@Autowired
SiteListFetcher siteListFetcher;
@Autowired
AddRoomMutation addRoomMutation;
@Autowired
SeleRoomListFetcher seleRoomListFetcher;
@Autowired
SeleRoomOnceFetcher roomOnceFetcher;
@Autowired
AddFloorMutation addFloorMutation;
@Autowired
SeleFloorOnceFetcher seleFloorOnceFetcher;
@Autowired
SeleFloorListFetcher seleFloorListFetcher;
// //
// @Autowired // @Autowired
// AddRoomMutation addRoomMutation; // AddRoomMutation addRoomMutation;
...@@ -88,6 +117,13 @@ public class MaterialFetchersLoader { ...@@ -88,6 +117,13 @@ public class MaterialFetchersLoader {
builder.type("Query" , t->t.dataFetcher("GoodsClassify" , goodsClassifyFetcher)); builder.type("Query" , t->t.dataFetcher("GoodsClassify" , goodsClassifyFetcher));
builder.type("Query" , t->t.dataFetcher("GoodsClassifys" , goodsClassifyListFetcher)); builder.type("Query" , t->t.dataFetcher("GoodsClassifys" , goodsClassifyListFetcher));
builder.type("Query" , t->t.dataFetcher("SeleSite" , rootBeanFetcher));
builder.type("Query" , t->t.dataFetcher("SeleSites" , siteListFetcher));
builder.type("Query" , t->t.dataFetcher("SeleRoom" ,roomOnceFetcher ));
builder.type("Query" , t->t.dataFetcher("SeleRooms" , seleRoomListFetcher));
builder.type("Query" , t->t.dataFetcher("SeleFloor" , seleFloorOnceFetcher));
builder.type("Query" , t->t.dataFetcher("SeleFloors" , seleFloorListFetcher));
// builder.type("Query" , t->t.dataFetcher("Buildings" , buildingListFetcher)); // builder.type("Query" , t->t.dataFetcher("Buildings" , buildingListFetcher));
// builder.type("Query" , t->t.dataFetcher("Building" , buildingFetcher)); // builder.type("Query" , t->t.dataFetcher("Building" , buildingFetcher));
// builder.type("Query" , t->t.dataFetcher("Campuses" , campusListFetcher)); // builder.type("Query" , t->t.dataFetcher("Campuses" , campusListFetcher));
...@@ -102,7 +138,10 @@ public class MaterialFetchersLoader { ...@@ -102,7 +138,10 @@ public class MaterialFetchersLoader {
// builder.type("Mutation" , t->t.dataFetcher("addRoom" , addRoomMutation)); // builder.type("Mutation" , t->t.dataFetcher("addRoom" , addRoomMutation));
// builder.type("Mutation" , t->t.dataFetcher("deleteRoom" , deleteRoomMutation)); // builder.type("Mutation" , t->t.dataFetcher("deleteRoom" , deleteRoomMutation));
builder.type("Mutation" , t->t.dataFetcher("addMaterialRoomAdds" , addRoomMutation));
builder.type("Mutation" , t->t.dataFetcher("addMaterialSiteAdds" , addRootSiteMutation));
builder.type("Mutation" , t->t.dataFetcher("addGoodsClassify" , addGoodsClassifyMutation)); builder.type("Mutation" , t->t.dataFetcher("addGoodsClassify" , addGoodsClassifyMutation));
builder.type("Mutation" , t->t.dataFetcher("addMaterialFloorAdds" , addFloorMutation));
// builder.type("Mutation" , t->t.dataFetcher("deleteFloor" , deleteFloorMutation)); // builder.type("Mutation" , t->t.dataFetcher("deleteFloor" , deleteFloorMutation));
// builder.type("Mutation" , t->t.dataFetcher("addUnit" , addUnitMutation)); // builder.type("Mutation" , t->t.dataFetcher("addUnit" , addUnitMutation));
// builder.type("Mutation" , t->t.dataFetcher("deleteUnit" , deleteUnitMutation)); // builder.type("Mutation" , t->t.dataFetcher("deleteUnit" , deleteUnitMutation));
......
package com.orhon.smartcampus.material.modules.management.fetcher;
import com.orhon.smartcampus.material.modules.management.dao.GoodsClassifyDao;
import com.orhon.smartcampus.material.modules.management.dao.RootDao;
import com.orhon.smartcampus.material.modules.management.entity.GoodsClassify;
import com.orhon.smartcampus.material.modules.management.entity.RootEntity;
import com.orhon.smartcampus.material.modules.management.gqlModel.GQLGoodsClassify;
import com.orhon.smartcampus.material.modules.management.gqlModel.GQLRootBeans;
import com.orhon.smartcampus.material.modules.management.mm.GoodsClassifyMapper;
import com.orhon.smartcampus.material.modules.management.mm.RootBeanMapper;
import graphql.schema.DataFetcher;
import graphql.schema.DataFetchingEnvironment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class RootBeanFetcher implements DataFetcher {
@Autowired
RootDao rootDao;
@Override
public Object get(DataFetchingEnvironment env) throws Exception {
// + schoolId
String hql = "from RootEntity";
RootEntity item = rootDao.findId(hql, null);
if(item!=null) {
GQLRootBeans goodsClassify = RootBeanMapper.MAPPER.toRootsClassify(item);
return goodsClassify;
}
return null;
}
}
package com.orhon.smartcampus.material.modules.management.fetcher;
import com.orhon.smartcampus.material.basicComponents.Result;
import com.orhon.smartcampus.material.modules.base.gqlModel.GQLPageParam;
import com.orhon.smartcampus.material.modules.base.mm.EnvArgsMapper;
import com.orhon.smartcampus.material.modules.management.dao.FloorDao;
import com.orhon.smartcampus.material.modules.management.dao.RoomDao;
import com.orhon.smartcampus.material.modules.management.entity.FloorEntity;
import com.orhon.smartcampus.material.modules.management.entity.RoomEntity;
import com.orhon.smartcampus.material.modules.management.gqlModel.FloorGqlModel;
import com.orhon.smartcampus.material.modules.management.gqlModel.RoomGqlModel;
import com.orhon.smartcampus.material.modules.management.mm.FloorMapper;
import com.orhon.smartcampus.material.modules.management.mm.RoomMapper;
import com.orhon.smartcampus.material.utils.ObjectToMap;
import com.orhon.smartcampus.material.utils.Util;
import graphql.schema.DataFetcher;
import graphql.schema.DataFetchingEnvironment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.List;
@Component
public class SeleFloorListFetcher implements DataFetcher {
@Autowired
FloorDao floorDao;
@Override
public Object get(DataFetchingEnvironment env) throws Exception {
// + schoolId
String hql = "from FloorEntity";
GQLPageParam page = EnvArgsMapper.MAPPER.fromArgs(env);
if(env.containsArgument("condition")) {
HashMap<String,Object> map = ObjectToMap.to(env.getArgument("condition"));
if(map.get("id")!=null) {
hql += "and id " + Util.decide(map.get("id"));
}
if(map.get("unit_id")!=null) {
hql += "and unit_id " + Util.decide(map.get("unit_id"));
}
if(map.get("floor_number")!=null) {
hql += "and floor_number " + Util.decide(map.get("floor_number"));
}
if(map.get("floor_head")!=null) {
hql += "and floor_head " + Util.decide(map.get("floor_head"));
}
if(map.get("add_id")!=null) {
hql += "and add_id " + Util.decide(map.get("add_id"));
}
}
List<FloorEntity> list = floorDao.find(hql,null,page.getPage(),page.getLimit());
// GQLGoodsClassify gqlGoodsClassify = null;
// if (env.getSelectionSet().contains("data/classify")){
// GoodsClassify goodsClassify = item.getBaseSchoolsBySchoolId();
// GgqlSchool = SchoolMapper.MAPPER.toSchool(schools);
// }
//
// GQLUnit gqlUnit=null;
// if (env.getSelectionSet().contains("data/unit")){
// Unit unit = item.getMaterialUnitByUnitId();
// gqlUnit = UnitMapper.MAPPER.toUnit(unit);
// }
//
// GQL floor = FloorMapper.MAPPER.toFloor(item);
// floor.setSchool(GgqlSchool);
// floor.setUnit(gqlUnit);
// GQLFloor.add(floor);
// List<GQLGoodsClassify> GQLFloor = new ArrayList<>();
//
// for (GQLGoodsClassify item : list) {
// // GQLGoodsClassify gqlGoodsClassify = GoodsClassifyMapper.MAPPER.toGoodsClassifyList(item);
// // GQLFloor.add(gqlGoodsClassify);
// }
List<FloorGqlModel> gqlGoodsClassifies = FloorMapper.MAPPER.toFloorList(list);
Long total = 0L;
if (env.getSelectionSet().contains("total")){
total = floorDao.getTotalCount(hql);
}
return Result.ok().put("data", gqlGoodsClassifies).put("total", total);
}
}
package com.orhon.smartcampus.material.modules.management.fetcher;
import com.orhon.smartcampus.material.modules.management.dao.FloorDao;
import com.orhon.smartcampus.material.modules.management.dao.RoomDao;
import com.orhon.smartcampus.material.modules.management.entity.FloorEntity;
import com.orhon.smartcampus.material.modules.management.entity.RoomEntity;
import com.orhon.smartcampus.material.modules.management.gqlModel.FloorGqlModel;
import com.orhon.smartcampus.material.modules.management.gqlModel.RoomGqlModel;
import com.orhon.smartcampus.material.modules.management.mm.FloorMapper;
import com.orhon.smartcampus.material.modules.management.mm.RoomMapper;
import com.sun.scenario.effect.Flood;
import graphql.schema.DataFetcher;
import graphql.schema.DataFetchingEnvironment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class SeleFloorOnceFetcher implements DataFetcher {
@Autowired
FloorDao floorDao;
@Override
public Object get(DataFetchingEnvironment environment) throws Exception {
String hql = "from RoomEntity";
FloorEntity item = floorDao.findId(hql, null);
if(item!=null) {
FloorGqlModel floorGqlModel = FloorMapper.MAPPER.toFloorModel(item);
return floorGqlModel;
}
return null;
}
}
package com.orhon.smartcampus.material.modules.management.fetcher;
import com.orhon.smartcampus.material.basicComponents.Result;
import com.orhon.smartcampus.material.modules.base.gqlModel.GQLPageParam;
import com.orhon.smartcampus.material.modules.base.mm.EnvArgsMapper;
import com.orhon.smartcampus.material.modules.management.dao.GoodsClassifyDao;
import com.orhon.smartcampus.material.modules.management.dao.RoomDao;
import com.orhon.smartcampus.material.modules.management.entity.GoodsClassify;
import com.orhon.smartcampus.material.modules.management.entity.RoomEntity;
import com.orhon.smartcampus.material.modules.management.gqlModel.GQLGoodsClassify;
import com.orhon.smartcampus.material.modules.management.gqlModel.RoomGqlModel;
import com.orhon.smartcampus.material.modules.management.mm.GoodsClassifyMapper;
import com.orhon.smartcampus.material.modules.management.mm.RoomMapper;
import com.orhon.smartcampus.material.utils.ObjectToMap;
import com.orhon.smartcampus.material.utils.Util;
import graphql.schema.DataFetcher;
import graphql.schema.DataFetchingEnvironment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.List;
@Component
public class SeleRoomListFetcher implements DataFetcher {
@Autowired
RoomDao roomDao;
@Override
public Object get(DataFetchingEnvironment env) throws Exception {
// + schoolId
String hql = "from RoomEntity";
GQLPageParam page = EnvArgsMapper.MAPPER.fromArgs(env);
if(env.containsArgument("condition")) {
HashMap<String,Object> map = ObjectToMap.to(env.getArgument("condition"));
if(map.get("id")!=null) {
hql += "and id " + Util.decide(map.get("id"));
}
if(map.get("unit_id")!=null) {
hql += "and unit_id " + Util.decide(map.get("unit_id"));
}
if(map.get("room_head")!=null) {
hql += "and room_head " + Util.decide(map.get("room_head"));
}
if(map.get("room_key_number")!=null) {
hql += "and room_key_number " + Util.decide(map.get("room_key_number"));
}
if(map.get("room_number_of")!=null) {
hql += "and room_number_of " + Util.decide(map.get("room_number_of"));
}
}
List<RoomEntity> list = roomDao.find(hql,null,page.getPage(),page.getLimit());
// GQLGoodsClassify gqlGoodsClassify = null;
// if (env.getSelectionSet().contains("data/classify")){
// GoodsClassify goodsClassify = item.getBaseSchoolsBySchoolId();
// GgqlSchool = SchoolMapper.MAPPER.toSchool(schools);
// }
//
// GQLUnit gqlUnit=null;
// if (env.getSelectionSet().contains("data/unit")){
// Unit unit = item.getMaterialUnitByUnitId();
// gqlUnit = UnitMapper.MAPPER.toUnit(unit);
// }
//
// GQL floor = FloorMapper.MAPPER.toFloor(item);
// floor.setSchool(GgqlSchool);
// floor.setUnit(gqlUnit);
// GQLFloor.add(floor);
// List<GQLGoodsClassify> GQLFloor = new ArrayList<>();
//
// for (GQLGoodsClassify item : list) {
// // GQLGoodsClassify gqlGoodsClassify = GoodsClassifyMapper.MAPPER.toGoodsClassifyList(item);
// // GQLFloor.add(gqlGoodsClassify);
// }
List<RoomGqlModel> gqlGoodsClassifies = RoomMapper.MAPPER.toRoomList(list);
Long total = 0L;
if (env.getSelectionSet().contains("total")){
total = roomDao.getTotalCount(hql);
}
return Result.ok().put("data", gqlGoodsClassifies).put("total", total);
}
}
package com.orhon.smartcampus.material.modules.management.fetcher;
import com.orhon.smartcampus.material.modules.management.dao.RoomDao;
import com.orhon.smartcampus.material.modules.management.dao.RootDao;
import com.orhon.smartcampus.material.modules.management.entity.RoomEntity;
import com.orhon.smartcampus.material.modules.management.entity.RootEntity;
import com.orhon.smartcampus.material.modules.management.gqlModel.GQLRootBeans;
import com.orhon.smartcampus.material.modules.management.gqlModel.RoomGqlModel;
import com.orhon.smartcampus.material.modules.management.mm.RoomMapper;
import com.orhon.smartcampus.material.modules.management.mm.RootBeanMapper;
import graphql.schema.DataFetcher;
import graphql.schema.DataFetchingEnvironment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class SeleRoomOnceFetcher implements DataFetcher {
@Autowired
RoomDao roomDao;
@Override
public Object get(DataFetchingEnvironment environment) throws Exception {
String hql = "from RoomEntity";
RoomEntity item = roomDao.findId(hql, null);
if(item!=null) {
RoomGqlModel goodsClassify = RoomMapper.MAPPER.toRoomModel(item);
return goodsClassify;
}
return null;
}
}
package com.orhon.smartcampus.material.modules.management.fetcher;
import com.orhon.smartcampus.material.basicComponents.Result;
import com.orhon.smartcampus.material.modules.base.gqlModel.GQLPageParam;
import com.orhon.smartcampus.material.modules.base.mm.EnvArgsMapper;
import com.orhon.smartcampus.material.modules.management.dao.GoodsClassifyDao;
import com.orhon.smartcampus.material.modules.management.dao.RootDao;
import com.orhon.smartcampus.material.modules.management.entity.GoodsClassify;
import com.orhon.smartcampus.material.modules.management.entity.RootEntity;
import com.orhon.smartcampus.material.modules.management.gqlModel.GQLGoodsClassify;
import com.orhon.smartcampus.material.modules.management.gqlModel.GQLRootBeans;
import com.orhon.smartcampus.material.modules.management.inputMapper.RootInputMapper;
import com.orhon.smartcampus.material.modules.management.mm.GoodsClassifyMapper;
import com.orhon.smartcampus.material.modules.management.mm.RootBeanMapper;
import com.orhon.smartcampus.material.utils.ObjectToMap;
import com.orhon.smartcampus.material.utils.Util;
import graphql.schema.DataFetcher;
import graphql.schema.DataFetchingEnvironment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.List;
@Component
public class SiteListFetcher implements DataFetcher {
@Autowired
RootDao rootDao;
@Override
public Object get(DataFetchingEnvironment env) throws Exception {
// + schoolId
String hql = "from RootEntity";
GQLPageParam page = EnvArgsMapper.MAPPER.fromArgs(env);
if(env.containsArgument("condition")) {
HashMap<String,Object> map = ObjectToMap.to(env.getArgument("condition"));
if(map.get("site_name")!=null) {
hql += "and site_name " + Util.decide(map.get("site_name"));
}
if(map.get("site_status")!=null) {
hql += "and site_status " + Util.decide(map.get("site_status"));
}
if(map.get("school_id")!=null) {
hql += "and school_id " + Util.decide(map.get("school_id"));
}
if(map.get("add_id")!=null) {
hql += "and add_id " + Util.decide(map.get("add_id"));
}
}
List<RootEntity> list = rootDao.find(hql,null,page.getPage(),page.getLimit());
// GQLGoodsClassify gqlGoodsClassify = null;
// if (env.getSelectionSet().contains("data/classify")){
// GoodsClassify goodsClassify = item.getBaseSchoolsBySchoolId();
// GgqlSchool = SchoolMapper.MAPPER.toSchool(schools);
// }
//
// GQLUnit gqlUnit=null;
// if (env.getSelectionSet().contains("data/unit")){
// Unit unit = item.getMaterialUnitByUnitId();
// gqlUnit = UnitMapper.MAPPER.toUnit(unit);
// }
//
// GQL floor = FloorMapper.MAPPER.toFloor(item);
// floor.setSchool(GgqlSchool);
// floor.setUnit(gqlUnit);
// GQLFloor.add(floor);
// List<GQLGoodsClassify> GQLFloor = new ArrayList<>();
//
// for (GQLGoodsClassify item : list) {
// // GQLGoodsClassify gqlGoodsClassify = GoodsClassifyMapper.MAPPER.toGoodsClassifyList(item);
// // GQLFloor.add(gqlGoodsClassify);
// }
List<GQLRootBeans> gqlGoodsClassifies = RootBeanMapper.MAPPER.toRootList(list);
Long total = 0L;
if (env.getSelectionSet().contains("total")){
total = rootDao.getTotalCount(hql);
}
return Result.ok().put("data", gqlGoodsClassifies).put("total", total);
}
}
package com.orhon.smartcampus.material.modules.management.gqlInputModel;
import lombok.Data;
@Data
public class GQLFloorInput {
private Integer id;
private Integer unit_id;
private Integer floor_number;
private String floor_head;
private String add_id;
}
...@@ -11,9 +11,10 @@ public class GQLGoodsClassifyInput { ...@@ -11,9 +11,10 @@ public class GQLGoodsClassifyInput {
private String classify_name; private String classify_name;
private Integer classify_status; private String classify_status;
private String classify_campus_id; private String school_id;
private String add_id;
private String classify_userid;
} }
package com.orhon.smartcampus.material.modules.management.gqlInputModel;
import lombok.Data;
@Data
public class GQLRoomInput {
private Long id;
private int unit_id;
private int site_status;
private String room_head;
private String add_id;
private String room_list_name;
private String room_status;
}
package com.orhon.smartcampus.material.modules.management.gqlInputModel;
import lombok.Data;
@Data
public class GQLRootInput {
private int unit_id;
private int site_status;
private String floor_head;
private String add_id;
private String room_list_name;
private String room_status;
}
package com.orhon.smartcampus.material.modules.management.gqlModel;
import lombok.Data;
import java.util.Date;
@Data
public class FloorGqlModel {
private int id;
private int unit_id;
private int floor_number;
private String floor_head;
private String add_id;
private Date created_at;
private Date updated_at;
}
...@@ -6,11 +6,11 @@ import java.util.Date; ...@@ -6,11 +6,11 @@ import java.util.Date;
@Data @Data
public class GQLGoodsClassify { public class GQLGoodsClassify {
private Long id; private int id;
private String classify_name; private String classify_name;
private Integer classify_status; private String classify_status;
private String classify_campus_id; private String school_id;
private String classify_userid; private String add_id;
private Date created_at; private Date created_at;
private Date updated_at; private Date updated_at;
} }
package com.orhon.smartcampus.material.modules.management.gqlModel;
import lombok.Data;
import java.util.Date;
@Data
public class GQLRootBeans {
private int id;
private String site_name;
private String site_status;
private String school_id;
private String add_id;
private Date created_at;
private Date updated_at;
}
package com.orhon.smartcampus.material.modules.management.gqlModel;
import lombok.Data;
import javax.persistence.Column;
import java.util.Date;
@Data
public class RoomGqlModel {
private int id;
private int unit_id;
private String room_head;
private String add_id;
private int room_number_of;
private int room_key_number;
private String room_list_name;
private String room_status;
private Date created_at;
private Date updated_at;
}
package com.orhon.smartcampus.material.modules.management.inputMapper;
import com.alibaba.fastjson.JSON;
import com.orhon.smartcampus.material.basicComponents.ConvertHelper;
import com.orhon.smartcampus.material.modules.management.gqlInputModel.GQLFloorInput;
import com.orhon.smartcampus.material.modules.management.gqlInputModel.GQLRoomInput;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import java.util.Map;
@Mapper(uses = {
ConvertHelper.class
})
public interface FloomInputMapper {
FloomInputMapper MAPPER = Mappers.getMapper(FloomInputMapper.class);
default GQLFloorInput mapInput(final Map map){
String json = JSON.toJSONString(map);
GQLFloorInput input = JSON.parseObject(json , GQLFloorInput.class);
return input;
}
}
package com.orhon.smartcampus.material.modules.management.inputMapper;
import com.alibaba.fastjson.JSON;
import com.orhon.smartcampus.material.basicComponents.ConvertHelper;
import com.orhon.smartcampus.material.modules.management.gqlInputModel.GQLRoomInput;
import com.orhon.smartcampus.material.modules.management.gqlModel.GQLRootBeans;
import com.orhon.smartcampus.material.modules.management.gqlModel.RoomGqlModel;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import java.util.Map;
@Mapper(uses = {
ConvertHelper.class
})
public interface RoomInputMapper {
RoomInputMapper MAPPER = Mappers.getMapper(RoomInputMapper.class);
default GQLRoomInput mapInput(final Map map){
String json = JSON.toJSONString(map);
GQLRoomInput input = JSON.parseObject(json , GQLRoomInput.class);
return input;
}
}
package com.orhon.smartcampus.material.modules.management.inputMapper;
import com.alibaba.fastjson.JSON;
import com.orhon.smartcampus.material.basicComponents.ConvertHelper;
import com.orhon.smartcampus.material.modules.management.gqlInputModel.GQLGoodsClassifyInput;
import com.orhon.smartcampus.material.modules.management.gqlModel.GQLRootBeans;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import java.util.Map;
@Mapper(uses = {
ConvertHelper.class
})
public interface RootInputMapper {
RootInputMapper MAPPER = Mappers.getMapper(RootInputMapper.class);
default GQLRootBeans mapInput(final Map map){
String json = JSON.toJSONString(map);
GQLRootBeans input = JSON.parseObject(json , GQLRootBeans.class);
return input;
}
}
package com.orhon.smartcampus.material.modules.management.mm;
import com.orhon.smartcampus.material.basicComponents.ConvertHelper;
import com.orhon.smartcampus.material.modules.management.entity.FloorEntity;
import com.orhon.smartcampus.material.modules.management.entity.RoomEntity;
import com.orhon.smartcampus.material.modules.management.gqlModel.FloorGqlModel;
import com.orhon.smartcampus.material.modules.management.gqlModel.RoomGqlModel;
import org.mapstruct.InheritConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import java.util.List;
@Mapper(
uses = {
ConvertHelper.class
}
)
public interface FloorMapper {
FloorMapper MAPPER = Mappers.getMapper(FloorMapper.class);
@Mapping(source = "id" , target = "id")
@Mapping(source = "unit_id" , target = "unit_id")
@Mapping(source = "floor_number" , target = "floor_number")
@Mapping(source = "floor_head" , target = "floor_head")
@Mapping(source = "add_id" , target = "add_id")
@Mapping(source = "created_at" , target = "created_at")
@Mapping(source = "updated_at" , target = "updated_at")
FloorGqlModel toFloorModel(FloorEntity entity);
@InheritConfiguration(name = "toFloorList")
List<FloorGqlModel> toFloorList(List<FloorEntity> entities);
}
...@@ -23,8 +23,8 @@ public interface GoodsClassifyMapper { ...@@ -23,8 +23,8 @@ public interface GoodsClassifyMapper {
@Mapping(source = "id" , target = "id") @Mapping(source = "id" , target = "id")
@Mapping(source = "classify_name" , target = "classify_name") @Mapping(source = "classify_name" , target = "classify_name")
@Mapping(source = "classify_status" , target = "classify_status") @Mapping(source = "classify_status" , target = "classify_status")
@Mapping(source = "classify_campus_id" , target = "classify_campus_id") @Mapping(source = "school_id" , target = "school_id")
@Mapping(source = "classify_userid" , target = "classify_userid") @Mapping(source = "add_id" , target = "add_id")
@Mapping(source = "created_at" , target = "created_at") @Mapping(source = "created_at" , target = "created_at")
@Mapping(source = "updated_at" , target = "updated_at") @Mapping(source = "updated_at" , target = "updated_at")
GQLGoodsClassify toGoodsClassify(GoodsClassify entity); GQLGoodsClassify toGoodsClassify(GoodsClassify entity);
......
package com.orhon.smartcampus.material.modules.management.mm;
import com.orhon.smartcampus.material.basicComponents.ConvertHelper;
import com.orhon.smartcampus.material.modules.management.entity.RoomEntity;
import com.orhon.smartcampus.material.modules.management.entity.RootEntity;
import com.orhon.smartcampus.material.modules.management.gqlModel.GQLRootBeans;
import com.orhon.smartcampus.material.modules.management.gqlModel.RoomGqlModel;
import org.mapstruct.InheritConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import java.util.List;
@Mapper(
uses = {
ConvertHelper.class
}
)
public interface RoomMapper {
RoomMapper MAPPER = Mappers.getMapper(RoomMapper.class);
@Mapping(source = "id" , target = "id")
@Mapping(source = "unit_id" , target = "unit_id")
@Mapping(source = "room_head" , target = "room_head")
@Mapping(source = "room_key_number" , target = "room_key_number")
@Mapping(source = "room_number_of" , target = "room_number_of")
@Mapping(source = "room_list_name" , target = "room_list_name")
@Mapping(source = "room_status" , target = "room_status")
@Mapping(source = "add_id" , target = "add_id")
@Mapping(source = "created_at" , target = "created_at")
@Mapping(source = "updated_at" , target = "updated_at")
RoomGqlModel toRoomModel(RoomEntity entity);
@InheritConfiguration(name = "toRoomList")
List<RoomGqlModel> toRoomList(List<RoomEntity> entities);
}
package com.orhon.smartcampus.material.modules.management.mm;
import com.orhon.smartcampus.material.basicComponents.ConvertHelper;
import com.orhon.smartcampus.material.modules.management.entity.GoodsClassify;
import com.orhon.smartcampus.material.modules.management.entity.RootEntity;
import com.orhon.smartcampus.material.modules.management.gqlModel.GQLGoodsClassify;
import com.orhon.smartcampus.material.modules.management.gqlModel.GQLRootBeans;
import org.mapstruct.InheritConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import java.util.List;
@Mapper(
uses = {
ConvertHelper.class
}
)
public interface RootBeanMapper {
RootBeanMapper MAPPER = Mappers.getMapper(RootBeanMapper.class);
@Mapping(source = "id" , target = "id")
@Mapping(source = "site_name" , target = "site_name")
@Mapping(source = "site_status" , target = "site_status")
@Mapping(source = "school_id" , target = "school_id")
@Mapping(source = "add_id" , target = "add_id")
@Mapping(source = "created_at" , target = "created_at")
@Mapping(source = "updated_at" , target = "updated_at")
GQLRootBeans toRootsClassify(RootEntity entity);
@InheritConfiguration(name = "toGoodsClassify")
List<GQLRootBeans> toRootList(List<RootEntity> entities);
}
package com.orhon.smartcampus.material.modules.management.mutation;
import com.orhon.smartcampus.material.basicComponents.Result;
import com.orhon.smartcampus.material.modules.management.dao.FloorDao;
import com.orhon.smartcampus.material.modules.management.dao.RoomDao;
import com.orhon.smartcampus.material.modules.management.entity.FloorEntity;
import com.orhon.smartcampus.material.modules.management.entity.RoomEntity;
import com.orhon.smartcampus.material.modules.management.gqlInputModel.GQLFloorInput;
import com.orhon.smartcampus.material.modules.management.gqlInputModel.GQLRoomInput;
import com.orhon.smartcampus.material.modules.management.inputMapper.FloomInputMapper;
import com.orhon.smartcampus.material.modules.management.inputMapper.RoomInputMapper;
import graphql.schema.DataFetcher;
import graphql.schema.DataFetchingEnvironment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
@Component
public class AddFloorMutation implements DataFetcher {
@Autowired
FloorDao floorDao;
/**
* Room管理添加
* editor : ths
*/
@Override
public Object get(DataFetchingEnvironment environment) throws Exception {
//String token = (String) SecurityUtils.getSubject().getPrincipal();
GQLFloorInput input = FloomInputMapper.MAPPER.mapInput(environment.getArgument("inputData"));
FloorEntity roomEntity = null;
if (input.getId() != null) {
roomEntity = floorDao.get(FloorEntity.class, input.getId());
roomEntity.setUpdated_at(new Date());
} else {
roomEntity = new FloorEntity();
roomEntity.setCreated_at(new Date());
}
if(input.getAdd_id() != null){
roomEntity.setAdd_id(input.getAdd_id());
}
if(input.getFloor_head() != null){
roomEntity.setFloor_head(input.getFloor_head());
}
if(input.getFloor_number() != null){
roomEntity.setFloor_number(input.getFloor_number());
}
if(input.getUnit_id() != null){
roomEntity.setUnit_id(input.getUnit_id());
}
try {
floorDao.saveOrUpdate(roomEntity);
} catch (Exception e) {
return Result.error(500, "" + e);
}
return Result.ok();
}
}
...@@ -44,17 +44,17 @@ public class AddGoodsClassifyMutation implements DataFetcher { ...@@ -44,17 +44,17 @@ public class AddGoodsClassifyMutation implements DataFetcher {
goodsClassify.setClassify_name(input.getClassify_name()); goodsClassify.setClassify_name(input.getClassify_name());
} }
if(input.getClassify_campus_id() != null){ if(input.getSchool_id() != null){
goodsClassify.setClassify_campus_id(input.getClassify_campus_id()); goodsClassify.setSchool_id(input.getSchool_id());
} }
if(input.getClassify_status() != null){ if(input.getClassify_status() != null){
goodsClassify.setClassify_status(input.getClassify_status()); goodsClassify.setClassify_status(input.getClassify_status());
} }
if(input.getClassify_userid() != null){ if(input.getAdd_id() != null){
goodsClassify.setClassify_userid(JSON.toJSONString(input.getClassify_userid())); goodsClassify.setAdd_id(JSON.toJSONString(input.getAdd_id()));
} }
try { try {
goodsClassifyDao.saveOrUpdate(goodsClassify); goodsClassifyDao.saveOrUpdate(goodsClassify);
......
package com.orhon.smartcampus.material.modules.management.mutation;
import com.alibaba.fastjson.JSON;
import com.orhon.smartcampus.material.basicComponents.Result;
import com.orhon.smartcampus.material.modules.management.dao.GoodsClassifyDao;
import com.orhon.smartcampus.material.modules.management.dao.RoomDao;
import com.orhon.smartcampus.material.modules.management.entity.GoodsClassify;
import com.orhon.smartcampus.material.modules.management.entity.RoomEntity;
import com.orhon.smartcampus.material.modules.management.gqlInputModel.GQLGoodsClassifyInput;
import com.orhon.smartcampus.material.modules.management.gqlInputModel.GQLRoomInput;
import com.orhon.smartcampus.material.modules.management.inputMapper.GoodsClassifyInputMapper;
import com.orhon.smartcampus.material.modules.management.inputMapper.RoomInputMapper;
import graphql.schema.DataFetcher;
import graphql.schema.DataFetchingEnvironment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
@Component
public class AddRoomMutation implements DataFetcher {
@Autowired
RoomDao roomDao;
/**
* Room管理添加
* editor : ths
*/
@Override
public Object get(DataFetchingEnvironment environment) throws Exception {
//String token = (String) SecurityUtils.getSubject().getPrincipal();
GQLRoomInput input = RoomInputMapper.MAPPER.mapInput(environment.getArgument("inputData"));
RoomEntity roomEntity = null;
if (input.getId() != null) {
roomEntity = roomDao.get(RoomEntity.class, input.getId());
roomEntity.setUpdated_at(new Date());
} else {
roomEntity = new RoomEntity();
roomEntity.setCreated_at(new Date());
}
if(input.getAdd_id() != null){
roomEntity.setAdd_id(input.getAdd_id());
}
if(input.getRoom_head() != null){
roomEntity.setRoom_head(input.getRoom_head());
}
if(input.getRoom_list_name() != null){
roomEntity.setRoom_list_name(input.getRoom_list_name());
}
if(!String.valueOf(input.getRoom_status()).equals("null")){
roomEntity.setRoom_status(input.getRoom_status());
}
try {
roomDao.saveOrUpdate(roomEntity);
} catch (Exception e) {
return Result.error(500, "" + e);
}
return Result.ok();
}
}
package com.orhon.smartcampus.material.modules.management.mutation;
import com.alibaba.fastjson.JSON;
import com.orhon.smartcampus.material.basicComponents.Result;
import com.orhon.smartcampus.material.modules.management.dao.GoodsClassifyDao;
import com.orhon.smartcampus.material.modules.management.dao.RootDao;
import com.orhon.smartcampus.material.modules.management.entity.GoodsClassify;
import com.orhon.smartcampus.material.modules.management.entity.RootEntity;
import com.orhon.smartcampus.material.modules.management.gqlInputModel.GQLGoodsClassifyInput;
import com.orhon.smartcampus.material.modules.management.gqlInputModel.GQLRootInput;
import com.orhon.smartcampus.material.modules.management.gqlModel.GQLRootBeans;
import com.orhon.smartcampus.material.modules.management.inputMapper.GoodsClassifyInputMapper;
import com.orhon.smartcampus.material.modules.management.inputMapper.RootInputMapper;
import com.orhon.smartcampus.material.utils.ObjectToMap;
import com.orhon.smartcampus.material.utils.Util;
import graphql.schema.DataFetcher;
import graphql.schema.DataFetchingEnvironment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@Component
public class AddRootSiteMutation implements DataFetcher {
@Autowired
RootDao rootDao;
/**
* 楼层管理
* editor : ths
*/
@Override
public Object get(DataFetchingEnvironment environment) throws Exception {
//String token = (String) SecurityUtils.getSubject().getPrincipal();
try {
GQLRootBeans input = RootInputMapper.MAPPER.mapInput(environment.getArgument("inputData"));
String hql = "from RootEntity as site where 1=1";
RootEntity goodsClassify = null;
if(environment.containsArgument("inputData")){
HashMap<String,Object> map = ObjectToMap.to(environment.getArgument("inputData"));
if(map.get("site_name")!=null){
hql+= "and site.site_name" + Util.decide(map.get("site_name"));
}
if(map.get("school_id")!=null){
hql+= "and site.school_id" + Util.decide(map.get("school_id"));
}
if(map.get("add_id")!=null){
hql+= "and site.add_id" + Util.decide(map.get("add_id"));
}
}
List<RootEntity> rootEntityList = rootDao.find(hql,null);
if(rootEntityList==null||rootEntityList.size()<=0){
goodsClassify = rootEntityList.get(0);
goodsClassify.setUpdated_at(new Date());
}else{
goodsClassify = new RootEntity();
goodsClassify.setCreated_at(new Date());
}
if(!String.valueOf(input.getSchool_id()).equals("null")){
goodsClassify.setSchool_id(input.getSchool_id());
}
if(!String.valueOf(input.getAdd_id()).equals("null")){
goodsClassify.setAdd_id(input.getAdd_id());
}
if(!String.valueOf(input.getSite_name()).equals("null")){
goodsClassify.setSite_name(input.getSite_name());
}
if(input.getSite_status() != null){
goodsClassify.setSite_status(input.getSite_status());
}
rootDao.saveOrUpdate(goodsClassify);
} catch (Exception e) {
return Result.error(500, "" + e);
}
return Result.ok();
}
}
...@@ -2,7 +2,7 @@ spring: ...@@ -2,7 +2,7 @@ spring:
datasource: datasource:
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
#url: jdbc:mysql://39.104.181.104:3311/smartcloud?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&useSSL=true #url: jdbc:mysql://39.104.181.104:3311/smartcloud?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&useSSL=true
url: jdbc:mysql://localhost:3306/material?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&useSSL=true url: jdbc:mysql://192.168.2.117:3306/material?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&useSSL=true
username: root username: root
password: weixuanhe2233 password: weixuanhe2233
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
......
input MaterialFloorAdd{
unit_id:Int
floor_number:Int
floor_head:String
add_id:String
}
type MaterialFloorListResult {
code:Int
msg:String
data:[MaterialFloorResultType]
total:Int
}
type MaterialFloorBean{
id:Int
site_name:String
site_status:Int
school_id:String
add_id:String
created_at:DateTime
updated_at:DateTime
}
type MaterialFloorResultType{
id:Int
unit_id:Int
floor_number:Int
floor_head:String
add_id:String
created_at:DateTime
updated_at:DateTime
}
input MaterialFloorResult{
id:Int
unit_id:Int
floor_number:Int
floor_head:String
add_id:String
created_at:DateTime
updated_at:DateTime
}
\ No newline at end of file
"楼层" #物品分类
type GoodsClassify { type GoodsClassify {
id:Long id:Int
"单元"
classify_name:String classify_name:String
"楼层电话"
classify_status:Int classify_status:Int
"楼层负责人"
classify_campus_id:String classify_campus_id:String
"楼层名"
classify_userid:String classify_userid:String
} }
...@@ -31,4 +27,45 @@ type GoodsClassifyResponse { ...@@ -31,4 +27,45 @@ type GoodsClassifyResponse {
msg:String msg:String
data:[GoodsClassify] data:[GoodsClassify]
total:Int total:Int
}
#物品管理
type GoodsManage {
id:Int
classify_id:String
goods_name:String
main_image:String
sub_images:String
goods_number:String
good_status:Int
goods_price:String
goods_stock:String
userid:String
school_id:String
}
input GoodsManageInput {
id:Int
classify_id:String
goods_name:String
main_image:String
sub_images:String
goods_number:String
good_status:Int
goods_price:String
goods_stock:String
userid:String
school_id:String
}
input GoodsManageCondition {
id:Int
code:String
userid:String
school_id:String
classify_id:String
}
type GoodsManageResponse {
code:Int
msg:String
data:[GoodsManage]
total:Int
} }
\ No newline at end of file
input MaterialRoomAdd{
unit_id:Int
room_head:String
room_key_number:Int
room_number_of:Int
room_list_name:String
room_status:String
add_id:String
}
type MaterialRoomListResult {
code:Int
msg:String
data:[MaterialRoomResultType]
total:Int
}
type MaterialRoomBean{
id:Int
unit_id:Int
room_head:String
room_key_number:Int
room_number_of:Int
room_list_name:String
room_status:String
add_id:String
created_at:DateTime
updated_at:DateTime
}
type MaterialRoomResultType{
id:Int
unit_id:Int
room_head:String
room_key_number:Int
room_number_of:Int
room_list_name:String
room_status:String
add_id:String
created_at:DateTime
updated_at:DateTime
}
input MaterialRoomResult{
id:Int
unit_id:Int
room_head:String
room_key_number:Int
room_number_of:Int
room_list_name:String
room_status:String
add_id:String
created_at:DateTime
updated_at:DateTime
}
\ No newline at end of file
type Query { type Query {
query:Query query:Query
#Floor查询
hello(a:SubjectType):String SeleFloor(id:Int!):MaterialFloorResultType
SeleFloors(page:Int,limit:Int,condition: MaterialFloorResult):MaterialFloorListResult
#Room查询
SeleRoom(id:Int!):MaterialRoomResultType
SeleRooms(page:Int,limit:Int,condition: MaterialRoomAdd):MaterialRoomListResult
#场地查询
SeleSite(id:Int!):MaterialSiteResultType
SeleSites(page:Int,limit:Int,condition: MaterialSiteResult):MaterialSiteListResult
#物品分类
GoodsClassifys(page:Int,limit:Int,condition: GoodsClassifyCondition):GoodsClassifyResponse GoodsClassifys(page:Int,limit:Int,condition: GoodsClassifyCondition):GoodsClassifyResponse
GoodsClassify(id:Long!):GoodsClassify GoodsClassify(id:Int!):GoodsClassify
#物品管理
GoodsManages(page:Int,limit:Int,condition: GoodsManageCondition):GoodsManageResponse
GoodsManage(id:Int!):GoodsManage
} }
input MessageInput{
hello:String
}
type Mutation { type Mutation {
addGoodsClassify(inputData:GoodsClassifyInput): GoodsClassifyResponse #Floor添加
addMaterialFloorAdds(inputData:MaterialFloorAdd):NormalResponse
#Room添加
addMaterialRoomAdds(inputData:MaterialRoomAdd):NormalResponse
#场地添加
addMaterialSiteAdds(inputData:MaterialSiteAdd):NormalResponse
#物品分类
addGoodsClassify(inputData:GoodsClassifyInput): GoodsClassifyResponse
#物品管理
addGoodsManage(inputData:GoodsManageInput): GoodsManageResponse
} }
input MaterialSiteAdd{
site_name:String
site_status:Int
school_id:String
add_id:String
}
type MaterialSiteListResult {
code:Int
msg:String
data:[MaterialSiteResultType]
total:Int
}
type MaterialSiteBean{
id:Int
site_name:String
site_status:Int
school_id:String
add_id:String
created_at:DateTime
updated_at:DateTime
}
type MaterialSiteResultType{
id:Int
site_name:String
site_status:Int
school_id:String
add_id:String
created_at:DateTime
updated_at:DateTime
}
input MaterialSiteResult{
id:Int
site_name:String
site_status:Int
school_id:String
add_id:String
created_at:DateTime
updated_at:DateTime
}
\ No newline at end of file
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