| | |
| | | } |
| | | |
| | | /** |
| | | * 生成 |
| | | * 流水生成 |
| | | * @param resources / |
| | | */ |
| | | @Override |
| | |
| | | // 资产类型:流动 |
| | | public static final String ACCET_TYPE_FLOW = "asset_type_flow"; |
| | | |
| | | // 合同费用类型 |
| | | public static final String CONTRACR_TYPE_COST = "contract_type_cost"; |
| | | // 合同费用类型:合同支出 |
| | | public static final String CONTRACR_EXPENDITURE = "contract_expenditure"; |
| | | // 合同费用类型:合同收入 |
| | | public static final String CONTRACR_REVENUE = "contract_revenue"; |
| | | |
| | | public static final String DAILY_PAYROLL_EXPEND = "工资流水支出"; |
| | | public static final String ASSET_FLOW_EXPEND_G = "固定资产支出"; |
| | | public static final String ASSET_FLOW_EXPEND_L = "流动资产支出"; |
| | | public static final String CONTRACT_EXPENSES = "合同费用支出"; |
| | | public static final String CONTRACT_EXPENSES_S = "合同费用收入"; |
| | | } |
| | |
| | | @ApiModelProperty(value = "合同ID") |
| | | private Long contractId; |
| | | |
| | | /** 魏传栋 - 始 */ |
| | | @Column(name = "`company_id`") |
| | | @ApiModelProperty(value = "公司ID") |
| | | private Long companyId; |
| | | /** 魏传栋 - 终 */ |
| | | |
| | | @Column(name = "`payment_time`") |
| | | @ApiModelProperty(value = "付款时间") |
| | | private Timestamp paymentTime; |
| | |
| | | @ApiModelProperty(value = "款项结束日期") |
| | | private Timestamp fundBelongEnd; |
| | | |
| | | /** 魏传栋 - 始 */ |
| | | @Column(name = "`payment_type`") |
| | | @ApiModelProperty(value = "收支类型") |
| | | private String paymentType; |
| | | /** 魏传栋 - 终 */ |
| | | |
| | | @Column(name = "`remarks`") |
| | | @ApiModelProperty(value = "备注信息") |
| | | private String remarks; |
| | |
| | | */ |
| | | package me.zhengjie.modules.contract.repository; |
| | | |
| | | import me.zhengjie.modules.assetManagement.domain.AssetManagement; |
| | | import me.zhengjie.modules.contract.domain.ContractPayment; |
| | | import org.springframework.data.jpa.repository.JpaRepository; |
| | | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| | |
| | | * @param contractId |
| | | */ |
| | | void deleteByContractId(Long contractId); |
| | | |
| | | /** |
| | | * 根据公司和日期查询 |
| | | * @return |
| | | */ |
| | | @Query(value = "SELECT * FROM `contract_payment` WHERE payment_time like %?% and company_id = ? and payment_type = ?",nativeQuery = true) |
| | | List<ContractPayment> findByDateAndCompany(String buyDate, Long companyId, String assetsType); |
| | | } |
| | |
| | | |
| | | /** 发票信息 */ |
| | | private List<Long> contractInvoiceIds; |
| | | |
| | | /** 魏传栋 - 始 */ |
| | | /** 公司id */ |
| | | private Long companyId; |
| | | |
| | | /** 费用类型 */ |
| | | private String paymentType; |
| | | |
| | | /** 公司名 */ |
| | | private String companyName; |
| | | /** 魏传栋 - 终 */ |
| | | } |
| | |
| | | import me.zhengjie.modules.contract.repository.ContractRepository; |
| | | import me.zhengjie.modules.contract.service.dto.ContractDto; |
| | | import me.zhengjie.modules.contract.service.mapstruct.ContractMapper; |
| | | import me.zhengjie.modules.system.domain.SysCompany; |
| | | import me.zhengjie.modules.system.repository.DictDetailRepository; |
| | | import me.zhengjie.modules.system.repository.SysCompanyRepository; |
| | | import me.zhengjie.utils.ValidationUtil; |
| | | import me.zhengjie.utils.FileUtil; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | private final ContractServiceImpl contractServiceImpl; |
| | | private final ContractMapper contractMapper; |
| | | private final ContractRepository contractRepository; |
| | | private final SysCompanyRepository sysCompanyRepository; |
| | | |
| | | @Override |
| | | public Map<String,Object> queryAll(ContractPaymentQueryCriteria criteria, Pageable pageable){ |
| | |
| | | Contract contract = contractRepository.findById(t.getContractId()).orElseGet(Contract::new); |
| | | // DTO赋值 |
| | | contractPaymentDto.setContractName(contract.getContractName()); |
| | | |
| | | // 魏传栋 - 始 |
| | | SysCompany sysCompany = sysCompanyRepository.findById(contractPaymentDto.getCompanyId()).orElseGet(SysCompany::new); |
| | | contractPaymentDto.setCompanyName(sysCompany.getLabel()); |
| | | // 返回处理好的DTO |
| | | return contractPaymentDto; |
| | | } |
| | |
| | | import me.zhengjie.modules.assetManagement.repository.AssetManagementRepository; |
| | | import me.zhengjie.modules.capitalFlow.domain.CapitalFlow; |
| | | import me.zhengjie.modules.capitalFlow.domain.CapitalFlowExpend; |
| | | import me.zhengjie.modules.capitalFlow.domain.CapitalFlowIncome; |
| | | import me.zhengjie.modules.capitalFlow.repository.CapitalFlowExpendRepository; |
| | | import me.zhengjie.modules.capitalFlow.repository.CapitalFlowIncomeRepository; |
| | | import me.zhengjie.modules.capitalFlow.repository.CapitalFlowRepository; |
| | | import me.zhengjie.modules.constant.Constant; |
| | | import me.zhengjie.modules.contract.domain.ContractPayment; |
| | | import me.zhengjie.modules.contract.repository.ContractPaymentRepository; |
| | | import me.zhengjie.modules.salary.domain.Salary; |
| | | import me.zhengjie.modules.salary.repository.SalaryRepository; |
| | | import me.zhengjie.modules.system.domain.SysCompany; |
| | |
| | | private final AssetManagementRepository assetManagementRepository; |
| | | private final CapitalFlowRepository capitalFlowRepository; |
| | | private final CapitalFlowExpendRepository capitalFlowExpendRepository; |
| | | private final ContractPaymentRepository contractPaymentRepository; |
| | | private final CapitalFlowIncomeRepository capitalFlowIncomeRepository; |
| | | |
| | | /** |
| | | * 向资金流水和流水指出添加数据 |
| | |
| | | capitalFlowExpendRepository.delete(capitalFlowExpends.get(i)); |
| | | } |
| | | |
| | | // 查询流水收入管理 |
| | | List<CapitalFlowIncome> capitalFlowIncomes = capitalFlowIncomeRepository.findByFlowId(capitalFlow.getId()); |
| | | // 流水收入管理不为空,数据全部删除 |
| | | for(int i = 0; i< capitalFlowIncomes.size(); i++){ |
| | | capitalFlowIncomeRepository.delete(capitalFlowIncomes.get(i)); |
| | | } |
| | | |
| | | // 工资支出总金额 |
| | | Double totalWageExpenditure = 0.0; |
| | | // 用户检索类 |
| | |
| | | saveCapitalFlowExpend(capitalFlow.getId(),totalAssetsExpenditureFlow, Constant.ASSET_FLOW_EXPEND_L); |
| | | } |
| | | |
| | | // 合同支出总金额 |
| | | Double contractExpenditure = 0.0; |
| | | // 根据日期和公司查询合同付款 |
| | | List<ContractPayment> contractPayments = contractPaymentRepository.findByDateAndCompany(targetYearMonth.substring(0,7), companyId, Constant.CONTRACR_EXPENDITURE); |
| | | for(int i = 0; i < contractPayments.size(); i++){ |
| | | contractExpenditure = contractExpenditure + Double.valueOf(contractPayments.get(i).getPaymentAmount().toString()); |
| | | } |
| | | // 合同支出总金额不为0的话就往流水支出管理添加数据 |
| | | if(!contractExpenditure.equals(0.0)){ |
| | | // 调用方法添加 |
| | | saveCapitalFlowExpend(capitalFlow.getId(),contractExpenditure, Constant.CONTRACT_EXPENSES); |
| | | } |
| | | |
| | | // 合同收入总金额 |
| | | Double contractRevenue = 0.0; |
| | | // 根据日期和公司查询合同收入 |
| | | List<ContractPayment> contractPaymentList = contractPaymentRepository.findByDateAndCompany(targetYearMonth.substring(0,7), companyId, Constant.CONTRACR_REVENUE); |
| | | for(int i = 0; i < contractPaymentList.size(); i++){ |
| | | contractRevenue = contractRevenue + Double.valueOf(contractPaymentList.get(i).getPaymentAmount().toString()); |
| | | } |
| | | // 合同收入总金额不为0就往流水收入管理添加数据 |
| | | if(!contractRevenue.equals(0.0)){ |
| | | CapitalFlowIncome capitalFlowIncome = new CapitalFlowIncome(); |
| | | capitalFlowIncome.setFlowId(capitalFlow.getId()); |
| | | capitalFlowIncome.setAmount(new BigDecimal(contractRevenue)); |
| | | capitalFlowIncome.setTitle(Constant.CONTRACT_EXPENSES_S); |
| | | capitalFlowIncomeRepository.save(capitalFlowIncome); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 流水支出管理添加 |
| | | * @param id |
| | |
| | | // 合同状态:已结束 |
| | | export const CONTRACT_STATUS_IS_OVER = 'contract_is_over' |
| | | |
| | | // 合同费用类型 |
| | | export const CONTRACR_TYPE_COST = 'contract_type_cost' |
| | | // 合同费用类型:合同支出 |
| | | export const CONTRACR_EXPENDITURE = 'contract_expenditure' |
| | | // 合同费用类型:合同收入 |
| | | export const CONTRACR_REVENUE = 'contract_revenue' |
| | | |
| | | export default { |
| | | ROLE_LEVEL_SUPER, |
| | | ROLE_LEVEL_GENERAL, |
| | |
| | | CONTRACT_STATUS_HAVE_HAND, |
| | | CONTRACT_STATUS_IN_SERVICE, |
| | | CONTRACT_STATUS_TERMINATED, |
| | | CONTRACT_STATUS_IS_OVER |
| | | CONTRACT_STATUS_IS_OVER, |
| | | CONTRACR_TYPE_COST, |
| | | CONTRACR_EXPENDITURE, |
| | | CONTRACR_REVENUE |
| | | } |
| | |
| | | <el-form-item label="付款金额" prop="paymentAmount"> |
| | | <money-input :key="random" v-model="form.paymentAmount" :width="200" /> |
| | | </el-form-item> |
| | | <!--魏传栋 - 始--> |
| | | <el-form-item label="所属公司" prop="companyId"> |
| | | <el-select v-model="form.companyId" filterable clearable placeholder="请选择" style="width: 200px;"> |
| | | <el-option |
| | | v-for="item in companyList" |
| | | :key="item.id" |
| | | :label="item.label" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="收支类型" prop="paymentType"> |
| | | <el-select v-model="form.paymentType" filterable clearable placeholder="请选择" style="width: 200px;"> |
| | | <el-option |
| | | v-for="item in dict[paymentType]" |
| | | :key="item.id" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <!--魏传栋 - 终--> |
| | | <span v-if="form.fundType == fundContract"> |
| | | <el-divider>合同费款项所属</el-divider> |
| | | <el-form-item label="所属内容" prop="fundBelong"> |
| | |
| | | {{ crud.toMoney(scope.row.paymentAmount) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="companyName" label="所属公司" /> |
| | | <el-table-column :show-overflow-tooltip="true" prop="paymentType" label="收支类型"> |
| | | <template slot-scope="scope"> |
| | | {{ dict.label[paymentType][scope.row.paymentType] }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="fundBelong" label="款项所属"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="scope.row.fundBelong != null"> |
| | |
| | | |
| | | <script> |
| | | import crudContractPayment from '@/api/contract/contractPayment' |
| | | import crudSysCompany from '@/api/system/sysCompany' |
| | | import CRUD, { presenter, header, form, crud } from '@crud/crud' |
| | | import rrOperation from '@crud/RR.operation' |
| | | import crudOperation from '@crud/CRUD.operation' |
| | |
| | | import crudContract from '@/api/contract/contract' |
| | | import crudContractInvoice from '@/api/contract/contractInvoice' |
| | | |
| | | const defaultForm = { paymentId: null, contractId: null, paymentTime: null, fundType: null, paymentAmount: null, fundBelong: null, fundBelongYear: null, fundBelongStart: null, fundBelongEnd: null, remarks: null, contractInvoiceIds: [], createBy: null, updateBy: null, createTime: null, updateTime: null } |
| | | const defaultForm = { paymentId: null, contractId: null, paymentTime: null, fundType: null, paymentAmount: null, fundBelong: null, fundBelongYear: null, fundBelongStart: null, fundBelongEnd: null, remarks: null, contractInvoiceIds: [], createBy: null, updateBy: null, createTime: null, updateTime: null, companyId: null, paymentType: null } |
| | | export default { |
| | | name: 'ContractPayment', |
| | | components: { pagination, crudOperation, rrOperation, udOperation, moneyInput }, |
| | | mixins: [presenter(), header(), form(defaultForm), crud()], |
| | | dicts: [constant.FUND_TYPE], |
| | | dicts: [constant.FUND_TYPE, constant.CONTRACR_TYPE_COST], |
| | | cruds() { |
| | | return CRUD({ title: '合同付款', url: 'api/contractPayment', idField: 'paymentId', sort: 'paymentId,desc', crudMethod: { ...crudContractPayment }}) |
| | | }, |
| | |
| | | ], |
| | | fundBelongEnd: [ |
| | | { required: true, message: '请选择款项结束日期', trigger: 'change' } |
| | | ], |
| | | companyId: [ |
| | | { required: true, message: '请选择所属公司', trigger: 'change' } |
| | | ], |
| | | paymentType: [ |
| | | { required: true, message: '请选择收支类型', trigger: 'change' } |
| | | ] |
| | | }, |
| | | queryTypeOptions: [ |
| | |
| | | // 发票数据 |
| | | contractInvoiceList: [], |
| | | // 当前合同信息 |
| | | currentContract: {} |
| | | currentContract: {}, |
| | | // 公司 |
| | | companyList: [], |
| | | // 字典:收支类型 |
| | | paymentType: constant.CONTRACR_TYPE_COST |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | if (this.$route.query.contractId != null && this.crud.query.contractId === undefined) { |
| | | this.$set(this.crud.query, 'contractId', Number(this.$route.query.contractId)) |
| | | } |
| | | // 获取公司数据 |
| | | crudSysCompany.getAll().then(res => { |
| | | this.companyList = res |
| | | }) |
| | | return true |
| | | }, |
| | | // 获取合同数据 |