Commit 0afe9a3c authored by zhaji's avatar zhaji

Merge branch 'develop' into feature-zhaji

parents a020a84f 4ec4186c
......@@ -63,14 +63,14 @@ public class EkpIncomeUtil {
String body = obj.getBody();
if (StringUtils.isBlank(body)) {
log.error(EkpConstants.SEND_FAILED);
return null;
return EkpConstants.SEND_FAILED;
} else {
log.info(EkpConstants.SEND_SUCCESS + body);
return body;
}
} catch (Exception e) {
log.info(e.getMessage());
return null;
return e.getMessage();
}
}
public String sendToEkpRisk(EkpIncomeParamRisk param) {
......@@ -100,14 +100,14 @@ public class EkpIncomeUtil {
String body = obj.getBody();
if (StringUtils.isBlank(body)) {
log.error(EkpConstants.SEND_FAILED);
return null;
return EkpConstants.SEND_FAILED;
} else {
log.info(EkpConstants.SEND_SUCCESS + body);
return body;
}
} catch (Exception e) {
log.info(e.getMessage());
return null;
return e.getMessage();
}
}
......
......@@ -57,14 +57,14 @@ public class EkpSalaryUtil {
String body = obj.getBody();
if (StringUtils.isBlank(body)){
log.error(EkpConstants.SEND_FAILED);
return null;
return EkpConstants.SEND_FAILED;
}else{
log.info(EkpConstants.SEND_SUCCESS+body);
return body;
}
}catch (Exception e){
log.info(e.getMessage());
return null;
return e.getMessage();
}
}
......
......@@ -13,6 +13,10 @@ import java.io.Serializable;
@Data
public class EkpSalaryParam implements Serializable {
/**
* 工资id
**/
private String fd_3b10af838eab5c;
/**
* 项目编码
**/
......
package com.yifu.cloud.plus.v1.yifu.ekp.vo;
import lombok.Data;
/**
* @Author fxj
* @Date 2022/8/22
* @Description 薪资明细对应参数
* @Version 1.0
*/
@Data
public class EkpSalaryParamVo extends EkpSalaryParam {
/**
* 报账表id
**/
private String salaryAccountId;
}
......@@ -9,6 +9,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceOperate;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.Dept;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceDetailService;
......@@ -94,7 +95,7 @@ public class TInsuranceDetailController {
@PostMapping("/getInsuranceList")
@PreAuthorize("@pms.hasPermission('insurance_custserve_insure_export')")
public R<List<InsuranceListVO>> getInsuranceList(@RequestBody InsuranceListParam param) {
return R.ok(tInsuranceDetailService.getInsuranceList(param));
return tInsuranceDetailService.getInsuranceList(param);
}
/**
......@@ -255,6 +256,9 @@ public class TInsuranceDetailController {
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN);
}
if(param.size() > CommonConstants.IMPORT_TWENTY_THOUSAND){
return R.failed(InsurancesConstants.IMPORT_TOO_LONG);
}
return tInsuranceDetailService.insuranceHandleImport(user,param);
}
......
......@@ -54,9 +54,9 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
*
* @author licancan
* @param param
* @return {@link List<InsuranceListVO>}
* @return {@link R<List<InsuranceListVO>>}
*/
List<InsuranceListVO> getInsuranceList(InsuranceListParam param);
R<List<InsuranceListVO>> getInsuranceList(InsuranceListParam param);
/**
* 投保办理分页查询
......
......@@ -208,16 +208,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* 投保不分页查询
*
* @param param
* @return {@link List<InsuranceListVO>}
* @return {@link R<List<InsuranceListVO>>}
* @author licancan
*/
@Override
public List<InsuranceListVO> getInsuranceList(InsuranceListParam param) {
public R<List<InsuranceListVO>> getInsuranceList(InsuranceListParam param) {
YifuUser user = SecurityUtils.getUser();
List<String> deptList = getDeptNoList(user);
List<InsuranceListVO> insuranceList = new ArrayList<>();
if (CollectionUtils.isEmpty(deptList)){
return insuranceList;
return R.ok(insuranceList);
}
param.setDeptNoList(deptList);
insuranceList = baseMapper.getInsuranceList(param);
......@@ -225,11 +225,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
setProjectNameByDeptNo(insuranceList);
// 购买月数
if (CollectionUtils.isNotEmpty(insuranceList)){
if(insuranceList.size() > CommonConstants.EXPORT_TWENTY_THOUSAND){
return R.failed(InsurancesConstants.EXPORT_TOO_LONG);
}
insuranceList.stream().forEach(e ->{
e.setBuyMonth(LocalDateUtil.betweenMonth(e.getPolicyStart().toString(),e.getPolicyEnd().toString()));
});
}
return insuranceList;
return R.ok(insuranceList);
}
/**
* 投保办理分页查询
......@@ -277,6 +280,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (CollectionUtils.isEmpty(paramList)){
return R.failed(CommonConstants.DATA_CAN_NOT_EMPTY);
}
if(paramList.size() > CommonConstants.IMPORT_TWENTY_THOUSAND){
return R.failed(InsurancesConstants.IMPORT_TOO_LONG);
}
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN);
......@@ -327,6 +333,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (CollectionUtils.isEmpty(paramList)){
return R.failed(CommonConstants.DATA_CAN_NOT_EMPTY);
}
if(paramList.size() > CommonConstants.IMPORT_TWENTY_THOUSAND){
return R.failed(InsurancesConstants.IMPORT_TOO_LONG);
}
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN);
......@@ -375,6 +384,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (CollectionUtils.isEmpty(paramList)){
return R.failed(CommonConstants.DATA_CAN_NOT_EMPTY);
}
if(paramList.size() > CommonConstants.IMPORT_TWENTY_THOUSAND){
return R.failed(InsurancesConstants.IMPORT_TOO_LONG);
}
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN);
......@@ -880,6 +892,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
insuranceExportList = baseMapper.getInsuranceExportList(param);
}
if (CollectionUtils.isNotEmpty(insuranceExportList)){
if(insuranceExportList.size() > CommonConstants.EXPORT_TWENTY_THOUSAND){
return R.failed(InsurancesConstants.EXPORT_TOO_LONG);
}
List<TInsuranceDetail> detailList = new ArrayList<>();
//根据项目编码获取项目名称
List<String> collect = insuranceExportList.stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList());
......@@ -1261,8 +1276,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceSettleService.save(settle);
detail.setDefaultSettleId(settle.getId());
successList.add(detail);
//生成收入数据
createInsuranceInfo(detail);
if (detail.getBuyType() != CommonConstants.FOUR_INT) {
//生成收入数据
createInsuranceInfo(detail);
}
}else {
//按天
//计算起止时间的天数
......@@ -1295,8 +1312,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceSettleService.save(settle);
detail.setDefaultSettleId(settle.getId());
successList.add(detail);
//生成收入数据
createInsuranceInfo(detail);
if (detail.getBuyType() != CommonConstants.FOUR_INT) {
//生成收入数据
createInsuranceInfo(detail);
}
}
}
//实缴
......@@ -1372,6 +1391,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (CollectionUtils.isEmpty(paramList)){
return R.failed(CommonConstants.DATA_CAN_NOT_EMPTY);
}
if(paramList.size() > CommonConstants.IMPORT_TWENTY_THOUSAND){
return R.failed(InsurancesConstants.IMPORT_TOO_LONG);
}
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN);
......@@ -5913,7 +5935,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
int isSum = 0;
if (Common.isNotNull(settleDomain)) {
// 含有商险,则计算收入
if (Common.isNotNull(settleDomain.getManageServerItem()) && settleDomain.getManageServerItem().contains(CommonConstants.THREE_STRING)) {
if (Common.isNotNull(settleDomain.getManageServerItem()) && settleDomain.getManageServerItem()
.contains(CommonConstants.THREE_STRING)) {
//预估模式
if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType())) {
if (CommonConstants.ZERO_STRING.equals(settleDomain.getManagementTag())) {
......@@ -5943,7 +5966,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
}
if (Common.isNotNull(settleDomain.getRiskServerItem()) && settleDomain.getRiskServerItem().contains(CommonConstants.THREE_STRING)) {
if (Common.isNotNull(settleDomain.getRiskServerItem()) && settleDomain.getRiskServerItem()
.contains(CommonConstants.THREE_STRING)) {
//预估模式
if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType()) &&
CommonConstants.ZERO_STRING.equals(settleDomain.getRiskFundTag())) {
......@@ -6000,6 +6024,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setCharges(charges);
detail.setMrSettleType(settleDomain.getMrSettleType());
detail.setId(CommonConstants.NULL);
detail.setRedData(CommonConstants.ZERO_STRING);
socialDaprUtils.createTIncomeDetail(detail);
}
......@@ -6012,13 +6037,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
for (TIncomeDetail detail : detailList.getData().getDetailList()) {
TIncomeDetail detail1 = new TIncomeDetail();
BeanCopyUtils.copyProperties(detail, detail1);
socialDaprUtils.deleteById(detail);
//已推送的数据生成红冲数据
if (settle.getIsEstimatePush() == CommonConstants.ONE_INT ||
settle.getIsActualPush() == CommonConstants.ONE_INT) {
detail1.setMoney(detail1.getMoney().negate());
socialDaprUtils.createTIncomeDetail(detail1);
}
detail1.setId(CommonConstants.NULL);
detail1.setRedData(CommonConstants.ONE_STRING);
detail1.setMoney(detail1.getMoney().negate());
socialDaprUtils.createTIncomeDetail(detail1);
}
}
}
......
......@@ -110,4 +110,8 @@ public class OrderConstants {
* 附件超出上传上限
*/
public static final String ENCLOSURE_SIZE_ERROR = "附件超出上传上限";
/**
* 一次性导出不可超过20000条,请分批导出
*/
public static final String EXPORT_TOO_LONG = "一次性导出不可超过20000条,请分批导出";
}
......@@ -60,7 +60,7 @@ public class OrderController {
@GetMapping("/getOrderList")
@PreAuthorize("@pms.hasPermission('order:order_getOrderList')")
public R<List<OrderListVO>> getOrderList(OrderListParam param) {
return R.ok(tOrderService.getOrderList(param));
return tOrderService.getOrderList(param);
}
/**
......
......@@ -34,9 +34,9 @@ public interface TOrderService extends IService<TOrder> {
*
* @author licancan
* @param param
* @return {@link List<OrderListVO>}
* @return {@link R<List<OrderListVO>>}
*/
List<OrderListVO> getOrderList(OrderListParam param);
R<List<OrderListVO>> getOrderList(OrderListParam param);
/**
* 变更订单状态
......
......@@ -83,7 +83,7 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
* @author licancan
*/
@Override
public List<OrderListVO> getOrderList(OrderListParam param) {
public R<List<OrderListVO>> getOrderList(OrderListParam param) {
YifuUser user = SecurityUtils.getUser();
List<OrderListVO> list;
if (CollectionUtils.isNotEmpty(param.getIdList())){
......@@ -91,7 +91,12 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
}else {
list = baseMapper.getOrderList(param,user.getUsername());
}
return list;
if (CollectionUtils.isNotEmpty(list)){
if(list.size() > CommonConstants.EXPORT_TWENTY_THOUSAND){
return R.failed(OrderConstants.EXPORT_TOO_LONG);
}
}
return R.ok(list);
}
/**
......
......@@ -20,7 +20,7 @@ package com.yifu.cloud.plus.v1.yifu.salary.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParamVo;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParam;
import com.yifu.cloud.plus.v1.yifu.salary.entity.THaveSalaryNosocial;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount;
import com.yifu.cloud.plus.v1.yifu.salary.vo.AccountCheckVo;
......@@ -38,25 +38,26 @@ import java.util.List;
*/
@Mapper
public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> {
/**
* 工资报账主表(工资条)简单分页查询
* @param tSalaryAccount 工资报账主表(工资条)
* @return
*/
IPage<TSalaryAccount> getTSalaryAccountPage(Page<TSalaryAccount> page, @Param("tSalaryAccount") TSalaryAccount tSalaryAccount);
/**
* 工资报账主表(工资条)简单分页查询
*
* @param tSalaryAccount 工资报账主表(工资条)
* @return
*/
IPage<TSalaryAccount> getTSalaryAccountPage(Page<TSalaryAccount> page, @Param("tSalaryAccount") TSalaryAccount tSalaryAccount);
/**
* @param settleId
* @param settleMonth
* @Description: 版本2.6.6判重:对同一“结算主体”、同一“结算月份”、同一“报表类型”、同一“工资月份”、同一“身份证号”、同一“应发金额”进行校验
*
* <p>
* 校验导入数据重复的Map格式:# 身份证号_工资月份_报表类型_应发金额
*
* @Author: hgw
* @Date: 2021/9/17 18:06
* @return: java.util.List<java.lang.String>
**/
List<AccountCheckVo> getAccountCheckList(@Param("settleId") String settleId, @Param("settleMonth") String settleMonth);
List<AccountCheckVo> getAccountSpecialList(@Param("invoiceTitle") String invoiceTitle, @Param("unitId") String unitId, @Param("salaryMonth") String salaryMonth);
List<AccountCheckVo> getAccountCheckListLabor(@Param("settleId") String settleId, @Param("settleMonth") String settleMonth);
......@@ -72,15 +73,15 @@ public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> {
String getMinTaxMonthByNowYear(@Param("empIdCard") String empIdCard, @Param("nowYear") int nowYear);
/**
* @return
* @Author fxj
* @Description 获取有工资无社保数据
* @Date 17:23 2022/8/16
* @Param
* @return
**/
List<THaveSalaryNosocial> getLastMonthTHaveSalaryNosocial(@Param("month")String month,
@Param("month2")String month2,
@Param("month3")String month3);
**/
List<THaveSalaryNosocial> getLastMonthTHaveSalaryNosocial(@Param("month") String month,
@Param("month2") String month2,
@Param("month3") String month3);
/**
* @Description: 薪资类型互斥校验 获取本年度身份证号列表
......@@ -97,10 +98,10 @@ public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> {
* @Date: 2022/8/29 16:52
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParam>
**/
List<EkpSalaryParamVo> getEkpSalaryParamList(@Param("salaryId") String salaryId);
List<EkpSalaryParam> getEkpSalaryParamList(@Param("salaryId") String salaryId);
List<TSalaryAccount> noPageDiy(@Param("searchVo") TSalaryAccountSearchVo searchVo,
@Param("idList")List<String> idList);
@Param("idList") List<String> idList);
/**
* @Description: 根据工资id,返回报账明细(字段较少且有计算,其他地方勿用)
......@@ -111,5 +112,5 @@ public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> {
List<TSalaryAccount> getListByIncome(@Param("salaryId") String salaryId);
int noPageCountDiy(@Param("searchVo") TSalaryAccountSearchVo searchVo,
@Param("idList")List<String> idList);
@Param("idList") List<String> idList);
}
......@@ -20,7 +20,7 @@ package com.yifu.cloud.plus.v1.yifu.salary.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParamVo;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParam;
import com.yifu.cloud.plus.v1.yifu.salary.entity.THaveSalaryNosocial;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryAccountSearchVo;
......@@ -104,5 +104,5 @@ public interface TSalaryAccountService extends IService<TSalaryAccount> {
* @Date: 2022/8/29 16:54
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParam>
**/
List<EkpSalaryParamVo> getEkpSalaryParamList(String salaryId);
List<EkpSalaryParam> getEkpSalaryParamList(String salaryId);
}
......@@ -26,7 +26,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ExcelUtil;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParamVo;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParam;
import com.yifu.cloud.plus.v1.yifu.salary.entity.THaveSalaryNosocial;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryAccountMapper;
......@@ -212,7 +212,7 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
}
@Override
public List<EkpSalaryParamVo> getEkpSalaryParamList(String salaryId) {
public List<EkpSalaryParam> getEkpSalaryParamList(String salaryId) {
return baseMapper.getEkpSalaryParamList(salaryId);
}
......
......@@ -35,7 +35,6 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.ekp.util.EkpSalaryUtil;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParam;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParamVo;
import com.yifu.cloud.plus.v1.yifu.salary.entity.MSalaryEstimate;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TApprovalRecord;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount;
......@@ -49,9 +48,9 @@ import com.yifu.cloud.plus.v1.yifu.salary.util.SalaryConstants;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardExportVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardSearchVo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TIncomeDetail;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSendEkpError;
import com.yifu.cloud.plus.v1.yifu.social.vo.TIncomeDetailReturnVo;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Service;
......@@ -314,7 +313,8 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
TIncomeDetailReturnVo vo = detailR.getData();
List<TIncomeDetail> detailList = vo.getDetailList();
for (TIncomeDetail incomeDetail : detailList) {
value = detailMap.get(incomeDetail.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING + incomeDetail.getFeeType()
value = detailMap.get(incomeDetail.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING
+ incomeDetail.getDeptId() + CommonConstants.DOWN_LINE_STRING + incomeDetail.getFeeType()
+ CommonConstants.DOWN_LINE_STRING + incomeDetail.getSourceType());
if (Common.isEmpty(value)) {
value = CommonConstants.ZERO_INT;
......@@ -325,6 +325,7 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
value--;
}
detailMap.put(incomeDetail.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING
+ incomeDetail.getDeptId() + CommonConstants.DOWN_LINE_STRING
+ incomeDetail.getFeeType() + CommonConstants.DOWN_LINE_STRING
+ incomeDetail.getSourceType(), value);
}
......@@ -513,7 +514,7 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
return R.failed("未找到工资表");
} else if (s.getStatus() == SalaryConstants.STATUS[2] || s.getStatus() == SalaryConstants.STATUS[10]) {
//报账表
List<EkpSalaryParamVo> ekpList = salaryAccountService.getEkpSalaryParamList(id);
List<EkpSalaryParam> ekpList = salaryAccountService.getEkpSalaryParamList(id);
YifuUser user = SecurityUtils.getUser();
if (user != null && ekpList != null && !ekpList.isEmpty()) {
boolean sendStatus = true;
......@@ -522,14 +523,14 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
TSalaryAccount account;
Date sendTime = new Date();
String nowMonth = DateUtil.addMonth(0);
EkpSalaryParam sendParam;
for (EkpSalaryParamVo sendParamVo : ekpList) {
for (EkpSalaryParam sendParam : ekpList) {
// 转化报账表的参数
account = new TSalaryAccount();
account.setId(sendParamVo.getSalaryAccountId());
sendParam = new EkpSalaryParam();
BeanUtils.copyProperties(sendParamVo, sendParam);
account.setId(sendParam.getFd_3b10af838eab5c());
sendBack = ekpSalaryUtil.sendToEKP(sendParam);
if (Common.isEmpty(sendBack) || sendBack.length() != 32) {
sendBack = ekpSalaryUtil.sendToEKP(sendParam);
}
account.setSendTime(sendTime);
account.setSendUser(user.getId());
account.setSendUserName(user.getNickname());
......@@ -539,6 +540,16 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
account.setEkpId(sendBack);
} else {
sendStatus = false;
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.ONE_STRING);
error.setCreateUserName(s.getCreateName());
error.setLinkId(account.getId());
error.setTitle(sendBack);
error.setNums(CommonConstants.ONE_INT);
HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
, "/tsendekperror/inner/saveError", error, Boolean.class, SecurityConstants.FROM_IN);
}
accountList.add(account);
}
......
......@@ -81,8 +81,8 @@
</resultMap>
<!-- 对接EKP的参数 -->
<resultMap id="ekpSalaryParamVoMap" type="com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParamVo">
<id property="salaryAccountId" column="id"/>
<resultMap id="ekpSalaryParamVoMap" type="com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParam">
<result property="fd_3b10af838eab5c" column="fd_3b10af838eab5c"/>
<result property="fd_3adfedf98ccba2" column="fd_3adfedf98ccba2"/>
<result property="fd_3adfedf9d2bf1c" column="fd_3adfedf9d2bf1c"/>
<result property="fd_3adfedfacd65d6" column="fd_3adfedfacd65d6"/>
......@@ -444,7 +444,7 @@
<!-- 获取薪资明细 -->
<select id="getEkpSalaryParamList" resultMap="ekpSalaryParamVoMap">
select
a.id
ifnull(a.id,'') fd_3b10af838eab5c
,ifnull(a.DEPT_NO,'') fd_3adfedf98ccba2
,ifnull(a.DEPT_NAME,'') fd_3adfedf9d2bf1c
,'' fd_3adfedfa4410aa
......
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.social.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Date;
/**
* 推送ekp报错的记录表
*
* @author hgw
* @date 2022-9-7 16:11:24
*/
@Data
@TableName("t_send_ekp_error")
@Schema(description = "推送ekp报错的记录表(同类型仅1条记录,更新计数器)")
public class TSendEkpError {
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("主键")
private String id;
@ExcelAttribute(name = "内容")
@ExcelProperty("内容")
private String title;
@ExcelAttribute(name = "类型")
@ExcelProperty("类型(1薪资明细2预估明细3缴费明细4实时收入5定时收入)")
private String type;
@ExcelAttribute(name = "创建日")
@ExcelProperty("创建日")
private String createDay;
@ExcelAttribute(name = "关联ID")
@ExcelProperty("关联ID")
private String linkId;
@ExcelAttribute(name = "创建时间")
@ExcelProperty("创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
@ExcelAttribute(name = "创建人姓名")
@ExcelProperty("创建人姓名")
private String createUserName;
@ExcelAttribute(name = "计数器")
@ExcelProperty("计数器")
private Integer nums;
}
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
......@@ -124,6 +125,7 @@ public class IncomeExportVo implements Serializable {
/**
* 数据生成时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@NotBlank(message = "数据生成时间 不能为空")
@ExcelAttribute(name = "数据生成时间", isNotEmpty = true, errorInfo = "数据生成时间 不能为空", isDate = true)
@Schema(description = "数据生成时间")
......
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.social.controller;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSendEkpError;
import com.yifu.cloud.plus.v1.yifu.social.service.TSendEkpErrorService;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 推送ekp报错的记录表
*
* @author hgw
* @date 2022-08-30 17:34:58
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tsendekperror")
@Tag(name = "推送ekp报错的记录表")
public class TSendEkpErrorController {
private final TSendEkpErrorService tSendEkpErrorService;
/**
* @Description: 新增-推送ekp报错的记录表
* @Author: hgw
* @Date: 2022/8/31 16:34
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
**/
@Inner
@PostMapping("/inner/saveError")
public Boolean saveError(@RequestBody TSendEkpError tSendEkpError) {
return tSendEkpErrorService.saveError(tSendEkpError);
}
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.social.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSendEkpError;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* error存储
*
* @author hgw
* @date 2022-9-7 16:28:46
*/
@Mapper
public interface TSendEkpErrorMapper extends BaseMapper<TSendEkpError> {
/**
* @param tSendEkpError
* @Description: 查找对应类型的1条数据来更新
* @Author: hgw
* @Date: 2022/9/7 16:56
* @return: com.yifu.cloud.plus.v1.yifu.social.entity.TSendEkpError
**/
TSendEkpError getByTitleTypeDay( @Param("tSendEkpError") TSendEkpError tSendEkpError);
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.social.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSendEkpError;
/**
* 收入明细表
*
* @author hgw
* @date 2022-08-30 17:34:58
*/
public interface TSendEkpErrorService extends IService<TSendEkpError> {
/**
* @Description: 新增-推送ekp报错的记录表;
* @Author: hgw
* @Date: 2022/8/31 16:31
* @return: boolean
**/
boolean saveError(TSendEkpError tSendEkpError);
}
......@@ -37,6 +37,7 @@ import com.yifu.cloud.plus.v1.yifu.ekp.util.EkpFundUtil;
import com.yifu.cloud.plus.v1.yifu.ekp.util.EkpSocialUtil;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushFundParam;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushSocialParam;
import com.yifu.cloud.plus.v1.yifu.insurances.util.BeanCopyUtils;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentBySalaryVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.UpdateSocialFoundVo;
......@@ -1553,11 +1554,21 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
baseMapper.deleteById(library.getId());
}
//删除停缴月以后的收入数据
detailService.remove(Wrappers.<TIncomeDetail>query().lambda().eq(TIncomeDetail::getEmpIdcard,library.getEmpIdcard())
List<TIncomeDetail> updateList = detailService.list(Wrappers.<TIncomeDetail>query().lambda()
.eq(TIncomeDetail::getEmpIdcard,library.getEmpIdcard())
.eq(TIncomeDetail::getDeptId,library.getSettleDomainId())
.eq(TIncomeDetail::getSourceType,CommonConstants.ONE_STRING)
.eq(TIncomeDetail::getPayMonth,library.getSocialPayMonth()));
if (Common.isNotNull(updateList)) {
for (TIncomeDetail upd : updateList) {
TIncomeDetail detail = new TIncomeDetail();
BeanCopyUtils.copyProperties(upd, detail);
detail.setId(CommonConstants.NULL);
detail.setRedData(CommonConstants.ONE_STRING);
detail.setMoney(detail.getMoney().negate());
incomeService.saveDetail(detail);
}
}
}
private void calculateFundType(BigDecimal zero, TForecastLibrary library) {
......@@ -1581,10 +1592,21 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
}
//删除停缴月以后的收入数据
detailService.remove(Wrappers.<TIncomeDetail>query().lambda().eq(TIncomeDetail::getEmpIdcard,library.getEmpIdcard())
List<TIncomeDetail> updateList = detailService.list(Wrappers.<TIncomeDetail>query().lambda()
.eq(TIncomeDetail::getEmpIdcard,library.getEmpIdcard())
.eq(TIncomeDetail::getDeptId,library.getSettleDomainId())
.eq(TIncomeDetail::getSourceType,CommonConstants.TWO_STRING)
.eq(TIncomeDetail::getPayMonth,library.getSocialPayMonth()));
if (Common.isNotNull(updateList)) {
for (TIncomeDetail upd : updateList) {
TIncomeDetail detail = new TIncomeDetail();
BeanCopyUtils.copyProperties(upd, detail);
detail.setId(CommonConstants.NULL);
detail.setRedData(CommonConstants.ONE_STRING);
detail.setMoney(detail.getMoney().negate());
incomeService.saveDetail(detail);
}
}
}
/**
......@@ -1790,7 +1812,23 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
library.setCreateTime(LocalDateTime.now());
baseMapper.insert(library);
isSaveAndUpdate = true;
}
}
}
if (Common.isNotNull(socialFundInfo.getSocialId())
&& CommonConstants.FOUR_STRING.equals(socialFundInfo.getSocialStatus())
|| CommonConstants.THREE_STRING.equals(socialFundInfo.getSocialStatus())) {
//获取所有的预估数据
List<TForecastLibrary> librarySocialInfoList = null;
librarySocialInfoList = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getEmpIdcard, empIdCard)
.eq(TForecastLibrary::getDataType, CommonConstants.ZERO_INT)
.eq(TForecastLibrary::getSettleDomainId,socialFundInfo.getSettleDomain())
.in(TForecastLibrary::getSocialPayMonth, payMonthList));
if (Common.isNotNull(librarySocialInfoList)) {
for (TForecastLibrary library :librarySocialInfoList) {
//办理成功生成收入
createIncomeInfo(library);
}
......@@ -2114,12 +2152,28 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
library.setCreateName("定时生成");
library.setCreateTime(LocalDateTime.now());
baseMapper.insert(library);
//办理成功生成收入
createIncomeInfo(library);
}
isSaveAndUpdate = true;
}
if (Common.isNotNull(socialFundInfo.getSocialId())
&& CommonConstants.FOUR_STRING.equals(socialFundInfo.getSocialStatus())
|| CommonConstants.THREE_STRING.equals(socialFundInfo.getSocialStatus())) {
//获取所有的预估数据
List<TForecastLibrary> librarySocialInfoList = null;
librarySocialInfoList = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getEmpIdcard, empIdCard)
.eq(TForecastLibrary::getDataType, CommonConstants.ZERO_INT)
.eq(TForecastLibrary::getSettleDomainId,socialFundInfo.getSettleDomain())
.in(TForecastLibrary::getSocialPayMonth, payMonthList));
if (Common.isNotNull(librarySocialInfoList)) {
for (TForecastLibrary library :librarySocialInfoList) {
//办理成功生成收入
createIncomeInfo(library);
}
}
}
if (isSaveAndUpdate) {
return R.ok(null, "执行成功!");
} else {
......@@ -2223,6 +2277,9 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
}
}
}
if (CommonConstants.ZERO_STRING.equals(settleDomain.getSocialType())) {
continue;
}
EkpPushSocialParam socialParam = new EkpPushSocialParam();
//员工姓名
socialParam.setFd_3adfe8c79989d4(library.getEmpName());
......@@ -2451,6 +2508,9 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
}
}
}
if (CommonConstants.ZERO_STRING.equals(settleDomain.getFundType())) {
continue;
}
EkpPushFundParam fundParam = new EkpPushFundParam();
//员工姓名
fundParam.setFd_3adfe8c79989d4(library.getEmpName());
......@@ -2469,14 +2529,14 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
fundParam.setFd_3adfeb52a4d2e2(CommonConstants.EMPTY_STRING);
}
//缴纳月份
if (Common.isNotNull(library.getSocialPayMonth())) {
fundParam.setFd_3adfe8cf632700(dateStringInsert(library.getSocialPayMonth()));
if (Common.isNotNull(library.getProvidentPayMonth())) {
fundParam.setFd_3adfe8cf632700(dateStringInsert(library.getProvidentPayMonth()));
} else {
fundParam.setFd_3adfe8cf632700(CommonConstants.EMPTY_STRING);
}
//生成月份
if (Common.isNotNull(library.getSocialCreateMonth())) {
fundParam.setFd_3adfe8cb96c41e(dateStringInsert(library.getSocialCreateMonth()));
if (Common.isNotNull(library.getProvidentCreateMonth())) {
fundParam.setFd_3adfe8cb96c41e(dateStringInsert(library.getProvidentCreateMonth()));
} else {
fundParam.setFd_3adfe8cb96c41e(CommonConstants.EMPTY_STRING);
}
......@@ -2594,7 +2654,13 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
incomeDetail.setSourceType(sourceType);
List<TIncomeDetail> detailList = detailService.getTIncomeDetailList(incomeDetail);
if (Common.isNotNull(detailList)) {
isExist = true;
BigDecimal sumMoney = BigDecimal.ZERO;
for (TIncomeDetail income : detailList) {
sumMoney = BigDecimalUtils.safeAdd(income.getMoney(),sumMoney);
}
if (sumMoney.compareTo(BigDecimal.ZERO) == CommonConstants.ONE_INT) {
isExist = true;
}
}
//判断是否为按人次收费
......@@ -2602,8 +2668,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
if (Common.isNotNull(settleDomain)) {
// 含有社保,则计算收入
if (Common.isNotNull(settleDomain.getManageServerItem()) && ((settleDomain.getManageServerItem().contains(CommonConstants.ONE_STRING)
&& CommonConstants.ONE_STRING.equals(sourceType)) || (settleDomain.getManageServerItem().contains(CommonConstants.TWO_STRING))
&& CommonConstants.ONE_STRING.equals(sourceType))) {
&& CommonConstants.ONE_STRING.equals(sourceType)) || (settleDomain.getManageServerItem().contains(CommonConstants.TWO_STRING)
&& CommonConstants.TWO_STRING.equals(sourceType)))) {
//预估模式
if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType())) {
if (CommonConstants.ZERO_STRING.equals(settleDomain.getManagementTag())) {
......@@ -2635,8 +2701,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
}
}
if (Common.isNotNull(settleDomain.getRiskServerItem()) && ((settleDomain.getRiskServerItem().contains(CommonConstants.ONE_STRING)
&& CommonConstants.ONE_STRING.equals(sourceType)) || (settleDomain.getRiskServerItem().contains(CommonConstants.TWO_STRING))
&& CommonConstants.ONE_STRING.equals(sourceType))) {
&& CommonConstants.ONE_STRING.equals(sourceType)) || (settleDomain.getRiskServerItem().contains(CommonConstants.TWO_STRING)
&& CommonConstants.TWO_STRING.equals(sourceType)))) {
//预估模式
if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType()) &&
CommonConstants.ZERO_STRING.equals(settleDomain.getRiskFundTag())) {
......@@ -2698,6 +2764,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
detail.setFeeMode(feeMode);
detail.setCharges(charges);
detail.setMrSettleType(settleDomain.getMrSettleType());
detail.setRedData(CommonConstants.ZERO_STRING);
detail.setId(CommonConstants.NULL);
incomeService.saveDetail(detail);
}
......
......@@ -31,14 +31,15 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.ekp.util.EkpIncomeUtil;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParam;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamManage;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamRisk;
import com.yifu.cloud.plus.v1.yifu.social.entity.TIncome;
import com.yifu.cloud.plus.v1.yifu.social.entity.TIncomeDetail;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSendEkpError;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TIncomeMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TIncomeDetailService;
import com.yifu.cloud.plus.v1.yifu.social.service.TIncomeService;
import com.yifu.cloud.plus.v1.yifu.social.service.TSendEkpErrorService;
import com.yifu.cloud.plus.v1.yifu.social.vo.IncomeExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TIncomeSearchVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TIncomeVo;
......@@ -66,6 +67,9 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
@Autowired
private TIncomeDetailService tIncomeDetailService;
@Autowired
private TSendEkpErrorService tSendEkpErrorService;
@Autowired
private EkpIncomeUtil ekpIncomeUtil;
......@@ -315,11 +319,24 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
income.setSendStatus(CommonConstants.ZERO_STRING);
this.save(income);
String sendBack = this.getSendBack(income);
if (Common.isEmpty(sendBack) || sendBack.length() != 32) {
sendBack = this.getSendBack(income);
}
income.setSendTime(new Date());
if (Common.isNotNull(sendBack) && sendBack.length() == 32) {
income.setSendStatus(CommonConstants.ONE_STRING);
income.setSendMonth(DateUtil.addMonth(0));
income.setEkpId(sendBack);
} else {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.FOUR_STRING);
error.setCreateUserName("收入表推送");
error.setLinkId(income.getId());
error.setTitle(sendBack);
error.setNums(CommonConstants.ONE_INT);
tSendEkpErrorService.saveError(error);
}
return this.updateById(income);
}
......@@ -518,21 +535,8 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
return this.saveIncome(tIncomeDetail);
}
} else {
Integer myNum = numMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getSourceType()
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
Integer socialNum = numMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + CommonConstants.ONE_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
Integer fundNum = numMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + CommonConstants.TWO_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
Integer insureNum = numMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + CommonConstants.THREE_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
Integer salaryNum = numMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + CommonConstants.FOUR_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
// 红冲判断:当本类型是最大值,才可以红冲
if (myNum != null && myNum > ifNullToZero(socialNum) && myNum > ifNullToZero(fundNum)
&& myNum > ifNullToZero(insureNum) && myNum > ifNullToZero(salaryNum)) {
return this.saveIncome(tIncomeDetail);
}
if (this.redDateJudge(tIncomeDetail, numMap)) return this.saveIncome(tIncomeDetail);
}
} else if (CommonConstants.THREE_STRING.equals(tIncomeDetail.getSourceType())) {
// 商险。收费方式:2金额-人数
......@@ -543,21 +547,7 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
return this.saveIncome(tIncomeDetail);
}
} else {
Integer myNum = numMap.get(tIncomeDetail.getDataCreateMonth() + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getSourceType()
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
Integer socialNum = numMap.get(tIncomeDetail.getDataCreateMonth() + CommonConstants.DOWN_LINE_STRING + CommonConstants.ONE_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
Integer fundNum = numMap.get(tIncomeDetail.getDataCreateMonth() + CommonConstants.DOWN_LINE_STRING + CommonConstants.TWO_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
Integer insureNum = numMap.get(tIncomeDetail.getDataCreateMonth() + CommonConstants.DOWN_LINE_STRING + CommonConstants.THREE_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
Integer salaryNum = numMap.get(tIncomeDetail.getDataCreateMonth() + CommonConstants.DOWN_LINE_STRING + CommonConstants.FOUR_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
// 红冲判断:当本类型是最大值,才可以红冲
if (myNum != null && myNum > ifNullToZero(socialNum) && myNum > ifNullToZero(fundNum)
&& myNum > ifNullToZero(insureNum) && myNum > ifNullToZero(salaryNum)) {
return this.saveIncome(tIncomeDetail);
}
if (this.redDateJudge(tIncomeDetail, numMap)) return this.saveIncome(tIncomeDetail);
}
} else {
// 各个模式累加逻辑:
......@@ -580,6 +570,43 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
return true;
}
/**
* @Description: 红冲判断
* @Author: hgw
* @Date: 2022/9/7 17:27
* @return: boolean
**/
private boolean redDateJudge(TIncomeDetail tIncomeDetail, Map<String, Integer> numMap) {
Integer socialNum = CommonConstants.ZERO_INT;
Integer fundNum = CommonConstants.ZERO_INT;
Integer insureNum = CommonConstants.ZERO_INT;
Integer salaryNum = CommonConstants.ZERO_INT;
Integer myNum = numMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getSourceType()
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
if (!CommonConstants.ONE_STRING.equals(tIncomeDetail.getSourceType())) {
socialNum = numMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + CommonConstants.ONE_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
}
if (!CommonConstants.TWO_STRING.equals(tIncomeDetail.getSourceType())) {
fundNum = numMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + CommonConstants.TWO_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
}
if (!CommonConstants.THREE_STRING.equals(tIncomeDetail.getSourceType())) {
insureNum = numMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + CommonConstants.THREE_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
}
if (!CommonConstants.FOUR_STRING.equals(tIncomeDetail.getSourceType())) {
salaryNum = numMap.get(tIncomeDetail.getPayMonth() + CommonConstants.DOWN_LINE_STRING + CommonConstants.FOUR_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
}
// 红冲判断:当本类型是最大值,才可以红冲
if (myNum != null && myNum > ifNullToZero(socialNum) && myNum > ifNullToZero(fundNum)
&& myNum > ifNullToZero(insureNum) && myNum > ifNullToZero(salaryNum)) {
return true;
}
return false;
}
private int ifNullToZero(Integer num) {
if (num == null) {
return CommonConstants.ZERO_INT;
......@@ -607,21 +634,8 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
return this.saveIncome(tIncomeDetail);
}
} else {
Integer myNum = numMap.get(month + CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getSourceType()
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
Integer socialNum = numMap.get(month + CommonConstants.DOWN_LINE_STRING + CommonConstants.ONE_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
Integer fundNum = numMap.get(month + CommonConstants.DOWN_LINE_STRING + CommonConstants.TWO_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
Integer insureNum = numMap.get(month + CommonConstants.DOWN_LINE_STRING + CommonConstants.THREE_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
Integer salaryNum = numMap.get(month + CommonConstants.DOWN_LINE_STRING + CommonConstants.FOUR_STRING
+ CommonConstants.DOWN_LINE_STRING + tIncomeDetail.getFeeType());
// 红冲判断:当本类型是最大值,才可以红冲
if (myNum != null && myNum > ifNullToZero(socialNum) && myNum > ifNullToZero(fundNum)
&& myNum > ifNullToZero(insureNum) && myNum > ifNullToZero(salaryNum)) {
return this.saveIncome(tIncomeDetail);
}
if (this.redDateJudge(tIncomeDetail, numMap)) return this.saveIncome(tIncomeDetail);
}
return false;
}
......
......@@ -28,12 +28,9 @@ 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.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.check.entity.TCheckIdCard;
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.TSettleDomain;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ProjectSetInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.SetInfoVo;
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.CommonConstants;
......@@ -48,8 +45,6 @@ import com.yifu.cloud.plus.v1.yifu.ekp.util.EkpFundUtil;
import com.yifu.cloud.plus.v1.yifu.ekp.util.EkpSocialUtil;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushFundParam;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushSocialParam;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsDeclarer;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentBySalaryVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.UpdateSocialFoundVo;
......@@ -64,7 +59,6 @@ import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentHeFeiVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoSearchVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoVo;
import lombok.extern.log4j.Log4j2;
import org.checkerframework.checker.units.qual.C;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -2381,8 +2375,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
//订单类型
socialParam.setFd_3add9dd7833db8(SocialConstants.DIFF_TYPE_THR);
//是否有预估
if (Common.isNotNull(settleDomain.getMrSettleType()) &&
CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType())) {
if (Common.isNotNull(settleDomain.getSocialType()) &&
CommonConstants.ONE_STRING.equals(settleDomain.getSocialType())) {
socialParam.setFd_3add9de0be85e4(CommonConstants.IS_TRUE);
} else {
socialParam.setFd_3add9de0be85e4(CommonConstants.IS_FALSE);
......@@ -2598,8 +2592,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
//订单类型
fundParam.setFd_3add9dd7833db8(SocialConstants.DIFF_TYPE_THR);
//是否有预估
if (Common.isNotNull(settleDomain.getMrSettleType()) &&
CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType())) {
if (Common.isNotNull(settleDomain.getFundType()) &&
CommonConstants.ONE_STRING.equals(settleDomain.getFundType())) {
fundParam.setFd_3add9de0be85e4(CommonConstants.IS_TRUE);
} else {
fundParam.setFd_3add9de0be85e4(CommonConstants.IS_FALSE);
......@@ -2693,24 +2687,28 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
Boolean exitFlag = false;
TIncomeDetail exitIncome = new TIncomeDetail();
List<TIncomeDetail> exitIncome = new ArrayList<>();
if (CommonConstants.ONE_STRING.equals(socialFundFlag)) {
exitIncome = detailMapper.selectOne(Wrappers.<TIncomeDetail>query().lambda()
exitIncome = detailMapper.selectList(Wrappers.<TIncomeDetail>query().lambda()
.eq(TIncomeDetail::getEmpIdcard, paymentInfo.getEmpIdcard())
.eq(TIncomeDetail::getPayMonth, paymentInfo.getSocialPayMonth())
.eq(TIncomeDetail::getDeptId, paymentInfo.getSettleDomainId())
.eq(TIncomeDetail::getSourceType, CommonConstants.ONE_STRING)
.last(CommonConstants.LAST_ONE_SQL));
.eq(TIncomeDetail::getSourceType, CommonConstants.ONE_STRING));
} else {
exitIncome = detailMapper.selectOne(Wrappers.<TIncomeDetail>query().lambda()
exitIncome = detailMapper.selectList(Wrappers.<TIncomeDetail>query().lambda()
.eq(TIncomeDetail::getEmpIdcard, paymentInfo.getEmpIdcard())
.eq(TIncomeDetail::getPayMonth, paymentInfo.getSocialPayMonth())
.eq(TIncomeDetail::getDeptId, paymentInfo.getSettleDomainId())
.eq(TIncomeDetail::getSourceType, CommonConstants.TWO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
.eq(TIncomeDetail::getSourceType, CommonConstants.TWO_STRING));
}
if (Common.isNotNull(exitIncome)) {
exitFlag = true;
BigDecimal sumMoney = BigDecimal.ZERO;
for (TIncomeDetail income : exitIncome) {
sumMoney = BigDecimalUtils.safeAdd(income.getMoney(),sumMoney);
}
if (sumMoney.compareTo(BigDecimal.ZERO) == CommonConstants.ONE_INT) {
exitFlag = true;
}
}
//判断是否为按人次收费
......@@ -2821,6 +2819,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
detail.setCharges(charges);
detail.setMrSettleType(settleDomain.getMrSettleType());
detail.setId(CommonConstants.NULL);
detail.setRedData(CommonConstants.ZERO_STRING);
incomeService.saveDetail(detail);
}
......
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.social.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSendEkpError;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TSendEkpErrorMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TSendEkpErrorService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
/**
* 收入明细表
*
* @author hgw
* @date 2022-08-30 17:34:58
*/
@Log4j2
@Service
public class TSendEkpErrorServiceImpl extends ServiceImpl<TSendEkpErrorMapper, TSendEkpError> implements TSendEkpErrorService {
/**
* @Description: 新增-推送ekp报错的记录表;
* @Author: hgw
* @Date: 2022/8/31 16:34
* @return: boolean
**/
@Override
public boolean saveError(TSendEkpError tSendEkpError) {
// 类型、创建日不可为空
if (Common.isEmpty(tSendEkpError.getType()) || Common.isEmpty(tSendEkpError.getCreateDay())) {
return false;
}
TSendEkpError error = baseMapper.getByTitleTypeDay(tSendEkpError);
if (error == null) {
return this.save(tSendEkpError);
} else {
error.setNums(error.getNums()+ CommonConstants.ONE_INT);
return this.updateById(error);
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.social.mapper.TSendEkpErrorMapper">
<resultMap id="tSendEkpErrorMap" type="com.yifu.cloud.plus.v1.yifu.social.entity.TSendEkpError">
<id property="id" column="ID"/>
<result property="title" column="title"/>
<result property="type" column="TYPE"/>
<result property="createDay" column="CREATE_DAY"/>
<result property="linkId" column="LINK_ID"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="createUserName" column="CREATE_USER_NAME"/>
<result property="nums" column="NUMS"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.TITLE,
a.TYPE,
a.CREATE_DAY,
a.LINK_ID,
a.CREATE_TIME,
a.CREATE_USER_NAME,
a.NUMS
</sql>
<sql id="tSendEkpError_where">
<if test="tSendEkpError != null">
<if test="tSendEkpError.id != null and tSendEkpError.id.trim() != ''">
AND a.ID = #{tSendEkpError.id}
</if>
<if test="tSendEkpError.title != null and tSendEkpError.title.trim() != ''">
AND a.TITLE = #{tSendEkpError.title}
</if>
<if test="tSendEkpError.title == null or tSendEkpError.title.trim() == ''">
AND a.TITLE is null
</if>
<if test="tSendEkpError.type != null and tSendEkpError.type.trim() != ''">
AND a.TYPE = #{tSendEkpError.type}
</if>
<if test="tSendEkpError.createDay != null and tSendEkpError.createDay.trim() != ''">
AND a.CREATE_DAY = #{tSendEkpError.createDay}
</if>
</if>
</sql>
<!-- 查找对应类型的1条数据来更新 -->
<select id="getByTitleTypeDay" resultMap="tSendEkpErrorMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_provident_fund a
<where>
1=1
<include refid="tSendEkpError_where"/>
</where>
limit 1
</select>
</mapper>
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