Commit b3fe528c by huangZW

审核同意,锁一下

parent 07431c92
......@@ -19,6 +19,7 @@ import com.gic.haoban.manage.web.anno.HttpLimit;
import com.gic.haoban.manage.web.auth.AuthRequestUtil;
import com.gic.haoban.manage.web.vo.BatchApproveVO;
import com.gic.haoban.manage.web.vo.LoginVO;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
......@@ -28,6 +29,7 @@ import org.springframework.web.bind.annotation.RestController;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.redis.data.util.RedisUtil;
@RestController
@RequestMapping("/audit")
......@@ -205,9 +207,16 @@ public class AuditController extends WebBaseController{
public HaobanResponse audit(String auditId,String auditName ) {
LoginVO login = (LoginVO) AuthRequestUtil.getLoginUser();
StaffDTO loginStaffDTO = login.getStaffDTO();
if (null == login) {
if (null == loginStaffDTO) {
return resultResponse(HaoBanErrCode.ERR_4);
}
Object o = RedisUtil.getCache("audit-"+auditId);
if(o != null){
log.info("请不要过于频繁点击");
return resultResponse(HaoBanErrCode.ERR_10008);
}
//设置缓存10秒
RedisUtil.setCache("audit-"+auditId, "1",10L);
String staffId = login.getStaffDTO().getStaffId();
String staffName = login.getStaffDTO().getStaffName();
if(StringUtils.isAnyBlank(auditId)){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment