Commit 0044358e authored by fangxinjiang's avatar fangxinjiang

消息提醒优化

parent d6c2011e
......@@ -78,13 +78,13 @@ public class SysMessageSalaryController {
@Operation(description = "生成最低工资提醒")
@GetMapping("/inner/createSysMessageSalary")
public void createSysMessageSalary() {
//结算月
String settleMonth = DateUtil.addMonth(-1);
//薪资月份
String salaryMonth = DateUtil.addMonth(-1);
//1:删除当前结算月数据:
sysMessageSalaryService.deleteAllBySettleMonth(settleMonth);
sysMessageSalaryService.deleteAllBySettleMonth(salaryMonth);
//2:开始生成:
//2.1:普通工资
sysMessageSalaryService.insertSalaryBySettleMonth(settleMonth);
sysMessageSalaryService.insertSalaryBySettleMonth(salaryMonth);
}
/**
......
......@@ -159,8 +159,8 @@ public class THaveSalaryNosocialController {
@Inner
@PostMapping("/inner/generate")
public void generate() {
String settleMonth = DateUtil.addMonth(0);
tHaveSalaryNosocialService.generate(settleMonth);
String salaryMonth = DateUtil.addMonth(-1);
tHaveSalaryNosocialService.generate(salaryMonth);
}
}
......@@ -115,17 +115,17 @@ public class THaveSalaryNosocialServiceImpl extends ServiceImpl<THaveSalaryNosoc
* * 4.生成记录
**/
@Override
public void generate(String settleMonth) {
public void generate(String salaryMonth) {
//重新跑上月数据
this.remove(Wrappers.<THaveSalaryNosocial>query().lambda().eq(THaveSalaryNosocial::getSettleMonth,settleMonth));
List<THaveSalaryNosocial> haveSalaryNosocialList = salaryAccountService.getLastMonthTHaveSalaryNosocial(settleMonth);
this.remove(Wrappers.<THaveSalaryNosocial>query().lambda().eq(THaveSalaryNosocial::getMonth,salaryMonth));
List<THaveSalaryNosocial> haveSalaryNosocialList = salaryAccountService.getLastMonthTHaveSalaryNosocial(salaryMonth);
if(!Common.isNotEmpty(haveSalaryNosocialList)){
log.error("获取有社保无工资数据为空");
return;
}
//去缴费库查询查询这些人社保是否存在
Map<String, TPaymentInfo> empPaymentInfoMap=Maps.newHashMap();
R<HaveSalaryNoSocialVo> noSocialVoR = socialDaprUtils.getPaymentinfoListByEmpdIdCard(Common.listObjectToStrList(haveSalaryNosocialList, "employeeIdCard"), settleMonth);
R<HaveSalaryNoSocialVo> noSocialVoR = socialDaprUtils.getPaymentinfoListByEmpdIdCard(Common.listObjectToStrList(haveSalaryNosocialList, "employeeIdCard"), salaryMonth);
if (Common.isNotNull(noSocialVoR)&& Common.isNotNull(noSocialVoR.getData())) {
for (TPaymentInfo paymentInfo : noSocialVoR.getData().getPaymentInfos()) {
empPaymentInfoMap.put(paymentInfo.getEmpIdcard(),paymentInfo);
......
......@@ -210,7 +210,8 @@
LEFT JOIN t_salary_account_item l ON l.SALARY_ACCOUNT_ID = a.id and l.JAVA_FIED_NAME = 'relaySalary'
WHERE
a.DELETE_FLAG = 0
and s.SEND_MONTH = #{settleMonth}
and a.FORM_TYPE='0'
and a.SALARY_MONTH = #{settleMonth}
AND s.STATUS IN (3, 4)
GROUP BY a.EMP_IDCARD,a.SALARY_MONTH
) b
......@@ -273,7 +274,7 @@
<!--生成前,先删除老数据-->
<delete id="deleteAllBySettleMonth">
delete from sys_message_salary where settle_month = #{settleMonth}
delete from sys_message_salary where SALARY_MONTH = #{settleMonth}
</delete>
......
......@@ -382,7 +382,8 @@
where
a.DELETE_FLAG = 0
and a.send_month in ( #{month} , #{month2} , #{month3})
and a.FORM_TYPE='0'
and a.SALARY_MONTH in ( #{month} , #{month2} , #{month3})
AND s.STATUS IN (3, 4)
GROUP BY a.EMP_IDCARD, a.SALARY_MONTH limit 10
) a
......
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