Browse Source

发票管理

lizhenhao 2 years ago
parent
commit
d026b987e1

+ 1 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/finance/invoice/mapper/xml/FinanceInvoiceMapper.xml

@@ -181,6 +181,7 @@
         select
         <include refid="Base_Column_List"></include>
         from finance_invoice fi
+        left join sys_user su on fi.create_by = su.id and su.del_flag = '0'
         ${ew.customSqlSegment}
     </select>
 

+ 1 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/finance/invoice/service/FinanceInvoiceService.java

@@ -521,7 +521,7 @@ public class FinanceInvoiceService extends ServiceImpl<FinanceInvoiceMapper, Fin
 //            }
             if (StringUtils.isNotBlank(financeInvoiceDetailDTO.getRate())) {
                 try {
-                    if ((new BigDecimal(financeInvoiceDetailDTO.getRate())).compareTo(new BigDecimal(0)) == -1
+                    if ((new BigDecimal(financeInvoiceDetailDTO.getRate())).compareTo(new BigDecimal(1)) == -1
                             || (new BigDecimal(financeInvoiceDetailDTO.getRate())).compareTo(new BigDecimal(100)) == 1) {
                         return "文件中有税率填写不正确,请重新填写";
                     }

+ 6 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/program/configuration/projectList/domain/ProgramProjectListInfo.java

@@ -203,4 +203,10 @@ public class ProgramProjectListInfo {
      */
     @TableField(exist = false)
     private String[] createDates;
+
+    /**
+     * 是否开票
+     */
+    @TableField(exist = false)
+    private String isInvoice;
 }

+ 1 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/program/configuration/projectList/mapper/ProjectListMapper.java

@@ -25,4 +25,5 @@ public interface ProjectListMapper extends BaseMapper<ProgramProjectListInfo> {
 
     IPage<ProgramProjectListInfo> findPage(Page<ProgramProjectListInfo> page, @Param(Constants.WRAPPER) QueryWrapper<ProgramProjectListInfo> wrapper);
 
+    String selectInvoiceFlag(@Param("id") String id);
 }

+ 26 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/program/configuration/projectList/mapper/xml/ProjectListMapper.xml

@@ -273,4 +273,30 @@
             ORDER BY ppli.update_date DESC
     </select>
 
+    <select id="selectInvoiceFlag" resultType="string">
+        select
+         case
+             when ff.status = '1' then '开票中'
+             when ff.status = '2' then '开票中'
+             when ff.status = '3' then '开票中'
+             when ff.status = '4' then '开票中'
+             when ff.status = '5' then '已开票'
+             when ff.status = '6' then '已开票'
+             when ff.status = '7' then '已开票'
+             when ff.status = '8' then '已开票'
+         else '' end
+        from
+        (select
+        fib.program_name as program_name,
+        fi.`status` as status,
+        fib.program_id as program_id,
+        fi.create_date as create_date
+        from finance_invoice_base fib
+        inner join finance_invoice fi on fi.id = fib.invoice_id and fi.del_flag = '0'
+        where fib.del_flag = '0' and fi.status != '9'
+        order by fi.create_date desc) ff
+        where ff.program_id = #{id}
+        limit 1
+    </select>
+
 </mapper>

+ 4 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/program/configuration/projectList/service/ProjectListService.java

@@ -214,6 +214,10 @@ public class ProjectListService {
             wrapper.between("a.create_date", info.getCreateDates()[0], info.getCreateDates()[1]);
         }
         IPage<ProgramProjectListInfo> pageList = projectListMapper.findPageList(page, wrapper);
+        pageList.getRecords().stream().forEach(item ->{
+            String isInvoice = projectListMapper.selectInvoiceFlag(item.getId());
+            item.setIsInvoice(isInvoice);
+        });
         return pageList;
     }