| | |
| | | private void writeBackPayment(FieldSetEntity fs){ |
| | | //回写发票号回款 |
| | | DataTableEntity dt = fs.getSubDataTable(CmnConst.LX_PROJECT_CONTRACT_PAYMENT_COLLECTION); |
| | | String contractTermsUUID = fs.getString("contract_terms"); |
| | | for (int i = 0; i <dt.getRows() ; i++) { |
| | | FieldSetEntity subFs = dt.getFieldSetEntity(i); |
| | | FieldSetEntity collection_amount_fs = baseDao.getFieldSetBySQL("SELECT sum(collection_amount) collection_amount FROM `product_project_contract_payment_collection` where invoice_num=?", new String[]{subFs.getString("invoice_num")}, false); |
| | | baseDao.executeUpdate("UPDATE product_project_contract_invoice_info set payment_amount=? where invoice_num=?",new String[]{collection_amount_fs.getString("collection_amount"),subFs.getString("invoice_num")}); |
| | | baseDao.executeUpdate("UPDATE product_project_contract_invoice_info set payment_amount=? where invoice_num=? AND contract_terms=?",new String[]{collection_amount_fs.getString("collection_amount"), subFs.getString("invoice_num"), contractTermsUUID}); |
| | | } |
| | | //回写条款回款 |
| | | FieldSetEntity contractTerms = baseDao.getFieldSetBySQL("SELECT sum(collection_amount) collection_amount FROM `product_project_contract_payment_collection` \n" + |
| | | "where contract_payment_uuid in(SELECT uuid FROM product_project_contract_payment where contract_terms=?)", new String[]{fs.getString("contract_terms")}, false); |
| | | "where contract_payment_uuid in(SELECT uuid FROM product_project_contract_payment where contract_terms=?)", new String[]{contractTermsUUID}, false); |
| | | if (contractTerms!=null&&!StringUtils.isEmpty(contractTerms.getString("collection_amount"))) { |
| | | FieldSetEntity contractInfoSub = new FieldSetEntity(); |
| | | contractInfoSub.setTableName(CmnConst.LX_PROJECT_CONTRACT_INFO_SUB); |