Commit 168c5ed1 by leialin

Merge branch 'lal' into 'develop'

Lal

See merge request 8timerv2/8timerapiv200!315
parents e10a8c70 68e288d3
...@@ -1648,14 +1648,12 @@ public class TimeCardController { ...@@ -1648,14 +1648,12 @@ public class TimeCardController {
attesummqueto.setOrgCode(userBean.getOrgCode()); attesummqueto.setOrgCode(userBean.getOrgCode());
String year = null,month = null; String year = null,month = null;
String staapptime = null,endapptime = null; String staapptime = null,endapptime = null,time_ = null;
if(attesummqueto.getTimes() != null && !("").equals(attesummqueto.getTimes())) { if(attesummqueto.getTimes() != null && !("").equals(attesummqueto.getTimes())) {
year = attesummqueto.getTimes().substring(0, 4); year = attesummqueto.getTimes().substring(0, 4);
month = attesummqueto.getTimes().substring(5, 7); month = attesummqueto.getTimes().substring(5, 7);
// staapptime = ClockInTool.getFirstDayOfMonth1(Integer.valueOf(year),Integer.valueOf(month)); time_ = attesummqueto.getTimes();
// endapptime = ClockInTool.getLastDayOfMonth1(Integer.valueOf(year),Integer.valueOf(month));
String time = attesummqueto.getTimes()+"-01"; String time = attesummqueto.getTimes()+"-01";
String sdaet = ClockInTool.getMinMonthDate(time); String sdaet = ClockInTool.getMinMonthDate(time);
...@@ -1666,13 +1664,7 @@ public class TimeCardController { ...@@ -1666,13 +1664,7 @@ public class TimeCardController {
year = new SimpleDateFormat("yyyy").format(new Date()).toString(); year = new SimpleDateFormat("yyyy").format(new Date()).toString();
month = new SimpleDateFormat("MM").format(new Date()).toString(); month = new SimpleDateFormat("MM").format(new Date()).toString();
// Calendar c = Calendar.getInstance(); time_ = new SimpleDateFormat("yyyy-MM").format(new Date()).toString();
// c.add(Calendar.MONTH, 0);
// c.set(Calendar.DAY_OF_MONTH,1);
// staapptime = DateUtil.getStringFormat(DateUtil.getStringTime(mat.format(c.getTime()),"yyyy-MM-dd"));
// Calendar ca = Calendar.getInstance();
// ca.set(Calendar.DAY_OF_MONTH, ca.getActualMaximum(Calendar.DAY_OF_MONTH));
// endapptime = DateUtil.getStringFormat(DateUtil.getStringTime(mat.format(ca.getTime()),"yyyy-MM-dd"));
Calendar c = Calendar.getInstance(); Calendar c = Calendar.getInstance();
c.add(Calendar.MONTH, 0); c.add(Calendar.MONTH, 0);
...@@ -1692,24 +1684,12 @@ public class TimeCardController { ...@@ -1692,24 +1684,12 @@ public class TimeCardController {
attesummqueto.setMonth(month); attesummqueto.setMonth(month);
attesummqueto.setStaapptime(staapptime); attesummqueto.setStaapptime(staapptime);
attesummqueto.setEndapptime(endapptime); attesummqueto.setEndapptime(endapptime);
attesummqueto.setTimes(time_);
// 缺-部门id 搜索 // 缺-部门id 搜索
IPage<KqglAssoMonthPunchSummaryDto> pageAs = kqglassomonthpunchsummarymapper.AttendanceSummaryData(page, attesummqueto); IPage<KqglAssoMonthPunchSummaryDto> pageAs = kqglassomonthpunchsummarymapper.AttendanceSummaryData(page, attesummqueto);
// List<BalanceSheetDataDto> balanceTo = new ArrayList<BalanceSheetDataDto>();
// int num = 0;
// int nums = 0;
//
// List<KqglAssoLeaveRules> rul = KqglAssoLeaveRules.builder().build().selectList(new QueryWrapper<KqglAssoLeaveRules>().lambda().eq(KqglAssoLeaveRules::getOrgCode, userBean.getOrgCode()));
// if(rul.size() > 0) {
// num = rul.size();
// }
//
// List<KqglAssoMonthPunchSummary> pusu = KqglAssoMonthPunchSummary.builder().build().selectList(new QueryWrapper<KqglAssoMonthPunchSummary>().lambda().eq(KqglAssoMonthPunchSummary::getOrgCode, userBean.getOrgCode())
// .eq(KqglAssoMonthPunchSummary::getBelongYear, year).eq(KqglAssoMonthPunchSummary::getBelongMonth, month));
// if(pusu.size() > 0) {
// nums = pusu.size();
// }
List<KqglAssoMonthPunchSummaryDto> listAs = pageAs.getRecords(); List<KqglAssoMonthPunchSummaryDto> listAs = pageAs.getRecords();
List<KqglAssoMonthPunchSummaryDto> sumlist = new ArrayList<KqglAssoMonthPunchSummaryDto>(); List<KqglAssoMonthPunchSummaryDto> sumlist = new ArrayList<KqglAssoMonthPunchSummaryDto>();
...@@ -1719,13 +1699,17 @@ public class TimeCardController { ...@@ -1719,13 +1699,17 @@ public class TimeCardController {
BeanUtil.copyProperties(endo, dets , "balanceTo"); BeanUtil.copyProperties(endo, dets , "balanceTo");
List<KqglAssoLeaveEmployeeBalance> empye = KqglAssoLeaveEmployeeBalance.builder().build().selectList(new QueryWrapper<KqglAssoLeaveEmployeeBalance>().lambda().eq(KqglAssoLeaveEmployeeBalance::getUserid, endo.getNum()) // List<KqglAssoLeaveEmployeeBalance> empye = KqglAssoLeaveEmployeeBalance.builder().build().selectList(new QueryWrapper<KqglAssoLeaveEmployeeBalance>().lambda().eq(KqglAssoLeaveEmployeeBalance::getUserid, endo.getNum())
.eq(KqglAssoLeaveEmployeeBalance::getOrgCode, endo.getOrgCode())); // .eq(KqglAssoLeaveEmployeeBalance::getOrgCode, endo.getOrgCode()));
List<BalanceSheetDataDto> empye = kqglassomonthpunchsummarymapper.MonthlySummaryLeave(endo.getOrgCode(), endo.getNum(), attesummqueto.getTimes());
List<BalanceSheetDataDto> balanceTo = new ArrayList<BalanceSheetDataDto>(); List<BalanceSheetDataDto> balanceTo = new ArrayList<BalanceSheetDataDto>();
for(KqglAssoLeaveEmployeeBalance empyes : empye) { for(BalanceSheetDataDto empyes : empye) {
BalanceSheetDataDto bal = BalanceSheetDataDto.builder().build(); BalanceSheetDataDto bal = BalanceSheetDataDto.builder().build();
bal.setBalancedays(empyes.getBalanceDays()); bal.setBalancedays(empyes.getBalancedays());
bal.setLeaverulesid(empyes.getLeaveRulesId()); bal.setLeaverulesid(empyes.getLeaverulesid());
balanceTo.add(bal); balanceTo.add(bal);
} }
dets.setBalanceTo(balanceTo); dets.setBalanceTo(balanceTo);
...@@ -1733,7 +1717,6 @@ public class TimeCardController { ...@@ -1733,7 +1717,6 @@ public class TimeCardController {
} }
// return ResultUtil.attdata(pageAs, listAs, "操作成功!",num,nums);
return ResultUtil.data(pageAs, sumlist, "操作成功!"); return ResultUtil.data(pageAs, sumlist, "操作成功!");
} }
...@@ -1792,7 +1775,6 @@ public class TimeCardController { ...@@ -1792,7 +1775,6 @@ public class TimeCardController {
} }
return ResultUtil.data(pageAs, sumlist, "操作成功!"); return ResultUtil.data(pageAs, sumlist, "操作成功!");
} }
...@@ -2778,18 +2760,23 @@ public class TimeCardController { ...@@ -2778,18 +2760,23 @@ public class TimeCardController {
KqglAssoMonthPunchSummary punsum = KqglAssoMonthPunchSummary.builder().build().selectOne(new QueryWrapper<KqglAssoMonthPunchSummary>().lambda().eq(KqglAssoMonthPunchSummary::getNum, userBean.getEmpNum()) KqglAssoMonthPunchSummary punsum = KqglAssoMonthPunchSummary.builder().build().selectOne(new QueryWrapper<KqglAssoMonthPunchSummary>().lambda().eq(KqglAssoMonthPunchSummary::getNum, userBean.getEmpNum())
.eq(KqglAssoMonthPunchSummary::getOrgCode, userBean.getOrgCode()).eq(KqglAssoMonthPunchSummary::getBelongYear, belongyear).eq(KqglAssoMonthPunchSummary::getBelongMonth, belongmonth)); .eq(KqglAssoMonthPunchSummary::getOrgCode, userBean.getOrgCode()).eq(KqglAssoMonthPunchSummary::getBelongYear, belongyear).eq(KqglAssoMonthPunchSummary::getBelongMonth, belongmonth));
Double compensatoryleave = 0d;
if(punsum != null) {
compensatoryleave = punsum.getWorkingTurnCompenLeave() + punsum.getRestTurnCompenLeave() + punsum.getHolidayTurnCompenLeave(); BalanceSheetDataDto empye = kqglassomonthpunchsummarymapper.FormMonthlySummaryLeave(userBean.getOrgCode(), userBean.getEmpNum(), ttstr);
}
tabl.setAttendance(punsum == null ? "" : String.valueOf(punsum.getDaysOnDuty()));// 应出勤 tabl.setAttendance(punsum == null ? "" : String.valueOf(punsum.getDaysOnDuty()));// 应出勤
tabl.setAttended(punsum == null ? "" : String.valueOf(punsum.getActualAttDays()));// 已出勤 tabl.setAttended(punsum == null ? "" : String.valueOf(punsum.getActualAttDays()));// 已出勤
tabl.setLeave(qjj == null ? "" : String.valueOf(qjj.getDuration()));// 请假
tabl.setLeave(qjj == null ? "" : String.valueOf(empye.getBalancedays()));// 请假*******************
tabl.setLackworkcard(punsum == null ? "" : String.valueOf(punsum.getNumberWorkCardShortage()));// 上班缺卡 tabl.setLackworkcard(punsum == null ? "" : String.valueOf(punsum.getNumberWorkCardShortage()));// 上班缺卡
tabl.setWorkovertime(sums == null ? "" : String.valueOf(sums.getDuration()));// 加班
tabl.setCompensatoryleave(String.valueOf(compensatoryleave));// 调休 // tabl.setWorkovertime(sums == null ? "" : String.valueOf(sums.getDuration()));// 加班
tabl.setEvection(cxx == null ? "" : String.valueOf(cxx.getDuration()));// 出差 tabl.setWorkovertime(sums == null ? "" : String.valueOf(punsum.getTotalOvertimeHours()));// 加班
tabl.setCompensatoryleave(String.valueOf(punsum.getDaysOff()));// 休息天数
// tabl.setEvection(cxx == null ? "" : String.valueOf(cxx.getDuration()));// 出差
tabl.setEvection(cxx == null ? "" : String.valueOf(punsum.getLengthBusinessTrip()));// 出差
tabl.setOffdutycardshortage(punsum == null ? "" : String.valueOf(punsum.getNumberDutyCardShortage()));// 下班缺卡 tabl.setOffdutycardshortage(punsum == null ? "" : String.valueOf(punsum.getNumberDutyCardShortage()));// 下班缺卡
......
...@@ -61,11 +61,13 @@ public class KqglServiceImpl implements KqglService { ...@@ -61,11 +61,13 @@ public class KqglServiceImpl implements KqglService {
String startdate = new SimpleDateFormat("yyyy-MM-dd").format(leaveappr.getStarttime()); String startdate = new SimpleDateFormat("yyyy-MM-dd").format(leaveappr.getStarttime());
String enddate = new SimpleDateFormat("yyyy-MM-dd").format(leaveappr.getEndtime()); String enddate = new SimpleDateFormat("yyyy-MM-dd").format(leaveappr.getEndtime());
String[] days=ClockInTool.listToString(ClockInTool.getDays(startdate,enddate)).split(","); String[] days=ClockInTool.listToString(ClockInTool.getDays(startdate,enddate)).split(",");
int i = 1;
for(String num : days) { for(String num : days) {
//记入打卡月汇总关联表 //记入打卡月汇总关联表
KqglAssoRelationSummary.builder().userId(leaveappr.getUserid()).appTime(num).approvalId(leaveappr.getLeaveid()).approvalType(2).duration(leaveappr.getDuration()) KqglAssoRelationSummary.builder().userId(leaveappr.getUserid()).appTime(num).approvalId(leaveappr.getLeaveid()).approvalType(2).duration(leaveappr.getDuration())
.leaveTypeId(leaveappr.getLeavetype()).startTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(leaveappr.getStarttime())) .leaveTypeId(leaveappr.getLeavetype()).startTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(leaveappr.getStarttime()))
.endTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(leaveappr.getEndtime())).orgCode(leaveappr.getOrgcode()).build().insert(); .endTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(leaveappr.getEndtime())).orgCode(leaveappr.getOrgcode()).ordernum(i).totals(days.length).build().insert();
i++;
} }
YgglMainEmp emp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, leaveappr.getUserid()).eq(YgglMainEmp::getOrgCode, leaveappr.getOrgcode())); YgglMainEmp emp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, leaveappr.getUserid()).eq(YgglMainEmp::getOrgCode, leaveappr.getOrgcode()));
...@@ -259,21 +261,25 @@ public class KqglServiceImpl implements KqglService { ...@@ -259,21 +261,25 @@ public class KqglServiceImpl implements KqglService {
String startdate = new SimpleDateFormat("yyyy-MM-dd").format(evecappr.getStarttime()); String startdate = new SimpleDateFormat("yyyy-MM-dd").format(evecappr.getStarttime());
String enddate = new SimpleDateFormat("yyyy-MM-dd").format(evecappr.getEndtime()); String enddate = new SimpleDateFormat("yyyy-MM-dd").format(evecappr.getEndtime());
String[] days=ClockInTool.listToString(ClockInTool.getDays(startdate,enddate)).split(","); String[] days=ClockInTool.listToString(ClockInTool.getDays(startdate,enddate)).split(",");
int i = 1;
for(String num : days) { for(String num : days) {
//记入打卡月汇总关联表 //记入打卡月汇总关联表
KqglAssoRelationSummary.builder().userId(evecappr.getUserid()).appTime(num).approvalId(evecappr.getEvectionid()).approvalType(3).duration(evecappr.getDuration()) KqglAssoRelationSummary.builder().userId(evecappr.getUserid()).appTime(num).approvalId(evecappr.getEvectionid()).approvalType(3).duration(evecappr.getDuration())
.startTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(evecappr.getStarttime())).endTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(evecappr.getEndtime())) .startTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(evecappr.getStarttime())).endTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(evecappr.getEndtime()))
.orgCode(evecappr.getOrgcode()).build().insert(); .orgCode(evecappr.getOrgcode()).ordernum(i).totals(days.length).build().insert();
i++;
} }
}else { //外出 }else { //外出
String startdate = new SimpleDateFormat("yyyy-MM-dd").format(evecappr.getStarttime()); String startdate = new SimpleDateFormat("yyyy-MM-dd").format(evecappr.getStarttime());
String enddate = new SimpleDateFormat("yyyy-MM-dd").format(evecappr.getEndtime()); String enddate = new SimpleDateFormat("yyyy-MM-dd").format(evecappr.getEndtime());
String[] days=ClockInTool.listToString(ClockInTool.getDays(startdate,enddate)).split(","); String[] days=ClockInTool.listToString(ClockInTool.getDays(startdate,enddate)).split(",");
int i = 1;
for(String num : days) { for(String num : days) {
//记入打卡月汇总关联表 //记入打卡月汇总关联表
KqglAssoRelationSummary.builder().userId(evecappr.getUserid()).appTime(num).approvalId(evecappr.getEvectionid()).approvalType(4).duration(evecappr.getDuration()) KqglAssoRelationSummary.builder().userId(evecappr.getUserid()).appTime(num).approvalId(evecappr.getEvectionid()).approvalType(4).duration(evecappr.getDuration())
.startTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(evecappr.getStarttime())).endTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(evecappr.getEndtime())) .startTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(evecappr.getStarttime())).endTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(evecappr.getEndtime()))
.orgCode(evecappr.getOrgcode()).build().insert(); .orgCode(evecappr.getOrgcode()).ordernum(i).totals(days.length).build().insert();
i++;
} }
} }
return true; return true;
......
...@@ -27,4 +27,8 @@ public interface KqglAssoMonthPunchSummaryMapper extends BaseMapper<KqglAssoMont ...@@ -27,4 +27,8 @@ public interface KqglAssoMonthPunchSummaryMapper extends BaseMapper<KqglAssoMont
IPage<DailyDetailsDto> Dailydetails(IPage<DailyDetailsDto> page,@Param("param") AttendanceSummaryQueryDto attendancesummaryquerydto); IPage<DailyDetailsDto> Dailydetails(IPage<DailyDetailsDto> page,@Param("param") AttendanceSummaryQueryDto attendancesummaryquerydto);
List<BalanceSheetDataDto> AttenSumDailyDetails(int orgcode,int userid,String apptime); List<BalanceSheetDataDto> AttenSumDailyDetails(int orgcode,int userid,String apptime);
List<BalanceSheetDataDto> MonthlySummaryLeave(int orgcode,int userid,String apptime);
BalanceSheetDataDto FormMonthlySummaryLeave(int orgcode,int userid,String apptime);
} }
...@@ -241,6 +241,25 @@ ...@@ -241,6 +241,25 @@
GROUP BY su.leave_type_id GROUP BY su.leave_type_id
</select> </select>
<select id="MonthlySummaryLeave" resultMap="BalanceSheetDataMap">
select res.leave_type_id as leaverulesid,res.duration as balancedays from kqgl_asso_relation_summary res
where res.user_id = #{userid}
and res.approval_type = 2
and res.org_code = #{orgcode}
and SUBSTR(res.app_time,1,7) = #{apptime}
GROUP BY res.leave_type_id,res.duration
</select>
<select id="FormMonthlySummaryLeave" resultMap="BalanceSheetDataMap">
select IFNULL(SUM(aa.balancedays),0) as balancedays from (
select res.leave_type_id as leaverulesid,res.duration as balancedays from kqgl_asso_relation_summary res
where res.user_id = #{userid}
and res.approval_type = 2
and res.org_code = #{orgcode}
and SUBSTR(res.app_time,1,7) = #{apptime}
GROUP BY res.leave_type_id,res.duration
) as aa
</select>
<select id="AttendanceSummaryData" resultMap="SummarydataMap"> <select id="AttendanceSummaryData" resultMap="SummarydataMap">
select sum.*, select sum.*,
......
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