Browse Source

1.大中型我的订单-返回标记送达日期
2.资产列表新增导出接口

GouGengquan 3 months ago
parent
commit
5e26517ba3

+ 9 - 0
biz-base/src/main/java/com/dayou/controller/AssetsController.java

@@ -54,6 +54,15 @@ public class AssetsController extends BaseController {
     }
 
     /**
+     * 条件导出资产任务列表
+     * @param assetsSelectDTO 查询条件
+     */
+    @GetMapping("/exportPage")
+    public void exportPage(AssetsSelectDTO assetsSelectDTO, HttpServletResponse response ) throws IOException {
+        exportPlus(response,"资产列表",assetsService.exportPage(assetsSelectDTO),AssetsVO.class);
+    }
+
+    /**
      * 条件查询我的资产订单列表
      * @param page 分页条件
      * @param assetsSelectDTO 查询条件

+ 7 - 0
dao/src/main/java/com/dayou/mapper/AssetsMapper.java

@@ -34,6 +34,13 @@ public interface AssetsMapper extends CustomBaseMapper<Assets> {
     Page<AssetsVO> selectPage(@Param("page") Page page, @Param("assetsSelectDTO") AssetsSelectDTO assetsSelectDTO);
 
     /**
+     * 条件导出资产任务列表
+     * @param assetsSelectDTO 查询条件
+     * @return Page<AssetsVO>
+     */
+    List<AssetsVO> exportPage(@Param("assetsSelectDTO") AssetsSelectDTO assetsSelectDTO);
+
+    /**
      * 条件查询我的资产订单列表
      * @param page 分页条件
      * @param assetsSelectDTO 查询条件

+ 26 - 16
dao/src/main/resources/mapper/AssetsMapper.xml

@@ -46,8 +46,8 @@
         name, order_id, financial, allot_type, client_manager_id, principal_id, department_id, assets_business_gener, entrust_again, clientele_type, clientele_id, clientele_sub_id, clientele_contact_id, security, significant_assets_reorganization, state_assets, foreign_assets_involved, dispense_benefit, bailor, bailor_address, bailor_contact_name, bailor_contact_tel, terminal_clientele_id, terminal_clientele_type, terminal_clientele_contact_id, members, remark
     </sql>
 
-    <!--条件查询资产任务列表-->
-    <select id="selectPage" resultType="com.dayou.vo.AssetsVO">
+    <!--资产列表查询SQL-->
+    <sql id="pageSql">
         SELECT DISTINCT
         nodeInfo.recordId AS id,
         assets.id AS assetsId,
@@ -97,7 +97,7 @@
         user,
         work_node AS node
         WHERE state = 'PENDING'
-#             (state = 'PENDING' OR( state = 'FINISHED' AND node.`code` = 'BUSINESS_ARCHIVING' ))
+        #             (state = 'PENDING' OR( state = 'FINISHED' AND node.`code` = 'BUSINESS_ARCHIVING' ))
         AND nodeInstance.node_id = node.id
         AND record.handler_id = user.id
         AND nodeInstance.deleted = 0
@@ -130,19 +130,19 @@
         </if>
         <if test="assetsSelectDTO != null and assetsSelectDTO.selectByAll">
             INNER JOIN (
-                SELECT DISTINCT
-                department.id,
-                user.id AS userId
-                FROM
-                user,
-                post,
-                department,
-                user_post
-                WHERE
-                user.id = user_post.user_id
-                AND user_post.post_id = post.id
-                AND post.department_id = department.id
-                AND user_post.deleted = 0
+            SELECT DISTINCT
+            department.id,
+            user.id AS userId
+            FROM
+            user,
+            post,
+            department,
+            user_post
+            WHERE
+            user.id = user_post.user_id
+            AND user_post.post_id = post.id
+            AND post.department_id = department.id
+            AND user_post.deleted = 0
             ) AS department ON (department.id IN
             <foreach collection="assetsSelectDTO.departmentIdList" index="index" item="item" open="(" separator=","
                      close=")">
@@ -190,6 +190,16 @@
             AND (nodeInfo.currentNodeCode = 'STATEMENT_BOOKBINDING_STAMP' OR nodeInfo.currentNodeCode = 'REPORT_BOOKBINDING_STAMP')
         </if>
         ORDER BY assets.created DESC
+    </sql>
+
+    <!--条件查询资产任务列表-->
+    <select id="selectPage" resultType="com.dayou.vo.AssetsVO">
+        <include refid="pageSql" />
+    </select>
+
+    <!--资产列表导出-->
+    <select id="exportPage" resultType="com.dayou.vo.AssetsVO">
+        <include refid="pageSql" />
     </select>
 
     <sql id="selectMyOrderSql">

+ 2 - 1
dao/src/main/resources/mapper/MajorProductionMapper.xml

@@ -374,12 +374,13 @@
             pf.production_should_amount as shouldAmount,
             fi.invoiceAmount,
             mp.delivery,
+            mp.delivery_date,
             (case mp.repertory_state when 0 then '已入库' when 1 then '已出库' else '未入库' end ) repertoryState,
             ( SELECT declare_result FROM commission_declare WHERE business_id = m.id AND production_id IS NOT NULL AND business_type = 'COMMISSION_DECLARE_MAJOR_MARKET' AND deleted = 0 order by created desc limit 1 ) as mDeclareResult,
             ( SELECT declare_result FROM commission_declare WHERE business_id = m.id AND production_id IS NOT NULL AND business_type = 'COMMISSION_DECLARE_MAJOR_EVALUATE' AND deleted = 0 order by created desc limit 1) as eDeclareResult
         FROM
             major m
-                left join (select id,name,major_id,report_no,evaluate_amount,production,if_save_file,delivery,repertory_state, client_name from major_production where deleted = 0 ) mp on mp.major_id = m.id
+                left join (select id,name,major_id,report_no,evaluate_amount,production,if_save_file,delivery,repertory_state, client_name, delivery_date from major_production where deleted = 0 ) mp on mp.major_id = m.id
                 left join user u on u.id = m.principal_id
                 left join user u1 on u1.id = m.client_manager_id
                 left join customer_company cc on cc.id = m.clientele_id

+ 6 - 0
domain/src/main/java/com/dayou/vo/MajorOrderVO.java

@@ -4,6 +4,7 @@ import com.dayou.annotation.Excel;
 import lombok.Data;
 
 import java.math.BigDecimal;
+import java.time.LocalDate;
 import java.util.Date;
 
 /**
@@ -172,6 +173,11 @@ public class MajorOrderVO {
     private Date created;
 
     /**
+     * 标记送达日期
+     */
+    private LocalDate deliveryDate;
+
+    /**
      * 应收款备注
      */
     private String remark;

+ 7 - 0
service/src/main/java/com/dayou/service/IAssetsService.java

@@ -31,6 +31,13 @@ public interface IAssetsService extends IService<Assets> {
         Page<AssetsVO> selectPage(Page page, AssetsSelectDTO assetsSelectDTO);
 
         /**
+         * 条件导出资产任务列表
+         * @param assetsSelectDTO 查询条件
+         * @return Page<AssetsVO>
+         */
+        List<AssetsVO> exportPage(AssetsSelectDTO assetsSelectDTO);
+
+        /**
          * 条件查询我的任务订单列表
          * @param page 分页条件
          * @param assetsSelectDTO 查询条件

+ 34 - 0
service/src/main/java/com/dayou/service/impl/AssetsServiceImpl.java

@@ -132,6 +132,40 @@ public class AssetsServiceImpl extends ServiceImpl<AssetsMapper, Assets> impleme
     }
 
     /**
+     * 条件导出资产任务列表
+     * @param assetsSelectDTO 查询条件
+     * @return Page<AssetsVO>
+     */
+    @Override
+    public List<AssetsVO> exportPage(AssetsSelectDTO assetsSelectDTO) {
+        // 判断是否要根据部门id集合查询(部门待办查询)
+        if (ObjectUtil.isNotNull(assetsSelectDTO.getSelectByDepartment()) && assetsSelectDTO.getSelectByDepartment()){
+            List<Long> depIds = new ArrayList<>();
+            for (SimpleParentModel postModel : LoginContext.getLoginCacheUserBO().getDepartmentList()) {
+                // 根据部门id获取部门及其下属部门的id
+                depIds.addAll(departmentMapper.getDepIdList(postModel.getId()));
+            }
+            // 去重并赋值
+            assetsSelectDTO.setDepartmentIdList(depIds.stream().distinct().collect(Collectors.toList()));
+        }
+        // 判断是否要查询资产列表,资产列表只能查询包含本人及其所在部门的人员为项目负责人或项目经理的流程(资产列表查询)
+        if (ObjectUtil.isNotNull(assetsSelectDTO.getSelectByAll()) && assetsSelectDTO.getSelectByAll()){
+            List<Long> depIds = new ArrayList<>();
+            for (SimpleParentModel postModel : LoginContext.getLoginCacheUserBO().getDepartmentList()) {
+                // 根据部门id获取部门及其下属部门的id
+                depIds.addAll(departmentMapper.getDepIdList(postModel.getId()));
+            }
+            // 去重并赋值
+            assetsSelectDTO.setDepartmentIdList(depIds.stream().distinct().collect(Collectors.toList()));
+        }
+        // 此处判断handlerId是否为空只是为了确保前端查询条件有handlerId,并不直接信任
+        if (ObjectUtil.isNotNull(assetsSelectDTO) && ObjectUtil.isNotNull(assetsSelectDTO.getHandlerId())){
+            assetsSelectDTO.setHandlerId(LoginContext.getCurrentUserId());
+        }
+        return assetsMapper.exportPage(assetsSelectDTO);
+    }
+
+    /**
      * 条件查询我的资产订单列表
      *
      * @param page            分页条件