需求计划撤回
This commit is contained in:
parent
36e8aa1188
commit
147732e3f0
|
|
@ -1,11 +1,18 @@
|
|||
package com.bonus.gzgqj.business.bases.controller;
|
||||
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.bonus.gzgqj.manager.common.util.JwtUtils;
|
||||
import com.bonus.gzgqj.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
|
||||
|
|
@ -25,7 +32,15 @@ public class HealthController {
|
|||
* @date 2024/11/27 16:00
|
||||
*/
|
||||
@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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,11 +2,7 @@ package com.bonus.gzgqj.business.plan.controller;
|
|||
|
||||
import java.io.OutputStream;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
|
@ -178,6 +174,9 @@ public class PlanApplicationController {
|
|||
private String getStatus(String statusType,String status) {
|
||||
try {
|
||||
String company ="";
|
||||
if(Objects.equals(statusType,"0") && Objects.equals(status,"0")){
|
||||
return "已撤回";
|
||||
}
|
||||
if("1".equals(statusType)) {
|
||||
return "审核通过";
|
||||
}else if("2".equals(statusType)) {
|
||||
|
|
@ -223,4 +222,17 @@ public class PlanApplicationController {
|
|||
public ServerResponse importExcelTools(HttpServletRequest request, @RequestParam(value = "file[]",required = false) MultipartFile[] files) {
|
||||
return service.importExcelTools(request,files);
|
||||
}
|
||||
|
||||
/**
|
||||
* 需求计划撤回
|
||||
* @param dto
|
||||
* @return ServerResponse
|
||||
* @author cwchen
|
||||
* @date 2025/3/21 18:17
|
||||
*/
|
||||
@PostMapping("withdrawData")
|
||||
@DecryptAndVerify(decryptedClass = PlanApplyBean.class)
|
||||
public ServerResponse withdrawData(EncryptedReq<PlanApplyBean> dto){
|
||||
return service.withdrawData(dto.getData());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,6 +97,15 @@ public interface PlanApplicationMapper {
|
|||
|
||||
List<PlanDevBean> getTypeList(PlanDevBean data);
|
||||
|
||||
/**
|
||||
* 需求计划撤回
|
||||
* @param data
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2025/3/23 17:05
|
||||
*/
|
||||
void withdrawData(PlanApplyBean data);
|
||||
|
||||
/**
|
||||
* 查询设备是否存在
|
||||
* @param planDevBean
|
||||
|
|
|
|||
|
|
@ -81,4 +81,13 @@ public interface PlanApplicationService {
|
|||
* @return
|
||||
*/
|
||||
ServerResponse importExcelTools(HttpServletRequest request, MultipartFile[] files);
|
||||
|
||||
/**
|
||||
* 需求计划撤回
|
||||
* @param data
|
||||
* @return ServerResponse
|
||||
* @author cwchen
|
||||
* @date 2025/3/23 17:04
|
||||
*/
|
||||
ServerResponse withdrawData(PlanApplyBean data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
|
@ -328,6 +329,21 @@ public class PlanApplicationServiceImp implements PlanApplicationService {
|
|||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public ServerResponse withdrawData(PlanApplyBean data) {
|
||||
try {
|
||||
// 添加创建人信息
|
||||
SelfUserEntity acount = UserUtil.getLoginUser();
|
||||
// 计划申请 status :0, status_type:0 表示撤回
|
||||
// 审批记录 status :0, status_type:-1 表示撤回
|
||||
dao.withdrawData(data);
|
||||
// 添加需求计划申请节点
|
||||
insetRescord(acount, data, "-1");
|
||||
return ServerResponse.createBySuccessMsg("撤回成功");
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return ServerResponse.createErroe("撤回失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,8 +92,12 @@
|
|||
need_time=#{needTime},updater=#{updater},update_time=now(),status=1,status_type=2
|
||||
where id=#{id}
|
||||
</update>
|
||||
|
||||
<!-- 插入数据详情 -->
|
||||
<!--需求计划撤回-->
|
||||
<update id="withdrawData">
|
||||
UPDATE t_plan_apply SET status = '0',status_type = '0' WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 插入数据详情 -->
|
||||
<insert id="insertDetail">
|
||||
insert INTO t_plan_details(
|
||||
apply_id,model_id,need_num,
|
||||
|
|
|
|||
Loading…
Reference in New Issue