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

增加事项来源字段

parent 1b494f6c
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 MatterSourceEnum implements IBaseEnum {
MANUAL(0, "手动添加", SysConstains.STYLE_DEFAULT),
AUTO(1, "站点事项", SysConstains.STYLE_DEFAULT);
private int value;
private String desc;
private String style;
MatterSourceEnum(int value, String desc, String style) {
this.value = value;
this.desc = desc;
this.style = style;
}
@Override
public int getValue() {
return this.value;
}
public String getDesc() {
return desc;
}
public String getStyle()
{
return style;
}
public static MatterSourceEnum getByValue(int value) {
for (MatterSourceEnum e : MatterSourceEnum.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 (MatterSourceEnum item : MatterSourceEnum.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;
}
}
...@@ -10,7 +10,7 @@ import com.mortals.xhx.module.matter.model.vo.MatterVo; ...@@ -10,7 +10,7 @@ import com.mortals.xhx.module.matter.model.vo.MatterVo;
* 事项申请材料实体对象 * 事项申请材料实体对象
* *
* @author zxfei * @author zxfei
* @date 2022-09-27 * @date 2022-10-10
*/ */
public class MatterEntity extends MatterVo { public class MatterEntity extends MatterVo {
...@@ -64,6 +64,10 @@ public class MatterEntity extends MatterVo { ...@@ -64,6 +64,10 @@ public class MatterEntity extends MatterVo {
* 是否推荐(0.未推荐,1.推荐) * 是否推荐(0.未推荐,1.推荐)
*/ */
private Integer isRecommend; private Integer isRecommend;
/**
* 事项来源(0.手动添加,1.站点事项)
*/
private Integer source;
...@@ -236,6 +240,20 @@ public class MatterEntity extends MatterVo { ...@@ -236,6 +240,20 @@ public class MatterEntity extends MatterVo {
public void setIsRecommend(Integer isRecommend){ public void setIsRecommend(Integer isRecommend){
this.isRecommend = isRecommend; this.isRecommend = isRecommend;
} }
/**
* 获取 事项来源(0.手动添加,1.站点事项)
* @return Integer
*/
public Integer getSource(){
return source;
}
/**
* 设置 事项来源(0.手动添加,1.站点事项)
* @param source
*/
public void setSource(Integer source){
this.source = source;
}
...@@ -270,6 +288,7 @@ public class MatterEntity extends MatterVo { ...@@ -270,6 +288,7 @@ public class MatterEntity extends MatterVo {
sb.append(",total:").append(getTotal()); sb.append(",total:").append(getTotal());
sb.append(",sort:").append(getSort()); sb.append(",sort:").append(getSort());
sb.append(",isRecommend:").append(getIsRecommend()); sb.append(",isRecommend:").append(getIsRecommend());
sb.append(",source:").append(getSource());
return sb.toString(); return sb.toString();
} }
...@@ -298,5 +317,7 @@ public class MatterEntity extends MatterVo { ...@@ -298,5 +317,7 @@ public class MatterEntity extends MatterVo {
this.sort = null; this.sort = null;
this.isRecommend = 0; this.isRecommend = 0;
this.source = 0;
} }
} }
\ No newline at end of file
...@@ -6,7 +6,7 @@ import com.mortals.xhx.module.matter.model.MatterEntity; ...@@ -6,7 +6,7 @@ import com.mortals.xhx.module.matter.model.MatterEntity;
* 事项申请材料查询对象 * 事项申请材料查询对象
* *
* @author zxfei * @author zxfei
* @date 2022-09-27 * @date 2022-10-10
*/ */
public class MatterQuery extends MatterEntity { public class MatterQuery extends MatterEntity {
/** 开始 主键,自增长 */ /** 开始 主键,自增长 */
...@@ -102,6 +102,18 @@ public class MatterQuery extends MatterEntity { ...@@ -102,6 +102,18 @@ public class MatterQuery extends MatterEntity {
/** 是否推荐(0.未推荐,1.推荐)列表 */ /** 是否推荐(0.未推荐,1.推荐)列表 */
private List <Integer> isRecommendList; private List <Integer> isRecommendList;
/** 开始 事项来源(0.手动添加,1.站点事项) */
private Integer sourceStart;
/** 结束 事项来源(0.手动添加,1.站点事项) */
private Integer sourceEnd;
/** 增加 事项来源(0.手动添加,1.站点事项) */
private Integer sourceIncrement;
/** 事项来源(0.手动添加,1.站点事项)列表 */
private List <Integer> sourceList;
/** 开始 创建时间 */ /** 开始 创建时间 */
private String createTimeStart; private String createTimeStart;
...@@ -623,6 +635,70 @@ public class MatterQuery extends MatterEntity { ...@@ -623,6 +635,70 @@ public class MatterQuery extends MatterEntity {
this.isRecommendList = isRecommendList; this.isRecommendList = isRecommendList;
} }
/**
* 获取 开始 事项来源(0.手动添加,1.站点事项)
* @return sourceStart
*/
public Integer getSourceStart(){
return this.sourceStart;
}
/**
* 设置 开始 事项来源(0.手动添加,1.站点事项)
* @param sourceStart
*/
public void setSourceStart(Integer sourceStart){
this.sourceStart = sourceStart;
}
/**
* 获取 结束 事项来源(0.手动添加,1.站点事项)
* @return $sourceEnd
*/
public Integer getSourceEnd(){
return this.sourceEnd;
}
/**
* 设置 结束 事项来源(0.手动添加,1.站点事项)
* @param sourceEnd
*/
public void setSourceEnd(Integer sourceEnd){
this.sourceEnd = sourceEnd;
}
/**
* 获取 增加 事项来源(0.手动添加,1.站点事项)
* @return sourceIncrement
*/
public Integer getSourceIncrement(){
return this.sourceIncrement;
}
/**
* 设置 增加 事项来源(0.手动添加,1.站点事项)
* @param sourceIncrement
*/
public void setSourceIncrement(Integer sourceIncrement){
this.sourceIncrement = sourceIncrement;
}
/**
* 获取 事项来源(0.手动添加,1.站点事项)
* @return sourceList
*/
public List<Integer> getSourceList(){
return this.sourceList;
}
/**
* 设置 事项来源(0.手动添加,1.站点事项)
* @param sourceList
*/
public void setSourceList(List<Integer> sourceList){
this.sourceList = sourceList;
}
/** /**
* 获取 开始 创建时间 * 获取 开始 创建时间
* @return createTimeStart * @return createTimeStart
...@@ -1154,6 +1230,51 @@ public class MatterQuery extends MatterEntity { ...@@ -1154,6 +1230,51 @@ public class MatterQuery extends MatterEntity {
return this; return this;
} }
/**
* 设置 事项来源(0.手动添加,1.站点事项)
* @param source
*/
public MatterQuery source(Integer source){
setSource(source);
return this;
}
/**
* 设置 开始 事项来源(0.手动添加,1.站点事项)
* @param sourceStart
*/
public MatterQuery sourceStart(Integer sourceStart){
this.sourceStart = sourceStart;
return this;
}
/**
* 设置 结束 事项来源(0.手动添加,1.站点事项)
* @param sourceEnd
*/
public MatterQuery sourceEnd(Integer sourceEnd){
this.sourceEnd = sourceEnd;
return this;
}
/**
* 设置 增加 事项来源(0.手动添加,1.站点事项)
* @param sourceIncrement
*/
public MatterQuery sourceIncrement(Integer sourceIncrement){
this.sourceIncrement = sourceIncrement;
return this;
}
/**
* 设置 事项来源(0.手动添加,1.站点事项)
* @param sourceList
*/
public MatterQuery sourceList(List<Integer> sourceList){
this.sourceList = sourceList;
return this;
}
/** /**
* 设置 创建用户 * 设置 创建用户
......
package com.mortals.xhx.module.matter.service.impl; package com.mortals.xhx.module.matter.service.impl;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.MatterSourceEnum;
import com.mortals.xhx.common.key.ParamKey; import com.mortals.xhx.common.key.ParamKey;
import com.mortals.xhx.common.utils.StringUtils; import com.mortals.xhx.common.utils.StringUtils;
import com.mortals.xhx.module.sheet.dao.SheetMatterDao; import com.mortals.xhx.module.sheet.dao.SheetMatterDao;
...@@ -40,6 +41,15 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter ...@@ -40,6 +41,15 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
return params; return params;
} }
@Override
protected void saveBefore(MatterEntity entity, Context context) throws AppException {
entity.setTotal(0);
entity.setSort(0);
entity.setIsRecommend(0);
entity.setSource(MatterSourceEnum.MANUAL.getValue());
this.validData(entity, context);
}
@Override @Override
public void createMatterbBySheetMatter(Long[] sheetMatterIds) { public void createMatterbBySheetMatter(Long[] sheetMatterIds) {
List<SheetMatterEntity> sheetMatterEntityList = sheetMatterDao.get(sheetMatterIds); List<SheetMatterEntity> sheetMatterEntityList = sheetMatterDao.get(sheetMatterIds);
...@@ -67,6 +77,7 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter ...@@ -67,6 +77,7 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
matterEntity.setTotal(0); matterEntity.setTotal(0);
matterEntity.setSort(0); matterEntity.setSort(0);
matterEntity.setIsRecommend(0); matterEntity.setIsRecommend(0);
matterEntity.setSource(MatterSourceEnum.AUTO.getValue());
matterEntity.setCreateUserId(1l); matterEntity.setCreateUserId(1l);
matterEntity.setCreateTime(now); matterEntity.setCreateTime(now);
list.add(matterEntity); list.add(matterEntity);
......
package com.mortals.xhx.module.matter.web; package com.mortals.xhx.module.matter.web;
import com.mortals.framework.common.IBaseEnum;
import com.mortals.framework.common.code.YesNo; import com.mortals.framework.common.code.YesNo;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.IUser; import com.mortals.framework.service.IUser;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.MatterSourceEnum;
import com.mortals.xhx.common.key.ParamKey; import com.mortals.xhx.common.key.ParamKey;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
...@@ -48,6 +50,7 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe ...@@ -48,6 +50,7 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe
@Override @Override
protected void init(Map<String, Object> model, Context context) { protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "isRecommend", paramService.getParamBySecondOrganize("Matter","isRecommend")); this.addDict(model, "isRecommend", paramService.getParamBySecondOrganize("Matter","isRecommend"));
this.addDict(model, "source", IBaseEnum.getEnumMap(MatterSourceEnum.class));
super.init(model, context); super.init(model, context);
} }
......
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