Browse Source

会计报告重新归档,获取原归档日期功能

user5 10 months ago
parent
commit
92d7162a19

+ 3 - 1
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReport/service/CwProjectReportService.java

@@ -630,7 +630,9 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
             queryWrapper.like("f.id", projectReportData.getRealHeaderName()).or().like("f.name", projectReportData.getRealHeaderName());
         }
         if (StringUtils.isNotEmpty(projectReportData.getCreateBy().getId())) {
-            queryWrapper.like("a.create_by_id", projectReportData.getCreateBy().getId()).or().like("d.name", projectReportData.getCreateBy().getId());
+            queryWrapper.and(wrapper -> wrapper.like("a.create_by_id", projectReportData.getCreateBy().getId())
+                    .or()
+                    .like("d.name", projectReportData.getCreateBy().getId()));
         }
         //4、签约时间(区间)
         String[] contractDates = projectReportData.getContractDates();

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

@@ -14,9 +14,7 @@ import com.jeeplus.finance.projectReportArchive.service.dto.CwProjectReportArchi
 import com.jeeplus.finance.projectReportArchive.service.dto.ReportDTO;
 import com.jeeplus.logging.annotation.ApiLog;
 import com.jeeplus.logging.constant.enums.LogTypeEnum;
-//import com.jeeplus.sys.utils.DictUtils;
 import com.jeeplus.sys.feign.IDictApi;
-import com.sun.org.apache.xpath.internal.operations.Bool;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
@@ -209,4 +207,28 @@ public class CwProjectReportArchiveController {
         cwProjectReportArchiveService.getNotFiledYetList(cwProjectReportArchiveDTO);
     }
 
+
+    /**
+     * 根据归档id查询该报告历史归档信息集合
+     * @return
+     */
+    @ApiOperation(value = "根据归档id查询该报告历史归档信息集合")
+    @GetMapping("/findHiById")
+    public ResponseEntity findHiById(@RequestParam String id) {
+        List<CwProjectReportArchiveDTO> hiById = cwProjectReportArchiveService.findHiById(id);
+        return ResponseEntity.ok(hiById);
+    }
+
+
+    /**
+     * 查询最后一条归档并作废的归档信息
+     * @return
+     */
+    @ApiOperation(value = "查询最后一条归档并作废的归档信息")
+    @GetMapping("/getLastAuditDateByReportId")
+    public ResponseEntity getLastAuditDateByReportId(@RequestParam String reportId) {
+        CwProjectReportArchiveDTO hiById = cwProjectReportArchiveService.getLastAuditDateByReportId(reportId);
+        return ResponseEntity.ok(hiById);
+    }
+
 }

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

@@ -5,12 +5,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.jeeplus.finance.invoice.domain.CwFinanceInvoice;
 import com.jeeplus.finance.projectReportArchive.domain.CwProjectReportArchive;
 import com.jeeplus.finance.projectReportArchive.service.dto.CwProjectReportArchiveDTO;
 import com.jeeplus.finance.projectReportArchive.service.dto.ReportDTO;
 import com.jeeplus.finance.projectReportArchive.service.dto.WorkAttachmentArchiveDto;
-import com.jeeplus.sys.domain.WorkAttachmentInfo;
 import com.jeeplus.sys.service.dto.UserDTO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Mapper;
@@ -58,6 +56,20 @@ public interface CwProjectReportArchiveMapper extends BaseMapper<CwProjectReport
     @InterceptorIgnore(tenantLine = "true")
     List<CwProjectReportArchiveDTO> getNotFiledYetList (@Param(Constants.WRAPPER) QueryWrapper<CwProjectReportArchive> queryWrapper);
 
+
+    /**
+     * 根据归档id查询该报告历史归档信息集合
+     * @param id
+     * @return
+     */
+    List<CwProjectReportArchiveDTO> findHiById(String id);
+
+    /**
+     * 查询最后一条归档并作废的归档信息
+     * @param reportId
+     * @return
+     */
+    CwProjectReportArchiveDTO getLastAuditDateByReportId(String reportId);
 }
 
 

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

@@ -313,7 +313,7 @@
             left join sys_user su2 on su2.id = cw_pr.signature_annotator2 and su2.del_flag = '0'
             where cw_prnl.del_flag = '0'
         ) b on b.report_id = cw_pa.report_id
-        where cw_pa.del_flag = '0' and cw_pa.id = #{id}
+        where cw_pa.id = #{id}
     </select>
 
     <select id="findReportList" resultType="com.jeeplus.finance.projectReportArchive.service.dto.ReportDTO">
@@ -491,4 +491,66 @@
         and cw_pa.audit_date is null and timestampdiff(day,cw_prnl.report_date,now()) &lt;= 60
         ORDER BY cw_pa.create_time DESC
     </select>
+
+
+
+    <select id="findHiById" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List"></include>,
+        cw_wcb.name as audited_units_name,
+        su.name as userName,
+        b.report_date,
+        b.report_create_name,
+        b.signature_annotator1_name,
+        b.signature_annotator2_name,
+        b.report_no,
+        prnl.report_no as "connectReport"
+        from cw_project_report_archive cw_pa
+        left join cw_project_report_new_line prnl on cw_pa.connect_report_id=prnl.report_id
+        left join cw_work_client_base cw_wcb on cw_pa.audited_units = cw_wcb.id and cw_wcb.del_flag = '0'
+        left join sys_user su on su.id = cw_pa.create_by_id and su.del_flag = '0'
+        left join(
+        select
+        <include refid="prnl_column"></include>
+        from cw_project_report_new_line cw_prnl
+        left join cw_project_report cw_pr on cw_pr.id = cw_prnl.report_id and cw_pr.del_flag = '0'
+        left join sys_user su on su.id = cw_prnl.create_by_id and su.del_flag = '0'
+        left join sys_user su1 on su1.id = cw_pr.signature_annotator1 and su1.del_flag = '0'
+        left join sys_user su2 on su2.id = cw_pr.signature_annotator2 and su2.del_flag = '0'
+        where cw_prnl.del_flag = '0'
+        ) b on b.report_id = cw_pa.report_id
+        where cw_pa.report_id = (select report_id from cw_project_report_archive where id = #{id}) and cw_pa.del_flag = 1 and cw_pa.status = 5
+        order by cw_pa.audit_date desc,cw_pa.update_time desc
+    </select>
+
+
+    <select id="getLastAuditDateByReportId" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List"></include>,
+        cw_wcb.name as audited_units_name,
+        su.name as userName,
+        b.report_date,
+        b.report_create_name,
+        b.signature_annotator1_name,
+        b.signature_annotator2_name,
+        b.report_no,
+        prnl.report_no as "connectReport"
+        from cw_project_report_archive cw_pa
+        left join cw_project_report_new_line prnl on cw_pa.connect_report_id=prnl.report_id
+        left join cw_work_client_base cw_wcb on cw_pa.audited_units = cw_wcb.id and cw_wcb.del_flag = '0'
+        left join sys_user su on su.id = cw_pa.create_by_id and su.del_flag = '0'
+        left join(
+        select
+        <include refid="prnl_column"></include>
+        from cw_project_report_new_line cw_prnl
+        left join cw_project_report cw_pr on cw_pr.id = cw_prnl.report_id and cw_pr.del_flag = '0'
+        left join sys_user su on su.id = cw_prnl.create_by_id and su.del_flag = '0'
+        left join sys_user su1 on su1.id = cw_pr.signature_annotator1 and su1.del_flag = '0'
+        left join sys_user su2 on su2.id = cw_pr.signature_annotator2 and su2.del_flag = '0'
+        where cw_prnl.del_flag = '0'
+        ) b on b.report_id = cw_pa.report_id
+        where cw_pa.report_id = #{reportId} and cw_pa.del_flag = 1 and cw_pa.status = 5
+        order by cw_pa.audit_date desc,cw_pa.update_time desc
+        limit 1
+    </select>
 </mapper>

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

@@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.util.ArrayUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.extra.spring.SpringUtil;
-import com.alibaba.druid.sql.dialect.odps.ast.OdpsStatisticClause;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -28,22 +27,11 @@ import com.jeeplus.finance.projectReportArchive.service.dto.ReportDTO;
 import com.jeeplus.finance.projectReportArchive.service.dto.WorkAttachmentArchiveDto;
 import com.jeeplus.finance.projectReportArchive.service.mapstruct.CwProjectReportArchiveWrapper;
 import com.jeeplus.flowable.feign.IFlowableApi;
-//import com.jeeplus.pubmodules.oss.domain.WorkAttachment;
-//import com.jeeplus.pubmodules.oss.mapper.OssServiceMapper;
-//import com.jeeplus.pubmodules.oss.service.OssService;
-//import com.jeeplus.pubmodules.oss.service.dto.WorkAttachmentDto;
-//import com.jeeplus.pubmodules.serialNumTpl.service.SerialnumTplService;
-import com.jeeplus.sys.domain.User;
 import com.jeeplus.sys.domain.WorkAttachmentInfo;
-import com.jeeplus.sys.feign.IRoleApi;
 import com.jeeplus.sys.feign.IUserApi;
 import com.jeeplus.sys.feign.IWorkAttachmentApi;
-//import com.jeeplus.sys.mapper.UserMapper;
-import com.jeeplus.sys.service.dto.RoleDTO;
 import com.jeeplus.sys.service.dto.UserDTO;
-//import com.jeeplus.sys.utils.UserUtils;
 import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -506,4 +494,26 @@ public class CwProjectReportArchiveService extends ServiceImpl<CwProjectReportAr
             e.printStackTrace();
         }
     }
+
+
+    /**
+     * 根据归档id查询该报告历史归档信息集合
+     * @param collectId
+     * @return
+     */
+    public List<CwProjectReportArchiveDTO> findHiById(String collectId) {
+        List<CwProjectReportArchiveDTO> hiById = cwProjectReportArchiveMapper.findHiById(collectId);
+        return hiById;
+    }
+
+
+    /**
+     * 查询最后一条归档并作废的归档信息
+     * @param collectId
+     * @return
+     */
+    public CwProjectReportArchiveDTO getLastAuditDateByReportId(String collectId) {
+        CwProjectReportArchiveDTO hiById = cwProjectReportArchiveMapper.getLastAuditDateByReportId(collectId);
+        return hiById;
+    }
 }

+ 13 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportArchive/service/dto/CwProjectReportArchiveDTO.java

@@ -275,6 +275,11 @@ public class CwProjectReportArchiveDTO extends BaseDTO {
      */
     private String cprrProcDefId;
 
+    /**
+     * 流程发起人姓名
+     */
+    private String userName;
+
 
     private static final long serialVersionUID = 1L;
 
@@ -645,4 +650,12 @@ public class CwProjectReportArchiveDTO extends BaseDTO {
     public void setConnectReport(String connectReport) {
         this.connectReport = connectReport;
     }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
 }

+ 5 - 1
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/workClientInfo/service/CwWorkClientService.java

@@ -150,6 +150,9 @@ public class CwWorkClientService extends ServiceImpl<CwWorkClientBaseMapper, CwW
         long l1 = System.currentTimeMillis();
         QueryWrapper<CwWorkClientBase> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("cw_wcb.del_flag","0");
+        if(StringUtils.isNotBlank(cwWorkClientBaseDTO.getName())){
+            queryWrapper.like("cw_wcb.name", cwWorkClientBaseDTO.getName());
+        }
         queryWrapper.orderByDesc("cw_wcb.create_time");
         if (ObjectUtil.isNotEmpty(cwWorkClientBaseDTO)) {
             if (StringUtils.isNotBlank(cwWorkClientBaseDTO.getName()) ||
@@ -210,7 +213,8 @@ public class CwWorkClientService extends ServiceImpl<CwWorkClientBaseMapper, CwW
             }
             if (StringUtils.isNotBlank(cwWorkClientBaseDTO.getIsTrue())) {
                 if ("1".equals(cwWorkClientBaseDTO.getIsTrue())){
-                    queryWrapper.eq("cw_wcb.status","0").or().eq("cw_wcb.status","5");
+                    //queryWrapper.eq("cw_wcb.status","0").or().eq("cw_wcb.status","5");
+                    queryWrapper.and(wrapper -> wrapper.eq("cw_wcb.status", "0").or().eq("cw_wcb.status", "5"));
                 }
             }
         }