Commit 09ce455a by leialin

修复BUG

parent e88983ef
......@@ -1859,7 +1859,7 @@ public class AttController {
apr.setRestday(xiuxi);//休息天数
apr.setAnswerday(y);//应出勤
}
List<PunchCardDetails> attendance = punchcarddetailsservice.selectAttendanceDays(Integer.valueOf(kqry.getEmpNum()), startDate, endDate);//打卡记录
List<PunchCardDetails> attendance = punchcarddetailsservice.selectAttendanceDays(Integer.valueOf(kqry.getEmpNum()), startDate, endDate,qyid);//打卡记录
apr.setActualday(attendance.size());//已出勤
if(apr.getAnswerday() > 0){
BigDecimal g = new BigDecimal(apr.getAnswerday());
......@@ -2233,7 +2233,7 @@ public class AttController {
attcal.setAttshouldmade(y);//应出勤
}
List<PunchCardDetails> attendance = punchcarddetailsservice.selectAttendanceDays(userid, startDate, endDate);//打卡记录
List<PunchCardDetails> attendance = punchcarddetailsservice.selectAttendanceDays(userid, startDate, endDate,qyid);//打卡记录
attcal.setAttendance(attendance.size());//已出勤
......@@ -5118,7 +5118,7 @@ public class AttController {
apr.setRestday(xiuxi);//休息天数
apr.setAnswerday(y);//应出勤
}
List<PunchCardDetails> attendance = punchcarddetailsservice.selectAttendanceDays(Integer.valueOf(kqry.getEmpNum()), startDate, endDate);//打卡记录
List<PunchCardDetails> attendance = punchcarddetailsservice.selectAttendanceDays(Integer.valueOf(kqry.getEmpNum()), startDate, endDate,qyid);//打卡记录
apr.setActualday(attendance.size());//已出勤
if(apr.getAnswerday() > 0){
BigDecimal g = new BigDecimal(apr.getAnswerday());
......
......@@ -92,8 +92,8 @@ public class AttendanceTaskTiming{
// @Scheduled(cron = "0 */2 * * * ?")
// @Scheduled(cron = "0 25 11 * * ?")
@Scheduled(cron = "0 0 8,12,16,20 * * ?")//每天上午8、12点,下午16点,20点 执行
// @Scheduled(cron = "0 0 6,20 * * ?")
public void AttendanceTask() throws ParseException {
boolean implement = true;
......@@ -117,7 +117,7 @@ public class AttendanceTaskTiming{
int summaryid = 0;//汇总id
List<QyzxEntInfoM> orgcodelist = qyzxentinfommapper.selectList(new QueryWrapper<QyzxEntInfoM>());//系统中的所有公司 所有未到期的公司
// List<QyzxEntInfoM> orgcodelist = qyzxentinfommapper.selectList(new QueryWrapper<QyzxEntInfoM>().lambda().eq(QyzxEntInfoM::getId, 3));
// List<QyzxEntInfoM> orgcodelist = qyzxentinfommapper.selectList(new QueryWrapper<QyzxEntInfoM>().lambda().eq(QyzxEntInfoM::getId, 1));
for(int t = 0;t<orgcodelist.size();t++){
int org_code = orgcodelist.get(t).getId();//企业组织代码
......@@ -148,7 +148,7 @@ public class AttendanceTaskTiming{
//考勤组信息
KqglMainKqz attgro = kqglmainkqzmapper.getAttendanceGroupInformationByUserid(user.getEmpnum(),org_code);
//目前为止打卡记录
List<PunchCardDetails> attendance = punchcarddetailsmapper.selectAttendanceDays(user.getEmpnum(), startDate, endDate);
List<PunchCardDetails> attendance = punchcarddetailsmapper.selectAttendanceDays(user.getEmpnum(), startDate, endDate,org_code);
int fdjjrnum = 0;
if(attgro != null) {
......@@ -451,7 +451,7 @@ public class AttendanceTaskTiming{
}
}
}
AttSubsidiaryDto subs = kqglassodkmxmapper.subsidiary(user.getEmpnum(), ttstr);
AttSubsidiaryDto subs = kqglassodkmxmapper.subsidiary(user.getEmpnum(), ttstr,org_code);
// //工作时长(分钟)、严重迟到次数、严重迟到时长(分钟)、旷工迟到次数
// double workinghours = 0,seriouslatetimes = 0,seriouslatehours = 0,absenlatetimes = 0;
if(subs != null) {
......
......@@ -157,7 +157,7 @@ public class LastMonthtimingExport {
//考勤组信息
KqglMainKqz attgro = kqglmainkqzmapper.getAttendanceGroupInformationByUserid(user.getEmpnum(),org_code);
//目前为止打卡记录
List<PunchCardDetails> attendance = punchcarddetailsmapper.selectAttendanceDays(user.getEmpnum(), startDate, endDate);
List<PunchCardDetails> attendance = punchcarddetailsmapper.selectAttendanceDays(user.getEmpnum(), startDate, endDate,org_code);
int fdjjrnum = 0;
if(attgro != null) {
......@@ -498,7 +498,7 @@ public class LastMonthtimingExport {
}
}
}
AttSubsidiaryDto subs = kqglassodkmxmapper.subsidiary(user.getEmpnum(), ttstr);
AttSubsidiaryDto subs = kqglassodkmxmapper.subsidiary(user.getEmpnum(), ttstr,org_code);
// //工作时长(分钟)、严重迟到次数、严重迟到时长(分钟)、旷工迟到次数
// double workinghours = 0,seriouslatetimes = 0,seriouslatehours = 0,absenlatetimes = 0;
if(subs != null) {
......
......@@ -84,8 +84,6 @@ public class RealTimeUpdate{
private PunchRecordMapper punchrecordmapper;
@Autowired
private KqglAssoDkmxMapper kqglassodkmxmapper;
@Autowired
private ClockInController clockincontroller;
/**
......@@ -150,7 +148,7 @@ public class RealTimeUpdate{
//考勤组信息
KqglMainKqz attgro = kqglmainkqzmapper.getAttendanceGroupInformationByUserid(user.getEmpnum(),org_code);
//目前为止打卡记录
List<PunchCardDetails> attendance = punchcarddetailsmapper.selectAttendanceDays(user.getEmpnum(), startDate, endDateyesterday);
List<PunchCardDetails> attendance = punchcarddetailsmapper.selectAttendanceDays(user.getEmpnum(), startDate, endDateyesterday,org_code);
int fdjjrnum = 0;
......@@ -489,7 +487,7 @@ public class RealTimeUpdate{
}
}
}
AttSubsidiaryDto subs = kqglassodkmxmapper.subsidiary(user.getEmpnum(), ttstr);
AttSubsidiaryDto subs = kqglassodkmxmapper.subsidiary(user.getEmpnum(), ttstr,org_code);
// //工作时长(分钟)、严重迟到次数、严重迟到时长(分钟)、旷工迟到次数
// double workinghours = 0,seriouslatetimes = 0,seriouslatehours = 0,absenlatetimes = 0;
if(subs != null) {
......
......@@ -1526,7 +1526,13 @@ public class SalaryManagementController {
if(file.getSfdx() == 0) {
XcglAssoXzdadx xzdadx = XcglAssoXzdadx.builder().build();
xzdadx.setUserid(emp.getEmpNum());//用户id
xzdadx.setSxrq(file.getSxrq().replace("/", "-"));//生效日期
String sxrq = file.getSxrq().substring(0,5) + "20" + file.getSxrq().substring(5,7);
if(sxrq.contains("/")) {
xzdadx.setSxrq(SalaryTool.SlashDate(sxrq));//生效日期
}else {
xzdadx.setSxrq(file.getSxrq());//生效日期
}
xzdadx.setAddtime(new Date().getTime());
xzdadx.setRemarks("");
xzdadx.setQyid(userBean.getOrgCode());
......@@ -1588,7 +1594,12 @@ public class SalaryManagementController {
}
XcglAssoXzdadx xzdadx = XcglAssoXzdadx.builder().build();
xzdadx.setUserid(emp.getEmpNum());//用户id
String sxrq = file.getSxrq().substring(0,5) + "20" + file.getSxrq().substring(5,7);
if(sxrq.contains("/")) {
xzdadx.setSxrq(SalaryTool.SlashDate(sxrq));//生效日期
}else {
xzdadx.setSxrq(file.getSxrq());//生效日期
}
xzdadx.setAddtime(new Date().getTime());
xzdadx.setXgyhid(userBean.getEmpNum());//修改用户id
xzdadx.setRemarks("");
......@@ -2350,12 +2361,12 @@ public class SalaryManagementController {
double continueedu_ = 0;//累计继续教育
double totalmoney_ = 0;//累计专项附加扣除
if(!status && sygs != null) {
childrenedu_ = sygs.getCumZljy();
houseloans_ = sygs.getCumZfdklx();
houserents_ = sygs.getCumZfzj();
supportolder_ = sygs.getCumSylr();
continueedu_ = sygs.getCumJxjy();
totalmoney_ = sygs.getCumZxfjkc();
childrenedu_ = sygs.getCumZljy() == null ? 0 : sygs.getCumZljy();
houseloans_ = sygs.getCumZfdklx() == null ? 0 : sygs.getCumZfdklx();
houserents_ = sygs.getCumZfzj() == null ? 0 : sygs.getCumZfzj();
supportolder_ = sygs.getCumSylr() == null ? 0 : sygs.getCumSylr();
continueedu_ = sygs.getCumJxjy() == null ? 0 : sygs.getCumJxjy();
totalmoney_ = sygs.getCumZxfjkc() == null ? 0 : sygs.getCumZxfjkc();
}
YgglMainEmp yh = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, gsus).eq(YgglMainEmp::getOrgCode, orgcode));
//对应算薪月份的专项附加扣除
......@@ -2414,8 +2425,8 @@ public class SalaryManagementController {
}
gsmx.setCumJcfy(cumjcfy);//累计减除费用 【5000*在职月份数】
gsmx.setCumZxkc((cuspde == null ? 0 : Double.valueOf(cuspde.getGrjltotal())) + (sygs == null ? 0 : sygs.getCumZxkc()));//累计专项扣除 【本期专项扣除+累计专项扣除(上月)】
gsmx.setCumQtkc(other_deductions+(sygs == null ? 0 : sygs.getCumQtkc()));//累计其他扣除 【其他扣除+累计其他扣除(上月)】
gsmx.setCumZxkc((cuspde == null ? 0 : Double.valueOf(cuspde.getGrjltotal())) + (sygs == null ? 0 : (sygs.getCumZxkc() == null ? 0 : sygs.getCumZxkc())));//累计专项扣除 【本期专项扣除+累计专项扣除(上月)】
gsmx.setCumQtkc(other_deductions+(sygs == null ? 0 : (sygs.getCumQtkc() == null ? 0 : sygs.getCumQtkc())));//累计其他扣除 【其他扣除+累计其他扣除(上月)】
double cumynssde = 0;
cumynssde = gsmx.getCumSre() - cumjcfy - gsmx.getCumZxkc() - gsmx.getCumZxfjkc() - gsmx.getCumQtkc();
......@@ -2427,7 +2438,7 @@ public class SalaryManagementController {
gsmx.setCumYnse(SalaryTool.formatDouble_(Double.valueOf(miscalculation[2])));//累计应纳税额 【累计应纳税所得额*税率-速算扣除数】
double cumyyjse = 0;
cumyyjse = (sygs == null ? 0 : sygs.getCumYyjse()) + (sygs == null ? 0 : sygs.getCumYbtse());
cumyyjse = (sygs == null ? 0 : (sygs.getCumYyjse() == null ? 0 : sygs.getCumYyjse())) + (sygs == null ? 0 : (sygs.getCumYbtse() == null ? 0 : sygs.getCumYbtse()));
gsmx.setCumYyjse(cumyyjse);//累计已预缴纳税额 【累计已预缴税额(上月)+累计应补(退)税额(上月)】
double cumybtse = 0;
......@@ -2951,7 +2962,7 @@ public class SalaryManagementController {
attrep.setRestday(xiuxi);//休息天数
attrep.setAnswerday(y);//应出勤
}
List<PunchCardDetails> attendance = punchcarddetailsservice.selectAttendanceDays(userid, startDate, endDate);//打卡记录
List<PunchCardDetails> attendance = punchcarddetailsservice.selectAttendanceDays(userid, startDate, endDate,orgCode);//打卡记录
attrep.setActualday(attendance.size());//已出勤
if(attrep.getAnswerday() > 0){
BigDecimal g = new BigDecimal(attrep.getAnswerday());
......@@ -3419,19 +3430,19 @@ public class SalaryManagementController {
fjkc.setSupportolder(Double.valueOf(spec.getSylr()));//赡养老人
fjkc.setContinueedu(Double.valueOf(spec.getJxjy()));//继续教育
BigDecimal num1 = new BigDecimal(spec.getZljy());
BigDecimal num2 = new BigDecimal(spec.getZfdk());
BigDecimal num1 = new BigDecimal(Double.valueOf(spec.getZljy()));
BigDecimal num2 = new BigDecimal(Double.valueOf(spec.getZfdk()));
double result1 = num1.add(num2).doubleValue();
BigDecimal num3 = new BigDecimal(result1);
BigDecimal num4 = new BigDecimal(spec.getZfzj());
BigDecimal num4 = new BigDecimal(Double.valueOf(spec.getZfzj()));
double result2 = num3.add(num4).doubleValue();
BigDecimal num5 = new BigDecimal(result2);
BigDecimal num6 = new BigDecimal(spec.getSylr());
BigDecimal num6 = new BigDecimal(Double.valueOf(spec.getSylr()));
double result3 = num5.add(num6).doubleValue();
BigDecimal num7 = new BigDecimal(result3);
BigDecimal num8 = new BigDecimal(spec.getJxjy());
BigDecimal num8 = new BigDecimal(Double.valueOf(spec.getJxjy()));
double result = num7.add(num8).doubleValue();
fjkc.setTotalmoney(Double.valueOf(result));//累计专项附加扣除
......@@ -3439,13 +3450,16 @@ public class SalaryManagementController {
toupdate++;
}
} catch (Exception e) {
// e.printStackTrace();
failure++;
map.put("name", name);
map.put("msg", StringUtils.isBlank(e.getMessage()) ? "必填数据出现空值" : e.getMessage());
map.put("msg", StringUtils.isBlank(e.getMessage()) ? "用户信息错误" : e.getMessage());
} finally {
if(!map.isEmpty()) {
reasons.add(map);
}
}
}
ImportDescriptionDto imds = new ImportDescriptionDto();
imds.setSuccess(toinsert + toupdate);//成功
imds.setToinsert(toinsert);
......
......@@ -11,6 +11,20 @@ public class SalaryTool {
static SimpleDateFormat mat = new SimpleDateFormat("yyyy-MM-dd");
static SimpleDateFormat matM = new SimpleDateFormat("yyyy-MM");
public static String SlashDate(String Slashdate) {
SimpleDateFormat sdf=new SimpleDateFormat("MM/dd/yyyy");
Date d = null;
try{
d=sdf.parse(Slashdate);
sdf.applyPattern("yyyy-MM-dd");
// System.out.println(sdf.format(d));
} catch(Exception exe){
exe.printStackTrace();
}
return sdf.format(d);
}
/**
* 保留两位小数,四舍五入的一个老土的方法
* @param d
......
......@@ -20,7 +20,7 @@ public interface PunchCardDetailsMapper {
int updateByPrimaryKey(PunchCardDetails record);
int ModifyPunchDetails(PunchCardDetails record);
List<PunchCardDetails> selectAttendanceDays(Integer userid,Long start,Long end);
List<PunchCardDetails> selectAttendanceDays(Integer userid,Long start,Long end,Integer qyid);
PunchCardDetails SingleAttendanceDays(Integer userid,Long start,Long end);
......
......@@ -15,7 +15,7 @@ import cn.timer.api.dto.kqmk.AttSubsidiaryDto;
@Repository
public interface KqglAssoDkmxMapper extends BaseMapper<KqglAssoDkmx> {
AttSubsidiaryDto subsidiary(int userid, String data);
AttSubsidiaryDto subsidiary(int userid, String data,int qyid);
int updateByPrimaryKeySelective(KqglAssoDkmx kqglassodkmx);
}
......@@ -290,6 +290,7 @@
where dkmx.userid = #{userid,jdbcType=INTEGER}
and dkmx.dksj &gt;= #{start,jdbcType=BIGINT}
and dkmx.dksj &lt;= #{end,jdbcType=BIGINT}
and dkmx.qyid = #{qyid,jdbcType=INTEGER}
</select>
<select id="SingleAttendanceDays" resultMap="BaseResultMap">
......
......@@ -59,6 +59,7 @@
from kqgl_asso_dkmx dk
where dk.userid = #{userid}
and SUBSTR(dk.`data`,1,7) = #{data}
and dk.qyid = #{qyid}
GROUP BY dk.userid
</select>
......
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