소스 검색

徐珊开票列表查询调整

sangwenwei 6 달 전
부모
커밋
dc63989beb

+ 1 - 1
jeeplus-modules/jeeplus-assess/src/main/resources/bootstrap.yml

@@ -89,7 +89,7 @@ config:
       endpoint: http://oss-cn-hangzhou.aliyuncs.com
       accessKeyId: LTAI5tKa6kzGr5EyPWJB4EcD
       accessKeySecret: arHxB7ZPhizrBYf4844TtyaRctPMgW
-      bucketName: xg-pg
+      bucketName: xgxm-test
     minIO:
       endpoint:
       accessKey:

+ 2 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/CwFinanceInvoiceMapper.java

@@ -20,6 +20,8 @@ import java.util.List;
 public interface CwFinanceInvoiceMapper extends BaseMapper<CwFinanceInvoice> {
 
     public IPage<CwFinanceInvoiceDTO> findList(Page<CwFinanceInvoiceDTO> page, @Param(Constants.WRAPPER) QueryWrapper<CwFinanceInvoice> queryWrapper);
+    //只针对于徐珊进行的列表查询
+    public IPage<CwFinanceInvoiceDTO> findList2(Page<CwFinanceInvoiceDTO> page, @Param(Constants.WRAPPER) QueryWrapper<CwFinanceInvoice> queryWrapper);
 
     /**
      * 下载导出

+ 66 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/xml/CwFinanceInvoiceMapper.xml

@@ -345,6 +345,72 @@
         fi.create_time DESC, cfid.number asc
     </select>
 
+    <select id="findList2" resultMap="BaseResultMap">
+        select DISTINCT a.id as 'baseId',
+        <include refid="Base_Column_List"></include>,
+        su.name as operator,
+        so.name as operator_office,
+        d.ID_ AS task_id,
+        (
+        case
+        when a.type = '0' then (concat('其他:',a.program_name))
+        when a.type = '1' then (select rpr.project_name from cw_project_records rpr where id = a.program_id)
+        when a.type = '2' then (select rpr.project_name from cw_project_records rpr where id = (select project_id from cw_project_report where id = a.program_id))
+        when a.type = '4' then (select rpr.project_name from cw_project_records rpr where id = a.program_id)
+        else '' end
+        ) as programName,
+
+        (
+        case
+        when a.type = '0' then (fi.report_type)
+        when a.type = '1' then (select rpr.report_type from cw_project_records rpr where id = a.program_id)
+        when a.type = '4' then (select rpr.report_type from cw_project_records rpr where id = a.program_id)
+        when a.type = '2' then (select rpr.report_type from cw_project_records rpr where id = (select project_id from cw_project_report where id = a.program_id))
+        else '' end
+        ) as reportType,
+        (
+        case
+        when a.type = '0' then ("")
+        when a.type = '1' then (select rpr.project_classification from cw_project_records rpr where id = a.program_id)
+        when a.type = '4' then (select rpr.project_classification from cw_project_records rpr where id = a.program_id)
+        when a.type = '2' then (select rpr.project_classification from cw_project_records rpr where id = (select project_id from cw_project_report where id = a.program_id))
+        else '' end
+        ) as projectClassification,
+        (
+        CASE WHEN a.type = '0' THEN ( "")
+        WHEN a.type = '1' THEN ( select GROUP_CONCAT(cprnlz.report_no) from cw_project_report cprz
+        left join cw_project_report_new_line cprnlz on cprz.id = cprnlz.report_id
+        left join cw_project_records cprsz on cprz.project_id= cprsz.id
+        where cprsz.id = a.program_id )
+        WHEN a.type = '2' THEN (
+        select cprnlz.report_no from cw_project_report cprz
+        left join cw_project_report_new_line cprnlz on cprz.id = cprnlz.report_id
+        where cprz.id = a.program_id)
+        WHEN a.type = '4' THEN ( select GROUP_CONCAT(cprnlz.report_no) from cw_project_report cprz
+        left join cw_project_report_new_line cprnlz on cprz.id = cprnlz.report_id
+        left join cw_project_records cprsz on cprz.project_id= cprsz.id
+        where cprsz.id = a.program_id )ELSE ''
+        END
+        ) AS reportNos,
+        cfid.number as "number",
+        ifnull(cfid.account,"0") as "accountDetail",
+        a.program_id,
+        pr.is_pre_invoice as isPreInvoice,
+        a.type as 'recordType'
+        from cw_finance_invoice_base a
+        left join cw_finance_invoice fi on a.invoice_id = fi.id
+        left join cw_finance_invoice_detail cfid on cfid.invoice_id = fi.id and cfid.del_flag = '0'
+        left join sys_user su on fi.create_by_id = su.id and su.del_flag = '0'
+        left join sys_user su1 on fi.reconciliation_people = su1.id and su1.del_flag = '0'
+        left join sys_user_manage_office sumo on sumo.office_id = su.office_id
+        left join sys_office so on su.office_id = so.id and so.del_flag = '0'
+        LEFT JOIN act_ru_task d ON fi.proc_ins_id = d.PROC_INST_ID_
+        LEFT JOIN cw_project_records pr on a.program_id=pr.id
+        ${ew.customSqlSegment}
+        ORDER BY
+        fi.billing_date DESC
+    </select>
+
 <select id="findExportList" resultMap="BaseExportResultMap">
         select DISTINCT a.id as 'baseId',
     ifnull(a.account,"0") as "baseAccount",

+ 32 - 15
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/CwFinanceInvoiceService.java

@@ -34,10 +34,12 @@ import com.jeeplus.finance.workClientInfo.service.CwWorkClientService;
 //import com.jeeplus.pubmodules.oss.service.OssService;
 //import com.jeeplus.pubmodules.serialNumTpl.service.SerialnumTplService;
 import com.jeeplus.sys.domain.User;
+import com.jeeplus.sys.feign.IOfficeApi;
 import com.jeeplus.sys.feign.IRoleApi;
 import com.jeeplus.sys.feign.IUserApi;
 import com.jeeplus.sys.feign.IWorkAttachmentApi;
 //import com.jeeplus.sys.service.UserService;
+import com.jeeplus.sys.service.dto.OfficeDTO;
 import com.jeeplus.sys.service.dto.RoleDTO;
 import com.jeeplus.sys.service.dto.UserDTO;
 import org.apache.commons.collections4.CollectionUtils;
@@ -348,24 +350,39 @@ public class CwFinanceInvoiceService extends ServiceImpl<CwFinanceInvoiceMapper,
 //            }
 //        }
         IPage<CwFinanceInvoiceDTO> list = null;
-        if(StringUtils.isNotBlank(export) && "export".equals(export)){
-            list = cwFinanceInvoiceMapper.findExportList(page, queryWrapper);
-            list.getRecords().forEach(item->{
-                //预开票且报告与发票关联完成的则已完成关联
-                if(StringUtils.isNotBlank(item.getIsPreInvoice()) && StringUtils.isNotBlank(item.getReportNos()) && StringUtils.isNotBlank(item.getNo())){
-                    if ("1".equals(item.getIsPreInvoice())){
-                        item.setIsCompleteInvoice("2");
-                    }
-                }else if (StringUtils.isNotBlank(item.getIsPreInvoice()) && StringUtils.isBlank(item.getReportNos()) && StringUtils.isNotBlank(item.getNo())){
-                    if ("1".equals(item.getIsPreInvoice())){
-                        item.setIsCompleteInvoice("0");
-                    }
+        //获取当前登录人角色是否是苏州报告签字盖章代办
+        UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
+        if (CollectionUtil.isNotEmpty(userDTO.getRoleDTOList())){
+            for (RoleDTO roleDTO : userDTO.getRoleDTOList()) {
+                RoleDTO dtoById = SpringUtil.getBean(IRoleApi.class).getRoleDTOById(roleDTO.getId());
+                if ("szbgqzgzdb".equals(dtoById.getEnName())){
+                    list = cwFinanceInvoiceMapper.findList2(page,queryWrapper);
+                    break;
                 }
-            });
-        }else{
-            list = cwFinanceInvoiceMapper.findList(page, queryWrapper);
+            }
+        }
+        if (null == list){
+            if(StringUtils.isNotBlank(export) && "export".equals(export)){
+                list = cwFinanceInvoiceMapper.findExportList(page, queryWrapper);
+                list.getRecords().forEach(item->{
+                    //预开票且报告与发票关联完成的则已完成关联
+                    if(StringUtils.isNotBlank(item.getIsPreInvoice()) && StringUtils.isNotBlank(item.getReportNos()) && StringUtils.isNotBlank(item.getNo())){
+                        if ("1".equals(item.getIsPreInvoice())){
+                            item.setIsCompleteInvoice("2");
+                        }
+                    }else if (StringUtils.isNotBlank(item.getIsPreInvoice()) && StringUtils.isBlank(item.getReportNos()) && StringUtils.isNotBlank(item.getNo())){
+                        if ("1".equals(item.getIsPreInvoice())){
+                            item.setIsCompleteInvoice("0");
+                        }
+                    }
+                });
+            }else{
+                list = cwFinanceInvoiceMapper.findList(page, queryWrapper);
+            }
         }
 
+
+
         return list;
     }