| | |
| | | @ApiModelProperty(value = "企微关联项目名称")
|
| | | private String wecomProjectName;
|
| | |
|
| | | @Column(name = "`wecom_category_name`")
|
| | | @ApiModelProperty(value = "企微出差类别名称")
|
| | | private String wecomCategoryName;
|
| | |
|
| | | public void copy(AttendanceBusinessTravel source){
|
| | | BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
| | | }
|
| | |
| | | // 判断是否提交企微审批 |
| | | List<DictDetail> siteTypes = dictDetailRepository.findByDictName(Constant.APPROVAL_SITE_TYPE).stream().filter(siteType -> siteType.getValue().toLowerCase().equals("wecom")).collect(Collectors.toList()); |
| | | if (siteTypes.size() > 0) { |
| | | Map<String, String> categoryNameMap = dictDetailRepository.findByDictName(Constant.ATTENDANCE_BUSINESS_TRAVEL_CATEGORY).stream().collect(Collectors.toMap(DictDetail::getValue, DictDetail::getLabel)); |
| | | // 添加企微申请参数 |
| | | attendanceBusinessTravel.setWecomProjectName(project.getName()); |
| | | attendanceBusinessTravel.setWecomCategoryName(categoryNameMap.get(resources.getCategory())); |
| | | attendanceBusinessTravel.setWecomLocation(String.format("%s -至- %s", Optional.ofNullable(attendanceBusinessTravel.getDepartureCity()).orElse("出发城市"), Optional.ofNullable(attendanceBusinessTravel.getArrivalCity()).orElse("到达城市"))); |
| | | attendanceBusinessTravel.setWecomDateType(ElAdminConstant.Constant.TEMPLATE_DATE_TYPE_HALFDAY); |
| | | attendanceBusinessTravel.setWecomDuration(String.valueOf(new BigDecimal(attendanceBusinessTravel.getTravelDuration()).multiply(new BigDecimal(86400)).longValue())); |
| | |
| | | Long result = resultParts.stream()
|
| | | .mapToLong(calculate -> ChronoUnit.MINUTES.between(calculate.getStart(), calculate.getEnd()))
|
| | | .sum();
|
| | | // 加班时长不足0.5小时的部分不计入加班统计。
|
| | | long halfHour = result / 30;
|
| | | return BigDecimal.valueOf(halfHour).multiply(BigDecimal.valueOf(0.5));
|
| | | }).reduce(BigDecimal::add).get().doubleValue();
|
| | |
| | | this.form.travelEndTime = data.travelEndTime |
| | | this.form.departureCity = data.departureCity |
| | | this.form.arrivalCity = data.arrivalCity |
| | | this.form.cagtegory = data.category |
| | | this.form.category = data.category |
| | | this.form.travelDuration = data.travelDuration |
| | | this.form.durationUnit = data.durationUnit |
| | | this.form.approvalStatus = data.approvalStatus |