后台审核页面+审核通过/拒绝
This commit is contained in:
parent
32a3979f31
commit
b3e1a6c009
|
|
@ -7,6 +7,7 @@ import com.ghy.common.core.page.TableDataInfo;
|
||||||
import com.ghy.common.enums.BusinessType;
|
import com.ghy.common.enums.BusinessType;
|
||||||
import com.ghy.common.enums.WorkerCertifyStatus;
|
import com.ghy.common.enums.WorkerCertifyStatus;
|
||||||
import com.ghy.common.enums.WorkerStatus;
|
import com.ghy.common.enums.WorkerStatus;
|
||||||
|
import com.ghy.common.json.JSONObject;
|
||||||
import com.ghy.common.utils.ExceptionUtil;
|
import com.ghy.common.utils.ExceptionUtil;
|
||||||
import com.ghy.common.utils.poi.ExcelUtil;
|
import com.ghy.common.utils.poi.ExcelUtil;
|
||||||
import com.ghy.system.domain.SysArea;
|
import com.ghy.system.domain.SysArea;
|
||||||
|
|
@ -183,4 +184,21 @@ public class WorkerCertificationController extends BaseController
|
||||||
return AjaxResult.error(e.getMessage());
|
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("操作失败!");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,11 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="btn-group-sm" id="toolbar" role="group">
|
<div class="btn-group-sm" id="toolbar" role="group">
|
||||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="worker:certification:add">
|
<a class="btn btn-primary multiple disabled" onclick="auditStatus(1)" shiro:hasPermission="worker:certification:add">
|
||||||
<i class="fa fa-plus"></i> 添加
|
<i class="fa fa-edit"></i> 通过
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-danger multiple disabled" onclick="auditStatus(2)" shiro:hasPermission="worker:certification:add">
|
||||||
|
<i class="fa fa-remove"></i> 拒绝
|
||||||
</a>
|
</a>
|
||||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="worker:certification:add">
|
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="worker:certification:add">
|
||||||
<i class="fa fa-plus"></i> 添加
|
<i class="fa fa-plus"></i> 添加
|
||||||
|
|
@ -173,6 +176,18 @@
|
||||||
};
|
};
|
||||||
$.table.init(options);
|
$.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 });
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
@ -2,6 +2,7 @@ package com.ghy.worker.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.ghy.worker.domain.WorkerCertification;
|
import com.ghy.worker.domain.WorkerCertification;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 师傅实名审核Mapper接口
|
* 师傅实名审核Mapper接口
|
||||||
|
|
@ -72,4 +73,12 @@ public interface WorkerCertificationMapper
|
||||||
* @param workerId 师傅ID
|
* @param workerId 师傅ID
|
||||||
*/
|
*/
|
||||||
int deleteCertificationByWorkerId(Long workerId);
|
int deleteCertificationByWorkerId(Long workerId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ids 审核记录id
|
||||||
|
* @param status 审核后状态
|
||||||
|
* @return 成功条数
|
||||||
|
*/
|
||||||
|
int changeStatus(@Param("ids") String ids, @Param("status") Integer status);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.ghy.worker.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.ghy.worker.domain.WorkerCertification;
|
import com.ghy.worker.domain.WorkerCertification;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 师傅实名审核Service接口
|
* 师傅实名审核Service接口
|
||||||
|
|
@ -74,4 +75,12 @@ public interface IWorkerCertificationService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
int deleteCertificationByWorkerId(Long workerId);
|
int deleteCertificationByWorkerId(Long workerId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ids 操作的审核记录
|
||||||
|
* @param status 审核后的状态
|
||||||
|
* @return 成功条数
|
||||||
|
*/
|
||||||
|
int changeStatus(@Param("ids") String ids, @Param("status") Integer status);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -105,4 +105,9 @@ public class WorkerCertificationServiceImpl implements IWorkerCertificationServi
|
||||||
public int deleteCertificationByWorkerId(Long workerId) {
|
public int deleteCertificationByWorkerId(Long workerId) {
|
||||||
return workerCertificationMapper.deleteCertificationByWorkerId(workerId);
|
return workerCertificationMapper.deleteCertificationByWorkerId(workerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int changeStatus(String ids, Integer status) {
|
||||||
|
return workerCertificationMapper.changeStatus(ids, status);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -166,4 +166,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<delete id="deleteCertificationByWorkerId" parameterType="Long">
|
<delete id="deleteCertificationByWorkerId" parameterType="Long">
|
||||||
DELETE FROM worker_certification WHERE worker_id = #{workerId}
|
DELETE FROM worker_certification WHERE worker_id = #{workerId}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<update id="changeStatus">
|
||||||
|
UPDATE worker_certification set status = #{status}
|
||||||
|
WHERE worker_certification_id in ( #{ids} )
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue