Commit f3a03fb5 authored by hongguangwu's avatar hongguangwu

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

parents 96aa139e 84b6f680
......@@ -111,12 +111,12 @@ public class THaveSalaryNosocial extends BaseEntity {
private String settlementOrganNo;
/**
* 结算月
* 生成月--- 生成数据的月份 删除用
*/
@Length(max = 10, message = "结算月不能超过10个字符")
@ExcelAttribute(name = "结算月", maxLength = 10, needExport = true)
@Schema(description = "结算月", name = "settleMonth")
private String settleMonth;
@Length(max = 10, message = "生成月不能超过10个字符")
@ExcelAttribute(name = "生成月", maxLength = 10, needExport = true)
@Schema(description = "生成月", name = "createMonth")
private String createMonth;
/**
......
......@@ -117,7 +117,7 @@ public class THaveSalaryNosocialServiceImpl extends ServiceImpl<THaveSalaryNosoc
@Override
public void generate(String salaryMonth) {
//重新跑上月数据
this.remove(Wrappers.<THaveSalaryNosocial>query().lambda().eq(THaveSalaryNosocial::getMonth,salaryMonth));
this.remove(Wrappers.<THaveSalaryNosocial>query().lambda().eq(THaveSalaryNosocial::getCreateMonth,salaryMonth));
List<THaveSalaryNosocial> haveSalaryNosocialList = salaryAccountService.getLastMonthTHaveSalaryNosocial(salaryMonth);
if(!Common.isNotEmpty(haveSalaryNosocialList)){
log.error("获取有社保无工资数据为空");
......@@ -126,7 +126,13 @@ public class THaveSalaryNosocialServiceImpl extends ServiceImpl<THaveSalaryNosoc
//去缴费库查询查询这些人社保是否存在
Map<String, TPaymentInfo> empPaymentInfoMap=Maps.newHashMap();
R<HaveSalaryNoSocialVo> noSocialVoR = socialDaprUtils.getPaymentinfoListByEmpdIdCard(Common.listObjectToStrList(haveSalaryNosocialList, "employeeIdCard"), salaryMonth);
if (Common.isNotNull(noSocialVoR)&& Common.isNotNull(noSocialVoR.getData())) {
if (Common.isEmpty(noSocialVoR) || noSocialVoR.getCode() == CommonConstants.FAIL){
log.error("获取社保公积金信息失败");
return;
}
if (Common.isNotNull(noSocialVoR)
&& Common.isNotNull(noSocialVoR.getData())
&& Common.isNotNull(noSocialVoR.getData().getPaymentInfos())) {
for (TPaymentInfo paymentInfo : noSocialVoR.getData().getPaymentInfos()) {
empPaymentInfoMap.put(paymentInfo.getEmpIdcard(),paymentInfo);
}
......@@ -134,6 +140,10 @@ public class THaveSalaryNosocialServiceImpl extends ServiceImpl<THaveSalaryNosoc
//结算主体
R<TSettleDomainListVo> domainListVoR = archivesDaprUtil.selectAllSettleDomainSelectVos();
HashMap<String, TSettleDomainSelectVo> settleDomainSelectVoMap = Maps.newHashMap();
if (Common.isEmpty(domainListVoR) || domainListVoR.getCode() == CommonConstants.FAIL){
log.error("获取项目信息失败");
return;
}
if (Common.isNotNull(domainListVoR)
&& Common.isNotNull(domainListVoR.getData())
&& Common.isNotNull(domainListVoR.getData().getListSelectVO()))
......@@ -163,6 +173,7 @@ public class THaveSalaryNosocialServiceImpl extends ServiceImpl<THaveSalaryNosoc
haveSalaryNosocial.setCreateBy(allUserDTOMap.get(haveSalaryNosocial.getCreateBy()));
}
haveSalaryNosocial.setCreateTime(LocalDateTime.now());
haveSalaryNosocial.setCreateMonth(salaryMonth);
this.save(haveSalaryNosocial);
}
......
......@@ -91,7 +91,7 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal
if (res > CommonConstants.ZERO_INT){
return R.failed("已存在对应区域在用的配置信息");
}
baseMapper.updateById(entity);
baseMapper.updateById(tMinSalary);
return R.ok(true,CommonConstants.UPDATE_SUCCESS);
}else {
return R.failed(false,CommonConstants.SAVE_FAILED);
......
......@@ -278,7 +278,7 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
} else {
//年终奖单独扣税
finalSalaryNoSalary = calculationSalary(annousTax,infoVo.getAnnualBonus());
BigDecimal annualTSalary = calculationSalaryT(personTax,infoVo.getAnnualTSalary(),sumTax);
BigDecimal annualTSalary = calculationSalaryT(personTax,infoVo.getAnnualTSalary());
finalSalaryNoSalary = BigDecimalUtils.safeAdd(finalSalaryNoSalary,annualTSalary);
wSalary = BigDecimalUtils.safeAdd(infoVo.getAnnualBonus(), infoVo.getAnnualTSalary());
finalSalaryWithSalary = calculationSalary(annousTax, wSalary);
......@@ -491,7 +491,7 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
}
/**
* @param annousTax 年终奖扣税阶梯表list
* @param annousTax 薪资扣税阶梯表list
* @param annualSalary 年终奖
* @Description: 计算薪资扣税-个税
* @Author: huyc
......@@ -528,7 +528,7 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
* @Date: 2022/8/23
* @return: java.math.BigDecimal
**/
private static BigDecimal calculationSalaryT(List<TSalaryTaxConfig> personTax, BigDecimal annualSalary, BigDecimal sumTax) {
private static BigDecimal calculationSalaryT(List<TSalaryTaxConfig> personTax, BigDecimal annualSalary) {
//本次年终奖纳税额
BigDecimal res = BigDecimal.ZERO;
//计算年终奖税
......@@ -539,7 +539,7 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
//annualSalary = realDeduSalary * ((double) ((annualSalary.getTaxRate() * 1.0) / 100)) - sumTax - sub.getQuick();
res = annualSalary.multiply(new BigDecimal(sub.getWithholdingRate()).divide(
SalaryConstants.B_ONEHUNDRED, SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP))
.subtract(sumTax).subtract(sub.getQuickDeducation());// 应纳税额
.subtract(sub.getQuickDeducation());// 应纳税额
break;
}
}
......
......@@ -209,6 +209,7 @@
LEFT JOIN t_salary_account_item i ON i.SALARY_ACCOUNT_ID = a.id and i.JAVA_FIED_NAME = 'actualSalarySum'
LEFT JOIN t_salary_account_item l ON l.SALARY_ACCOUNT_ID = a.id and l.JAVA_FIED_NAME = 'relaySalary'
WHERE
(t.`STATUS`=1 or t.id is null) and (c.`STATUS`=1 or c.id is null) and
a.DELETE_FLAG = 0
and a.FORM_TYPE='0'
and a.SALARY_MONTH = #{settleMonth}
......
......@@ -37,7 +37,7 @@
a.SETTLEMENT_ORGAN_NAME,
a.SETTLEMENT_ORGAN_NO,
a.month,
a.SETTLE_MONTH,
a.CREATE_MONTH,
a.relay_salary,
a.FEED_BACK,
a.CREATE_NAME,
......@@ -75,8 +75,8 @@
<if test="tHaveSalaryNosocial.month != null">
AND a.month = #{tHaveSalaryNosocial.month}
</if>
<if test="tHaveSalaryNosocial.settleMonth != null">
AND a.SETTLE_MONTH = #{tHaveSalaryNosocial.settleMonth}
<if test="tHaveSalaryNosocial.createMonth != null">
AND a.CREATE_MONTH = #{tHaveSalaryNosocial.createMonth}
</if>
<if test="tHaveSalaryNosocial.createName != null">
AND a.CREATE_NAME = #{tHaveSalaryNosocial.createName}
......@@ -205,7 +205,7 @@
,b.*
FROM t_have_salary_nosocial a
left join t_feed_back b on a.ID=b.RELATE_ID
where a.SETTLE_MONTH in(#{lastOneMonth},#{lastTwoMonth},#{lastThreeMonth}) and b.REASON_TYPE is not null
where a.CREATE_MONTH in(#{lastOneMonth},#{lastTwoMonth},#{lastThreeMonth}) and b.REASON_TYPE is not null
</select>
<select id="noPageDiy" resultMap="haveSalaryNoSocialExportMap">
......
......@@ -387,7 +387,7 @@
, a.EMP_IDCARD employee_id_card
, a.EMP_NAME employee_name
, GROUP_CONCAT(a.relaySalary) relay_salary
, a.CREATE_BY CREATE_USER_ID
, a.CREATE_BY CREATE_BY
, GROUP_CONCAT(a.SALARY_MONTH) month
, a.EMP_NAME employee_name
, a.EMP_IDCARD employee_id_card
......@@ -395,6 +395,7 @@
, a.DEPT_NAME SETTLEMENT_ORGAN_NAME
, a.DEPT_NO SETTLEMENT_ORGAN_NO
, a.SETTLEMENT_MONTH SETTLE_MONTH
,a.CREATE_NAME,a.CREATE_TIME
from (
select a.id
, s.DEPT_ID
......@@ -411,6 +412,7 @@
, sum(if(item.JAVA_FIED_NAME in
('unitSocial', 'personalSocial', 'withholidingUnitSocial', 'withholidingPersonSocial'),
item.SALARY_MONEY, 0)) social
,a.CREATE_NAME,a.CREATE_TIME
from mvp_salary.t_salary_account a
left join mvp_salary.t_salary_account_item item on item.SALARY_ACCOUNT_ID = a.id
LEFT JOIN mvp_salary.t_salary_standard s on a.SALARY_FORM_ID = s.id
......
......@@ -91,7 +91,7 @@
<!--统计-->
<select id="doStatisticsLabor" resultMap="tStatisticsLaborMap">
select
#{nowMonth} DECLARE_MONTH,a.EMP_NAME,a.EMP_IDCARD,sum(a.SALARY_TAX) PERSONAL_TAX,sum(a.ACTUAL_SALARY) INCOME,
#{nowMonth} DECLARE_MONTH,a.EMP_NAME,a.EMP_IDCARD,sum(a.SALARY_TAX + a.SALARY_TAX_UNIT) PERSONAL_TAX,sum(a.RELAY_SALARY_UNIT) INCOME,
a.INVOICE_TITLE DECLARE_UNIT,'一般劳务报酬所得' INCOME_ITEM,'居民身份证' CARD_TYPE
from t_salary_account a
where a.DELETE_FLAG = 0 and a.SETTLEMENT_MONTH = #{lastMonth} and a.FORM_TYPE = '3'
......
......@@ -88,7 +88,7 @@
<select id="doStatisticsRemuneration" resultMap="tStatisticsRemunerationMap">
select
#{nowMonth} DECLARE_MONTH,a.EMP_NAME,a.EMP_IDCARD,sum(a.SALARY_TAX) PERSONAL_TAX,
sum(a.ACTUAL_SALARY) INCOME,a.INVOICE_TITLE DECLARE_UNIT,'居民身份证' CARD_TYPE
sum(a.SALARY_TAX_UNIT) INCOME,a.INVOICE_TITLE DECLARE_UNIT,'居民身份证' CARD_TYPE
from t_salary_account a
where a.DELETE_FLAG = 0 and a.SETTLEMENT_MONTH = #{lastMonth} and a.FORM_TYPE = '4'
GROUP BY a.EMP_IDCARD,DECLARE_UNIT
......
......@@ -582,5 +582,12 @@ public class TDispatchInfo extends BaseEntity {
@ExcelProperty("首次购买时间(第一派单月份)" )
private Date firstBuyMonthSocial;
/**
* 订单ID
*/
@ExcelAttribute(name = "订单ID")
@Schema(description = "订单ID" )
@ExcelProperty("订单ID" )
private String orderId;
}
......@@ -445,4 +445,9 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
@ExcelProperty("派单ID" )
private String dispatchId;
/**
* 订单ID
*/
private String orderId;
}
......@@ -224,8 +224,8 @@ public class TDispatchInfoController {
@SysLog("批量新增派单信息记录表")
@PostMapping("/importListAdd")
//@PreAuthorize("@pms.hasPermission('demo_tdispatchinfo-batch-import')")
public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file){
return tDispatchInfoService.importDiy(file.getInputStream());
public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file, String orderId){
return tDispatchInfoService.importDiy(file.getInputStream(),orderId);
}
/**
......
......@@ -46,7 +46,7 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> {
*/
IPage<TDispatchInfoPageVo> getTDispatchInfoPage(Page<TDispatchInfo> page, TDispatchInfoSearchVo tDispatchInfo);
R<List<ErrorMessage>> importDiy(InputStream inputStream);
R<List<ErrorMessage>> importDiy(InputStream inputStream, String orderId);
void listExport(HttpServletResponse response, TDispatchInfoSearchVo searchVo);
......@@ -56,7 +56,7 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> {
@ShardingTransactionType(TransactionType.BASE)
void importTDispatchInfo(List<TDispatchImportVo> excelVOList,
List<ErrorMessage> errorMessageList,
YifuUser user);
YifuUser user, String orderId);
R<List<ErrorMessage>> importReduceDiy(InputStream inputStream);
......
......@@ -236,7 +236,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
@Override
public R<List<ErrorMessage>> importDiy(InputStream inputStream) {
public R<List<ErrorMessage>> importDiy(InputStream inputStream, String orderId) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)){
R.failed(CommonConstants.USER_FAIL);
......@@ -284,7 +284,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
importTDispatchInfo(cachedDataList, errorMessageList,user);
importTDispatchInfo(cachedDataList, errorMessageList,user,orderId);
log.info("存储数据库成功!");
}
}).sheet().doRead();
......@@ -299,7 +299,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
@ShardingTransactionType(TransactionType.BASE)
public void importTDispatchInfo(List<TDispatchImportVo> excelVOList,
List<ErrorMessage> errorMessageList,
YifuUser user) {
YifuUser user, String orderId) {
if (!Common.isNotNull(excelVOList)){
return;
}
......@@ -432,6 +432,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
continue;
}
// 新增派单信息
excel.setOrderId(orderId);
initDispatchAddInfo(user, dispatchMap, empVo, socialSet, fundSet, excel,socialFund,injury);
// 变更社保公积金查询
initSocialFundAddInfo(socialFundAddMap, empVo, socialSet, fundSet, setInfoVo, socialFund, excel);
......@@ -1002,6 +1003,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
TSocialFundInfo socialFund, boolean injury) {
TDispatchInfo dispatch = new TDispatchInfo();
// 初始化派单项
dispatch.setOrderId(excel.getOrderId());
initAddHandleItem(excel, socialFund,dispatch,socialSet,injury);
dispatch.setOrganName(user.getDeptName());
dispatch.setCreateBy(user.getId());
......
......@@ -24,7 +24,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysArea;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.AreaVo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainListVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.*;
......@@ -41,7 +40,6 @@ import com.yifu.cloud.plus.v1.yifu.social.service.TPreDispatchInfoService;
import com.yifu.cloud.plus.v1.yifu.social.util.ServiceUtil;
import com.yifu.cloud.plus.v1.yifu.social.vo.*;
import lombok.RequiredArgsConstructor;
import org.checkerframework.checker.units.qual.C;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -383,7 +381,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
}
// 档案地市没问题 开始派单处理
if (errorMessageList.size() == CommonConstants.ZERO_INT) {
dispatchInfoService.importTDispatchInfo(importVoList, errorMessageList, user);
dispatchInfoService.importTDispatchInfo(importVoList, errorMessageList, user, null);
}
// 处理派增结果
errorMessage = handleDispatchAddRes(preInfo, errorMessageList);
......@@ -2453,7 +2451,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
}
// 档案地市没问题 开始派单处理
if (!Common.isNotNull(errorMessageList)){
dispatchInfoService.importTDispatchInfo(importVoList, errorMessageList, user);
dispatchInfoService.importTDispatchInfo(importVoList, errorMessageList, user, null);
}
// 处理派增结果
handleDispatchAddRes(pre, errorMessageList);
......
......@@ -95,6 +95,8 @@
<result property="idCardAddress" column="ID_CARD_ADDRESS"/>
<result property="applyNo" column="APPLY_NO"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="orderId" column="ORDER_ID"/>
</resultMap>
<resultMap id="dispatchPageMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoPageVo" extends="tDispatchInfoMap">
<result property="providentHouseholdName" column="PROVIDENT_HOUSEHOLD_NAME"/>
......@@ -213,7 +215,8 @@
a.ID_CARD_CITY,
a.ID_CARD_TOWN,
a.ID_CARD_ADDRESS,
a.APPLY_NO
a.APPLY_NO,
a.ORDER_ID
</sql>
<sql id="tDispatchInfo_where">
<if test="tDispatchInfo != null">
......
......@@ -282,7 +282,7 @@ public class UserController {
* @return
**/
@Inner
@GetMapping(value = {"/inner/getAllUserName"})
@PostMapping(value = {"/inner/getAllUserName"})
public AllUserNaVo getAllUserDTO() {
AllUserNaVo naVo = new AllUserNaVo();
List<SysUser> sysUsers = userService.list(Wrappers.<SysUser>query().lambda());
......
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