Selaa lähdekoodia

试验页面填报上报上报后状态未改变问题,试验创建报告后没有保存不更改委托单状态,限制委托单删除,日志标题无法预览,质检无法预览部分表单(e_visa_pdf_url判空问题)

DengLinLang 1 kuukausi sitten
vanhempi
commit
7847b858f2

+ 3 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/EntrustInfoController.java

@@ -124,6 +124,9 @@ public class  EntrustInfoController extends BladeController {
 		if(Func.isNotEmpty(entrustInfo.getRepealType()) && entrustInfo.getRepealType()==2){
 			entrustInfo.setSampleStatus("5");
 		}
+		if ("".equals(entrustInfo.getSampleStatus())){
+			entrustInfo.setSampleStatus(null);
+		}
 		return R.status(entrustInfoService.updateById(entrustInfo));
 	}
 

+ 16 - 8
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -887,17 +887,25 @@ public class InformationWriteQueryController extends BladeController {
         if (ObjectUtil.isNotEmpty(startTaskVO.getTrialSelfInspectionRecordId())) {
             //试验
             businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, startTaskVO.getIds().replaceAll(",", "")).eq(InformationQuery::getClassify, startTaskVO.getClassify().toString()).eq(InformationQuery::getType, 2));
+            if (businessData != null) {
+                //设置业务数据ID
+                startTaskVO.setIds(businessData.getWbsId().toString());
+                startTaskVO.setTrialSelfInspectionRecordId(1L);
+                return this.batchTask(startTaskVO);
+            } else {
+                return R.data(300, false, "未查询到填报信息,上报失败");
+            }
         } else { //质检
             businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, startTaskVO.getIds().replaceAll(",", "")).eq(InformationQuery::getClassify, startTaskVO.getClassify().toString()).eq(InformationQuery::getType, 1));
+            if (businessData != null) {
+                //设置业务数据ID
+                startTaskVO.setIds(businessData.getId().toString());
+                return this.batchTask(startTaskVO);
+            } else {
+                return R.data(300, false, "未查询到填报信息,上报失败");
+            }
         }
-        //处理上报信息
-        if (businessData != null) {
-            //设置业务数据ID
-            startTaskVO.setIds(businessData.getId().toString());
-            return this.batchTask(startTaskVO);
-        } else {
-            return R.data(300, false, "未查询到填报信息,上报失败");
-        }
+
     }
 
     /**

+ 2 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/EntrustInfoMapper.java

@@ -55,4 +55,6 @@ public interface EntrustInfoMapper extends BaseMapper<EntrustInfo> {
 	int delEntrustInfo(@Param("ids") List<Long> ids);
 
 	Integer selectCountBySampleId(Long sampleId);
+
+	List<EntrustInfo> checkDelete(@Param("ids") List<Long> ids);
 }

+ 10 - 1
blade-service/blade-business/src/main/java/org/springblade/business/mapper/EntrustInfoMapper.xml

@@ -91,7 +91,7 @@
         SELECT
         CASE
         WHEN max(c.task_status) = '未上报' THEN 1
-        WHEN max(c.task_status) = '待审批' THEN 3
+        WHEN max(c.task_status) = '待审批' THEN 2
         WHEN max(c.task_status) = '已审批' THEN 4
         ELSE 5
         END
@@ -158,6 +158,15 @@
     <select id="selectCountBySampleId" resultType="java.lang.Integer">
         select  count(*) from u_entrust_info where sample_id=#{sampleId} and is_deleted=0
     </select>
+    <select id="checkDelete" resultType="org.springblade.business.entity.EntrustInfo">
+        select id from u_entrust_info where  id in (
+            <foreach collection="ids" item="id" separator=",">
+                #{id}
+            </foreach>
+            )
+        and (status = 2
+        or id  in (select entrust_id from u_trial_self_inspection_record where is_deleted=0))
+    </select>
 
 
     <delete id="delEntrustInfo" >

+ 4 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/EntrustInfoServiceImpl.java

@@ -171,6 +171,10 @@ public class EntrustInfoServiceImpl extends BaseServiceImpl<EntrustInfoMapper, E
 			return R.fail("ids不能为null");
 		}
 		List<Long> longList = Func.toLongList(ids);
+		List<EntrustInfo> entrustInfos = baseMapper.checkDelete(longList);
+		if (entrustInfos.size()>0){
+			return R.fail("删除失败");
+		}
 		int delete = baseMapper.delEntrustInfo(longList);
 
 		return R.success("");

+ 2 - 2
blade-service/blade-manager/pom.xml

@@ -87,8 +87,8 @@
 
         <dependency>
             <groupId>e-iceblue</groupId>
-            <artifactId>spire.office.free</artifactId>
-            <version>5.3.1</version>
+            <artifactId>spire.xls.free</artifactId>
+            <version>5.3.0</version>
         </dependency>
 
         <dependency>

+ 3 - 3
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -1822,7 +1822,7 @@ public class ExcelTabController extends BladeController {
         if (maps.size() >= 1) {
             Map<String, Object> stringObjectMap = maps.get(0);
             String pdfUrl = stringObjectMap.get("pdf_url") + "";
-            if (stringObjectMap.get("e_visa_pdf_url") != null) {
+            if (Func.isNotEmpty(stringObjectMap.get("e_visa_pdf_url"))) {
                 //优先使用电签的pdf
                 pdfUrl = stringObjectMap.get("e_visa_pdf_url") + "";
             }
@@ -2364,8 +2364,8 @@ public class ExcelTabController extends BladeController {
                     CellRange[] columns = sheet.getMergedCells();
                     for (int i = 0; i < columns.length; i++) {
                         CellRange cellRange = columns[i];
-                        System.out.println(cellRange.getText());
-                        if (cellRange.getStyle().getFont().getSize() >= 12 && Func.isNotEmpty(cellRange.getText())) {
+
+                        if (cellRange.getStyle().getFont().getSize() >= 12 && (Func.isNotEmpty(cellRange.getValue2()) || Func.isNotEmpty(cellRange.getValue()))) {
                             String title = projectInfo.getProjectName();
                             if (title.length() >= 30) {
                                 cellRange.setRowHeight(40);

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/ExcelTabClientImpl.java

@@ -244,7 +244,7 @@ public class ExcelTabClientImpl implements ExcelTabClient {
                     for (int i = 0; i < columns.length; i++) {
                         CellRange cellRange = columns[i];
                         System.out.println(cellRange.getText());
-                        if (cellRange.getStyle().getFont().getSize() >= 12 && Func.isNotEmpty(cellRange.getText())) {
+                        if (cellRange.getStyle().getFont().getSize() >= 12 && (Func.isNotEmpty(cellRange.getValue2()) || Func.isNotEmpty(cellRange.getValue()))) {
                             String title = projectInfo.getProjectName();
                             if (title.length() >= 30) {
                                 cellRange.setRowHeight(40);

+ 0 - 4
blade-service/blade-manager/src/main/java/org/springblade/manager/utils/ExcelInfoUtils.java

@@ -6,9 +6,6 @@ import com.spire.xls.Workbook;
 import com.spire.xls.Worksheet;
 import com.spire.xls.core.spreadsheet.HTMLOptions;
 import org.apache.commons.lang.StringUtils;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
 import org.jsoup.nodes.Element;
@@ -23,7 +20,6 @@ import org.springblade.manager.vo.DateFormat;
 
 import java.io.File;
 import java.io.FileInputStream;
-import java.io.FileNotFoundException;
 import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.HashMap;