浮动薪酬加解密
This commit is contained in:
parent
35a0349f38
commit
fc88f03904
|
|
@ -84,4 +84,6 @@ public interface VariableArchiveItemMapper {
|
|||
void deleteByIds(@Param("collection")List<Long> part);
|
||||
|
||||
void deleteByArchiveIds(@Param("collection")List<Long> part);
|
||||
|
||||
void updateBatchSelective(@Param("list")List<VariableArchiveItemPO> variableArchiveItemPOS);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -312,6 +312,22 @@
|
|||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
<update id="updateBatchSelective">
|
||||
update hrsa_variable_archive_item
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<trim prefix="item_value = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.itemValue != null">
|
||||
when id = #{item.id} then #{item.itemValue}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
</trim>
|
||||
where id in
|
||||
<foreach close=")" collection="list" item="item" open="(" separator=", ">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 根据主键删除记录 -->
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import java.util.List;
|
|||
*/
|
||||
public interface VariableArchiveItemService {
|
||||
|
||||
List<VariableArchiveItemPO> listAll();
|
||||
/**
|
||||
* 根据浮动薪资档案id获取
|
||||
*
|
||||
|
|
|
|||
|
|
@ -25,6 +25,11 @@ public class VariableArchiveItemServiceImpl extends Service implements VariableA
|
|||
return MapperProxyFactory.getProxy(VariableArchiveItemMapper.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VariableArchiveItemPO> listAll() {
|
||||
return getVariableArchiveItemMapper().listAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据浮动薪资档案id获取
|
||||
*
|
||||
|
|
|
|||
|
|
@ -206,9 +206,7 @@ public class VariableArchiveServiceImpl extends Service implements VariableArchi
|
|||
|
||||
List<VariableArchivePO> variableArchivePOList = getVariableArchiveMapper().listSome(VariableArchivePO.builder().salaryMonth(saveParam.getSalaryMonthDate()).taxAgentId(saveParam.getTaxAgentIds()).employeeId(saveParam.getEmployeeId()).build());
|
||||
if (CollectionUtils.isNotEmpty(variableArchivePOList)) {
|
||||
// 先删除原有档案
|
||||
List<Long> variableArchiveIds = variableArchivePOList.stream().map(VariableArchivePO::getId).collect(Collectors.toList());
|
||||
getVariableArchiveMapper().deleteByIds(variableArchiveIds);
|
||||
throw new SalaryRunTimeException("已存在浮动薪酬数据");
|
||||
}
|
||||
|
||||
// 保存浮动薪资档案信息
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import com.engine.salary.entity.datacollection.AddUpDeduction;
|
|||
import com.engine.salary.entity.datacollection.AddUpSituation;
|
||||
import com.engine.salary.entity.datacollection.po.OtherDeductionPO;
|
||||
import com.engine.salary.entity.datacollection.po.SpecialAddDeductionPO;
|
||||
import com.engine.salary.entity.datacollection.po.VariableArchiveItemPO;
|
||||
import com.engine.salary.entity.salaryacct.po.ExcelAcctResultPO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO;
|
||||
|
|
@ -24,10 +25,7 @@ import com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO;
|
|||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationDetailPO;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.archive.SalaryArchiveItemMapper;
|
||||
import com.engine.salary.mapper.datacollection.AddUpDeductionMapper;
|
||||
import com.engine.salary.mapper.datacollection.AddUpSituationMapper;
|
||||
import com.engine.salary.mapper.datacollection.OtherDeductionMapper;
|
||||
import com.engine.salary.mapper.datacollection.SpecialAddDeductionMapper;
|
||||
import com.engine.salary.mapper.datacollection.*;
|
||||
import com.engine.salary.mapper.salaryacct.ExcelAcctResultMapper;
|
||||
import com.engine.salary.mapper.salaryacct.SalaryAcctResultMapper;
|
||||
import com.engine.salary.mapper.siaccount.ExcelInsuranceDetailMapper;
|
||||
|
|
@ -39,6 +37,8 @@ import com.engine.salary.mapper.siarchives.SocialSchemeMapper;
|
|||
import com.engine.salary.mapper.sischeme.InsuranceSchemeDetailMapper;
|
||||
import com.engine.salary.mapper.sys.SalarySysConfMapper;
|
||||
import com.engine.salary.mapper.taxdeclaration.TaxDeclarationDetailMapper;
|
||||
import com.engine.salary.service.VariableArchiveItemService;
|
||||
import com.engine.salary.service.impl.VariableArchiveItemServiceImpl;
|
||||
import com.engine.salary.sys.config.SysConfig;
|
||||
import com.engine.salary.sys.constant.SalarySysConstant;
|
||||
import com.engine.salary.sys.entity.param.AppSettingSaveParam;
|
||||
|
|
@ -157,6 +157,9 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
|
|||
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private VariableArchiveItemService getVariableArchiveItemService(User user) {
|
||||
return ServiceUtil.getService(VariableArchiveItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作是否需要申报功能
|
||||
|
|
@ -1234,14 +1237,42 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
|
|||
return 1;
|
||||
});
|
||||
|
||||
int flag = submit.get() + submit1.get() + submit2.get() + submit3.get() + submit4.get() + submit5.get() + submit6.get() + submit7.get() + submit8.get() + submit9.get() + submit10.get() + submit11.get() + submit12.get() + submit13.get() + submit14.get();
|
||||
if (flag == 15) {
|
||||
Future<Integer> submit15 = fixedThreadPool.submit(() -> {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
List<VariableArchiveItemPO> variableArchiveItemPOS = getVariableArchiveItemService(user).listAll();
|
||||
if (CollectionUtils.isNotEmpty(variableArchiveItemPOS)) {
|
||||
variableArchiveItemPOS.forEach(po -> {
|
||||
if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) {
|
||||
po.setItemValue(AESEncryptUtil.closeEncryptSetting(po.getItemValue(), sysConfPo));
|
||||
} else {
|
||||
po.setItemValue(AESEncryptUtil.encrypt(po.getItemValue()));
|
||||
}
|
||||
});
|
||||
List<List<VariableArchiveItemPO>> partition = Lists.partition(variableArchiveItemPOS, 10);
|
||||
VariableArchiveItemMapper mapper = sqlSession.getMapper(VariableArchiveItemMapper.class);
|
||||
partition.forEach(mapper::updateBatchSelective);
|
||||
sqlSession.commit();
|
||||
log.info("finish hrsa_variable_archive_item");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
sqlSession.rollback();
|
||||
log.error("fail hrsa_variable_archive_item", e);
|
||||
return 0;
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
return 1;
|
||||
});
|
||||
|
||||
int flag = submit.get() + submit1.get() + submit2.get() + submit3.get() + submit4.get() + submit5.get() + submit6.get() + submit7.get() + submit8.get() + submit9.get() + submit10.get() + submit11.get() + submit12.get() + submit13.get() + submit14.get() + submit15.get();
|
||||
if (flag == 16) {
|
||||
Util_DataCache.setObjVal(ENCRYPT_IN_PROGRESS + progressId, "success", 30);
|
||||
} else {
|
||||
Util_DataCache.setObjVal(ENCRYPT_IN_PROGRESS + progressId, "fail", 30);
|
||||
}
|
||||
Util_DataCache.clearVal(AES_ENCRYPT_IN_PROGRESS);
|
||||
return flag == 15;
|
||||
return flag == 16;
|
||||
} catch (Exception e) {
|
||||
Util_DataCache.setObjVal(ENCRYPT_IN_PROGRESS + progressId, "fail", 30);
|
||||
Util_DataCache.clearVal(AES_ENCRYPT_IN_PROGRESS);
|
||||
|
|
|
|||
Loading…
Reference in New Issue