zxz 2 年之前
父節點
當前提交
9498afb127

+ 10 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/ExpenseInfo.java

@@ -97,6 +97,11 @@ public class ExpenseInfo extends BaseModel<ExpenseInfo> {
      * 费用名称
      */
     private String expenseName;
+    /**
+     * 备用金支付标识(1是)
+     */
+    private String paymentIdentifi;
+
     /**
      * 费用分配方式(1按重量自动分配3指定金额分配)
      */
@@ -397,6 +402,11 @@ public class ExpenseInfo extends BaseModel<ExpenseInfo> {
      */
     @TableField(exist = false)
     private String contractType;
+    /**
+     * 流向标识
+     */
+    @TableField(exist = false)
+    private String flowFlag;
     /**
      * 费用管理导出
      */

+ 33 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/ExpenseInfoServiceImpl.java

@@ -191,6 +191,7 @@ public class ExpenseInfoServiceImpl extends ServiceImpl<ExpenseInfoMapper, Expen
         pageView.put("appFlag", expenseInfo.getAppFlag());
         pageView.put("pageSize", expenseInfo.getPageSize());
         pageView.put("currentPage", expenseInfo.getCurrentPage());
+        pageView.put("flowFlag", expenseInfo.getFlowFlag());
         pageView.put("contractNo", expenseInfo.getContractNo());
         if(expenseInfo.getCreateUserId() != null && expenseInfo.getCompId()!=null){
             CommonUser commonUser = commonUserService.selectById(expenseInfo.getCreateUserId());
@@ -421,8 +422,10 @@ public class ExpenseInfoServiceImpl extends ServiceImpl<ExpenseInfoMapper, Expen
             no = "HTF" + df.format(new Date()) + newNo;
         } else if ("3".equals(expenseInfo.getExpensesPurpose())) {
             no = "KDF" + df.format(new Date()) + newNo;
-        } else {
+        } else if ("5".equals(expenseInfo.getExpensesPurpose())){
             no = "JYF" + df.format(new Date()) + newNo;
+        }else{
+            no = "BYJ" + df.format(new Date()) + newNo;
         }
         expenseInfo.setCostNo(no);
 
@@ -441,7 +444,7 @@ public class ExpenseInfoServiceImpl extends ServiceImpl<ExpenseInfoMapper, Expen
             expenseInfo.setStatusFlag(StatusEnum.COST_PAYMENT.getFlag());
             expenseInfo.setStatus(StatusEnum.COST_PAYMENT.getName());
             //合同非粮款和库点费用自动分配的情况,未分配金额默认等于费用金额
-            if (("3".equals(expenseInfo.getCostType()) && "1".equals(expenseInfo.getExpensesPurpose())) || ("3".equals(expenseInfo.getExpensesPurpose()) && !"1".equals(expenseInfo.getAutoAssign()))) {
+            if (("3".equals(expenseInfo.getCostType()) && "1".equals(expenseInfo.getExpensesPurpose())) || ("3".equals(expenseInfo.getExpensesPurpose()) && !"1".equals(expenseInfo.getAutoAssign())) || "7".equals(expenseInfo.getExpensesPurpose())) {
                 expenseInfo.setUnallocatedAmount(expenseInfo.getAmountMoney());
             }
             //合同粮款校验
@@ -1596,6 +1599,31 @@ public class ExpenseInfoServiceImpl extends ServiceImpl<ExpenseInfoMapper, Expen
         return page;
     }
 
+//    /**
+//     * 备用金列表查询
+//     * @param expenseInfo
+//     * @return
+//     */
+//    @Override
+//    public Page<ExpenseInfo> selectPettyCashInfo(ExpenseInfo expenseInfo) {
+//        Map<String, Object> pageView = new HashMap<>();
+//        pageView.put("startRecord", (expenseInfo.getCurrentPage() - 1)
+//                * expenseInfo.getPageSize());
+//        pageView.put("searchKeyWord", expenseInfo.getSearchKeyWord());
+//        pageView.put("searchType", expenseInfo.getSearchType());
+//        pageView.put("pageSize", expenseInfo.getPageSize());
+//        pageView.put("currentPage", expenseInfo.getCurrentPage());
+//        pageView.put("contractNo", expenseInfo.getContractNo());
+//        // 查询总数
+//        Integer dataCount = baseMapper.getBondCountByCondition(pageView);
+//        List<ExpenseInfo> dataList = baseMapper.getBondListByCondition(pageView);
+//        Page<ExpenseInfo> page = new Page<>();
+//        page.setRecords(dataList == null ? Lists.newArrayList() : dataList);
+//        page.setTotal(dataCount == null ? 0 : dataCount);
+//        page.setCurrent(expenseInfo.getCurrentPage());
+//        page.setSize(expenseInfo.getPageSize());
+//        return page;
+//    }
     /**
      * 燃料款列表请款记录列表
      * @param expenseInfo
@@ -2265,7 +2293,9 @@ public class ExpenseInfoServiceImpl extends ServiceImpl<ExpenseInfoMapper, Expen
                     }
                 } else if ("5".equals(expenseInfo1.getExpensesPurpose())) {
                     cell.setCellValue(editString("经营性费用"));
-                } else {
+                }else if("7".equals(expenseInfo1.getExpensesPurpose())){
+                    cell.setCellValue(editString("备用金"));
+                }else {
                     cell.setCellValue(editString(expenseInfo1.getCostType()));
                 }
                 cell.setCellStyle(styleDetail);

+ 86 - 6
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/ExpenseInfoMapper.xml

@@ -72,7 +72,8 @@
             AND (lower(expense_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
             OR lower(agent) like lower(CONCAT('%',#{searchKeyWord},'%'))
             OR lower(warehouse_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
-            OR lower(contract_no) like lower(CONCAT('%',#{searchKeyWord},'%')))
+            OR lower(contract_no) like lower(CONCAT('%',#{searchKeyWord},'%'))
+            OR lower(cost_no) like lower(CONCAT('%',#{searchKeyWord},'%')))
         </if>
         <if test="number != null and number != ''">
             AND (lower(cost_no) like lower(CONCAT('%',#{number},'%')))
@@ -84,14 +85,25 @@
             AND (lower(contract_no) like lower(CONCAT('%',#{flowTo},'%'))
             OR lower(warehouse_name) like lower(CONCAT('%',#{flowTo},'%')))
         </if>
+        <if test="flowFlag != null and flowFlag != ''">
+            <if test="flowFlag == 1">
+                AND expenses_purpose = '5'
+                OR expenses_purpose = '7'
+            </if>
+        </if>
         <if test="expenseName != null and expenseName != ''">
             AND (lower(expense_name) like lower(CONCAT('%',#{expenseName},'%')))
         </if>
         <if test="agent != null and agent != ''">
             AND (lower(agent) like lower(CONCAT('%',#{agent},'%')))
         </if>
-        <if test="unallocatedAmount != null">
-            AND unallocated_amount= #{unallocatedAmount}
+<!--        <if test="unallocatedAmount != null">-->
+<!--            AND unallocated_amount= #{unallocatedAmount}-->
+<!--        </if>-->
+        <if test="unallocatedAmount != null and unallocatedAmount != ''">
+            <if test="unallocatedAmount == 1">
+                AND unallocated_amount > 0
+            </if>
         </if>
         <if test="numberList != null and numberList.size > 0">
             and(
@@ -241,7 +253,8 @@
             AND (lower(expense_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
             OR lower(agent) like lower(CONCAT('%',#{searchKeyWord},'%'))
             OR lower(warehouse_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
-            OR lower(contract_no) like lower(CONCAT('%',#{searchKeyWord},'%')))
+            OR lower(contract_no) like lower(CONCAT('%',#{searchKeyWord},'%'))
+            OR lower(cost_no) like lower(CONCAT('%',#{searchKeyWord},'%')))
         </if>
         <if test="number != null and number != ''">
             AND (lower(cost_no) like lower(CONCAT('%',#{number},'%')))
@@ -253,14 +266,25 @@
             AND (lower(contract_no) like lower(CONCAT('%',#{flowTo},'%'))
             OR lower(warehouse_name) like lower(CONCAT('%',#{flowTo},'%')))
         </if>
+        <if test="flowFlag != null and flowFlag != ''">
+            <if test="flowFlag == 1">
+                AND expenses_purpose = '5'
+                OR expenses_purpose = '7'
+            </if>
+        </if>
         <if test="expenseName != null and expenseName != ''">
             AND (lower(expense_name) like lower(CONCAT('%',#{expenseName},'%')))
         </if>
         <if test="agent != null and agent != ''">
             AND (lower(agent) like lower(CONCAT('%',#{agent},'%')))
         </if>
-        <if test="unallocatedAmount != null">
-            AND unallocated_amount= #{unallocatedAmount}
+<!--        <if test="unallocatedAmount != null">-->
+<!--            AND unallocated_amount= #{unallocatedAmount}-->
+<!--        </if>-->
+        <if test="unallocatedAmount != null and unallocatedAmount != ''">
+            <if test="unallocatedAmount == 1">
+                AND unallocated_amount > 0
+            </if>
         </if>
         <if test="numberList != null and numberList.size > 0">
             and(
@@ -491,6 +515,62 @@
             LIMIT ${startRecord}, ${pageSize}
         </if>
     </select>
+<!--    &lt;!&ndash;查询备用金列表总数&ndash;&gt;-->
+<!--    <select id="getPettyCashCountByCondition" parameterType="Map" resultType="java.lang.Integer">-->
+<!--        SELECT-->
+<!--        COUNT(ei.id)-->
+<!--        FROM expense_info ei-->
+<!--        cmi.delete_flag='0'-->
+<!--        WHERE-->
+<!--        ei.delete_flag = '0'-->
+<!--        and ei.expenses_purpose='7'-->
+<!--        <if test="searchType != null and searchType != ''">-->
+<!--            <if test="searchType == 1">-->
+<!--                AND ei.expenses_type = '1'-->
+<!--            </if>-->
+<!--            <if test="searchType == 2">-->
+<!--                AND ei.expenses_type = '2'-->
+<!--            </if>-->
+<!--        </if>-->
+<!--        <if test="searchKeyWord != null and searchKeyWord != ''">-->
+<!--            AND (lower(cmi.seller) like lower(CONCAT('%',#{searchKeyWord},'%'))-->
+<!--            OR lower(cmi.seller) like lower(CONCAT('%',#{searchKeyWord},'%')))-->
+<!--        </if>-->
+<!--    </select>-->
+<!--    &lt;!&ndash;查询备用金列表&ndash;&gt;-->
+<!--    <select id="getPettyCashListByCondition" parameterType="Map"-->
+<!--            resultType="com.yh.saas.plugin.yiliangyiyun.entity.ExpenseInfo">-->
+<!--        SELECT-->
+<!--        ei.id,-->
+<!--        ei.expenses_type as expensesType,-->
+<!--        ei.contract_no as contractNo,-->
+<!--        ei.amount_money as amountMoney,-->
+<!--        ei.expense_name as expenseName,-->
+<!--        ei.create_user_id as createUserId,-->
+<!--        ei.address_url as addressUrl,-->
+<!--        ei.create_date as createDate-->
+<!--        FROM expense_info ei-->
+<!--        WHERE-->
+<!--        ei.delete_flag = '0'-->
+<!--        and ei.expenses_purpose='7'-->
+<!--        and ei.status!='待确认'-->
+<!--        <if test="searchType != null and searchType != ''">-->
+<!--            <if test="searchType == 1">-->
+<!--                AND ei.expenses_type = '1'-->
+<!--            </if>-->
+<!--            <if test="searchType == 2">-->
+<!--                AND ei.expenses_type = '2'-->
+<!--            </if>-->
+<!--        </if>-->
+<!--        <if test="searchKeyWord != null and searchKeyWord != ''">-->
+<!--            AND (lower(cmi.seller) like lower(CONCAT('%',#{searchKeyWord},'%'))-->
+<!--            OR lower(cmi.seller) like lower(CONCAT('%',#{searchKeyWord},'%')))-->
+<!--        </if>-->
+<!--        ORDER BY ei.update_date DESC-->
+<!--        <if test="currentPage != null and currentPage != ''">-->
+<!--            LIMIT ${startRecord}, ${pageSize}-->
+<!--        </if>-->
+<!--    </select>-->
 
     <select id="getRequestRecordCountByCondition" parameterType="Map" resultType="java.lang.Integer">
         SELECT