Explorar o código

DeBugDeBugDeBug

buzhanyi %!s(int64=2) %!d(string=hai) anos
pai
achega
ddce7bbdf9

+ 17 - 0
purchase-admin/pom.xml

@@ -54,6 +54,23 @@
             <artifactId>easyexcel</artifactId>
             <version>2.1.6</version>
         </dependency>
+
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>2.5</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <version>3.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-pool2</artifactId>
+            <version>2.4.2</version>
+        </dependency>
+
     </dependencies>
 
     <build>

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

@@ -170,6 +170,8 @@ public class PlanYearsController extends BaseController {
         OutputStream outputStream = null;
         InputStream inputStream = null;
         try {
+            response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
+            response.setCharacterEncoding("utf-8");
             outputStream = response.getOutputStream();
             ExcelWriter excelWriter = EasyExcel.write(outputStream).withTemplate(resourceAsStream).autoCloseStream(true).build();
             WriteSheet writeSheet = EasyExcel.writerSheet().build();

BIN=BIN
purchase-admin/src/main/resources/template/planYears.xlsx


BIN=BIN
purchase-admin/src/main/resources/template/plan_year.xlsx


+ 4 - 14
purchase-system/src/main/java/com/ozs/plan/service/impl/PlanYearsServiceImpl.java

@@ -1179,20 +1179,10 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
                     }
                 }
             }
-            //是否可以申请撤销
-            //需求待填制可以申请,需求建档就不能申请
-            PlanQuarter byPlanYearId = planQuarterMapper.getByPlanYearId(planYear.getPlanYearId());
-            if (!ObjectUtils.isEmpty(byPlanYearId)) {
-                PmDemand demand = demandService.selectByPlanId(byPlanYearId.getPlanPracticalId());
-                if (!ObjectUtils.isEmpty(demand) && !demand.getProjectStatus().equals(PmProjectStatus.DEMAND_WAIT_FILL.getCode())) {
-                    planYear.setAppDeleteDo("false");
-                } else if (!ObjectUtils.isEmpty(planYear.getAppDelete()) && planYear.getAppDelete().equals("true")) {
-                    //申请过的不能再申请
-                    planYear.setAppDeleteDo("false");
-                } else {
-                    planYear.setAppDeleteDo("true");
-                }
-            } else if (!planYear.getProjectStatus().equals("0")) {
+            if (!ObjectUtils.isEmpty(planYear.getAppDelete())) {
+                //申请过的不能再申请
+                planYear.setAppDeleteDo("false");
+            } else if (planYear.getProjectStatus().equals(ProjectStatus.PLANWAIEXAMINE.getCode())) {
                 //提交后可以申请撤销
                 planYear.setAppDeleteDo("true");
             }

+ 1 - 1
purchase-system/src/main/java/com/ozs/pm/service/impl/PmAuditDeptRefServiceImpl.java

@@ -66,7 +66,7 @@ public class PmAuditDeptRefServiceImpl extends ServiceImpl<PmAuditDeptRefMapper,
             bdeptId = Long.valueOf(ancestors[3]);
         }
         if (!Arrays.asList("A", "B", "C").contains(deptLevel)) {
-            throw new BaseException("当前用户单位不属于ABC三级,无权提交");
+            throw new BaseException("管理员无权限提交需求。");
         }
         //判断每个级别是否允许审核,并插入审核关联表
         PmAuditDeptRef refA = new PmAuditDeptRef(null, refId, refType, deptId,