Browse Source

月度对表

hexiao 2 years ago
parent
commit
2b50f35960

+ 32 - 13
purchase-admin/src/main/java/com/ozs/web/controller/plan/MonthlyReconciliationController.java

@@ -15,6 +15,8 @@ import com.ozs.plan.doman.vo.requestVo.MonthlyReconciliationPageReqVo;
 import com.ozs.plan.service.MonthlyReconciliationService;
 import com.ozs.system.domain.SysFileInfo;
 import com.ozs.system.domain.SysFileRef;
+import com.ozs.system.domain.vo.responseVo.SysDeptResponseVo;
+import com.ozs.system.service.ISysDeptService;
 import com.ozs.system.service.SysFileRefService;
 import com.ozs.system.service.SysFileService;
 import io.swagger.annotations.Api;
@@ -27,12 +29,13 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.validation.constraints.NotEmpty;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 
 @RestController
 @RequestMapping("/monthly/reconciliation")
-@Api( tags = ModularConstans.monthly)
+@Api(tags = ModularConstans.monthly)
 public class MonthlyReconciliationController extends BaseController {
 
 
@@ -42,6 +45,8 @@ public class MonthlyReconciliationController extends BaseController {
     private SysFileRefService sysFileRefService;
     @Autowired
     private SysFileService sysFileService;
+    @Autowired
+    private ISysDeptService iSysDeptService;
 
     @ApiOperation(value = "分页查询月度对表")
     @PostMapping("/page")
@@ -50,14 +55,14 @@ public class MonthlyReconciliationController extends BaseController {
     public AjaxResult page(@NotEmpty(message = "数据为空")
                            @RequestBody MonthlyReconciliationPageReqVo vo) {
         LambdaQueryWrapper<MonthlyReconciliation> lw = new LambdaQueryWrapper<>();
-        if(!StringUtils.isBlank(vo.getProjectName())){
-            lw.like(MonthlyReconciliation::getProjectName,vo.getProjectName());
+        if (!StringUtils.isBlank(vo.getProjectName())) {
+            lw.like(MonthlyReconciliation::getProjectName, vo.getProjectName());
         }
-        if(!ObjectUtils.isEmpty(vo.getProjectStatus())){
-            lw.eq(MonthlyReconciliation::getProjectStatus,vo.getProjectStatus());
+        if (!ObjectUtils.isEmpty(vo.getProjectStatus())) {
+            lw.eq(MonthlyReconciliation::getProjectStatus, vo.getProjectStatus());
         }
-        if(!StringUtils.isBlank(vo.getPurchaseServices())){
-            lw.eq(MonthlyReconciliation::getPurchaseServices,vo.getPurchaseServices());
+        if (!StringUtils.isBlank(vo.getPurchaseServices())) {
+            lw.eq(MonthlyReconciliation::getPurchaseServices, vo.getPurchaseServices());
         }
 //        if(!ObjectUtils.isEmpty(vo.getStartTime())){
 //            lw.ge(BaseNotice::getReleaseTime,vo.getStartTime());
@@ -66,7 +71,16 @@ public class MonthlyReconciliationController extends BaseController {
 //            lw.le(BaseNotice::getReleaseTime,vo.getEntTime());
 //        }
         IPage<MonthlyReconciliation> page = monthlyReconciliationService.page(new Page<>(vo.getPageNum(), vo.getPageSize()), lw);
-
+        if (!ObjectUtils.isEmpty(page.getRecords())) {
+            page.setRecords(page.getRecords().stream().map(dto -> {
+                Map<String, Object> stringObjectMap = iSysDeptService.selectDeptById(dto.getPurchaseDeptId());
+                if (!ObjectUtils.isEmpty(stringObjectMap)) {
+                    SysDeptResponseVo sysDept = (SysDeptResponseVo) stringObjectMap.get("sysDept");
+                    dto.setPurchaseDeptName(sysDept.getDeptName());
+                }
+                return dto;
+            }).collect(Collectors.toList()));
+        }
         return success(page);
 
     }
@@ -81,16 +95,21 @@ public class MonthlyReconciliationController extends BaseController {
                                       Long id) {
         MonthlyReconciliation vo = monthlyReconciliationService.getById(id);
 
-        if(!ObjectUtils.isEmpty(vo)){
-            LambdaQueryWrapper<SysFileRef> lw =new LambdaQueryWrapper();
+        if (!ObjectUtils.isEmpty(vo)) {
+            LambdaQueryWrapper<SysFileRef> lw = new LambdaQueryWrapper();
             lw.eq(SysFileRef::getType, SysFileRefEnum.PLAN_TEMPORARY.getType());
-            lw.eq(SysFileRef::getRedId,vo.getPlanId());
+            lw.eq(SysFileRef::getRedId, vo.getPlanId());
             List<SysFileRef> list = sysFileRefService.list(lw);
-            if(!ObjectUtils.isEmpty(list)){
-                LambdaQueryWrapper<SysFileInfo> l =new LambdaQueryWrapper();
+            if (!ObjectUtils.isEmpty(list)) {
+                LambdaQueryWrapper<SysFileInfo> l = new LambdaQueryWrapper();
                 l.in(SysFileInfo::getFileId, list.stream().map(SysFileRef::getFileId).collect(Collectors.toList()));
                 vo.setFileList(sysFileService.list(l));
             }
+            Map<String, Object> stringObjectMap = iSysDeptService.selectDeptById(vo.getPurchaseDeptId());
+            if (!ObjectUtils.isEmpty(stringObjectMap)) {
+                SysDeptResponseVo sysDept = (SysDeptResponseVo) stringObjectMap.get("sysDept");
+                vo.setPurchaseDeptName(sysDept.getDeptName());
+            }
         }
 
         return success(vo);

+ 1 - 1
purchase-admin/src/main/resources/application.yml

@@ -10,4 +10,4 @@ server:
 # Spring配置
 spring:
   profiles:
-    active: druid,dev
+    active: druid,test

+ 5 - 0
purchase-common/src/main/java/com/ozs/common/core/domain/BaseEntity.java

@@ -4,6 +4,8 @@ import java.io.Serializable;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
+
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonInclude;
@@ -23,6 +25,7 @@ public class BaseEntity implements Serializable
     /** 搜索值 */
     @JsonIgnore
     @ApiModelProperty("搜索值")
+    @TableField(exist = false)
     private String searchValue;
 
     /** 创建者 */
@@ -45,11 +48,13 @@ public class BaseEntity implements Serializable
 
     /** 备注 */
     @ApiModelProperty("备注")
+    @TableField(exist = false)
     private String remark;
 
     /** 请求参数 */
     @JsonInclude(JsonInclude.Include.NON_EMPTY)
     @ApiModelProperty("请求参数")
+    @TableField(exist = false)
     private Map<String, Object> params;
 
     public String getSearchValue()

+ 17 - 1
purchase-system/src/main/java/com/ozs/plan/doman/MonthlyReconciliation.java

@@ -1,7 +1,11 @@
 package com.ozs.plan.doman;
 
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.ozs.common.annotation.Excel;
 import com.ozs.common.core.domain.BaseEntity;
 import com.ozs.system.domain.SysFileInfo;
@@ -26,7 +30,11 @@ public class MonthlyReconciliation extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
 
+    /*实际完成采购时间是指采购执行管理中,点击填制中标信息,弹出框中,填写的中标时间
+    * 实际提报时间就是指采购需求管理中"提交"的时间*/
+
     /** 主键 */
+    @TableId(type = IdType.AUTO)
     private Long demandId;
 
     /** 计划ID */
@@ -34,9 +42,14 @@ public class MonthlyReconciliation extends BaseEntity
     private Long planId;
 
     /** 采购单位(登录账号的单位) */
-    @Excel(name = "采购单位", readConverterExp = "登=录账号的单位")
+    @Excel(name = "采购单位Id", readConverterExp = "登=录账号的单位")
     private Long purchaseDeptId;
 
+    /** 采购单位(登录账号的单位) */
+    @Excel(name = "采购单位", readConverterExp = "登=录账号的单位")
+    @TableField(exist = false)
+    private String purchaseDeptName;
+
     /** 项目名称 */
     @Excel(name = "项目名称")
     private String projectName;
@@ -129,5 +142,8 @@ public class MonthlyReconciliation extends BaseEntity
 
     /** 附件 */
     @Excel(name = "附件")
+    @TableField(exist = false)
     private List<SysFileInfo> fileList;
+
+
 }