Ver código fonte

增加通用暂存

tags/24080901
WendyYang 7 meses atrás
pai
commit
013d935a0f
23 arquivos alterados com 381 adições e 9 exclusões
  1. +1
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/external/todo/MHTodoClient.java
  2. +2
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/OperationManage.java
  3. +6
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java
  4. +9
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/dto/OperationReq.java
  5. +9
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/entity/Operation.java
  6. +19
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/entity/Purchase.java
  7. +26
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/enumerization/BidTypeEnum.java
  8. +24
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/enumerization/PurchaseScopeEnum.java
  9. +22
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/req/SubmitPurchaseNoticeReq.java
  10. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/scheduler/task/DeclaredRecordReminderTask.java
  11. +38
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/sys/controller/StagingController.java
  12. +61
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/sys/manage/StagingManage.java
  13. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/sys/mapper/MhTodoRecordMapper.java
  14. +16
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/sys/mapper/StagingMapper.java
  15. +5
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/sys/mapper/StagingMapper.xml
  16. +35
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/sys/model/dto/StagingDTO.java
  17. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/sys/model/entity/MhTodoRecord.java
  18. +42
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/sys/model/entity/Staging.java
  19. +25
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/sys/model/enumeration/StagingType.java
  20. +1
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/sys/service/IMhTodoRecordService.java
  21. +16
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/sys/service/IStagingService.java
  22. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/sys/service/impl/MhTodoRecordServiceImpl.java
  23. +20
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/sys/service/impl/StagingServiceImpl.java

+ 1
- 2
hz-pm-api/src/main/java/com/hz/pm/api/external/todo/MHTodoClient.java Ver arquivo

@@ -13,7 +13,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hz.pm.api.external.todo.dto.MhTodoRequestDTO;
import com.hz.pm.api.external.todo.dto.MhTodoRetDTO;
import com.hz.pm.api.external.todo.enumerization.MHTodoTypeEnum;
import com.hz.pm.api.sys.entity.MhTodoRecord;
import com.hz.pm.api.sys.model.entity.MhTodoRecord;
import com.hz.pm.api.sys.service.IMhTodoRecordService;
import com.hz.pm.api.user.security.model.UserFullInfoDTO;
import com.ningdatech.basic.exception.BizException;
@@ -26,7 +26,6 @@ import org.springframework.transaction.annotation.Transactional;

import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;

/**


+ 2
- 1
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/OperationManage.java Ver arquivo

@@ -35,8 +35,8 @@ import java.util.Objects;
* @Date 2023/7/31 14:48
* @Author PoffyZhang
*/
@Component
@Slf4j
@Component
@RequiredArgsConstructor
public class OperationManage {

@@ -85,6 +85,7 @@ public class OperationManage {
curr.setUpdateOn(now);
curr.setUpdateBy(user.getUsername());
operationService.saveOrUpdate(curr);

long operationCount = operationService.countByBidIds(purchaseMap.keySet());
if (operationCount == purchaseMap.size()) {
// 修改项目状态


+ 6
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java Ver arquivo

@@ -267,6 +267,12 @@ public class PurchaseManage {
purchase.setBidEndTime(w.getBidEndTime());
purchase.setId(w.getBidId());
purchase.setProjectId(projectId);
purchase.setPurchaseConnectAddress(w.getPurchaseConnectAddress());
purchase.setPurchasePhone(w.getPurchasePhone());
purchase.setPurchaseRemark(w.getPurchaseRemark());
purchase.setPurchaseScope(w.getPurchaseScope());
purchase.setPurchaseUnit(w.getPurchaseUnit());
purchase.setPurchaseContact(w.getPurchaseContact());
if (purchase.getId() == null) {
purchase.setCreateBy(user.getUserIdStr());
}


+ 9
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/dto/OperationReq.java Ver arquivo

@@ -50,4 +50,13 @@ public class OperationReq {
@ApiModelProperty("试运行开始时间")
private LocalDateTime pilotRunStartDate;

@ApiModelProperty("适配改造时间")
private LocalDateTime adaptationTime;

@ApiModelProperty("系统自测时间")
private LocalDateTime selfTestTime;

@ApiModelProperty("测试验证时间")
private LocalDateTime testValidTime;

}

+ 9
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/entity/Operation.java Ver arquivo

@@ -65,4 +65,13 @@ public class Operation {
@ApiModelProperty("试运行开始时间")
private LocalDateTime pilotRunStartDate;

@ApiModelProperty("适配改造时间")
private LocalDateTime adaptationTime;

@ApiModelProperty("系统自测时间")
private LocalDateTime selfTestTime;

@ApiModelProperty("测试验证时间")
private LocalDateTime testValidTime;

}

+ 19
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/entity/Purchase.java Ver arquivo

@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@@ -100,6 +101,24 @@ public class Purchase {

private Integer status;

@ApiModelProperty("采购范围:1 公开采购、2 非公开采购")
private Integer purchaseScope;

@ApiModelProperty("采购单位")
private String purchaseUnit;

@ApiModelProperty("采购联系人")
private String purchaseContact;

@ApiModelProperty("采购联系电话")
private String purchasePhone;

@ApiModelProperty("采购联系地址")
private String purchaseConnectAddress;

@ApiModelProperty("采购说明")
private String purchaseRemark;

@ApiModelProperty("初验材料")
private String preliminaryInspectionMaterials;



+ 26
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/enumerization/BidTypeEnum.java Ver arquivo

@@ -0,0 +1,26 @@
package com.hz.pm.api.projectdeclared.model.enumerization;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
* <p>
* BidTypeEnum
* </p>
*
* @author WendyYang
* @since 13:37 2024/3/25
*/
@Getter
@AllArgsConstructor
public enum BidTypeEnum {

BUILD(1, "建设类(无应用)"),
BUILD_APP(2, "建设类(总集成,软件开发)"),
SERVICE(3, "服务类(单一集成,项目监理,系统运维,咨询设计,系统测评,财务审计)"),
SERVICE_RENT(4, "服务类(产品采购、政务内网服务器租赁服务,政务外网云建设租赁服务)");

private final Integer code;
private final String val;

}

+ 24
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/enumerization/PurchaseScopeEnum.java Ver arquivo

@@ -0,0 +1,24 @@
package com.hz.pm.api.projectdeclared.model.enumerization;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
* <p>
* PurchaseScopeEnum
* </p>
*
* @author WendyYang
* @since 13:28 2024/3/25
*/
@Getter
@AllArgsConstructor
public enum PurchaseScopeEnum {

PUBLIC(1, "公开采购"),
PRIVATE(2, "非公开采购");

private final Integer code;
private final String val;

}

+ 22
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/req/SubmitPurchaseNoticeReq.java Ver arquivo

@@ -64,9 +64,31 @@ public class SubmitPurchaseNoticeReq {
@NotBlank(message = "采购方式不能为空")
private String purchaseMethod;

@ApiModelProperty("采购范围:1 公开采购、2 非公开采购")
private Integer purchaseScope;

@ApiModelProperty("标段类型")
private Integer bidType;

@ApiModelProperty("招标文件")
@NotBlank(message = "招标文件不能为空")
private String bidDoc;

@ApiModelProperty("采购单位")
private String purchaseUnit;

@ApiModelProperty("采购联系人")
private String purchaseContact;

@ApiModelProperty("采购联系电话")
private String purchasePhone;

@ApiModelProperty("采购联系地址")
private String purchaseConnectAddress;

@ApiModelProperty("采购说明")
private String purchaseRemark;

}

}

+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/scheduler/task/DeclaredRecordReminderTask.java Ver arquivo

@@ -14,7 +14,7 @@ import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.service.IMhProjectService;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.sys.entity.MhTodoRecord;
import com.hz.pm.api.sys.model.entity.MhTodoRecord;
import com.hz.pm.api.sys.service.IMhTodoRecordService;
import com.hz.pm.api.user.helper.MhUnitCache;
import com.hz.pm.api.user.model.dto.UnitDTO;


+ 38
- 0
hz-pm-api/src/main/java/com/hz/pm/api/sys/controller/StagingController.java Ver arquivo

@@ -0,0 +1,38 @@
package com.hz.pm.api.sys.controller;

import com.hz.pm.api.sys.manage.StagingManage;
import com.hz.pm.api.sys.model.dto.StagingDTO;
import com.hz.pm.api.sys.model.enumeration.StagingType;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
* <p>
* 通用暂存前端控制器
* </p>
*
* @author WendyYang
* @since 2024-03-25
*/
@RestController
@AllArgsConstructor
@RequestMapping("/api/v1/staging")
public class StagingController {

private final StagingManage stagingManage;

@PostMapping("/save")
@ApiOperation("保存暂存")
public void saveStaging(@Valid @RequestBody StagingDTO staging) {
stagingManage.save(staging);
}

@GetMapping(value = {"/detail/{type}", "/detail/{type}/{bizId}"})
public StagingDTO detail(@PathVariable StagingType type, @PathVariable(required = false) String bizId) {
return stagingManage.detail(type, bizId);
}

}

+ 61
- 0
hz-pm-api/src/main/java/com/hz/pm/api/sys/manage/StagingManage.java Ver arquivo

@@ -0,0 +1,61 @@
package com.hz.pm.api.sys.manage;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hz.pm.api.common.model.constant.BizConst;
import com.hz.pm.api.sys.model.dto.StagingDTO;
import com.hz.pm.api.sys.model.entity.Staging;
import com.hz.pm.api.sys.model.enumeration.StagingType;
import com.hz.pm.api.sys.service.IStagingService;
import com.hz.pm.api.user.util.LoginUserUtil;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
* <p>
* StagingManage
* </p>
*
* @author WendyYang
* @since 14:21 2024/3/25
*/
@Component
@AllArgsConstructor
public class StagingManage {

private final IStagingService stagingService;

public void save(StagingDTO staging) {
Staging entity = new Staging();
entity.setType(staging.getType().name());
entity.setContent(staging.getContent());
entity.setBizId(staging.getBizId());
entity.setCreateBy(LoginUserUtil.getUserId());
entity.setCreateOn(LocalDateTime.now());
stagingService.save(entity);
}

public StagingDTO detail(StagingType type, String bizId) {
Wrapper<Staging> query = Wrappers.lambdaQuery(Staging.class)
.eq(Staging::getType, type)
.eq(Staging::getCreateBy, LoginUserUtil.getUserId())
.eq(StrUtil.isNotBlank(bizId), Staging::getBizId, bizId)
.orderByDesc(Staging::getCreateOn, Staging::getId)
.last(BizConst.LIMIT_1);
Staging staging = stagingService.getOne(query);
if (staging == null) {
return null;
}
StagingDTO detail = new StagingDTO();
detail.setId(staging.getId());
detail.setContent(staging.getType());
detail.setType(StagingType.valueOf(staging.getType()));
detail.setBizId(staging.getBizId());
return detail;
}

}

+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/sys/mapper/MhTodoRecordMapper.java Ver arquivo

@@ -1,6 +1,6 @@
package com.hz.pm.api.sys.mapper;

import com.hz.pm.api.sys.entity.MhTodoRecord;
import com.hz.pm.api.sys.model.entity.MhTodoRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**


+ 16
- 0
hz-pm-api/src/main/java/com/hz/pm/api/sys/mapper/StagingMapper.java Ver arquivo

@@ -0,0 +1,16 @@
package com.hz.pm.api.sys.mapper;

import com.hz.pm.api.sys.model.entity.Staging;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
* <p>
* Mapper 接口
* </p>
*
* @author WendyYang
* @since 2024-03-25
*/
public interface StagingMapper extends BaseMapper<Staging> {

}

+ 5
- 0
hz-pm-api/src/main/java/com/hz/pm/api/sys/mapper/StagingMapper.xml Ver arquivo

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hz.pm.api.sys.mapper.StagingMapper">

</mapper>

+ 35
- 0
hz-pm-api/src/main/java/com/hz/pm/api/sys/model/dto/StagingDTO.java Ver arquivo

@@ -0,0 +1,35 @@
package com.hz.pm.api.sys.model.dto;

import com.hz.pm.api.sys.model.enumeration.StagingType;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
* <p>
* StagingDTO
* </p>
*
* @author WendyYang
* @since 14:24 2024/3/25
*/
@Data
public class StagingDTO {

@ApiModelProperty("暂存ID")
private Long id;

@ApiModelProperty("唯一业务标识")
private String bizId;

@ApiModelProperty("暂存类型")
@NotNull(message = "暂存类型不能为空")
private StagingType type;

@ApiModelProperty("暂存内容")
@NotBlank(message = "暂存内容不能为空")
private String content;

}

hz-pm-api/src/main/java/com/hz/pm/api/sys/entity/MhTodoRecord.java → hz-pm-api/src/main/java/com/hz/pm/api/sys/model/entity/MhTodoRecord.java Ver arquivo

@@ -1,4 +1,4 @@
package com.hz.pm.api.sys.entity;
package com.hz.pm.api.sys.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

+ 42
- 0
hz-pm-api/src/main/java/com/hz/pm/api/sys/model/entity/Staging.java Ver arquivo

@@ -0,0 +1,42 @@
package com.hz.pm.api.sys.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
* <p>
* 通用暂存表
* </p>
*
* @author WendyYang
* @since 2024-03-25
*/
@Getter
@Setter
@TableName("ND_STAGING")
@ApiModel(value = "NdStaging对象")
public class Staging implements Serializable {

private static final long serialVersionUID = 1L;

@TableId(value = "ID", type = IdType.AUTO)
private Long id;

private String type;

private String content;

private String bizId;

private Long createBy;

private LocalDateTime createOn;

}

+ 25
- 0
hz-pm-api/src/main/java/com/hz/pm/api/sys/model/enumeration/StagingType.java Ver arquivo

@@ -0,0 +1,25 @@
package com.hz.pm.api.sys.model.enumeration;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
* <p>
* StagingType
* </p>
*
* @author WendyYang
* @since 14:26 2024/3/25
*/
@Getter
@AllArgsConstructor
public enum StagingType {

PURCHASE_NOTICE("发布采购公告"),
PURCHASE_RECORD("采购信息备案"),
CONSTRUCTION_RECORD("采购合同备案"),
OPERATION_PLAN("填写实施计划");

private final String val;

}

+ 1
- 2
hz-pm-api/src/main/java/com/hz/pm/api/sys/service/IMhTodoRecordService.java Ver arquivo

@@ -1,10 +1,9 @@
package com.hz.pm.api.sys.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hz.pm.api.external.todo.enumerization.MHTodoTypeEnum;
import com.hz.pm.api.sys.entity.MhTodoRecord;
import com.hz.pm.api.sys.model.entity.MhTodoRecord;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.Collection;


+ 16
- 0
hz-pm-api/src/main/java/com/hz/pm/api/sys/service/IStagingService.java Ver arquivo

@@ -0,0 +1,16 @@
package com.hz.pm.api.sys.service;

import com.hz.pm.api.sys.model.entity.Staging;
import com.baomidou.mybatisplus.extension.service.IService;

/**
* <p>
* 服务类
* </p>
*
* @author WendyYang
* @since 2024-03-25
*/
public interface IStagingService extends IService<Staging> {

}

+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/sys/service/impl/MhTodoRecordServiceImpl.java Ver arquivo

@@ -1,6 +1,6 @@
package com.hz.pm.api.sys.service.impl;

import com.hz.pm.api.sys.entity.MhTodoRecord;
import com.hz.pm.api.sys.model.entity.MhTodoRecord;
import com.hz.pm.api.sys.mapper.MhTodoRecordMapper;
import com.hz.pm.api.sys.service.IMhTodoRecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;


+ 20
- 0
hz-pm-api/src/main/java/com/hz/pm/api/sys/service/impl/StagingServiceImpl.java Ver arquivo

@@ -0,0 +1,20 @@
package com.hz.pm.api.sys.service.impl;

import com.hz.pm.api.sys.model.entity.Staging;
import com.hz.pm.api.sys.mapper.StagingMapper;
import com.hz.pm.api.sys.service.IStagingService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
* <p>
* 服务实现类
* </p>
*
* @author WendyYang
* @since 2024-03-25
*/
@Service
public class StagingServiceImpl extends ServiceImpl<StagingMapper, Staging> implements IStagingService {

}

Carregando…
Cancelar
Salvar