需求计划撤回
This commit is contained in:
parent
42fac01f76
commit
6f86643e55
|
|
@ -1,10 +1,17 @@
|
|||
package com.bonus.aqgqj.business.backstage.controller;
|
||||
|
||||
import com.bonus.aqgqj.manager.common.util.JwtUtils;
|
||||
import com.bonus.aqgqj.manager.webResult.ServerResponse;
|
||||
import io.jsonwebtoken.Claims;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @className:HealthController
|
||||
* @author:cwchen
|
||||
|
|
@ -24,7 +31,26 @@ public class HealthController {
|
|||
* @date 2024/11/27 16:37
|
||||
*/
|
||||
@GetMapping("isHealth")
|
||||
public ServerResponse getApplyPlanList() {
|
||||
return ServerResponse.createBySuccessMsg("合法");
|
||||
public ServerResponse getApplyPlanList(HttpServletRequest request) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
String authorization = request.getHeader("authorization");
|
||||
System.err.println(authorization);
|
||||
Claims claims = JwtUtils.parseToken(authorization);
|
||||
map.put("username",claims.get("username"));
|
||||
map.put("id",claims.get("user_id"));
|
||||
map.put("orgId",claims.get("ORG_ID"));
|
||||
map.put("companyId",claims.get("COMPANY_ID"));
|
||||
return ServerResponse.createSuccess("合法",map);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
String a = "eyJhbGciOiJIUzUxMiJ9.eyJPUkdfSUQiOiIxIiwicm9sZV9pZCI6bnVsbCwidXNlcl9pZCI6MSwidXNlcl9rZXkiOiI0Zjg3NzJmZi01NGYzLTQxOTQtOWU0MC02Y2Y4Yzk4NDU5YzYiLCJDT01QQU5ZX0lEIjoiMTEiLCJ1c2VybmFtZSI6InNhIn0.8cSp_RmUDBagU66KH1LA3cQTem_X3eMcdyfbMl3HjqrHjeUFIWX6GxrOwgBbQI_TES-eY_-mAOKDLxQrycYyMg";
|
||||
Claims claims = JwtUtils.parseToken(a);
|
||||
map.put("username",claims.get("username"));
|
||||
map.put("user_id",claims.get("user_id"));
|
||||
map.put("org_id",claims.get("ORG_ID"));
|
||||
map.put("company_id",claims.get("COMPANY_ID"));
|
||||
String b = "ac";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,11 +17,9 @@ import io.swagger.annotations.Api;
|
|||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.List;
|
||||
|
|
@ -256,6 +254,19 @@ public class PlanApplyController {
|
|||
return pageInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 需求计划撤回
|
||||
* @param dto
|
||||
* @return ServerResponse
|
||||
* @author cwchen
|
||||
* @date 2025/3/21 18:17
|
||||
*/
|
||||
@PostMapping("withdrawData")
|
||||
@DecryptAndVerify(decryptedClass = PlanApplyVo.class)
|
||||
public ServerResponse withdrawData(EncryptedReq<PlanApplyVo> dto){
|
||||
return service.withdrawData(dto.getData());
|
||||
}
|
||||
|
||||
/**
|
||||
* 安全工器具的方法
|
||||
* @param
|
||||
|
|
|
|||
|
|
@ -169,6 +169,13 @@ public interface PlanApplyMapper {
|
|||
*/
|
||||
Integer getPlanData(PlanApplyVo data);
|
||||
|
||||
/**
|
||||
* 需求计划撤回
|
||||
* @param dto
|
||||
* @date 2025/1/23 18:47
|
||||
*/
|
||||
void withdrawData(PlanApplyVo dto);
|
||||
|
||||
/**
|
||||
* 判断安全工器具是否存在
|
||||
* @param planDevBean
|
||||
|
|
|
|||
|
|
@ -5,9 +5,7 @@ import com.bonus.aqgqj.business.backstage.entity.plan.PlanApplyVo;
|
|||
import com.bonus.aqgqj.business.backstage.entity.plan.PlanDetailVo;
|
||||
import com.bonus.aqgqj.manager.webResult.AjaxResult;
|
||||
import com.bonus.aqgqj.manager.webResult.ServerResponse;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -99,6 +97,15 @@ public interface PlanApplyService {
|
|||
*/
|
||||
ServerResponse editApplyPlan(PlanApplyVo data);
|
||||
|
||||
/**
|
||||
* 需求计划撤回
|
||||
* @param dto
|
||||
* @return ServerResponse
|
||||
* @author cwchen
|
||||
* @date 2025/3/21 18:18
|
||||
*/
|
||||
ServerResponse withdrawData(PlanApplyVo dto);
|
||||
|
||||
/**
|
||||
* 导入安全工器具
|
||||
*
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import com.bonus.aqgqj.business.backstage.mapper.plan.PlanApplyMapper;
|
|||
import com.bonus.aqgqj.manager.advice.ValidatorsUtils;
|
||||
import com.bonus.aqgqj.manager.common.util.DateTimeHelper;
|
||||
import com.bonus.aqgqj.manager.common.util.UserUtil;
|
||||
import com.bonus.aqgqj.manager.core.entity.EncryptedReq;
|
||||
import com.bonus.aqgqj.manager.security.entity.SelfUserEntity;
|
||||
import com.bonus.aqgqj.manager.webResult.AjaxResult;
|
||||
import com.bonus.aqgqj.manager.webResult.ServerResponse;
|
||||
|
|
@ -351,4 +352,23 @@ public class PlanApplyServiceImpl implements PlanApplyService {
|
|||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServerResponse withdrawData(PlanApplyVo dto) {
|
||||
try {
|
||||
// 添加创建人信息
|
||||
SelfUserEntity acount = UserUtil.getLoginUser();
|
||||
// 计划申请 status :0, status_type:0 表示撤回
|
||||
// 审批记录 status :0, status_type:-1 表示撤回
|
||||
mapper.withdrawData(dto);
|
||||
// 添加需求计划申请节点
|
||||
PlanAuditRecordVo vo = setPlanAuditRecordVoData(dto, acount, "-1");
|
||||
mapper.addPlanRecord(vo);
|
||||
return ServerResponse.createBySuccessMsg("撤回成功");
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return ServerResponse.createErroe("撤回失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,6 +125,10 @@
|
|||
<update id="editAuditStatus">
|
||||
UPDATE st_plan_apply SET status = '1',status_type = '2' WHERE id = #{id}
|
||||
</update>
|
||||
<!--需求计划撤回-->
|
||||
<update id="withdrawData">
|
||||
UPDATE st_plan_apply SET status = '0',status_type = '0' WHERE id = #{id}
|
||||
</update>
|
||||
<!--删除安全工器具数据-->
|
||||
<delete id="delPlanDetail">
|
||||
DELETE FROM st_plan_details WHERE id IN
|
||||
|
|
|
|||
Loading…
Reference in New Issue