Commit 196ebb65 authored by hongguangwu's avatar hongguangwu

预估优化

parent 90ff8965
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.DecimalMax;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* 部门结算信息表
*
* @author wangan
* @date 2019-08-09 12:24:14
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_depart_settlement_info")
@Schema(description = "部门结算信息表")
public class TDepartSettlementInfo extends Model<TDepartSettlementInfo> {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键", name = "id")
private String id;
/**
* 社保卡收取 单位 个人
*/
@Length(max = 1, message = "社保卡收取不能超过1个字符")
@ExcelAttribute(name = "社保卡收取", maxLength = 1)
@Schema(description = "社保卡收取", name = "socialCardTaker")
private String socialCardTaker;
/**
* 岗位
*/
@Length(max = 32, message = "岗位不能超过32个字符")
@ExcelAttribute(name = "岗位", maxLength = 32)
@Schema(description = "岗位", name = "station")
private String station;
/**
* 管理费是否收费(0收费/1不收费)
*/
@Length(max = 1, message = "管理费是否收费(0收费/1不收费)不能超过1个字符")
@ExcelAttribute(name = "管理费是否收费(0收费/1不收费)", maxLength = 1)
@Schema(description = "管理费是否收费(0收费/1不收费)", name = "managementTag")
private String managementTag;
/**
* 管理费收取项目 如:应发工资 单位社保 单位公积金 商险 单位社保卡费 单位代扣 其他费用1 其他费用2 其他费用3
*/
@Length(max = 255, message = "管理费收取项目不能超过255个字符")
@ExcelAttribute(name = "管理费收取项目")
@Schema(description = "管理费收取项目", name = "managementTag")
private String manageServerItem;
/**
* 风险金收取项目
*/
@Length(max = 255, message = "风险金收取项目不能超过255个字符")
@ExcelAttribute(name = "风险金收取项目")
@Schema(description = "风险金收取项目", name = "riskServerItem")
private String riskServerItem;
/**
* 管理费费率/管理费金额
*/
@DecimalMax(value = "999999.999", message = "管理费费率(管理费金额)不能大于999999.999")
@ExcelAttribute(name = "管理费费率/管理费金额")
@Schema(description = "管理费费率/管理费金额", name = "managementFee")
private BigDecimal managementFee;
/**
* 管理费收费类型 按固定值 按比例
*/
@Length(max = 32, message = "管理费收费类型不能超过32个字符")
@ExcelAttribute(name = "管理费收费类型", maxLength = 32)
@Schema(description = "管理费收费类型(0:固定;1:比例)", name = "managementType")
private String managementType;
/**
* 风险金是否收取
*/
@Length(max = 1, message = "风险金是否收取不能超过1个字符")
@ExcelAttribute(name = "风险金是否收取", maxLength = 1)
@Schema(description = "风险金是否收取(0收费/1不收费)", name = "riskFundTag")
private String riskFundTag;
/**
* 风险金收取费用/税率
*/
@DecimalMax(value = "9999999.99", message = "风险金收取费用/税率不能大于9999999.99")
@ExcelAttribute(name = "风险金收取费用/税率")
@Schema(description = "风险金收取费用/税率", name = "riskFundFee")
private BigDecimal riskFundFee;
/**
* 风险金收取方式
*/
@Length(max = 32, message = "风险金收取方式不能超过32个字符")
@ExcelAttribute(name = "风险金收取方式", maxLength = 32)
@Schema(description = "风险金收取方式(0:固定;1:比例)", name = "riskFundType")
private String riskFundType;
/**
* 缴税类型(交税类型) 增值税-专票 增值税-普票 差额纳税-专票 差额纳税-普票
*/
@Length(max = 32, message = "缴税类型不能超过32个字符")
@ExcelAttribute(name = "缴税类型", maxLength = 32)
@Schema(description = "缴税类型", name = "taxType")
private String taxType;
/**
* 风险金税收类型
*/
@Length(max = 1, message = "风险金税收类型不能超过1个字符")
@ExcelAttribute(name = "风险金税收类型", maxLength = 1)
@Schema(description = "风险金税收类型(0:税前;1:税后(需要计算))", name = "riskFundTaxTag")
private String riskFundTaxTag;
/**
* 管理费税收类型 1含税 0不含税
*/
@Length(max = 1, message = "管理费税收类型不能超过1个字符")
@ExcelAttribute(name = "管理费税收类型", maxLength = 1)
@Schema(description = "管理费税收类型(0:税前;1:税后(需要计算))", name = "managementTaxTag")
private String managementTaxTag;
/**
* 单位大病比例
*/
@ExcelAttribute(name = "单位大病比例")
@DecimalMax(value = "100.00", message = "单位大病比例不能大于100.00")
@Schema(description = "单位大病比例", name = "unitSeriousIllnessProp")
private BigDecimal unitSeriousIllnessProp;
/**
* 创建人
*/
@Length(max = 32, message = "创建人不能超过32个字符")
@ExcelAttribute(name = "创建人", maxLength = 32)
@Schema(description = "创建人", name = "createUser")
private String createUser;
/**
* 创建时间
*/
@ExcelAttribute(name = "创建时间")
@Schema(description = "创建时间", name = "createTime")
private LocalDateTime createTime;
/**
* 最后更新人
*/
@Length(max = 32, message = "最后更新人不能超过32个字符")
@ExcelAttribute(name = "最后更新人", maxLength = 32)
@Schema(description = "最后更新人", name = "lastUpdateUser")
private String lastUpdateUser;
/**
* 最后更新时间
*/
@ExcelAttribute(name = "最后更新时间")
@Schema(description = "最后更新时间", name = "lastUpdateTime")
private LocalDateTime lastUpdateTime;
/**
* 结算主体ID
*/
@Length(max = 32, message = "结算主体ID不能超过32个字符")
@ExcelAttribute(name = "结算主体ID", maxLength = 32)
@Schema(description = "结算主体ID", name = "settleId")
private String settleId;
/**
* 缴税税率
*/
@DecimalMax(value = "99.99", message = "缴税税率不能大于99.99")
@ExcelAttribute(name = "缴税税率")
@Schema(description = "缴税税率", name = "taxFee")
private BigDecimal taxFee;
/**
* 管理费是否扣税
* 0是/1否
*
* @Author pwang
* @Date 2020-04-26 9:38
* @param null
* @return
**/
@Length(max = 1, message = "管理费是否扣税字段不能超过1个字符")
@Schema(description = "管理费是否扣税")
private String managementExpFlag;
}
......@@ -23,4 +23,8 @@ public class TSettleDomainSelectVo extends TSettleDomain implements Serializable
*/
private String industryBelong;
//页面名称:商务主体 ————(归属服务公司名称 (商务主体(乙方)名称))
// 薪资用到,作为封面抬头
private String businessSubjectName;
}
......@@ -160,7 +160,7 @@ public class TForecastLibraryController {
@Operation(summary = "每日定时刷新社保公积金信息、预估数据,根据新增的户数据", description = "每日定时刷新社保公积金信息、预估数据,根据新增的户数据")
@SysLog("每日定时刷新社保公积金信息、预估数据,根据新增的户数据")
@Inner
@GetMapping("/inner/updateForecastLibaryBySysBase")
@PostMapping("/inner/updateForecastLibaryBySysBase")
public void updateForecastLibaryBySysBase() {
tForecastLibraryService.updateForecastLibaryBySysBase(null);
}
......@@ -174,7 +174,7 @@ public class TForecastLibraryController {
@Operation(summary = "每月定时生成下月预估库数据", description = "每月定时生成下月预估库数据")
@SysLog("每月定时生成下月预估库数据")
@Inner
@GetMapping("/inner/everyMonthCreateForecastLibary")
@PostMapping("/inner/everyMonthCreateForecastLibary")
public void everyMonthCreateForecastLibary() {
tForecastLibraryService.everyMonthCreateForecastLibary();
}
......
......@@ -97,7 +97,7 @@ public interface TForecastLibraryService extends IService<TForecastLibrary> {
void updateForecastLibaryBySysBase(SysBaseSetInfo newSysBaseSetInfo);
/**
* @Description: 每月定时预估库 TODO-加定时器
* @Description: 每月定时预估库
* @Author: hgw
* @Date: 2022/7/26 19:09
* @return: void
......
......@@ -27,6 +27,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.social.constants.SocialConstants;
import com.yifu.cloud.plus.v1.yifu.social.entity.SysBaseSetInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TAgentConfig;
......@@ -1646,6 +1648,9 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
monthDiff = DateUtil.getMonthDiff(minStartDate, new Date()) + 2;
}
List<String> payMonthList = new ArrayList<>();
if (monthDiff <= 0) {
return R.failed("同步预估库,起缴月份无法生成,monthDiff=" + monthDiff);
}
for (int i = 0; i < monthDiff; i++) {
payMonthList.add(DateUtil.addMonth(1 - i));
}
......@@ -1724,16 +1729,27 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
, fundHistoryMap, socialPushMap, fundPushMap, saveLibraryMap, isReduceSocial, isReduceFund);
if (coreR != null) return coreR;
boolean isSaveAndUpdate = false;
YifuUser user = SecurityUtils.getUser();
String userId = "305";
String userName = "系统";
if (user != null) {
userId = user.getId();
userName = user.getNickname();
}
for (TForecastLibrary library : saveLibraryMap.values()) {
if (Common.isEmpty(library.getSocialId()) && Common.isEmpty(library.getProvidentId())) {
continue;
}
if (Common.isNotNull(library.getId())) {
library.setUpdateBy(userId);
library.setUpdateTime(LocalDateTime.now());
baseMapper.updateById(library);
isSaveAndUpdate = true;
} else {
if (BigDecimal.ZERO.compareTo(BigDecimalUtils.isNullToZero(library.getUnitSocialSum())) != CommonConstants.ZERO_INT
|| BigDecimal.ZERO.compareTo(BigDecimalUtils.isNullToZero(library.getUnitFundSum())) != CommonConstants.ZERO_INT) {
library.setCreateBy(userId);
library.setCreateName(userName);
library.setCreateTime(LocalDateTime.now());
baseMapper.insert(library);
isSaveAndUpdate = true;
......@@ -2010,8 +2026,12 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
continue;
}
if (Common.isNotNull(library.getId())) {
library.setUpdateBy("305");
library.setUpdateTime(LocalDateTime.now());
baseMapper.updateById(library);
} else {
library.setCreateBy("305");
library.setCreateName("定时生成");
library.setCreateTime(LocalDateTime.now());
baseMapper.insert(library);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment