This commit is contained in:
parent
c54f9daa2d
commit
e0d4820e2e
|
|
@ -478,8 +478,6 @@ public class GetDeclareTaxResultFeedbackResponse extends BaseResponse {
|
|||
/**
|
||||
* 累计专项附加扣除额 必填:null 专项附加合计
|
||||
*/
|
||||
@SalaryTableColumn(text = "累计专项附加扣除额", width = "10%", column = "ljzxfjkce")
|
||||
@ExcelHead(title = "累计专项附加扣除额", dataIndex = "ljzxfjkce")
|
||||
private BigDecimal ljzxfjkce;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import com.engine.salary.util.page.PageInfo;
|
|||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 个税申报表明细
|
||||
|
|
@ -90,7 +91,7 @@ public interface TaxDeclarationValueService {
|
|||
* 对比
|
||||
* @param taxDeclareRecordId
|
||||
*/
|
||||
void contrast(Long taxDeclareRecordId);
|
||||
Map<String, Object> contrast(Long taxDeclareRecordId);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ import com.engine.salary.util.JsonUtil;
|
|||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryEnumUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.excel.ExcelUtil;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
|
|
@ -334,24 +333,35 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar
|
|||
}
|
||||
|
||||
@Override
|
||||
public void contrast(Long taxDeclareRecordId) {
|
||||
TaxDeclareRecordPO taxDeclareRecordPO = getTaxDeclareRecordMapper().getById(taxDeclareRecordId);
|
||||
public Map<String, Object> contrast(Long taxDeclarationId) {
|
||||
|
||||
|
||||
TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(taxDeclarationId);
|
||||
if (taxDeclaration == null) {
|
||||
throw new SalaryRunTimeException("无申报表");
|
||||
}
|
||||
|
||||
TaxDeclareRecordPO taxDeclareRecordPO = getTaxDeclareRecordMapper().getById(taxDeclaration.getTaxDeclareRecordId());
|
||||
if (taxDeclareRecordPO == null) {
|
||||
throw new SalaryRunTimeException("申报记录不存在!");
|
||||
}
|
||||
|
||||
List<TaxDeclarationPO> taxDeclarations = getTaxDeclarationService(user).listByTaxDeclareRecordId(taxDeclareRecordId);
|
||||
if (CollectionUtils.isEmpty(taxDeclarations)) {
|
||||
throw new SalaryRunTimeException("无申报表");
|
||||
}
|
||||
|
||||
Map<String, List<Map<String, Object>>> localData = new HashMap<>();
|
||||
for (TaxDeclarationPO taxDeclaration : taxDeclarations) {
|
||||
//线上数据
|
||||
DeclareClient declareClient = new DeclareClient(taxDeclareRecordPO.getTaxAgentId());
|
||||
GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse = declareClient.getDeclareTaxResultFeedback(taxDeclareRecordPO.getDeclareRequestId());
|
||||
|
||||
Map<String, List<List<Object>>> onlineDataMap = new HashMap<>();
|
||||
List<TaxDeclarationPO> list = getTaxDeclarationService(user).listByTaxDeclareRecordId(taxDeclareRecordPO.getId());
|
||||
list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(onlineDataMap, declareTaxResultFeedbackResponse));
|
||||
|
||||
Map<String, Object> resultList = new HashMap<>();
|
||||
List<TaxDeclarationValuePO> taxDeclarationValues = listByTaxDeclarationId(taxDeclaration.getId());
|
||||
|
||||
// 查询个税申报表表头
|
||||
IncomeCategoryEnum incomeCategoryEnum = SalaryEnumUtil.enumMatchByValue(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.class);
|
||||
List<TaxReportColumnPO> taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum);
|
||||
List<String> columns = SalaryEntityUtil.properties(taxReportColumns, TaxReportColumnPO::getReportColumnName, Collectors.toList());
|
||||
// 人员id
|
||||
Set<Long> employeeIds = SalaryEntityUtil.properties(taxDeclarationValues, TaxDeclarationValuePO::getEmployeeId);
|
||||
// 查询报送的人员
|
||||
|
|
@ -373,21 +383,9 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar
|
|||
List<ExtEmpPO> extEmployees = getExtEmpService(user).getExtEmpByIds(extEmployeeIds);
|
||||
|
||||
// 列表数据
|
||||
List<Map<String, Object>> data = TaxDeclarationValueList.buildTableData(incomeCategoryEnum, taxReportColumns, taxDeclarationValues,
|
||||
List<Map<String, Object>> localList = TaxDeclarationValueList.buildTableData(incomeCategoryEnum, taxReportColumns, taxDeclarationValues,
|
||||
employeeDeclares, simpleEmployees, simpleUserInfos, extEmployees, true);
|
||||
|
||||
localData.put(incomeCategoryEnum.getDefaultLabel(), data);
|
||||
}
|
||||
|
||||
DeclareClient declareClient = new DeclareClient(taxDeclareRecordPO.getTaxAgentId());
|
||||
GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse = declareClient.getDeclareTaxResultFeedback(taxDeclareRecordPO.getDeclareRequestId());
|
||||
|
||||
Map<String, List<List<Object>>> onlineDataMap = new HashMap<>();
|
||||
List<TaxDeclarationPO> list = getTaxDeclarationService(user).listByTaxDeclareRecordId(taxDeclareRecordPO.getId());
|
||||
list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(onlineDataMap, declareTaxResultFeedbackResponse));
|
||||
|
||||
for (String incomeCategory : localData.keySet()) {
|
||||
List<Map<String, Object>> localList = localData.get(incomeCategory);
|
||||
|
||||
Map<String, Map<String, Object>> localMap = new HashMap<>();
|
||||
for (Map<String, Object> map : localList) {
|
||||
|
|
@ -395,7 +393,7 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar
|
|||
localMap.put(no, map);
|
||||
}
|
||||
|
||||
List<List<Object>> onlineData = onlineDataMap.get(incomeCategory);
|
||||
List<List<Object>> onlineData = onlineDataMap.get(incomeCategoryEnum.getDefaultLabel());
|
||||
List<Object> heads = onlineData.get(0);
|
||||
List<List<Object>> data = onlineData.subList(1, onlineData.size());
|
||||
List<Map<String, Object>> onlineMap = new ArrayList<>();
|
||||
|
|
@ -415,22 +413,30 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar
|
|||
onlineNoMap.put(no, map);
|
||||
}
|
||||
|
||||
Map<String, List<Object>> header = ExcelUtil.getHeader(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class);
|
||||
List<Object> list1 = header.get(header);
|
||||
List<Map<String, Object>> resultList = new ArrayList<>();
|
||||
|
||||
|
||||
|
||||
for (Map<String, Object> map : localList) {
|
||||
String no = map.getOrDefault("证件号码", "").toString();
|
||||
Map<String, Object> d1 = localMap.get(no);
|
||||
Map<String, Object> d2 = onlineNoMap.get(no);
|
||||
|
||||
|
||||
}
|
||||
|
||||
List<Map<String, Object>> oneResultList = new ArrayList<>();
|
||||
for (Map<String, Object> local : localList) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("姓名", local.get("姓名"));
|
||||
result.put("证件类型", local.get("证件类型"));
|
||||
result.put("证件号码", local.get("证件号码"));
|
||||
String no = local.getOrDefault("证件号码", "").toString();
|
||||
Map<String, Object> online = onlineNoMap.get(no);
|
||||
|
||||
taxReportColumns.stream().forEach(col -> {
|
||||
Map<String, Object> temp = Maps.newHashMap();
|
||||
// 系统值
|
||||
Object localValue = local.getOrDefault(col.getReportColumnName(), "");
|
||||
// 线下值
|
||||
Object onlineValue = online.getOrDefault(col.getReportColumnName(), "");
|
||||
temp.put("local", localValue);
|
||||
temp.put("online", onlineValue);
|
||||
result.put(col.getReportColumnName(), temp);
|
||||
});
|
||||
oneResultList.add(result);
|
||||
}
|
||||
resultList.put("columns", columns);
|
||||
resultList.put("data", oneResultList);
|
||||
return resultList;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
|
|
|||
|
|
@ -191,6 +191,7 @@ public class TaxDeclarationController {
|
|||
|
||||
/**
|
||||
* 删除申报表
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @param param
|
||||
|
|
@ -281,17 +282,18 @@ public class TaxDeclarationController {
|
|||
|
||||
/**
|
||||
* 对比算税过程
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @param taxDeclareRecordParam
|
||||
* @param taxDeclarationId
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@GET
|
||||
@Path("/contrast")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String contrast(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) {
|
||||
public String contrast(@Context HttpServletRequest request, @Context HttpServletResponse response,@QueryParam(value = "taxDeclarationId") Long taxDeclarationId) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, String>(user).run(getTaxDeclareRecordWrapper(user)::contrast, taxDeclareRecordParam.getTaxDeclareRecordId());
|
||||
return new ResponseResult<Long, Map<String, Object>>(user).run(getTaxDeclareRecordWrapper(user)::contrast, taxDeclarationId);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -380,7 +382,6 @@ public class TaxDeclarationController {
|
|||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 刷新数据
|
||||
*
|
||||
|
|
|
|||
|
|
@ -312,6 +312,7 @@ public class TaxDeclareRecordWrapper extends Service {
|
|||
|
||||
/**
|
||||
* 新增申报表
|
||||
*
|
||||
* @param param
|
||||
*/
|
||||
public void addTaxDeclaration(TaxDeclarationAddParam param) {
|
||||
|
|
@ -638,10 +639,11 @@ public class TaxDeclareRecordWrapper extends Service {
|
|||
|
||||
/**
|
||||
* 对比算税结果
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
public void contrast(Long id) {
|
||||
getTaxDeclarationValueService(user).contrast(id);
|
||||
public Map<String, Object> contrast(Long id) {
|
||||
return getTaxDeclarationValueService(user).contrast(id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -724,6 +726,7 @@ public class TaxDeclareRecordWrapper extends Service {
|
|||
|
||||
/**
|
||||
* 新增表单
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -780,6 +783,7 @@ public class TaxDeclareRecordWrapper extends Service {
|
|||
|
||||
/**
|
||||
* 详细信息
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue