Commit 12933106 authored by 廖旭伟's avatar 廖旭伟

基础设置平台模块管理增加模块类型字段

parent e0e14ff0
...@@ -192,3 +192,8 @@ PRIMARY KEY (`id`) ...@@ -192,3 +192,8 @@ PRIMARY KEY (`id`)
ALTER TABLE mortals_sys_app_category ADD COLUMN `cover` varchar(256) DEFAULT '' COMMENT '封面' AFTER sort; ALTER TABLE mortals_sys_app_category ADD COLUMN `cover` varchar(256) DEFAULT '' COMMENT '封面' AFTER sort;
ALTER TABLE mortals_sys_app_category ADD COLUMN `remark` varchar(256) DEFAULT '' COMMENT '备注' AFTER cover; ALTER TABLE mortals_sys_app_category ADD COLUMN `remark` varchar(256) DEFAULT '' COMMENT '备注' AFTER cover;
-- ----------------------------
2023-08-29
-- ----------------------------
ALTER TABLE `mortals_sys_model` ADD COLUMN `type` tinyint(2) DEFAULT '1' COMMENT '模块分类' AFTER `sort`;
\ No newline at end of file
package com.mortals.xhx.common.code;
import com.mortals.framework.ap.SysConstains;
import com.mortals.framework.common.IBaseEnum;
import java.util.LinkedHashMap;
import java.util.Map;
public enum ModelTypeEnum implements IBaseEnum {
JC(1,"平台基础能力",SysConstains.STYLE_DEFAULT),
G2G(2,"G2G:政府面向政府", SysConstains.STYLE_DEFAULT),
G2C(3,"G2C:政府面向公民", SysConstains.STYLE_DEFAULT),
;
private int value;
private String desc;
private String style;
ModelTypeEnum(int value, String desc, String style) {
this.value = value;
this.desc = desc;
this.style = style;
}
@Override
public int getValue() {
return this.value;
}
@Override
public String getDesc() {
return this.desc;
}
@Override
public String getStyle() {
return this.style;
}
public static ModelTypeEnum getByValue(int value) {
for (ModelTypeEnum e : ModelTypeEnum.values()) {
if (e.getValue() == value) {
return e;
}
}
return null;
}
public static Map<String,String> getEnumMap(int... eItem) {
Map<String,String> resultMap= new LinkedHashMap<String,String>();
for (ModelTypeEnum item : ModelTypeEnum.values()) {
try{
boolean hasE = false;
for (int e : eItem){
if(item.getValue()==e){
hasE = true;
break;
}
}
if(!hasE){
resultMap.put(item.getValue()+"", item.getDesc());
}
}catch(Exception ex){
}
}
return resultMap;
}
}
\ No newline at end of file
package com.mortals.xhx.module.model.model; package com.mortals.xhx.module.model.model;
import java.util.List;
import java.util.ArrayList;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.model.model.vo.ModelVo; import com.mortals.xhx.module.model.model.vo.ModelVo;
/** /**
* 模块实体对象 * 模块实体对象
...@@ -45,7 +38,10 @@ public class ModelEntity extends ModelVo { ...@@ -45,7 +38,10 @@ public class ModelEntity extends ModelVo {
@JSONField(serialize = false) @JSONField(serialize = false)
private Integer sort; private Integer sort;
/**
* 模块分类
*/
private Integer type;
public ModelEntity(){} public ModelEntity(){}
/** /**
...@@ -133,8 +129,20 @@ public class ModelEntity extends ModelVo { ...@@ -133,8 +129,20 @@ public class ModelEntity extends ModelVo {
this.sort = sort; this.sort = sort;
} }
/**
* 获取 模块分类
* @return Integer
*/
public Integer getType() {
return type;
}
/**
* 设置 模块分类
* @param type
*/
public void setType(Integer type) {
this.type = type;
}
@Override @Override
public int hashCode() { public int hashCode() {
...@@ -160,6 +168,7 @@ public class ModelEntity extends ModelVo { ...@@ -160,6 +168,7 @@ public class ModelEntity extends ModelVo {
sb.append(",modelUrl:").append(getModelUrl()); sb.append(",modelUrl:").append(getModelUrl());
sb.append(",remark:").append(getRemark()); sb.append(",remark:").append(getRemark());
sb.append(",sort:").append(getSort()); sb.append(",sort:").append(getSort());
sb.append(",type:").append(getType());
return sb.toString(); return sb.toString();
} }
...@@ -176,5 +185,7 @@ public class ModelEntity extends ModelVo { ...@@ -176,5 +185,7 @@ public class ModelEntity extends ModelVo {
this.remark = null; this.remark = null;
this.sort = 0; this.sort = 0;
this.type = 1;
} }
} }
\ No newline at end of file
package com.mortals.xhx.module.model.model; package com.mortals.xhx.module.model.model;
import java.util.List; import java.util.List;
import com.mortals.xhx.module.model.model.ModelEntity;
/** /**
* 模块查询对象 * 模块查询对象
* *
...@@ -72,6 +71,21 @@ public class ModelQuery extends ModelEntity { ...@@ -72,6 +71,21 @@ public class ModelQuery extends ModelEntity {
/** 结束 修改时间 */ /** 结束 修改时间 */
private String updateTimeEnd; private String updateTimeEnd;
/** 开始 模块分类 */
private Integer typeStart;
/** 结束 模块分类 */
private Integer typeEnd;
/** 增加 模块分类 */
private Integer typeIncrement;
/** 模块分类列表 */
private List <Integer> typeList;
/** 模块分类排除列表 */
private List <Integer> typeNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */ /** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<ModelQuery> orConditionList; private List<ModelQuery> orConditionList;
...@@ -551,6 +565,86 @@ public class ModelQuery extends ModelEntity { ...@@ -551,6 +565,86 @@ public class ModelQuery extends ModelEntity {
return this; return this;
} }
/**
* 获取 开始 模块分类
* @return typeStart
*/
public Integer getTypeStart(){
return this.typeStart;
}
/**
* 设置 开始 模块分类
* @param typeStart
*/
public void setTypeStart(Integer typeStart){
this.typeStart = typeStart;
}
/**
* 获取 结束 模块分类
* @return $typeEnd
*/
public Integer getTypeEnd(){
return this.typeEnd;
}
/**
* 设置 结束 模块分类
* @param typeEnd
*/
public void setTypeEnd(Integer typeEnd){
this.typeEnd = typeEnd;
}
/**
* 获取 增加 模块分类
* @return typeIncrement
*/
public Integer getTypeIncrement(){
return this.typeIncrement;
}
/**
* 设置 增加 模块分类
* @param typeIncrement
*/
public void setTypeIncrement(Integer typeIncrement){
this.typeIncrement = typeIncrement;
}
/**
* 获取 模块分类
* @return typeList
*/
public List<Integer> getTypeList(){
return this.typeList;
}
/**
* 设置 模块分类
* @param typeList
*/
public void setTypeList(List<Integer> typeList){
this.typeList = typeList;
}
/**
* 获取 模块分类
* @return typeNotList
*/
public List<Integer> getTypeNotList(){
return this.typeNotList;
}
/**
* 设置 模块分类
* @param typeNotList
*/
public void setTypeNotList(List<Integer> typeNotList){
this.typeNotList = typeNotList;
}
/** /**
* 设置 排序 * 设置 排序
* @param sort * @param sort
......
package com.mortals.xhx.module.model.web; package com.mortals.xhx.module.model.web;
import com.mortals.framework.annotation.UnAuth; import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.IBaseEnum;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.model.OrderCol; import com.mortals.framework.model.OrderCol;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.ModelTypeEnum;
import com.mortals.xhx.module.model.model.ModelEntity; import com.mortals.xhx.module.model.model.ModelEntity;
import com.mortals.xhx.module.model.model.ModelQuery; import com.mortals.xhx.module.model.model.ModelQuery;
import com.mortals.xhx.module.model.service.ModelService; import com.mortals.xhx.module.model.service.ModelService;
import com.mortals.xhx.module.window.model.WindowMatterEntity;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -24,6 +22,7 @@ import java.util.ArrayList; ...@@ -24,6 +22,7 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
* 模块 * 模块
...@@ -55,6 +54,7 @@ public class ModelController extends BaseCRUDJsonBodyMappingController<ModelServ ...@@ -55,6 +54,7 @@ public class ModelController extends BaseCRUDJsonBodyMappingController<ModelServ
@Override @Override
protected void init(Map<String, Object> model, Context context) { protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "type", IBaseEnum.getEnumMap(ModelTypeEnum.class));
super.init(model, context); super.init(model, context);
} }
...@@ -135,7 +135,18 @@ public class ModelController extends BaseCRUDJsonBodyMappingController<ModelServ ...@@ -135,7 +135,18 @@ public class ModelController extends BaseCRUDJsonBodyMappingController<ModelServ
int code=1; int code=1;
try { try {
List<ModelEntity> result = this.getService().getListBySiteId(query.getSiteId(),query.getIsAdmin()); List<ModelEntity> result = this.getService().getListBySiteId(query.getSiteId(),query.getIsAdmin());
model.put("data", result); Map<Integer,List<ModelEntity>> groupMap = result.stream().collect(Collectors.groupingBy(t -> t.getType()));
List<Map<String,List<ModelEntity>>> mapList = new ArrayList<>();
Map<String,List<ModelEntity>> jcMap = new HashMap<>();
jcMap.put(ModelTypeEnum.JC.getDesc(),groupMap.get(ModelTypeEnum.JC.getValue()));
mapList.add(jcMap);
Map<String,List<ModelEntity>> g2gMap = new HashMap<>();
g2gMap.put(ModelTypeEnum.G2G.getDesc(),groupMap.get(ModelTypeEnum.G2G.getValue()));
mapList.add(g2gMap);
Map<String,List<ModelEntity>> g2cMap = new HashMap<>();
g2cMap.put(ModelTypeEnum.G2C.getDesc(),groupMap.get(ModelTypeEnum.G2C.getValue()));
mapList.add(g2cMap);
model.put("data", mapList);
model.put("message_info", busiDesc + "成功"); model.put("message_info", busiDesc + "成功");
this.recordSysLog(this.request, busiDesc + " 【成功】"); this.recordSysLog(this.request, busiDesc + " 【成功】");
} catch (Exception var9) { } catch (Exception var9) {
......
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