Commit 0044358e authored by fangxinjiang's avatar fangxinjiang

消息提醒优化

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