feature: 功能调整

This commit is contained in:
曹鹏飞 2024-12-03 08:43:12 +08:00
parent 9bb2b7a28f
commit 0311b76a17
4 changed files with 16 additions and 15 deletions

View File

@ -1,7 +1,6 @@
package com.nflg.product.technology; package com.nflg.product.technology;
import com.mzt.logapi.starter.annotation.EnableLogRecord; import com.mzt.logapi.starter.annotation.EnableLogRecord;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

View File

@ -32,41 +32,41 @@ public class VirtualWorkingEntity extends EntityBase implements Serializable {
@TableField(value = "hourly_auxiliary_fee") @TableField(value = "hourly_auxiliary_fee")
@ApiModelProperty(value = "每小时辅助费用") @ApiModelProperty(value = "每小时辅助费用")
private BigDecimal hourlyAuxiliaryFee; private BigDecimal hourlyAuxiliaryFee = BigDecimal.ZERO;
@TableField(value = "user_num") @TableField(value = "user_num")
@ApiModelProperty(value = "本车间一线人数") @ApiModelProperty(value = "本车间一线人数")
private Integer userNum; private Integer userNum = 0;
@TableField(value = "workshop_total_fee") @TableField(value = "workshop_total_fee")
@ApiModelProperty(value = "年度总费用") @ApiModelProperty(value = "年度总费用")
private BigDecimal workshopTotalFee; private BigDecimal workshopTotalFee = BigDecimal.ZERO;
@TableField(value = "consumables_fee") @TableField(value = "consumables_fee")
@ApiModelProperty(value = "水电费、生产耗材费用") @ApiModelProperty(value = "水电费、生产耗材费用")
private BigDecimal consumablesFee; private BigDecimal consumablesFee = BigDecimal.ZERO;
@TableField(value = "equipment_depreciation_fee") @TableField(value = "equipment_depreciation_fee")
@ApiModelProperty("设备折旧") @ApiModelProperty("设备折旧")
private BigDecimal equipmentDepreciationFee; private BigDecimal equipmentDepreciationFee = BigDecimal.ZERO;
@TableField(value = "workshop_labor_fee") @TableField(value = "workshop_labor_fee")
@ApiModelProperty("车间管理人工费") @ApiModelProperty("车间管理人工费")
private BigDecimal workshopLaborFee; private BigDecimal workshopLaborFee = BigDecimal.ZERO;
@TableField(value = "workshop_office_fee") @TableField(value = "workshop_office_fee")
@ApiModelProperty("车间办公室费用") @ApiModelProperty("车间办公室费用")
private BigDecimal workshopOfficeFee; private BigDecimal workshopOfficeFee = BigDecimal.ZERO;
@TableField(value = "assistant_total_fee") @TableField(value = "assistant_total_fee")
@ApiModelProperty("辅助部门年度总费用") @ApiModelProperty("辅助部门年度总费用")
private BigDecimal assistantTotalFee; private BigDecimal assistantTotalFee = BigDecimal.ZERO;
@TableField(value = "assistant_labor_fee") @TableField(value = "assistant_labor_fee")
@ApiModelProperty("辅助部门人工费") @ApiModelProperty("辅助部门人工费")
private BigDecimal assistantLaborFee; private BigDecimal assistantLaborFee = BigDecimal.ZERO;
@TableField(value = "assistant_fee") @TableField(value = "assistant_fee")
@ApiModelProperty("辅助部门费用") @ApiModelProperty("辅助部门费用")
private BigDecimal assistantFee; private BigDecimal assistantFee = BigDecimal.ZERO;
} }

View File

@ -97,6 +97,7 @@ public class CostConfigService {
configs.put(TechnologyConfigEnum.THEORETICAL_DAILY_WORKING_HOURS.getValue(), BigDecimal.valueOf(query.getDailyHours())); configs.put(TechnologyConfigEnum.THEORETICAL_DAILY_WORKING_HOURS.getValue(), BigDecimal.valueOf(query.getDailyHours()));
configs.put(TechnologyConfigEnum.THEORETICAL_WORKING_DAYS_PER_MONTH.getValue(), BigDecimal.valueOf(query.getMonthlyWorkingDays())); configs.put(TechnologyConfigEnum.THEORETICAL_WORKING_DAYS_PER_MONTH.getValue(), BigDecimal.valueOf(query.getMonthlyWorkingDays()));
configs.put(TechnologyConfigEnum.CORRECTION_FACTOR.getValue(), query.getCorrectionFactor()); configs.put(TechnologyConfigEnum.CORRECTION_FACTOR.getValue(), query.getCorrectionFactor());
configs.put(TechnologyConfigEnum.MONTHLY_THEORETICAL_FULL_LOAD_WORKING_HOURS.getValue(), query.getMonthlyWorkingHours());
technologyConfigService.save(configs); technologyConfigService.save(configs);
} }
@ -106,6 +107,7 @@ public class CostConfigService {
vo.setDailyHours(BigDecimalUtil.toInteger(technologyConfigService.getTheoreticalDailyWorkingHours())); vo.setDailyHours(BigDecimalUtil.toInteger(technologyConfigService.getTheoreticalDailyWorkingHours()));
vo.setMonthlyWorkingDays(BigDecimalUtil.toInteger(technologyConfigService.getTheoreticalWorkingDaysPerMonth())); vo.setMonthlyWorkingDays(BigDecimalUtil.toInteger(technologyConfigService.getTheoreticalWorkingDaysPerMonth()));
vo.setCorrectionFactor(technologyConfigService.getCorrectionFactor()); vo.setCorrectionFactor(technologyConfigService.getCorrectionFactor());
vo.setMonthlyWorkingHours(technologyConfigService.getMonthlyTheoreticalFullLoadWorkingHours());
return vo; return vo;
} }

View File

@ -1,7 +1,6 @@
package com.nflg.product.technology.service; package com.nflg.product.technology.service;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.NumberUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nflg.product.base.core.conmon.util.SessionUtil; import com.nflg.product.base.core.conmon.util.SessionUtil;
import com.nflg.product.technology.constant.TechnologyConfigEnum; import com.nflg.product.technology.constant.TechnologyConfigEnum;
@ -110,10 +109,11 @@ public class TechnologyConfigService extends ServiceImpl<TechnologyConfigMapper,
} }
public BigDecimal getMonthlyTheoreticalFullLoadWorkingHours() { public BigDecimal getMonthlyTheoreticalFullLoadWorkingHours() {
if (Objects.isNull(getUserNum()) || Objects.isNull(getTheoreticalDailyWorkingHours()) TechnologyConfigEntity entity = lambdaQuery().eq(TechnologyConfigEntity::getCode, TechnologyConfigEnum.MONTHLY_THEORETICAL_FULL_LOAD_WORKING_HOURS.getValue()).one();
|| Objects.isNull(getTheoreticalWorkingDaysPerMonth()) || Objects.isNull(getCorrectionFactor())) { if (Objects.isNull(entity)) {
return null; return null;
} else {
return entity.getValue();
} }
return NumberUtil.mul(getUserNum(), getTheoreticalDailyWorkingHours(), getTheoreticalWorkingDaysPerMonth(), getCorrectionFactor());
} }
} }