Commit 30457ed0 by ilal Committed by chenzg

提交

parent 108cfcc0
......@@ -1497,6 +1497,8 @@ public class ClockInController {
int sbyf = 1;//0:失败;1:成功
int status_ = 0;
int xiuxidaka = 0;//休息并打卡
YgglMainEmp user = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, clock.getUserid()).eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));
if(user != null) {
int qyid = user.getOrgCode();
......@@ -1534,6 +1536,9 @@ public class ClockInController {
if(attdate.getAttgrouptype() != 3) {
List<AttSchedule> checknextday = attdate.getAttsch();
if(EmptyUtil.isNotEmpty(attdate.getAttsch()) && checknextday.get(0).getId() != 0) {
if(checknextday.size() > 0) {
for(int c=0;c<checknextday.size();c++) {
if(checknextday.get(c).getNextday() == 2) {
......@@ -1541,6 +1546,7 @@ public class ClockInController {
}
}
}
}
KqglAssoDkmx dkmc = KqglAssoDkmx.builder().build();
boolean dnck = false;
......@@ -2290,9 +2296,92 @@ public class ClockInController {
status_ = 2;
}
}else {
msg = "当前是休息时间";
sbyf = 0;
status_ = 2;
// msg = "当前是休息时间";
// sbyf = 0;
// status_ = 2;
KqglAssoDkmx zydkmc = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, userid)
.ge(KqglAssoDkmx::getDksj, startDate).le(KqglAssoDkmx::getDksj, endDate));
if(zydkmc == null) {//新增
KqglAssoDkmx pcd = KqglAssoDkmx.builder().build();
pcd = KqglAssoDkmx.builder().userid(userid).data(putime).sbdk1(time_).sbdk1jg(0).ydkcs(0).qyid(qyid).dksj(startDate).yzcdcs(0).yzcdsc(Double.valueOf(0)).kgcdfzs(0).build();
if (!pcd.insert()) {
throw new CustomException("打卡明细-新增异常-1");
}
dkmx = pcd.getId();
atttype = 1;
xiuxidaka = 1;
}else {//修改
dkmx = zydkmc.getId();
KqglAssoDkmx zypcd = KqglAssoDkmx.builder().build();
kskd = false;
if((!("").equals(zydkmc.getSbdk1()) || zydkmc.getSbdk1() != null) && (("").equals(zydkmc.getXbdk1()) || zydkmc.getXbdk1() == null)){//下班1
zypcd.setId(zydkmc.getId());
zypcd.setXbdk1(time_);//下班1打卡时间
if(zydkmc.getSbdk1() != null){
Long time = (time_ - zydkmc.getSbdk1())/1000/60;
zypcd.setGzsc(Math.abs(Double.valueOf(time.toString())));//只打一次卡时计算工作时长
}
kqglassodkmxmapper.updateByPrimaryKeySelective(zypcd);//修改打卡记录
atttype = 2;
xiuxidaka = 1;
}else if((!("").equals(zydkmc.getSbdk1()) || zydkmc.getSbdk1() != null) && (!("").equals(zydkmc.getXbdk1()) || zydkmc.getXbdk1() != null)
&& (("").equals(zydkmc.getSbdk2()) || zydkmc.getSbdk2() == null)){//上班2
zypcd.setId(zydkmc.getId());
zypcd.setSbdk2(time_);//上班1打卡时间
kqglassodkmxmapper.updateByPrimaryKeySelective(zypcd);//修改打卡记录
atttype = 3;
xiuxidaka = 1;
}else if((!("").equals(zydkmc.getSbdk1()) || zydkmc.getSbdk1() != null) && (!("").equals(zydkmc.getXbdk1()) || zydkmc.getXbdk1() != null)
&& (!("").equals(zydkmc.getSbdk2()) || zydkmc.getSbdk2() != null) && (("").equals(zydkmc.getXbdk2()) || zydkmc.getXbdk2() == null)){//下班2
zypcd.setId(zydkmc.getId());
zypcd.setXbdk2(time_);//下班1打卡时间
//班次为4次时,计算工作时长
if(zydkmc.getSbdk2() != null){
Long time = (time_ - zydkmc.getSbdk2())/1000/60;
BigDecimal om = new BigDecimal(zydkmc.getGzsc());
BigDecimal on = new BigDecimal(time);
double worktime = Math.abs(om.add(on).doubleValue());
zypcd.setGzsc(worktime);
}
kqglassodkmxmapper.updateByPrimaryKeySelective(zypcd);//修改打卡记录
atttype = 4;
xiuxidaka = 1;
}else if((!("").equals(zydkmc.getSbdk1()) || zydkmc.getSbdk1() != null) && (!("").equals(zydkmc.getXbdk1()) || zydkmc.getXbdk1() != null)
&& (!("").equals(zydkmc.getSbdk2()) || zydkmc.getSbdk2() != null) && (!("").equals(zydkmc.getXbdk2()) || zydkmc.getXbdk2() != null)
&& (("").equals(zydkmc.getSbdk3()) || zydkmc.getSbdk3() == null)){//上班3
zypcd.setId(zydkmc.getId());
zypcd.setSbdk3(time_);//上班1打卡时间
kqglassodkmxmapper.updateByPrimaryKeySelective(zypcd);//修改打卡记录
atttype = 5;
xiuxidaka = 1;
}else if((!("").equals(zydkmc.getSbdk1()) || zydkmc.getSbdk1() != null) && (!("").equals(zydkmc.getXbdk1()) || zydkmc.getXbdk1() != null)
&& (!("").equals(zydkmc.getSbdk2()) || zydkmc.getSbdk2() != null) && (!("").equals(zydkmc.getXbdk2()) || zydkmc.getXbdk2() != null)
&& (!("").equals(zydkmc.getSbdk3()) || zydkmc.getSbdk3() != null) && (("").equals(zydkmc.getXbdk3()) || zydkmc.getXbdk3() == null)){
zypcd.setId(zydkmc.getId());
zypcd.setXbdk3(time_);//下班1打卡时间
//班次为6次时,计算工作时长
if(zydkmc.getSbdk3() != null){
Long time = (time_ - zydkmc.getSbdk3())/1000/60;
BigDecimal om = new BigDecimal(zydkmc.getGzsc());//第二次
BigDecimal on = new BigDecimal(time);
double worktime = Math.abs(om.add(on).doubleValue());
zypcd.setGzsc(worktime);
}
kqglassodkmxmapper.updateByPrimaryKeySelective(zypcd);//修改打卡记录
atttype = 6;
xiuxidaka = 1;
}else {
atttype = 7;
xiuxidaka = 1;
}
}
}
}
}
......@@ -2467,6 +2556,10 @@ public class ClockInController {
if(atttype > 0) {
if((atttype)%2 > 0){
type = 1;// 类型(类型 0:无排班打卡 1:上班 2:下班) punchcardtime == 0:无班次打卡
if(xiuxidaka > 0) {
status = 1;
}else {
if(attdate.getAttgrouptype() != 3) {
if(EmptyUtil.isNotEmpty(attdate.getAttsch())) {
if(punchcardtime == 0 && clockt.getShifid() != 0){
......@@ -2494,8 +2587,15 @@ public class ClockInController {
status = 2;
}
}
}
}else{
type = 2;// 类型(类型 0:无排班打卡 1:上班 2:下班)
if(xiuxidaka > 0) {
status = 1;
}else {
if(attdate.getAttgrouptype() != 3) {
if(EmptyUtil.isNotEmpty(attdate.getAttsch())) {
if(punchcardtime == 0 && clockt.getShifid() != 0){
......@@ -2524,6 +2624,9 @@ public class ClockInController {
}
}
}
}
}
//第二次未超过应上班打卡时间 打卡为无效
......@@ -3360,8 +3463,41 @@ public class ClockInController {
}else {
//休息的时候
// List<AttSchedule> attsch_ = new ArrayList<AttSchedule>();
// attdate.setAttsch(attsch_);
List<AttSchedule> attsch_ = new ArrayList<AttSchedule>();
if(dajllist_.size() > 0) {
for(int i=1;i<=dajllist_.size();i++){
KqglAssoDkjl dkjl = KqglAssoDkjl.builder().build();
BeanUtil.copyProperties(dajllist_.get(i-1), dkjl,"attdate","bcid","remarks","userId","attime","dkmxid","commentary","punchequipment","punchmode");
AttSchedule ast = AttSchedule.builder().build();
ast.setId(0);
ast.setIsdk(1);
ast.setDajl(dkjl);
ast.setSort(i);
attsch_.add(ast);
attdate.setAttsch(attsch_);
}
KqglAssoDkjl dkjj_ = KqglAssoDkjl.builder().build();
AttSchedule ast_ = AttSchedule.builder().build();
ast_.setId(0);
ast_.setIsdk(0);
ast_.setDajl(dkjj_);
ast_.setSort(dajllist_.size() + 1);
attsch_.add(ast_);
attdate.setAttsch(attsch_);
}else {
KqglAssoDkjl dkjj = KqglAssoDkjl.builder().build();
AttSchedule ast = AttSchedule.builder().build();
ast.setId(0);
ast.setIsdk(0);
ast.setDajl(dkjj);
ast.setSort(1);
attsch_.add(ast);
attdate.setAttsch(attsch_);
}
}
......@@ -3404,7 +3540,7 @@ public class ClockInController {
List<TransactionApprovalDto> tranappr = new ArrayList<TransactionApprovalDto>();
//事务审批单
List<KqglAssoRelationSummary> trap = KqglAssoRelationSummary.builder().build().selectList(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, userBean.getEmpNum())
.eq(KqglAssoRelationSummary::getAppTime, str));
.eq(KqglAssoRelationSummary::getAppTime, str).eq(KqglAssoRelationSummary::getOrgCode, userBean.getOrgCode()));
if(trap.size() > 0) {
for(KqglAssoRelationSummary spnsw : trap) {
if(spnsw.getApprovalType() != 5) {
......
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