Procházet zdrojové kódy

根据报告号查询盒号

huangguoce před 1 dnem
rodič
revize
7ddf9ff14b

+ 3 - 3
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/controller/CwProjectReportArchiveController.java

@@ -326,10 +326,10 @@ public class CwProjectReportArchiveController {
     }
 
 
-    @ApiOperation(value = "根据委托项目类型查询最新盒号和报告文号")
+    @ApiOperation(value = "查询最新盒号和报告文号")
     @GetMapping("/getFileBoxNumber")
-    public ResponseEntity<CwProjectReportArchiveDTO> getFileBoxNumber(@RequestParam String entrustType) throws Exception{
-        CwProjectReportArchiveDTO dto = cwProjectReportArchiveService.findByEntrustType(entrustType);
+    public ResponseEntity<CwProjectReportArchiveDTO> getFileBoxNumber(@RequestParam String reportType) throws Exception{
+        CwProjectReportArchiveDTO dto = cwProjectReportArchiveService.findByReportType(reportType);
         return ResponseEntity.ok(dto);
     }
 }

+ 2 - 2
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/mapper/CwProjectReportArchiveMapper.java

@@ -88,11 +88,11 @@ public interface CwProjectReportArchiveMapper extends BaseMapper<CwProjectReport
     List<CwProjectReportArchiveDTO> getArchiveDateByReportId(String reportId);
 
     /**
-     * 根据委托项目类型查询盒号和报告文号
+     * 根据报告号查询盒号和报告文号
      * @return
      */
     @InterceptorIgnore(tenantLine = "true")
-    CwProjectReportArchiveDTO findByEntrustType(@Param("entrustType")String entrustType);
+    CwProjectReportArchiveDTO findByReportType(@Param("reportType")String reportType);
 
 }
 

+ 6 - 6
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/mapper/xml/CwProjectReportArchiveMapper.xml

@@ -718,17 +718,17 @@
     </select>
 
 
-    <select id="findByEntrustType" resultType="com.jeeplus.finance.projectReportArchive.service.dto.CwProjectReportArchiveDTO">
+    <select id="findByReportType" resultType="com.jeeplus.finance.projectReportArchive.service.dto.CwProjectReportArchiveDTO">
         select
             a.number,
             cw_prnl.report_no AS reportNo
         from cw_project_report_archive a
             left join cw_project_report_new_line cw_prnl on a.report_id = cw_prnl.report_id and cw_prnl.del_flag = '0'
-        where a.entrust_type = #{entrustType}
+        where cw_prnl.report_no like concat('%',#{reportType},'%')
             and a.del_flag = '0'
-            and a.status = '5'
-        order by
-            a.update_time DESC
-            limit 1
+        ORDER BY
+            CAST(SUBSTRING(cw_prnl.report_no, 7, 4) AS UNSIGNED) DESC,
+            CAST(SUBSTRING(cw_prnl.report_no, 12, LENGTH(cw_prnl.report_no)-12) AS UNSIGNED) DESC
+            LIMIT 1;
     </select>
 </mapper>

+ 4 - 4
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/service/CwProjectReportArchiveService.java

@@ -741,12 +741,12 @@ public class CwProjectReportArchiveService extends ServiceImpl<CwProjectReportAr
 
     /**
      * 根据委托项目类型查询最新盒号和报告文号
-     * @param entrustType
+     * @param reportType
      * @return
      */
-    public CwProjectReportArchiveDTO findByEntrustType(String entrustType) {
-        if (StringUtils.isNotBlank(entrustType)){
-            CwProjectReportArchiveDTO cwProjectReportArchiveDTO = cwProjectReportArchiveMapper.findByEntrustType(entrustType);
+    public CwProjectReportArchiveDTO findByReportType(String reportType) {
+        if (StringUtils.isNotBlank(reportType)){
+            CwProjectReportArchiveDTO cwProjectReportArchiveDTO = cwProjectReportArchiveMapper.findByReportType(reportType);
                 return cwProjectReportArchiveDTO;
         }
         return null;