Commit 615398bf authored by fangxinjiang's avatar fangxinjiang

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

# Conflicts:
#	yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/mapper/TIncomeMapper.java
#	yifu-social/yifu-social-biz/src/main/resources/mapper/TIncomeMapper.xml
parents 9380a94f 0c6d0857
...@@ -143,6 +143,13 @@ public class TEmployeeProject extends BaseEntity { ...@@ -143,6 +143,13 @@ public class TEmployeeProject extends BaseEntity {
@TableField(exist = false) @TableField(exist = false)
private Integer isLeaveEmployee; private Integer isLeaveEmployee;
/**
* 已产生未结算费用 0:划转 1:不划转
*/
@Schema(description ="已产生未结算费用(0:划转 1:不划转)")
@TableField(exist = false)
private String unsettleDeal;
/** /**
* 员工编码 * 员工编码
*/ */
......
...@@ -39,6 +39,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R; ...@@ -39,6 +39,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.SocialDaprUtils; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.SocialDaprUtils;
import com.yifu.cloud.plus.v1.yifu.salary.vo.UpdateSocialFoundVo; import com.yifu.cloud.plus.v1.yifu.salary.vo.UpdateSocialFoundVo;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
...@@ -63,6 +64,7 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -63,6 +64,7 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
private final TEmployeeLogServiceImpl tEmployeeLogService; private final TEmployeeLogServiceImpl tEmployeeLogService;
@Autowired
private final SocialDaprUtils socialDaprUtils; private final SocialDaprUtils socialDaprUtils;
public static final Pattern PATTERN = Pattern.compile("^[-\\+]?[\\d]*$"); public static final Pattern PATTERN = Pattern.compile("^[-\\+]?[\\d]*$");
...@@ -114,7 +116,6 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -114,7 +116,6 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
// 记录变更日志 // 记录变更日志
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "", updateTEmployeeProject.getId(), tEmployeeProjectOld, updateTEmployeeProject); tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "", updateTEmployeeProject.getId(), tEmployeeProjectOld, updateTEmployeeProject);
UpdateSocialFoundVo updateSocialFoundVo = new UpdateSocialFoundVo(); UpdateSocialFoundVo updateSocialFoundVo = new UpdateSocialFoundVo();
updateSocialFoundVo.setEmpIdcard(updateTEmployeeProject.getEmpIdcard()); updateSocialFoundVo.setEmpIdcard(updateTEmployeeProject.getEmpIdcard());
updateSocialFoundVo.setSettleDomainCode(updateTEmployeeProject.getDeptNo()); updateSocialFoundVo.setSettleDomainCode(updateTEmployeeProject.getDeptNo());
...@@ -122,14 +123,16 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -122,14 +123,16 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
updateSocialFoundVo.setSettleDomainName(updateTEmployeeProject.getDeptName()); updateSocialFoundVo.setSettleDomainName(updateTEmployeeProject.getDeptName());
updateSocialFoundVo.setUnitId(updateTEmployeeProject.getUnitId()); updateSocialFoundVo.setUnitId(updateTEmployeeProject.getUnitId());
updateSocialFoundVo.setUnitName(updateTEmployeeProject.getUnitName()); updateSocialFoundVo.setUnitName(updateTEmployeeProject.getUnitName());
updateSocialFoundVo.setSocialCreateMonth(tEmpChangeInfo.getChangeStartMonth()); if (CommonConstants.ONE_STRING.equals(tEmpChangeInfo.getUnsettleDeal())) {
updateSocialFoundVo.setSocialCreateMonth(tEmpChangeInfo.getChangeStartMonth().replace("-",""));
socialDaprUtils.updatePaymentSocialAndFound(updateSocialFoundVo); socialDaprUtils.updatePaymentSocialAndFound(updateSocialFoundVo);
socialDaprUtils.updateForSocialAndFound(updateSocialFoundVo); socialDaprUtils.updateForSocialAndFound(updateSocialFoundVo);
if (!CommonConstants.ZERO_STRING.equals(updateTEmployeeProject.getSocialStatus())) { }
if (CommonConstants.ZERO_INT != updateTEmployeeProject.getSocialStatus()) {
updateSocialFoundVo.setFlag(CommonConstants.ZERO_STRING); updateSocialFoundVo.setFlag(CommonConstants.ZERO_STRING);
socialDaprUtils.updateSocialAndFoundInfo(updateSocialFoundVo); socialDaprUtils.updateSocialAndFoundInfo(updateSocialFoundVo);
} }
if (!CommonConstants.ZERO_STRING.equals(updateTEmployeeProject.getFundStatus())) { if (CommonConstants.ZERO_INT != updateTEmployeeProject.getFundStatus()) {
updateSocialFoundVo.setFlag(CommonConstants.ONE_STRING); updateSocialFoundVo.setFlag(CommonConstants.ONE_STRING);
socialDaprUtils.updateSocialAndFoundInfo(updateSocialFoundVo); socialDaprUtils.updateSocialAndFoundInfo(updateSocialFoundVo);
} }
...@@ -221,6 +224,7 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -221,6 +224,7 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
updateTEmployeePro.setUnitName(tCustomerInfo.getCustomerName()); updateTEmployeePro.setUnitName(tCustomerInfo.getCustomerName());
} }
updateTEmployeePro.setChangeStartMonth(excel.getChangeStartMonth()); updateTEmployeePro.setChangeStartMonth(excel.getChangeStartMonth());
updateTEmployeePro.setUnsettleDeal(excel.getUnsettleDeal());
updateList.add(updateTEmployeePro); updateList.add(updateTEmployeePro);
// 记录变更日志 // 记录变更日志
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "", tEmployeeProjectOld.getId(), tEmployeeProjectOld, updateTEmployeePro); tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "", tEmployeeProjectOld.getId(), tEmployeeProjectOld, updateTEmployeePro);
...@@ -246,14 +250,16 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -246,14 +250,16 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
updateSocialFoundVo.setUnitId(tEmployeeProject.getUnitId()); updateSocialFoundVo.setUnitId(tEmployeeProject.getUnitId());
updateSocialFoundVo.setUnitName(tEmployeeProject.getUnitName()); updateSocialFoundVo.setUnitName(tEmployeeProject.getUnitName());
updateSocialFoundVo.setSettleDomainName(tEmployeeProject.getDeptName()); updateSocialFoundVo.setSettleDomainName(tEmployeeProject.getDeptName());
if (CommonConstants.IS_CHANGE.equals(tEmployeeProject.getUnsettleDeal())) {
updateSocialFoundVo.setSocialCreateMonth(tEmployeeProject.getChangeStartMonth()); updateSocialFoundVo.setSocialCreateMonth(tEmployeeProject.getChangeStartMonth());
socialDaprUtils.updatePaymentSocialAndFound(updateSocialFoundVo); socialDaprUtils.updatePaymentSocialAndFound(updateSocialFoundVo);
socialDaprUtils.updateForSocialAndFound(updateSocialFoundVo); socialDaprUtils.updateForSocialAndFound(updateSocialFoundVo);
if (!CommonConstants.ZERO_STRING.equals(tEmployeeProject.getSocialStatus())) { }
if (CommonConstants.ZERO_INT != tEmployeeProject.getSocialStatus()) {
updateSocialFoundVo.setFlag(CommonConstants.ZERO_STRING); updateSocialFoundVo.setFlag(CommonConstants.ZERO_STRING);
socialDaprUtils.updateSocialAndFoundInfo(updateSocialFoundVo); socialDaprUtils.updateSocialAndFoundInfo(updateSocialFoundVo);
} }
if (!CommonConstants.ZERO_STRING.equals(tEmployeeProject.getFundStatus())) { if (CommonConstants.ZERO_INT != tEmployeeProject.getFundStatus()) {
updateSocialFoundVo.setFlag(CommonConstants.ONE_STRING); updateSocialFoundVo.setFlag(CommonConstants.ONE_STRING);
socialDaprUtils.updateSocialAndFoundInfo(updateSocialFoundVo); socialDaprUtils.updateSocialAndFoundInfo(updateSocialFoundVo);
} }
......
...@@ -264,6 +264,11 @@ public class SalaryAccountUtil implements Serializable { ...@@ -264,6 +264,11 @@ public class SalaryAccountUtil implements Serializable {
sai.setSalaryMoney(cellValueBig); sai.setSalaryMoney(cellValueBig);
} }
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
if (cellValueStr.length() > 500) {
errorFlag = false;
errorList.add(new ErrorMessage((i + 2), "文本超长!"));
continue;
}
sai.setTextValue(cellValueStr); sai.setTextValue(cellValueStr);
} }
saiList.add(sai); saiList.add(sai);
......
...@@ -169,6 +169,14 @@ public class TIncome { ...@@ -169,6 +169,14 @@ public class TIncome {
@Length(max = 6, message = "数据生成月份不能超过6个字符") @Length(max = 6, message = "数据生成月份不能超过6个字符")
@ExcelProperty("数据生成月份") @ExcelProperty("数据生成月份")
private String dataCreateMonth; private String dataCreateMonth;
/**
* 红冲:0否1是
*/
@ExcelAttribute(name = "红冲:0否1是", maxLength = 1)
@ExcelProperty("红冲:0否1是")
private String redData;
/** /**
* 推送状态:0未推送1已推送 * 推送状态:0未推送1已推送
*/ */
......
...@@ -178,4 +178,11 @@ public class TIncomeDetail { ...@@ -178,4 +178,11 @@ public class TIncomeDetail {
@ExcelProperty("来源id,红冲使用") @ExcelProperty("来源id,红冲使用")
private String sourceId; private String sourceId;
/**
* 红冲:0否1是
*/
@ExcelAttribute(name = "红冲:0否1是", maxLength = 1)
@ExcelProperty("红冲:0否1是")
private String redData;
} }
...@@ -54,4 +54,7 @@ public interface TIncomeMapper extends BaseMapper<TIncome> { ...@@ -54,4 +54,7 @@ public interface TIncomeMapper extends BaseMapper<TIncome> {
@Param("settleDomainIds")List<String> settleDomains, @Param("settleDomainIds")List<String> settleDomains,
@Param("idsStr") List<String> idsStr, @Param("idsStr") List<String> idsStr,
@Param("sql")String sql); @Param("sql")String sql);
List<TIncome> getTIncomeList(@Param("tIncome") TIncome tIncome);
} }
...@@ -246,11 +246,44 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -246,11 +246,44 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
**/ **/
@Override @Override
public boolean saveDetail(TIncomeDetail tIncomeDetail) { public boolean saveDetail(TIncomeDetail tIncomeDetail) {
if (Common.isEmpty(tIncomeDetail.getEmpIdcard())
|| Common.isEmpty(tIncomeDetail.getDeptId())
|| Common.isEmpty(tIncomeDetail.getPayMonth())) {
return false;
}
tIncomeDetail.setCreateTime(new Date()); tIncomeDetail.setCreateTime(new Date());
tIncomeDetail.setDataCreateMonth(DateUtil.addMonth(0)); tIncomeDetail.setDataCreateMonth(DateUtil.addMonth(0));
tIncomeDetailService.save(tIncomeDetail); tIncomeDetailService.save(tIncomeDetail);
// TODO-获取对应信息的统计表,根据项目配置,判断是否可以加一条统计: // TODO-获取对应信息的统计表,根据项目配置,判断是否可以加一条统计:
return true; TIncome income = new TIncome();
income.setEmpIdcard(tIncomeDetail.getEmpIdcard());
income.setDeptId(tIncomeDetail.getDeptId());
List<TIncome> incomeList = baseMapper.getTIncomeList(income);
// 不存在,直接新增
if (incomeList == null || incomeList.isEmpty()) {
return this.saveIncome(tIncomeDetail);
} else {
// 核心判断
return this.copyCore(tIncomeDetail, incomeList);
}
}
// 复制并保存
private boolean saveIncome(TIncomeDetail tIncomeDetail) {
TIncome income = new TIncome();
BeanUtil.copyProperties(tIncomeDetail, income);
income.setPushStatus(CommonConstants.ZERO_STRING);
return this.save(income);
} }
private boolean copyCore(TIncomeDetail tIncomeDetail, List<TIncome> incomeList) {
// 判断
if (CommonConstants.TWO_STRING.equals(tIncomeDetail.getFeeMode())) {
}
return false;
}
} }
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
<result property="createTime" column="CREATE_TIME"/> <result property="createTime" column="CREATE_TIME"/>
<result property="dataCreateMonth" column="DATA_CREATE_MONTH"/> <result property="dataCreateMonth" column="DATA_CREATE_MONTH"/>
<result property="sourceId" column="SOURCE_ID"/> <result property="sourceId" column="SOURCE_ID"/>
<result property="redData" column="RED_DATA"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
a.ID, a.ID,
...@@ -63,7 +64,8 @@ ...@@ -63,7 +64,8 @@
a.PAY_MONTH, a.PAY_MONTH,
a.CREATE_TIME, a.CREATE_TIME,
a.DATA_CREATE_MONTH, a.DATA_CREATE_MONTH,
a.SOURCE_ID a.SOURCE_ID,
a.RED_DATA
</sql> </sql>
<sql id="tIncomeDetail_where"> <sql id="tIncomeDetail_where">
<if test="tIncomeDetail != null"> <if test="tIncomeDetail != null">
...@@ -124,6 +126,9 @@ ...@@ -124,6 +126,9 @@
<if test="tIncomeDetail.sourceId != null and tIncomeDetail.sourceId.trim() != ''"> <if test="tIncomeDetail.sourceId != null and tIncomeDetail.sourceId.trim() != ''">
AND a.SOURCE_ID = #{tIncomeDetail.sourceId} AND a.SOURCE_ID = #{tIncomeDetail.sourceId}
</if> </if>
<if test="tIncomeDetail.redData != null and tIncomeDetail.redData.trim() != ''">
AND a.RED_DATA = #{tIncomeDetail.redData}
</if>
</if> </if>
</sql> </sql>
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
<result property="createTime" column="CREATE_TIME"/> <result property="createTime" column="CREATE_TIME"/>
<result property="dataCreateMonth" column="DATA_CREATE_MONTH"/> <result property="dataCreateMonth" column="DATA_CREATE_MONTH"/>
<result property="pushStatus" column="PUSH_STATUS"/> <result property="pushStatus" column="PUSH_STATUS"/>
<result property="redData" column="RED_DATA"/>
</resultMap> </resultMap>
<resultMap id="incomeExportMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.IncomeExportVo"> <resultMap id="incomeExportMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.IncomeExportVo">
<result property="empName" column="EMP_NAME"/> <result property="empName" column="EMP_NAME"/>
...@@ -80,7 +81,8 @@ ...@@ -80,7 +81,8 @@
a.PAY_MONTH, a.PAY_MONTH,
a.CREATE_TIME, a.CREATE_TIME,
a.DATA_CREATE_MONTH, a.DATA_CREATE_MONTH,
a.PUSH_STATUS a.PUSH_STATUS,
a.RED_DATA
</sql> </sql>
<sql id="tIncome_where"> <sql id="tIncome_where">
<if test="tIncome != null"> <if test="tIncome != null">
...@@ -141,6 +143,9 @@ ...@@ -141,6 +143,9 @@
<if test="tIncome.pushStatus != null and tIncome.pushStatus.trim() != ''"> <if test="tIncome.pushStatus != null and tIncome.pushStatus.trim() != ''">
AND a.PUSH_STATUS = #{tIncome.pushStatus} AND a.PUSH_STATUS = #{tIncome.pushStatus}
</if> </if>
<if test="tIncome.redData != null and tIncome.redData.trim() != ''">
AND a.RED_DATA = #{tIncome.redData}
</if>
</if> </if>
</sql> </sql>
<!--tIncome简单分页查询--> <!--tIncome简单分页查询-->
...@@ -181,6 +186,17 @@ ...@@ -181,6 +186,17 @@
<include refid="export_sql"/> <include refid="export_sql"/>
</where> </where>
</select> </select>
<!-- 列表 -->
<select id="getTIncomeList" resultMap="tIncomeMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_income a
<where>
1=1
<include refid="tIncome_where"/>
</where>
</select>
<sql id="export_sql"> <sql id="export_sql">
<include refid="tIncome_where"/> <include refid="tIncome_where"/>
<if test="idsStr != null and idsStr.size > 0"> <if test="idsStr != null and idsStr.size > 0">
......
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