| | |
| | | */ |
| | | public FieldSetEntity getContractInfoByName(FieldSetEntity fs) throws BaseException { |
| | | FieldSetEntity fss = baseDao.getFieldSetEntity(CmnConst.LX_PROJECT_CONTRACT_INFO,fs.getUUID(),true); |
| | | FieldSetEntity fsProject = baseDao.getFieldSetEntity(CmnConst.LX_PROJECT_INFO,fss.getString("project_uuid"),false); |
| | | DataTableEntity dt = fss.getSubDataTable(CmnConst.LX_PROJECT_CONTRACT_INFO_SUB); |
| | | FieldSetEntity fsub = null; |
| | | int invoiced = 0;//已开票金额 |
| | | int payment_received = 0;//已回款金额 |
| | | if(dt!=null && dt.getRows()>0){ |
| | | for (int i = 0; i < dt.getRows(); i++) { |
| | | fsub = dt.getFieldSetEntity(i); |
| | | String invo = fsub.getString("invoiced"); |
| | | String paym = fsub.getString("payment_received"); |
| | | if(BaseUtil.strIsNull(invo)){ |
| | | invo = "0"; |
| | | } |
| | | if(BaseUtil.strIsNull(paym)){ |
| | | paym = "0"; |
| | | } |
| | | invoiced += Double.parseDouble(invo); |
| | | payment_received += Double.parseDouble(paym); |
| | | } |
| | | FieldSetEntity fsProject = baseDao.getFieldSetEntity(CmnConst.PRODUCT_PROJECT_BUSINESS,fss.getString("project_uuid"),false); |
| | | FieldSetEntity contractName = baseDao.getFieldSetEntityBySQL("SELECT sum(invoice_amount) invoice_amount FROM product_project_contract_invoice_info WHERE contract_invoice_uuid in(SELECT uuid FROM product_project_contract_invoice where contract_name=?)", new String[]{fs.getString("uuid")},false); |
| | | if (contractName==null||StringUtils.isEmpty(contractName.getString("invoice_amount"))){ |
| | | fss.setValue("invoice_amount",0); |
| | | }else { |
| | | fss.setValue("invoice_amount",contractName.getString("invoice_amount")); |
| | | } |
| | | fss.setValue("invoiced",invoiced); |
| | | fss.setValue("payment_received",payment_received); |
| | | |
| | | fss.setValue("collection_amount",0); |
| | | fss.setValue("project_num",fsProject.getString("project_num")); |
| | | fss.setValue("project_name",fsProject.getString("project_name")); |
| | | return fss; |
| | |
| | | if(fss!=null){ |
| | | fsinvo = baseDao.getFieldSetEntityByFilter(CmnConst.LX_PROJECT_CONTRACT_INVOICE,"contract_name=?",new Object[]{fss.getUUID()},true); |
| | | fspaym = baseDao.getFieldSetEntityByFilter(CmnConst.LX_PROJECT_CONTRACT_PAYMENT,"contract_name=?",new Object[]{fss.getUUID()},true); |
| | | dtproj = baseDao.listTable(CmnConst.LX_PROJECT_INFO," uuid=? ",new Object[]{fss.getString("project_uuid")}); |
| | | dtproj = baseDao.listTable(CmnConst.PRODUCT_PROJECT_BUSINESS," uuid=? ",new Object[]{fss.getString("project_uuid")}); |
| | | } |
| | | DataTableEntity dt = fss.getSubDataTable(CmnConst.LX_PROJECT_CONTRACT_INFO_SUB); |
| | | FieldSetEntity fsub = null; |
| | |
| | | */ |
| | | public String isAddContract(FieldSetEntity fs) throws BaseException { |
| | | String uuid = fs.getUUID(); |
| | | DataTableEntity dataTableEntity = baseDao.listTable(" SELECT * FROM product_project_contract_info where flow_flag = 2 AND project_uuid = ? ", new String[]{uuid}); |
| | | DataTableEntity dataTableEntity = baseDao.listTable(" SELECT * FROM product_project_contract_info where project_uuid = ? ", new String[]{uuid}); |
| | | if (BaseUtil.dataTableIsEmpty(dataTableEntity)) { |
| | | return "0"; |
| | | } else { |