Browse Source

1.我的申请下载;2.文件申请时间

da-xian 3 months ago
parent
commit
78340409dd

+ 1 - 1
src/main/java/com/bowintek/smartsearch/controller/WellInfoController.java

@@ -239,7 +239,7 @@ public class WellInfoController {
         getParams.put("fileName", fileName+".png");
         getParams.put("filePath", "/user/ktkf/a1/sjh/JSJGSYT");
 
-        String reData = remoteHelper.getJson(getParams, appConfig.hdfshelperurl + "read", "UTF-8");
+        String reData = remoteHelper.getJson(getParams, appConfig.hdfshelperurl + "readImage", "UTF-8");
 
         return RespGenerstor.success(reData);
     }

+ 7 - 0
src/main/java/com/bowintek/smartsearch/mapper/cquery/WellInfoCQuery.java

@@ -100,6 +100,13 @@ public interface WellInfoCQuery {
      */
     List<HashMap<String,Object>> selectDataIndexList(String well_id);
 
+    /**
+     * 井资料索引(文档)
+     * @param well_common_name
+     * @return
+     */
+    List<HashMap<String,Object>> selectDataIndexListByWellCommonName(String well_common_name);
+
     /**
      * 地质单元类型列表
      * @return

+ 26 - 4
src/main/java/com/bowintek/smartsearch/services/impl/ApplyFormServiceImpl.java

@@ -9,7 +9,9 @@ import com.bowintek.smartsearch.model.CfApplyFormReviewer;
 import com.bowintek.smartsearch.model.CfApplyFormReviewerExample;
 import com.bowintek.smartsearch.model.CfApplyFormWellFile;
 import com.bowintek.smartsearch.services.service.ApplyFormService;
+import com.bowintek.smartsearch.services.service.WellInfoService;
 import com.bowintek.smartsearch.services.service.system.RoleService;
+import com.bowintek.smartsearch.util.StringUtils;
 import com.bowintek.smartsearch.vo.user.UserInfoModel;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
@@ -18,10 +20,7 @@ import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.UUID;
+import java.util.*;
 
 @Component
 public class ApplyFormServiceImpl implements ApplyFormService {
@@ -35,7 +34,11 @@ public class ApplyFormServiceImpl implements ApplyFormService {
     @Autowired
     private CfApplyFormWellFileMapper wellFileMapper;
     @Autowired
+    private WellInfoService wellInfoService;
+    @Autowired
     private RoleService roleService;
+    @Autowired
+    private StringUtils stringUtils;
 
     @Override
     public PageInfo<HashMap<String, Object>> selectApplyFormList(int page, int rows, String userID, String applyUserName, String reviewerUserId, String beginDate, String endDate) {
@@ -93,6 +96,25 @@ public class ApplyFormServiceImpl implements ApplyFormService {
     @Override
     public List<HashMap<String, Object>> selectApplyFormFileList( String applyId,Integer status,String applyUserId) {
         List<HashMap<String, Object>> dataList = applyFormCQuery.selectApplyFormFileList(applyId,status,applyUserId);
+
+        String well_common_name = "";
+        List<HashMap<String, Object>> urlList = new ArrayList<>();
+        for(HashMap<String, Object> obj: dataList){
+            if(stringUtils.isNullOrBlank(obj.get("well_common_name")))
+                continue;
+
+            if(!well_common_name.equals(stringUtils.objectToString(obj.get("well_common_name")))){
+                well_common_name = stringUtils.objectToString(obj.get("well_common_name"));
+                urlList = wellInfoService.selectDataIndexListByWellCommonName(well_common_name);
+            }
+
+            if(urlList.size()>0){
+                HashMap<String, Object> item = urlList.stream().filter(x-> stringUtils.objectToString(obj.get("well_common_name")).equals(stringUtils.objectToString(x.get("well_common_name")))
+                                          && stringUtils.objectToString(obj.get("file_name")).equals(stringUtils.objectToString(x.get("file_name")))).findFirst().orElse(null);
+                if(item!=null)
+                    obj.put("storage_path", stringUtils.objectToString(item.get("storage_path")));
+            }
+        }
         return dataList;
     }
 }

+ 6 - 0
src/main/java/com/bowintek/smartsearch/services/impl/WellInfoServiceImpl.java

@@ -133,6 +133,12 @@ public class WellInfoServiceImpl implements WellInfoService {
         return wellInfoCQuery.selectDataIndexList(well_id);
     }
 
+    @Override
+    @SwitchDataSource(DBTypeEnum.POSTGRE)
+    public List<HashMap<String, Object>> selectDataIndexListByWellCommonName(String well_common_name) {
+        return wellInfoCQuery.selectDataIndexListByWellCommonName(well_common_name);
+    }
+
     @Override
     public int saveExpendSetting(WlUserExpendSetting model) {
         WlUserExpendSettingExample example = new WlUserExpendSettingExample();

+ 1 - 0
src/main/java/com/bowintek/smartsearch/services/service/WellInfoService.java

@@ -22,6 +22,7 @@ public interface WellInfoService {
     List<HashMap<String,Object>> selectHistoryAssignmentSummary(String well_id);
     HashMap<String, Object> getLastHistoryAssignment(String well_id);
     List<HashMap<String,Object>> selectDataIndexList(String well_id);
+    List<HashMap<String,Object>> selectDataIndexListByWellCommonName(String well_common_name);
     int saveExpendSetting(WlUserExpendSetting model);
     WlUserExpendSetting getExpendSetting(String userId ,String wellId);
     List<HashMap<String, Object>> getConstructUnitTree();

+ 16 - 0
src/main/java/com/bowintek/smartsearch/util/StringUtils.java

@@ -24,4 +24,20 @@ public class StringUtils {
     public static boolean IsNullEmpty(String value) {
         return value == null || value.isEmpty();
     }
+
+    public static boolean isNullOrBlank(Object obj) {
+        if (obj == null) {
+            return true;
+        }
+
+        if (obj instanceof String) {
+            return ((String) obj).trim().isEmpty();
+        }
+
+        return false;
+    }
+
+    public static String objectToString(Object obj) {
+        return obj == null ? "" : obj.toString();
+    }
 }

+ 5 - 0
src/main/resources/mapping/cquery/WellInfoCQuery.xml

@@ -310,6 +310,11 @@
                  inner join by_dwr.fact_dwr_well_basic_information well on di.well_common_name=well.well_common_name
         where well.well_id = #{well_id}
     </select>
+    <select id="selectDataIndexListByWellCommonName" resultType="java.util.HashMap">
+        select di.*
+        from by_dwr.fact_dwr_well_data_index di
+        where di.well_common_name = #{wellCommonName}
+    </select>
     <select id="selectDimProjectTypeList" resultType="java.util.HashMap">
         select name as title,value_id as key
         from BY_DIM.dim_project_type

+ 1 - 1
vue/src/views/applyform/apply.vue

@@ -118,7 +118,7 @@ export default defineComponent({
         width: 200,
         align: "center",
         key: 'applyDate',
-        customRender: ({record}) => dayjs(record.startTime).format('YYYY-MM-DD')
+        customRender: ({record}) => dayjs(record.applyDate).format('YYYY-MM-DD')
       },
       {title: '申请原因', dataIndex: 'reason', key: '1', align: "center"},
       {title: '状态', dataIndex: 'statusName', key: '1', align: "center"},

+ 1 - 1
vue/src/views/applyform/reviewer.vue

@@ -125,7 +125,7 @@ export default defineComponent({
         width: 200,
         align: "center",
         key: 'applyDate',
-        customRender: ({record}) => dayjs(record.startTime).format('YYYY-MM-DD')
+        customRender: ({record}) => dayjs(record.applyDate).format('YYYY-MM-DD')
       },
       {title: '申请原因', dataIndex: 'reason', key: '1', align: "center"},
       {title: '状态', dataIndex: 'statusName', key: '1', align: "center"},