Commit d0022ad9 authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/develop' into develop

parents 5f8720d8 a7bfb97c
...@@ -22,11 +22,13 @@ spring: ...@@ -22,11 +22,13 @@ spring:
username: ${spring.datasource.username} username: ${spring.datasource.username}
password: ${spring.datasource.password} password: ${spring.datasource.password}
pool-name: AmytangHikariCP pool-name: AmytangHikariCP
connection-timeout: 600000 #最大超时时间
minimum-idle: 10 # 最小空闲连接数量 minimum-idle: 10 # 最小空闲连接数量
idle-timeout: 60000 # 空闲连接存活最大时间,默认600000(10分钟) validation-timeout: 3000 #此属性控制测试连接是否活跃的最长时间。此值必须小于 connectionTimeout
maximum-pool-size: 12 # 连接池最大连接数,默认是10 idle-timeout: 60000 # 空闲连接存活最大时间,默认600000(10分钟)此属性控制允许连接在池中处于空闲状态的最长时间
maximum-pool-size: 20 # 连接池最大连接数,默认是10
auto-commit: true #此属性控制从池返回的连接的默认自动提交行为,默认值:true auto-commit: true #此属性控制从池返回的连接的默认自动提交行为,默认值:true
max-lifetime: 0 #此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟 max-lifetime: 1800000 #此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟
## spring security 配置 ## spring security 配置
security: security:
......
...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableId; ...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model; import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data; import lombok.Data;
...@@ -27,7 +28,7 @@ import java.io.Serializable; ...@@ -27,7 +28,7 @@ import java.io.Serializable;
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@TableName("t_config_salary") @TableName("t_config_salary")
@Tag(name="薪资配置-普通薪资配置") @Tag(name="薪资配置-普通薪资配置")
public class TConfigSalary extends Model<TConfigSalary> implements Serializable { public class TConfigSalary extends BaseEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 主键 * 主键
......
...@@ -56,6 +56,15 @@ public class TDeptSee extends BaseEntity { ...@@ -56,6 +56,15 @@ public class TDeptSee extends BaseEntity {
@Length(max = 50, message = "项目名称不能超过50个字符") @Length(max = 50, message = "项目名称不能超过50个字符")
@ExcelProperty("项目名称") @ExcelProperty("项目名称")
private String deptName; private String deptName;
/**
* 项目名称
*/
@ExcelAttribute(name = "项目名称", isNotEmpty = true, errorInfo = "项目名称不能为空", maxLength = 50)
@NotBlank(message = "项目名称不能为空")
@Length(max = 50, message = "项目名称不能超过50个字符")
@ExcelProperty("项目名称")
private String deptNo;
/** /**
* 是否可查看工资:0否;1是 * 是否可查看工资:0否;1是
*/ */
......
...@@ -2,11 +2,14 @@ package com.yifu.cloud.plus.v1.yifu.salary.controller; ...@@ -2,11 +2,14 @@ package com.yifu.cloud.plus.v1.yifu.salary.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TConfigSalary; import com.yifu.cloud.plus.v1.yifu.salary.entity.TConfigSalary;
import com.yifu.cloud.plus.v1.yifu.salary.service.TConfigSalaryService; import com.yifu.cloud.plus.v1.yifu.salary.service.TConfigSalaryService;
import com.yifu.cloud.plus.v1.yifu.salary.util.SalaryConstants;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
...@@ -87,7 +90,13 @@ public class TConfigSalaryController { ...@@ -87,7 +90,13 @@ public class TConfigSalaryController {
@Operation(description = "新增(wxhr:tconfigsalary_add)") @Operation(description = "新增(wxhr:tconfigsalary_add)")
@PostMapping @PostMapping
@PreAuthorize("@pms.hasPermission('wxhr:tconfigsalary_add')") @PreAuthorize("@pms.hasPermission('wxhr:tconfigsalary_add')")
public R save(@Valid @RequestBody TConfigSalary tConfigSalary) { public R<Boolean> save(@Valid @RequestBody TConfigSalary tConfigSalary) {
long res = tConfigSalaryService.count(Wrappers.<TConfigSalary>query().lambda()
.eq(TConfigSalary::getDepartId,tConfigSalary.getDepartId())
.eq(TConfigSalary::getName,tConfigSalary.getName()));
if ( res > 0){
return R.failed(SalaryConstants.CONFIG_SALARY_REPEAT);
}
return new R<>(tConfigSalaryService.save(tConfigSalary)); return new R<>(tConfigSalaryService.save(tConfigSalary));
} }
...@@ -101,7 +110,14 @@ public class TConfigSalaryController { ...@@ -101,7 +110,14 @@ public class TConfigSalaryController {
@SysLog("修改工资报账配置") @SysLog("修改工资报账配置")
@PutMapping @PutMapping
@PreAuthorize("@pms.hasPermission('wxhr:tconfigsalary_edit')") @PreAuthorize("@pms.hasPermission('wxhr:tconfigsalary_edit')")
public R update(@RequestBody TConfigSalary tConfigSalary) { public R<Boolean> update(@RequestBody TConfigSalary tConfigSalary) {
long res = tConfigSalaryService.count(Wrappers.<TConfigSalary>query().lambda()
.eq(TConfigSalary::getDepartId,tConfigSalary.getDepartId())
.eq(TConfigSalary::getName,tConfigSalary.getName())
.ne(TConfigSalary::getId,tConfigSalary.getId()));
if ( res > 0){
return R.failed(SalaryConstants.CONFIG_SALARY_REPEAT);
}
return new R<>(tConfigSalaryService.updateById(tConfigSalary)); return new R<>(tConfigSalaryService.updateById(tConfigSalary));
} }
...@@ -115,7 +131,7 @@ public class TConfigSalaryController { ...@@ -115,7 +131,7 @@ public class TConfigSalaryController {
@SysLog("删除工资报账配置") @SysLog("删除工资报账配置")
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
@PreAuthorize("@pms.hasPermission('wxhr:tconfigsalary_del')") @PreAuthorize("@pms.hasPermission('wxhr:tconfigsalary_del')")
public R removeById(@PathVariable String id) { public R<Boolean> removeById(@PathVariable String id) {
return new R<>(tConfigSalaryService.removeById(id)); return new R<>(tConfigSalaryService.removeById(id));
} }
......
...@@ -18,11 +18,13 @@ ...@@ -18,11 +18,13 @@
package com.yifu.cloud.plus.v1.yifu.salary.controller; package com.yifu.cloud.plus.v1.yifu.salary.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TDeptSee; import com.yifu.cloud.plus.v1.yifu.salary.entity.TDeptSee;
import com.yifu.cloud.plus.v1.yifu.salary.service.TDeptSeeService; import com.yifu.cloud.plus.v1.yifu.salary.service.TDeptSeeService;
import com.yifu.cloud.plus.v1.yifu.salary.util.SalaryConstants;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TDeptSeeSearchVo; import com.yifu.cloud.plus.v1.yifu.salary.vo.TDeptSeeSearchVo;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
...@@ -31,6 +33,7 @@ import org.springframework.security.access.prepost.PreAuthorize; ...@@ -31,6 +33,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
import java.util.WeakHashMap;
/** /**
...@@ -97,6 +100,10 @@ public class TDeptSeeController { ...@@ -97,6 +100,10 @@ public class TDeptSeeController {
@PostMapping @PostMapping
@PreAuthorize("@pms.hasPermission('salary_tdeptsee_add')") @PreAuthorize("@pms.hasPermission('salary_tdeptsee_add')")
public R<Boolean> save(@RequestBody TDeptSee tDeptSee) { public R<Boolean> save(@RequestBody TDeptSee tDeptSee) {
long res = tDeptSeeService.count(Wrappers.<TDeptSee>query().lambda().eq(TDeptSee::getId,tDeptSee.getId()));
if (res > 0){
return R.failed(SalaryConstants.DEPT_SEE_REPEAT);
}
return R.ok(tDeptSeeService.save(tDeptSee)); return R.ok(tDeptSeeService.save(tDeptSee));
} }
......
...@@ -128,11 +128,15 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper, ...@@ -128,11 +128,15 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
if (null == user || null == user.getId()) { if (null == user || null == user.getId()) {
return R.failed("获取登录用户信息失败!"); return R.failed("获取登录用户信息失败!");
} }
//薪资导入
if (CommonConstants.ZERO_STRING.equals(salaryType) && Common.isNotNull(configId)) {
TConfigSalary configSalary = new TConfigSalary();
if (Common.isNotNull(configId)) {
// 薪资配置-结算月、社保月等信息 // 薪资配置-结算月、社保月等信息
TConfigSalary configSalary = configSalaryService.getById(configId); configSalary = configSalaryService.getById(configId);
} else {
configSalary = configSalaryService.getById(CommonConstants.ONE_STRING);
}
try { try {
jsonString = URLDecoder.decode(jsonString, "UTF-8").replace("=", ""); jsonString = URLDecoder.decode(jsonString, "UTF-8").replace("=", "");
SalaryAccountUtil util1 = new SalaryAccountUtil(); SalaryAccountUtil util1 = new SalaryAccountUtil();
...@@ -166,80 +170,33 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper, ...@@ -166,80 +170,33 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
// 2.6.6:校验导入数据重复的Map格式:#身份证号_工资月份_报表类型_应发金额 // 2.6.6:校验导入数据重复的Map格式:#身份证号_工资月份_报表类型_应发金额
Map<String, Integer> checkMap = tSalaryAccountService.getAccountCheckMap(dept.getId(), DateUtil.addMonth(configSalary.getSalaryMonth())); Map<String, Integer> checkMap = tSalaryAccountService.getAccountCheckMap(dept.getId(), DateUtil.addMonth(configSalary.getSalaryMonth()));
util1.getJsonStringToList(user, jsonString,
dept, configSalary, salaryConfigMap, isMustMap, empIdCardMap, empNameMap, isDuplicateName
, salaryType, null,invoiceTitle, employeeService, checkMap, ownEmployeeMap, ownDeptMap, tSalaryAccountService);
List<TSalaryAccountVo> saList = util1.getEntityList();
if ((null != util1.getErrorInfo() && !util1.getErrorInfo().isEmpty())) {
return R.failed(util1.getErrorInfo());
} else {
if (null != saList && !saList.isEmpty()) {
// return R.ok(saList)
return this.saveAndSubmit(saList);
} else {
return R.failed("导入数据不可为空");
}
}
} catch (Exception e) {
log.error(e.getMessage());
return R.failed("数据导入解析失败!");
}
//劳务费导入
} else if (CommonConstants.THREE_STRING.equals(salaryType)) {
TConfigSalary configSalary = new TConfigSalary();
// 薪资配置-结算月、社保月等信息
configSalary = configSalaryService.getById(CommonConstants.ONE_STRING);
try {
jsonString = URLDecoder.decode(jsonString, "UTF-8").replace("=", "");
SalaryAccountUtil util1 = new SalaryAccountUtil();
List<TSalaryEmployee> empList = employeeService.list(Wrappers.<TSalaryEmployee>query().lambda()
.eq(TSalaryEmployee::getUnitId, dept.getCustomerId()));
Map<String, TSalaryEmployee> empIdCardMap = new HashMap<>();
Map<String, TSalaryEmployee> empNameMap = new HashMap<>();
boolean isDuplicateName = false;
if (empList != null) {
TSalaryEmployee es;//筛选人员,添加判断:非在职,或开户行为空,或 结算主体等于选择的结算主体且在职,都可以存入Map优先备用
for (TSalaryEmployee e : empList) {
es = empIdCardMap.get(e.getEmpIdcard());
if (es == null || CommonConstants.ZERO_INT != es.getFileStatus() || Common.isEmpty(es.getBankName())
|| (e.getDeptId().equals(settleDepart) && CommonConstants.ZERO_INT == e.getFileStatus()
&& Common.isNotNull(e.getBankName()))) {
empIdCardMap.put(e.getEmpIdcard(), e);
empNameMap.put(e.getEmpName().replace(" ", ""), e);
}
}
if (empNameMap.size() == empIdCardMap.size()) {
isDuplicateName = true;
}
}
// 自有员工结算主体id,新员工使用
Map<String, Integer> ownDeptMap = tOwnDeptService.getOwnDeptMap();
// 自有员工所在结算主体Map
Map<String, Integer> ownEmployeeMap = tOwnDeptService.getOwnEmpMap();
// 薪资类型互斥校验Map格式:本年度#身份证号_报表类型
List<String> checkListY = new ArrayList<>(); List<String> checkListY = new ArrayList<>();
if (CommonConstants.THREE_STRING.equals(salaryType)) {
// 薪资类型互斥校验Map格式:本年度#身份证号_报表类型
if (Common.isNotNull(configSalary)) { if (Common.isNotNull(configSalary)) {
checkListY = tSalaryAccountService.getAccountYearCheckMap(dept.getId()); checkListY = tSalaryAccountService.getAccountYearCheckMap(dept.getId());
} }
// 校验导入数据重复的Map格式:#身份证号_工资月份_报表类型_应发金额
Map<String, Integer> checkMap = new HashMap<>();
if (Common.isNotNull(configSalary)) {
checkMap = tSalaryAccountService.getAccountCheckMap(dept.getId(), DateUtil.addMonth(configSalary.getSalaryMonth()));
} }
util1.getJsonStringToList(user, jsonString, dept, !Common.isNotNull(configSalary) ? null: configSalary,
salaryConfigMap, isMustMap, empIdCardMap, empNameMap, isDuplicateName, salaryType,checkListY util1.getJsonStringToList(user, jsonString, dept, configSalary, salaryConfigMap, isMustMap,
,null, employeeService, checkMap, ownEmployeeMap, ownDeptMap, tSalaryAccountService); empIdCardMap, empNameMap, isDuplicateName, salaryType, checkListY, invoiceTitle,
employeeService, checkMap, ownEmployeeMap, ownDeptMap, tSalaryAccountService);
List<TSalaryAccountVo> saList = util1.getEntityList(); List<TSalaryAccountVo> saList = util1.getEntityList();
if ((null != util1.getErrorInfo() && !util1.getErrorInfo().isEmpty())) { if ((null != util1.getErrorInfo() && !util1.getErrorInfo().isEmpty())) {
return R.failed(util1.getErrorInfo()); return R.failed(util1.getErrorInfo());
} else { } else {
if (null != saList && !saList.isEmpty()) { if (null != saList && !saList.isEmpty()) {
// return R.ok(saList)
//薪资导入
if (CommonConstants.ZERO_STRING.equals(salaryType)) {
return this.saveAndSubmit(saList);
}
//劳务费导入
if (CommonConstants.THREE_STRING.equals(salaryType)) {
return this.saveLaborSubmit(saList, dept); return this.saveLaborSubmit(saList, dept);
}
} else { } else {
return R.failed("导入数据不可为空"); return R.failed("导入数据不可为空");
} }
...@@ -248,7 +205,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper, ...@@ -248,7 +205,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
log.error(e.getMessage()); log.error(e.getMessage());
return R.failed("数据导入解析失败!"); return R.failed("数据导入解析失败!");
} }
}
} }
return R.failed("导入数据不可为空"); return R.failed("导入数据不可为空");
} }
...@@ -825,7 +782,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper, ...@@ -825,7 +782,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
salary.setHaveSpecialFlag(CommonConstants.ZERO_INT); salary.setHaveSpecialFlag(CommonConstants.ZERO_INT);
salary.setIsRepeat(CommonConstants.ZERO_INT); salary.setIsRepeat(CommonConstants.ZERO_INT);
salary.setStatus(SalaryConstants.AUDIT_STATUS[0]); salary.setStatus(SalaryConstants.AUDIT_STATUS[0]);
if (haveSalaryFlag || haveSpecialFlag || ownNum>0 || repeatFlag) { if (haveSalaryFlag || haveSpecialFlag || ownNum > 0 || repeatFlag) {
if (haveSalaryFlag) { if (haveSalaryFlag) {
salary.setHaveSalaryFlag(CommonConstants.ONE_INT); salary.setHaveSalaryFlag(CommonConstants.ONE_INT);
} }
...@@ -1529,7 +1486,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper, ...@@ -1529,7 +1486,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
TSalaryLock lockUpdate; TSalaryLock lockUpdate;
try { try {
// 薪资核心导入代码 // 薪资核心导入代码
return this.doLaborCoreSalary(savList, saiList, sai, dept, invoiceTitle, salary); return this.doLaborCoreSalary(savList, saiList, sai, dept, invoiceTitle, salary, user);
} catch (Exception e) { } catch (Exception e) {
lockUpdate = new TSalaryLock(); lockUpdate = new TSalaryLock();
lockUpdate.setId(lock.getId()); lockUpdate.setId(lock.getId());
...@@ -1560,7 +1517,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper, ...@@ -1560,7 +1517,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
* @return: com.yifu.cloud.v1.common.core.util.R * @return: com.yifu.cloud.v1.common.core.util.R
**/ **/
public R doLaborCoreSalary(List<TSalaryAccountVo> savList, List<TSalaryAccountItem> saiList, TSalaryAccountItem sai, public R doLaborCoreSalary(List<TSalaryAccountVo> savList, List<TSalaryAccountItem> saiList, TSalaryAccountItem sai,
TSettleDomainSelectVo dept, String invoiceTitle, TSalaryStandard salary) { TSettleDomainSelectVo dept, String invoiceTitle, TSalaryStandard salary, YifuUser user) {
List<TSalaryAccount> aList = new ArrayList<>(); List<TSalaryAccount> aList = new ArrayList<>();
TSalaryAccount a;//定库: TSalaryAccount a;//定库:
BigDecimal money = new BigDecimal(CommonConstants.ZERO_STRING); //初始化金额备用 BigDecimal money = new BigDecimal(CommonConstants.ZERO_STRING); //初始化金额备用
...@@ -1642,7 +1599,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper, ...@@ -1642,7 +1599,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
this.saveNewItems(sai, saiList, SalaryConstants.SALARY_TAX, this.saveNewItems(sai, saiList, SalaryConstants.SALARY_TAX,
SalaryConstants.SALARY_TAX_JAVA, SalaryConstants.SALARY_TAX_JAVA,
calculationLabor(saiList, asList calculationLabor(saiList, asList
, saiList,a), CommonConstants.ZERO_INT); , saiList, a), CommonConstants.ZERO_INT);
a.setSaiList(saiList); a.setSaiList(saiList);
aList.add(a); aList.add(a);
...@@ -1659,7 +1616,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper, ...@@ -1659,7 +1616,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
salary.setHaveSpecialFlag(CommonConstants.ZERO_INT); salary.setHaveSpecialFlag(CommonConstants.ZERO_INT);
salary.setIsRepeat(CommonConstants.ZERO_INT); salary.setIsRepeat(CommonConstants.ZERO_INT);
salary.setStatus(SalaryConstants.AUDIT_STATUS[0]); salary.setStatus(SalaryConstants.AUDIT_STATUS[0]);
if (haveSalaryFlag || haveSpecialFlag || ownNum>0 || repeatFlag) { if (haveSalaryFlag || haveSpecialFlag || ownNum > 0 || repeatFlag) {
if (haveSalaryFlag) { if (haveSalaryFlag) {
salary.setHaveSalaryFlag(CommonConstants.ONE_INT); salary.setHaveSalaryFlag(CommonConstants.ONE_INT);
} }
...@@ -1673,6 +1630,9 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper, ...@@ -1673,6 +1630,9 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
//保存工资表 //保存工资表
tSalaryStandardService.save(salary); tSalaryStandardService.save(salary);
// 获取上一个工资条顺序,复制:
tSalaryStandardSetService.copyLastSetByDeptId(salary.getId(), dept.getId(), String.valueOf(user.getId()));
salaryDetailVo.setSalary(salary); salaryDetailVo.setSalary(salary);
for (TSalaryAccount account : aList) { for (TSalaryAccount account : aList) {
...@@ -1733,10 +1693,10 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper, ...@@ -1733,10 +1693,10 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
nowTaxY = getNowTax(actualSalarySum); nowTaxY = getNowTax(actualSalarySum);
relaySalary = BigDecimalUtils.safeAdd(actualSalarySumNow, nowTaxT).setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP); relaySalary = BigDecimalUtils.safeAdd(actualSalarySumNow, nowTaxT).setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
BigDecimal salaryTax = BigDecimalUtils.safeSubtract(nowTaxY,BigDecimalUtils.safeAdd(nowTaxT,sumTax)); BigDecimal salaryTax = BigDecimalUtils.safeSubtract(nowTaxY, BigDecimalUtils.safeAdd(nowTaxT, sumTax));
a.setSalaryTax(salaryTax); a.setSalaryTax(salaryTax);
a.setSalaryTaxUnit(nowTaxT); a.setSalaryTaxUnit(nowTaxT);
a.setActualSalary(BigDecimalUtils.safeSubtract(actualSalarySumNow,salaryTax)); a.setActualSalary(BigDecimalUtils.safeSubtract(actualSalarySumNow, salaryTax));
} else { } else {
nowTaxY = getNowTax(actualSalarySum); nowTaxY = getNowTax(actualSalarySum);
if (sumTax.compareTo(BigDecimal.ZERO) != 0) { if (sumTax.compareTo(BigDecimal.ZERO) != 0) {
...@@ -1757,7 +1717,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper, ...@@ -1757,7 +1717,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
return nowTaxT; return nowTaxT;
} }
public static BigDecimal getNowTax (BigDecimal actualSalarySum) { public static BigDecimal getNowTax(BigDecimal actualSalarySum) {
BigDecimal nowTax; BigDecimal nowTax;
// 2022-3-3 11:24:20 运营中心郭华照提供的公式: // 2022-3-3 11:24:20 运营中心郭华照提供的公式:
// ROUND(IF(B7<=800,0,IF(B7<=3360,(B7-800)/4,IF(B7<=21000,0.16*B7/0.84,IF(B7<=49500,(0.24*B7-2000)/0.76,(0.32*B7-7000)/0.68)))),2) // ROUND(IF(B7<=800,0,IF(B7<=3360,(B7-800)/4,IF(B7<=21000,0.16*B7/0.84,IF(B7<=49500,(0.24*B7-2000)/0.76,(0.32*B7-7000)/0.68)))),2)
......
...@@ -47,7 +47,7 @@ public class TConfigSalaryServiceImpl extends ServiceImpl<TConfigSalaryMapper, T ...@@ -47,7 +47,7 @@ public class TConfigSalaryServiceImpl extends ServiceImpl<TConfigSalaryMapper, T
} }
vo = domainListVoR.getData(); vo = domainListVoR.getData();
if (Common.isEmpty(vo) || !Common.isNotEmpty(vo.getDeptIds())) { if (Common.isEmpty(vo) || !Common.isNotEmpty(vo.getDeptIds())) {
throw new RuntimeException("未获取到相关结算信息"); throw new RuntimeException("无项目权限");
} }
} }
if (Common.isEmpty(vo)){ if (Common.isEmpty(vo)){
......
...@@ -276,4 +276,8 @@ public class SalaryConstants { ...@@ -276,4 +276,8 @@ public class SalaryConstants {
//派单限制统计表更新类型(0认领更新/1撤销认领更新/2匹配更新/3取消匹配更新) //派单限制统计表更新类型(0认领更新/1撤销认领更新/2匹配更新/3取消匹配更新)
public static final Integer[] DISPATCH_UPDTYPE= {0, 1, 2, 3}; public static final Integer[] DISPATCH_UPDTYPE= {0, 1, 2, 3};
//项目薪资配置重复
public static final String CONFIG_SALARY_REPEAT = "项目薪资配置重复";
//项目薪资权限重复
public static final String DEPT_SEE_REPEAT = "项目薪资权限重复";
} }
...@@ -76,6 +76,7 @@ ...@@ -76,6 +76,7 @@
</foreach> </foreach>
</if> </if>
</where> </where>
order by CREATE_TIME DESC
</select> </select>
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
<result property="createTime" column="CREATE_TIME"/> <result property="createTime" column="CREATE_TIME"/>
<result property="updateBy" column="UPDATE_BY"/> <result property="updateBy" column="UPDATE_BY"/>
<result property="updateTime" column="UPDATE_TIME"/> <result property="updateTime" column="UPDATE_TIME"/>
<result property="deptNo" column="DEPT_NO"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
a.ID, a.ID,
...@@ -41,7 +42,8 @@ ...@@ -41,7 +42,8 @@
a.CREATE_NAME, a.CREATE_NAME,
a.CREATE_TIME, a.CREATE_TIME,
a.UPDATE_BY, a.UPDATE_BY,
a.UPDATE_TIME a.UPDATE_TIME,
a.DEPT_NO
</sql> </sql>
<sql id="tDeptSee_where"> <sql id="tDeptSee_where">
<if test="tDeptSee != null"> <if test="tDeptSee != null">
......
spring: spring:
shardingsphere:
datasource:
ds0:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.1.65:22306/mvp_social?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
username: root
password: yf_zsk
hikari:
driver-class-name: ${spring.datasource.driver-class-name}
jdbc-url: ${spring.datasource.url}
username: ${spring.datasource.username}
password: ${spring.datasource.password}
pool-name: AmytangHikariCP
minimum-idle: 10 # 最小空闲连接数量
idle-timeout: 60000 # 空闲连接存活最大时间,默认600000(10分钟)
maximum-pool-size: 12 # 连接池最大连接数,默认是10
auto-commit: true #此属性控制从池返回的连接的默认自动提交行为,默认值:true
max-lifetime: 0 #此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟
names: ds0
rules:
sharding:
key-generators:
snowflake:
type: SNOWFLAKE
sharding-algorithms:
t-payment-inline:
props:
strategy: standard
algorithmClassName: com.yifu.cloud.plus.v1.yifu.social.config.OTAStrategyShardingAlgorithm
type: CLASS_BASED
tables:
t_payment_info:
actual-data-nodes: ds0.t_payment_info_20$->{17..22}
key-generate-strategy:
column: ID
key-generator-name: snowflake
table-strategy:
standard:
sharding-column: CREATE_TIME
sharding-algorithm-name: t-payment-inline
mvc: mvc:
pathmatch: pathmatch:
matching-strategy: ant_path_matcher matching-strategy: ant_path_matcher
...@@ -6,17 +48,6 @@ spring: ...@@ -6,17 +48,6 @@ spring:
activate: activate:
on-profile: dev on-profile: dev
redis: redis:
host: 127.0.0.1 host: 192.168.1.65
port: 6379 port: 22379
password: '@yf_2017' password: '@yf_2017'
\ No newline at end of file
datasource:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: yf_zsk
url: jdbc:mysql://192.168.1.65:22306/mvp_social?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
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