From 54b1e93d644ae448a5db555c3be81a2bef54fbe8 Mon Sep 17 00:00:00 2001 From: ly19960718 <1622779752@qq.com> Date: Sat, 15 May 2021 16:11:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8A=A5=E5=90=8D=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/api/apply/ApplyController.java | 2 +- .../applyconfig/ApplyConfigController.java | 28 +++++++++++++------ .../service/apply/impl/ApplyServiceImpl.java | 4 ++- .../static/route/applyconfig/show.html | 17 ++++++----- 4 files changed, 32 insertions(+), 19 deletions(-) diff --git a/src/main/java/cn/com/tenlion/controller/api/apply/ApplyController.java b/src/main/java/cn/com/tenlion/controller/api/apply/ApplyController.java index 795959d..bd5df29 100644 --- a/src/main/java/cn/com/tenlion/controller/api/apply/ApplyController.java +++ b/src/main/java/cn/com/tenlion/controller/api/apply/ApplyController.java @@ -126,7 +126,7 @@ public class ApplyController extends DefaultBaseController { }) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("get/{applyId}") - public ApplyDTO get(@PathVariable("applyId") String applyId) { + public ApplyDTO get(@PathVariable("applyId") String applyId) { return applyService.get(applyId); } diff --git a/src/main/java/cn/com/tenlion/controller/api/applyconfig/ApplyConfigController.java b/src/main/java/cn/com/tenlion/controller/api/applyconfig/ApplyConfigController.java index d6e5f85..3e18b31 100644 --- a/src/main/java/cn/com/tenlion/controller/api/applyconfig/ApplyConfigController.java +++ b/src/main/java/cn/com/tenlion/controller/api/applyconfig/ApplyConfigController.java @@ -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 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 get() { + Map 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(). -// } diff --git a/src/main/java/cn/com/tenlion/service/apply/impl/ApplyServiceImpl.java b/src/main/java/cn/com/tenlion/service/apply/impl/ApplyServiceImpl.java index 6833837..71740a9 100644 --- a/src/main/java/cn/com/tenlion/service/apply/impl/ApplyServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/apply/impl/ApplyServiceImpl.java @@ -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); //判断当前机构是否可以报名 diff --git a/src/main/resources/static/route/applyconfig/show.html b/src/main/resources/static/route/applyconfig/show.html index 1e8ecea..f6d4c70 100644 --- a/src/main/resources/static/route/applyconfig/show.html +++ b/src/main/resources/static/route/applyconfig/show.html @@ -25,7 +25,7 @@
- +
人数
@@ -40,7 +40,7 @@
- +
小时
@@ -55,7 +55,7 @@
- +
天数
@@ -64,7 +64,7 @@
@@ -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);