加解密

This commit is contained in:
钱涛 2022-06-10 16:43:38 +08:00
parent e83714ba4f
commit 6ddf483767
21 changed files with 36 additions and 545 deletions

View File

@ -6,11 +6,8 @@ import com.engine.salary.encrypt.datacollection.AddUpDeductionStrDTOEncrypt;
import com.engine.salary.entity.datacollection.AddUpDeduction;
import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO;
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO;
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordStrDTO;
import com.engine.salary.entity.datacollection.dto.AddUpDeductionStrDTO;
import com.engine.salary.entity.datacollection.param.AddUpDeductionQueryParam;
import com.engine.salary.mapper.datacollection.AddUpDeductionMapper;
import com.engine.salary.util.excel.ExcelUtil;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.ibatis.session.SqlSession;
@ -33,7 +30,7 @@ public class AddUpDeductionBiz extends BaseBean {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
AddUpDeductionMapper mapper = sqlSession.getMapper(AddUpDeductionMapper.class);
List<AddUpDeductionStrDTO> list = mapper.list(param);
List<AddUpDeductionDTO> list = mapper.list(param);
return AddUpDeductionStrDTOEncrypt.decryptAddUpDeductionList(list);
} finally {
sqlSession.close();
@ -85,7 +82,7 @@ public class AddUpDeductionBiz extends BaseBean {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
AddUpDeductionMapper mapper = sqlSession.getMapper(AddUpDeductionMapper.class);
List<AddUpDeductionRecordStrDTO> addUpDeductionRecordStrDTOS = mapper.recordList(param);
List<AddUpDeductionRecordDTO> addUpDeductionRecordStrDTOS = mapper.recordList(param);
return AddUpDeductionRecordStrDTOEncrypt.decryptAddUpDeductionRecordDTO(addUpDeductionRecordStrDTOS);
} finally {
sqlSession.close();

View File

@ -422,8 +422,6 @@ public class SIArchivesBiz {
InsuranceArchivesSocialSchemePOEncrypt.decryptList(socialList);
return socialList.size() != 0 ? socialList.get(0) : null;
} finally {
}finally {
sqlSession.close();
}
}

View File

@ -1,48 +0,0 @@
package com.engine.salary.cmd.taxDeclaration;
import com.engine.common.biz.AbstractCommonCommand;
import com.engine.common.entity.BizLogContext;
import com.engine.core.interceptor.CommandContext;
import com.engine.salary.biz.TaxRateBiz;
import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.util.DataUtil;
import org.apache.commons.collections4.CollectionUtils;
import weaver.hrm.User;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
public class TaxDeclarationDeleteCmd extends AbstractCommonCommand<Map<String, Object>> {
public TaxDeclarationDeleteCmd(Map<String, Object> params, User user) {
this.user = user;
this.params = params;
}
@Override
public BizLogContext getLogContext() {
return null;
}
@Override
public Map<String, Object> execute(CommandContext commandContext) {
Map<String, Object> apidatas = new HashMap<String, Object>(16);
List<String> idStrs = DataUtil.castList(params.get("ids"), String.class);
if (CollectionUtils.isEmpty(idStrs)) {
throw new SalaryRunTimeException("参数错误");
}
List<Long> ids = idStrs.stream().map(Long::valueOf).collect(Collectors.toList());
TaxRateBiz taxRateBiz = new TaxRateBiz();
taxRateBiz.deleteByIds(ids);
return apidatas;
}
}

View File

@ -1,33 +0,0 @@
package com.engine.salary.cmd.taxDeclaration;
import com.engine.common.biz.AbstractCommonCommand;
import com.engine.common.entity.BizLogContext;
import com.engine.core.interceptor.CommandContext;
import com.engine.salary.biz.TaxRateBiz;
import com.engine.salary.entity.taxrate.param.TaxRateSaveParam;
import weaver.hrm.User;
import java.util.HashMap;
import java.util.Map;
public class TaxDeclarationGetFormCmd extends AbstractCommonCommand<Map<String, Object>> {
public TaxDeclarationGetFormCmd(Map<String, Object> params, User user) {
this.user = user;
this.params = params;
}
@Override
public BizLogContext getLogContext() {
return null;
}
@Override
public Map<String, Object> execute(CommandContext commandContext) {
Map<String, Object> apidatas = new HashMap<String, Object>(16);
TaxRateBiz taxRateBiz = new TaxRateBiz();
TaxRateSaveParam taxRateSaveParam = (TaxRateSaveParam) params.get("taxRateSaveParam");
taxRateBiz.save(taxRateSaveParam, (long) user.getUID());
return apidatas;
}
}

View File

@ -1,33 +0,0 @@
package com.engine.salary.cmd.taxDeclaration;
import com.engine.common.biz.AbstractCommonCommand;
import com.engine.common.entity.BizLogContext;
import com.engine.core.interceptor.CommandContext;
import com.engine.salary.biz.TaxRateBiz;
import com.engine.salary.entity.taxrate.param.TaxRateSaveParam;
import weaver.hrm.User;
import java.util.HashMap;
import java.util.Map;
public class TaxDeclarationGetTaxDeclarationInfoCmd extends AbstractCommonCommand<Map<String, Object>> {
public TaxDeclarationGetTaxDeclarationInfoCmd(Map<String, Object> params, User user) {
this.user = user;
this.params = params;
}
@Override
public BizLogContext getLogContext() {
return null;
}
@Override
public Map<String, Object> execute(CommandContext commandContext) {
Map<String, Object> apidatas = new HashMap<String, Object>(16);
TaxRateBiz taxRateBiz = new TaxRateBiz();
TaxRateSaveParam taxRateSaveParam = (TaxRateSaveParam) params.get("taxRateSaveParam");
taxRateBiz.save(taxRateSaveParam, (long) user.getUID());
return apidatas;
}
}

View File

@ -1,33 +0,0 @@
package com.engine.salary.cmd.taxDeclaration;
import com.engine.common.biz.AbstractCommonCommand;
import com.engine.common.entity.BizLogContext;
import com.engine.core.interceptor.CommandContext;
import com.engine.salary.biz.TaxRateBiz;
import com.engine.salary.entity.taxrate.param.TaxRateSaveParam;
import weaver.hrm.User;
import java.util.HashMap;
import java.util.Map;
public class TaxDeclarationSaveCmd extends AbstractCommonCommand<Map<String, Object>> {
public TaxDeclarationSaveCmd(Map<String, Object> params, User user) {
this.user = user;
this.params = params;
}
@Override
public BizLogContext getLogContext() {
return null;
}
@Override
public Map<String, Object> execute(CommandContext commandContext) {
Map<String, Object> apidatas = new HashMap<String, Object>(16);
TaxRateBiz taxRateBiz = new TaxRateBiz();
TaxRateSaveParam taxRateSaveParam = (TaxRateSaveParam) params.get("taxRateSaveParam");
taxRateBiz.save(taxRateSaveParam, (long) user.getUID());
return apidatas;
}
}

View File

@ -1,33 +0,0 @@
package com.engine.salary.cmd.taxDeclaration;
import com.engine.common.biz.AbstractCommonCommand;
import com.engine.common.entity.BizLogContext;
import com.engine.core.interceptor.CommandContext;
import com.engine.salary.biz.TaxRateBiz;
import com.engine.salary.entity.taxrate.param.TaxRateSaveParam;
import weaver.hrm.User;
import java.util.HashMap;
import java.util.Map;
public class TaxDeclarationUpdateCmd extends AbstractCommonCommand<Map<String, Object>> {
public TaxDeclarationUpdateCmd(Map<String, Object> params, User user) {
this.user = user;
this.params = params;
}
@Override
public BizLogContext getLogContext() {
return null;
}
@Override
public Map<String, Object> execute(CommandContext commandContext) {
Map<String, Object> apidatas = new HashMap<String, Object>(16);
TaxRateBiz taxRateBiz = new TaxRateBiz();
TaxRateSaveParam taxRateSaveParam = (TaxRateSaveParam) params.get("taxRateSaveParam");
taxRateBiz.update(taxRateSaveParam, (long) user.getUID());
return apidatas;
}
}

View File

@ -2,10 +2,7 @@ package com.engine.salary.encrypt.datacollection;
import com.engine.salary.encrypt.AESEncryptUtil;
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO;
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordStrDTO;
import org.apache.commons.lang.StringUtils;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@ -20,16 +17,18 @@ import java.util.stream.Collectors;
* add_up_support_elderly
*/
public class AddUpDeductionRecordStrDTOEncrypt {
public static List<AddUpDeductionRecordDTO> decryptAddUpDeductionRecordDTO(List<AddUpDeductionRecordStrDTO> list) {
public static List<AddUpDeductionRecordDTO> decryptAddUpDeductionRecordDTO(List<AddUpDeductionRecordDTO> list) {
if(list == null || list.size() == 0) {
return new ArrayList<>();
}
list.forEach(item -> {
item.setAddUpChildEducation(AESEncryptUtil.encrypt(item.getAddUpChildEducation()));
item.setAddUpContinuingEducation(AESEncryptUtil.encrypt(item.getAddUpContinuingEducation()));
item.setAddUpHousingLoanInterest(AESEncryptUtil.encrypt(item.getAddUpHousingLoanInterest()));
item.setAddUpHousingRent(AESEncryptUtil.encrypt(item.getAddUpHousingRent()));
item.setAddUpSupportElderly(AESEncryptUtil.encrypt(item.getAddUpSupportElderly()));
item.setAddUpChildEducation(AESEncryptUtil.decrypt(item.getAddUpChildEducation()));
item.setAddUpContinuingEducation(AESEncryptUtil.decrypt(item.getAddUpContinuingEducation()));
item.setAddUpHousingLoanInterest(AESEncryptUtil.decrypt(item.getAddUpHousingLoanInterest()));
item.setAddUpHousingRent(AESEncryptUtil.decrypt(item.getAddUpHousingRent()));
item.setAddUpSupportElderly(AESEncryptUtil.decrypt(item.getAddUpSupportElderly()));
item.setAddUpIllnessMedical(AESEncryptUtil.decrypt(item.getAddUpIllnessMedical()));
item.setAddUpInfantCare(AESEncryptUtil.decrypt(item.getAddUpInfantCare()));
});
return list.stream().map(item -> {
return AddUpDeductionRecordDTO.builder()

View File

@ -2,10 +2,7 @@ package com.engine.salary.encrypt.datacollection;
import com.engine.salary.encrypt.AESEncryptUtil;
import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO;
import com.engine.salary.entity.datacollection.dto.AddUpDeductionStrDTO;
import org.apache.commons.lang.StringUtils;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@ -20,7 +17,7 @@ import java.util.stream.Collectors;
* add_up_support_elderly
*/
public class AddUpDeductionStrDTOEncrypt {
public static List<AddUpDeductionDTO> decryptAddUpDeductionList(List<AddUpDeductionStrDTO> list) {
public static List<AddUpDeductionDTO> decryptAddUpDeductionList(List<AddUpDeductionDTO> list) {
if(list == null || list.size() == 0) {
return new ArrayList<>();
}
@ -30,6 +27,8 @@ public class AddUpDeductionStrDTOEncrypt {
item.setAddUpHousingLoanInterest(AESEncryptUtil.decrypt(item.getAddUpHousingLoanInterest()));
item.setAddUpHousingRent(AESEncryptUtil.decrypt(item.getAddUpHousingRent()));
item.setAddUpSupportElderly(AESEncryptUtil.decrypt(item.getAddUpSupportElderly()));
item.setAddUpIllnessMedical(AESEncryptUtil.decrypt(item.getAddUpIllnessMedical()));
item.setAddUpInfantCare(AESEncryptUtil.decrypt(item.getAddUpInfantCare()));
});
return list.stream().map(item -> {
return AddUpDeductionDTO.builder()

View File

@ -1,9 +1,8 @@
package com.engine.salary.encrypt.taxdeclaration;
import com.engine.salary.encrypt.AESEncryptUtil;
import com.engine.salary.entity.taxdeclaration.TaxDeclarationDetail;
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationDetailPO;
import java.util.Collection;
import java.util.List;
/**
@ -12,7 +11,7 @@ import java.util.List;
* field_value
*/
public class TaxDeclarationDetailEncrypt {
public static List<TaxDeclarationDetail> encryptTaxDeclarationDetailList(List<TaxDeclarationDetail> list) {
public static List<TaxDeclarationDetailPO> encryptTaxDeclarationDetailList(List<TaxDeclarationDetailPO> list) {
if(list == null || list.size() == 0) {
return list;
}
@ -22,7 +21,7 @@ public class TaxDeclarationDetailEncrypt {
return list;
}
public static List<TaxDeclarationDetail> decryptTaxDeclarationDetailList(List<TaxDeclarationDetail> list) {
public static List<TaxDeclarationDetailPO> decryptTaxDeclarationDetailList(List<TaxDeclarationDetailPO> list) {
if(list == null || list.size() == 0) {
return list;
}

View File

@ -4,6 +4,7 @@ import com.cloudstore.eccom.pc.table.WeaTableType;
import com.engine.salary.annotation.SalaryTable;
import com.engine.salary.annotation.SalaryTableColumn;
import com.engine.salary.annotation.SalaryTableOperate;
import com.engine.salary.annotation.TableTitle;
import com.engine.salary.util.excel.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
@ -44,6 +45,7 @@ public class AddUpDeductionDTO {
*/
@ExcelProperty(index = 0)
@SalaryTableColumn(text = "姓名", width = "10%", column = "username")
@TableTitle(title = "姓名", dataIndex = "username", key = "username")
private String username;
/**
@ -51,6 +53,7 @@ public class AddUpDeductionDTO {
*/
@ExcelProperty(index = 1)
@SalaryTableColumn(text = "个税扣缴义务人", width = "10%", column = "taxAgentName")
@TableTitle(title = "个税扣缴义务人", dataIndex = "taxAgentName", key = "taxAgentName")
private String taxAgentName;
/**

View File

@ -1,104 +0,0 @@
package com.engine.salary.entity.datacollection.dto;
import com.cloudstore.eccom.pc.table.WeaTableType;
import com.engine.salary.annotation.SalaryTable;
import com.engine.salary.annotation.SalaryTableColumn;
import com.engine.salary.util.excel.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.Date;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
//数据采集-累计专项附加扣除记录
@SalaryTable(pageId = "a4f85287-3354-4275-adn9-7d06e54y6rj8", tableType = WeaTableType.CHECKBOX)
public class AddUpDeductionRecordStrDTO {
//主键id
@SalaryTableColumn(column = "id", display = false)
private Long id;
//员工id
private Long employeeId;
@ExcelProperty(index = 0)
private String username;
//申报月份
@JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8")
@SalaryTableColumn(text = "申报月份", width = "10%", column = "declareMonth", transmethod = "com.engine.salary.transmethod.TransMethod.timeToMoth")
@ExcelProperty(index = 1)
private Date declareMonth;
//个税扣缴义务人
@SalaryTableColumn(text = "个税扣缴义务人", width = "10%", column = "taxAgentName")
@ExcelProperty(index = 2)
private String taxAgentName;
//部门
@SalaryTableColumn(text = "部门", width = "10%", column = "departmentName")
@ExcelProperty(index = 3)
private String departmentName;
//手机号
@SalaryTableColumn(text = "手机号", width = "10%", column = "mobile")
private String mobile;
//工号
@SalaryTableColumn(text = "工号", width = "10%", column = "jobNum")
@ExcelProperty(index = 4)
private String jobNum;
/**
* 累计子女教育
*/
@ExcelProperty(index = 5)
@SalaryTableColumn(text = "累计子女教育", width = "10%", column = "addUpChildEducation")
private String addUpChildEducation;
/**
* 累计继续教育
*/
@ExcelProperty(index = 6)
@SalaryTableColumn(text = "累计继续教育", width = "10%", column = "addUpContinuingEducation")
private String addUpContinuingEducation;
/**
* 累计住房贷款利息
*/
@ExcelProperty(index = 7)
@SalaryTableColumn(text = "累计住房贷款利息", width = "10%", column = "addUpHousingLoanInterest")
private String addUpHousingLoanInterest;
/**
* 累计住房租金
*/
@ExcelProperty(index = 8)
@SalaryTableColumn(text = "累计住房租金", width = "10%", column = "addUpHousingRent")
private String addUpHousingRent;
/**
* 累计赡养老人
*/
@ExcelProperty(index = 9)
@SalaryTableColumn(text = "累计赡养老人", width = "10%", column = "addUpSupportElderly")
private String addUpSupportElderly;
@ExcelProperty(index = 10)
@SalaryTableColumn(text = "累计大病医疗", width = "10%", column = "addUpIllnessMedical")
private String addUpIllnessMedical;
@ExcelProperty(index = 11)
@SalaryTableColumn(text = "累计婴幼儿照护", width = "10%", column = "addUpInfantCare")
private String addUpInfantCare;
}

View File

@ -1,142 +0,0 @@
package com.engine.salary.entity.datacollection.dto;
import com.cloudstore.eccom.pc.table.WeaTableType;
import com.engine.salary.annotation.SalaryTable;
import com.engine.salary.annotation.SalaryTableColumn;
import com.engine.salary.annotation.SalaryTableOperate;
import com.engine.salary.util.excel.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
/**
* 数据采集-累计专项附加扣除
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@SalaryTable(pageId = "a4f85287-e3f9-4275-adn9-7d06e54y6rj8", tableType = WeaTableType.CHECKBOX, operates = {
@SalaryTableOperate(text = "查看明细")
})
public class AddUpDeductionStrDTO {
/**
* 主键id
*/
@SalaryTableColumn(column = "id", display = false)
private Long id;
/**
* 员工id
*/
private Long employeeId;
/**
* 姓名
*/
@ExcelProperty(index = 0)
@SalaryTableColumn(text = "姓名", width = "10%", column = "username")
private String username;
/**
* 个税扣缴义务人
*/
@ExcelProperty(index = 1)
@SalaryTableColumn(text = "个税扣缴义务人", width = "10%", column = "taxAgentName")
private String taxAgentName;
/**
* 部门
*/
@ExcelProperty(index = 2)
@SalaryTableColumn(text = "部门", width = "10%", column = "departmentName")
private String departmentName;
/**
* 手机号
*/
@ExcelProperty(index = 3)
@SalaryTableColumn(text = "手机号", width = "10%", column = "mobile")
private String mobile;
/**
* 工号
*/
@ExcelProperty(index = 4)
@SalaryTableColumn(text = "工号", width = "10%", column = "jobNum")
private String jobNum;
/**
* 证件号码
*/
@ExcelProperty(index = 5)
@SalaryTableColumn(text = "证件号码", width = "10%", column = "idNo")
private String idNo;
/**
* 入职日期
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@ExcelProperty(index = 6)
@SalaryTableColumn(text = "入职日期", width = "10%", column = "hiredate")
private String hiredate;
/**
* 累计子女教育
*/
@ExcelProperty(index = 7)
@SalaryTableColumn(text = "累计子女教育", width = "10%", column = "addUpChildEducation")
private String addUpChildEducation;
/**
* 累计继续教育
*/
@ExcelProperty(index = 8)
@SalaryTableColumn(text = "累计继续教育", width = "10%", column = "addUpContinuingEducation")
private String addUpContinuingEducation;
/**
* 累计住房贷款利息
*/
@ExcelProperty(index = 9)
@SalaryTableColumn(text = "累计住房贷款利息", width = "10%", column = "addUpHousingLoanInterest")
private String addUpHousingLoanInterest;
/**
* 累计住房租金
*/
@ExcelProperty(index = 10)
@SalaryTableColumn(text = "累计住房租金", width = "10%", column = "addUpHousingRent")
private String addUpHousingRent;
/**
* 累计赡养老人
*/
@ExcelProperty(index = 11)
@SalaryTableColumn(text = "累计赡养老人", width = "10%", column = "addUpSupportElderly")
private String addUpSupportElderly;
/**
* 累计大病医疗
*/
@ExcelProperty(index = 12)
@SalaryTableColumn(text = "累计大病医疗", width = "10%", column = "addUpIllnessMedical")
private String addUpIllnessMedical;
@ExcelProperty(index = 13)
@SalaryTableColumn(text = "累计婴幼儿照护", width = "10%", column = "addUpInfantCare")
private String addUpInfantCare;
@SalaryTableColumn(text = "操作", width = "20%", column = "operate")
private String operate;
}

View File

@ -71,7 +71,6 @@ public class TaxAgentBO {
/**
* 构建表格
*
* @param weaTable
* @param isOpenDevolution
*/
public static void buildTaxAgentTable(PageInfo<Map<String, Object>> listPage, boolean isOpenDevolution) {

View File

@ -4,8 +4,6 @@ import com.engine.salary.entity.datacollection.AddUpDeduction;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO;
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO;
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordStrDTO;
import com.engine.salary.entity.datacollection.dto.AddUpDeductionStrDTO;
import com.engine.salary.entity.datacollection.param.AddUpDeductionQueryParam;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -43,7 +41,7 @@ public interface AddUpDeductionMapper {
* @param param
* @return
*/
List<AddUpDeductionStrDTO> list(@Param("param") AddUpDeductionQueryParam param);
List<AddUpDeductionDTO> list(@Param("param") AddUpDeductionQueryParam param);
/**
* 根据条件查询
@ -64,5 +62,5 @@ public interface AddUpDeductionMapper {
*/
void updateData(@Param("collection") List<AddUpDeduction> updateList);
List<AddUpDeductionRecordStrDTO> recordList(@Param("param") AddUpDeductionQueryParam param);
List<AddUpDeductionRecordDTO> recordList(@Param("param") AddUpDeductionQueryParam param);
}

View File

@ -283,7 +283,7 @@
</if>
</sql>
<select id="list" resultType="com.engine.salary.entity.datacollection.dto.AddUpDeductionStrDTO">
<select id="list" resultType="com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO">
SELECT
<include refid="addUpDeductionColumn"/>
FROM
@ -299,7 +299,7 @@
ORDER BY t1.id DESC
</select>
<select id="list" resultType="com.engine.salary.entity.datacollection.dto.AddUpDeductionStrDTO"
<select id="list" resultType="com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO"
databaseId="oracle">
SELECT
<include refid="addUpDeductionColumn"/>
@ -315,7 +315,7 @@
<include refid="paramSql"/>
ORDER BY t1.id DESC
</select>
<select id="list" resultType="com.engine.salary.entity.datacollection.dto.AddUpDeductionStrDTO"
<select id="list" resultType="com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO"
databaseId="sqlserver">
SELECT
<include refid="addUpDeductionColumn"/>
@ -528,7 +528,7 @@
</foreach>
</update>
<select id="recordList" resultType="com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordStrDTO">
<select id="recordList" resultType="com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO">
SELECT
<include refid="addUpDeductionColumn"/>
FROM

View File

@ -9,7 +9,6 @@ import com.engine.salary.util.page.PageInfo;
import java.util.Collection;
import java.util.List;
import java.util.Map;
public interface TaxDeclarationService {
@ -20,16 +19,8 @@ public interface TaxDeclarationService {
//表单
TaxDeclarationPO getById(Long id);
Map<String, Object> getForm(Map<String, Object> params);
Map<String, Object> getTaxDeclarationInfo(Map<String, Object> params);
void save(TaxDeclarationSaveParam saveParam);
Map<String, Object> update(Map<String, Object> params);
Map<String, Object> delete(Map<String, Object> params);
/**
* 删除个税申报表
*

View File

@ -10,14 +10,13 @@ import com.engine.core.impl.Service;
import com.engine.salary.biz.AddUpDeductionBiz;
import com.engine.salary.biz.EmployBiz;
import com.engine.salary.common.LocalDateRange;
import com.engine.salary.cmd.datacollection.*;
import com.engine.salary.encrypt.datacollection.AddUpDeductionRecordStrDTOEncrypt;
import com.engine.salary.encrypt.datacollection.AddUpDeductionStrDTOEncrypt;
import com.engine.salary.entity.datacollection.AddUpDeduction;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO;
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO;
import com.engine.salary.entity.datacollection.param.AddUpDeductionImportParam;
import com.engine.salary.entity.datacollection.dto.AddUpDeductionStrDTO;
import com.engine.salary.entity.datacollection.param.AddUpDeductionQueryParam;
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
@ -423,7 +422,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
SalaryPageUtil.start(queryParam.getCurrent(), queryParam.getPageSize());
List<AddUpDeductionDTO> list = getAddUpDeductionMapper().list(queryParam);
return new PageInfo<>(list, AddUpDeductionDTO.class);
return new PageInfo<>(AddUpDeductionStrDTOEncrypt.decryptAddUpDeductionList(list), AddUpDeductionDTO.class);
}
@Override
@ -441,7 +440,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
SalaryPageUtil.start(queryParam.getCurrent(), queryParam.getPageSize());
List<AddUpDeductionRecordDTO> list = getAddUpDeductionMapper().recordList(queryParam);
return new PageInfo<>(list, AddUpDeductionRecordDTO.class);
return new PageInfo<>(AddUpDeductionRecordStrDTOEncrypt.decryptAddUpDeductionRecordDTO(list), AddUpDeductionRecordDTO.class);
}
@ -535,8 +534,6 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
taxAgentIdsAsAdmin.contains(f.getTaxAgentId())
// 作为分管理员
|| TaxAgentBO.checkTaxAgentAndEmployee(taxAgentEmployees, f.getTaxAgentId(), f.getEmployeeId())
// 自己最后修改过的则可以看到最新和其历史
// || lastList.stream().anyMatch(l -> l.getEmployeeId().equals(f.getEmployeeId()) && l.getTaxAgentId().equals(f.getTaxAgentId()) && !l.getDeclareMonth().isBefore(f.getDeclareMonth()))
).collect(Collectors.toList());
}
@ -581,38 +578,6 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
List<List<Object>> rows = new ArrayList<>();
rows.add(headerList);
// // 2.表头
// if (queryParam.getDeclareMonth() != null) {
// queryParam.setDeclareMonth(queryParam.getDeclareMonth().stream().map(e -> e + "-01 00:00:00").collect(Collectors.toList()));
// }
// // 获取累计专项附加扣除
// List<AddUpDeductionDTO> list = getAddUpDeductionMapper().list(queryParam);
// // 人员信息赋值
// list.forEach(m -> {
// // todo 身份证号
// m.setIdNo("");
// });
//
// for (AddUpDeductionDTO dto : list) {
// List<Object> row = new ArrayList<>();
// row.add(Util.null2String(dto.getUsername()));
// row.add(Util.null2String(dto.getTaxAgentName()));
// row.add(Util.null2String(dto.getDepartmentName()));
// row.add(Util.null2String(dto.getMobile()));
// row.add(Util.null2String(dto.getJobNum()));
// row.add(Util.null2String(dto.getIdNo()));
// row.add(Util.null2String(dto.getHiredate()));
// row.add(Util.null2String(dto.getAddUpChildEducation()));
// row.add(Util.null2String(dto.getAddUpContinuingEducation()));
// row.add(Util.null2String(dto.getAddUpHousingLoanInterest()));
// row.add(Util.null2String(dto.getAddUpHousingRent()));
// row.add(Util.null2String(dto.getAddUpSupportElderly()));
// row.add(Util.null2String(dto.getAddUpIllnessMedical()));
// row.add(Util.null2String(dto.getAddUpInfantCare()));
// rows.add(row);
// }
// 4.注释
List<ExcelComment> excelComments = Lists.newArrayList();
excelComments.add(new ExcelComment(0, 0, 3, 2, SalaryI18nUtil.getI18nLabel(100344, "必填")));
@ -660,14 +625,11 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
if (getTaxAgentService(user).isOpenDevolution() && !isChief) {
List<TaxAgentEmployeeDTO> taxAgentEmployees = getTaxAgentService(user).listTaxAgentAndEmployee(employeeId);
List<Long> taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
// List<AddUpDeductionPO> lastList = getLastListByModifier(employeeId);
list = list.stream().filter(f ->
// 作为管理员
taxAgentIdsAsAdmin.contains(f.getTaxAgentId())
// 作为分管理员
|| TaxAgentBO.checkTaxAgentAndEmployee(taxAgentEmployees, f.getTaxAgentId(), f.getEmployeeId())
// 自己最后修改过的则可以看到最新和其历史
// || lastList.stream().anyMatch(l->l.getEmployeeId().equals(f.getEmployeeId()) && l.getTaxAgentId().equals(f.getTaxAgentId()) && !l.getDeclareMonth().isBefore(f.getDeclareMonth()))
).collect(Collectors.toList());
}

View File

@ -9,9 +9,6 @@ import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.biz.AddUpSituationBiz;
import com.engine.salary.biz.EmployBiz;
import com.engine.salary.cmd.datacollection.*;
import com.engine.salary.encrypt.datacollection.AddUpSituationDTOEncrypt;
import com.engine.salary.encrypt.datacollection.AddUpSituationEncrypt;
import com.engine.salary.entity.datacollection.AddUpSituation;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.datacollection.dto.AddUpSituationDTO;
@ -69,6 +66,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
private TaxAgentService getTaxAgentService(User user) {
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
}
private SalaryEmployeeService getSalaryEmployeeService(User user) {
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
}
@ -167,14 +165,14 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
public PageInfo<AddUpSituationDTO> listPage(AddUpSituationQueryParam queryParam) {
List<String> taxYearMonth = queryParam.getTaxYearMonth();
if(CollectionUtils.isNotEmpty(taxYearMonth)){
if (CollectionUtils.isNotEmpty(taxYearMonth)) {
queryParam.setTaxYearMonth(taxYearMonth.stream().map(e -> e + "-01 00:00:00").collect(Collectors.toList()));
}
long employeeId = user.getUID();
Boolean needAuth = getTaxAgentService(user).isNeedAuth(employeeId);
if(needAuth){
if (needAuth) {
List<Long> taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
if (CollectionUtils.isEmpty(taxAgentIdsAsAdmin)) {
return new PageInfo<>(AddUpSituationDTO.class);
@ -192,7 +190,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
long employeeId = user.getUID();
Boolean needAuth = getTaxAgentService(user).isNeedAuth(employeeId);
if(needAuth){
if (needAuth) {
List<Long> taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
if (CollectionUtils.isEmpty(taxAgentIdsAsAdmin)) {
return new PageInfo<>(AddUpSituationRecordDTO.class);
@ -258,7 +256,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
if (getTaxAgentService(user).isOpenDevolution() && !getTaxAgentService(user).isChief(employeeId)) {
List<Long> taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
list = list.stream().filter(f ->
taxAgentIdsAsAdmin.contains(f.getTaxAgentId())
taxAgentIdsAsAdmin.contains(f.getTaxAgentId())
).collect(Collectors.toList());
}
@ -323,8 +321,8 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
if (getTaxAgentService(user).isOpenDevolution() || !getTaxAgentService(user).isChief(employeeId)) {
List<Long> taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
list = list.stream().filter(f ->
// 作为管理员
taxAgentIdsAsAdmin.contains(f.getTaxAgentId())
// 作为管理员
taxAgentIdsAsAdmin.contains(f.getTaxAgentId())
).collect(Collectors.toList());
}
final List<List<String>> dataRowList = Optional.ofNullable(list)
@ -659,7 +657,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
}
// 分权判断
if(openDevolution){
if (openDevolution) {
Optional<TaxAgentManageRangeEmployeeDTO.TaxAgentEmployee> optionalTaxAgentEmp = taxAgentEmployees.stream().filter(f -> f.getEmployeeId().equals(po.getEmployeeId())).findFirst();
if (!optionalTaxAgentEmp.isPresent()) {
Map<String, String> errorMessageMap = Maps.newHashMap();

View File

@ -5,8 +5,6 @@ import com.engine.common.service.impl.HrmCommonServiceImpl;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.biz.SalaryRoleBiz;
import com.engine.salary.biz.TaxAgentBiz;
import com.engine.salary.cmd.TaxAgent.*;
import com.engine.salary.encrypt.datacollection.AddUpDeductionEncrypt;
import com.engine.salary.encrypt.datacollection.AddUpSituationEncrypt;
import com.engine.salary.encrypt.datacollection.OtherDeductionPOEncrypt;

View File

@ -2,10 +2,6 @@ package com.engine.salary.service.impl;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.cmd.taxDeclaration.TaxDeclarationDeleteCmd;
import com.engine.salary.cmd.taxDeclaration.TaxDeclarationGetFormCmd;
import com.engine.salary.cmd.taxDeclaration.TaxDeclarationGetTaxDeclarationInfoCmd;
import com.engine.salary.cmd.taxDeclaration.TaxDeclarationUpdateCmd;
import com.engine.salary.common.LocalDateRange;
import com.engine.salary.entity.datacollection.AddUpSituation;
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
@ -129,16 +125,6 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration
return getTaxDeclarationMapper().getById(id);
}
@Override
public Map<String, Object> getForm(Map<String, Object> params) {
return commandExecutor.execute(new TaxDeclarationGetFormCmd(params, user));
}
@Override
public Map<String, Object> getTaxDeclarationInfo(Map<String, Object> params) {
return commandExecutor.execute(new TaxDeclarationGetTaxDeclarationInfoCmd(params, user));
}
@Override
public void save(TaxDeclarationSaveParam saveParam) {
long currentEmployeeId = user.getUID();
@ -234,16 +220,6 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration
getSalaryAcctRecordService(user).updateStatusByIds(salaryAcctRecordIds, SalaryAcctRecordStatusEnum.DECLARED);
}
@Override
public Map<String, Object> update(Map<String, Object> params) {
return commandExecutor.execute(new TaxDeclarationUpdateCmd(params, user));
}
@Override
public Map<String, Object> delete(Map<String, Object> params) {
return commandExecutor.execute(new TaxDeclarationDeleteCmd(params, user));
}
@Override
public void deleteBySalaryMonth(SalaryAcctRecordPO salaryAcctRecordPO) {
// 薪资所属月的日期范围