招投标
This commit is contained in:
parent
6c698b5256
commit
8db8dec22b
|
@ -82,5 +82,7 @@ public class Message implements Serializable {
|
||||||
public static final String DAILY_REPORT_EXISTS = "当日已提交日报";
|
public static final String DAILY_REPORT_EXISTS = "当日已提交日报";
|
||||||
public static final String BIDDING_INFO_ID_IS_NOT_EXIST = "招标信息id不存在";
|
public static final String BIDDING_INFO_ID_IS_NOT_EXIST = "招标信息id不存在";
|
||||||
public static final String TENDER_INFO_ID_IS_NOT_EXIST = "投标信息id不存在";
|
public static final String TENDER_INFO_ID_IS_NOT_EXIST = "投标信息id不存在";
|
||||||
|
public static final String TENDER_INFO_IS_EXIST = "招标[{}]已存中投信息存在";
|
||||||
public static final String OUTBID_INFO_ID_IS_NOT_EXIST = "中标信息id不存在";
|
public static final String OUTBID_INFO_ID_IS_NOT_EXIST = "中标信息id不存在";
|
||||||
|
public static final String OUTBID_INFO_IS_EXIST = "招标[{}]已存中标信息存在";
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,10 @@ public class AttachInfoEntity extends AuditableEntity implements Serializable {
|
||||||
@TableField("business_type")
|
@TableField("business_type")
|
||||||
private String businessType;
|
private String businessType;
|
||||||
|
|
||||||
|
@ApiModelProperty("文件名")
|
||||||
|
@TableField("file_name")
|
||||||
|
private String fileName;
|
||||||
|
|
||||||
@ApiModelProperty("文件类型")
|
@ApiModelProperty("文件类型")
|
||||||
@TableField("file_type")
|
@TableField("file_type")
|
||||||
private String fileType;
|
private String fileType;
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class OutbidInfoEntity extends AuditableEntity implements Serializable {
|
||||||
|
|
||||||
@ApiModelProperty("中标通知信息id")
|
@ApiModelProperty("中标通知信息id")
|
||||||
@TableId(type = IdType.ASSIGN_UUID)
|
@TableId(type = IdType.ASSIGN_UUID)
|
||||||
private String outbidId;
|
private String outbidInfoId;
|
||||||
|
|
||||||
@ApiModelProperty("招标信息id")
|
@ApiModelProperty("招标信息id")
|
||||||
private String biddingInfoId;
|
private String biddingInfoId;
|
||||||
|
@ -48,6 +48,9 @@ public class OutbidInfoEntity extends AuditableEntity implements Serializable {
|
||||||
@ApiModelProperty("中标通知文件")
|
@ApiModelProperty("中标通知文件")
|
||||||
private String outbidNoticeFileId;
|
private String outbidNoticeFileId;
|
||||||
|
|
||||||
|
@ApiModelProperty("状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
@ApiModelProperty("删除标志(0代表存在 1代表删除)")
|
@ApiModelProperty("删除标志(0代表存在 1代表删除)")
|
||||||
@TableLogic(value = "0", delval = "1")
|
@TableLogic(value = "0", delval = "1")
|
||||||
private String delFlag;
|
private String delFlag;
|
||||||
|
|
|
@ -24,6 +24,9 @@ public class AttachInfoReq implements Serializable {
|
||||||
@ApiModelProperty("自定义路径")
|
@ApiModelProperty("自定义路径")
|
||||||
private String userDefinedPath;
|
private String userDefinedPath;
|
||||||
|
|
||||||
|
@ApiModelProperty("文件名称")
|
||||||
|
private String fileName;
|
||||||
|
|
||||||
@ApiModelProperty("文件类型")
|
@ApiModelProperty("文件类型")
|
||||||
private String fileType;
|
private String fileType;
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,9 @@ public class AttachInfoResp implements Serializable {
|
||||||
@ApiModelProperty("附件路径")
|
@ApiModelProperty("附件路径")
|
||||||
private String attachPath;
|
private String attachPath;
|
||||||
|
|
||||||
|
@ApiModelProperty("文件名称")
|
||||||
|
private String fileName;
|
||||||
|
|
||||||
@ApiModelProperty("文件类型")
|
@ApiModelProperty("文件类型")
|
||||||
private String fileType;
|
private String fileType;
|
||||||
|
|
||||||
|
|
|
@ -46,10 +46,6 @@ public class BiddingInfoReq implements Serializable {
|
||||||
private String source;
|
private String source;
|
||||||
|
|
||||||
@ApiModelProperty("信息来源网址")
|
@ApiModelProperty("信息来源网址")
|
||||||
@Size(max = 500, message = "信息来源网址不能超过500个字符")
|
@Size(max = 100, message = "信息来源网址不能超过100个字符")
|
||||||
private String sourceWebsite;
|
private String sourceWebsite;
|
||||||
|
|
||||||
@ApiModelProperty("招标文件")
|
|
||||||
@Size(max = 200, message = "招标文件不能超过200个字符")
|
|
||||||
private String biddingFileId;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,9 @@ public class BiddingInfoResp extends BiddingInfoReq implements Serializable {
|
||||||
@ApiModelProperty("招标信息id")
|
@ApiModelProperty("招标信息id")
|
||||||
private String biddingInfoId;
|
private String biddingInfoId;
|
||||||
|
|
||||||
|
@ApiModelProperty("文件名称")
|
||||||
|
private String fileName;
|
||||||
|
|
||||||
@ApiModelProperty("招标文件地址")
|
@ApiModelProperty("招标文件地址")
|
||||||
private String attachPath;
|
private String attachPath;
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class OutbidInfoReq implements Serializable {
|
||||||
private String biddingInfoId;
|
private String biddingInfoId;
|
||||||
|
|
||||||
@ApiModelProperty("中标金额")
|
@ApiModelProperty("中标金额")
|
||||||
private BigDecimal outBidAmount;
|
private BigDecimal outbidAmount;
|
||||||
|
|
||||||
@ApiModelProperty("工期")
|
@ApiModelProperty("工期")
|
||||||
private Integer duration;
|
private Integer duration;
|
||||||
|
|
|
@ -27,6 +27,9 @@ public class OutbidInfoResp extends OutbidInfoReq implements Serializable {
|
||||||
@ApiModelProperty("招标公司")
|
@ApiModelProperty("招标公司")
|
||||||
private String biddingCompany;
|
private String biddingCompany;
|
||||||
|
|
||||||
|
@ApiModelProperty("文件名称")
|
||||||
|
private String fileName;
|
||||||
|
|
||||||
@ApiModelProperty("中标通知文件地址")
|
@ApiModelProperty("中标通知文件地址")
|
||||||
private String attachPath;
|
private String attachPath;
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,9 @@ public class TenderInfoResp extends TenderInfoReq implements Serializable {
|
||||||
@ApiModelProperty("招标公司")
|
@ApiModelProperty("招标公司")
|
||||||
private String biddingCompany;
|
private String biddingCompany;
|
||||||
|
|
||||||
|
@ApiModelProperty("文件名称")
|
||||||
|
private String fileName;
|
||||||
|
|
||||||
@ApiModelProperty("投标文件地址")
|
@ApiModelProperty("投标文件地址")
|
||||||
private String attachPath;
|
private String attachPath;
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,10 @@ public enum AttachBusinessTypeEnum {
|
||||||
DEFECT_MARK_PIC("defect_mark_pic", "缺陷标注图片"),
|
DEFECT_MARK_PIC("defect_mark_pic", "缺陷标注图片"),
|
||||||
REPORT("report", "报告"),
|
REPORT("report", "报告"),
|
||||||
PROJECT_BUDGE("project_budge", "预算文件"),
|
PROJECT_BUDGE("project_budge", "预算文件"),
|
||||||
|
PROJECT_DAILY_REPORT("project_daily_report", "项目日报文件"),
|
||||||
|
BIDDING_INFO("bidding_info", "招标信息"),
|
||||||
|
TENDER_INFO("tender_info", "投标信息"),
|
||||||
|
OUTBID_INFO("outbid_info", "中标信息"),
|
||||||
;
|
;
|
||||||
private final String code;
|
private final String code;
|
||||||
private final String desc;
|
private final String desc;
|
||||||
|
|
|
@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.dite.znpt.domain.entity.BiddingInfoEntity;
|
import com.dite.znpt.domain.entity.BiddingInfoEntity;
|
||||||
import com.dite.znpt.domain.vo.BiddingInfoReq;
|
import com.dite.znpt.domain.vo.BiddingInfoReq;
|
||||||
import com.dite.znpt.domain.vo.BiddingInfoResp;
|
import com.dite.znpt.domain.vo.BiddingInfoResp;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,5 @@ public interface OutbidInfoService extends IService<OutbidInfoEntity> {
|
||||||
void save(OutbidInfoReq req);
|
void save(OutbidInfoReq req);
|
||||||
void update(String outbidInfoId, OutbidInfoReq req);
|
void update(String outbidInfoId, OutbidInfoReq req);
|
||||||
void deleteById(String outbidInfoId);
|
void deleteById(String outbidInfoId);
|
||||||
void uploadOutbidNoticeFile(String outBidInfoId, String outbidFileId);
|
|
||||||
void downLoadOutbidNoticeFile(String outbidFileId, HttpServletResponse response) throws Exception;
|
void downLoadOutbidNoticeFile(String outbidFileId, HttpServletResponse response) throws Exception;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.dite.znpt.domain.entity.TenderInfoEntity;
|
import com.dite.znpt.domain.entity.TenderInfoEntity;
|
||||||
import com.dite.znpt.domain.vo.TenderInfoReq;
|
import com.dite.znpt.domain.vo.TenderInfoReq;
|
||||||
import com.dite.znpt.domain.vo.TenderInfoResp;
|
import com.dite.znpt.domain.vo.TenderInfoResp;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -20,6 +19,5 @@ public interface TenderInfoService extends IService<TenderInfoEntity> {
|
||||||
void save(TenderInfoReq req);
|
void save(TenderInfoReq req);
|
||||||
void update(String tenderInfoId, TenderInfoReq req);
|
void update(String tenderInfoId, TenderInfoReq req);
|
||||||
void deleteById(String tenderInfoId);
|
void deleteById(String tenderInfoId);
|
||||||
void uploadBiddingInfoFile(String tenderInfoId, String tenderFileId);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,9 +81,11 @@ public class AttachInfoServiceImpl extends ServiceImpl<FileInfoMapper, AttachInf
|
||||||
try {
|
try {
|
||||||
String path = temPathPrefix + file.getOriginalFilename();
|
String path = temPathPrefix + file.getOriginalFilename();
|
||||||
FileUtil.writeBytes(file.getBytes(),path);
|
FileUtil.writeBytes(file.getBytes(),path);
|
||||||
|
String fileName = StrUtil.isBlank(infoReq.getFileName()) ? file.getOriginalFilename() : infoReq.getFileName();
|
||||||
AttachInfoEntity attachInfo = AttachInfoEntity.builder()
|
AttachInfoEntity attachInfo = AttachInfoEntity.builder()
|
||||||
.attachPath(FilePathEnum.ATTACH.getFileDownPath(path))
|
.attachPath(FilePathEnum.ATTACH.getFileDownPath(path))
|
||||||
.businessType(businessType)
|
.businessType(businessType)
|
||||||
|
.fileName(fileName)
|
||||||
.fileType(infoReq.getFileType())
|
.fileType(infoReq.getFileType())
|
||||||
.remark(infoReq.getRemark())
|
.remark(infoReq.getRemark())
|
||||||
.build();
|
.build();
|
||||||
|
|
|
@ -72,6 +72,9 @@ public class BiddingInfoServiceImpl extends ServiceImpl<BiddingInfoMapper, Biddi
|
||||||
}
|
}
|
||||||
entity.setBiddingFileId(biddingFileId);
|
entity.setBiddingFileId(biddingFileId);
|
||||||
this.updateById(entity);
|
this.updateById(entity);
|
||||||
|
|
||||||
|
attachInfo.setBusinessId(biddingInfoId);
|
||||||
|
attachInfoService.updateById(attachInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package com.dite.znpt.service.impl;
|
package com.dite.znpt.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.dite.znpt.constant.Constants;
|
import com.dite.znpt.constant.Constants;
|
||||||
import com.dite.znpt.constant.Message;
|
import com.dite.znpt.constant.Message;
|
||||||
|
@ -11,11 +13,11 @@ import com.dite.znpt.domain.vo.OutbidInfoResp;
|
||||||
import com.dite.znpt.exception.ServiceException;
|
import com.dite.znpt.exception.ServiceException;
|
||||||
import com.dite.znpt.mapper.OutbidInfoMapper;
|
import com.dite.znpt.mapper.OutbidInfoMapper;
|
||||||
import com.dite.znpt.service.AttachInfoService;
|
import com.dite.znpt.service.AttachInfoService;
|
||||||
|
import com.dite.znpt.service.BiddingInfoService;
|
||||||
import com.dite.znpt.service.OutbidInfoService;
|
import com.dite.znpt.service.OutbidInfoService;
|
||||||
import com.dite.znpt.util.PageUtil;
|
import com.dite.znpt.util.PageUtil;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
@ -29,8 +31,12 @@ import java.util.List;
|
||||||
@Service
|
@Service
|
||||||
public class OutbidInfoServiceImpl extends ServiceImpl<OutbidInfoMapper, OutbidInfoEntity> implements OutbidInfoService {
|
public class OutbidInfoServiceImpl extends ServiceImpl<OutbidInfoMapper, OutbidInfoEntity> implements OutbidInfoService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BiddingInfoService biddingInfoService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private AttachInfoService attachInfoService;
|
private AttachInfoService attachInfoService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<OutbidInfoResp> page(String projectName) {
|
public List<OutbidInfoResp> page(String projectName) {
|
||||||
PageUtil.startPage();
|
PageUtil.startPage();
|
||||||
|
@ -51,7 +57,22 @@ public class OutbidInfoServiceImpl extends ServiceImpl<OutbidInfoMapper, OutbidI
|
||||||
@Override
|
@Override
|
||||||
public void save(OutbidInfoReq req) {
|
public void save(OutbidInfoReq req) {
|
||||||
OutbidInfoEntity entity = Converts.INSTANCE.toOutbidInfoEntity(req);
|
OutbidInfoEntity entity = Converts.INSTANCE.toOutbidInfoEntity(req);
|
||||||
|
if(!listByBiddingInfoId(req.getBiddingInfoId()).isEmpty()){
|
||||||
|
throw new ServiceException(StrUtil.format(Message.OUTBID_INFO_IS_EXIST, req.getBiddingInfoId()));
|
||||||
|
}
|
||||||
this.save(entity);
|
this.save(entity);
|
||||||
|
if(StrUtil.isNotBlank(req.getOutbidNoticeFileId())){
|
||||||
|
AttachInfoEntity attachInfo = attachInfoService.getById(req.getOutbidNoticeFileId());
|
||||||
|
if(null == attachInfo || !Constants.DEL_FLAG_0.equals(attachInfo.getDelFlag())){
|
||||||
|
throw new ServiceException(Message.ATTACH_INFO_IS_NOT_EXIST);
|
||||||
|
}
|
||||||
|
attachInfo.setBusinessId(entity.getOutbidInfoId());
|
||||||
|
attachInfoService.updateById(attachInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<OutbidInfoEntity> listByBiddingInfoId(String biddingInfoId){
|
||||||
|
return this.list(Wrappers.<OutbidInfoEntity>lambdaQuery().eq(OutbidInfoEntity::getBiddingInfoId, biddingInfoId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@ -61,9 +82,26 @@ public class OutbidInfoServiceImpl extends ServiceImpl<OutbidInfoMapper, OutbidI
|
||||||
if(null == outbidInfo){
|
if(null == outbidInfo){
|
||||||
throw new ServiceException(Message.OUTBID_INFO_ID_IS_NOT_EXIST);
|
throw new ServiceException(Message.OUTBID_INFO_ID_IS_NOT_EXIST);
|
||||||
}
|
}
|
||||||
|
if(!outbidInfo.getBiddingInfoId().equals(req.getBiddingInfoId())){
|
||||||
|
if(!listByBiddingInfoId(req.getBiddingInfoId()).isEmpty()){
|
||||||
|
throw new ServiceException(StrUtil.format(Message.OUTBID_INFO_IS_EXIST, req.getBiddingInfoId()));
|
||||||
|
}
|
||||||
|
}
|
||||||
OutbidInfoEntity entity = Converts.INSTANCE.toOutbidInfoEntity(req);
|
OutbidInfoEntity entity = Converts.INSTANCE.toOutbidInfoEntity(req);
|
||||||
entity.setOutbidId(outbidInfoId);
|
entity.setOutbidInfoId(outbidInfoId);
|
||||||
this.updateById(entity);
|
this.updateById(entity);
|
||||||
|
if(StrUtil.isNotBlank(req.getOutbidNoticeFileId())){
|
||||||
|
AttachInfoEntity attachInfo = attachInfoService.getById(req.getOutbidNoticeFileId());
|
||||||
|
if(null == attachInfo || !Constants.DEL_FLAG_0.equals(attachInfo.getDelFlag())){
|
||||||
|
throw new ServiceException(Message.ATTACH_INFO_IS_NOT_EXIST);
|
||||||
|
}
|
||||||
|
attachInfo.setBusinessId(outbidInfoId);
|
||||||
|
attachInfoService.updateById(attachInfo);
|
||||||
|
}else {
|
||||||
|
if(StrUtil.isNotBlank(outbidInfo.getOutbidNoticeFileId())){
|
||||||
|
attachInfoService.deleteByAttachInfoId(outbidInfo.getOutbidNoticeFileId());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@ -74,20 +112,9 @@ public class OutbidInfoServiceImpl extends ServiceImpl<OutbidInfoMapper, OutbidI
|
||||||
throw new ServiceException(Message.OUTBID_INFO_ID_IS_NOT_EXIST);
|
throw new ServiceException(Message.OUTBID_INFO_ID_IS_NOT_EXIST);
|
||||||
}
|
}
|
||||||
this.removeById(outbidInfoId);
|
this.removeById(outbidInfoId);
|
||||||
}
|
if(StrUtil.isNotBlank(outbidInfo.getOutbidNoticeFileId())){
|
||||||
|
attachInfoService.deleteByAttachInfoId(outbidInfo.getOutbidNoticeFileId());
|
||||||
@Override
|
|
||||||
public void uploadOutbidNoticeFile(String outbidInfoId, String outbidNoticeFileId) {
|
|
||||||
OutbidInfoEntity outbidInfo = this.getById(outbidInfoId);
|
|
||||||
if(null == outbidInfo){
|
|
||||||
throw new ServiceException(Message.OUTBID_INFO_ID_IS_NOT_EXIST);
|
|
||||||
}
|
}
|
||||||
AttachInfoEntity attachInfo = attachInfoService.getById(outbidNoticeFileId);
|
|
||||||
if(null == attachInfo || !Constants.DEL_FLAG_0.equals(attachInfo.getDelFlag())){
|
|
||||||
throw new ServiceException(Message.ATTACH_INFO_IS_NOT_EXIST);
|
|
||||||
}
|
|
||||||
outbidInfo.setOutbidNoticeFileId(outbidNoticeFileId);
|
|
||||||
this.updateById(outbidInfo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,21 +1,26 @@
|
||||||
package com.dite.znpt.service.impl;
|
package com.dite.znpt.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.dite.znpt.constant.Constants;
|
import com.dite.znpt.constant.Constants;
|
||||||
import com.dite.znpt.constant.Message;
|
import com.dite.znpt.constant.Message;
|
||||||
import com.dite.znpt.converts.Converts;
|
import com.dite.znpt.converts.Converts;
|
||||||
import com.dite.znpt.domain.entity.AttachInfoEntity;
|
import com.dite.znpt.domain.entity.AttachInfoEntity;
|
||||||
|
import com.dite.znpt.domain.entity.OutbidInfoEntity;
|
||||||
import com.dite.znpt.domain.entity.TenderInfoEntity;
|
import com.dite.znpt.domain.entity.TenderInfoEntity;
|
||||||
|
import com.dite.znpt.domain.entity.UserEntity;
|
||||||
import com.dite.znpt.domain.vo.TenderInfoReq;
|
import com.dite.znpt.domain.vo.TenderInfoReq;
|
||||||
import com.dite.znpt.domain.vo.TenderInfoResp;
|
import com.dite.znpt.domain.vo.TenderInfoResp;
|
||||||
|
import com.dite.znpt.enums.AttachBusinessTypeEnum;
|
||||||
import com.dite.znpt.exception.ServiceException;
|
import com.dite.znpt.exception.ServiceException;
|
||||||
import com.dite.znpt.mapper.TenderInfoMapper;
|
import com.dite.znpt.mapper.TenderInfoMapper;
|
||||||
import com.dite.znpt.service.AttachInfoService;
|
import com.dite.znpt.service.AttachInfoService;
|
||||||
import com.dite.znpt.service.TenderInfoService;
|
import com.dite.znpt.service.TenderInfoService;
|
||||||
|
import com.dite.znpt.service.UserService;
|
||||||
import com.dite.znpt.util.PageUtil;
|
import com.dite.znpt.util.PageUtil;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -28,8 +33,12 @@ import java.util.List;
|
||||||
@Service
|
@Service
|
||||||
public class TenderInfoServiceImpl extends ServiceImpl<TenderInfoMapper, TenderInfoEntity> implements TenderInfoService {
|
public class TenderInfoServiceImpl extends ServiceImpl<TenderInfoMapper, TenderInfoEntity> implements TenderInfoService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private UserService userService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private AttachInfoService attachInfoService;
|
private AttachInfoService attachInfoService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<TenderInfoResp> page(String projectName) {
|
public List<TenderInfoResp> page(String projectName) {
|
||||||
PageUtil.startPage();
|
PageUtil.startPage();
|
||||||
|
@ -50,19 +59,64 @@ public class TenderInfoServiceImpl extends ServiceImpl<TenderInfoMapper, TenderI
|
||||||
@Override
|
@Override
|
||||||
public void save(TenderInfoReq req) {
|
public void save(TenderInfoReq req) {
|
||||||
TenderInfoEntity entity = Converts.INSTANCE.toTenderInfoEntity(req);
|
TenderInfoEntity entity = Converts.INSTANCE.toTenderInfoEntity(req);
|
||||||
|
if(StrUtil.isNotBlank(req.getTenderManager())){
|
||||||
|
UserEntity user = userService.getById(req.getTenderManager());
|
||||||
|
if(null == user || !Constants.DEL_FLAG_0.equals(user.getDelFlag())){
|
||||||
|
throw new ServiceException(Message.USER_ID_NOT_EXIST);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!listByBiddingInfoId(req.getBiddingInfoId()).isEmpty()){
|
||||||
|
throw new ServiceException(StrUtil.format(Message.TENDER_INFO_IS_EXIST,req.getBiddingInfoId()));
|
||||||
|
}
|
||||||
this.save(entity);
|
this.save(entity);
|
||||||
|
if(StrUtil.isNotBlank(req.getTenderFileId())){
|
||||||
|
AttachInfoEntity attachInfo = attachInfoService.getById(req.getTenderFileId());
|
||||||
|
if(null == attachInfo || !Constants.DEL_FLAG_0.equals(attachInfo.getDelFlag())){
|
||||||
|
throw new ServiceException(Message.ATTACH_INFO_IS_NOT_EXIST);
|
||||||
|
}
|
||||||
|
attachInfo.setBusinessId(entity.getTenderInfoId());
|
||||||
|
attachInfoService.updateById(attachInfo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public void update(String tenderInfoId, TenderInfoReq req) {
|
public void update(String tenderInfoId, TenderInfoReq req) {
|
||||||
TenderInfoEntity tenderInfo = this.getById(tenderInfoId);
|
TenderInfoEntity tenderInfo = this.getById(tenderInfoId);
|
||||||
if(null ==tenderInfo){
|
if(null == tenderInfo){
|
||||||
throw new ServiceException(Message.TENDER_INFO_ID_IS_NOT_EXIST);
|
throw new ServiceException(Message.TENDER_INFO_ID_IS_NOT_EXIST);
|
||||||
}
|
}
|
||||||
|
if(!tenderInfo.getBiddingInfoId().equals(req.getBiddingInfoId())){
|
||||||
|
if(!listByBiddingInfoId(req.getBiddingInfoId()).isEmpty()){
|
||||||
|
throw new ServiceException(StrUtil.format(Message.TENDER_INFO_IS_EXIST,req.getBiddingInfoId()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(StrUtil.isNotBlank(req.getTenderFileId())){
|
||||||
|
AttachInfoEntity attachInfo = attachInfoService.getById(req.getTenderFileId());
|
||||||
|
if(null == attachInfo || !Constants.DEL_FLAG_0.equals(attachInfo.getDelFlag())){
|
||||||
|
throw new ServiceException(Message.ATTACH_INFO_IS_NOT_EXIST);
|
||||||
|
}
|
||||||
|
attachInfo.setBusinessId(tenderInfoId);
|
||||||
|
attachInfoService.updateById(attachInfo);
|
||||||
|
}else{
|
||||||
|
if(StrUtil.isNotBlank(tenderInfo.getTenderFileId())){
|
||||||
|
attachInfoService.deleteByAttachInfoId(tenderInfo.getTenderFileId());
|
||||||
|
}
|
||||||
|
}
|
||||||
TenderInfoEntity entity = Converts.INSTANCE.toTenderInfoEntity(req);
|
TenderInfoEntity entity = Converts.INSTANCE.toTenderInfoEntity(req);
|
||||||
|
if(StrUtil.isNotBlank(req.getTenderManager())){
|
||||||
|
UserEntity user = userService.getById(req.getTenderManager());
|
||||||
|
if(null == user || !Constants.DEL_FLAG_0.equals(user.getDelFlag())){
|
||||||
|
throw new ServiceException(Message.USER_ID_NOT_EXIST);
|
||||||
|
}
|
||||||
|
}
|
||||||
entity.setTenderInfoId(tenderInfoId);
|
entity.setTenderInfoId(tenderInfoId);
|
||||||
this.updateById(entity);
|
this.updateById(entity);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<TenderInfoEntity> listByBiddingInfoId(String biddingInfoId){
|
||||||
|
return this.list(Wrappers.<TenderInfoEntity>lambdaQuery().eq(TenderInfoEntity::getBiddingInfoId, biddingInfoId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@ -73,21 +127,9 @@ public class TenderInfoServiceImpl extends ServiceImpl<TenderInfoMapper, TenderI
|
||||||
throw new ServiceException(Message.TENDER_INFO_ID_IS_NOT_EXIST);
|
throw new ServiceException(Message.TENDER_INFO_ID_IS_NOT_EXIST);
|
||||||
}
|
}
|
||||||
this.removeById(tenderInfoId);
|
this.removeById(tenderInfoId);
|
||||||
|
if(StrUtil.isNotBlank(tenderInfo.getTenderFileId())){
|
||||||
|
attachInfoService.deleteByAttachInfoId(tenderInfo.getTenderFileId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
@Override
|
|
||||||
public void uploadBiddingInfoFile(String tenderInfoId, String tenderFileId) {
|
|
||||||
TenderInfoEntity entity = this.getById(tenderInfoId);
|
|
||||||
if(null == entity){
|
|
||||||
throw new ServiceException(Message.TENDER_INFO_ID_IS_NOT_EXIST);
|
|
||||||
}
|
|
||||||
AttachInfoEntity attachInfo = attachInfoService.getById(tenderInfoId);
|
|
||||||
if(null == attachInfo || !Constants.DEL_FLAG_0.equals(attachInfo.getDelFlag())){
|
|
||||||
throw new ServiceException(Message.ATTACH_INFO_IS_NOT_EXIST);
|
|
||||||
}
|
|
||||||
entity.setTenderFileId(tenderFileId);
|
|
||||||
this.updateById(entity);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<mapper namespace="com.dite.znpt.mapper.BiddingInfoMapper">
|
<mapper namespace="com.dite.znpt.mapper.BiddingInfoMapper">
|
||||||
|
|
||||||
<select id="listBiddingInfoResp" resultType="com.dite.znpt.domain.vo.BiddingInfoResp">
|
<select id="listBiddingInfoResp" resultType="com.dite.znpt.domain.vo.BiddingInfoResp">
|
||||||
SELECT bi.bidding_info_id, bi.bidding_project, bi.bidding_company, bi.bidding_amount, bi.bidding_deadline, bi.info_entry_time, bi.source, bi.source_website, ai.attach_path
|
SELECT bi.bidding_info_id, bi.bidding_project, bi.bidding_company, bi.bidding_amount, bi.bidding_deadline, bi.info_entry_time, bi.source, bi.source_website, ai.file_name, ai.attach_path
|
||||||
FROM bidding_info bi
|
FROM bidding_info bi
|
||||||
LEFT JOIN attach_info ai ON bi.bidding_file_id = ai.attach_id
|
LEFT JOIN attach_info ai ON bi.bidding_file_id = ai.attach_id
|
||||||
<where>
|
<where>
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<mapper namespace="com.dite.znpt.mapper.OutbidInfoMapper">
|
<mapper namespace="com.dite.znpt.mapper.OutbidInfoMapper">
|
||||||
|
|
||||||
<select id="listOutbidInfoResp" resultType="com.dite.znpt.domain.vo.OutbidInfoResp">
|
<select id="listOutbidInfoResp" resultType="com.dite.znpt.domain.vo.OutbidInfoResp">
|
||||||
SELECT oi.outbid_info_id, oi.bidding_info_id, bi.bidding_project, bi.bidding_company, oi.outbid_amount, oi.outbid_notify_date, oi.outbid_notice_file_id, oi.status, ai.attach_path
|
SELECT oi.outbid_info_id, oi.bidding_info_id, bi.bidding_project, bi.bidding_company, oi.outbid_amount, oi.outbid_notify_date, oi.outbid_notice_file_id, oi.status, ai.file_name, ai.attach_path
|
||||||
FROM outbid_info oi
|
FROM outbid_info oi
|
||||||
LEFT JOIN bidding_info bi ON oi.bidding_info_id = bi.bidding_info_id
|
LEFT JOIN bidding_info bi ON oi.bidding_info_id = bi.bidding_info_id
|
||||||
LEFT JOIN attach_info ai ON oi.outbid_notice_file_id = ai.attach_id
|
LEFT JOIN attach_info ai ON oi.outbid_notice_file_id = ai.attach_id
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
<select id="getOutbidInfoResp" resultType="com.dite.znpt.domain.vo.OutbidInfoResp">
|
<select id="getOutbidInfoResp" resultType="com.dite.znpt.domain.vo.OutbidInfoResp">
|
||||||
SELECT oi.outbid_info_id, oi.bidding_info_id, bi.bidding_project, bi.bidding_company, oi.outbid_amount, oi.outbid_notify_date, oi.outbid_notice_file_id, oi.status, ai.attach_path
|
SELECT oi.outbid_info_id, oi.bidding_info_id, bi.bidding_project, bi.bidding_company, oi.outbid_amount, oi.outbid_notify_date, oi.outbid_notice_file_id, oi.status, ai.file_name, ai.attach_path
|
||||||
FROM outbid_info oi
|
FROM outbid_info oi
|
||||||
LEFT JOIN bidding_info bi ON oi.bidding_info_id = bi.bidding_info_id
|
LEFT JOIN bidding_info bi ON oi.bidding_info_id = bi.bidding_info_id
|
||||||
LEFT JOIN attach_info ai ON oi.outbid_notice_file_id = ai.attach_id
|
LEFT JOIN attach_info ai ON oi.outbid_notice_file_id = ai.attach_id
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
<select id="listTenderInfoResp" resultType="com.dite.znpt.domain.vo.TenderInfoResp">
|
<select id="listTenderInfoResp" resultType="com.dite.znpt.domain.vo.TenderInfoResp">
|
||||||
SELECT ti.tender_info_id, ti.bidding_info_id, bi.bidding_project, bi.bidding_company, ti.tender_amount, ti.project_address,ti.project_type, ti.tender_manager, u.name AS 'tenderManagerName',
|
SELECT ti.tender_info_id, ti.bidding_info_id, bi.bidding_project, bi.bidding_company, ti.tender_amount, ti.project_address,ti.project_type, ti.tender_manager, u.name AS 'tenderManagerName',
|
||||||
ti.tender_manager_phone, ti.project_description, ti.tender_file_id, ai.attach_path
|
ti.tender_manager_phone, ti.project_description, ti.tender_file_id, ai.file_name, ai.attach_path
|
||||||
FROM tender_info ti
|
FROM tender_info ti
|
||||||
LEFT JOIN bidding_info bi ON ti.bidding_info_id = bi.bidding_info_id
|
LEFT JOIN bidding_info bi ON ti.bidding_info_id = bi.bidding_info_id
|
||||||
LEFT JOIN user u ON ti.tender_manager = u.user_id
|
LEFT JOIN user u ON ti.tender_manager = u.user_id
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
</select>
|
</select>
|
||||||
<select id="getTenderInfoResp" resultType="com.dite.znpt.domain.vo.TenderInfoResp">
|
<select id="getTenderInfoResp" resultType="com.dite.znpt.domain.vo.TenderInfoResp">
|
||||||
SELECT ti.tender_info_id, ti.bidding_info_id, bi.bidding_project, bi.bidding_company, ti.tender_amount, ti.project_address,ti.project_type, ti.tender_manager, u.name AS 'tenderManagerName',
|
SELECT ti.tender_info_id, ti.bidding_info_id, bi.bidding_project, bi.bidding_company, ti.tender_amount, ti.project_address,ti.project_type, ti.tender_manager, u.name AS 'tenderManagerName',
|
||||||
ti.tender_manager_phone, ti.project_description, ti.tender_file_id, ai.attach_path
|
ti.tender_manager_phone, ti.project_description, ti.tender_file_id, ai.file_name, ai.attach_path
|
||||||
FROM tender_info ti
|
FROM tender_info ti
|
||||||
LEFT JOIN bidding_info bi ON ti.bidding_info_id = bi.bidding_info_id
|
LEFT JOIN bidding_info bi ON ti.bidding_info_id = bi.bidding_info_id
|
||||||
LEFT JOIN user u ON ti.tender_manager = u.user_id
|
LEFT JOIN user u ON ti.tender_manager = u.user_id
|
||||||
|
|
|
@ -9,7 +9,6 @@ import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -47,7 +46,7 @@ public class BiddingInfoController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "编辑招标消息",httpMethod = "POST")
|
@ApiOperation(value = "编辑招标消息",httpMethod = "POST")
|
||||||
@PutMapping
|
@PutMapping("/{biddingInfoId}")
|
||||||
public Result<?> edit(@PathVariable String biddingInfoId, @Validated @RequestBody BiddingInfoReq req){
|
public Result<?> edit(@PathVariable String biddingInfoId, @Validated @RequestBody BiddingInfoReq req){
|
||||||
biddingInfoService.update(biddingInfoId, req);
|
biddingInfoService.update(biddingInfoId, req);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
|
|
|
@ -63,13 +63,6 @@ public class OutbidInfoController {
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "上传中标通知信息文件", httpMethod = "POST")
|
|
||||||
@PostMapping("/{outBidInfoId}/upload-outbid-info-file/{outbidNoticeFileId}")
|
|
||||||
public Result<?> uploadOutbidNoticeFile(@PathVariable String outBidInfoId, @PathVariable String outbidNoticeFileId) {
|
|
||||||
outbidInfoService.uploadOutbidNoticeFile(outBidInfoId, outbidNoticeFileId);
|
|
||||||
return Result.ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation(value = "下载中标通知信息文件", httpMethod = "POST")
|
@ApiOperation(value = "下载中标通知信息文件", httpMethod = "POST")
|
||||||
@PostMapping("/download-outbid-info-file/{outbidNoticeFileId}")
|
@PostMapping("/download-outbid-info-file/{outbidNoticeFileId}")
|
||||||
public Result<?> downLoadOutbidNoticeFile(@PathVariable String outbidNoticeFileId, HttpServletResponse response) throws Exception {
|
public Result<?> downLoadOutbidNoticeFile(@PathVariable String outbidNoticeFileId, HttpServletResponse response) throws Exception {
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.dite.znpt.web.controller;
|
||||||
|
|
||||||
import com.dite.znpt.domain.PageResult;
|
import com.dite.znpt.domain.PageResult;
|
||||||
import com.dite.znpt.domain.Result;
|
import com.dite.znpt.domain.Result;
|
||||||
|
import com.dite.znpt.domain.vo.BiddingInfoResp;
|
||||||
import com.dite.znpt.domain.vo.TenderInfoReq;
|
import com.dite.znpt.domain.vo.TenderInfoReq;
|
||||||
import com.dite.znpt.domain.vo.TenderInfoResp;
|
import com.dite.znpt.domain.vo.TenderInfoResp;
|
||||||
import com.dite.znpt.service.TenderInfoService;
|
import com.dite.znpt.service.TenderInfoService;
|
||||||
|
@ -9,7 +10,6 @@ import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -52,24 +52,18 @@ public class TenderInfoController {
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "修改投标信息", httpMethod = "PUT")
|
@ApiOperation(value = "修改投标信息", httpMethod = "PUT", notes = "上传附件调用新增附件信息接口:/attach-info/tenderInfo,userDefinedPath = {tenderInfoId}")
|
||||||
@PutMapping("/{tenderInfoId}")
|
@PutMapping("/{tenderInfoId}")
|
||||||
public Result<?> edit(@PathVariable String tenderInfoId, @Validated @RequestBody TenderInfoReq req) {
|
public Result<?> edit(@PathVariable String tenderInfoId, @Validated @RequestBody TenderInfoReq req) {
|
||||||
tenderInfoService.update(tenderInfoId, req);
|
tenderInfoService.update(tenderInfoId, req);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "删除投标信息", httpMethod = "DELETE")
|
@ApiOperation(value = "删除投标信息", httpMethod = "DELETE", notes = "上传附件调用新增附件信息接口:/attach-info/tenderInfo,userDefinedPath = {tenderInfoId}")
|
||||||
@DeleteMapping("/{tenderInfoId}")
|
@DeleteMapping("/{tenderInfoId}")
|
||||||
public Result<?> delete(@PathVariable String tenderInfoId) {
|
public Result<?> delete(@PathVariable String tenderInfoId) {
|
||||||
tenderInfoService.deleteById(tenderInfoId);
|
tenderInfoService.deleteById(tenderInfoId);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "上传投标信息文件", httpMethod = "POST", notes = "上传附件调用新增附件信息接口:/attach-info/tenderInfo,userDefinedPath = {tenderInfoId}")
|
|
||||||
@PostMapping("/{tenderInfoId}/upload-tender-info-file/{tenderFileId}")
|
|
||||||
public Result<?> uploadTenderInfoFile(@PathVariable String tenderInfoId, @PathVariable String tenderFileId) {
|
|
||||||
tenderInfoService.uploadBiddingInfoFile(tenderInfoId, tenderFileId);
|
|
||||||
return Result.ok();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue