This commit is contained in:
Harryxzy 2023-07-21 15:32:44 +08:00
parent 9c6d71d095
commit e7f5c7c066
4 changed files with 39 additions and 5 deletions

View File

@ -7,6 +7,7 @@ import com.engine.bjcj220907.service.MonthBonusCountService;
import com.engine.bjcj220907.utils.BjcjCommonUtils; import com.engine.bjcj220907.utils.BjcjCommonUtils;
import com.engine.common.util.ServiceUtil; import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service; import com.engine.core.impl.Service;
import com.engine.salary.util.SalaryDateUtil;
import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryEntityUtil;
import weaver.general.BaseBean; import weaver.general.BaseBean;
@ -87,6 +88,13 @@ public class MonthBonusCountServiceImpl extends Service implements MonthBonusCou
departureTemp.add(j); departureTemp.add(j);
countCal.add(Calendar.MONTH,1); countCal.add(Calendar.MONTH,1);
} }
// 如果是28号或者28号之后离职那还要加一个月
if (info.getLzrq() != null && SalaryDateUtil.dateToLocalDate(info.getLzrq()).getDayOfMonth() > 28){
int year = countCal.get(Calendar.YEAR);
int season =countCal.get(Calendar.MONTH)/3+1;
CountMonthBonus j = getMonthBonusDAO().getJXInfoByUser(info.getXm(), bonusSendMonth, countCal.getTime(), year, season);
result.add(j);
}
} }
//获取所有人的薪酬等级和绩效工资 //获取所有人的薪酬等级和绩效工资

View File

@ -1,6 +1,9 @@
package com.engine.bjcj220907.utils; package com.engine.bjcj220907.utils;
import com.engine.salary.util.SalaryDateUtil;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
@ -115,16 +118,22 @@ public class BjcjCommonUtils {
return false; return false;
} }
public static boolean isEqualsMonth(Date a,Date b){ public static boolean isEqualsMonth(Date a,Date kqMonth){
try { try {
if(a == null || b == null){ if(a == null || kqMonth == null){
return false; return false;
} }
// 如果入离职的日期>28 则属于下一个月
LocalDate aLocalDate = SalaryDateUtil.dateToLocalDate(a);
if(aLocalDate.getDayOfMonth() > 28){
LocalDate localDate = aLocalDate.plusMonths(1);
a = SalaryDateUtil.localDateToDate(localDate);
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd");
Date formatA = sdf.parse(sdf2.format(a)); Date formatA = sdf.parse(sdf2.format(a));
Date formatB = sdf.parse(sdf2.format(b)); Date formatB = sdf.parse(sdf2.format(kqMonth));
if( formatA.equals(formatB) ){ if( formatA.equals(formatB) ){
return true; return true;
} }

View File

@ -32,6 +32,23 @@ public class MonthBonusCountController extends AbstractModeExpandJavaCodeNew {
return new MonthBonusDAO(); return new MonthBonusDAO();
} }
// @POST
// @Path("/month")
// @Produces(MediaType.APPLICATION_JSON)
// public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestParam Map<String, Object> param) throws ParseException {
// User tempUser = new User();
// tempUser.setLoginid("1");
// tempUser.setLoginid("sysadmin");
// Map<String, String> result = new HashMap<String, String>();
// String bonusM="2023-03";
// String sendM="2023-07";
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
// CountMonthBonusParam countParam = CountMonthBonusParam.builder().bonusMonth(sdf.parse(bonusM)).bonusSendMonth(sdf.parse(sendM)).build();
// baseBean.writeLog("开始核算绩效,绩效所属月:"+bonusM+",绩效发放月:"+sendM);
// getMonthBonusCountService(tempUser).countMonthBonus(countParam);
// return "";
// }
/*** /***
* @description 月度计算奖金计算 * @description 月度计算奖金计算
* @return String * @return String

View File

@ -7,10 +7,10 @@
<map> <map>
<entry key="com.zeroturnaround.jrebel.FormatVersion" value="7.0.0" /> <entry key="com.zeroturnaround.jrebel.FormatVersion" value="7.0.0" />
<entry key="jrebelEnabled" value="true" /> <entry key="jrebelEnabled" value="true" />
<entry key="lastExternalPluginCheckTime" value="1679481054163" /> <entry key="lastExternalPluginCheckTime" value="1689904532674" />
</map> </map>
</option> </option>
<option name="version" value="17" /> <option name="version" value="22" />
</configuration> </configuration>
</facet> </facet>
</component> </component>