Commit d38cfed3 by Administrator

Merge branch 'develop' into 'master'

Develop

See merge request 8timerv2/8timerapiv200!496
parents 8ceed22c 412052f3
......@@ -52,4 +52,6 @@ public class AttendanceAssistant implements Serializable{
int overtimeRulesId;//加班id
int fieldpersonnel;//外勤
int restdayclock;//休息日打卡
}
......@@ -46,6 +46,8 @@ public class AttendanceGroup implements Serializable{
private Integer overtimeRulesId;//加班规则id
private String overtimeRulesName;//加班规则名称
private Integer restdayclock;//休息日打卡
private Integer kqjid;
private List<AttGroupBinPunchMode> kqzdkfslist = new ArrayList<AttGroupBinPunchMode>();
......
......@@ -97,4 +97,7 @@ public class KqglMainKqz extends Model<KqglMainKqz> {
@ApiModelProperty(value="加班规则 加班规则",example="101")
private Integer overtimeRulesId;
@ApiModelProperty(value="休息日打卡开关 0:关 1:开",example="101")
private Integer restdayclock;
}
\ No newline at end of file
......@@ -50,6 +50,7 @@ import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.config.enums.SysRoleType;
import cn.timer.api.controller.kqgl.ClockInTool;
import cn.timer.api.dao.crm.CrmClientContactsMapper;
import cn.timer.api.dao.crm.CrmClientDataMapper;
import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper;
......@@ -610,7 +611,7 @@ public class CrmController {
crmClientDatas = CheckUtil.distinct(myClient, myAsso, true).stream()
.filter(CheckUtil.distinctByKey(CrmClientData::getId)).collect(Collectors.toList());
} else if (type == 1) // 我负责的客户
crmClientDatas = getMyCilent(empNum, orgCode, groupId, status, like,startCreateTime,endCreateTime,startFollowTime,endFollowTime,type);
crmClientDatas = getMyCilent(empNum, orgCode, groupId, status, like,startCreateTime,endCreateTime,startFollowTime,endFollowTime,typei);
else if (type == 2) // 我协作的客户
crmClientDatas = getMyAssociateCilent(empNum, orgCode, groupId, status, like,typei,startFollowTime,endFollowTime,startCreateTime,endCreateTime);
else if (type == 3) // 我关注的客户
......@@ -634,15 +635,22 @@ public class CrmController {
BeanUtil.copyProperties(crmd, crmdts , "iscooperation");
List<CrmClientAssociate> crmClientAssociates = CrmClientAssociate.builder().build()
.selectList(new QueryWrapper<CrmClientAssociate>().lambda().eq(CrmClientAssociate::getCid, crmd.getId()));
int u = 0;
if(crmClientAssociates.size() > 0) {
String[] collaborator = new String[crmClientAssociates.size()];
for (CrmClientAssociate crmClientAssociate : crmClientAssociates) {
Integer empNum1 = crmClientAssociate.getAssociateId();
if(userBean.getEmpNum().equals(empNum1)) {
collaborator[u] = String.valueOf(empNum1);
u++;
}
if(ClockInTool.contains(ClockInTool.deleteArrayNull(collaborator),String.valueOf(userBean.getEmpNum()))) {
crmdts.setIscooperation(1);
}else {
crmdts.setIscooperation(0);
}
}
}else {
crmdts.setIscooperation(0);
}
......
......@@ -1361,6 +1361,8 @@ public class AttController {
attgro.setIsWq(attass.getFieldpersonnel());//外勤:0-关 1-开
attgro.setRestdayclock(attass.getRestdayclock());//休息日打卡
if(attass.getAtttype() == 1){
attgro.setIsFdjjr(attass.getLegalholidays());//是否开启法定节假日休息(固定排班)
}
......
......@@ -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,98 @@ public class ClockInController {
status_ = 2;
}
}else {
//判断 考勤组是否开启休息日打卡
if(attgro.getRestdayclock().equals(0)) {
msg = "当前是休息时间";
sbyf = 0;
status_ = 2;
}else {
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 +2562,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 +2593,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 +2630,9 @@ public class ClockInController {
}
}
}
}
}
//第二次未超过应上班打卡时间 打卡为无效
......@@ -2656,7 +2765,7 @@ public class ClockInController {
String nowattdate = yymmdd+" "+ClockInTool.dateToWeek2(str);
//查询当天考勤记录
List<KqglAssoDkjl> dajllist_ = kqglassodkjlmapper.getDetailedRecordClock(startDate,endDate,userBean.getEmpNum(),nowattdate);
List<KqglAssoDkjl> dajllist_ = kqglassodkjlmapper.getDetailedRecordClock(startDate,endDate,userBean.getEmpNum(),nowattdate,userBean.getOrgCode());
if(dajllist_.size() > 0) {
dkcs = dajllist_.size();
......@@ -2709,7 +2818,7 @@ public class ClockInController {
String yeboattdate = attdate_+" "+ClockInTool.dateToWeek2(yesterday);
//次日查询昨日考勤时 时间范围扩大到 昨日开始到今日结束
List<KqglAssoDkjl> dajllistbefo = kqglassodkjlmapper.getDetailedRecordClock(startDateyesterday,endDate,userBean.getEmpNum(),yeboattdate);
List<KqglAssoDkjl> dajllistbefo = kqglassodkjlmapper.getDetailedRecordClock(startDateyesterday,endDate,userBean.getEmpNum(),yeboattdate,userBean.getOrgCode());
List<AttSchedule> beforeattsch = beforeattdate.getAttsch();
......@@ -2954,7 +3063,7 @@ public class ClockInController {
Long endDateafterday = DateUtil.getnowEndTime(23,DateUtil.getStringTime(afterday,"yyyy-MM-dd")).getTime();
if(sb1 == 1 ||xb1 == 1 || sb2 == 1 ||xb2 == 1 || sb3 == 1 ||xb3 == 1) {//当天存在次日打卡数据时 查询打卡记录范围应该是:当天的开始到后一天的结束
dajllist_ = kqglassodkjlmapper.getDetailedRecordClock(startDate,endDateafterday,userBean.getEmpNum(),nowattdate);
dajllist_ = kqglassodkjlmapper.getDetailedRecordClock(startDate,endDateafterday,userBean.getEmpNum(),nowattdate,userBean.getOrgCode());
}
KqglAssoDkjl dkjl = KqglAssoDkjl.builder().build();
......@@ -3057,7 +3166,7 @@ public class ClockInController {
/****/
//事务(请假,加班,调休,出差)
KqglAssoRelationSummary asssum1 = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, userBean.getEmpNum())
.eq(KqglAssoRelationSummary::getAppTime, str).last("LIMIT 1"));
.eq(KqglAssoRelationSummary::getAppTime, str).eq(KqglAssoRelationSummary::getOrgCode, userBean.getOrgCode()).last("LIMIT 1"));
if(asssum1 != null) {
if(asssum1.getApprovalType() != 5) {
......@@ -3360,8 +3469,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 +3546,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) {
......@@ -3565,7 +3707,7 @@ public class ClockInController {
//获取前一天最后下班的时间
yesterdaymx = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, userBean.getEmpNum())
.ge(KqglAssoDkmx::getDksj, startDateyesterday).le(KqglAssoDkmx::getDksj, endDateyesterday));
.ge(KqglAssoDkmx::getDksj, startDateyesterday).le(KqglAssoDkmx::getDksj, endDateyesterday).eq(KqglAssoDkmx::getQyid, userBean.getOrgCode()));
attdateyesterday = MethodCall(userBean.getOrgCode(),userBean.getEmpNum(),yesterday);
List<AttSchedule> ashyes = attdateyesterday.getAttsch();
......@@ -3795,7 +3937,7 @@ public class ClockInController {
//事务(请假,加班,调休,出差)
KqglAssoRelationSummary asssum = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, userBean.getEmpNum())
.eq(KqglAssoRelationSummary::getAppTime, num).last("LIMIT 1"));
.eq(KqglAssoRelationSummary::getAppTime, num).eq(KqglAssoRelationSummary::getOrgCode, userBean.getOrgCode()).last("LIMIT 1"));
if(asssum != null) {
if(asssum.getApprovalType() == 5) {//补卡
wocal.setCalendar_status(1);//打卡正常
......
......@@ -1309,7 +1309,8 @@ public class TimeCardController {
.isWq(attass.getFieldpersonnel()).isFdjjr(attass.getLegalholidays()).isXzbcdk(attass.getOptscheduling()).sybc(String.join(",",attass.getAttShifts()))
.isDqtx(attass.getAttRemind()).txry(String.join(",",attass.getAttRemindUserids())).txfs(attass.getAdvanceDays()).txxhts(attass.getRemCycleDays())
.txsjTime(attass.getReminderTime()).tsfs(String.join(",",attass.getPromptingMode())).isWpbsdk(attass.getAttRemind()).kqkssjTime(attass.getNewAttTime())
.zsgzsc(attass.getLeastworkTime()).zcgzsc(attass.getNormalWorkTime()).jbzdsc(attass.getMaxOvertimeTime()).overtimeRulesId(attass.getOvertimeRulesId()).build();
.zsgzsc(attass.getLeastworkTime()).zcgzsc(attass.getNormalWorkTime()).jbzdsc(attass.getMaxOvertimeTime()).overtimeRulesId(attass.getOvertimeRulesId())
.restdayclock(attass.getRestdayclock()).build();
// if (!attgro.insertOrUpdate())
if (!attgro.insert())
......
......@@ -96,7 +96,7 @@ public class AttendanceTaskTiming{
//typeid:1-员工 2-考勤组
// @Scheduled(cron = "0 */5 * * * ?")
// @Scheduled(cron = "0 16 17 * * ?")
// @Scheduled(cron = "0 15 16 * * ?")
@Scheduled(cron = "0 0 8,12,16,20 * * ?")//每天上午8、12点,下午16点,20点 执行
public void AttendanceTask() throws ParseException {
......
......@@ -88,7 +88,7 @@ public class LastMonthtimingExport {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
// @Scheduled(cron = "0 10 17 * * ?")
// @Scheduled(cron = "0 6 12 * * ?")
@Scheduled(cron = "0 0 4,20 * * ?")//每天上午4点,下午20点 执行
public void LastMonthtimingAttendanceTask() throws ParseException {
......
......@@ -795,7 +795,7 @@ public class SpmkController {
}
//我发起的
if(mySummaryQueryDto.getType() == 0) {
mySummaryQueryDto.setSts(null);
// mySummaryQueryDto.setSts(null);
}
// 缺-部门id 搜索
IPage<SpmkApproveSummary> pageAs = spmkApproveSummaryMapper.selectPageByQueryForEmpNum(page, mySummaryQueryDto);
......
......@@ -15,5 +15,5 @@ import cn.timer.api.bean.kqmk.KqglAssoDkjl;
*/
@Repository
public interface KqglAssoDkjlMapper extends BaseMapper<KqglAssoDkjl> {
List<KqglAssoDkjl> getDetailedRecordClock(Long start,Long end,Integer userId,String attdate);
List<KqglAssoDkjl> getDetailedRecordClock(Long start,Long end,Integer userId,String attdate,Integer qyid);
}
......@@ -54,4 +54,6 @@ public class AttendanceAssistantDto implements Serializable{
int overtimeRulesId;//加班id
int fieldpersonnel;//外勤
int restdayclock;//休息日打卡
}
......@@ -81,6 +81,9 @@ public class KqglMainKqzDto {
@ApiModelProperty(value="加班规则 加班规则",example="101")
private Integer overtimeRulesId;
@ApiModelProperty(value="休息日打卡开关 0:关 1:开",example="101")
private Integer restdayclock;
@ApiModelProperty(value = "考勤组人员数", example = "100")
private Integer kqznum;
......
......@@ -33,6 +33,8 @@
<result column="overtimeRulesName" property="overtimeRulesName" />
<result column="restdayclock" property="restdayclock" />
<collection property="kqzdkfslist" ofType="cn.timer.api.bean.kqgl.AttGroupBinPunchMode">
<result column="kqzId" property="kqzId" jdbcType="INTEGER" />
<result column="type" property="type" jdbcType="INTEGER" />
......@@ -95,7 +97,7 @@
<sql id="Base_Column_List" >
id, name, kqbz, pbfs, qyid, is_fdjjr, kqkssj_time, zsgzsc, zcgzsc, jbzdsc, is_dqtx,
txry, txfs, txxhts, txsj_time, tsfs, is_wpbsdk,sybc,is_xzbcdk,is_wq,overtime_rules_id
txry, txfs, txxhts, txsj_time, tsfs, is_wpbsdk,sybc,is_xzbcdk,is_wq,overtime_rules_id,restdayclock
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select kqz.*,
......@@ -113,14 +115,14 @@
kqkssj_time, zsgzsc, zcgzsc,
jbzdsc, is_dqtx, txry,
txfs, txxhts, txsj_time,
tsfs, is_wpbsdk,sybc,is_xzbcdk,is_wq)
tsfs, is_wpbsdk,sybc,is_xzbcdk,is_wq,restdayclock)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{kqbz,jdbcType=VARCHAR},
#{pbfs,jdbcType=INTEGER}, #{qyid,jdbcType=INTEGER}, #{isFdjjr,jdbcType=INTEGER},
#{kqkssjTime,jdbcType=VARCHAR}, #{zsgzsc,jdbcType=VARCHAR}, #{zcgzsc,jdbcType=VARCHAR},
#{jbzdsc,jdbcType=VARCHAR}, #{isDqtx,jdbcType=INTEGER}, #{txry,jdbcType=VARCHAR},
#{txfs,jdbcType=INTEGER}, #{txxhts,jdbcType=INTEGER}, #{txsjTime,jdbcType=VARCHAR},
#{tsfs,jdbcType=VARCHAR}, #{isWpbsdk,jdbcType=INTEGER}, #{sybc,jdbcType=VARCHAR},
#{isXzbcdk,jdbcType=INTEGER},#{isWq,jdbcType=INTEGER})
#{isXzbcdk,jdbcType=INTEGER},#{isWq,jdbcType=INTEGER},#{restdayclock,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="cn.timer.api.bean.kqgl.AttendanceGroup" useGeneratedKeys="true" keyProperty="id">
insert into kqgl_main_kqz
......@@ -186,6 +188,9 @@
<if test="overtimeRulesId != null" >
overtime_rules_id,
</if>
<if test="restdayclock != null" >
restdayclock,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
......@@ -249,6 +254,9 @@
<if test="overtimeRulesId != null" >
#{overtimeRulesId,jdbcType=INTEGER},
</if>
<if test="restdayclock != null" >
#{restdayclock,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="cn.timer.api.bean.kqgl.AttendanceGroup" >
......@@ -314,6 +322,9 @@
<if test="overtimeRulesId != null" >
overtime_rules_id = #{overtimeRulesId,jdbcType=INTEGER},
</if>
<if test="restdayclock != null" >
restdayclock = #{restdayclock,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
......@@ -338,7 +349,8 @@
sybc = #{sybc,jdbcType=VARCHAR},
is_xzbcdk = #{isXzbcdk,jdbcType=INTEGER},
is_wq = #{isWq,jdbcType=INTEGER},
overtime_rules_id = #{overtimeRulesId,jdbcType=INTEGER}
overtime_rules_id = #{overtimeRulesId,jdbcType=INTEGER},
restdayclock = #{restdayclock,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
......
......@@ -85,6 +85,7 @@
and dkjl.user_id = #{userId,jdbcType=INTEGER}
and dkjl.status not in (0,2)
and dkjl.attdate = #{attdate}
and dkjl.qyid = #{qyid}
</select>
<!--
......
......@@ -311,117 +311,125 @@
IFNULL((select kqz.pbfs from kqgl_main_kqz kqz where kqz.id = sum.att_group),'') as attpbfs,
IFNULL((select kqz.id from kqgl_main_kqz kqz where kqz.id = sum.att_group),'') as attid,
(CASE WHEN IFNULL((select kqz.pbfs from kqgl_main_kqz kqz where kqz.id = sum.att_group),'') = 1
THEN (IFNULL((select zh.bcid from kqgl_asso_zhoupaiban zh where zh.kqzid = sum.att_group
THEN (IFNULL((select te.bcid from kqgl_asso_teshu te where te.kqzid = sum.att_group and te.tsrq = #{param.times}
),(select zh.bcid from kqgl_asso_zhoupaiban zh where zh.kqzid = sum.att_group
and zh.type = (select CASE WHEN DAYNAME(#{param.times}) = 'Monday' THEN '1'
WHEN DAYNAME(#{param.times}) = 'Tuesday' THEN '2'
WHEN DAYNAME(#{param.times}) = 'Wednesday' THEN '3'
WHEN DAYNAME(#{param.times}) = 'Thursday' THEN '4'
WHEN DAYNAME(#{param.times}) = 'Friday' THEN '5'
WHEN DAYNAME(#{param.times}) = 'Saturday' THEN '6' ELSE '7' END)),(select te.bcid from kqgl_asso_teshu te where te.kqzid = sum.att_group and te.tsrq = #{param.times})))
WHEN DAYNAME(#{param.times}) = 'Saturday' THEN '6' ELSE '7' END))))
WHEN IFNULL((select kqz.pbfs from kqgl_main_kqz kqz where kqz.id = sum.att_group),'') = 2
THEN (select pb.bcid from kqgl_asso_pbmx pb where pb.userid = sum.num
and pb.`data` = #{param.times} and pb.kqzid = sum.att_group) ELSE '' END) as bcszid,
IFNULL((select bc.name from kqgl_asso_bcsz bc where bc.id = ((CASE WHEN IFNULL((select kqz.pbfs from kqgl_main_kqz kqz where kqz.id = sum.att_group),'') = 1
THEN (IFNULL((select zh.bcid from kqgl_asso_zhoupaiban zh where zh.kqzid = sum.att_group
THEN (IFNULL((select te.bcid from kqgl_asso_teshu te where te.kqzid = sum.att_group and te.tsrq = #{param.times}
),(select zh.bcid from kqgl_asso_zhoupaiban zh where zh.kqzid = sum.att_group
and zh.type = (select CASE WHEN DAYNAME(#{param.times}) = 'Monday' THEN '1'
WHEN DAYNAME(#{param.times}) = 'Tuesday' THEN '2'
WHEN DAYNAME(#{param.times}) = 'Wednesday' THEN '3'
WHEN DAYNAME(#{param.times}) = 'Thursday' THEN '4'
WHEN DAYNAME(#{param.times}) = 'Friday' THEN '5'
WHEN DAYNAME(#{param.times}) = 'Saturday' THEN '6' ELSE '7' END)),(select te.bcid from kqgl_asso_teshu te where te.kqzid = sum.att_group and te.tsrq = #{param.times})))
WHEN DAYNAME(#{param.times}) = 'Saturday' THEN '6' ELSE '7' END))))
WHEN IFNULL((select kqz.pbfs from kqgl_main_kqz kqz where kqz.id = sum.att_group),'') = 2
THEN (select pb.bcid from kqgl_asso_pbmx pb where pb.userid = sum.num
and pb.`data` = #{param.times} and pb.kqzid = sum.att_group) ELSE '' END))),'') as bcname,
IFNULL((select bc.sbdk1 from kqgl_asso_bcsz bc where bc.id = ((CASE WHEN IFNULL((select kqz.pbfs from kqgl_main_kqz kqz where kqz.id = sum.att_group),'') = 1
THEN (IFNULL((select zh.bcid from kqgl_asso_zhoupaiban zh where zh.kqzid = sum.att_group
THEN (IFNULL((select te.bcid from kqgl_asso_teshu te where te.kqzid = sum.att_group and te.tsrq = #{param.times}
),(select zh.bcid from kqgl_asso_zhoupaiban zh where zh.kqzid = sum.att_group
and zh.type = (select CASE WHEN DAYNAME(#{param.times}) = 'Monday' THEN '1'
WHEN DAYNAME(#{param.times}) = 'Tuesday' THEN '2'
WHEN DAYNAME(#{param.times}) = 'Wednesday' THEN '3'
WHEN DAYNAME(#{param.times}) = 'Thursday' THEN '4'
WHEN DAYNAME(#{param.times}) = 'Friday' THEN '5'
WHEN DAYNAME(#{param.times}) = 'Saturday' THEN '6' ELSE '7' END)),(select te.bcid from kqgl_asso_teshu te where te.kqzid = sum.att_group and te.tsrq = #{param.times})))
WHEN DAYNAME(#{param.times}) = 'Saturday' THEN '6' ELSE '7' END))))
WHEN IFNULL((select kqz.pbfs from kqgl_main_kqz kqz where kqz.id = sum.att_group),'') = 2
THEN (select pb.bcid from kqgl_asso_pbmx pb where pb.userid = sum.num
and pb.`data` = #{param.times} and pb.kqzid = sum.att_group) ELSE '' END))),'') as bcsbdk1,
IFNULL((select bc.xbdk1 from kqgl_asso_bcsz bc where bc.id = ((CASE WHEN IFNULL((select kqz.pbfs from kqgl_main_kqz kqz where kqz.id = sum.att_group),'') = 1
THEN (IFNULL((select zh.bcid from kqgl_asso_zhoupaiban zh where zh.kqzid = sum.att_group
THEN (IFNULL((select te.bcid from kqgl_asso_teshu te where te.kqzid = sum.att_group and te.tsrq = #{param.times}
),(select zh.bcid from kqgl_asso_zhoupaiban zh where zh.kqzid = sum.att_group
and zh.type = (select CASE WHEN DAYNAME(#{param.times}) = 'Monday' THEN '1'
WHEN DAYNAME(#{param.times}) = 'Tuesday' THEN '2'
WHEN DAYNAME(#{param.times}) = 'Wednesday' THEN '3'
WHEN DAYNAME(#{param.times}) = 'Thursday' THEN '4'
WHEN DAYNAME(#{param.times}) = 'Friday' THEN '5'
WHEN DAYNAME(#{param.times}) = 'Saturday' THEN '6' ELSE '7' END)),(select te.bcid from kqgl_asso_teshu te where te.kqzid = sum.att_group and te.tsrq = #{param.times})))
WHEN DAYNAME(#{param.times}) = 'Saturday' THEN '6' ELSE '7' END))))
WHEN IFNULL((select kqz.pbfs from kqgl_main_kqz kqz where kqz.id = sum.att_group),'') = 2
THEN (select pb.bcid from kqgl_asso_pbmx pb where pb.userid = sum.num
and pb.`data` = #{param.times} and pb.kqzid = sum.att_group) ELSE '' END))),'') as bcxbdk1,
IFNULL((select bc.sbdk2 from kqgl_asso_bcsz bc where bc.id = ((CASE WHEN IFNULL((select kqz.pbfs from kqgl_main_kqz kqz where kqz.id = sum.att_group),'') = 1
THEN (IFNULL((select zh.bcid from kqgl_asso_zhoupaiban zh where zh.kqzid = sum.att_group
THEN (IFNULL((select te.bcid from kqgl_asso_teshu te where te.kqzid = sum.att_group and te.tsrq = #{param.times}
),(select zh.bcid from kqgl_asso_zhoupaiban zh where zh.kqzid = sum.att_group
and zh.type = (select CASE WHEN DAYNAME(#{param.times}) = 'Monday' THEN '1'
WHEN DAYNAME(#{param.times}) = 'Tuesday' THEN '2'
WHEN DAYNAME(#{param.times}) = 'Wednesday' THEN '3'
WHEN DAYNAME(#{param.times}) = 'Thursday' THEN '4'
WHEN DAYNAME(#{param.times}) = 'Friday' THEN '5'
WHEN DAYNAME(#{param.times}) = 'Saturday' THEN '6' ELSE '7' END)),(select te.bcid from kqgl_asso_teshu te where te.kqzid = sum.att_group and te.tsrq = #{param.times})))
WHEN DAYNAME(#{param.times}) = 'Saturday' THEN '6' ELSE '7' END))))
WHEN IFNULL((select kqz.pbfs from kqgl_main_kqz kqz where kqz.id = sum.att_group),'') = 2
THEN (select pb.bcid from kqgl_asso_pbmx pb where pb.userid = sum.num
and pb.`data` = #{param.times} and pb.kqzid = sum.att_group) ELSE '' END))),'') as bcsbdk2,
IFNULL((select bc.xbdk2 from kqgl_asso_bcsz bc where bc.id = ((CASE WHEN IFNULL((select kqz.pbfs from kqgl_main_kqz kqz where kqz.id = sum.att_group),'') = 1
THEN (IFNULL((select zh.bcid from kqgl_asso_zhoupaiban zh where zh.kqzid = sum.att_group
THEN (IFNULL((select te.bcid from kqgl_asso_teshu te where te.kqzid = sum.att_group and te.tsrq = #{param.times}
),(select zh.bcid from kqgl_asso_zhoupaiban zh where zh.kqzid = sum.att_group
and zh.type = (select CASE WHEN DAYNAME(#{param.times}) = 'Monday' THEN '1'
WHEN DAYNAME(#{param.times}) = 'Tuesday' THEN '2'
WHEN DAYNAME(#{param.times}) = 'Wednesday' THEN '3'
WHEN DAYNAME(#{param.times}) = 'Thursday' THEN '4'
WHEN DAYNAME(#{param.times}) = 'Friday' THEN '5'
WHEN DAYNAME(#{param.times}) = 'Saturday' THEN '6' ELSE '7' END)),(select te.bcid from kqgl_asso_teshu te where te.kqzid = sum.att_group and te.tsrq = #{param.times})))
WHEN DAYNAME(#{param.times}) = 'Saturday' THEN '6' ELSE '7' END))))
WHEN IFNULL((select kqz.pbfs from kqgl_main_kqz kqz where kqz.id = sum.att_group),'') = 2
THEN (select pb.bcid from kqgl_asso_pbmx pb where pb.userid = sum.num
and pb.`data` = #{param.times} and pb.kqzid = sum.att_group) ELSE '' END))),'') as bcxbdk2,
IFNULL((select bc.sbdk3 from kqgl_asso_bcsz bc where bc.id = ((CASE WHEN IFNULL((select kqz.pbfs from kqgl_main_kqz kqz where kqz.id = sum.att_group),'') = 1
THEN (IFNULL((select zh.bcid from kqgl_asso_zhoupaiban zh where zh.kqzid = sum.att_group
THEN (IFNULL((select te.bcid from kqgl_asso_teshu te where te.kqzid = sum.att_group and te.tsrq = #{param.times}
),(select zh.bcid from kqgl_asso_zhoupaiban zh where zh.kqzid = sum.att_group
and zh.type = (select CASE WHEN DAYNAME(#{param.times}) = 'Monday' THEN '1'
WHEN DAYNAME(#{param.times}) = 'Tuesday' THEN '2'
WHEN DAYNAME(#{param.times}) = 'Wednesday' THEN '3'
WHEN DAYNAME(#{param.times}) = 'Thursday' THEN '4'
WHEN DAYNAME(#{param.times}) = 'Friday' THEN '5'
WHEN DAYNAME(#{param.times}) = 'Saturday' THEN '6' ELSE '7' END)),(select te.bcid from kqgl_asso_teshu te where te.kqzid = sum.att_group and te.tsrq = #{param.times})))
WHEN DAYNAME(#{param.times}) = 'Saturday' THEN '6' ELSE '7' END))))
WHEN IFNULL((select kqz.pbfs from kqgl_main_kqz kqz where kqz.id = sum.att_group),'') = 2
THEN (select pb.bcid from kqgl_asso_pbmx pb where pb.userid = sum.num
and pb.`data` = #{param.times} and pb.kqzid = sum.att_group) ELSE '' END))),'') as bcsbdk3,
IFNULL((select bc.xbdk3 from kqgl_asso_bcsz bc where bc.id = ((CASE WHEN IFNULL((select kqz.pbfs from kqgl_main_kqz kqz where kqz.id = sum.att_group),'') = 1
THEN (IFNULL((select zh.bcid from kqgl_asso_zhoupaiban zh where zh.kqzid = sum.att_group
THEN (IFNULL((select te.bcid from kqgl_asso_teshu te where te.kqzid = sum.att_group and te.tsrq = #{param.times}
),(select zh.bcid from kqgl_asso_zhoupaiban zh where zh.kqzid = sum.att_group
and zh.type = (select CASE WHEN DAYNAME(#{param.times}) = 'Monday' THEN '1'
WHEN DAYNAME(#{param.times}) = 'Tuesday' THEN '2'
WHEN DAYNAME(#{param.times}) = 'Wednesday' THEN '3'
WHEN DAYNAME(#{param.times}) = 'Thursday' THEN '4'
WHEN DAYNAME(#{param.times}) = 'Friday' THEN '5'
WHEN DAYNAME(#{param.times}) = 'Saturday' THEN '6' ELSE '7' END)),(select te.bcid from kqgl_asso_teshu te where te.kqzid = sum.att_group and te.tsrq = #{param.times})))
WHEN DAYNAME(#{param.times}) = 'Saturday' THEN '6' ELSE '7' END))))
WHEN IFNULL((select kqz.pbfs from kqgl_main_kqz kqz where kqz.id = sum.att_group),'') = 2
THEN (select pb.bcid from kqgl_asso_pbmx pb where pb.userid = sum.num
and pb.`data` = #{param.times} and pb.kqzid = sum.att_group) ELSE '' END))),'') as bcxbdk3,
IFNULL((select (bc.sxbcs * 2) from kqgl_asso_bcsz bc where bc.id = ((CASE WHEN IFNULL((select kqz.pbfs from kqgl_main_kqz kqz where kqz.id = sum.att_group),'') = 1
THEN (IFNULL((select zh.bcid from kqgl_asso_zhoupaiban zh where zh.kqzid = sum.att_group
THEN (IFNULL((select te.bcid from kqgl_asso_teshu te where te.kqzid = sum.att_group and te.tsrq = #{param.times}
),(select zh.bcid from kqgl_asso_zhoupaiban zh where zh.kqzid = sum.att_group
and zh.type = (select CASE WHEN DAYNAME(#{param.times}) = 'Monday' THEN '1'
WHEN DAYNAME(#{param.times}) = 'Tuesday' THEN '2'
WHEN DAYNAME(#{param.times}) = 'Wednesday' THEN '3'
WHEN DAYNAME(#{param.times}) = 'Thursday' THEN '4'
WHEN DAYNAME(#{param.times}) = 'Friday' THEN '5'
WHEN DAYNAME(#{param.times}) = 'Saturday' THEN '6' ELSE '7' END)),(select te.bcid from kqgl_asso_teshu te where te.kqzid = sum.att_group and te.tsrq = #{param.times})))
WHEN DAYNAME(#{param.times}) = 'Saturday' THEN '6' ELSE '7' END))))
WHEN IFNULL((select kqz.pbfs from kqgl_main_kqz kqz where kqz.id = sum.att_group),'') = 2
THEN (select pb.bcid from kqgl_asso_pbmx pb where pb.userid = sum.num
and pb.`data` = #{param.times} and pb.kqzid = sum.att_group) ELSE '' END))),'') as ydkcs,
IFNULL((select bc.is_xbdk from kqgl_asso_bcsz bc where bc.id = ((CASE WHEN IFNULL((select kqz.pbfs from kqgl_main_kqz kqz where kqz.id = sum.att_group),'') = 1
THEN (IFNULL((select zh.bcid from kqgl_asso_zhoupaiban zh where zh.kqzid = sum.att_group
THEN (IFNULL((select te.bcid from kqgl_asso_teshu te where te.kqzid = sum.att_group and te.tsrq = #{param.times}
), (select zh.bcid from kqgl_asso_zhoupaiban zh where zh.kqzid = sum.att_group
and zh.type = (select CASE WHEN DAYNAME(#{param.times}) = 'Monday' THEN '1'
WHEN DAYNAME(#{param.times}) = 'Tuesday' THEN '2'
WHEN DAYNAME(#{param.times}) = 'Wednesday' THEN '3'
WHEN DAYNAME(#{param.times}) = 'Thursday' THEN '4'
WHEN DAYNAME(#{param.times}) = 'Friday' THEN '5'
WHEN DAYNAME(#{param.times}) = 'Saturday' THEN '6' ELSE '7' END)), (select te.bcid from kqgl_asso_teshu te where te.kqzid = sum.att_group and te.tsrq = #{param.times})))
WHEN DAYNAME(#{param.times}) = 'Saturday' THEN '6' ELSE '7' END))))
WHEN IFNULL((select kqz.pbfs from kqgl_main_kqz kqz where kqz.id = sum.att_group),'') = 2
THEN (select pb.bcid from kqgl_asso_pbmx pb where pb.userid = sum.num
and pb.`data` = #{param.times} and pb.kqzid = sum.att_group) ELSE '' END))),'') as isxbdk,
'' address,'' remarks,'' cardtype,'' macaddress,'' macname,
IFNULL(rtj.attdate, '') attdate,IFNULL(rtj.userid,'') userid,
#{param.times} data,
......
......@@ -25,6 +25,7 @@
<result column="is_xzbcdk" property="isXzbcdk" />
<result column="is_wq" property="isWq" />
<result column="overtime_rules_id" property="overtimeRulesId" />
<result column="restdayclock" property="restdayclock" />
</resultMap>
<resultMap id="AuxiliaryMap" type="cn.timer.api.dto.kqmk.KqglMainKqzDto" >
......@@ -82,7 +83,8 @@
sybc,
is_xzbcdk,
is_wq,
overtime_rules_id
overtime_rules_id,
restdayclock
</sql>
<sql id="Base_Column_List_Alias">
......@@ -106,7 +108,8 @@
sybc KqglMainKqz_sybc,
is_xzbcdk KqglMainKqz_is_xzbcdk,
is_wq KqglMainKqz_is_wq,
overtime_rules_id KqglMainKqz_overtime_rules_id
overtime_rules_id KqglMainKqz_overtime_rules_id,
restdayclock KqglMainKqz_restdayclock
</sql>
<sql id="Base_Column_List_a">
......@@ -130,7 +133,8 @@
a.sybc,
a.is_xzbcdk,
a.is_wq,
a.overtime_rules_id
a.overtime_rules_id,
a.restdayclock
</sql>
<select id="selectAttGroupMachineByQyid" resultMap="AuxiliaryMap">
......
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