Commit 2bfd4bdf authored by 赵啸非's avatar 赵啸非

添加权重

parent bd411294
...@@ -3,15 +3,16 @@ package com.mortals.xhx.base.system.param.web; ...@@ -3,15 +3,16 @@ package com.mortals.xhx.base.system.param.web;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.RepeatSubmit; import com.mortals.framework.annotation.RepeatSubmit;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.code.PageDisplayType; import com.mortals.framework.common.code.PageDisplayType;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.util.FileUtil; import com.mortals.framework.util.FileUtil;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.common.pdu.WeightPdu;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RestController;
import com.mortals.framework.web.BaseCRUDJsonMappingController; import com.mortals.framework.web.BaseCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.model.ParamEntity; import com.mortals.xhx.base.system.param.model.ParamEntity;
...@@ -24,6 +25,8 @@ import javax.servlet.http.HttpServletResponse; ...@@ -24,6 +25,8 @@ import javax.servlet.http.HttpServletResponse;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import static com.mortals.xhx.common.key.ParamKey.SYS_PARAM_WEIGHT;
/** /**
* 参数信息 * 参数信息
* *
...@@ -59,6 +62,30 @@ public class ParamController extends BaseCRUDJsonBodyMappingController<ParamServ ...@@ -59,6 +62,30 @@ public class ParamController extends BaseCRUDJsonBodyMappingController<ParamServ
return result; return result;
} }
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "key")
@UnAuth
public String getValueByKey(@RequestParam(name = "key") String key) {
JSONObject jsonObject = new JSONObject();
String busiDesc = "通过key查询参数值" + this.getModuleDesc();
try {
String value = this.service.getValueByKey(key);
if (ObjectUtils.isEmpty(value) && key.equals(SYS_PARAM_WEIGHT)) {
WeightPdu weightPdu = new WeightPdu();
value = JSONObject.toJSONString(weightPdu);
}
jsonObject.put(KEY_RESULT_DATA, value);
recordSysLog(request, busiDesc + " 【成功】");
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
jsonObject.put(KEY_RESULT_MSG, busiDesc + "成功!");
} catch (Exception e) {
log.error("获取异常", e);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
jsonObject.put(KEY_RESULT_MSG, super.convertException(e));
}
return jsonObject.toJSONString();
}
public static void main(String[] args) { public static void main(String[] args) {
FileUtil.delete("E:\\pic\\1.png"); FileUtil.delete("E:\\pic\\1.png");
} }
......
...@@ -114,4 +114,5 @@ public final class Constant { ...@@ -114,4 +114,5 @@ public final class Constant {
public static final String DISTRIBUTE_PATH = "distribute_path"; public static final String DISTRIBUTE_PATH = "distribute_path";
} }
...@@ -25,4 +25,6 @@ public class ParamKey { ...@@ -25,4 +25,6 @@ public class ParamKey {
public static String SYS_PARAM_USER_URL = "user_url"; public static String SYS_PARAM_USER_URL = "user_url";
public static String SYS_PARAM_WEIGHT = "weight";
} }
package com.mortals.xhx.common.pdu;
import lombok.Data;
/**
* 权重pdu
*/
@Data
public class WeightPdu {
/**
* 自评权重
*/
private Integer selfWeight=20;
/**
* 考勤权重
*/
private Integer attendWeight=20;
/**
* 效能权重
*/
private Integer effectWeight=20;
/**
* 办件权重
*/
private Integer goworkWeight=20;
/**
* 评价权重
*/
private Integer reviewWeight=20;
}
...@@ -133,8 +133,6 @@ public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerD ...@@ -133,8 +133,6 @@ public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerD
StaffEntity staffEntity = staffService.selectOne(new StaffQuery().phoneNumber(mobile)); StaffEntity staffEntity = staffService.selectOne(new StaffQuery().phoneNumber(mobile));
if (!ObjectUtils.isEmpty(staffEntity)) { if (!ObjectUtils.isEmpty(staffEntity)) {
return staffEntity; return staffEntity;
} else {
} }
return getStaffEntityByName(name); return getStaffEntityByName(name);
} else if (!ObjectUtils.isEmpty(name)) { } else if (!ObjectUtils.isEmpty(name)) {
...@@ -146,6 +144,8 @@ public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerD ...@@ -146,6 +144,8 @@ public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerD
} }
}).collect(Collectors.toList()); }).collect(Collectors.toList());
return Rest.ok(staffEntityList); return Rest.ok(staffEntityList);
}else{
} }
return Rest.fail("获取窗口工作人员失败"); return Rest.fail("获取窗口工作人员失败");
} }
......
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