Explorar el Código

Merge branch 'master' into prod

buzhanyi hace 1 año
padre
commit
552ff314be

+ 16 - 6
purchase-admin/src/main/java/com/ozs/web/controller/base/BaseAgencyController.java

@@ -22,6 +22,7 @@ import com.ozs.plan.doman.MonthlyReconciliation;
 import com.ozs.plan.service.MonthlyReconciliationService;
 import com.ozs.system.domain.vo.responseVo.SysDeptResponseVo;
 import com.ozs.system.service.ISysDeptService;
+import com.ozs.system.service.ISysDictDataService;
 import com.ozs.system.service.ISysDictTypeService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -33,10 +34,7 @@ import org.springframework.util.ObjectUtils;
 import org.springframework.web.bind.annotation.*;
 
 import javax.validation.constraints.NotEmpty;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
+import java.util.*;
 import java.util.stream.Collectors;
 
 
@@ -57,6 +55,10 @@ public class BaseAgencyController extends BaseController {
     @Autowired
     private ISysDictTypeService dictTypeService;
 
+    @Autowired
+    private ISysDictDataService dictDataService;
+
+
 
     @ApiOperation(value = "新增招标代理机构")
     @PostMapping("/insertBaseAgency")
@@ -145,7 +147,6 @@ public class BaseAgencyController extends BaseController {
         }
         IPage<BaseAgency> page = baseAgencyService.page(new Page<BaseAgency>(vo.getPageNum(), vo.getPageSize()), lw);
         if (!ObjectUtils.isEmpty(page) && !ObjectUtils.isEmpty(page.getRecords())) {
-
             List<SysDictData> dictData = dictTypeService.selectDictDataByType(Constants.SYS_COMPANY_NATURE);
             if (!ObjectUtils.isEmpty(dictData)) {
                 List<BaseAgency> collect = page.getRecords().stream().map(o -> {
@@ -154,11 +155,20 @@ public class BaseAgencyController extends BaseController {
                     if (!ObjectUtils.isEmpty(dl)) {
                         o.setCompanyNature(dl.get(0).getDictLabel());
                     }
+                    if(!ObjectUtils.isEmpty(o.getCompanyType())){
+                        List<String> split = Arrays.asList(o.getCompanyType().split(","));
+                        StringBuilder sb = new StringBuilder();
+                        for(String sp:split){
+                           String valueName =  dictDataService.selectDictLabel(Constants.SYS_PROJECT_TYPE,sp);
+                            sb.append(valueName).append(",");
+                        }
+                        sb.deleteCharAt(sb.length()-1);
+                       o.setCompanyTypeName(sb.toString());
+                    }
                     return o;
                 }).collect(Collectors.toList());
                 page.setRecords(collect);
             }
-
         }
         return success(page);
     }

+ 23 - 4
purchase-admin/src/main/java/com/ozs/web/controller/plan/PlanQuarterController.java

@@ -159,11 +159,30 @@ public class PlanQuarterController extends BaseController {
     @PostMapping("/exportPlanExamine")
     @PreAuthorize("@ss.hasPermi('plan:quarter:exportPlanExamine')")
     @Log(title = ModularConstans.planQuarter, businessType = BusinessType.EXPORT)
-    public void exportPlanExamine(HttpServletResponse response, @RequestBody PlanQuarterStandardVo quarterStandardVo, HttpServletRequest request) throws Exception {
-        LoginUser loginUser = tokenService.getLoginUser(request);
-        List<PlanQuarterResponseVo> list = quarterService.selectPlanQuarterExamineListEXP(quarterStandardVo, loginUser);
+    public void exportPlanExamine(HttpServletResponse response, @RequestBody PlanQuarterStandardVo vo, HttpServletRequest request) throws Exception {
+        List<PlanQuarterResponseVo> planQuarterList = new ArrayList<>();
+        try {
+            PlanQuarterStandardVo standardVo = new PlanQuarterStandardVo();
+            BeanUtils.copyProperties(vo, standardVo);
+            standardVo.setPageNum(null);
+            standardVo.setPageSize(null);
+            LoginUser loginUser = tokenService.getLoginUser(request);
+            standardVo.setCreated(String.valueOf(loginUser.getUserId()));
+            //前端没有选择部门id,就默认登录人的id
+            if (!ObjectUtils.isEmpty(vo.getDeptId())) {
+                standardVo.setPurchaseDeptId(String.valueOf(vo.getDeptId()));
+            } else {
+                standardVo.setPurchaseDeptId(String.valueOf(loginUser.getDeptId()));
+            }
+            List<PlanQuarter> planYears = quarterService.queryPage(standardVo);
+            if (!ObjectUtils.isEmpty(planYears) && !ObjectUtils.isEmpty(planYears.size())) {
+                planQuarterList = quarterServiceImpl.changeTo(planYears);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
         ExcelUtil<PlanQuarterResponseVo> util = new ExcelUtil<>(PlanQuarterResponseVo.class);
-        util.exportExcel(response, list, "季度计划数据(审核单位)");
+        util.exportExcel(response, planQuarterList, "季度计划数据(审核单位)");
     }
 
     @ApiOperation(value = "创建季度计划")

+ 10 - 0
purchase-admin/src/main/java/com/ozs/web/controller/plan/PlanYearsController.java

@@ -161,6 +161,11 @@ public class PlanYearsController extends BaseController {
     public void exportPlan(HttpServletResponse response, @RequestBody PlanYearsStandardVo yearsStandardVo, HttpServletRequest request) throws Exception {
         LoginUser loginUser = tokenService.getLoginUser(request);
         List<PlanYearsResponseVo> list = planYearsService.selectPlanYearsListEXP(yearsStandardVo, loginUser);
+        Long num = 1L;
+        for(PlanYearsResponseVo li:list){
+            li.setPlanYearId(num);
+            num++;
+        }
         InputStream resourceAsStream = this.getClass().getResourceAsStream("/template/plan_year.xlsx");
         OutputStream outputStream = null;
         try {
@@ -189,6 +194,11 @@ public class PlanYearsController extends BaseController {
     @Log(title = ModularConstans.planYear, businessType = BusinessType.EXPORT)
     public void exportPlanExamine(HttpServletResponse response, @RequestBody PlanYearsStandardVo yearsStandardVo, HttpServletRequest request) throws Exception {
         List<PlanYearsResponseVo> list = planYearsService.selectPlanYearsExamineListEXP(yearsStandardVo);
+        Long num = 1L;
+        for(PlanYearsResponseVo li:list){
+            li.setPlanYearId(num);
+            num++;
+        }
         InputStream resourceAsStream = this.getClass().getResourceAsStream("/template/plan_year.xlsx");
         OutputStream outputStream = null;
         try {

+ 35 - 1
purchase-admin/src/main/java/com/ozs/web/controller/plan/ProvisionalPlanController.java

@@ -19,8 +19,8 @@ import com.ozs.common.utils.file.FileUtils;
 import com.ozs.common.utils.poi.ExcelUtil;
 import com.ozs.framework.web.service.TokenService;
 import com.ozs.plan.doman.ProvisionalPlan;
-import com.ozs.plan.doman.vo.requestVo.PlanYearsStandardVo;
 import com.ozs.plan.doman.vo.requestVo.ProvisionalPlanVo;
+import com.ozs.plan.doman.vo.responseVo.PlanQuarterResponseVo;
 import com.ozs.plan.doman.vo.responseVo.ProvisionalPlanResVo;
 import com.ozs.plan.service.ProvisionalPlanService;
 import com.ozs.plan.service.impl.ProvisionalPlanServiceImpl;
@@ -198,6 +198,40 @@ public class ProvisionalPlanController extends BaseController {
         return AjaxResult.success(pages);
     }
 
+    @ApiOperation(value = "导出临时计划(审核单位)")
+    @PostMapping("/exportProvisionalPlanAudit")
+    @PreAuthorize("@ss.hasPermi('plan:provisionalPlan:exportProvisionalPlanAudit')")
+    @Log(title = ModularConstans.provisionalPlan, businessType = BusinessType.EXPORT)
+    public void exportProvisionalPlanAudit(HttpServletResponse response,@RequestBody ProvisionalPlanVo vo, HttpServletRequest request){
+        List<ProvisionalPlanResVo> provisionalPlanList = new ArrayList<>();
+        try {
+            ProvisionalPlanVo standardVo = new ProvisionalPlanVo();
+            standardVo.setPageNum(null);
+            standardVo.setPageSize(null);
+            LoginUser loginUser = tokenService.getLoginUser(request);
+            standardVo.setCreated(String.valueOf(loginUser.getUserId()));
+            //前端没有选择部门id,就默认登录人的id
+            if (!ObjectUtils.isEmpty(vo.getDeptId())) {
+                standardVo.setPurchaseDeptId(vo.getDeptId());
+            } else {
+                standardVo.setPurchaseDeptId(loginUser.getDeptId());
+            }
+            List<ProvisionalPlan> provisionalPlans = provisionalPlanService.queryPage(standardVo);
+            if (!ObjectUtils.isEmpty(provisionalPlans) && !ObjectUtils.isEmpty(provisionalPlans.size())) {
+                provisionalPlanList = provisionalPlanServiceImpl.changeTo(provisionalPlans);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        Long num = 1L;
+        for(ProvisionalPlanResVo li:provisionalPlanList){
+            li.setPlanPracticalId(num);
+            num++;
+        }
+        ExcelUtil<ProvisionalPlanResVo> util = new ExcelUtil<>(ProvisionalPlanResVo.class);
+        util.exportExcel(response, provisionalPlanList, "临时计划数据(审核单位)");
+    }
+
     @ApiOperation(value = "查询临时计划详情")
     @PostMapping("/selectById")
     @PreAuthorize("@ss.hasPermi('plan:provisionalPlan:selectById')")

+ 2 - 0
purchase-system/src/main/java/com/ozs/plan/doman/vo/requestVo/ProvisionalPlanVo.java

@@ -76,10 +76,12 @@ public class ProvisionalPlanVo extends PageVo {
      * 机关业务指导处(科)
      */
     private String organDivision;
+    private String organDivisionStr;
     /**
      * 预算科目
      */
     private String budgetAccount;
+    private String budgetAccountStr;
 
     @JsonFormat(pattern = "yyyy-MM-dd")
     @ApiModelProperty(value = "计划提报需求时间--->需求单位成功提报采购需求的日期(具体到月)")

+ 2 - 0
purchase-system/src/main/java/com/ozs/plan/mapper/ProvisionalPlanMapper.java

@@ -21,6 +21,8 @@ public interface ProvisionalPlanMapper extends BaseMapper<ProvisionalPlan> {
 
     ProvisionalPlan seletById(@Param("planPracticalId") Long planPracticalId);
 
+    ProvisionalPlan seletByPlanid(@Param("planPracticalId") Long planPracticalId);
+
     List<ProvisionalPlan> selectProvisionalPlan(ProvisionalPlanVo provisionalPlanVo);
 
     List<ProvisionalPlan> selectProvisionalPlanAudit(ProvisionalPlanVo provisionalPlanVo);

+ 25 - 0
purchase-system/src/main/java/com/ozs/plan/service/impl/PlanQuarterServiceImpl.java

@@ -266,6 +266,31 @@ public class PlanQuarterServiceImpl extends ServiceImpl<PlanQuarterMapper, PlanQ
             }
             responseVo.setFileInfos(fileInfos);
         }
+        String organDivision = byId.getOrganDivision();
+        if (!ObjectUtils.isEmpty(organDivision)) {
+            int length = organDivision.split(",").length;
+            SysDeptOrgan organ = new SysDeptOrgan();
+            if (length > 1) {
+                StringBuilder builder = new StringBuilder();
+                String[] split = organDivision.split(",");
+                for (String s : split) {
+                    organ = sysDeptOrganMapper.selectById(s);
+                    if (!ObjectUtils.isEmpty(organ)) {
+                        if (!organDivision.endsWith(s)) {
+                            builder.append(organ.getOrganName() + ",");
+                        } else {
+                            builder.append(organ.getOrganName());
+                        }
+                    }
+                }
+                responseVo.setOrganDivisionStr(builder.toString());
+            } else if (length == 1) {
+                organ = sysDeptOrganMapper.selectById(organDivision);
+                if (!ObjectUtils.isEmpty(organ)) {
+                    responseVo.setOrganDivisionStr(organ.getOrganName());
+                }
+            }
+        }
         return AjaxResult.success(responseVo);
     }
 

+ 26 - 0
purchase-system/src/main/java/com/ozs/plan/service/impl/PlanYearsServiceImpl.java

@@ -161,6 +161,7 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
         try {
             LoginUser loginUser = SecurityUtils.getLoginUser();
             vo.setCreated(String.valueOf(loginUser.getUserId()));
+            vo.setPurchaseDeptId(String.valueOf(loginUser.getDeptId()));
             list = queryPage(vo);
         } catch (ParseException e) {
             e.printStackTrace();
@@ -236,6 +237,31 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
             }
             responseVo.setFileInfos(fileInfos);
         }
+        String organDivision = byId.getOrganDivision();
+        if (!ObjectUtils.isEmpty(organDivision)) {
+            int length = organDivision.split(",").length;
+            SysDeptOrgan organ = new SysDeptOrgan();
+            if (length > 1) {
+                StringBuilder builder = new StringBuilder();
+                String[] split = organDivision.split(",");
+                for (String s : split) {
+                    organ = sysDeptOrganMapper.selectById(s);
+                    if (!ObjectUtils.isEmpty(organ)) {
+                        if (!organDivision.endsWith(s)) {
+                            builder.append(organ.getOrganName() + ",");
+                        } else {
+                            builder.append(organ.getOrganName());
+                        }
+                    }
+                }
+                responseVo.setOrganDivisionStr(builder.toString());
+            } else if (length == 1) {
+                organ = sysDeptOrganMapper.selectById(organDivision);
+                if (!ObjectUtils.isEmpty(organ)) {
+                    responseVo.setOrganDivisionStr(organ.getOrganName());
+                }
+            }
+        }
         return AjaxResult.success(responseVo);
     }
 

+ 37 - 10
purchase-system/src/main/java/com/ozs/plan/service/impl/ProvisionalPlanServiceImpl.java

@@ -316,6 +316,31 @@ public class ProvisionalPlanServiceImpl extends ServiceImpl<ProvisionalPlanMappe
             }
             provisionalPlanVo.setFileInfos(fileInfos);
         }
+        String organDivision = provisionalPlan.getOrganDivision();
+        if (!ObjectUtils.isEmpty(organDivision)) {
+            int length = organDivision.split(",").length;
+            SysDeptOrgan organ = new SysDeptOrgan();
+            if (length > 1) {
+                StringBuilder builder = new StringBuilder();
+                String[] split = organDivision.split(",");
+                for (String s : split) {
+                    organ = sysDeptOrganMapper.selectById(s);
+                    if (!ObjectUtils.isEmpty(organ)) {
+                        if (!organDivision.endsWith(s)) {
+                            builder.append(organ.getOrganName() + ",");
+                        } else {
+                            builder.append(organ.getOrganName());
+                        }
+                    }
+                }
+                provisionalPlanVo.setOrganDivisionStr(builder.toString());
+            } else if (length == 1) {
+                organ = sysDeptOrganMapper.selectById(organDivision);
+                if (!ObjectUtils.isEmpty(organ)) {
+                    provisionalPlanVo.setOrganDivisionStr(organ.getOrganName());
+                }
+            }
+        }
         return AjaxResult.success(provisionalPlanVo);
     }
 
@@ -760,26 +785,25 @@ public class ProvisionalPlanServiceImpl extends ServiceImpl<ProvisionalPlanMappe
             String organDivision = provisionalPlan.getOrganDivision();
             if (!ObjectUtils.isEmpty(organDivision)) {
                 int length = organDivision.split(",").length;
-                SysDept sysDept = new SysDept();
+                SysDeptOrgan deptOrgan = new SysDeptOrgan();
                 if (length > 1) {
                     StringBuilder builder = new StringBuilder();
                     String[] split = organDivision.split(",");
                     for (String s : split) {
-
-                        sysDept = deptService.selectById(Long.valueOf(s));
-                        if (!ObjectUtils.isEmpty(sysDept)) {
+                        deptOrgan = sysDeptOrganMapper.selectById(Long.valueOf(s));
+                        if (!ObjectUtils.isEmpty(deptOrgan)) {
                             if (!organDivision.endsWith(s)) {
-                                builder.append(sysDept.getDeptName() + ",");
+                                builder.append(deptOrgan.getOrganName() + ",");
                             } else {
-                                builder.append(sysDept.getDeptName());
+                                builder.append(deptOrgan.getOrganName());
                             }
                         }
                     }
                     provisionalPlan.setOrganDivisionStr(builder.toString());
                 } else if (length == 1) {
-                    sysDept = deptService.selectById(Long.valueOf(organDivision));
-                    if (!ObjectUtils.isEmpty(sysDept)) {
-                        provisionalPlan.setOrganDivisionStr(sysDept.getDeptName());
+                    deptOrgan = sysDeptOrganMapper.selectById(Long.valueOf(organDivision));
+                    if (!ObjectUtils.isEmpty(deptOrgan)) {
+                        provisionalPlan.setOrganDivisionStr(deptOrgan.getOrganName());
                     }
                 }
             }
@@ -812,8 +836,11 @@ public class ProvisionalPlanServiceImpl extends ServiceImpl<ProvisionalPlanMappe
                 }
 
             }
-
             BeanUtils.copyProperties(provisionalPlan, provisionalPlanResVo);
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
+            provisionalPlanResVo.setPlanDemandSubTimeStr(sdf.format(provisionalPlanResVo.getPlanDemandSubTime()));
+            provisionalPlanResVo.setPlanPurchaseFinishTimeStr(sdf.format(provisionalPlanResVo.getPlanPurchaseFinishTime()));
+            provisionalPlanResVo.setPlanDeliverTimeStr(sdf.format(provisionalPlanResVo.getPlanDeliverTime()));
             //状态在采购需求对接和流废标退回之间的项目可以进行催告---已发函不可再次发函
             provisionalPlanResVo.setSendLetterDo("false");
             if (!ObjectUtils.isEmpty(demand)) {

+ 45 - 2
purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandServiceImpl.java

@@ -106,11 +106,13 @@ import com.ozs.pm.service.PmExpertFeedbackService;
 import com.ozs.pm.service.PmProcurementDocumentsReviewService;
 import com.ozs.pm.service.PmProjectConstructionService;
 import com.ozs.pm.service.PmReleaseAnnouncementService;
+import com.ozs.system.domain.SysDeptOrgan;
 import com.ozs.system.domain.SysFileInfo;
 import com.ozs.system.domain.SysFileRef;
 import com.ozs.system.domain.vo.SysRegionVO;
 import com.ozs.system.domain.vo.responseVo.SysDeptResponseVo;
 import com.ozs.system.mapper.SysDeptMapper;
+import com.ozs.system.mapper.SysDeptOrganMapper;
 import com.ozs.system.mapper.SysFileRefMapper;
 import com.ozs.system.mapper.SysRoleMapper;
 import com.ozs.system.service.ISysDeptService;
@@ -229,6 +231,8 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
     @Autowired
     private ProvisionalPlanMapper provisionalPlanMapper;
     @Autowired
+    private SysDeptOrganMapper sysDeptOrganMapper;
+    @Autowired
     private PmExpertFeedbackService pmExpertFeedbackService;
     @Autowired
     private PmProcurementDocumentsReviewService pmProcurementDocumentsReviewService;
@@ -244,18 +248,56 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
      */
     @Override
     public PmDemandResVo selectPmDemandByDemandId(Long demandId, String detailType) {
+        //获取字典数据
+        HashMap<String, HashMap<String, String>> planEnums = dictTypeService.getAboutEnums();
+        HashMap<String, String> budgetAccountMap = planEnums.get("budgetAccount");
+
         PmDemand pmDemand = this.getById(demandId);
         if (pmDemand != null) {
             PmDemandResVo vo = new PmDemandResVo();
             vo.setProjectName(pmDemand.getProjectName());
             vo.setDemandId(demandId);
             BeanUtils.copyProperties(pmDemand, vo);
-            if ("1".equals(detailType)) { //项目计划
+            //项目计划
+            if ("1".equals(detailType)) {
                 //project_type,evaluation 从原来计划里取
-                ProvisionalPlan provisionalPlan = provisionalPlanMapper.seletById(pmDemand.getPlanId());
+                ProvisionalPlan provisionalPlan = provisionalPlanMapper.seletByPlanid(pmDemand.getPlanId());
                 if (provisionalPlan != null) {
                     vo.setProjectType(provisionalPlan.getProjectType());
                     vo.setEvaluation(provisionalPlan.getEvaluation().doubleValue());
+                    //机关业务指导处(科)为id拼接
+                    String organDivision = provisionalPlan.getOrganDivision();
+                    if (!ObjectUtils.isEmpty(organDivision)) {
+                        int length = organDivision.split(",").length;
+                        SysDeptOrgan deptOrgan = new SysDeptOrgan();
+                        if (length > 1) {
+                            StringBuilder builder = new StringBuilder();
+                            String[] split = organDivision.split(",");
+                            for (String s : split) {
+                                deptOrgan = sysDeptOrganMapper.selectById(Long.valueOf(s));
+                                if (!ObjectUtils.isEmpty(deptOrgan)) {
+                                    if (!organDivision.endsWith(s)) {
+                                        builder.append(deptOrgan.getOrganName() + ",");
+                                    } else {
+                                        builder.append(deptOrgan.getOrganName());
+                                    }
+                                }
+                            }
+                            vo.setOrganDivisionStr(builder.toString());
+                        } else if (length == 1) {
+                            deptOrgan = sysDeptOrganMapper.selectById(Long.valueOf(organDivision));
+                            if (!ObjectUtils.isEmpty(deptOrgan)) {
+                                vo.setOrganDivisionStr(deptOrgan.getOrganName());
+                            }
+                        }
+                    }
+                    //预算科目
+                    for (Map.Entry<String, String> entry : budgetAccountMap.entrySet()) {
+                        if (!ObjectUtils.isEmpty(provisionalPlan.getBudgetAccount()) && provisionalPlan.getBudgetAccount().equals(entry.getValue())) {
+                            vo.setBudgetAccountStr(entry.getKey());
+                            break;
+                        }
+                    }
                 }
 
                 SysDeptResponseVo sysDeptResponseVo = (SysDeptResponseVo) deptService.selectDeptById(vo.getPurchaseDeptId()).get("sysDept");
@@ -383,6 +425,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
                     break;
                 }
             }
+
             return vo;
         } else {
             return null;

+ 6 - 0
purchase-system/src/main/resources/mapper/plan/ProvisionalPlanMapper.xml

@@ -132,6 +132,12 @@
           and plan_practical_id = #{planPracticalId}
     </select>
 
+    <select id="seletByPlanid" resultType="com.ozs.plan.doman.ProvisionalPlan" parameterType="java.lang.Long">
+        select *
+        from plan_practical
+        where plan_practical_id = #{planPracticalId}
+    </select>
+
     <select id="selectProvisionalPlan" resultType="com.ozs.plan.doman.ProvisionalPlan"
             parameterType="com.ozs.plan.doman.vo.requestVo.ProvisionalPlanVo">
         select * from plan_practical