Explorar o código

总所删除功能、
各部门报销详情来源功能修改

user5 %!s(int64=2) %!d(string=hai) anos
pai
achega
2434bb3a68

+ 44 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/mapper/xml/AccountantReimbursementBusinessMapper.xml

@@ -18,6 +18,40 @@
         su.name as "user.name"
     </sql>
 
+    <sql id="reimbursementColumns">
+        id,
+        create_by,
+        create_date,
+        update_by,
+        update_date,
+        remarks,
+        del_flag,
+        parent_id,
+        parent_ids,
+        invoice_code,
+        invoice_number,
+        firm_name,
+        make_time,
+        name,
+        money,
+        tax,
+        income,
+        business_code,
+        gathering_time,
+        proposer,
+        partner,
+        business_type,
+        reimbursement_ratio,
+        gathering_status,
+        reimbursement_status,
+        batch_flag,
+        year,
+        random_type,
+        random_business_code_index,
+        reimbursement_batch,
+        sort
+    </sql>
+
     <sql id="reimbursementBusinessColumns">
         a.id AS "id",
 		a.create_by AS "createBy.id",
@@ -243,7 +277,16 @@
         ,zri.reimbursement_batch as "reimbursementBatch"
         FROM zs_reimbursement_business_info a
         <include refid="reimbursementUserJoinColumns"/>
-        left join zs_reimbursement_accountant_info zri on zri.id = a.business_code_id
+        left join (select <include refid="reimbursementColumns"/> from zs_reimbursement_info
+                    UNION all
+                    select <include refid="reimbursementColumns"/> from zs_wuhan_reimbursement_info
+                    UNION all
+                    select <include refid="reimbursementColumns"/> from zs_reimbursement_accountant_info
+                    UNION all
+                    select <include refid="reimbursementColumns"/> from zs_reimbursement_project_info
+                    UNION all
+                    select <include refid="reimbursementColumns"/> from zs_reimbursement_assess_info
+            ) zri on zri.id = a.business_code_id
         <where>
             a.del_flag = 0
             and a.user_id = #{userId}

+ 44 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAssess/mapper/xml/AssessReimbursementBusinessMapper.xml

@@ -18,6 +18,40 @@
         su.name as "user.name"
     </sql>
 
+    <sql id="reimbursementColumns">
+        id,
+        create_by,
+        create_date,
+        update_by,
+        update_date,
+        remarks,
+        del_flag,
+        parent_id,
+        parent_ids,
+        invoice_code,
+        invoice_number,
+        firm_name,
+        make_time,
+        name,
+        money,
+        tax,
+        income,
+        business_code,
+        gathering_time,
+        proposer,
+        partner,
+        business_type,
+        reimbursement_ratio,
+        gathering_status,
+        reimbursement_status,
+        batch_flag,
+        year,
+        random_type,
+        random_business_code_index,
+        reimbursement_batch,
+        sort
+    </sql>
+
     <sql id="reimbursementBusinessColumns">
         a.id AS "id",
 		a.create_by AS "createBy.id",
@@ -242,7 +276,16 @@
         ,zri.business_code as "businessCode"
         FROM zs_reimbursement_business_info a
         <include refid="reimbursementUserJoinColumns"/>
-        left join zs_reimbursement_assess_info zri on zri.id = a.business_code_id
+        left join (select <include refid="reimbursementColumns"/> from zs_reimbursement_info
+                    UNION all
+                    select <include refid="reimbursementColumns"/> from zs_wuhan_reimbursement_info
+                    UNION all
+                    select <include refid="reimbursementColumns"/> from zs_reimbursement_accountant_info
+                    UNION all
+                    select <include refid="reimbursementColumns"/> from zs_reimbursement_project_info
+                    UNION all
+                    select <include refid="reimbursementColumns"/> from zs_reimbursement_assess_info
+            ) zri on zri.id = a.business_code_id
         <where>
             a.del_flag = 0
             and a.user_id = #{userId}

+ 44 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementProject/mapper/xml/ProjectReimbursementBusinessMapper.xml

@@ -18,6 +18,40 @@
         su.name as "user.name"
     </sql>
 
+    <sql id="reimbursementColumns">
+        id,
+        create_by,
+        create_date,
+        update_by,
+        update_date,
+        remarks,
+        del_flag,
+        parent_id,
+        parent_ids,
+        invoice_code,
+        invoice_number,
+        firm_name,
+        make_time,
+        name,
+        money,
+        tax,
+        income,
+        business_code,
+        gathering_time,
+        proposer,
+        partner,
+        business_type,
+        reimbursement_ratio,
+        gathering_status,
+        reimbursement_status,
+        batch_flag,
+        year,
+        random_type,
+        random_business_code_index,
+        reimbursement_batch,
+        sort
+    </sql>
+
     <sql id="reimbursementBusinessColumns">
         a.id AS "id",
 		a.create_by AS "createBy.id",
@@ -242,7 +276,16 @@
         ,zri.business_code as "businessCode"
         FROM zs_reimbursement_business_info a
         <include refid="reimbursementUserJoinColumns"/>
-        left join zs_reimbursement_project_info zri on zri.id = a.business_code_id
+        left join (select <include refid="reimbursementColumns"/> from zs_reimbursement_info
+                    UNION all
+                    select <include refid="reimbursementColumns"/> from zs_wuhan_reimbursement_info
+                    UNION all
+                    select <include refid="reimbursementColumns"/> from zs_reimbursement_accountant_info
+                    UNION all
+                    select <include refid="reimbursementColumns"/> from zs_reimbursement_project_info
+                    UNION all
+                    select <include refid="reimbursementColumns"/> from zs_reimbursement_assess_info
+            ) zri on zri.id = a.business_code_id
         <where>
             a.del_flag = 0
             and a.user_id = #{userId}

+ 11 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/mapper/WuHanReimbursementSysMapper.java

@@ -227,4 +227,15 @@ public interface WuHanReimbursementSysMapper extends BaseMapper<WuHanReimburseme
      * @param reimbursement
      */
     int updateById(WuHanReimbursementDTO reimbursement);
+
+    /**
+     * 查询该发票信息下是否存在有效的同级数据信息
+     * @param id
+     */
+    String getValidBusinessIdByInvoiceId(String id);
+    /**
+     * 删除业务信息(逻辑删除)
+     * @param id
+     */
+    void removeBusinessById(String id);
 }

+ 47 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/mapper/xml/ReimbursementBusinessMapper.xml

@@ -18,6 +18,40 @@
         su.name as "user.name"
     </sql>
 
+    <sql id="reimbursementColumns">
+        id,
+        create_by,
+        create_date,
+        update_by,
+        update_date,
+        remarks,
+        del_flag,
+        parent_id,
+        parent_ids,
+        invoice_code,
+        invoice_number,
+        firm_name,
+        make_time,
+        name,
+        money,
+        tax,
+        income,
+        business_code,
+        gathering_time,
+        proposer,
+        partner,
+        business_type,
+        reimbursement_ratio,
+        gathering_status,
+        reimbursement_status,
+        batch_flag,
+        year,
+        random_type,
+        random_business_code_index,
+        reimbursement_batch,
+        sort
+    </sql>
+
     <sql id="reimbursementBusinessColumns">
         a.id AS "id",
 		a.create_by AS "createBy.id",
@@ -255,7 +289,16 @@
         ,ifnull(zri.business_code,(select business_code from zs_wuhan_reimbursement_info where id = a.business_code_id)) as "businessCode"
         FROM zs_reimbursement_business_info a
         <include refid="reimbursementUserJoinColumns"/>
-        left join zs_reimbursement_info zri on zri.id = a.business_code_id
+        left join (select <include refid="reimbursementColumns"/> from zs_reimbursement_info
+                    UNION all
+                    select <include refid="reimbursementColumns"/> from zs_wuhan_reimbursement_info
+                    UNION all
+                    select <include refid="reimbursementColumns"/> from zs_reimbursement_accountant_info
+                    UNION all
+                    select <include refid="reimbursementColumns"/> from zs_reimbursement_project_info
+                    UNION all
+                    select <include refid="reimbursementColumns"/> from zs_reimbursement_assess_info
+            ) zri on zri.id = a.business_code_id
         <where>
             a.del_flag = 0
             and a.user_id = #{userId}
@@ -279,6 +322,9 @@
             <if test="endDate != null">
                 and a.create_date &lt;= #{endDate}
             </if>
+            <if test="officeType != null and officeType != ''">
+                and a.office_type = #{officeType}
+            </if>
         </where>
         order by a.update_date desc,a.year desc, a.user_id asc
     </select>

+ 66 - 2
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/mapper/xml/WuHanReimbursementBusinessMapper.xml

@@ -18,6 +18,40 @@
         su.name as "user.name"
     </sql>
 
+    <sql id="reimbursementColumns">
+        id,
+        create_by,
+        create_date,
+        update_by,
+        update_date,
+        remarks,
+        del_flag,
+        parent_id,
+        parent_ids,
+        invoice_code,
+        invoice_number,
+        firm_name,
+        make_time,
+        name,
+        money,
+        tax,
+        income,
+        business_code,
+        gathering_time,
+        proposer,
+        partner,
+        business_type,
+        reimbursement_ratio,
+        gathering_status,
+        reimbursement_status,
+        batch_flag,
+        year,
+        random_type,
+        random_business_code_index,
+        reimbursement_batch,
+        sort
+    </sql>
+
     <sql id="reimbursementBusinessColumns">
         a.id AS "id",
 		a.create_by AS "createBy.id",
@@ -253,12 +287,42 @@
         ,zri.business_code as "businessCode"
         FROM zs_reimbursement_business_info a
         <include refid="reimbursementUserJoinColumns"/>
-        left join zs_reimbursement_info zri on zri.id = a.business_code_id
+        left join (select <include refid="reimbursementColumns"/> from zs_reimbursement_info
+                    UNION all
+                    select <include refid="reimbursementColumns"/> from zs_wuhan_reimbursement_info
+                    UNION all
+                    select <include refid="reimbursementColumns"/> from zs_reimbursement_accountant_info
+                    UNION all
+                    select <include refid="reimbursementColumns"/> from zs_reimbursement_project_info
+                    UNION all
+                    select <include refid="reimbursementColumns"/> from zs_reimbursement_assess_info
+            ) zri on zri.id = a.business_code_id
         <where>
             a.del_flag = 0
             and a.user_id = #{userId}
             and a.year = #{year}
-            and a.reimbursement_address = #{reimbursementAddress}
+
+            <if test="reimbursementAddress != null and reimbursementAddress != ''">
+                and a.reimbursement_address = #{reimbursementAddress}
+            </if>
+            <if test="reimbursementFsalary != null and reimbursementFsalary != ''">
+                and a.reimbursement_fsalary = #{reimbursementFsalary}
+            </if>
+            <if test="beginReimbursementQuota != null and beginReimbursementQuota != ''">
+                and a.reimbursement_amount >= #{beginReimbursementQuota}
+            </if>
+            <if test="endReimbursementQuota != null and endReimbursementQuota != ''">
+                and a.reimbursement_amount &lt;= #{endReimbursementQuota}
+            </if>
+            <if test="beginDate != null">
+                and a.create_date >= #{beginDate}
+            </if>
+            <if test="endDate != null">
+                and a.create_date &lt;= #{endDate}
+            </if>
+            <if test="officeType != null and officeType != ''">
+                and a.office_type = #{officeType}
+            </if>
         </where>
         order by a.update_date desc,a.year desc, a.user_id asc
     </select>

+ 15 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/mapper/xml/WuHanReimbursementSysMapper.xml

@@ -554,4 +554,19 @@
         id = #{id} and del_flag = 0
     </update>
 
+
+    <select id="getValidBusinessIdByInvoiceId" resultType="java.lang.String">
+        select parent_id from zs_wuhan_reimbursement_invoice_info
+        where parent_id = (
+        select parent_id from zs_wuhan_reimbursement_invoice_info
+        where id = #{id}
+        ) and del_flag = 0 limit 1
+    </select>
+
+    <update id="removeBusinessById">
+        update zs_wuhan_reimbursement_info
+        set del_flag = 1
+        where id = (select parent_id from zs_wuhan_reimbursement_invoice_info where id = #{id})
+    </update>
+
 </mapper>

+ 1 - 3
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/impl/ReimbursementUserServiceImpl.java

@@ -214,15 +214,13 @@ public class ReimbursementUserServiceImpl implements ReimbursementUserService {
         reimbursementBusiness.setEndReimbursementQuota(reimbursementBusinessReturn.getEndReimbursementQuota());
         reimbursementBusiness.setReimbursementAddress(reimbursementBusinessReturn.getReimbursementAddress());
         reimbursementBusiness.setReimbursementFsalary(reimbursementBusinessReturn.getReimbursementFsalary());
+        reimbursementBusiness.setOfficeType(reimbursementBusinessReturn.getOfficeType());
 
         ReimbursementBusinessReturnDTO reimbursementBusinessReturnDTO = new ReimbursementBusinessReturnDTO();
         List<ReimbursementBusinessDTO> showList = businessMapper.findListByUserIdAndYear(reimbursementBusiness);
         //获取报销来源集合
         List<ReimbursementAddressDTO> reimbursementAddressList = businessMapper.getReimbursementAddressByUserIdAndYear(reimbursementBusiness);
         reimbursementBusinessReturnDTO.setReimbursementAddressList(reimbursementAddressList);
-        //获取实发类型集合
-        List<ReimbursementAddressDTO> reimbursementFsalaryList = businessMapper.getReimbursementFsalaryByUserIdAndYear(reimbursementBusiness);
-        reimbursementBusinessReturnDTO.setReimbursementFsalaryList(reimbursementFsalaryList);
 
         for (ReimbursementBusinessDTO info : showList) {
             info.setReimbursementFsalary(DictUtils.getDictLabel(info.getReimbursementFsalary(), "reimbursement_fsalary", null));

+ 10 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/impl/WuHanReimbursementSysServiceImpl.java

@@ -586,9 +586,18 @@ public class WuHanReimbursementSysServiceImpl implements WuHanReimbursementSysSe
 
     @Override
     public void removeInvoiceByIds(List<String> idList) {
+        //删除发票信息
         if(idList.size()>0) {
-            //删除发票信息
             mapper.removeInvoiceByIds(idList);
+            Set<String> set = new HashSet<>();
+            //遍历发票id查询对应得业务信息下是否存在有效的发票信息,若不存在,则将对应的业务信息同时删除
+            for (String id : idList) {
+                //查询该发票信息下是否存在有效的同级数据信息
+                String businessId = mapper.getValidBusinessIdByInvoiceId(id);
+                if(StringUtils.isBlank(businessId)){
+                    mapper.removeBusinessById(id);
+                }
+            }
         }
     }