1.全过程管理附件上送

This commit is contained in:
2024-11-01 16:31:25 +08:00
parent 84321ff192
commit b49ba0e06f
6 changed files with 89 additions and 11 deletions

View File

@@ -43,7 +43,7 @@ public class SupvFile {
@ApiModelProperty("附件名称") @ApiModelProperty("附件名称")
private String attachmentName; private String attachmentName;
@ApiModelProperty("0.计划 1.问题") @ApiModelProperty("0.计划 1.问题 2.全过程")
private Integer type; private Integer type;
@ApiModelProperty("附件分类") @ApiModelProperty("附件分类")

View File

@@ -1,6 +1,7 @@
package com.njcn.process.pojo.po; package com.njcn.process.pojo.po;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@@ -16,6 +17,8 @@ import lombok.Data;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import javax.validation.constraints.NotBlank;
/** /**
* <p> * <p>
* *
@@ -30,17 +33,21 @@ public class SupvPlanRel {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@TableId
private String objId; private String objId;
@NotBlank(message = "计划id不可为空")
private String planId; private String planId;
/** /**
* 关联对象类型 * 关联对象类型
*/ */
@NotBlank(message = "关联对象类型不可为空")
private String relObjType; private String relObjType;
private String relObjId; private String relObjId;
@NotBlank(message = "对象名称不可为空")
private String relObjName; private String relObjName;
private Timestamp createTimes; private Timestamp createTimes;
@@ -49,12 +56,14 @@ public class SupvPlanRel {
private Long createTime; private Long createTime;
private Timestamp updateTimes; private Timestamp updateTimes;
@TableField(exist = false) @TableField(exist = false)
private Long updateTime; private Long updateTime;
private String isDelete; private String isDelete;
private Timestamp deleteTimes; private Timestamp deleteTimes;
@TableField(exist = false) @TableField(exist = false)
private Long deleteTime; private Long deleteTime;

View File

@@ -10,6 +10,7 @@ import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil; import com.njcn.common.utils.HttpResultUtil;
import com.njcn.process.pojo.param.SupvPlanParam; import com.njcn.process.pojo.param.SupvPlanParam;
import com.njcn.process.pojo.po.SupvPlan; import com.njcn.process.pojo.po.SupvPlan;
import com.njcn.process.pojo.po.SupvPlanRel;
import com.njcn.process.pojo.vo.SupvPlanVO; import com.njcn.process.pojo.vo.SupvPlanVO;
import com.njcn.process.service.ISupvPlanService; import com.njcn.process.service.ISupvPlanService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@@ -65,7 +66,7 @@ public class SupvPlanController extends BaseController {
} }
@PostMapping("delPlan") @PostMapping("delPlan")
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD) @OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.DELETE)
@ApiOperation("删除监督计划") @ApiOperation("删除监督计划")
@ApiImplicitParam(name = "planIds",value = "监督计划索引集合",required = true) @ApiImplicitParam(name = "planIds",value = "监督计划索引集合",required = true)
public HttpResult<Object> delPlan(@RequestBody List<String> planIds){ public HttpResult<Object> delPlan(@RequestBody List<String> planIds){
@@ -86,6 +87,39 @@ public class SupvPlanController extends BaseController {
@PostMapping("saveOrUpdatePlanRel")
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
@ApiOperation("新增变容器组关联对象")
@ApiImplicitParam(name = "supvPlanRel",value = "请求体",required = true)
public HttpResult<Object> saveOrUpdatePlanRel(@RequestBody @Validated SupvPlanRel supvPlanRel){
String methodDescribe = getMethodDescribe("saveOrUpdatePlanRel");
iSupvPlanService.saveOrUpdatePlanRel(supvPlanRel);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
@PostMapping("delPlanRel")
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.DELETE)
@ApiOperation("删除变容器组关联对象")
@ApiImplicitParam(name = "planRelIds",value = "监督计划索引集合",required = true)
public HttpResult<Object> delPlanRel(@RequestBody List<String> planRelIds){
String methodDescribe = getMethodDescribe("delPlanRel");
iSupvPlanService.delPlanRel(planRelIds);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
@PostMapping("planRelList")
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@ApiOperation("查询变容器组关联对象")
@ApiImplicitParam(name = "supvPlanRel",value = "请求体",required = true)
public HttpResult<List<SupvPlanRel>> planRelList(@RequestBody SupvPlanRel supvPlanRel){
String methodDescribe = getMethodDescribe("planRelList");
List<SupvPlanRel> result = iSupvPlanService.planList(supvPlanRel);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
}
} }

View File

@@ -6,7 +6,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.common.pojo.response.HttpResult; import com.njcn.common.pojo.response.HttpResult;
import com.njcn.process.pojo.param.SupvPlanParam; import com.njcn.process.pojo.param.SupvPlanParam;
import com.njcn.process.pojo.po.SupvPlan; import com.njcn.process.pojo.po.SupvPlan;
import com.njcn.process.pojo.po.SupvPlanRel;
import com.njcn.process.pojo.vo.SupvPlanVO; import com.njcn.process.pojo.vo.SupvPlanVO;
import liquibase.pro.packaged.S;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@@ -54,5 +56,12 @@ public interface ISupvPlanService extends IService<SupvPlan> {
boolean saveOrUpdatePlanRel(SupvPlanRel supvPlanRel);
boolean delPlanRel(List<String> planRelIds);
List<SupvPlanRel> planList(SupvPlanRel supvPlanRel);
} }

View File

@@ -21,12 +21,10 @@ import com.njcn.oss.utils.FileStorageUtil;
import com.njcn.process.enums.ProcessResponseEnum; import com.njcn.process.enums.ProcessResponseEnum;
import com.njcn.process.mapper.SupvFileMapper; import com.njcn.process.mapper.SupvFileMapper;
import com.njcn.process.mapper.SupvPlanMapper; import com.njcn.process.mapper.SupvPlanMapper;
import com.njcn.process.mapper.SupvPlanRelMapper;
import com.njcn.process.mapper.SupvProblemMapper; import com.njcn.process.mapper.SupvProblemMapper;
import com.njcn.process.pojo.param.SupvPlanParam; import com.njcn.process.pojo.param.SupvPlanParam;
import com.njcn.process.pojo.po.SupvFile; import com.njcn.process.pojo.po.*;
import com.njcn.process.pojo.po.SupvPlan;
import com.njcn.process.pojo.po.SupvPlanHis;
import com.njcn.process.pojo.po.SupvProblem;
import com.njcn.process.pojo.vo.SupvPlanVO; import com.njcn.process.pojo.vo.SupvPlanVO;
import com.njcn.process.service.ISupvFileService; import com.njcn.process.service.ISupvFileService;
import com.njcn.process.service.ISupvPlanHisService; import com.njcn.process.service.ISupvPlanHisService;
@@ -52,13 +50,11 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.sql.Timestamp;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.ArrayList; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
@@ -88,6 +84,8 @@ public class SupvPlanServiceImpl extends ServiceImpl<SupvPlanMapper, SupvPlan> i
private final FileStorageUtil fileStorageUtil; private final FileStorageUtil fileStorageUtil;
private final ISupvPlanHisService supvPlanHisService; private final ISupvPlanHisService supvPlanHisService;
private final SupvPlanRelMapper supvPlanRelMapper;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@@ -365,6 +363,34 @@ public class SupvPlanServiceImpl extends ServiceImpl<SupvPlanMapper, SupvPlan> i
return pageVo; return pageVo;
} }
@Override
public boolean saveOrUpdatePlanRel(SupvPlanRel supvPlanRel) {
if(StrUtil.isBlank(supvPlanRel.getObjId())){
supvPlanRel.setRelObjId(IdUtil.simpleUUID());
supvPlanRel.setCreateTimes(new Timestamp(new Date().getTime()));
supvPlanRel.setUpdateTimes(new Timestamp(new Date().getTime()));
supvPlanRel.setIsDelete("0");
supvPlanRelMapper.insert(supvPlanRel);
}else {
supvPlanRel.setUpdateTimes(new Timestamp(new Date().getTime()));
supvPlanRelMapper.updateById(supvPlanRel);
}
return true;
}
@Override
public boolean delPlanRel(List<String> planRelIds) {
int res = supvPlanRelMapper.deleteBatchIds(planRelIds);
return res == planRelIds.size();
}
@Override
public List<SupvPlanRel> planList(SupvPlanRel supvPlanRel) {
LambdaQueryWrapper<SupvPlanRel> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(SupvPlanRel::getPlanId,supvPlanRel.getPlanId()).orderByDesc(SupvPlanRel::getCreateTimes);
return supvPlanRelMapper.selectList(lambdaQueryWrapper);
}
private void checkParam(SupvPlanParam supvPlanParam, Boolean updateFlag) { private void checkParam(SupvPlanParam supvPlanParam, Boolean updateFlag) {

View File

@@ -758,8 +758,8 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
otherParams.put("fileCount", (int) Math.ceil(s.length() / (1365000 * 1.0)) + ""); otherParams.put("fileCount", (int) Math.ceil(s.length() / (1365000 * 1.0)) + "");
otherParams.put("fileCurrentNum", m + ""); otherParams.put("fileCurrentNum", m + "");
str = requestCommon("pqFileFromHyCreate", url, otherParams);
otherParams.put("fileByte", s.substring(i, Math.min(i + 1365000, s.length()))); otherParams.put("fileByte", s.substring(i, Math.min(i + 1365000, s.length())));
str = requestCommon("pqFileFromHyCreate", url, otherParams);
m++; m++;
} }