From fa8f1487431679ad219e0d899bf35f1625e4cc6f Mon Sep 17 00:00:00 2001 From: pengjie <17373303529@163.com> Date: Tue, 27 Aug 2024 20:03:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=95=E6=A0=87=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jz/controller/JzBidBuyController.java | 3 +- .../jz/controller/JzBidController.java | 62 +++++++++++++- .../jz/controller/JzProjectController.java | 2 +- .../zhgd/xmgl/modules/jz/entity/JzBidBuy.java | 18 ++++ .../xmgl/modules/jz/entity/JzBidExam.java | 85 ++++++++++++++++++- .../xmgl/modules/jz/entity/JzBidResult.java | 26 ++++++ .../modules/jz/service/IJzBidBuyService.java | 2 + .../modules/jz/service/IJzProjectService.java | 2 + .../jz/service/impl/JzBidBuyServiceImpl.java | 22 ++++- .../jz/service/impl/JzBidExamServiceImpl.java | 27 ++++-- .../service/impl/JzBidResultServiceImpl.java | 4 + .../jz/service/impl/JzProjectServiceImpl.java | 8 ++ .../zhgd/xmgl/security/WebSecurityConfig.java | 2 +- 13 files changed, 244 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/zhgd/xmgl/modules/jz/controller/JzBidBuyController.java b/src/main/java/com/zhgd/xmgl/modules/jz/controller/JzBidBuyController.java index 6826f2050..5ab73618c 100644 --- a/src/main/java/com/zhgd/xmgl/modules/jz/controller/JzBidBuyController.java +++ b/src/main/java/com/zhgd/xmgl/modules/jz/controller/JzBidBuyController.java @@ -105,8 +105,7 @@ public class JzBidBuyController { @ApiOperation(value = " 添加标书购买信息", notes = "添加标书购买信息", httpMethod = "POST") @PostMapping(value = "/add") public Result add(@RequestBody JzBidBuy jzBidBuy) { - Result result = new Result(); - jzBidBuyService.save(jzBidBuy); + jzBidBuyService.saveInfo(jzBidBuy); return Result.success("添加成功!"); } diff --git a/src/main/java/com/zhgd/xmgl/modules/jz/controller/JzBidController.java b/src/main/java/com/zhgd/xmgl/modules/jz/controller/JzBidController.java index 2637c59d8..9c85914d0 100644 --- a/src/main/java/com/zhgd/xmgl/modules/jz/controller/JzBidController.java +++ b/src/main/java/com/zhgd/xmgl/modules/jz/controller/JzBidController.java @@ -1,5 +1,6 @@ package com.zhgd.xmgl.modules.jz.controller; +import com.alibaba.fastjson.JSONObject; import com.zhgd.annotation.OperLog; import com.zhgd.xmgl.modules.jz.entity.JzBidBuy; import com.zhgd.xmgl.modules.jz.entity.JzBidExam; @@ -104,7 +105,66 @@ public class JzBidController { @ApiOperation(value = " 添加投标决策信息", notes = "添加投标决策信息", httpMethod = "POST") @PostMapping(value = "/add") public Result add(@RequestBody JzBid jzBid) { - Result result = new Result(); + jzBidService.save(jzBid); + return Result.success("添加成功!"); + } + + /** + * 添加 + * + * @param object + * @return + */ + @OperLog(operModul = "投标决策管理", operType = "新增", operDesc = "添加投标决策信息") + @ApiOperation(value = " 添加投标决策信息", notes = "添加投标决策信息", httpMethod = "POST") + @PostMapping(value = "/flowSave") + public Result flowSave(@RequestBody JSONObject object) { + log.info("添加投标决策信息=======" + object); + String [] sources = {"自筹", "财政拨款", "政府补贴", "其他"}; + String [] types = {"公开招标", "邀标", "议标"}; + String projectId = object.getJSONArray("projectId").getString(0); + String budget = object.getString("budget"); + String source = object.getString("source"); + Date bidTime = object.getDate("bidTime"); + Date buyBidTime = object.getDate("buyBidTime"); + String type = object.getString("type"); + String competitor = object.getString("competitor"); + String depositRequired = object.getString("depositRequired"); + String depositAmount = object.getString("depositAmount"); + Date openBidTime = object.getDate("openBidTime"); + Date depositBackTime = object.getDate("depositBackTime"); + String internalResources = object.getString("internalResources"); + String graspDegree = object.getString("graspDegree"); + String overview = object.getString("overview"); + String introduction = object.getString("introduction"); + String fileUrl = JSON.toJSONString(object.getJSONArray("fileUrl")); + JzBid jzBid = new JzBid(); + jzBid.setProjectId(Long.valueOf(projectId)); + jzBid.setBudget(budget); + for (int i = 0; i < sources.length; i++) { + if (sources[i].equals(source)) { + int j = i + 1; + jzBid.setSource(j + ""); + } + } + jzBid.setBidTime(bidTime); + jzBid.setBuyBidTime(buyBidTime); + for (int i = 0; i < types.length; i++) { + if (types[i].equals(type)) { + int j = i + 1; + jzBid.setType(j + ""); + } + } + jzBid.setCompetitor(competitor); + jzBid.setDepositRequired(depositRequired.equals("是") ? "1" : "0"); + jzBid.setDepositAmount(depositAmount); + jzBid.setOpenBidTime(openBidTime); + jzBid.setDepositBackTime(depositBackTime); + jzBid.setInternalResources(internalResources.equals("是") ? "1" : "0"); + jzBid.setGraspDegree(graspDegree); + jzBid.setOverview(overview); + jzBid.setIntroduction(introduction); + jzBid.setFileUrl(fileUrl); jzBidService.save(jzBid); return Result.success("添加成功!"); } diff --git a/src/main/java/com/zhgd/xmgl/modules/jz/controller/JzProjectController.java b/src/main/java/com/zhgd/xmgl/modules/jz/controller/JzProjectController.java index 70ce8aea2..56dcee7e2 100644 --- a/src/main/java/com/zhgd/xmgl/modules/jz/controller/JzProjectController.java +++ b/src/main/java/com/zhgd/xmgl/modules/jz/controller/JzProjectController.java @@ -214,7 +214,7 @@ public class JzProjectController { @PostMapping(value = "/queryById") public Result queryById(@ApiIgnore @RequestBody Map map) { Result result = new Result(); - JzProject jzProject = jzProjectService.getById(MapUtils.getString(map, "id")); + JzProject jzProject = jzProjectService.queryById(MapUtils.getString(map, "id")); if (jzProject == null) { result.error500("未找到对应实体"); } else { diff --git a/src/main/java/com/zhgd/xmgl/modules/jz/entity/JzBidBuy.java b/src/main/java/com/zhgd/xmgl/modules/jz/entity/JzBidBuy.java index 89b0d5312..c1495229f 100644 --- a/src/main/java/com/zhgd/xmgl/modules/jz/entity/JzBidBuy.java +++ b/src/main/java/com/zhgd/xmgl/modules/jz/entity/JzBidBuy.java @@ -3,6 +3,7 @@ package com.zhgd.xmgl.modules.jz.entity; import java.io.Serializable; import java.util.Date; +import cn.hutool.core.date.DateTime; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; @@ -38,6 +39,12 @@ public class JzBidBuy implements Serializable { @Excel(name = "项目ID", width = 15) @ApiModelProperty(value = "项目ID") private Long projectId; + /** + * 标书编号 + */ + @Excel(name = "标书编号", width = 15) + @ApiModelProperty(value = "标书编号") + private String code; /** * 招标公司名称 */ @@ -127,10 +134,21 @@ public class JzBidBuy implements Serializable { @ApiModelProperty(value = "附件") private String fileUrl; + /** + * 创建时间 + */ + @Excel(name = "创建时间", width = 15) + @ApiModelProperty(value = "创建时间") + private Date createTime; + @TableField(exist = false) @ApiModelProperty(value = "项目名称") private String projectName; + @TableField(exist = false) + @ApiModelProperty(value = "项目编号") + private String projectSn; + @TableField(exist = false) @ApiModelProperty(value = "客户名称") private String customerName; diff --git a/src/main/java/com/zhgd/xmgl/modules/jz/entity/JzBidExam.java b/src/main/java/com/zhgd/xmgl/modules/jz/entity/JzBidExam.java index fd5256f8a..67433e3a5 100644 --- a/src/main/java/com/zhgd/xmgl/modules/jz/entity/JzBidExam.java +++ b/src/main/java/com/zhgd/xmgl/modules/jz/entity/JzBidExam.java @@ -50,6 +50,12 @@ public class JzBidExam implements Serializable { */ @Excel(name = "审查编号", width = 15) @ApiModelProperty(value = "审查编号") + private String examCode; + /** + * 标书编号 + */ + @Excel(name = "标书编号", width = 15) + @ApiModelProperty(value = "标书编号") private String code; /** * 开标日期 @@ -108,7 +114,7 @@ public class JzBidExam implements Serializable { */ @Excel(name = "总金额", width = 15) @ApiModelProperty(value = "总金额") - private String amount; + private String businessAmount; /** * 税率 */ @@ -146,18 +152,93 @@ public class JzBidExam implements Serializable { @ApiModelProperty(value = "商务审查附件") private String businessFile; + /** + * 招标公司名称 + */ + @Excel(name = "招标公司名称", width = 15) + @ApiModelProperty(value = "招标公司名称") + private String inviteCompanyName; + /** + * 投标公司名称 + */ + @Excel(name = "投标公司名称", width = 15) + @ApiModelProperty(value = "投标公司名称") + private String bidCompanyName; + /** + * 购买人员 + */ + @Excel(name = "购买人员", width = 15) + @ApiModelProperty(value = "购买人员") + private String createBy; + /** + * 购买标书金额 + */ + @Excel(name = "购买标书金额", width = 15) + @ApiModelProperty(value = "购买标书金额") + private String amount; + /** + * 招标项目资金来源 + */ + @Excel(name = "招标项目资金来源", width = 15) + @ApiModelProperty(value = "招标项目资金来源") + private String source; + /** + * 投标时间 + */ + @Excel(name = "投标时间", width = 15, format = "yyyy-MM-dd") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty(value = "投标时间") + private Date bidTime; + /** + * 购买标书时间 + */ + @Excel(name = "购买标书时间", width = 15, format = "yyyy-MM-dd") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty(value = "购买标书时间") + private Date buyBidTime; + /** + * 招标方式 + */ + @Excel(name = "招标方式", width = 15) + @ApiModelProperty(value = "招标方式") + private String type; + /** + * 投标地址 + */ + @Excel(name = "投标地址", width = 15) + @ApiModelProperty(value = "投标地址") + private String bidAddress; + /** + * 是否需要保证金 + */ + @Excel(name = "是否需要保证金", width = 15) + @ApiModelProperty(value = "是否需要保证金") + private String depositRequired; + /** + * 保证金金额(元) + */ + @Excel(name = "保证金金额(元)", width = 15) + @ApiModelProperty(value = "保证金金额(元)") + private String depositAmount; + /** * 创建时间 */ @Excel(name = "创建时间", width = 15) @ApiModelProperty(value = "创建时间") - private DateTime createTime; + private Date createTime; @TableField(exist = false) @ApiModelProperty(value = "项目名称") private String projectName; + @TableField(exist = false) + @ApiModelProperty(value = "项目编码") + private String projectSn; + @TableField(exist = false) @ApiModelProperty(value = "客户名称") private String customerName; diff --git a/src/main/java/com/zhgd/xmgl/modules/jz/entity/JzBidResult.java b/src/main/java/com/zhgd/xmgl/modules/jz/entity/JzBidResult.java index 228afcc71..b8d3deb2e 100644 --- a/src/main/java/com/zhgd/xmgl/modules/jz/entity/JzBidResult.java +++ b/src/main/java/com/zhgd/xmgl/modules/jz/entity/JzBidResult.java @@ -80,11 +80,37 @@ public class JzBidResult implements Serializable { @Excel(name = "附件", width = 15) @ApiModelProperty(value = "附件") private String fileUrl; + /** + * 投标时间 + */ + @Excel(name = "投标时间", width = 15, format = "yyyy-MM-dd") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty(value = "投标时间") + private Date bidTime; + /** + * 开标日期 + */ + @Excel(name = "开标日期", width = 15, format = "yyyy-MM-dd") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty(value = "开标日期") + private Date openBidTime; + /** + * 标书编号 + */ + @Excel(name = "标书编号", width = 15) + @ApiModelProperty(value = "标书编号") + private String code; @TableField(exist = false) @ApiModelProperty(value = "项目名称") private String projectName; + @TableField(exist = false) + @ApiModelProperty(value = "项目编码") + private String projectSn; + @TableField(exist = false) @ApiModelProperty(value = "客户名称") private String customerName; diff --git a/src/main/java/com/zhgd/xmgl/modules/jz/service/IJzBidBuyService.java b/src/main/java/com/zhgd/xmgl/modules/jz/service/IJzBidBuyService.java index 544c3d39c..0db3118be 100644 --- a/src/main/java/com/zhgd/xmgl/modules/jz/service/IJzBidBuyService.java +++ b/src/main/java/com/zhgd/xmgl/modules/jz/service/IJzBidBuyService.java @@ -15,4 +15,6 @@ import com.zhgd.xmgl.modules.jz.entity.JzCompetitor; public interface IJzBidBuyService extends IService { Page pageList(Page page, Wrapper wrapper); + + boolean saveInfo(JzBidBuy jzBidBuy); } diff --git a/src/main/java/com/zhgd/xmgl/modules/jz/service/IJzProjectService.java b/src/main/java/com/zhgd/xmgl/modules/jz/service/IJzProjectService.java index 28cbc5886..473d0b0d1 100644 --- a/src/main/java/com/zhgd/xmgl/modules/jz/service/IJzProjectService.java +++ b/src/main/java/com/zhgd/xmgl/modules/jz/service/IJzProjectService.java @@ -16,5 +16,7 @@ public interface IJzProjectService extends IService { Page pageList(Page page, Wrapper wrapper); + JzProject queryById(String id); + boolean saveInfo(JzProject jzProject); } diff --git a/src/main/java/com/zhgd/xmgl/modules/jz/service/impl/JzBidBuyServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/jz/service/impl/JzBidBuyServiceImpl.java index e87a787d9..92519346d 100644 --- a/src/main/java/com/zhgd/xmgl/modules/jz/service/impl/JzBidBuyServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/jz/service/impl/JzBidBuyServiceImpl.java @@ -1,11 +1,11 @@ package com.zhgd.xmgl.modules.jz.service.impl; +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUtil; import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.zhgd.xmgl.modules.jz.entity.JzBidBuy; -import com.zhgd.xmgl.modules.jz.entity.JzCompetitor; -import com.zhgd.xmgl.modules.jz.entity.JzCustomer; -import com.zhgd.xmgl.modules.jz.entity.JzProject; +import com.zhgd.xmgl.modules.jz.entity.*; import com.zhgd.xmgl.modules.jz.mapper.JzBidBuyMapper; import com.zhgd.xmgl.modules.jz.service.IJzBidBuyService; import com.zhgd.xmgl.modules.jz.service.IJzCustomerService; @@ -15,6 +15,7 @@ import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import java.util.Date; import java.util.List; import java.util.stream.Collectors; @@ -41,10 +42,23 @@ public class JzBidBuyServiceImpl extends ServiceImpl i List jzProjects = jzProjectList.stream().filter(j -> j.getId().toString().equals(record.getProjectId().toString())).collect(Collectors.toList()); if (jzProjects.size() > 0) { record.setProjectName(jzProjects.get(0).getName()); + record.setProjectSn(jzProjects.get(0).getProjectSn()); List jzCustomers = jzCustomerList.stream().filter(j -> j.getId().toString().equals(jzProjects.get(0).getCustomerId().toString())).collect(Collectors.toList()); record.setCustomerName(jzCustomers.size() > 0 ? jzCustomers.get(0).getName() : ""); } } return pageList; } + + @Override + public boolean saveInfo(JzBidBuy jzBidBuy) { + DateTime beginOfDay = DateUtil.beginOfDay(new Date()); + DateTime endOfDay = DateUtil.endOfDay(new Date()); + List list = this.list(Wrappers.lambdaQuery().ge(JzBidBuy::getCreateTime, beginOfDay) + .le(JzBidBuy::getCreateTime, endOfDay)); + int count = list.size() + 1; + jzBidBuy.setCode("BSNO-" + DateUtil.format(new Date(), "yyyyMMdd") + "-" + count); + jzBidBuy.setCreateTime(new Date()); + return this.save(jzBidBuy); + } } diff --git a/src/main/java/com/zhgd/xmgl/modules/jz/service/impl/JzBidExamServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/jz/service/impl/JzBidExamServiceImpl.java index b52cd4aa8..39ec712ea 100644 --- a/src/main/java/com/zhgd/xmgl/modules/jz/service/impl/JzBidExamServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/jz/service/impl/JzBidExamServiceImpl.java @@ -8,10 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.sun.corba.se.impl.encoding.WrapperInputStream; import com.zhgd.xmgl.modules.jz.entity.*; import com.zhgd.xmgl.modules.jz.mapper.JzBidExamMapper; -import com.zhgd.xmgl.modules.jz.service.IJzBidExamService; -import com.zhgd.xmgl.modules.jz.service.IJzBidService; -import com.zhgd.xmgl.modules.jz.service.IJzCustomerService; -import com.zhgd.xmgl.modules.jz.service.IJzProjectService; +import com.zhgd.xmgl.modules.jz.service.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -37,7 +34,7 @@ public class JzBidExamServiceImpl extends ServiceImpl pageList(Page page, Wrapper wrapper) { @@ -48,6 +45,7 @@ public class JzBidExamServiceImpl extends ServiceImpl jzProjects = jzProjectList.stream().filter(j -> j.getId().toString().equals(record.getProjectId().toString())).collect(Collectors.toList()); if (jzProjects.size() > 0) { record.setProjectName(jzProjects.get(0).getName()); + record.setProjectSn(jzProjects.get(0).getProjectSn()); List jzCustomers = jzCustomerList.stream().filter(j -> j.getId().toString().equals(jzProjects.get(0).getCustomerId().toString())).collect(Collectors.toList()); record.setCustomerName(jzCustomers.size() > 0 ? jzCustomers.get(0).getName() : ""); } @@ -57,14 +55,27 @@ public class JzBidExamServiceImpl extends ServiceImpl list = this.list(Wrappers.lambdaQuery().ge(JzBidExam::getCreateTime, beginOfDay) .le(JzBidExam::getCreateTime, endOfDay)); int count = list.size() + 1; - jzBidExam.setCode("标书审查-" + DateUtil.format(new Date(), "yyyyHHmm") + "-" + count); + jzBidExam.setCode(jzBidBuy.getCode()); + jzBidExam.setCreateTime(new Date()); + jzBidExam.setExamCode("标书审查-" + DateUtil.format(new Date(), "yyyyMMdd") + "-" + count); + jzBidExam.setInviteCompanyName(jzBidBuy.getInviteCompanyName()); + jzBidExam.setBidCompanyName(jzBidBuy.getBidCompanyName()); + jzBidExam.setCreateBy(jzBidBuy.getCreateBy()); + jzBidExam.setAmount(jzBidBuy.getAmount()); + jzBidExam.setSource(jzBidBuy.getSource()); + jzBidExam.setBidTime(jzBidBuy.getBidTime()); + jzBidExam.setBuyBidTime(jzBidBuy.getBuyBidTime()); + jzBidExam.setType(jzBidBuy.getType()); + jzBidExam.setBidAddress(jzBidBuy.getBidAddress()); + jzBidExam.setDepositRequired(jzBidBuy.getDepositRequired()); + jzBidExam.setDepositAmount(jzBidBuy.getDepositAmount()); return this.save(jzBidExam); } } diff --git a/src/main/java/com/zhgd/xmgl/modules/jz/service/impl/JzBidResultServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/jz/service/impl/JzBidResultServiceImpl.java index 9335d52b2..df21a626e 100644 --- a/src/main/java/com/zhgd/xmgl/modules/jz/service/impl/JzBidResultServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/jz/service/impl/JzBidResultServiceImpl.java @@ -43,6 +43,7 @@ public class JzBidResultServiceImpl extends ServiceImpl jzProjects = jzProjectList.stream().filter(j -> j.getId().toString().equals(record.getProjectId().toString())).collect(Collectors.toList()); if (jzProjects.size() > 0) { record.setProjectName(jzProjects.get(0).getName()); + record.setProjectSn(jzProjects.get(0).getProjectSn()); List jzCustomers = jzCustomerList.stream().filter(j -> j.getId().toString().equals(jzProjects.get(0).getCustomerId().toString())).collect(Collectors.toList()); record.setCustomerName(jzCustomers.size() > 0 ? jzCustomers.get(0).getName() : ""); } @@ -54,6 +55,9 @@ public class JzBidResultServiceImpl extends ServiceImpl