新增报名配置
This commit is contained in:
parent
a4b5fbc9a1
commit
54b1e93d64
@ -1,6 +1,7 @@
|
||||
package cn.com.tenlion.controller.api.applyconfig;
|
||||
|
||||
|
||||
import cn.com.tenlion.pojo.dtos.apply.ApplyDTO;
|
||||
import cn.com.tenlion.pojo.vos.apply.ApplyVO;
|
||||
import ink.wgink.annotation.CheckRequestBodyAnnotation;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
@ -13,6 +14,7 @@ import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@ -32,25 +34,35 @@ public class ApplyConfigController {
|
||||
private IConfigService configService;
|
||||
|
||||
|
||||
@ApiOperation(value = "修改报名信息", notes = "修改报名信息接口")
|
||||
@ApiOperation(value = "报名配置修改", notes = "报名配置修改接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path")
|
||||
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PutMapping("update")
|
||||
@CheckRequestBodyAnnotation
|
||||
public SuccessResult update(@RequestBody Map<String,Object> params) {
|
||||
configService.updateConfig("",params.get(""));
|
||||
configService.updateConfig("",params.get(""));
|
||||
configService.updateConfig("",params.get(""));
|
||||
configService.updateConfig("applyClassPlanUserNum",params.get("applyClassPlanUserNum"));
|
||||
configService.updateConfig("applyClassPlanTime",params.get("applyClassPlanTime"));
|
||||
configService.updateConfig("applyClassPlanDays",params.get("applyClassPlanDays"));
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "报名配置详情", notes = "报名配置详情接口")
|
||||
@ApiImplicitParams({
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("get")
|
||||
public Map<String,Object> get() {
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("applyClassPlanUserNum", ConfigManager.getInstance().getConfig().get("applyClassPlanUserNum"));
|
||||
map.put("applyClassPlanTime", ConfigManager.getInstance().getConfig().get("applyClassPlanTime"));
|
||||
map.put("applyClassPlanDays", ConfigManager.getInstance().getConfig().get("applyClassPlanDays"));
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
// public void a (){
|
||||
// ConfigManager.getInstance().getConfig().
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
@ -28,6 +28,7 @@ import ink.wgink.exceptions.SaveException;
|
||||
import ink.wgink.exceptions.SearchException;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.interfaces.manager.ISystemConfigManager;
|
||||
import ink.wgink.login.base.manager.ConfigManager;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.app.AppTokenUser;
|
||||
import ink.wgink.pojo.dtos.user.UserDTO;
|
||||
@ -241,7 +242,8 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
|
||||
states.clear();
|
||||
states.add("2");
|
||||
Integer num3 = countApplyNum(workTypeId,row.getInstitutionId(),states);
|
||||
trainingInstitutionWorkTypeDTO.setApplyUserNum1(0);
|
||||
Object applyClassPlanUserNum = ConfigManager.getInstance().getConfig().get("applyClassPlanUserNum");
|
||||
trainingInstitutionWorkTypeDTO.setApplyUserNum1(applyClassPlanUserNum == null ? 0:Integer.valueOf(applyClassPlanUserNum.toString()));
|
||||
trainingInstitutionWorkTypeDTO.setApplyUserNum2(num2);
|
||||
trainingInstitutionWorkTypeDTO.setApplyUserNum3(num3);
|
||||
//判断当前机构是否可以报名
|
||||
|
@ -25,7 +25,7 @@
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-inline">
|
||||
<input type="number" name="changePasswordNoticeDays" lay-verify="required" placeholder="人数" class="layui-input">
|
||||
<input type="number" name="applyClassPlanUserNum" lay-verify="required" placeholder="人数" class="layui-input">
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">人数</div>
|
||||
</div>
|
||||
@ -40,7 +40,7 @@
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-inline">
|
||||
<input type="number" name="changePasswordNoticeDays" lay-verify="required" placeholder="小时" class="layui-input">
|
||||
<input type="number" name="applyClassPlanTime" lay-verify="required" placeholder="小时" class="layui-input">
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">小时</div>
|
||||
</div>
|
||||
@ -55,7 +55,7 @@
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-inline">
|
||||
<input type="number" name="changePasswordNoticeDays" lay-verify="required" placeholder="天数" class="layui-input">
|
||||
<input type="number" name="applyClassPlanDays" lay-verify="required" placeholder="天数" class="layui-input">
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">天数</div>
|
||||
</div>
|
||||
@ -64,7 +64,7 @@
|
||||
<div class="layui-form-item layui-layout-admin">
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-footer" style="left: 0;">
|
||||
<button type="button" class="layui-btn" lay-submit lay-filter="submitForm">提交修改</button>
|
||||
<button type="button" class="layui-btn" lay-submit lay-filter="submitForm">更新配置</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -100,14 +100,13 @@
|
||||
// 初始化内容
|
||||
function initData() {
|
||||
var loadLayerIndex;
|
||||
top.restAjax.get(top.restAjax.path('api/applyauditlog/get/{applyAuditLogId}', [applyAuditLogId]), {}, null, function(code, data) {
|
||||
top.restAjax.get(top.restAjax.path('api/applyconfig/get', []), {}, null, function(code, data) {
|
||||
var dataFormData = {};
|
||||
for(var i in data) {
|
||||
dataFormData[i] = data[i] +'';
|
||||
}
|
||||
form.val('dataForm', dataFormData);
|
||||
form.render(null, 'dataForm');
|
||||
initApplyAuditTimeDateTime();
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
@ -116,17 +115,17 @@
|
||||
top.dialog.close(loadLayerIndex);
|
||||
});
|
||||
}
|
||||
//initData();
|
||||
initData();
|
||||
|
||||
// 提交表单
|
||||
form.on('submit(submitForm)', function(formData) {
|
||||
top.dialog.confirm(top.dataMessage.commit, function(index) {
|
||||
top.dialog.close(index);
|
||||
var loadLayerIndex;
|
||||
top.restAjax.put(top.restAjax.path('api/applyauditlog/update/{applyAuditLogId}', [applyAuditLogId]), formData.field, null, function(code, data) {
|
||||
top.restAjax.put(top.restAjax.path('api/applyconfig/update', []), formData.field, null, function(code, data) {
|
||||
var layerIndex = top.dialog.msg(top.dataMessage.updateSuccess, {
|
||||
time: 0,
|
||||
btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
|
||||
btn: [top.dataMessage.button.yes],
|
||||
shade: 0.3,
|
||||
yes: function(index) {
|
||||
top.dialog.close(index);
|
||||
|
Loading…
Reference in New Issue
Block a user