diff --git a/ghy-admin/src/main/java/com/ghy/web/controller/worker/WorkerCertificationController.java b/ghy-admin/src/main/java/com/ghy/web/controller/worker/WorkerCertificationController.java index d26ff451..2d9f3c08 100644 --- a/ghy-admin/src/main/java/com/ghy/web/controller/worker/WorkerCertificationController.java +++ b/ghy-admin/src/main/java/com/ghy/web/controller/worker/WorkerCertificationController.java @@ -7,6 +7,7 @@ import com.ghy.common.core.page.TableDataInfo; import com.ghy.common.enums.BusinessType; import com.ghy.common.enums.WorkerCertifyStatus; import com.ghy.common.enums.WorkerStatus; +import com.ghy.common.json.JSONObject; import com.ghy.common.utils.ExceptionUtil; import com.ghy.common.utils.poi.ExcelUtil; import com.ghy.system.domain.SysArea; @@ -183,4 +184,21 @@ public class WorkerCertificationController extends BaseController return AjaxResult.error(e.getMessage()); } } + + @PostMapping("/changeStatus") + @ResponseBody + public AjaxResult changeStatus(String ids,Integer status){ + try { + int result = workerCertificationService.changeStatus(ids, status); + if(result > 0){ + return AjaxResult.success("操作成功!"); + }else { + return AjaxResult.warn("操作失败!"); + } + }catch (Exception e){ + e.printStackTrace(); + logger.error(ExceptionUtil.getExceptionMessage(e)); + return AjaxResult.error("操作失败!"); + } + } } diff --git a/ghy-admin/src/main/resources/templates/worker/certification/certification.html b/ghy-admin/src/main/resources/templates/worker/certification/certification.html index 26edb597..93b2251f 100644 --- a/ghy-admin/src/main/resources/templates/worker/certification/certification.html +++ b/ghy-admin/src/main/resources/templates/worker/certification/certification.html @@ -28,8 +28,11 @@
- - 添加 + + 通过 + + + 拒绝 添加 @@ -173,6 +176,18 @@ }; $.table.init(options); }); + + function auditStatus(status){ + table.set(); + var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId); + if (rows.length == 0) { + $.modal.alertWarning("请至少选择一条记录"); + return; + } + $.modal.confirm("确认审核吗?", function() { + $.operate.post(prefix + "/changeStatus", { "ids": rows.join(), "status": status }); + }) + } \ No newline at end of file diff --git a/ghy-worker/src/main/java/com/ghy/worker/mapper/WorkerCertificationMapper.java b/ghy-worker/src/main/java/com/ghy/worker/mapper/WorkerCertificationMapper.java index 411af766..b00bc237 100644 --- a/ghy-worker/src/main/java/com/ghy/worker/mapper/WorkerCertificationMapper.java +++ b/ghy-worker/src/main/java/com/ghy/worker/mapper/WorkerCertificationMapper.java @@ -2,6 +2,7 @@ package com.ghy.worker.mapper; import java.util.List; import com.ghy.worker.domain.WorkerCertification; +import org.apache.ibatis.annotations.Param; /** * 师傅实名审核Mapper接口 @@ -72,4 +73,12 @@ public interface WorkerCertificationMapper * @param workerId 师傅ID */ int deleteCertificationByWorkerId(Long workerId); + + /** + * @param ids 审核记录id + * @param status 审核后状态 + * @return 成功条数 + */ + int changeStatus(@Param("ids") String ids, @Param("status") Integer status); + } diff --git a/ghy-worker/src/main/java/com/ghy/worker/service/IWorkerCertificationService.java b/ghy-worker/src/main/java/com/ghy/worker/service/IWorkerCertificationService.java index dbce6328..c265cde6 100644 --- a/ghy-worker/src/main/java/com/ghy/worker/service/IWorkerCertificationService.java +++ b/ghy-worker/src/main/java/com/ghy/worker/service/IWorkerCertificationService.java @@ -2,6 +2,7 @@ package com.ghy.worker.service; import java.util.List; import com.ghy.worker.domain.WorkerCertification; +import org.apache.ibatis.annotations.Param; /** * 师傅实名审核Service接口 @@ -74,4 +75,12 @@ public interface IWorkerCertificationService * @return 结果 */ int deleteCertificationByWorkerId(Long workerId); + + /** + * @param ids 操作的审核记录 + * @param status 审核后的状态 + * @return 成功条数 + */ + int changeStatus(@Param("ids") String ids, @Param("status") Integer status); + } diff --git a/ghy-worker/src/main/java/com/ghy/worker/service/impl/WorkerCertificationServiceImpl.java b/ghy-worker/src/main/java/com/ghy/worker/service/impl/WorkerCertificationServiceImpl.java index 12305424..55423cbd 100644 --- a/ghy-worker/src/main/java/com/ghy/worker/service/impl/WorkerCertificationServiceImpl.java +++ b/ghy-worker/src/main/java/com/ghy/worker/service/impl/WorkerCertificationServiceImpl.java @@ -105,4 +105,9 @@ public class WorkerCertificationServiceImpl implements IWorkerCertificationServi public int deleteCertificationByWorkerId(Long workerId) { return workerCertificationMapper.deleteCertificationByWorkerId(workerId); } + + @Override + public int changeStatus(String ids, Integer status) { + return workerCertificationMapper.changeStatus(ids, status); + } } diff --git a/ghy-worker/src/main/resources/mapper/worker/WorkerCertificationMapper.xml b/ghy-worker/src/main/resources/mapper/worker/WorkerCertificationMapper.xml index 902796f5..fd4919c3 100644 --- a/ghy-worker/src/main/resources/mapper/worker/WorkerCertificationMapper.xml +++ b/ghy-worker/src/main/resources/mapper/worker/WorkerCertificationMapper.xml @@ -166,4 +166,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" DELETE FROM worker_certification WHERE worker_id = #{workerId} + + + UPDATE worker_certification set status = #{status} + WHERE worker_certification_id in ( #{ids} ) +