diff --git a/fill-manager/src/main/java/com/mortals/xhx/base/system/param/dao/ibatis/ParamDaoImpl.java b/fill-manager/src/main/java/com/mortals/xhx/base/system/param/dao/ibatis/ParamDaoImpl.java index f2262ef214904e79d92bdba653f11b0c56df7ddd..d6400cd5add3ac300b4c892f062078d9b58409f4 100644 --- a/fill-manager/src/main/java/com/mortals/xhx/base/system/param/dao/ibatis/ParamDaoImpl.java +++ b/fill-manager/src/main/java/com/mortals/xhx/base/system/param/dao/ibatis/ParamDaoImpl.java @@ -11,7 +11,6 @@ package com.mortals.xhx.base.system.param.dao.ibatis; import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis; import com.mortals.xhx.base.system.param.dao.ParamDao; import com.mortals.xhx.base.system.param.model.ParamEntity; - import org.springframework.stereotype.Repository; /** diff --git a/fill-manager/src/main/java/com/mortals/xhx/base/system/param/model/ParamEntity.java b/fill-manager/src/main/java/com/mortals/xhx/base/system/param/model/ParamEntity.java index d647e84879edc89a53ceb7e3b1f063d003126897..fb76321a60ad45b2e5b52c8c2cee38a7bb4d2c8a 100644 --- a/fill-manager/src/main/java/com/mortals/xhx/base/system/param/model/ParamEntity.java +++ b/fill-manager/src/main/java/com/mortals/xhx/base/system/param/model/ParamEntity.java @@ -21,7 +21,7 @@ import java.util.Date; * @author * @version 1.0.0 */ -public class ParamEntity extends ParamEntityExt implements IParam { +public class ParamEntity extends BaseEntityLong implements IParam { private static final long serialVersionUID = 1536307966363L; /** 鍙傛暟鍚嶇О */ diff --git a/fill-manager/src/main/java/com/mortals/xhx/base/system/param/service/ParamService.java b/fill-manager/src/main/java/com/mortals/xhx/base/system/param/service/ParamService.java index 81c101f0379f5731e97a540c7c698fc7aece5f07..f606913b9d3eda2fb2259289eb28e45959dd1773 100644 --- a/fill-manager/src/main/java/com/mortals/xhx/base/system/param/service/ParamService.java +++ b/fill-manager/src/main/java/com/mortals/xhx/base/system/param/service/ParamService.java @@ -5,7 +5,6 @@ import com.mortals.framework.service.ICRUDCacheService; import com.mortals.framework.service.IParamService; import com.mortals.xhx.base.system.param.model.ParamEntity; -import java.util.List; import java.util.Map; /** @@ -45,35 +44,4 @@ public interface ParamService extends ICRUDCacheService<ParamEntity, Long>, IPar */ Map<String, String> getParamBySecondOrganize(String firstOrganize,String secondOrganize, String... excludeParamKeys); - - /** - * 鑾峰彇鐑瘝鍒楄〃 - * @return - */ - String getHotWords(); - /** - * 璁剧疆鐑瘝鍒楄〃 - * @return - */ - void setHotWords(String value); - - /** - * 绌虹櫧鎵撳嵃鏉愭枡灞曠ず鏁伴噺 - * @return - */ - int getPrintDisplayQuantity(); - /** - * 璁剧疆绌虹櫧鎵撳嵃鏉愭枡灞曠ず鏁伴噺 - * @return - */ - void setPrintDisplayQuantity(int value); - - /** - * 閫氳繃Key璁剧疆鍙傛暟鍊� value - * @param key - * @param value - * @return - */ - void setValueByKey(String key,String value); - } \ No newline at end of file diff --git a/fill-manager/src/main/java/com/mortals/xhx/base/system/param/service/impl/ParamServiceImpl.java b/fill-manager/src/main/java/com/mortals/xhx/base/system/param/service/impl/ParamServiceImpl.java index 91a09aa1ce15cdb20ed03d49fbab1ce910be6e24..ce963f0e63d0ba7d8f1434e230b7d5a9d32a9d14 100644 --- a/fill-manager/src/main/java/com/mortals/xhx/base/system/param/service/impl/ParamServiceImpl.java +++ b/fill-manager/src/main/java/com/mortals/xhx/base/system/param/service/impl/ParamServiceImpl.java @@ -1,6 +1,5 @@ package com.mortals.xhx.base.system.param.service.impl; -import com.mortals.framework.common.code.YesNo; import com.mortals.framework.exception.AppException; import com.mortals.framework.service.IParam; import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl; @@ -8,12 +7,10 @@ import com.mortals.framework.util.DataUtil; import com.mortals.framework.util.StringUtils; import com.mortals.xhx.base.system.param.dao.ParamDao; import com.mortals.xhx.base.system.param.model.ParamEntity; -import com.mortals.xhx.base.system.param.model.ParamQuery; import com.mortals.xhx.base.system.param.service.ParamService; import org.springframework.stereotype.Service; import java.util.Arrays; -import java.util.Date; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -30,9 +27,6 @@ import java.util.stream.Collectors; @Service("paramService") public class ParamServiceImpl extends AbstractCRUDCacheServiceImpl<ParamDao, ParamEntity, Long> implements ParamService { - private final String HOT_WORDS = "HotWords"; - private final String PRINT_QUANTITY = "PrintDisplayQuantity"; - @Override protected String getCacheName() { return "ParamEntity.paramKey"; @@ -65,92 +59,6 @@ public class ParamServiceImpl extends AbstractCRUDCacheServiceImpl<ParamDao, Par ).collect(Collectors.toMap(ParamEntity::getParamKey, ParamEntity::getParamValue, (o, n) -> n)); } - @Override - public String getHotWords() { - return this.getParamValue(HOT_WORDS); - } - - @Override - public void setHotWords(String value) { - List<ParamEntity> list = this.getCacheList(); - ParamEntity entity = null; - for(ParamEntity paramEntity:list){ - if(HOT_WORDS.equals(paramEntity.getParamKey())){ - entity = paramEntity; - break; - } - } - if(entity!=null){ - entity.setParamValue(value); - this.update(entity); - }else { - entity = new ParamEntity(); - entity.setParamValue(value); - entity.setParamKey(HOT_WORDS); - entity.setName("鐑棬鎼滅储璇嶆眹"); - entity.setCreateTime(new Date()); - entity.setCreateUserId(1l); - entity.setCreateUserName("绯荤粺绠$悊鍛�"); - this.save(entity); - } - } - - @Override - public int getPrintDisplayQuantity() { - String printV = this.getParamValue(PRINT_QUANTITY); - return DataUtil.converStr2Int(printV,20); - } - - @Override - public void setPrintDisplayQuantity(int value) { - List<ParamEntity> list = this.getCacheList(); - ParamEntity entity = null; - for(ParamEntity paramEntity:list){ - if(PRINT_QUANTITY.equals(paramEntity.getParamKey())){ - entity = paramEntity; - break; - } - } - if(entity!=null){ - entity.setParamValue(String.valueOf(value)); - this.update(entity); - }else { - entity = new ParamEntity(); - entity.setParamValue(String.valueOf(value)); - entity.setParamKey(PRINT_QUANTITY); - entity.setName("绌虹櫧鎵撳嵃鏉愭枡灞曠ず鏁伴噺"); - entity.setCreateTime(new Date()); - entity.setCreateUserId(1l); - entity.setCreateUserName("绯荤粺绠$悊鍛�"); - this.save(entity); - } - } - - @Override - public void setValueByKey(String key, String value) { - List<ParamEntity> list = this.getCacheList(); - ParamEntity entity = null; - for(ParamEntity paramEntity:list){ - if(key.equals(paramEntity.getParamKey())){ - entity = paramEntity; - break; - } - } - if(entity!=null){ - entity.setParamValue(String.valueOf(value)); - this.update(entity); - }else { - entity = new ParamEntity(); - entity.setParamValue(String.valueOf(value)); - entity.setParamKey(key); - entity.setName("key"); - entity.setCreateTime(new Date()); - entity.setCreateUserId(1l); - entity.setCreateUserName("绯荤粺绠$悊鍛�"); - this.save(entity); - } - } - @Override public boolean needRefresh() { diff --git a/fill-manager/src/main/java/com/mortals/xhx/base/system/param/web/ParamController.java b/fill-manager/src/main/java/com/mortals/xhx/base/system/param/web/ParamController.java index b038c7a2d9513509380300f5629b6b6c70b0a8c6..6599fe453395097652187154803fac333aa7a990 100644 --- a/fill-manager/src/main/java/com/mortals/xhx/base/system/param/web/ParamController.java +++ b/fill-manager/src/main/java/com/mortals/xhx/base/system/param/web/ParamController.java @@ -1,37 +1,29 @@ package com.mortals.xhx.base.system.param.web; -import com.alibaba.fastjson.JSONObject; -import com.mortals.framework.annotation.RepeatSubmit; import com.mortals.framework.common.code.PageDisplayType; import com.mortals.framework.model.Context; - import com.mortals.framework.util.FileUtil; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import com.mortals.framework.web.BaseCRUDJsonMappingController; +import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.xhx.base.system.param.model.ParamEntity; import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.common.code.DataSatusEnum; import com.mortals.xhx.common.code.ModStatusEnum; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; import java.util.HashMap; import java.util.Map; /** - * * 鍙傛暟淇℃伅 + * * @author: zxfei - * @date: 2021/11/30 10:04 + * @date: 2022/5/7 15:38 */ @RestController @RequestMapping("param") -public class ParamController extends BaseCRUDJsonMappingController<ParamService, ParamForm, ParamEntity, Long> { +public class ParamController extends BaseCRUDJsonBodyMappingController<ParamService, ParamEntity, Long> { public ParamController() { super.setFormClass(ParamForm.class); @@ -39,21 +31,17 @@ public class ParamController extends BaseCRUDJsonMappingController<ParamService, } @Override - protected void init(HttpServletRequest request, HttpServletResponse response, ParamForm form, - Map<String, Object> model, Context context) { + protected void init(Map<String, Object> model, Context context) { Map<String, Object> status = new HashMap<String, Object>(); status.put("validStatus", DataSatusEnum.getEnumMap(DataSatusEnum.CLOSE.getValue(), DataSatusEnum.DELETE.getValue(), DataSatusEnum.OVERDUE.getValue(), DataSatusEnum.USEOUT.getValue())); status.put("modStatus", ModStatusEnum.getEnumMap()); status.put("displayType", getPageDisplayType()); model.put(KEY_RESULT_DICT, status); - - super.init(request, response, form, model, context); } private Map<String, Object> getPageDisplayType() { - PageDisplayType[] pageDisplayTypes = PageDisplayType.values(); Map<String, Object> result = new HashMap<>(pageDisplayTypes.length); for (PageDisplayType pageDisplayType : pageDisplayTypes) { @@ -62,7 +50,6 @@ public class ParamController extends BaseCRUDJsonMappingController<ParamService, return result; } - public static void main(String[] args) { FileUtil.delete("E:\\pic\\1.png"); }