Merge branch 'zhaoss' of http://192.168.1.110:5678/r/pms-upgrade into master
| | |
| | | */ |
| | | @Query(value = "SELECT SUM(after_tax_amount) AS totalAmount FROM contract_invoice WHERE contract_id = ?1",nativeQuery = true) |
| | | BigDecimal countTotalAmountByContractId(Long contractId); |
| | | |
| | | /** |
| | | * 根据合同ID删除 |
| | | * @param contractId |
| | | */ |
| | | void deleteByContractId(Long contractId); |
| | | } |
| | |
| | | */ |
| | | @Query(value = "SELECT SUM(payment_amount) AS totalAmount FROM contract_payment WHERE contract_id = ?1",nativeQuery = true) |
| | | BigDecimal countTotalAmountByContractId(Long contractId); |
| | | |
| | | /** |
| | | * 根据合同ID删除 |
| | | * @param contractId |
| | | */ |
| | | void deleteByContractId(Long contractId); |
| | | } |
| | |
| | | package me.zhengjie.modules.contract.service.impl; |
| | | |
| | | import me.zhengjie.modules.constant.Constant; |
| | | import me.zhengjie.modules.contract.domain.Contract; |
| | | import me.zhengjie.modules.contract.domain.ContractInvoice; |
| | | import me.zhengjie.modules.contract.domain.ContractInvoicePayment; |
| | | import me.zhengjie.modules.contract.repository.ContractInvoicePaymentRepository; |
| | |
| | | private final DictDetailRepository dictDetailRepository; |
| | | private final ContractInvoicePaymentRepository contractInvoicePaymentRepository; |
| | | private final ContractInvoicePaymentServiceImpl contractInvoicePaymentServiceImpl; |
| | | private final ContractServiceImpl contractServiceImpl; |
| | | private final ContractRepository contractRepository; |
| | | |
| | | @Override |
| | | public Map<String,Object> queryAll(ContractInvoiceQueryCriteria criteria, Pageable pageable){ |
| | |
| | | // DTO赋值 |
| | | contractInvoiceDto.setContractPaymentIds(contractPaymentIds); |
| | | // 查询合同数据 |
| | | ContractDto contractDto = contractServiceImpl.findById(t.getContractId()); |
| | | Contract contract = contractRepository.findById(t.getContractId()).orElseGet(Contract::new); |
| | | // DTO赋值 |
| | | contractInvoiceDto.setContractName(contractDto.getContractName()); |
| | | contractInvoiceDto.setContractName(contract.getContractName()); |
| | | // 返回处理好的DTO |
| | | return contractInvoiceDto; |
| | | } |
| | |
| | | public void download(List<ContractInvoiceDto> all, HttpServletResponse response) throws IOException { |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | for (ContractInvoiceDto contractInvoice : all) { |
| | | ContractDto contractDto = contractServiceImpl.findById(contractInvoice.getContractId()); |
| | | Contract contract = contractRepository.findById(contractInvoice.getContractId()).orElseGet(Contract::new); |
| | | String invoiceType = contractInvoice.getInvoiceType() != null ? dictDetailRepository.findByDictNameAndValue(Constant.INVOICE_TYPE, contractInvoice.getInvoiceType()).getLabel() : ""; |
| | | Map<String,Object> map = new LinkedHashMap<>(); |
| | | map.put("所属合同", contractDto.getContractName()); |
| | | map.put("所属合同", contract.getContractName()); |
| | | map.put("开票时间", contractInvoice.getBillingTime()); |
| | | map.put("发票类型", invoiceType); |
| | | map.put("税前金额", contractInvoice.getBeforeTaxAmount()); |
| | |
| | | // DTO赋值 |
| | | contractPaymentDto.setContractInvoiceIds(contractInvoiceIds); |
| | | // 查询合同数据 |
| | | ContractDto contractDto = contractServiceImpl.findById(t.getContractId()); |
| | | Contract contract = contractRepository.findById(t.getContractId()).orElseGet(Contract::new); |
| | | // DTO赋值 |
| | | contractPaymentDto.setContractName(contractDto.getContractName()); |
| | | contractPaymentDto.setContractName(contract.getContractName()); |
| | | // 返回处理好的DTO |
| | | return contractPaymentDto; |
| | | } |
| | |
| | | String fundBelongEnd = sdf.format(contractPayment.getFundBelongEnd()); |
| | | fundBelong = fundBelongStart.substring(0, 10) + " 至 " + fundBelongEnd.substring(0, 10) + " 服务费"; |
| | | } |
| | | ContractDto contractDto = contractServiceImpl.findById(contractPayment.getContractId()); |
| | | Contract contract = contractRepository.findById(contractPayment.getContractId()).orElseGet(Contract::new); |
| | | Map<String,Object> map = new LinkedHashMap<>(); |
| | | map.put("所属合同", contractDto.getContractName()); |
| | | map.put("所属合同", contract.getContractName()); |
| | | map.put("付款时间", contractPayment.getPaymentTime()); |
| | | map.put("款项类型", fundType); |
| | | map.put("付款金额", contractPayment.getPaymentAmount()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void deleteAll(Long[] ids) { |
| | | for (Long contractId : ids) { |
| | | contractRepository.deleteById(contractId); |
| | | contractInvoiceRepository.deleteByContractId(contractId); |
| | | contractPaymentRepository.deleteByContractId(contractId); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | private Long levelId; |
| | | |
| | | private String levelName; |
| | | |
| | | private String gender; |
| | | |
| | | private String avatarName; |
| | |
| | | |
| | | @Override |
| | | public List<UserDto> queryAll(UserQueryCriteria criteria) { |
| | | // 日历类 |
| | | Calendar calendar = Calendar.getInstance(); |
| | | // 日期格式化 |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | // 日历字符串 |
| | | String calendarStr = sdf.format(calendar.getTime()); |
| | | // 查询用户数据 |
| | | List<User> users = userRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder)); |
| | | return userMapper.toDto(users); |
| | | List<UserDto> usersDto = userMapper.toDto(users); |
| | | // 循环用户 |
| | | for (int i= 0; i < usersDto.size(); i ++) { |
| | | // 根据用户ID、指定年月查询用户级别工资 |
| | | SysUserLevelWage sysUserLevelWage = sysUserLevelWageRepository.findTargetYearMonth(usersDto.get(i).getId(), calendarStr); |
| | | // 判断用户级别工资是否为空 |
| | | if (sysUserLevelWage != null) { |
| | | // 根据ID查询用户级别 |
| | | SysLevel sysLevel = sysLevelRepository.findById(sysUserLevelWage.getLevelId()).orElseGet(SysLevel::new); |
| | | // 用户 |
| | | usersDto.get(i).setLevelName(sysLevel.getName()); |
| | | } else { |
| | | // 用户 |
| | | usersDto.get(i).setLevelName(null); |
| | | } |
| | | } |
| | | return usersDto; |
| | | } |
| | | |
| | | @Override |
| | |
| | | taskUserService.deleteAll(ids); |
| | | return new ResponseEntity<>(HttpStatus.OK); |
| | | } |
| | | |
| | | @GetMapping(value = "/taskUserIds") |
| | | @Log("查询任务分配用户") |
| | | @ApiOperation("查询任务分配用户") |
| | | @PreAuthorize("@el.check('taskUser:list')") |
| | | public ResponseEntity<Object> queryTaskUserIds(TaskUserQueryCriteria criteria){ |
| | | return new ResponseEntity<>(taskUserService.queryTaskUserIds(criteria),HttpStatus.OK); |
| | | } |
| | | } |
| | |
| | | * @return TaskUserDto |
| | | */ |
| | | void divide(TaskUserDto resources); |
| | | |
| | | /** |
| | | * 查询任务分配用户 |
| | | * @param criteria |
| | | * @return |
| | | */ |
| | | List<Long> queryTaskUserIds(TaskUserQueryCriteria criteria); |
| | | } |
| | |
| | | taskUserRepository.save(taskUser); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<Long> queryTaskUserIds(TaskUserQueryCriteria criteria){ |
| | | return taskUserRepository.findUserIdByTaskId(criteria.getTaskId()); |
| | | } |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | export default { getAll, add, edit, del } |
| | | export function getTaskUserIds(params) { |
| | | return request({ |
| | | url: 'api/taskUser/taskUserIds', |
| | | method: 'get', |
| | | params |
| | | }) |
| | | } |
| | | |
| | | export default { getAll, add, edit, del, getTaskUserIds } |
| | |
| | | if (cents < 10) { cents = '0' + cents } |
| | | for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3); i++) { num = num.substring(0, num.length - (4 * i + 3)) + ',' + num.substring(num.length - (4 * i + 3)) } |
| | | return (((sign) ? '' : '-') + num + '.' + cents) |
| | | }, |
| | | /** |
| | | * 最大两位小数格式 |
| | | * @param {Object} num |
| | | */ |
| | | toMaxTwoDecimalPlaces(num) { |
| | | const numList = num.toString().split('.') |
| | | num = numList.length > 1 ? numList[1].length > 1 ? num.toFixed(2) : num : num |
| | | return num |
| | | } |
| | | } |
| | | const crud = Object.assign({}, data) |
| | |
| | | data() { |
| | | // 指针重指向 |
| | | const _this = this |
| | | // 时长(千内)验证 |
| | | // 时长(万内)验证 |
| | | var durationValidate = (rule, value, callback) => { |
| | | const reg = /^([0-9]|[1-9]\d{1,2})(\.\d{1,2})?$|1000$/ |
| | | const reg = /^([0-9]|[1-9]\d{1,3})(\.\d{1,2})?$/ |
| | | if (value != null && value !== '' && !reg.test(value)) { |
| | | callback(new Error('请输入 一千 以内的正整数或两位小数')) |
| | | callback(new Error('请输入 一万 以内的正整数或两位小数')) |
| | | } else { |
| | | callback() |
| | | } |
| | |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | :disabled="item.approveStatus == approveStatusUnrecognized" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | <el-table-column :show-overflow-tooltip="true" prop="planEndTime" label="计划结束时间" width="140" /> |
| | | <el-table-column :show-overflow-tooltip="true" label="已完成 / 已分配 / 计划工时" width="160"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.completedHours }} / {{ scope.row.divideHours }} / {{ scope.row.planHours }} |
| | | {{ crud.toMaxTwoDecimalPlaces(scope.row.completedHours) }} / {{ scope.row.divideHours }} / {{ scope.row.planHours }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" label="已完成 / 已分配 / 计划工作量" width="180"> |
| | | <template slot-scope="scope"> |
| | | <span> |
| | | {{ scope.row.completedWorkload }} / {{ scope.row.divideWorkload }} / {{ scope.row.planWorkload == null || scope.row.planWorkload == '' ? 0 : scope.row.planWorkload }} |
| | | {{ crud.toMaxTwoDecimalPlaces(scope.row.completedWorkload) }} / {{ scope.row.divideWorkload }} / {{ scope.row.planWorkload == null || scope.row.planWorkload == '' ? 0 : scope.row.planWorkload }} |
| | | </span> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <el-form-item label="任务名称" prop="taskName"> |
| | | {{ divideForm.taskName }} |
| | | </el-form-item> |
| | | <el-form-item label="分配用户" prop="userIds"> |
| | | <el-form-item label="分配员工" prop="userIds"> |
| | | <el-select v-model="divideForm.userIds" filterable clearable multiple placeholder="请选择" style="width: 340px;"> |
| | | <el-option |
| | | v-for="item in users" |
| | |
| | | :label="item.nickName" |
| | | :value="item.id" |
| | | :disabled="!item.enabled || divideForm.divideUserIds.includes(item.id)" |
| | | /> |
| | | > |
| | | <span style="float: left">{{ item.nickName }}</span> |
| | | <span style="float: right; color: #8492a6; font-size: 13px">{{ item.levelName }}</span> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="任务开始时间" prop="taskStartDate"> |
| | |
| | | data() { |
| | | // 指针重指向 |
| | | const _this = this |
| | | // 时长(千内)验证 |
| | | // 时长(万内)验证 |
| | | var durationValidate = (rule, value, callback) => { |
| | | const reg = /^([0-9]|[1-9]\d{1,2})(\.\d{1,2})?$|1000$/ |
| | | const reg = /^([0-9]|[1-9]\d{1,3})(\.\d{1,2})?$/ |
| | | if (value != null && value !== '' && !reg.test(value)) { |
| | | callback(new Error('请输入 一千 以内的正整数或两位小数')) |
| | | callback(new Error('请输入 一万 以内的正整数或两位小数')) |
| | | } else { |
| | | callback() |
| | | } |
| | |
| | | standardWorkloadUnit: constant.STANDARD_WORKLOAD_UNIT, |
| | | // 字典:任务状态 |
| | | taskStatus: constant.TASK_STATUS, |
| | | // 字典:批准状态-未承认 |
| | | approveStatusUnrecognized: constant.APPROVE_STATUS_UNRECOGNIZED, |
| | | // CRUD状态 |
| | | crudStatusPrepared: CRUD.STATUS.PREPARED, |
| | | // 项目列表 |
| | |
| | | // 分配表单验证 |
| | | divideRules: { |
| | | userIds: [ |
| | | { required: true, message: '分配用户不能为空', trigger: 'change' } |
| | | { required: true, message: '分配员工不能为空', trigger: 'change' } |
| | | ], |
| | | taskStartDate: [ |
| | | { required: true, message: '任务开始时间不能为空', trigger: 'change' } |
| | |
| | | return CRUD({ title: '任务日报', url: 'api/taskDaliy', idField: 'id', sort: 'fillDate,desc', crudMethod: { ...crudTaskDaliy }}) |
| | | }, |
| | | data() { |
| | | // 时长(千内)验证 |
| | | // 时长(万内)验证 |
| | | var durationValidate = (rule, value, callback) => { |
| | | const reg = /^([0-9]|[1-9]\d{1,2})(\.\d{1,2})?$|1000$/ |
| | | const reg = /^([0-9]|[1-9]\d{1,3})(\.\d{1,2})?$/ |
| | | if (value != null && value !== '' && !reg.test(value)) { |
| | | callback(new Error('请输入 一千 以内的正整数或两位小数')) |
| | | callback(new Error('请输入 一万 以内的正整数或两位小数')) |
| | | } else { |
| | | callback() |
| | | } |
| | |
| | | <div class="head-container"> |
| | | <div v-if="crud.props.searchToggle"> |
| | | <!-- 搜索 --> |
| | | <el-select v-model="query.userId" filterable clearable placeholder="所属员工" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery"> |
| | | <el-option |
| | | v-for="item in users" |
| | | :key="item.id" |
| | | :label="item.nickName" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | <el-select v-model="query.projectId" filterable clearable placeholder="所属项目" style="width: 185px;" class="filter-item" @change="queryProjectChange" @keyup.enter.native="crud.toQuery"> |
| | | <el-option |
| | | v-for="item in projects" |
| | |
| | | v-for="item in queryTasks" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | <el-select v-model="query.userId" filterable clearable placeholder="所属员工" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery"> |
| | | <el-option |
| | | v-for="item in users" |
| | | :key="item.id" |
| | | :label="item.nickName" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | |
| | | <!--表单组件--> |
| | | <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px"> |
| | | <el-form ref="form" :model="form" :rules="rules" size="small" label-width="110px"> |
| | | <el-form-item label="所属员工" prop="userId"> |
| | | <el-select v-model="form.userId" filterable clearable placeholder="请选择" style="width: 340px;" :disabled="crud.status.edit == crudStatusPrepared || userRolesLevelMin == roleLevelOrdinary"> |
| | | <el-option |
| | | v-for="item in users" |
| | | :key="item.id" |
| | | :label="item.nickName" |
| | | :value="item.id" |
| | | :disabled="!item.enabled" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="所属项目" prop="projectId"> |
| | | <el-select v-model="form.projectId" filterable clearable placeholder="请选择" style="width: 340px;" :disabled="crud.status.edit == crudStatusPrepared || userRolesLevelMin == roleLevelOrdinary" @change="formProjectChange"> |
| | | <el-option |
| | |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | :disabled="item.approveStatus == approveStatusUnrecognized" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | :label="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="所属员工" prop="userId"> |
| | | <el-select v-model="form.userId" filterable clearable placeholder="请选择" style="width: 340px;" :disabled="crud.status.edit == crudStatusPrepared || userRolesLevelMin == roleLevelOrdinary"> |
| | | <el-option |
| | | v-for="item in users" |
| | | :key="item.id" |
| | | :label="item.nickName" |
| | | :value="item.id" |
| | | :disabled="!item.enabled || form.divideUserIds.includes(item.id)" |
| | | > |
| | | <span style="float: left">{{ item.nickName }}</span> |
| | | <span style="float: right; color: #8492a6; font-size: 13px">{{ item.levelName }}</span> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="任务开始时间" prop="taskStartDate"> |
| | |
| | | <!--表格渲染--> |
| | | <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler"> |
| | | <el-table-column type="selection" width="55" /> |
| | | <el-table-column :show-overflow-tooltip="true" prop="userNickName" label="所属员工" fixed="left" width="100"> |
| | | <el-table-column :show-overflow-tooltip="true" prop="projectName" label="所属项目" fixed="left" width="140"> |
| | | <template slot-scope="scope"> |
| | | <el-tag>{{ scope.row.userNickName }}</el-tag> |
| | | <el-tag>{{ scope.row.projectName }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="taskName" label="所属任务" fixed="left" width="180"> |
| | |
| | | <el-tag>{{ scope.row.taskName }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="projectName" label="所属项目" width="140"> |
| | | <el-table-column :show-overflow-tooltip="true" prop="userNickName" label="所属员工" width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-tag>{{ scope.row.projectName }}</el-tag> |
| | | <el-tag>{{ scope.row.userNickName }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="taskStartDate" label="任务开始时间" width="140" /> |
| | |
| | | import crudTask from '@/api/task/task' |
| | | import crudUser from '@/api/system/user' |
| | | |
| | | const defaultForm = { id: null, userId: null, projectId: null, taskId: null, taskStartDate: null, taskEndDate: null, taskHours: null, taskWorkload: null, taskStatus: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null } |
| | | const defaultForm = { id: null, userId: null, projectId: null, taskId: null, taskStartDate: null, taskEndDate: null, taskHours: null, taskWorkload: null, taskStatus: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null, divideUserIds: [] } |
| | | export default { |
| | | name: 'TaskUser', |
| | | components: { pagination, crudOperation, rrOperation, udOperation }, |
| | |
| | | data() { |
| | | // 指针重指向 |
| | | const _this = this |
| | | // 时长(千内)验证 |
| | | // 时长(万内)验证 |
| | | var durationValidate = (rule, value, callback) => { |
| | | const reg = /^([0-9]|[1-9]\d{1,2})(\.\d{1,2})?$|1000$/ |
| | | const reg = /^([0-9]|[1-9]\d{1,3})(\.\d{1,2})?$/ |
| | | if (value != null && value !== '' && !reg.test(value)) { |
| | | callback(new Error('请输入 一千 以内的正整数或两位小数')) |
| | | callback(new Error('请输入 一万 以内的正整数或两位小数')) |
| | | } else { |
| | | callback() |
| | | } |
| | |
| | | download: ['admin', 'taskUser:download'] |
| | | }, |
| | | rules: { |
| | | userId: [ |
| | | { required: true, message: '所属员工不能为空', trigger: 'change' } |
| | | ], |
| | | projectId: [ |
| | | { required: true, message: '所属项目不能为空', trigger: 'change' } |
| | | ], |
| | | taskId: [ |
| | | { required: true, message: '所属任务不能为空', trigger: 'change' } |
| | | ], |
| | | userId: [ |
| | | { required: true, message: '所属员工不能为空', trigger: 'change' } |
| | | ], |
| | | taskStartDate: [ |
| | | { required: true, message: '任务开始时间不能为空', trigger: 'change' } |
| | |
| | | ] |
| | | }, |
| | | queryTypeOptions: [ |
| | | { key: 'userId', display_name: '所属员工' }, |
| | | { key: 'projectId', display_name: '所属项目' }, |
| | | { key: 'taskId', display_name: '所属任务' }, |
| | | { key: 'userId', display_name: '所属员工' }, |
| | | { key: 'taskStatus', display_name: '任务状态' } |
| | | ], |
| | | // 任务开始时间选项 |
| | |
| | | taskStatus: constant.TASK_STATUS, |
| | | // 字典:标准工作量单位 |
| | | standardWorkloadUnit: constant.STANDARD_WORKLOAD_UNIT, |
| | | // 字典:批准状态-未承认 |
| | | approveStatusUnrecognized: constant.APPROVE_STATUS_UNRECOGNIZED, |
| | | // 角色级别:普通用户 |
| | | roleLevelOrdinary: constant.ROLE_LEVEL_ORDINARY, |
| | | // CRUD状态 |
| | |
| | | if (this.formTasks[i].id === this.form.taskId) { |
| | | // 表单赋值 |
| | | this.form.taskWorkloadUnit = this.formTasks[i].planWorkloadUnit |
| | | return |
| | | break |
| | | } |
| | | // 判断循环是否结束 |
| | | if (i === this.formTasks.length - 1) { |
| | |
| | | this.form.taskWorkloadUnit = null |
| | | } |
| | | } |
| | | // 判断是否是否是新增 |
| | | if (this.crud.status.add === CRUD.STATUS.PREPARED) { |
| | | // 表单赋值 |
| | | this.form.userId = null |
| | | } |
| | | // 查询任务分配用户 |
| | | crudTaskUser.getTaskUserIds({ taskId: this.form.taskId }).then(res => { |
| | | // 表单赋值 |
| | | this.form.divideUserIds = res |
| | | }) |
| | | } |
| | | } |
| | | } |