新增报名配置

This commit is contained in:
ly19960718 2021-05-15 16:11:14 +08:00
parent a4b5fbc9a1
commit 54b1e93d64
4 changed files with 32 additions and 19 deletions

View File

@ -126,7 +126,7 @@ public class ApplyController extends DefaultBaseController {
}) })
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("get/{applyId}") @GetMapping("get/{applyId}")
public ApplyDTO get(@PathVariable("applyId") String applyId) { public ApplyDTO get(@PathVariable("applyId") String applyId) {
return applyService.get(applyId); return applyService.get(applyId);
} }

View File

@ -1,6 +1,7 @@
package cn.com.tenlion.controller.api.applyconfig; package cn.com.tenlion.controller.api.applyconfig;
import cn.com.tenlion.pojo.dtos.apply.ApplyDTO;
import cn.com.tenlion.pojo.vos.apply.ApplyVO; import cn.com.tenlion.pojo.vos.apply.ApplyVO;
import ink.wgink.annotation.CheckRequestBodyAnnotation; import ink.wgink.annotation.CheckRequestBodyAnnotation;
import ink.wgink.interfaces.consts.ISystemConstant; import ink.wgink.interfaces.consts.ISystemConstant;
@ -13,6 +14,7 @@ import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
/** /**
@ -32,25 +34,35 @@ public class ApplyConfigController {
private IConfigService configService; private IConfigService configService;
@ApiOperation(value = "修改报名信息", notes = "修改报名信息接口") @ApiOperation(value = "报名配置修改", notes = "报名配置修改接口")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path")
}) })
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PutMapping("update") @PutMapping("update")
@CheckRequestBodyAnnotation @CheckRequestBodyAnnotation
public SuccessResult update(@RequestBody Map<String,Object> params) { public SuccessResult update(@RequestBody Map<String,Object> params) {
configService.updateConfig("",params.get("")); configService.updateConfig("applyClassPlanUserNum",params.get("applyClassPlanUserNum"));
configService.updateConfig("",params.get("")); configService.updateConfig("applyClassPlanTime",params.get("applyClassPlanTime"));
configService.updateConfig("",params.get("")); configService.updateConfig("applyClassPlanDays",params.get("applyClassPlanDays"));
return new SuccessResult(); 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().
// }

View File

@ -28,6 +28,7 @@ import ink.wgink.exceptions.SaveException;
import ink.wgink.exceptions.SearchException; import ink.wgink.exceptions.SearchException;
import ink.wgink.interfaces.consts.ISystemConstant; import ink.wgink.interfaces.consts.ISystemConstant;
import ink.wgink.interfaces.manager.ISystemConfigManager; import ink.wgink.interfaces.manager.ISystemConfigManager;
import ink.wgink.login.base.manager.ConfigManager;
import ink.wgink.pojo.ListPage; import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.app.AppTokenUser; import ink.wgink.pojo.app.AppTokenUser;
import ink.wgink.pojo.dtos.user.UserDTO; import ink.wgink.pojo.dtos.user.UserDTO;
@ -241,7 +242,8 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
states.clear(); states.clear();
states.add("2"); states.add("2");
Integer num3 = countApplyNum(workTypeId,row.getInstitutionId(),states); 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.setApplyUserNum2(num2);
trainingInstitutionWorkTypeDTO.setApplyUserNum3(num3); trainingInstitutionWorkTypeDTO.setApplyUserNum3(num3);
//判断当前机构是否可以报名 //判断当前机构是否可以报名

View File

@ -25,7 +25,7 @@
<div class="layui-card-body" style="padding: 15px;"> <div class="layui-card-body" style="padding: 15px;">
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-input-inline"> <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>
<div class="layui-form-mid layui-word-aux">人数</div> <div class="layui-form-mid layui-word-aux">人数</div>
</div> </div>
@ -40,7 +40,7 @@
<div class="layui-card-body" style="padding: 15px;"> <div class="layui-card-body" style="padding: 15px;">
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-input-inline"> <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>
<div class="layui-form-mid layui-word-aux">小时</div> <div class="layui-form-mid layui-word-aux">小时</div>
</div> </div>
@ -55,7 +55,7 @@
<div class="layui-card-body" style="padding: 15px;"> <div class="layui-card-body" style="padding: 15px;">
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-input-inline"> <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>
<div class="layui-form-mid layui-word-aux">天数</div> <div class="layui-form-mid layui-word-aux">天数</div>
</div> </div>
@ -64,7 +64,7 @@
<div class="layui-form-item layui-layout-admin"> <div class="layui-form-item layui-layout-admin">
<div class="layui-input-block"> <div class="layui-input-block">
<div class="layui-footer" style="left: 0;"> <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> </div>
</div> </div>
@ -100,14 +100,13 @@
// 初始化内容 // 初始化内容
function initData() { function initData() {
var loadLayerIndex; 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 = {}; var dataFormData = {};
for(var i in data) { for(var i in data) {
dataFormData[i] = data[i] +''; dataFormData[i] = data[i] +'';
} }
form.val('dataForm', dataFormData); form.val('dataForm', dataFormData);
form.render(null, 'dataForm'); form.render(null, 'dataForm');
initApplyAuditTimeDateTime();
}, function(code, data) { }, function(code, data) {
top.dialog.msg(data.msg); top.dialog.msg(data.msg);
}, function() { }, function() {
@ -116,17 +115,17 @@
top.dialog.close(loadLayerIndex); top.dialog.close(loadLayerIndex);
}); });
} }
//initData(); initData();
// 提交表单 // 提交表单
form.on('submit(submitForm)', function(formData) { form.on('submit(submitForm)', function(formData) {
top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.confirm(top.dataMessage.commit, function(index) {
top.dialog.close(index); top.dialog.close(index);
var loadLayerIndex; 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, { var layerIndex = top.dialog.msg(top.dataMessage.updateSuccess, {
time: 0, time: 0,
btn: [top.dataMessage.button.yes, top.dataMessage.button.no], btn: [top.dataMessage.button.yes],
shade: 0.3, shade: 0.3,
yes: function(index) { yes: function(index) {
top.dialog.close(index); top.dialog.close(index);