数字建考勤接入
parent
0dc727670e
commit
8a4261e572
|
@ -207,7 +207,10 @@ export default {
|
|||
if (tmps.length > 0) {
|
||||
this.$store.dispatch("SetSelProject", tmps[0]);
|
||||
this.selProject = tmps[0];
|
||||
this.selProject.vendorsCode = "uni";
|
||||
if(this.sel.vendorsCode == "jgw" ){
|
||||
this.selProject.vendorsCode = "uni";
|
||||
}
|
||||
|
||||
document.title = this.selProject.projectName + " - 大屏";
|
||||
} else {
|
||||
this.$store.dispatch("SetSelProject", null);
|
||||
|
|
|
@ -205,7 +205,6 @@ export default {
|
|||
}),
|
||||
]
|
||||
this.$api.http.all(ajax).then((res) => {
|
||||
console.log(res)
|
||||
this.allData = res[0]
|
||||
this.curMonthData = res[1]
|
||||
this.yearMonthData = res[2]
|
||||
|
@ -236,6 +235,7 @@ export default {
|
|||
tmps = this.curMonthData.filter((it) => it.factorType == 0)
|
||||
this.totalData[2] = tmps.length > 0 ? tmps[0].emissionReduction : 0
|
||||
this.chartKey++
|
||||
setTimeout(this.loadData,60*1000);
|
||||
})
|
||||
},
|
||||
renderChart1() {
|
||||
|
|
|
@ -579,7 +579,10 @@ export default {
|
|||
}
|
||||
this.$api.project.getProjectInfo(this.selProject.id).then((d) => {
|
||||
this.prjInfo = d.data || {}
|
||||
this.prjInfo.vendorsCode = 'uni'
|
||||
if(this.prjInfo.vendorsCode == 'jgw'){
|
||||
this.prjInfo.vendorsCode = 'uni'
|
||||
}
|
||||
|
||||
let tmps = this.prjInfo.projectDeptsList || []
|
||||
const func = (t) => {
|
||||
let objs = tmps.filter((it) => it.deptType == t)
|
||||
|
|
|
@ -197,6 +197,7 @@ export default {
|
|||
this.getWorkerCountGroupByType()
|
||||
this.getRealAttendance()
|
||||
this.getAttendanceAlert()
|
||||
setTimeout(this.init,3*60*1000);
|
||||
},
|
||||
resize() {
|
||||
let is1K = this.$dpi() == '1K'
|
||||
|
@ -257,8 +258,8 @@ export default {
|
|||
this.weekData = d.data.map((it) => {
|
||||
return {
|
||||
name: it.dt.substring(5).replace('-', '.'),
|
||||
//value: it.cnt,
|
||||
value: it.cnt + parseInt(Math.random() * 100),
|
||||
value: it.cnt,
|
||||
|
||||
}
|
||||
})
|
||||
this.chartKey++
|
||||
|
|
|
@ -664,16 +664,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="getRealAttendance" resultMap="SurProjectAttendanceDataResult">
|
||||
<!--
|
||||
|
||||
select * from sur_project_attendance_data_${year}
|
||||
where date(attendance_time)=date(now()) or date(attendance_out_time)=date(now())
|
||||
and is_del!=1
|
||||
and projectid=#{prjId}
|
||||
order by ifnull(attendance_time,attendance_out_time) DESC
|
||||
LIMIT 4-->
|
||||
select * from yanzhu_jh.sur_project_attendance_data_2024
|
||||
where (date(attendance_time)='2024-03-22' or date(attendance_out_time)='2024-03-22')
|
||||
order by ifnull(attendance_time,attendance_out_time) DESC
|
||||
LIMIT 4
|
||||
</select>
|
||||
</mapper>
|
|
@ -830,7 +830,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="getAttendanceAlert" resultMap="SurProjectAttendanceUserResult">
|
||||
|
||||
<!--
|
||||
|
||||
select u.*,TIMESTAMPDIFF(Day, att.dt,now()) id
|
||||
from (
|
||||
select su.workerId,su.name,pi.project_name companyName, pdept.sub_dept_name teamName
|
||||
|
@ -851,28 +851,6 @@ and cfg.project_id=#{projectId} ) u
|
|||
GROUP BY workerId
|
||||
order by max(ifnull(attendance_time,attendance_out_time))
|
||||
) att on u.workerId=att.workerId
|
||||
-->
|
||||
select u.*,TIMESTAMPDIFF(Day, att.dt,now()) id
|
||||
from (
|
||||
select su.workerId,su.name,pi.project_name companyName, pdept.sub_dept_name teamName
|
||||
from ( select 11 cfgid, name,workerId
|
||||
from yanzhu_jh.sur_project_attendance_user where cfgId=1) su
|
||||
left join attendance_cfg cfg on su.cfgId=cfg.ID
|
||||
left join pro_project_info pi on pi.id = cfg.project_id
|
||||
join pro_project_info_subdepts pdept on cfg.dept_id=pdept.id
|
||||
|
||||
) u
|
||||
join
|
||||
|
||||
(
|
||||
|
||||
select workerId,max(ifnull(attendance_time,attendance_out_time)) dt
|
||||
from yanzhu_jh.sur_project_attendance_data_2024
|
||||
where projectid=644 and is_del!=1
|
||||
GROUP BY workerId
|
||||
order by max(ifnull(attendance_time,attendance_out_time))
|
||||
) att on u.workerId=att.workerId
|
||||
|
||||
LIMIT 10
|
||||
</select>
|
||||
</mapper>
|
|
@ -0,0 +1,512 @@
|
|||
package com.yanzhu.job.domain;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.yanzhu.common.core.annotation.Excel;
|
||||
import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 劳务实名制管理对象 sur_project_attendance_data
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-09-24
|
||||
*/
|
||||
public class QuartzProjectAttendanceData extends BaseEntity
|
||||
{
|
||||
public QuartzProjectAttendanceData(){
|
||||
this.year= DateTime.now().year();
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private int year;
|
||||
|
||||
public int getYear() {
|
||||
return year;
|
||||
}
|
||||
|
||||
public void setYear(int year) {
|
||||
this.year = year;
|
||||
}
|
||||
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
public String getDeptName() {
|
||||
return deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
public String getWorkerName() {
|
||||
return workerName;
|
||||
}
|
||||
|
||||
public void setWorkerName(String workerName) {
|
||||
this.workerName = workerName;
|
||||
}
|
||||
|
||||
public String getWorkerPhoto() {
|
||||
return workerPhoto;
|
||||
}
|
||||
|
||||
public void setWorkerPhoto(String workerPhoto) {
|
||||
this.workerPhoto = workerPhoto;
|
||||
}
|
||||
|
||||
public Long getWorkerGender() {
|
||||
return workerGender;
|
||||
}
|
||||
|
||||
public void setWorkerGender(Long workerGender) {
|
||||
this.workerGender = workerGender;
|
||||
}
|
||||
|
||||
public Long getBirthDate() {
|
||||
return birthDate;
|
||||
}
|
||||
|
||||
public void setBirthDate(Long birthDate) {
|
||||
this.birthDate = birthDate;
|
||||
}
|
||||
|
||||
public String getGroupName() {
|
||||
return groupName;
|
||||
}
|
||||
|
||||
public void setGroupName(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
|
||||
public String getWorkTypeName() {
|
||||
return workTypeName;
|
||||
}
|
||||
|
||||
public void setWorkTypeName(String workTypeName) {
|
||||
this.workTypeName = workTypeName;
|
||||
}
|
||||
|
||||
public String getEthnic() {
|
||||
return ethnic;
|
||||
}
|
||||
|
||||
public void setEthnic(String ethnic) {
|
||||
this.ethnic = ethnic;
|
||||
}
|
||||
|
||||
public String getNativePlace() {
|
||||
return nativePlace;
|
||||
}
|
||||
|
||||
public void setNativePlace(String nativePlace) {
|
||||
this.nativePlace = nativePlace;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public Integer getSpecWorkType() {
|
||||
return specWorkType;
|
||||
}
|
||||
|
||||
public void setSpecWorkType(Integer specWorkType) {
|
||||
this.specWorkType = specWorkType;
|
||||
}
|
||||
|
||||
public String getCompanyName() {
|
||||
return companyName;
|
||||
}
|
||||
|
||||
public void setCompanyName(String companyName) {
|
||||
this.companyName = companyName;
|
||||
}
|
||||
|
||||
public String getAttendanceOutTime() {
|
||||
return attendanceOutTime;
|
||||
}
|
||||
|
||||
public void setAttendanceOutTime(String attendanceOutTime) {
|
||||
this.attendanceOutTime = attendanceOutTime;
|
||||
}
|
||||
|
||||
|
||||
private Long projectId;
|
||||
@Excel(name = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
private Long deptId;
|
||||
@Excel(name = "部门名称")
|
||||
private String deptName;
|
||||
@Excel(name = "姓名")
|
||||
private String workerName;
|
||||
|
||||
private String workerPhoto;
|
||||
@Excel(name = "性别0:男 1:女")
|
||||
private Long workerGender;
|
||||
|
||||
private Long birthDate;
|
||||
@Excel(name = "所属班组")
|
||||
private String groupName;
|
||||
@Excel(name = "工种")
|
||||
private String workTypeName;
|
||||
@Excel(name = "民族")
|
||||
private String ethnic;
|
||||
@Excel(name = "籍贯")
|
||||
private String nativePlace;
|
||||
|
||||
@Excel(name = "联系电话")
|
||||
private String phone;
|
||||
@Excel(name = "是否特殊工种")
|
||||
private Integer specWorkType;
|
||||
|
||||
private String companyTypeId;
|
||||
@Excel(name = "分包商名称")
|
||||
private String companyName;
|
||||
|
||||
private String workerId;
|
||||
|
||||
/** 考勤时间yyyy-MM-dd HH:mm:ss */
|
||||
@Excel(name = "考勤时间(进场)")
|
||||
private String attendanceTime;
|
||||
|
||||
@Excel(name = "考勤时间(离开)")
|
||||
private String attendanceOutTime;
|
||||
/** 身份证号 */
|
||||
@Excel(name = "身份证号")
|
||||
private String identification;
|
||||
|
||||
/** */
|
||||
private Long id;
|
||||
|
||||
/** 配置项ID,可以获取项目ID和总包ID */
|
||||
private Long cfgid;
|
||||
|
||||
/** 注册应用ID */
|
||||
private String appId;
|
||||
|
||||
/** 厂商编号参考字典attendance_vendors */
|
||||
private String vendorsCode;
|
||||
|
||||
/** 服务端ID */
|
||||
private String serverid;
|
||||
|
||||
/** 队伍id */
|
||||
private Long teamId;
|
||||
|
||||
/** 工种编码 */
|
||||
private String workTypeCode;
|
||||
|
||||
/** 分包商id */
|
||||
private String companyId;
|
||||
|
||||
/** 平台对应分包商ID */
|
||||
private Long vendorId;
|
||||
|
||||
/** 设备编号 */
|
||||
private String deviceCode;
|
||||
|
||||
/** 照片 */
|
||||
private String scanPhoto;
|
||||
|
||||
/** */
|
||||
private Long isDel;
|
||||
|
||||
private Long subDeptId;
|
||||
|
||||
/** 重要::yanzhu接口接收base64图片 */
|
||||
private String scanPhotoBase64;
|
||||
|
||||
/** 重要::yanzhu出门进门逻辑判断 */
|
||||
private String attendanceType;
|
||||
|
||||
public String getScanPhotoBase64() {
|
||||
return scanPhotoBase64;
|
||||
}
|
||||
|
||||
public void setScanPhotoBase64(String scanPhotoBase64) {
|
||||
this.scanPhotoBase64 = scanPhotoBase64;
|
||||
}
|
||||
|
||||
public String getAttendanceType() {
|
||||
return attendanceType;
|
||||
}
|
||||
|
||||
public void setAttendanceType(String attendanceType) {
|
||||
this.attendanceType = attendanceType;
|
||||
}
|
||||
|
||||
public static QuartzProjectAttendanceData createFromHuazhu(JSONObject j) {
|
||||
QuartzProjectAttendanceData d=new QuartzProjectAttendanceData();
|
||||
d.vendorsCode="huazhu";
|
||||
d.serverid=j.getString("id");
|
||||
d.workerId=j.getString("labourWorkerId");
|
||||
long recordTime=j.getLongValue("recordTime",0);
|
||||
if(recordTime>0){
|
||||
if(j.getIntValue("inOrOut",1)==1){
|
||||
d.setRemark("E");
|
||||
}else{
|
||||
d.setRemark("L");
|
||||
}
|
||||
d.attendanceTime= DateUtil.format(DateUtil.date(recordTime),"yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
d.identification=j.getString("idCardNo");
|
||||
d.teamId=j.getLongValue("teamId",0);
|
||||
d.workTypeCode=j.getString("workerTypeId");
|
||||
d.companyId=j.getString("unitId");
|
||||
d.deviceCode=j.getString("deviceNo");
|
||||
return d;
|
||||
}
|
||||
|
||||
public static QuartzProjectAttendanceData createFromJgw(JSONObject j) {
|
||||
QuartzProjectAttendanceData d=new QuartzProjectAttendanceData();
|
||||
d.vendorsCode="jgw";
|
||||
d.serverid=j.getString("id");
|
||||
d.workerId=j.getString("workerId");
|
||||
if("2".equals(j.getString("machineType"))){
|
||||
d.setRemark("E");
|
||||
}else{
|
||||
d.setRemark("L");
|
||||
}
|
||||
d.attendanceTime = j.getString("checkinTime");
|
||||
|
||||
d.teamId=0l;
|
||||
d.workTypeCode="";
|
||||
d.companyId=j.getString("subcontractorId");
|
||||
d.deviceCode=j.getString("deviceSerialNo");
|
||||
d.isDel=0l;
|
||||
return d;
|
||||
}
|
||||
|
||||
public Long getDeptId() {
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
|
||||
public Long getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public void setProjectId(Long projectId) {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public Long getSubDeptId() {
|
||||
return subDeptId;
|
||||
}
|
||||
|
||||
public void setSubDeptId(Long subDeptId) {
|
||||
this.subDeptId = subDeptId;
|
||||
}
|
||||
|
||||
public String getCompanyTypeId() {
|
||||
return companyTypeId;
|
||||
}
|
||||
|
||||
public void setCompanyTypeId(String companyTypeId) {
|
||||
this.companyTypeId = companyTypeId;
|
||||
}
|
||||
|
||||
public static QuartzProjectAttendanceData create(JSONObject json) {
|
||||
QuartzProjectAttendanceData d=new QuartzProjectAttendanceData();
|
||||
d.attendanceTime=json.getString("time");
|
||||
if("E".equals(json.getString("type"))){
|
||||
d.setRemark("E");
|
||||
}else{
|
||||
d.setRemark("L");
|
||||
}
|
||||
d.serverid=json.getString("id");
|
||||
d.workerId=json.getString("workerId");
|
||||
d.identification=json.getString("identification");
|
||||
d.teamId=json.getLong("teamId");
|
||||
d.workTypeCode=json.getString("workerTypeId");
|
||||
d.companyId=json.getString("companyId");
|
||||
d.vendorId=json.getLong("vendorId");
|
||||
d.deviceCode=json.getString("deviceCode");
|
||||
d.scanPhoto=json.getString("scanPhoto");
|
||||
d.isDel=0l;
|
||||
return d;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setCfgid(Long cfgid)
|
||||
{
|
||||
this.cfgid = cfgid;
|
||||
}
|
||||
|
||||
public Long getCfgid()
|
||||
{
|
||||
return cfgid;
|
||||
}
|
||||
public void setVendorsCode(String vendorsCode)
|
||||
{
|
||||
this.vendorsCode = vendorsCode;
|
||||
}
|
||||
|
||||
public String getVendorsCode()
|
||||
{
|
||||
return vendorsCode;
|
||||
}
|
||||
public void setServerid(String serverid)
|
||||
{
|
||||
this.serverid = serverid;
|
||||
}
|
||||
|
||||
public String getServerid()
|
||||
{
|
||||
return serverid;
|
||||
}
|
||||
public void setWorkerId(String workerId)
|
||||
{
|
||||
this.workerId = workerId;
|
||||
}
|
||||
|
||||
public String getWorkerId()
|
||||
{
|
||||
return workerId;
|
||||
}
|
||||
|
||||
public void setAttendanceTime(String attendanceTime)
|
||||
{
|
||||
this.attendanceTime = attendanceTime;
|
||||
}
|
||||
|
||||
public String getAttendanceTime()
|
||||
{
|
||||
return attendanceTime;
|
||||
}
|
||||
public void setIdentification(String identification)
|
||||
{
|
||||
this.identification = identification;
|
||||
}
|
||||
|
||||
public String getIdentification()
|
||||
{
|
||||
return identification;
|
||||
}
|
||||
public void setTeamId(Long teamId)
|
||||
{
|
||||
this.teamId = teamId;
|
||||
}
|
||||
|
||||
public Long getTeamId()
|
||||
{
|
||||
return teamId;
|
||||
}
|
||||
public void setWorkTypeCode(String workTypeCode)
|
||||
{
|
||||
this.workTypeCode = workTypeCode;
|
||||
}
|
||||
|
||||
public String getWorkTypeCode()
|
||||
{
|
||||
return workTypeCode;
|
||||
}
|
||||
public void setCompanyId(String companyId)
|
||||
{
|
||||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
public String getCompanyId()
|
||||
{
|
||||
return companyId;
|
||||
}
|
||||
public void setVendorId(Long vendorId)
|
||||
{
|
||||
this.vendorId = vendorId;
|
||||
}
|
||||
|
||||
public Long getVendorId()
|
||||
{
|
||||
return vendorId;
|
||||
}
|
||||
|
||||
public void setDeviceCode(String deviceCode)
|
||||
{
|
||||
this.deviceCode = deviceCode;
|
||||
}
|
||||
|
||||
public String getDeviceCode()
|
||||
{
|
||||
return deviceCode;
|
||||
}
|
||||
|
||||
|
||||
public void setScanPhoto(String scanPhoto)
|
||||
{
|
||||
this.scanPhoto = scanPhoto;
|
||||
}
|
||||
|
||||
public String getScanPhoto()
|
||||
{
|
||||
return scanPhoto;
|
||||
}
|
||||
|
||||
public void setIsDel(Long isDel)
|
||||
{
|
||||
this.isDel = isDel;
|
||||
}
|
||||
|
||||
public Long getIsDel()
|
||||
{
|
||||
return isDel;
|
||||
}
|
||||
|
||||
public String getAppId() {
|
||||
return appId;
|
||||
}
|
||||
|
||||
public void setAppId(String appId) {
|
||||
this.appId = appId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("cfgid", getCfgid())
|
||||
.append("vendorsCode", getVendorsCode())
|
||||
.append("serverid", getServerid())
|
||||
.append("workerId", getWorkerId())
|
||||
.append("attendanceTime", getAttendanceTime())
|
||||
.append("identification", getIdentification())
|
||||
.append("teamId", getTeamId())
|
||||
.append("workTypeCode", getWorkTypeCode())
|
||||
.append("companyId", getCompanyId())
|
||||
.append("vendorId", getVendorId())
|
||||
.append("deviceCode", getDeviceCode())
|
||||
.append("scanPhoto", getScanPhoto())
|
||||
.append("remark", getRemark())
|
||||
.append("isDel", getIsDel())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,429 @@
|
|||
package com.yanzhu.job.domain;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.yanzhu.common.core.annotation.Excel;
|
||||
import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 广联达班组信息对象 sur_project_attendance_group
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-09-26
|
||||
*/
|
||||
public class QuartzProjectAttendanceGroup extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** id */
|
||||
private Long id;
|
||||
|
||||
/** cfgid */
|
||||
@Excel(name = "cfgid")
|
||||
private Long cfgid;
|
||||
|
||||
/** 注册应用ID */
|
||||
@Excel(name = "注册应用ID")
|
||||
private String appId;
|
||||
|
||||
/** 服务器主键id */
|
||||
@Excel(name = "服务器主键id")
|
||||
private String serverid;
|
||||
|
||||
/** 营业执照号 */
|
||||
@Excel(name = "营业执照号")
|
||||
private String bizLicense;
|
||||
|
||||
/** 分包商统一社会信用代码 */
|
||||
@Excel(name = "分包商统一社会信用代码")
|
||||
private String companyCode;
|
||||
|
||||
/** 分包商ID */
|
||||
@Excel(name = "分包商ID")
|
||||
private String companyId;
|
||||
|
||||
/** 分包商名称 */
|
||||
@Excel(name = "分包商名称")
|
||||
private String companyName;
|
||||
|
||||
/** 分包商类型 */
|
||||
@Excel(name = "分包商类型")
|
||||
private String companyTypeId;
|
||||
|
||||
/** 平台对应分包商ID */
|
||||
@Excel(name = "平台对应分包商ID")
|
||||
private Long vendorId;
|
||||
|
||||
/** 班组名称 */
|
||||
@Excel(name = "班组名称")
|
||||
private String name;
|
||||
|
||||
/** 班组长名称 */
|
||||
@Excel(name = "班组长名称")
|
||||
private String leaderName;
|
||||
|
||||
/** 班组长电话 */
|
||||
@Excel(name = "班组长电话")
|
||||
private String leaderPhone;
|
||||
|
||||
/** 队伍Id */
|
||||
@Excel(name = "队伍Id")
|
||||
private Long teamId;
|
||||
|
||||
/** 队伍名称 */
|
||||
@Excel(name = "队伍名称")
|
||||
private String teamName;
|
||||
|
||||
/** 班组类型0:建筑工人班组;1:管理人员班组 */
|
||||
@Excel(name = "班组类型0:建筑工人班组;1:管理人员班组")
|
||||
private Long type;
|
||||
|
||||
/** 班组长对应的工人ID */
|
||||
@Excel(name = "班组长对应的工人ID")
|
||||
private Long leaderId;
|
||||
|
||||
/** 是否删除 */
|
||||
@Excel(name = "是否删除")
|
||||
private Integer deleted;
|
||||
|
||||
/** 基础平台对应班组ID */
|
||||
@Excel(name = "基础平台对应班组ID")
|
||||
private Long platformGroupId;
|
||||
|
||||
/** 基础平台对应队伍ID */
|
||||
@Excel(name = "基础平台对应队伍ID")
|
||||
private Long platformTeamId;
|
||||
|
||||
/** 企业进场日期 */
|
||||
@Excel(name = "企业进场日期")
|
||||
private Long enterDate;
|
||||
|
||||
/** 企业退场日期 */
|
||||
@Excel(name = "企业退场日期")
|
||||
private Long exitDate;
|
||||
|
||||
/** 是否有效 */
|
||||
@Excel(name = "是否有效")
|
||||
private Long isDel;
|
||||
|
||||
/** 时间戳 */
|
||||
@Excel(name = "时间戳")
|
||||
private Long createTimestamp;
|
||||
|
||||
public static QuartzProjectAttendanceGroup createHuazhu(JSONObject j) {
|
||||
QuartzProjectAttendanceGroup g=new QuartzProjectAttendanceGroup();
|
||||
g.companyId=""+j.getLongValue("unitId",0);
|
||||
g.companyName=j.getString("unitName");
|
||||
g.companyTypeId=j.getString("unitType");
|
||||
g.serverid=j.getString("id");
|
||||
g.enterDate=j.getLong("enterTime");
|
||||
g.exitDate=j.getLong("leaveTime");
|
||||
g.isDel=0l;
|
||||
return g;
|
||||
}
|
||||
|
||||
public static QuartzProjectAttendanceGroup createJgw(JSONObject j, boolean isDirectlyUnder) {
|
||||
QuartzProjectAttendanceGroup g=new QuartzProjectAttendanceGroup();
|
||||
g.serverid=j.getString("id");
|
||||
if(isDirectlyUnder) {
|
||||
g.companyId = j.getString("leaderTeamId");
|
||||
g.leaderName=j.getString("subcontractorId");
|
||||
g.leaderPhone="directly";
|
||||
}else{
|
||||
g.companyId=j.getString("subcontractorId");
|
||||
}
|
||||
g.companyName=j.getString("corpName");
|
||||
g.teamName=j.getString("teamName");
|
||||
|
||||
g.bizLicense=j.getString("corpCode");
|
||||
g.companyCode=j.getString("teamJobtype");
|
||||
|
||||
g.companyTypeId="0";
|
||||
g.enterDate=0l;
|
||||
g.exitDate=0l;
|
||||
g.isDel=0l;
|
||||
return g;
|
||||
}
|
||||
|
||||
public Long getCreateTimestamp() {
|
||||
return createTimestamp;
|
||||
}
|
||||
|
||||
public void setCreateTimestamp(Long createTimestamp) {
|
||||
this.createTimestamp = createTimestamp;
|
||||
}
|
||||
|
||||
public static QuartzProjectAttendanceGroup create(JSONObject json) {
|
||||
QuartzProjectAttendanceGroup g=new QuartzProjectAttendanceGroup();
|
||||
g.serverid=json.getString("id");
|
||||
g.bizLicense=json.getString("bizLicense");
|
||||
g.companyCode=json.getString("companyCode");
|
||||
g.companyId=""+json.getLongValue("companyId",0);
|
||||
g.companyName=json.getString("companyName");
|
||||
String typeId=json.getString("companyTypeId");
|
||||
if("1".equals(typeId)||"8".equals(typeId)||"9".equals(typeId)){
|
||||
typeId=typeId;
|
||||
}else{
|
||||
typeId="2";
|
||||
}
|
||||
g.companyTypeId=typeId;
|
||||
g.vendorId=json.getLongValue("vendorId",0);
|
||||
g.name=json.getString("name");
|
||||
g.leaderName=json.getString("leaderName");
|
||||
g.leaderPhone=json.getString("leaderPhone");
|
||||
g.teamId=json.getLongValue("teamId",0);
|
||||
g.teamName=json.getString("teamName");
|
||||
g.type=json.getLongValue("type",0);
|
||||
g.leaderId=json.getLongValue("leaderId",0);
|
||||
g.deleted=json.get("deleted")==null?0:(json.getBoolean("deleted")?1:0);
|
||||
g.platformGroupId=json.getLongValue("platformGroupId",0);
|
||||
g.platformTeamId=json.getLongValue("platformTeamId",0);
|
||||
g.enterDate=json.getLongValue("enterDate",0);
|
||||
g.exitDate=json.getLongValue("exitDate",0);
|
||||
g.isDel=0l;
|
||||
return g;
|
||||
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setCfgid(Long cfgid)
|
||||
{
|
||||
this.cfgid = cfgid;
|
||||
}
|
||||
|
||||
public Long getCfgid()
|
||||
{
|
||||
return cfgid;
|
||||
}
|
||||
public void setServerid(String serverid)
|
||||
{
|
||||
this.serverid = serverid;
|
||||
}
|
||||
|
||||
public String getServerid()
|
||||
{
|
||||
return serverid;
|
||||
}
|
||||
public void setBizLicense(String bizLicense)
|
||||
{
|
||||
this.bizLicense = bizLicense;
|
||||
}
|
||||
|
||||
public String getBizLicense()
|
||||
{
|
||||
return bizLicense;
|
||||
}
|
||||
public void setCompanyCode(String companyCode)
|
||||
{
|
||||
this.companyCode = companyCode;
|
||||
}
|
||||
|
||||
public String getCompanyCode()
|
||||
{
|
||||
return companyCode;
|
||||
}
|
||||
public void setCompanyId(String companyId)
|
||||
{
|
||||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
public String getCompanyId()
|
||||
{
|
||||
return companyId;
|
||||
}
|
||||
public void setCompanyName(String companyName)
|
||||
{
|
||||
this.companyName = companyName;
|
||||
}
|
||||
|
||||
public String getCompanyName()
|
||||
{
|
||||
return companyName;
|
||||
}
|
||||
public void setCompanyTypeId(String companyTypeId)
|
||||
{
|
||||
this.companyTypeId = companyTypeId;
|
||||
}
|
||||
|
||||
public String getCompanyTypeId()
|
||||
{
|
||||
return companyTypeId;
|
||||
}
|
||||
public void setVendorId(Long vendorId)
|
||||
{
|
||||
this.vendorId = vendorId;
|
||||
}
|
||||
|
||||
public Long getVendorId()
|
||||
{
|
||||
return vendorId;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setLeaderName(String leaderName)
|
||||
{
|
||||
this.leaderName = leaderName;
|
||||
}
|
||||
|
||||
public String getLeaderName()
|
||||
{
|
||||
return leaderName;
|
||||
}
|
||||
public void setLeaderPhone(String leaderPhone)
|
||||
{
|
||||
this.leaderPhone = leaderPhone;
|
||||
}
|
||||
|
||||
public String getLeaderPhone()
|
||||
{
|
||||
return leaderPhone;
|
||||
}
|
||||
public void setTeamId(Long teamId)
|
||||
{
|
||||
this.teamId = teamId;
|
||||
}
|
||||
|
||||
public Long getTeamId()
|
||||
{
|
||||
return teamId;
|
||||
}
|
||||
public void setTeamName(String teamName)
|
||||
{
|
||||
this.teamName = teamName;
|
||||
}
|
||||
|
||||
public String getTeamName()
|
||||
{
|
||||
return teamName;
|
||||
}
|
||||
public void setType(Long type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Long getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
public void setLeaderId(Long leaderId)
|
||||
{
|
||||
this.leaderId = leaderId;
|
||||
}
|
||||
|
||||
public Long getLeaderId()
|
||||
{
|
||||
return leaderId;
|
||||
}
|
||||
public void setDeleted(Integer deleted)
|
||||
{
|
||||
this.deleted = deleted;
|
||||
}
|
||||
|
||||
public Integer getDeleted()
|
||||
{
|
||||
return deleted;
|
||||
}
|
||||
public void setPlatformGroupId(Long platformGroupId)
|
||||
{
|
||||
this.platformGroupId = platformGroupId;
|
||||
}
|
||||
|
||||
public Long getPlatformGroupId()
|
||||
{
|
||||
return platformGroupId;
|
||||
}
|
||||
public void setPlatformTeamId(Long platformTeamId)
|
||||
{
|
||||
this.platformTeamId = platformTeamId;
|
||||
}
|
||||
|
||||
public Long getPlatformTeamId()
|
||||
{
|
||||
return platformTeamId;
|
||||
}
|
||||
public void setEnterDate(Long enterDate)
|
||||
{
|
||||
this.enterDate = enterDate;
|
||||
}
|
||||
|
||||
public Long getEnterDate()
|
||||
{
|
||||
return enterDate;
|
||||
}
|
||||
public void setExitDate(Long exitDate)
|
||||
{
|
||||
this.exitDate = exitDate;
|
||||
}
|
||||
|
||||
public Long getExitDate()
|
||||
{
|
||||
return exitDate;
|
||||
}
|
||||
public void setIsDel(Long isDel)
|
||||
{
|
||||
this.isDel = isDel;
|
||||
}
|
||||
|
||||
public Long getIsDel()
|
||||
{
|
||||
return isDel;
|
||||
}
|
||||
|
||||
public String getAppId() {
|
||||
return appId;
|
||||
}
|
||||
|
||||
public void setAppId(String appId) {
|
||||
this.appId = appId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("cfgid", getCfgid())
|
||||
.append("serverid", getServerid())
|
||||
.append("bizLicense", getBizLicense())
|
||||
.append("companyCode", getCompanyCode())
|
||||
.append("companyId", getCompanyId())
|
||||
.append("companyName", getCompanyName())
|
||||
.append("companyTypeId", getCompanyTypeId())
|
||||
.append("vendorId", getVendorId())
|
||||
.append("name", getName())
|
||||
.append("leaderName", getLeaderName())
|
||||
.append("leaderPhone", getLeaderPhone())
|
||||
.append("teamId", getTeamId())
|
||||
.append("teamName", getTeamName())
|
||||
.append("type", getType())
|
||||
.append("leaderId", getLeaderId())
|
||||
.append("deleted", getDeleted())
|
||||
.append("createTimestamp", getCreateTimestamp())
|
||||
.append("platformGroupId", getPlatformGroupId())
|
||||
.append("platformTeamId", getPlatformTeamId())
|
||||
.append("enterDate", getEnterDate())
|
||||
.append("exitDate", getExitDate())
|
||||
.append("remark", getRemark())
|
||||
.append("isDel", getIsDel())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,754 @@
|
|||
package com.yanzhu.job.domain;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.yanzhu.common.core.annotation.Excel;
|
||||
import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 考勤人员基本属性对象 sur_project_attendance_user
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-09-24
|
||||
*/
|
||||
public class QuartzProjectAttendanceUser extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/** */
|
||||
private Long id;
|
||||
|
||||
/** 配置项ID,可以获取项目ID和总包ID */
|
||||
|
||||
private Long cfgid;
|
||||
|
||||
/** 注册应用ID */
|
||||
|
||||
private String appId;
|
||||
|
||||
/** 厂商编号参考字典attendance_vendors */
|
||||
|
||||
private String vendorsCode;
|
||||
|
||||
/** 工人id */
|
||||
@Excel(name = "工人id")
|
||||
private String workerId;
|
||||
|
||||
/** 项目工人履历id对于旧劳务,这个字段相当于工人的projectWorkerId,管理人员的registerManagerId */
|
||||
|
||||
private Long laborWorkerId;
|
||||
|
||||
/** 人员类别0:工人,1:管理人员 */
|
||||
@Excel(name = "人员类别0:工人,1:管理人员")
|
||||
private Long workerCategory;
|
||||
|
||||
/** 工号 */
|
||||
|
||||
private Long qrCode;
|
||||
|
||||
/** 姓名 */
|
||||
@Excel(name = "姓名")
|
||||
private String name;
|
||||
|
||||
/** 民族 */
|
||||
@Excel(name = "民族")
|
||||
private String ethnic;
|
||||
|
||||
/** 籍贯 */
|
||||
@Excel(name = "籍贯")
|
||||
private String nativePlace;
|
||||
|
||||
/** 性别0:男 1:女 */
|
||||
@Excel(name = "性别0:男 1:女")
|
||||
private Long gender;
|
||||
|
||||
/** 出生日期时间戳 */
|
||||
@Excel(name = "出生日期时间戳")
|
||||
private Long birthDate;
|
||||
|
||||
/** 联系电话 */
|
||||
@Excel(name = "联系电话")
|
||||
private String phone;
|
||||
|
||||
/** 学历 */
|
||||
@Excel(name = "学历")
|
||||
private String degreeName;
|
||||
|
||||
/** 身份证照 */
|
||||
@Excel(name = "身份证照")
|
||||
private String photo;
|
||||
|
||||
@Excel(name = "证件号码")
|
||||
private String idCardNo;
|
||||
|
||||
public String getIdCardNo() {
|
||||
return idCardNo;
|
||||
}
|
||||
|
||||
public void setIdCardNo(String idCardNo) {
|
||||
this.idCardNo = idCardNo;
|
||||
}
|
||||
|
||||
public String getIdTypeName() {
|
||||
return idTypeName;
|
||||
}
|
||||
|
||||
public void setIdTypeName(String idTypeName) {
|
||||
this.idTypeName = idTypeName;
|
||||
}
|
||||
|
||||
@Excel(name = "证件类型")
|
||||
private String idTypeName;
|
||||
/** 近照 */
|
||||
|
||||
private String recentPhoto;
|
||||
|
||||
/** 所属班组ID */
|
||||
|
||||
private String groupId;
|
||||
|
||||
/** 所属班组 */
|
||||
@Excel(name = "所属班组")
|
||||
private String groupName;
|
||||
|
||||
/** 是否班组长 */
|
||||
@Excel(name = "是否班组长")
|
||||
private Integer leader;
|
||||
|
||||
/** 工种编码 */
|
||||
@Excel(name = "工种编码")
|
||||
private String workTypeCode;
|
||||
|
||||
/** 工种 */
|
||||
@Excel(name = "工种")
|
||||
private String workTypeName;
|
||||
|
||||
/** 是否特殊工种 */
|
||||
@Excel(name = "是否特殊工种")
|
||||
private Integer specWorkType;
|
||||
|
||||
/** 安全帽编号 */
|
||||
@Excel(name = "安全帽编号")
|
||||
private String hatCode;
|
||||
|
||||
/** 进退场状态0:进场,1:退场 */
|
||||
@Excel(name = "进退场状态0:进场,1:退场")
|
||||
private Long state;
|
||||
|
||||
/** 进场日期 */
|
||||
@Excel(name = "进场日期")
|
||||
private String enterDate;
|
||||
|
||||
/** 退场日期 */
|
||||
@Excel(name = "退场日期")
|
||||
private String exitDate;
|
||||
|
||||
/** 分包商id */
|
||||
@Excel(name = "分包商id")
|
||||
private String companyId;
|
||||
|
||||
/** 分包商名称 */
|
||||
@Excel(name = "分包商名称")
|
||||
private String companyName;
|
||||
|
||||
/** 平台对应分包商ID */
|
||||
@Excel(name = "平台对应分包商ID")
|
||||
private Long vendorId;
|
||||
|
||||
/** 队伍id */
|
||||
@Excel(name = "队伍id")
|
||||
private Integer teamId;
|
||||
|
||||
/** 队伍名称 */
|
||||
@Excel(name = "队伍名称")
|
||||
private String teamName;
|
||||
|
||||
/** 进场方式0:自动,1:手动2:拍照 */
|
||||
@Excel(name = "进场方式0:自动,1:手动2:拍照")
|
||||
private String enterType;
|
||||
|
||||
/** 服务返回的JSON */
|
||||
@Excel(name = "服务返回的JSON")
|
||||
private String other;
|
||||
|
||||
/** 是否有效 */
|
||||
@Excel(name = "是否有效")
|
||||
private Long isDel;
|
||||
|
||||
/** 人员部门类型 */
|
||||
@Excel(name = "人员部门类型")
|
||||
private String companyTypeId;
|
||||
|
||||
/** 重要::yanzhu接口接收base64图片 */
|
||||
private String recentPhotoBase64;
|
||||
|
||||
public String getRecentPhotoBase64() {
|
||||
return recentPhotoBase64;
|
||||
}
|
||||
|
||||
public void setRecentPhotoBase64(String recentPhotoBase64) {
|
||||
this.recentPhotoBase64 = recentPhotoBase64;
|
||||
}
|
||||
|
||||
@Excel(name = "进场时间")
|
||||
private Date inTime;
|
||||
@Excel(name = "离场时间")
|
||||
private Date outTime;
|
||||
|
||||
public static QuartzProjectAttendanceUser createFromHuazhu(JSONObject j) {
|
||||
QuartzProjectAttendanceUser u=new QuartzProjectAttendanceUser();
|
||||
u.workerId=j.getString("id");
|
||||
u.name=j.getString("name");
|
||||
u.ethnic=j.getString("nationalName");
|
||||
u.nativePlace=j.getString("provinceName")+j.getString("cityName");
|
||||
u.gender=j.getLongValue("sex",0)==0l?1l:0l;
|
||||
u.birthDate=j.getLongValue("birthday",0);
|
||||
u.phone=j.getString("phone");
|
||||
u.degreeName=j.getString("levelOfEducation");
|
||||
u.recentPhoto=j.getString("profile");
|
||||
u.groupId=j.getString("teamId");
|
||||
u.groupName=j.getString("teamName");
|
||||
u.workTypeCode=j.getString("workerTypeId");
|
||||
u.workTypeName=j.getString("workerTypeName");
|
||||
u.state=j.getLongValue("status",1)==2l?0l:1l;
|
||||
long enterTime=j.getLong("enterTime");
|
||||
if(enterTime>0){
|
||||
u.enterDate= DateUtil.format(DateUtil.date(enterTime),"yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
long leaveTime=j.getLong("leaveTime");
|
||||
if(leaveTime>0) {
|
||||
u.exitDate = DateUtil.format(DateUtil.date(leaveTime), "yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
u.vendorId=j.getLongValue("unitProjectId",0);
|
||||
u.companyId=""+j.getLongValue("unitId",0);
|
||||
u.companyName=j.getString("unitName");
|
||||
u.teamName=j.getString("teamName");
|
||||
return u;
|
||||
}
|
||||
|
||||
public static QuartzProjectAttendanceUser createFromJgw(JSONObject j) {
|
||||
QuartzProjectAttendanceUser u=new QuartzProjectAttendanceUser();
|
||||
u.workerId=j.getString("workerId");
|
||||
u.name=j.getString("name");
|
||||
u.ethnic=j.getString("minor");
|
||||
u.phone=j.getString("workPhone");
|
||||
u.nativePlace=j.getString("address");
|
||||
u.gender=j.getLongValue("sex",0)==0l?1l:0l;
|
||||
String tmp=j.getString("birthday");
|
||||
if(StrUtil.isNotEmpty(tmp)) {
|
||||
try {
|
||||
u.birthDate = DateUtil.parse(tmp).getTime();
|
||||
}catch (Exception ex){
|
||||
|
||||
}
|
||||
}
|
||||
u.photo=j.getString("headImage");
|
||||
u.degreeName=j.getString("education");
|
||||
u.recentPhoto=j.getString("vaildPhoto");
|
||||
u.groupId="";
|
||||
u.groupName="";
|
||||
u.workTypeCode="";
|
||||
u.workTypeName=j.getString("jobtype");
|
||||
u.state="01".equals( j.getString("workerStatus"))?0l:1l;
|
||||
String workDate=j.getString("workDate");
|
||||
if(!StrUtil.isEmpty(workDate)){
|
||||
u.enterDate=workDate;
|
||||
}
|
||||
u.vendorId=0l;
|
||||
u.companyId=j.getString("subcontractorId");
|
||||
u.companyName="";
|
||||
u.teamName="";
|
||||
u.isDel=0l;
|
||||
JSONArray ja=j.getJSONArray("corpName");
|
||||
if(ja!=null && ja.size()>0){
|
||||
Object obj=ja.get(0);
|
||||
if(obj!=null){
|
||||
u.companyName=obj.toString();
|
||||
}
|
||||
}
|
||||
|
||||
u.leader=j.getInteger("isAdmin")==1?1:0;
|
||||
return u;
|
||||
}
|
||||
|
||||
public Date getInTime() {
|
||||
return inTime;
|
||||
}
|
||||
|
||||
public void setInTime(Date inTime) {
|
||||
this.inTime = inTime;
|
||||
}
|
||||
|
||||
public Date getOutTime() {
|
||||
return outTime;
|
||||
}
|
||||
|
||||
public void setOutTime(Date outTime) {
|
||||
this.outTime = outTime;
|
||||
}
|
||||
|
||||
private Long projectId;
|
||||
private Long subDeptId;
|
||||
private Long deptId;
|
||||
|
||||
private List<String> workerIds;
|
||||
|
||||
public List<String> getWorkerIds() {
|
||||
return workerIds;
|
||||
}
|
||||
|
||||
public void setWorkerIds(List<String> workerIds) {
|
||||
this.workerIds = workerIds;
|
||||
}
|
||||
|
||||
private int size;
|
||||
|
||||
public int getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public void setSize(int size) {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
public int getIndex() {
|
||||
return index;
|
||||
}
|
||||
|
||||
public void setIndex(int index) {
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
private int index;
|
||||
public Long getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public void setProjectId(Long projectId) {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public Long getSubDeptId() {
|
||||
return subDeptId;
|
||||
}
|
||||
|
||||
public void setSubDeptId(Long subDeptId) {
|
||||
this.subDeptId = subDeptId;
|
||||
}
|
||||
|
||||
public Long getDeptId() {
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public static QuartzProjectAttendanceUser create(JSONObject json) {
|
||||
QuartzProjectAttendanceUser u=new QuartzProjectAttendanceUser();
|
||||
u.workerId=json.getString("workerId");
|
||||
u.laborWorkerId=json.getLongValue("laborWorkerId",0);
|
||||
u.workerCategory=json.getLongValue("workerCategory",0);
|
||||
u.qrCode=json.getLongValue("qrCode",0);
|
||||
u.name=json.getString("name");
|
||||
u.ethnic=json.getString("ethnic");
|
||||
u.nativePlace=json.getString("nativePlace");
|
||||
u.gender=json.getLongValue("gender",0);
|
||||
u.birthDate=json.getLongValue("birthDate",0);
|
||||
u.phone=json.getString("phone");
|
||||
u.recentPhoto=json.getString("recentPhoto");
|
||||
u.groupId=json.getString("groupId");
|
||||
u.groupName=json.getString("groupName");
|
||||
u.leader=json.getBooleanValue("leader",false)?1:0;
|
||||
u.workTypeCode=json.getString("workTypeCode");
|
||||
u.workTypeName=json.getString("workTypeName");
|
||||
u.specWorkType=json.getBooleanValue("specWorkType",false)?1:0;
|
||||
u.hatCode=json.getString("hatCode");
|
||||
u.state=json.getLongValue("status",0);
|
||||
u.enterDate=json.getString("enterDate");
|
||||
u.exitDate=json.getString("exitDate");
|
||||
u.companyId=""+json.getLongValue("companyId",0);
|
||||
u.companyName=json.getString("companyName");
|
||||
u.vendorId=json.getLongValue("vendorId",0);
|
||||
u.teamId=json.getInteger("teamId");
|
||||
u.teamName=json.getString("teamName");
|
||||
u.enterType=json.getString("enterType");
|
||||
u.isDel=0l;
|
||||
return u;
|
||||
}
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setCfgid(Long cfgid)
|
||||
{
|
||||
this.cfgid = cfgid;
|
||||
}
|
||||
|
||||
public Long getCfgid()
|
||||
{
|
||||
return cfgid;
|
||||
}
|
||||
public void setVendorsCode(String vendorsCode)
|
||||
{
|
||||
this.vendorsCode = vendorsCode;
|
||||
}
|
||||
|
||||
public String getVendorsCode()
|
||||
{
|
||||
return vendorsCode;
|
||||
}
|
||||
public void setWorkerId(String workerId)
|
||||
{
|
||||
this.workerId = workerId;
|
||||
}
|
||||
|
||||
public String getWorkerId()
|
||||
{
|
||||
return workerId;
|
||||
}
|
||||
public void setLaborWorkerId(Long laborWorkerId)
|
||||
{
|
||||
this.laborWorkerId = laborWorkerId;
|
||||
}
|
||||
|
||||
public Long getLaborWorkerId()
|
||||
{
|
||||
return laborWorkerId;
|
||||
}
|
||||
public void setWorkerCategory(Long workerCategory)
|
||||
{
|
||||
this.workerCategory = workerCategory;
|
||||
}
|
||||
|
||||
public Long getWorkerCategory()
|
||||
{
|
||||
return workerCategory;
|
||||
}
|
||||
public void setQrCode(Long qrCode)
|
||||
{
|
||||
this.qrCode = qrCode;
|
||||
}
|
||||
|
||||
public Long getQrCode()
|
||||
{
|
||||
return qrCode;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setEthnic(String ethnic)
|
||||
{
|
||||
this.ethnic = ethnic;
|
||||
}
|
||||
|
||||
public String getEthnic()
|
||||
{
|
||||
return ethnic;
|
||||
}
|
||||
public void setNativePlace(String nativePlace)
|
||||
{
|
||||
this.nativePlace = nativePlace;
|
||||
}
|
||||
|
||||
public String getNativePlace()
|
||||
{
|
||||
return nativePlace;
|
||||
}
|
||||
public void setGender(Long gender)
|
||||
{
|
||||
this.gender = gender;
|
||||
}
|
||||
|
||||
public Long getGender()
|
||||
{
|
||||
return gender;
|
||||
}
|
||||
public void setBirthDate(Long birthDate)
|
||||
{
|
||||
this.birthDate = birthDate;
|
||||
}
|
||||
|
||||
public Long getBirthDate()
|
||||
{
|
||||
return birthDate;
|
||||
}
|
||||
public void setPhone(String phone)
|
||||
{
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getPhone()
|
||||
{
|
||||
return phone;
|
||||
}
|
||||
public void setDegreeName(String degreeName)
|
||||
{
|
||||
this.degreeName = degreeName;
|
||||
}
|
||||
|
||||
public String getDegreeName()
|
||||
{
|
||||
return degreeName;
|
||||
}
|
||||
public void setPhoto(String photo)
|
||||
{
|
||||
this.photo = photo;
|
||||
}
|
||||
|
||||
public String getPhoto()
|
||||
{
|
||||
return photo;
|
||||
}
|
||||
public void setRecentPhoto(String recentPhoto)
|
||||
{
|
||||
this.recentPhoto = recentPhoto;
|
||||
}
|
||||
|
||||
public String getRecentPhoto()
|
||||
{
|
||||
return recentPhoto;
|
||||
}
|
||||
public void setGroupId(String groupId)
|
||||
{
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
public String getGroupId()
|
||||
{
|
||||
return groupId;
|
||||
}
|
||||
public void setGroupName(String groupName)
|
||||
{
|
||||
this.groupName = groupName;
|
||||
}
|
||||
|
||||
public String getGroupName()
|
||||
{
|
||||
return groupName;
|
||||
}
|
||||
public void setLeader(Integer leader)
|
||||
{
|
||||
this.leader = leader;
|
||||
}
|
||||
|
||||
public Integer getLeader()
|
||||
{
|
||||
return leader;
|
||||
}
|
||||
public void setWorkTypeCode(String workTypeCode)
|
||||
{
|
||||
this.workTypeCode = workTypeCode;
|
||||
}
|
||||
|
||||
public String getWorkTypeCode()
|
||||
{
|
||||
return workTypeCode;
|
||||
}
|
||||
public void setWorkTypeName(String workTypeName)
|
||||
{
|
||||
this.workTypeName = workTypeName;
|
||||
}
|
||||
|
||||
public String getWorkTypeName()
|
||||
{
|
||||
return workTypeName;
|
||||
}
|
||||
public void setSpecWorkType(Integer specWorkType)
|
||||
{
|
||||
this.specWorkType = specWorkType;
|
||||
}
|
||||
|
||||
public Integer getSpecWorkType()
|
||||
{
|
||||
return specWorkType;
|
||||
}
|
||||
public void setHatCode(String hatCode)
|
||||
{
|
||||
this.hatCode = hatCode;
|
||||
}
|
||||
|
||||
public String getHatCode()
|
||||
{
|
||||
return hatCode;
|
||||
}
|
||||
public void setState(Long state)
|
||||
{
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public Long getState()
|
||||
{
|
||||
return state;
|
||||
}
|
||||
public void setEnterDate(String enterDate)
|
||||
{
|
||||
this.enterDate = enterDate;
|
||||
}
|
||||
|
||||
public String getEnterDate()
|
||||
{
|
||||
return enterDate;
|
||||
}
|
||||
public void setExitDate(String exitDate)
|
||||
{
|
||||
this.exitDate = exitDate;
|
||||
}
|
||||
|
||||
public String getExitDate()
|
||||
{
|
||||
return exitDate;
|
||||
}
|
||||
public void setCompanyId(String companyId)
|
||||
{
|
||||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
public String getCompanyId()
|
||||
{
|
||||
return companyId;
|
||||
}
|
||||
public void setCompanyName(String companyName)
|
||||
{
|
||||
this.companyName = companyName;
|
||||
}
|
||||
|
||||
public String getCompanyName()
|
||||
{
|
||||
return companyName;
|
||||
}
|
||||
public void setVendorId(Long vendorId)
|
||||
{
|
||||
this.vendorId = vendorId;
|
||||
}
|
||||
|
||||
public Long getVendorId()
|
||||
{
|
||||
return vendorId;
|
||||
}
|
||||
public void setTeamId(Integer teamId)
|
||||
{
|
||||
this.teamId = teamId;
|
||||
}
|
||||
|
||||
public Integer getTeamId()
|
||||
{
|
||||
return teamId;
|
||||
}
|
||||
public void setTeamName(String teamName)
|
||||
{
|
||||
this.teamName = teamName;
|
||||
}
|
||||
|
||||
public String getTeamName()
|
||||
{
|
||||
return teamName;
|
||||
}
|
||||
public void setEnterType(String enterType)
|
||||
{
|
||||
this.enterType = enterType;
|
||||
}
|
||||
|
||||
public String getEnterType()
|
||||
{
|
||||
return enterType;
|
||||
}
|
||||
public void setOther(String other)
|
||||
{
|
||||
this.other = other;
|
||||
}
|
||||
|
||||
public String getOther()
|
||||
{
|
||||
return other;
|
||||
}
|
||||
public void setIsDel(Long isDel)
|
||||
{
|
||||
this.isDel = isDel;
|
||||
}
|
||||
|
||||
public Long getIsDel()
|
||||
{
|
||||
return isDel;
|
||||
}
|
||||
|
||||
public String getAppId() {
|
||||
return appId;
|
||||
}
|
||||
|
||||
public void setAppId(String appId) {
|
||||
this.appId = appId;
|
||||
}
|
||||
|
||||
public String getCompanyTypeId() {
|
||||
return companyTypeId;
|
||||
}
|
||||
|
||||
public void setCompanyTypeId(String companyTypeId) {
|
||||
this.companyTypeId = companyTypeId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("cfgid", getCfgid())
|
||||
.append("vendorsCode", getVendorsCode())
|
||||
.append("workerId", getWorkerId())
|
||||
.append("laborWorkerId", getLaborWorkerId())
|
||||
.append("workerCategory", getWorkerCategory())
|
||||
.append("qrCode", getQrCode())
|
||||
.append("name", getName())
|
||||
.append("ethnic", getEthnic())
|
||||
.append("nativePlace", getNativePlace())
|
||||
.append("gender", getGender())
|
||||
.append("birthDate", getBirthDate())
|
||||
.append("phone", getPhone())
|
||||
.append("degreeName", getDegreeName())
|
||||
.append("photo", getPhoto())
|
||||
.append("recentPhoto", getRecentPhoto())
|
||||
.append("groupId", getGroupId())
|
||||
.append("groupName", getGroupName())
|
||||
.append("leader", getLeader())
|
||||
.append("workTypeCode", getWorkTypeCode())
|
||||
.append("workTypeName", getWorkTypeName())
|
||||
.append("specWorkType", getSpecWorkType())
|
||||
.append("hatCode", getHatCode())
|
||||
.append("state", getState())
|
||||
.append("enterDate", getEnterDate())
|
||||
.append("exitDate", getExitDate())
|
||||
.append("companyId", getCompanyId())
|
||||
.append("companyName", getCompanyName())
|
||||
.append("vendorId", getVendorId())
|
||||
.append("teamId", getTeamId())
|
||||
.append("teamName", getTeamName())
|
||||
.append("enterType", getEnterType())
|
||||
.append("other", getOther())
|
||||
.append("remark", getRemark())
|
||||
.append("isDel", getIsDel())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,155 @@
|
|||
package com.yanzhu.job.domain;
|
||||
|
||||
/**
|
||||
* 数字建 参建单位
|
||||
*
|
||||
*/
|
||||
public class SzjEnterpriseInfo {
|
||||
private Long id;
|
||||
private String enterpriseName;
|
||||
private String enterpriseAddress;
|
||||
private Long enterpriseType;
|
||||
private Long companyTypeId;
|
||||
private String creditCode;
|
||||
private String address;
|
||||
private String city;
|
||||
private Integer cityCode;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getEnterpriseName() {
|
||||
return enterpriseName;
|
||||
}
|
||||
|
||||
public void setEnterpriseName(String enterpriseName) {
|
||||
this.enterpriseName = enterpriseName;
|
||||
}
|
||||
|
||||
public String getEnterpriseAddress() {
|
||||
return enterpriseAddress;
|
||||
}
|
||||
|
||||
public void setEnterpriseAddress(String enterpriseAddress) {
|
||||
this.enterpriseAddress = enterpriseAddress;
|
||||
}
|
||||
|
||||
public Long getEnterpriseType() {
|
||||
return enterpriseType;
|
||||
}
|
||||
|
||||
public void setEnterpriseType(Long enterpriseType) {
|
||||
this.enterpriseType = enterpriseType;
|
||||
if(enterpriseType==null){
|
||||
companyTypeId = 0L;
|
||||
return;
|
||||
}
|
||||
if(enterpriseType==3L){
|
||||
companyTypeId = 1L;
|
||||
}else if(enterpriseType==1L){
|
||||
companyTypeId = 8L;
|
||||
}else{
|
||||
companyTypeId = 2L;
|
||||
}
|
||||
}
|
||||
|
||||
public Long getCompanyTypeId() {
|
||||
return companyTypeId;
|
||||
}
|
||||
|
||||
public void setCompanyTypeId(Long companyTypeId) {
|
||||
this.companyTypeId = companyTypeId;
|
||||
}
|
||||
|
||||
public String getCreditCode() {
|
||||
return creditCode;
|
||||
}
|
||||
|
||||
public void setCreditCode(String creditCode) {
|
||||
this.creditCode = creditCode;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
|
||||
public void setCity(String city) {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
public Integer getCityCode() {
|
||||
return cityCode;
|
||||
}
|
||||
|
||||
public void setCityCode(Integer cityCode) {
|
||||
this.cityCode = cityCode;
|
||||
}
|
||||
|
||||
public String getContactNumber() {
|
||||
return contactNumber;
|
||||
}
|
||||
|
||||
public void setContactNumber(String contactNumber) {
|
||||
this.contactNumber = contactNumber;
|
||||
}
|
||||
|
||||
public String getContactPerson() {
|
||||
return contactPerson;
|
||||
}
|
||||
|
||||
public void setContactPerson(String contactPerson) {
|
||||
this.contactPerson = contactPerson;
|
||||
}
|
||||
|
||||
public String getCountry() {
|
||||
return country;
|
||||
}
|
||||
|
||||
public void setCountry(String country) {
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
public String getCountryCode() {
|
||||
return countryCode;
|
||||
}
|
||||
|
||||
public void setCountryCode(String countryCode) {
|
||||
this.countryCode = countryCode;
|
||||
}
|
||||
|
||||
public String getProvince() {
|
||||
return province;
|
||||
}
|
||||
|
||||
public void setProvince(String province) {
|
||||
this.province = province;
|
||||
}
|
||||
|
||||
public String getProvinceCode() {
|
||||
return provinceCode;
|
||||
}
|
||||
|
||||
public void setProvinceCode(String provinceCode) {
|
||||
this.provinceCode = provinceCode;
|
||||
}
|
||||
|
||||
private String contactNumber;
|
||||
private String contactPerson;
|
||||
private String country;
|
||||
private String countryCode;
|
||||
private String province;
|
||||
private String provinceCode;
|
||||
}
|
|
@ -0,0 +1,135 @@
|
|||
package com.yanzhu.job.mapper;
|
||||
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceData;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 劳务实名制管理Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-09-24
|
||||
*/
|
||||
public interface QuartzProjectAttendanceDataMapper
|
||||
{
|
||||
/**
|
||||
* 查询劳务实名制管理
|
||||
*
|
||||
* @param id 劳务实名制管理主键
|
||||
* @return 劳务实名制管理
|
||||
*/
|
||||
public QuartzProjectAttendanceData selectSurProjectAttendanceDataById(Long id);
|
||||
|
||||
/**
|
||||
* 查询劳务实名制管理列表
|
||||
*
|
||||
* @param quartzProjectAttendanceData 劳务实名制管理
|
||||
* @return 劳务实名制管理集合
|
||||
*/
|
||||
public List<QuartzProjectAttendanceData> selectSurProjectAttendanceDataList(QuartzProjectAttendanceData quartzProjectAttendanceData);
|
||||
|
||||
/**
|
||||
* 查询考勤信息
|
||||
*
|
||||
* @param quartzProjectAttendanceData 劳务实名制管理
|
||||
* @return 劳务实名制管理集合
|
||||
*/
|
||||
public QuartzProjectAttendanceData findCurrentAttendanceData(QuartzProjectAttendanceData quartzProjectAttendanceData);
|
||||
|
||||
public List<QuartzProjectAttendanceData> selectSurProjectAttendanceDataListEx(QuartzProjectAttendanceData quartzProjectAttendanceData);
|
||||
/**
|
||||
* 新增劳务实名制管理
|
||||
*
|
||||
* @param quartzProjectAttendanceData 劳务实名制管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSurProjectAttendanceData(QuartzProjectAttendanceData quartzProjectAttendanceData);
|
||||
|
||||
/**
|
||||
* 修改劳务实名制管理
|
||||
*
|
||||
* @param quartzProjectAttendanceData 劳务实名制管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSurProjectAttendanceData(QuartzProjectAttendanceData quartzProjectAttendanceData);
|
||||
|
||||
/**
|
||||
* 删除劳务实名制管理
|
||||
*
|
||||
* @param id 劳务实名制管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceDataById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除劳务实名制管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceDataByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 批量删除劳务实名制管理
|
||||
*
|
||||
* @param list 需要删除的数据参数集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceDataByParams(List<String> list);
|
||||
|
||||
/**
|
||||
* 批量新增劳务实名制考勤管理
|
||||
*
|
||||
* @param quartzProjectAttendanceDataList 劳务实名制考勤管理列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchSurProjectAttendanceData(@Param("list") List<QuartzProjectAttendanceData> quartzProjectAttendanceDataList, @Param("year") String year);
|
||||
|
||||
public Long getLastServerId(QuartzProjectAttendanceData where);
|
||||
|
||||
List<QuartzProjectAttendanceData> groupAllByComany(QuartzProjectAttendanceData where);
|
||||
List<QuartzProjectAttendanceData> groupByComany(QuartzProjectAttendanceData where);
|
||||
|
||||
public Long getHuazhuPage(QuartzProjectAttendanceData where);
|
||||
|
||||
|
||||
public List<Map<String,Object>> initOtherData(Map<String,Object> data);
|
||||
|
||||
public List<Map<String,Object>> initHuaZhuData(Map<String,Object> data);
|
||||
|
||||
public String findHuaZhuCompanyType(String deptName);
|
||||
|
||||
public List<QuartzProjectAttendanceData> todayAttendance(QuartzProjectAttendanceData where);
|
||||
|
||||
/**
|
||||
* 统计人员数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> findGroupAllByDays(QuartzProjectAttendanceData where);
|
||||
|
||||
/**
|
||||
* 统计所有数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> findGroupAllByParams(QuartzProjectAttendanceData where);
|
||||
|
||||
/**
|
||||
* 统计考勤数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> groupDataByParams(QuartzProjectAttendanceData where);
|
||||
|
||||
/**
|
||||
* 考勤数据列表
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<QuartzProjectAttendanceData> attendanceDataList(QuartzProjectAttendanceData where);
|
||||
|
||||
public List<QuartzProjectAttendanceData> groupTodayCompanyTypeId(QuartzProjectAttendanceData where);
|
||||
}
|
|
@ -0,0 +1,87 @@
|
|||
package com.yanzhu.job.mapper;
|
||||
|
||||
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceGroup;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 广联达班组信息Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-09-26
|
||||
*/
|
||||
public interface QuartzProjectAttendanceGroupMapper
|
||||
{
|
||||
/**
|
||||
* 查询广联达班组信息
|
||||
*
|
||||
* @param id 广联达班组信息主键
|
||||
* @return 广联达班组信息
|
||||
*/
|
||||
public QuartzProjectAttendanceGroup selectSurProjectAttendanceGroupById(Long id);
|
||||
|
||||
/**
|
||||
* 查询广联达班组信息列表
|
||||
*
|
||||
* @param quartzProjectAttendanceGroup 广联达班组信息
|
||||
* @return 广联达班组信息集合
|
||||
*/
|
||||
public List<QuartzProjectAttendanceGroup> selectSurProjectAttendanceGroupViewList(QuartzProjectAttendanceGroup quartzProjectAttendanceGroup);
|
||||
|
||||
/**
|
||||
* 查询广联达班组信息列表
|
||||
*
|
||||
* @param quartzProjectAttendanceGroup 广联达班组信息
|
||||
* @return 广联达班组信息集合
|
||||
*/
|
||||
public List<QuartzProjectAttendanceGroup> selectSurProjectAttendanceGroupList(QuartzProjectAttendanceGroup quartzProjectAttendanceGroup);
|
||||
|
||||
/**
|
||||
* 新增广联达班组信息
|
||||
*
|
||||
* @param quartzProjectAttendanceGroup 广联达班组信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSurProjectAttendanceGroup(QuartzProjectAttendanceGroup quartzProjectAttendanceGroup);
|
||||
|
||||
/**
|
||||
* 修改广联达班组信息
|
||||
*
|
||||
* @param quartzProjectAttendanceGroup 广联达班组信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSurProjectAttendanceGroup(QuartzProjectAttendanceGroup quartzProjectAttendanceGroup);
|
||||
|
||||
/**
|
||||
* 删除广联达班组信息
|
||||
*
|
||||
* @param id 广联达班组信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceGroupById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除广联达班组信息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceGroupByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 批量删除广联达班组信息
|
||||
*
|
||||
* @param list 需要删除的数据参数集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceGroupByParams(List<String> list);
|
||||
|
||||
/**
|
||||
* 批量新增广联达班组信息
|
||||
*
|
||||
* @param quartzProjectAttendanceGroupList 广联达班组信息列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchSurProjectAttendanceGroup(List<QuartzProjectAttendanceGroup> quartzProjectAttendanceGroupList);
|
||||
}
|
|
@ -0,0 +1,170 @@
|
|||
package com.yanzhu.job.mapper;
|
||||
|
||||
|
||||
import com.yanzhu.job.domain.QuartzProAttendanceCfg;
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceData;
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceUser;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 考勤人员基本属性Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-09-24
|
||||
*/
|
||||
public interface QuartzProjectAttendanceUserMapper
|
||||
{
|
||||
/**
|
||||
* 查询考勤人员基本属性
|
||||
*
|
||||
* @param id 考勤人员基本属性主键
|
||||
* @return 考勤人员基本属性
|
||||
*/
|
||||
public QuartzProjectAttendanceUser selectSurProjectAttendanceUserById(Long id);
|
||||
|
||||
/**
|
||||
* 查询考勤人员信息
|
||||
*
|
||||
* @param quartzProjectAttendanceUser
|
||||
* @return 考勤人员基本属性
|
||||
*/
|
||||
public QuartzProjectAttendanceUser findCurrentAttendanceUser(QuartzProjectAttendanceUser quartzProjectAttendanceUser);
|
||||
|
||||
/**
|
||||
* 查询[研筑]考勤人员信息
|
||||
*
|
||||
* @param quartzProjectAttendanceUser
|
||||
* @return 考勤人员基本属性
|
||||
*/
|
||||
public QuartzProjectAttendanceUser findYzCurrentAttendanceUser(QuartzProjectAttendanceUser quartzProjectAttendanceUser);
|
||||
|
||||
/**
|
||||
* 查询考勤人员基本属性列表
|
||||
*
|
||||
* @param quartzProjectAttendanceUser 考勤人员基本属性
|
||||
* @return 考勤人员基本属性集合
|
||||
*/
|
||||
public List<QuartzProjectAttendanceUser> selectSurProjectAttendanceUserList(QuartzProjectAttendanceUser quartzProjectAttendanceUser);
|
||||
|
||||
|
||||
public List<QuartzProjectAttendanceUser> querySurProjectAttendanceUserList(QuartzProjectAttendanceUser quartzProjectAttendanceUser);
|
||||
|
||||
public List<QuartzProjectAttendanceUser> selectSurProjectAttendanceUserListJgw(QuartzProjectAttendanceUser quartzProjectAttendanceUser);
|
||||
/**
|
||||
* 新增考勤人员基本属性
|
||||
*
|
||||
* @param quartzProjectAttendanceUser 考勤人员基本属性
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSurProjectAttendanceUser(QuartzProjectAttendanceUser quartzProjectAttendanceUser);
|
||||
|
||||
/**
|
||||
* 修改考勤人员基本属性
|
||||
*
|
||||
* @param quartzProjectAttendanceUser 考勤人员基本属性
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSurProjectAttendanceUser(QuartzProjectAttendanceUser quartzProjectAttendanceUser);
|
||||
|
||||
/**
|
||||
* 删除考勤人员基本属性
|
||||
*
|
||||
* @param id 考勤人员基本属性主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceUserById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除考勤人员基本属性
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceUserByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 批量删除考勤人员基本属性
|
||||
*
|
||||
* @param list 需要删除的数据参数集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceUserByParams(List<String> list);
|
||||
|
||||
/**
|
||||
* 批量新增考勤人员基本属性
|
||||
*
|
||||
* @param quartzProjectAttendanceUserList 考勤人员基本属性列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchSurProjectAttendanceUser(List<QuartzProjectAttendanceUser> quartzProjectAttendanceUserList);
|
||||
|
||||
/**
|
||||
* 下面三个方法完成考勤记录分页查询
|
||||
* countAttendance 获取总记录条数
|
||||
* queryAttendanceUsers 获取当前页workerIds
|
||||
* queryAttendanceByUserIds 根据workerIds查询一页数据然后组装
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<QuartzProjectAttendanceUser> queryAttendanceByUserIds(QuartzProjectAttendanceUser where);
|
||||
public long countAttendance(QuartzProAttendanceCfg where);
|
||||
public List<QuartzProjectAttendanceUser> queryAttendanceUsers(QuartzProjectAttendanceUser where);
|
||||
|
||||
public long countTodayAttendance(QuartzProjectAttendanceUser where);
|
||||
|
||||
|
||||
public List<QuartzProjectAttendanceUser> todayAttendance(QuartzProjectAttendanceUser where);
|
||||
public List<QuartzProjectAttendanceUser> todayAttendanceData(List<String> list);
|
||||
|
||||
public List<QuartzProjectAttendanceUser> todayAttendanceOtherData(Map<String,Object> data);
|
||||
|
||||
/**
|
||||
* 在岗工人查询
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
List<QuartzProjectAttendanceUser> queryWorkerOnDuty(QuartzProjectAttendanceUser where);
|
||||
|
||||
/**
|
||||
* 统计人员数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> groupUserByParams(QuartzProjectAttendanceUser where);
|
||||
|
||||
/**
|
||||
* 在岗工人查询
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<QuartzProjectAttendanceUser> attendanceUserList(QuartzProjectAttendanceUser where);
|
||||
|
||||
/**
|
||||
* 统计人员数据
|
||||
* @param projectId
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> findUserAllByDays(Long projectId);
|
||||
|
||||
/**
|
||||
* 按部门汇总在岗人数
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
List<QuartzProjectAttendanceData> groupByWorkerOnDutyByDept(QuartzProjectAttendanceUser where);
|
||||
/**
|
||||
* 按部门汇总在岗|离岗人数
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
List<QuartzProjectAttendanceData> groupByWorkerByDept(QuartzProjectAttendanceUser where);
|
||||
/**
|
||||
* 在岗|离岗工人查询
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
List<QuartzProjectAttendanceUser> queryWorkerByState(QuartzProjectAttendanceUser where);
|
||||
|
||||
}
|
|
@ -0,0 +1,141 @@
|
|||
package com.yanzhu.job.service;
|
||||
|
||||
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceData;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 劳务实名制管理Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-09-24
|
||||
*/
|
||||
public interface IQuartzProjectAttendanceDataService
|
||||
{
|
||||
/**
|
||||
* 查询劳务实名制管理
|
||||
*
|
||||
* @param id 劳务实名制管理主键
|
||||
* @return 劳务实名制管理
|
||||
*/
|
||||
public QuartzProjectAttendanceData selectSurProjectAttendanceDataById(Long id);
|
||||
|
||||
/**
|
||||
* 查询劳务实名制管理列表
|
||||
*
|
||||
* @param quartzProjectAttendanceData 劳务实名制管理
|
||||
* @return 劳务实名制管理集合
|
||||
*/
|
||||
public List<QuartzProjectAttendanceData> selectSurProjectAttendanceDataList(QuartzProjectAttendanceData quartzProjectAttendanceData);
|
||||
|
||||
/**
|
||||
* 查询考勤信息
|
||||
*
|
||||
* @param quartzProjectAttendanceData 劳务实名制管理
|
||||
* @return 劳务实名制管理集合
|
||||
*/
|
||||
public QuartzProjectAttendanceData findCurrentAttendanceData(QuartzProjectAttendanceData quartzProjectAttendanceData);
|
||||
|
||||
public List<QuartzProjectAttendanceData> selectSurProjectAttendanceDataListEx(QuartzProjectAttendanceData quartzProjectAttendanceData);
|
||||
|
||||
/**
|
||||
* 新增劳务实名制管理
|
||||
*
|
||||
* @param quartzProjectAttendanceData 劳务实名制管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSurProjectAttendanceData(QuartzProjectAttendanceData quartzProjectAttendanceData);
|
||||
|
||||
/**
|
||||
* 修改劳务实名制管理
|
||||
*
|
||||
* @param quartzProjectAttendanceData 劳务实名制管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSurProjectAttendanceData(QuartzProjectAttendanceData quartzProjectAttendanceData);
|
||||
|
||||
/**
|
||||
* 批量删除劳务实名制管理
|
||||
*
|
||||
* @param ids 需要删除的劳务实名制管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceDataByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除劳务实名制管理信息
|
||||
*
|
||||
* @param id 劳务实名制管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceDataById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除劳务实名制管理
|
||||
*
|
||||
* @param list 需要删除的数据参数集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceDataByParams(List<String> list);
|
||||
|
||||
/**
|
||||
* 批量新增劳务实名制考勤管理
|
||||
*
|
||||
* @param quartzProjectAttendanceDataList 劳务实名制管理考勤列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchSurProjectAttendanceData(List<QuartzProjectAttendanceData> quartzProjectAttendanceDataList);
|
||||
|
||||
public void add(QuartzProjectAttendanceData sdata);
|
||||
|
||||
public String getLastServerId(QuartzProjectAttendanceData where);
|
||||
|
||||
public List<QuartzProjectAttendanceData> groupByComany(QuartzProjectAttendanceData where);
|
||||
|
||||
public Long getHuazhuPage( QuartzProjectAttendanceData where);
|
||||
|
||||
public List<QuartzProjectAttendanceData> groupAllByComany(QuartzProjectAttendanceData where);
|
||||
|
||||
|
||||
public List<Map<String,Object>> initHuaZhuData(Map<String,Object> data);
|
||||
|
||||
List<QuartzProjectAttendanceData> todayAttendance(QuartzProjectAttendanceData where);
|
||||
|
||||
/**
|
||||
* 统计所有数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> groupAllByParams(QuartzProjectAttendanceData where);
|
||||
|
||||
/**
|
||||
* 统计人员数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> findGroupAllByDays(QuartzProjectAttendanceData where);
|
||||
|
||||
/**
|
||||
* 考勤数据列表
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<QuartzProjectAttendanceData> attendanceDataList(QuartzProjectAttendanceData where);
|
||||
|
||||
/**
|
||||
* 统计考勤数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> groupDataByParams(QuartzProjectAttendanceData where);
|
||||
|
||||
List<QuartzProjectAttendanceData> groupTodayCompanyTypeId(QuartzProjectAttendanceData where);
|
||||
|
||||
/**
|
||||
* 指增加
|
||||
* @param addList
|
||||
*/
|
||||
void addList(List<QuartzProjectAttendanceData> addList);
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
package com.yanzhu.job.service;
|
||||
|
||||
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceGroup;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 广联达班组信息Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-09-26
|
||||
*/
|
||||
public interface IQuartzProjectAttendanceGroupService
|
||||
{
|
||||
/**
|
||||
* 查询广联达班组信息
|
||||
*
|
||||
* @param id 广联达班组信息主键
|
||||
* @return 广联达班组信息
|
||||
*/
|
||||
public QuartzProjectAttendanceGroup selectSurProjectAttendanceGroupById(Long id);
|
||||
|
||||
/**
|
||||
* 查询广联达班组信息列表
|
||||
*
|
||||
* @param quartzProjectAttendanceGroup 广联达班组信息
|
||||
* @return 广联达班组信息集合
|
||||
*/
|
||||
public List<QuartzProjectAttendanceGroup> selectSurProjectAttendanceGroupViewList(QuartzProjectAttendanceGroup quartzProjectAttendanceGroup);
|
||||
|
||||
/**
|
||||
* 查询广联达班组信息列表
|
||||
*
|
||||
* @param quartzProjectAttendanceGroup 广联达班组信息
|
||||
* @return 广联达班组信息集合
|
||||
*/
|
||||
public List<QuartzProjectAttendanceGroup> selectSurProjectAttendanceGroupList(QuartzProjectAttendanceGroup quartzProjectAttendanceGroup);
|
||||
|
||||
/**
|
||||
* 新增广联达班组信息
|
||||
*
|
||||
* @param quartzProjectAttendanceGroup 广联达班组信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSurProjectAttendanceGroup(QuartzProjectAttendanceGroup quartzProjectAttendanceGroup);
|
||||
|
||||
/**
|
||||
* 修改广联达班组信息
|
||||
*
|
||||
* @param quartzProjectAttendanceGroup 广联达班组信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSurProjectAttendanceGroup(QuartzProjectAttendanceGroup quartzProjectAttendanceGroup);
|
||||
|
||||
/**
|
||||
* 批量删除广联达班组信息
|
||||
*
|
||||
* @param ids 需要删除的广联达班组信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceGroupByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除广联达班组信息信息
|
||||
*
|
||||
* @param id 广联达班组信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceGroupById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除广联达班组信息
|
||||
*
|
||||
* @param list 需要删除的数据参数集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceGroupByParams(List<String> list);
|
||||
|
||||
/**
|
||||
* 批量新增广联达班组信息
|
||||
*
|
||||
* @param quartzProjectAttendanceGroupList 广联达班组信息列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchSurProjectAttendanceGroup(List<QuartzProjectAttendanceGroup> quartzProjectAttendanceGroupList);
|
||||
|
||||
public void add(QuartzProjectAttendanceGroup group);
|
||||
|
||||
/**
|
||||
* 更新济工网的分组类型
|
||||
* @param group
|
||||
*/
|
||||
public void updateJgw(QuartzProjectAttendanceGroup group);
|
||||
}
|
|
@ -0,0 +1,163 @@
|
|||
package com.yanzhu.job.service;
|
||||
|
||||
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceData;
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceUser;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 考勤人员基本属性Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-09-24
|
||||
*/
|
||||
public interface IQuartzProjectAttendanceUserService
|
||||
{
|
||||
/**
|
||||
* 查询考勤人员基本属性
|
||||
*
|
||||
* @param id 考勤人员基本属性主键
|
||||
* @return 考勤人员基本属性
|
||||
*/
|
||||
public QuartzProjectAttendanceUser selectSurProjectAttendanceUserById(Long id);
|
||||
|
||||
/**
|
||||
* 查询考勤人员信息
|
||||
*
|
||||
* @param quartzProjectAttendanceUser
|
||||
* @return 考勤人员基本属性
|
||||
*/
|
||||
public QuartzProjectAttendanceUser findCurrentAttendanceUser(QuartzProjectAttendanceUser quartzProjectAttendanceUser);
|
||||
|
||||
/**
|
||||
* 查询[研筑]考勤人员信息
|
||||
*
|
||||
* @param quartzProjectAttendanceUser
|
||||
* @return 考勤人员基本属性
|
||||
*/
|
||||
public QuartzProjectAttendanceUser findYzCurrentAttendanceUser(QuartzProjectAttendanceUser quartzProjectAttendanceUser);
|
||||
|
||||
/**
|
||||
* 查询考勤人员基本属性列表
|
||||
*
|
||||
* @param quartzProjectAttendanceUser 考勤人员基本属性
|
||||
* @return 考勤人员基本属性集合
|
||||
*/
|
||||
public List<QuartzProjectAttendanceUser> selectSurProjectAttendanceUserList(QuartzProjectAttendanceUser quartzProjectAttendanceUser);
|
||||
|
||||
/**
|
||||
* 新增考勤人员基本属性
|
||||
*
|
||||
* @param quartzProjectAttendanceUser 考勤人员基本属性
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSurProjectAttendanceUser(QuartzProjectAttendanceUser quartzProjectAttendanceUser);
|
||||
|
||||
/**
|
||||
* 修改考勤人员基本属性
|
||||
*
|
||||
* @param quartzProjectAttendanceUser 考勤人员基本属性
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSurProjectAttendanceUser(QuartzProjectAttendanceUser quartzProjectAttendanceUser);
|
||||
|
||||
/**
|
||||
* 批量删除考勤人员基本属性
|
||||
*
|
||||
* @param ids 需要删除的考勤人员基本属性主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceUserByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除考勤人员基本属性信息
|
||||
*
|
||||
* @param id 考勤人员基本属性主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceUserById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除考勤人员基本属性
|
||||
*
|
||||
* @param list 需要删除的数据参数集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceUserByParams(List<String> list);
|
||||
|
||||
/**
|
||||
* 批量新增考勤人员基本属性
|
||||
*
|
||||
* @param quartzProjectAttendanceUserList 考勤人员基本属性列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchSurProjectAttendanceUser(List<QuartzProjectAttendanceUser> quartzProjectAttendanceUserList);
|
||||
|
||||
public void add(QuartzProjectAttendanceUser user);
|
||||
|
||||
public List<QuartzProjectAttendanceUser> queryAttendanceData(QuartzProjectAttendanceUser where);
|
||||
|
||||
public long countTodayAttendance(QuartzProjectAttendanceUser where);
|
||||
|
||||
public List<QuartzProjectAttendanceUser> todayAttendance(QuartzProjectAttendanceUser where);
|
||||
|
||||
public long countAttendance(QuartzProjectAttendanceUser where);
|
||||
|
||||
/**
|
||||
* 济工网人员查询
|
||||
* @param quartzProjectAttendanceUser
|
||||
* @return
|
||||
*/
|
||||
public List<QuartzProjectAttendanceUser> selectSurProjectAttendanceUserListJgw(QuartzProjectAttendanceUser quartzProjectAttendanceUser);
|
||||
|
||||
/**
|
||||
* 在岗工人查询
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<QuartzProjectAttendanceUser> queryWorkerOnDuty(QuartzProjectAttendanceUser where);
|
||||
|
||||
/**
|
||||
* 统计人员数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> groupUserByParams(QuartzProjectAttendanceUser where);
|
||||
|
||||
/**
|
||||
* 在岗工人查询
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<QuartzProjectAttendanceUser> attendanceUserList(QuartzProjectAttendanceUser where);
|
||||
|
||||
/**
|
||||
* 统计人员数据
|
||||
* @param projectId
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> findUserAllByDays(Long projectId);
|
||||
|
||||
/**
|
||||
* 按部门汇总在岗人数
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
List<QuartzProjectAttendanceData> groupByWorkerOnDutyByDept(QuartzProjectAttendanceUser where);
|
||||
|
||||
List<QuartzProjectAttendanceUser> querySurProjectAttendanceUserList(QuartzProjectAttendanceUser quartzProjectAttendanceUser);
|
||||
/**
|
||||
* 按部门汇总在岗|离岗人数
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
List<QuartzProjectAttendanceData> groupByWorkerByDept(QuartzProjectAttendanceUser where);
|
||||
/**
|
||||
* 在岗|离岗工人查询
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
List<QuartzProjectAttendanceUser> queryWorkerByState(QuartzProjectAttendanceUser where);
|
||||
}
|
|
@ -19,7 +19,7 @@ public class QuartzProAttendanceCfgServiceImpl implements IQuartzProAttendanceCf
|
|||
{
|
||||
|
||||
@Autowired
|
||||
private QuartzProAttendanceCfgMapper quartzProjectAttendanceCfgMapper;
|
||||
private QuartzProAttendanceCfgMapper cfgMapper;
|
||||
|
||||
/**
|
||||
* 查询项目考勤配置列表
|
||||
|
@ -30,7 +30,7 @@ public class QuartzProAttendanceCfgServiceImpl implements IQuartzProAttendanceCf
|
|||
@Override
|
||||
public List<QuartzProAttendanceCfg> selectProAttendanceCfgList(QuartzProAttendanceCfg quartzProAttendanceCfg)
|
||||
{
|
||||
return quartzProjectAttendanceCfgMapper.selectProAttendanceCfgList(quartzProAttendanceCfg);
|
||||
return cfgMapper.selectProAttendanceCfgList(quartzProAttendanceCfg);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,501 @@
|
|||
package com.yanzhu.job.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
import com.yanzhu.common.core.utils.StringUtils;
|
||||
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||
import com.yanzhu.job.domain.QuartzProAttendanceCfg;
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceData;
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceGroup;
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceUser;
|
||||
import com.yanzhu.job.mapper.QuartzProAttendanceCfgMapper;
|
||||
import com.yanzhu.job.mapper.QuartzProjectAttendanceDataMapper;
|
||||
import com.yanzhu.job.mapper.QuartzProjectAttendanceGroupMapper;
|
||||
import com.yanzhu.job.mapper.QuartzProjectAttendanceUserMapper;
|
||||
import com.yanzhu.job.service.IQuartzProjectAttendanceDataService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 劳务实名制管理Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-09-24
|
||||
*/
|
||||
@Service
|
||||
public class QuartzProjectAttendanceDataServiceImpl implements IQuartzProjectAttendanceDataService
|
||||
{
|
||||
@Autowired
|
||||
private QuartzProjectAttendanceDataMapper quartzProjectAttendanceDataMapper;
|
||||
|
||||
@Autowired
|
||||
private QuartzProjectAttendanceUserMapper quartzProjectAttendanceUserMapper;
|
||||
|
||||
@Autowired
|
||||
private QuartzProjectAttendanceGroupMapper quartzProjectAttendanceGroupMapper;
|
||||
|
||||
@Autowired
|
||||
private QuartzProAttendanceCfgMapper cfgMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询劳务实名制管理
|
||||
*
|
||||
* @param id 劳务实名制管理主键
|
||||
* @return 劳务实名制管理
|
||||
*/
|
||||
@Override
|
||||
public QuartzProjectAttendanceData selectSurProjectAttendanceDataById(Long id)
|
||||
{
|
||||
return quartzProjectAttendanceDataMapper.selectSurProjectAttendanceDataById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询劳务实名制管理列表
|
||||
*
|
||||
* @param quartzProjectAttendanceData 劳务实名制管理
|
||||
* @return 劳务实名制管理
|
||||
*/
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceData> selectSurProjectAttendanceDataList(QuartzProjectAttendanceData quartzProjectAttendanceData)
|
||||
{
|
||||
return quartzProjectAttendanceDataMapper.selectSurProjectAttendanceDataList(quartzProjectAttendanceData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询考勤信息
|
||||
*
|
||||
* @param quartzProjectAttendanceData 劳务实名制管理
|
||||
* @return 劳务实名制管理集合
|
||||
*/
|
||||
@Override
|
||||
public QuartzProjectAttendanceData findCurrentAttendanceData(QuartzProjectAttendanceData quartzProjectAttendanceData){
|
||||
return quartzProjectAttendanceDataMapper.findCurrentAttendanceData(quartzProjectAttendanceData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceData> selectSurProjectAttendanceDataListEx(QuartzProjectAttendanceData quartzProjectAttendanceData)
|
||||
{
|
||||
return quartzProjectAttendanceDataMapper.selectSurProjectAttendanceDataListEx(quartzProjectAttendanceData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增劳务实名制管理
|
||||
*
|
||||
* @param quartzProjectAttendanceData 劳务实名制管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSurProjectAttendanceData(QuartzProjectAttendanceData quartzProjectAttendanceData)
|
||||
{
|
||||
String userName= SecurityUtils.getUsername();
|
||||
quartzProjectAttendanceData.setCreateBy(StrUtil.isEmpty(userName)?"task":userName);
|
||||
quartzProjectAttendanceData.setCreateTime(DateUtils.getNowDate());
|
||||
|
||||
return quartzProjectAttendanceDataMapper.insertSurProjectAttendanceData(quartzProjectAttendanceData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改劳务实名制管理
|
||||
*
|
||||
* @param quartzProjectAttendanceData 劳务实名制管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSurProjectAttendanceData(QuartzProjectAttendanceData quartzProjectAttendanceData)
|
||||
{
|
||||
String userName=SecurityUtils.getUsername();
|
||||
quartzProjectAttendanceData.setUpdateBy(StrUtil.isEmpty(userName)?"task":userName);
|
||||
|
||||
quartzProjectAttendanceData.setUpdateTime(DateUtils.getNowDate());
|
||||
return quartzProjectAttendanceDataMapper.updateSurProjectAttendanceData(quartzProjectAttendanceData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除劳务实名制管理
|
||||
*
|
||||
* @param ids 需要删除的劳务实名制管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSurProjectAttendanceDataByIds(Long[] ids)
|
||||
{
|
||||
return quartzProjectAttendanceDataMapper.deleteSurProjectAttendanceDataByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除劳务实名制管理信息
|
||||
*
|
||||
* @param id 劳务实名制管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSurProjectAttendanceDataById(Long id)
|
||||
{
|
||||
return quartzProjectAttendanceDataMapper.deleteSurProjectAttendanceDataById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除劳务实名制管理
|
||||
*
|
||||
* @param list 需要删除的数据参数集合
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSurProjectAttendanceDataByParams(List<String> list) {
|
||||
return quartzProjectAttendanceDataMapper.deleteSurProjectAttendanceDataByParams(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增劳务实名制考勤管理
|
||||
*
|
||||
* @param quartzProjectAttendanceDataList 劳务实名制考勤管理列表
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int batchSurProjectAttendanceData(List<QuartzProjectAttendanceData> quartzProjectAttendanceDataList) {
|
||||
return quartzProjectAttendanceDataMapper.batchSurProjectAttendanceData(quartzProjectAttendanceDataList,DateUtils.dateTimeNow(DateUtils.YYYY));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(QuartzProjectAttendanceData sdata) {
|
||||
if(StringUtils.isEmpty(sdata.getWorkerId()) || StringUtils.isEmpty(sdata.getAttendanceTime())){
|
||||
return;
|
||||
}
|
||||
QuartzProjectAttendanceData where=new QuartzProjectAttendanceData();
|
||||
where.setVendorsCode(sdata.getVendorsCode());
|
||||
where.setCfgid(sdata.getCfgid());
|
||||
where.setWorkerId(sdata.getWorkerId());
|
||||
where.setAttendanceTime(sdata.getAttendanceTime());
|
||||
List<QuartzProjectAttendanceData> list=selectSurProjectAttendanceDataListEx(where);
|
||||
if(list.size()==0){
|
||||
//设置考勤其它参数
|
||||
//查询人员信息
|
||||
QuartzProjectAttendanceUser userWhere=new QuartzProjectAttendanceUser();
|
||||
userWhere.setWorkerId(sdata.getWorkerId());
|
||||
List<QuartzProjectAttendanceUser> uList= quartzProjectAttendanceUserMapper.selectSurProjectAttendanceUserList(userWhere);
|
||||
if(uList.size()==0){
|
||||
return;
|
||||
}
|
||||
QuartzProjectAttendanceUser user=uList.get(0);
|
||||
sdata.setWorkerName(user.getName());
|
||||
String photo=user.getPhoto();
|
||||
if(StrUtil.isEmpty(photo)){
|
||||
photo=user.getRecentPhoto();
|
||||
}
|
||||
|
||||
sdata.setWorkerPhoto(photo);
|
||||
sdata.setWorkerGender(user.getGender());;
|
||||
sdata.setGroupName(user.getGroupName());
|
||||
sdata.setWorkTypeName(user.getWorkTypeName());
|
||||
sdata.setEthnic(user.getEthnic());
|
||||
sdata.setNativePlace(user.getNativePlace());
|
||||
sdata.setPhone(user.getPhone());
|
||||
sdata.setSpecWorkType(user.getSpecWorkType());
|
||||
if("jgw".equals(sdata.getVendorsCode())) {
|
||||
sdata.setCompanyId(user.getCompanyId());
|
||||
}
|
||||
//查询分组信息
|
||||
QuartzProjectAttendanceGroup groupWhere=new QuartzProjectAttendanceGroup();
|
||||
groupWhere.setCfgid(sdata.getCfgid());
|
||||
groupWhere.setCompanyId(sdata.getCompanyId());
|
||||
List<QuartzProjectAttendanceGroup> gList= quartzProjectAttendanceGroupMapper.selectSurProjectAttendanceGroupList(groupWhere);
|
||||
if(gList.size()==0){
|
||||
return;
|
||||
}
|
||||
QuartzProjectAttendanceGroup group=gList.get(0);
|
||||
sdata.setCompanyName(group.getCompanyName());
|
||||
sdata.setCompanyTypeId(group.getCompanyTypeId());
|
||||
//查询华筑的分组信息
|
||||
if("huazhu".equals(sdata.getVendorsCode())){
|
||||
sdata.setWorkerGender(sdata.getWorkerGender());
|
||||
sdata.setCompanyTypeId(getHuazhuCompanyTypeId(group.getCompanyName()));//获取华筑的分包商类型
|
||||
}
|
||||
if("jgw".equals(sdata.getVendorsCode())){
|
||||
//sdata.setWorkTypeName(group.getCompanyCode());
|
||||
//sdata.setCompanyName(user.getCompanyName());
|
||||
sdata.setWorkTypeName(user.getWorkTypeName());
|
||||
sdata.setCompanyName(group.getCompanyName());
|
||||
sdata.setGroupName(group.getTeamName());
|
||||
}
|
||||
//查询项目部门信息
|
||||
QuartzProAttendanceCfg cfgWhere=new QuartzProAttendanceCfg();
|
||||
cfgWhere.setId(sdata.getCfgid());
|
||||
List<QuartzProAttendanceCfg> cfgList= cfgMapper.selectProAttendanceCfgList(cfgWhere);
|
||||
if(cfgList.size()==0){
|
||||
return;
|
||||
}
|
||||
QuartzProAttendanceCfg cfg=cfgList.get(0);
|
||||
sdata.setProjectId(cfg.getProjectId());
|
||||
sdata.setDeptId(cfg.getDeptId());
|
||||
sdata.setProjectName(cfg.getProjectName());
|
||||
sdata.setDeptName(cfg.getDeptName());
|
||||
if(sdata.getCompanyTypeId()==null){
|
||||
sdata.setCompanyTypeId("0");
|
||||
}
|
||||
insertSurProjectAttendanceData(sdata);
|
||||
}else{
|
||||
sdata.setId(list.get(0).getId());
|
||||
QuartzProjectAttendanceData upData=list.get(0);
|
||||
String dt1=upData.getAttendanceTime(); //
|
||||
String dt2=upData.getAttendanceOutTime();
|
||||
String dt3=sdata.getAttendanceTime();
|
||||
if (StrUtil.isEmpty(dt3)) {
|
||||
return;
|
||||
}
|
||||
long time3=DateUtil.parse(dt3).getTime();
|
||||
if(StrUtil.isEmpty(dt2)){
|
||||
upData.setAttendanceOutTime(dt3);
|
||||
//比较 dt1,dt2 进行交换
|
||||
long time2=DateUtil.parse(dt3).getTime();
|
||||
long time1=DateUtil.parse(dt1).getTime();
|
||||
if(time1>time2){
|
||||
upData.setAttendanceTime(dt3);
|
||||
upData.setAttendanceOutTime(dt1);
|
||||
}
|
||||
}else{
|
||||
long time2=DateUtil.parse(dt2).getTime();
|
||||
long time1=DateUtil.parse(dt1).getTime();
|
||||
//比较 dt3<dt1 in->dt3
|
||||
if(time3<time1){
|
||||
upData.setAttendanceTime(dt3);
|
||||
}
|
||||
//比较 dt3>dt2 out->dt3
|
||||
if(time3>time2){
|
||||
upData.setAttendanceOutTime(dt3);
|
||||
}
|
||||
}
|
||||
//upData.setAttendanceOutTime(sdata.getAttendanceTime());
|
||||
if("jgw".equals(upData.getVendorsCode())){
|
||||
upData.setRemark(sdata.getRemark());
|
||||
}
|
||||
updateSurProjectAttendanceData(upData);
|
||||
}
|
||||
}
|
||||
|
||||
private String getHuazhuCompanyTypeId(String groupName) {
|
||||
return quartzProjectAttendanceDataMapper.findHuaZhuCompanyType(groupName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLastServerId(QuartzProjectAttendanceData where) {
|
||||
return ""+ quartzProjectAttendanceDataMapper.getLastServerId(where);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceData> groupByComany(QuartzProjectAttendanceData where) {
|
||||
return quartzProjectAttendanceDataMapper.groupByComany(where);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getHuazhuPage( QuartzProjectAttendanceData attWhere) {
|
||||
return quartzProjectAttendanceDataMapper.getHuazhuPage(attWhere);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceData> groupAllByComany(QuartzProjectAttendanceData where) {
|
||||
return quartzProjectAttendanceDataMapper.groupAllByComany(where);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<Map<String,Object>> initHuaZhuData(Map<String,Object> data) {
|
||||
List<Map<String,Object>> dataList = new ArrayList<>();
|
||||
List<Map<String,Object>> list = quartzProjectAttendanceDataMapper.initHuaZhuData(data);
|
||||
if(StringUtils.isNotEmpty(list)){
|
||||
List<String> workerIds = list.stream().map(Map -> Map.get("workerId").toString()).collect(Collectors.toList());
|
||||
data.put("list",workerIds);
|
||||
List<QuartzProjectAttendanceUser> datas= quartzProjectAttendanceUserMapper.todayAttendanceOtherData(data);
|
||||
for (Map<String,Object> map:list) {
|
||||
for(QuartzProjectAttendanceUser sau:datas){
|
||||
if(Objects.equals(map.get("workerId").toString(),sau.getWorkerId())){
|
||||
map.put("inTime",DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,sau.getInTime()));
|
||||
map.put("outTime",DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,sau.getOutTime()));
|
||||
dataList.add(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return dataList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceData> todayAttendance(QuartzProjectAttendanceData where) {
|
||||
return quartzProjectAttendanceDataMapper.todayAttendance(where);
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计所有数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> groupAllByParams(QuartzProjectAttendanceData where) {
|
||||
return quartzProjectAttendanceDataMapper.findGroupAllByParams(where);
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计人员数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> findGroupAllByDays(QuartzProjectAttendanceData where){
|
||||
return quartzProjectAttendanceDataMapper.findGroupAllByDays(where);
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计考勤数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> groupDataByParams(QuartzProjectAttendanceData where){
|
||||
return quartzProjectAttendanceDataMapper.groupDataByParams(where);
|
||||
}
|
||||
|
||||
/**
|
||||
* 考勤数据列表
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceData> attendanceDataList(QuartzProjectAttendanceData where) {
|
||||
return quartzProjectAttendanceDataMapper.attendanceDataList(where);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceData> groupTodayCompanyTypeId(QuartzProjectAttendanceData where) {
|
||||
return quartzProjectAttendanceDataMapper.groupTodayCompanyTypeId(where);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量增加
|
||||
* @param addList
|
||||
*/
|
||||
@Override
|
||||
public void addList(List<QuartzProjectAttendanceData> addList) {
|
||||
if(addList.size()==0){
|
||||
return;
|
||||
}
|
||||
QuartzProjectAttendanceData where=new QuartzProjectAttendanceData();
|
||||
where.setVendorsCode(addList.get(0).getVendorsCode());
|
||||
where.setCfgid(addList.get(0).getCfgid());
|
||||
where.setAttendanceTime(addList.get(0).getAttendanceTime());
|
||||
List<QuartzProjectAttendanceData> oldList=selectSurProjectAttendanceDataListEx(where);
|
||||
for(QuartzProjectAttendanceData sdata:addList){
|
||||
List<QuartzProjectAttendanceData> list=oldList.stream().filter(d->d.getWorkerId().equals(sdata.getWorkerId())).collect(Collectors.toList());
|
||||
if(list.size()==0){
|
||||
//设置考勤其它参数
|
||||
//查询人员信息
|
||||
QuartzProjectAttendanceUser userWhere=new QuartzProjectAttendanceUser();
|
||||
userWhere.setWorkerId(sdata.getWorkerId());
|
||||
List<QuartzProjectAttendanceUser> uList= quartzProjectAttendanceUserMapper.selectSurProjectAttendanceUserList(userWhere);
|
||||
if(uList.size()==0){
|
||||
return;
|
||||
}
|
||||
QuartzProjectAttendanceUser user=uList.get(0);
|
||||
sdata.setWorkerName(user.getName());
|
||||
String photo=user.getPhoto();
|
||||
if(StrUtil.isEmpty(photo)){
|
||||
photo=user.getRecentPhoto();
|
||||
}
|
||||
|
||||
sdata.setWorkerPhoto(photo);
|
||||
sdata.setWorkerGender(user.getGender());;
|
||||
sdata.setGroupName(user.getGroupName());
|
||||
sdata.setWorkTypeName(user.getWorkTypeName());
|
||||
sdata.setEthnic(user.getEthnic());
|
||||
sdata.setNativePlace(user.getNativePlace());
|
||||
sdata.setPhone(user.getPhone());
|
||||
sdata.setSpecWorkType(user.getSpecWorkType());
|
||||
if("jgw".equals(sdata.getVendorsCode())) {
|
||||
sdata.setCompanyId(user.getCompanyId());
|
||||
}
|
||||
//查询分组信息
|
||||
QuartzProjectAttendanceGroup groupWhere=new QuartzProjectAttendanceGroup();
|
||||
groupWhere.setCfgid(sdata.getCfgid());
|
||||
groupWhere.setCompanyId(sdata.getCompanyId());
|
||||
List<QuartzProjectAttendanceGroup> gList= quartzProjectAttendanceGroupMapper.selectSurProjectAttendanceGroupList(groupWhere);
|
||||
if(gList.size()==0){
|
||||
return;
|
||||
}
|
||||
QuartzProjectAttendanceGroup group=gList.get(0);
|
||||
sdata.setCompanyName(group.getCompanyName());
|
||||
sdata.setCompanyTypeId(group.getCompanyTypeId());
|
||||
//查询华筑的分组信息
|
||||
if("huazhu".equals(sdata.getVendorsCode())){
|
||||
sdata.setWorkerGender(sdata.getWorkerGender());
|
||||
sdata.setCompanyTypeId(getHuazhuCompanyTypeId(group.getCompanyName()));//获取华筑的分包商类型
|
||||
}
|
||||
if("jgw".equals(sdata.getVendorsCode())){
|
||||
//sdata.setWorkTypeName(group.getCompanyCode());
|
||||
//sdata.setCompanyName(user.getCompanyName());
|
||||
sdata.setWorkTypeName(user.getWorkTypeName());
|
||||
sdata.setCompanyName(group.getCompanyName());
|
||||
sdata.setGroupName(group.getTeamName());
|
||||
}
|
||||
//查询项目部门信息
|
||||
QuartzProAttendanceCfg cfgWhere=new QuartzProAttendanceCfg();
|
||||
cfgWhere.setId(sdata.getCfgid());
|
||||
List<QuartzProAttendanceCfg> cfgList= cfgMapper.selectProAttendanceCfgList(cfgWhere);
|
||||
if(cfgList.size()==0){
|
||||
return;
|
||||
}
|
||||
QuartzProAttendanceCfg cfg=cfgList.get(0);
|
||||
sdata.setProjectId(cfg.getProjectId());
|
||||
sdata.setDeptId(cfg.getDeptId());
|
||||
sdata.setProjectName(cfg.getProjectName());
|
||||
sdata.setDeptName(cfg.getDeptName());
|
||||
if(sdata.getCompanyTypeId()==null){
|
||||
sdata.setCompanyTypeId("0");
|
||||
}
|
||||
insertSurProjectAttendanceData(sdata);
|
||||
}else{
|
||||
sdata.setId(list.get(0).getId());
|
||||
QuartzProjectAttendanceData upData=list.get(0);
|
||||
String dt1=upData.getAttendanceTime(); //
|
||||
String dt2=upData.getAttendanceOutTime();
|
||||
String dt3=sdata.getAttendanceTime();
|
||||
if (StrUtil.isEmpty(dt3)) {
|
||||
return;
|
||||
}
|
||||
long time3=DateUtil.parse(dt3).getTime();
|
||||
if(StrUtil.isEmpty(dt2)){
|
||||
upData.setAttendanceOutTime(dt3);
|
||||
//比较 dt1,dt2 进行交换
|
||||
long time2=DateUtil.parse(dt3).getTime();
|
||||
long time1=DateUtil.parse(dt1).getTime();
|
||||
if(time1>time2){
|
||||
upData.setAttendanceTime(dt3);
|
||||
upData.setAttendanceOutTime(dt1);
|
||||
}
|
||||
}else{
|
||||
long time2=DateUtil.parse(dt2).getTime();
|
||||
long time1=DateUtil.parse(dt1).getTime();
|
||||
//比较 dt3<dt1 in->dt3
|
||||
if(time3<time1){
|
||||
upData.setAttendanceTime(dt3);
|
||||
}
|
||||
//比较 dt3>dt2 out->dt3
|
||||
if(time3>time2){
|
||||
upData.setAttendanceOutTime(dt3);
|
||||
}
|
||||
}
|
||||
//upData.setAttendanceOutTime(sdata.getAttendanceTime());
|
||||
if("jgw".equals(upData.getVendorsCode())){
|
||||
upData.setRemark(sdata.getRemark());
|
||||
}
|
||||
updateSurProjectAttendanceData(upData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,166 @@
|
|||
package com.yanzhu.job.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceGroup;
|
||||
import com.yanzhu.job.mapper.QuartzProjectAttendanceGroupMapper;
|
||||
import com.yanzhu.job.service.IQuartzProjectAttendanceGroupService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 广联达班组信息Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-09-26
|
||||
*/
|
||||
@Service
|
||||
public class QuartzProjectAttendanceGroupServiceImpl implements IQuartzProjectAttendanceGroupService
|
||||
{
|
||||
@Autowired
|
||||
private QuartzProjectAttendanceGroupMapper quartzProjectAttendanceGroupMapper;
|
||||
|
||||
/**
|
||||
* 查询广联达班组信息
|
||||
*
|
||||
* @param id 广联达班组信息主键
|
||||
* @return 广联达班组信息
|
||||
*/
|
||||
@Override
|
||||
public QuartzProjectAttendanceGroup selectSurProjectAttendanceGroupById(Long id)
|
||||
{
|
||||
return quartzProjectAttendanceGroupMapper.selectSurProjectAttendanceGroupById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询广联达班组信息列表
|
||||
*
|
||||
* @param quartzProjectAttendanceGroup 广联达班组信息
|
||||
* @return 广联达班组信息
|
||||
*/
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceGroup> selectSurProjectAttendanceGroupViewList(QuartzProjectAttendanceGroup quartzProjectAttendanceGroup)
|
||||
{
|
||||
return quartzProjectAttendanceGroupMapper.selectSurProjectAttendanceGroupViewList(quartzProjectAttendanceGroup);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询广联达班组信息列表
|
||||
*
|
||||
* @param quartzProjectAttendanceGroup 广联达班组信息
|
||||
* @return 广联达班组信息集合
|
||||
*/
|
||||
public List<QuartzProjectAttendanceGroup> selectSurProjectAttendanceGroupList(QuartzProjectAttendanceGroup quartzProjectAttendanceGroup) {
|
||||
return quartzProjectAttendanceGroupMapper.selectSurProjectAttendanceGroupList(quartzProjectAttendanceGroup);
|
||||
}
|
||||
/**
|
||||
* 新增广联达班组信息
|
||||
*
|
||||
* @param quartzProjectAttendanceGroup 广联达班组信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSurProjectAttendanceGroup(QuartzProjectAttendanceGroup quartzProjectAttendanceGroup)
|
||||
{
|
||||
String userName= SecurityUtils.getUsername();
|
||||
quartzProjectAttendanceGroup.setCreateBy(StrUtil.isEmpty(userName)?"task":userName);
|
||||
quartzProjectAttendanceGroup.setCreateTime(DateUtils.getNowDate());
|
||||
return quartzProjectAttendanceGroupMapper.insertSurProjectAttendanceGroup(quartzProjectAttendanceGroup);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改广联达班组信息
|
||||
*
|
||||
* @param quartzProjectAttendanceGroup 广联达班组信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSurProjectAttendanceGroup(QuartzProjectAttendanceGroup quartzProjectAttendanceGroup)
|
||||
{
|
||||
String userName= SecurityUtils.getUsername();
|
||||
quartzProjectAttendanceGroup.setUpdateBy(StrUtil.isEmpty(userName)?"task":userName);
|
||||
|
||||
quartzProjectAttendanceGroup.setUpdateTime(DateUtils.getNowDate());
|
||||
return quartzProjectAttendanceGroupMapper.updateSurProjectAttendanceGroup(quartzProjectAttendanceGroup);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除广联达班组信息
|
||||
*
|
||||
* @param ids 需要删除的广联达班组信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSurProjectAttendanceGroupByIds(Long[] ids)
|
||||
{
|
||||
return quartzProjectAttendanceGroupMapper.deleteSurProjectAttendanceGroupByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除广联达班组信息信息
|
||||
*
|
||||
* @param id 广联达班组信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSurProjectAttendanceGroupById(Long id)
|
||||
{
|
||||
return quartzProjectAttendanceGroupMapper.deleteSurProjectAttendanceGroupById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除广联达班组信息
|
||||
*
|
||||
* @param list 需要删除的数据参数集合
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSurProjectAttendanceGroupByParams(List<String> list) {
|
||||
return quartzProjectAttendanceGroupMapper.deleteSurProjectAttendanceGroupByParams(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增广联达班组信息
|
||||
*
|
||||
* @param quartzProjectAttendanceGroupList 广联达班组信息列表
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int batchSurProjectAttendanceGroup(List<QuartzProjectAttendanceGroup> quartzProjectAttendanceGroupList) {
|
||||
return quartzProjectAttendanceGroupMapper.batchSurProjectAttendanceGroup(quartzProjectAttendanceGroupList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(QuartzProjectAttendanceGroup group) {
|
||||
QuartzProjectAttendanceGroup where=new QuartzProjectAttendanceGroup();
|
||||
where.setServerid(group.getServerid());
|
||||
where.setCfgid(group.getCfgid());
|
||||
List<QuartzProjectAttendanceGroup> list=selectSurProjectAttendanceGroupList(where);
|
||||
if(list.size()==0){
|
||||
insertSurProjectAttendanceGroup(group);
|
||||
}else{
|
||||
group.setId(list.get(0).getId());
|
||||
updateSurProjectAttendanceGroup(group);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新济工网的分组类型
|
||||
* @param group
|
||||
*/
|
||||
@Override
|
||||
public void updateJgw(QuartzProjectAttendanceGroup group) {
|
||||
QuartzProjectAttendanceGroup where=new QuartzProjectAttendanceGroup();
|
||||
where.setBizLicense(group.getBizLicense());
|
||||
where.setCompanyName(group.getCompanyName());
|
||||
where.setCfgid(group.getCfgid());
|
||||
List<QuartzProjectAttendanceGroup> list=selectSurProjectAttendanceGroupList(where);
|
||||
for(QuartzProjectAttendanceGroup g:list){
|
||||
g.setCompanyTypeId(group.getCompanyTypeId());
|
||||
updateSurProjectAttendanceGroup(g);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,315 @@
|
|||
package com.yanzhu.job.service.impl;
|
||||
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
import com.yanzhu.common.core.utils.StringUtils;
|
||||
import com.yanzhu.job.domain.QuartzProAttendanceCfg;
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceData;
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceUser;
|
||||
import com.yanzhu.job.mapper.QuartzProjectAttendanceUserMapper;
|
||||
import com.yanzhu.job.service.IQuartzProjectAttendanceUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 考勤人员基本属性Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-09-24
|
||||
*/
|
||||
@Service
|
||||
public class QuartzProjectAttendanceUserServiceImpl implements IQuartzProjectAttendanceUserService
|
||||
{
|
||||
@Autowired
|
||||
private QuartzProjectAttendanceUserMapper quartzProjectAttendanceUserMapper;
|
||||
|
||||
/**
|
||||
* 查询考勤人员基本属性
|
||||
*
|
||||
* @param id 考勤人员基本属性主键
|
||||
* @return 考勤人员基本属性
|
||||
*/
|
||||
@Override
|
||||
public QuartzProjectAttendanceUser selectSurProjectAttendanceUserById(Long id)
|
||||
{
|
||||
return quartzProjectAttendanceUserMapper.selectSurProjectAttendanceUserById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询考勤人员信息
|
||||
*
|
||||
* @param quartzProjectAttendanceUser
|
||||
* @return 考勤人员基本属性
|
||||
*/
|
||||
@Override
|
||||
public QuartzProjectAttendanceUser findCurrentAttendanceUser(QuartzProjectAttendanceUser quartzProjectAttendanceUser) {
|
||||
return quartzProjectAttendanceUserMapper.findCurrentAttendanceUser(quartzProjectAttendanceUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询[研筑]考勤人员信息
|
||||
*
|
||||
* @param quartzProjectAttendanceUser
|
||||
* @return 考勤人员基本属性
|
||||
*/
|
||||
public QuartzProjectAttendanceUser findYzCurrentAttendanceUser(QuartzProjectAttendanceUser quartzProjectAttendanceUser){
|
||||
return quartzProjectAttendanceUserMapper.findYzCurrentAttendanceUser(quartzProjectAttendanceUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询考勤人员基本属性列表
|
||||
*
|
||||
* @param quartzProjectAttendanceUser 考勤人员基本属性
|
||||
* @return 考勤人员基本属性
|
||||
*/
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceUser> selectSurProjectAttendanceUserList(QuartzProjectAttendanceUser quartzProjectAttendanceUser)
|
||||
{
|
||||
return quartzProjectAttendanceUserMapper.selectSurProjectAttendanceUserList(quartzProjectAttendanceUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增考勤人员基本属性
|
||||
*
|
||||
* @param quartzProjectAttendanceUser 考勤人员基本属性
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSurProjectAttendanceUser(QuartzProjectAttendanceUser quartzProjectAttendanceUser)
|
||||
{
|
||||
if(StringUtils.isEmpty(quartzProjectAttendanceUser.getCreateBy())){
|
||||
quartzProjectAttendanceUser.setCreateBy("task");
|
||||
quartzProjectAttendanceUser.setCreateTime(DateUtils.getNowDate());
|
||||
}
|
||||
return quartzProjectAttendanceUserMapper.insertSurProjectAttendanceUser(quartzProjectAttendanceUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改考勤人员基本属性
|
||||
*
|
||||
* @param quartzProjectAttendanceUser 考勤人员基本属性
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSurProjectAttendanceUser(QuartzProjectAttendanceUser quartzProjectAttendanceUser)
|
||||
{
|
||||
if(StringUtils.isEmpty(quartzProjectAttendanceUser.getCreateBy())){
|
||||
quartzProjectAttendanceUser.setUpdateBy("task");
|
||||
}
|
||||
quartzProjectAttendanceUser.setUpdateTime(DateUtils.getNowDate());
|
||||
return quartzProjectAttendanceUserMapper.updateSurProjectAttendanceUser(quartzProjectAttendanceUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除考勤人员基本属性
|
||||
*
|
||||
* @param ids 需要删除的考勤人员基本属性主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSurProjectAttendanceUserByIds(Long[] ids)
|
||||
{
|
||||
return quartzProjectAttendanceUserMapper.deleteSurProjectAttendanceUserByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除考勤人员基本属性信息
|
||||
*
|
||||
* @param id 考勤人员基本属性主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSurProjectAttendanceUserById(Long id)
|
||||
{
|
||||
return quartzProjectAttendanceUserMapper.deleteSurProjectAttendanceUserById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除考勤人员基本属性
|
||||
*
|
||||
* @param list 需要删除的数据参数集合
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSurProjectAttendanceUserByParams(List<String> list) {
|
||||
return quartzProjectAttendanceUserMapper.deleteSurProjectAttendanceUserByParams(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增考勤人员基本属性
|
||||
*
|
||||
* @param quartzProjectAttendanceUserList 考勤人员基本属性列表
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int batchSurProjectAttendanceUser(List<QuartzProjectAttendanceUser> quartzProjectAttendanceUserList) {
|
||||
return quartzProjectAttendanceUserMapper.batchSurProjectAttendanceUser(quartzProjectAttendanceUserList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(QuartzProjectAttendanceUser user) {
|
||||
QuartzProjectAttendanceUser where=new QuartzProjectAttendanceUser();
|
||||
where.setWorkerId(user.getWorkerId());
|
||||
where.setCfgid(user.getCfgid());
|
||||
List<QuartzProjectAttendanceUser> list=selectSurProjectAttendanceUserList(where);
|
||||
if(list.size()==0){
|
||||
insertSurProjectAttendanceUser(user);
|
||||
}else{
|
||||
QuartzProjectAttendanceUser old=list.get(0);
|
||||
if(user.getVendorsCode().equals("jgw")){
|
||||
user.setCompanyId(old.getCompanyId());
|
||||
String oldNav=old.getNativePlace();
|
||||
String newNav=user.getNativePlace();
|
||||
if(oldNav==null || !oldNav.equals(newNav)){
|
||||
old.setNativePlace(newNav);
|
||||
}
|
||||
}
|
||||
user.setId(old.getId());
|
||||
updateSurProjectAttendanceUser(user);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceUser> queryAttendanceData(QuartzProjectAttendanceUser where) {
|
||||
List<QuartzProjectAttendanceUser> list= quartzProjectAttendanceUserMapper.queryAttendanceUsers(where);
|
||||
List<String> workerIds=new ArrayList<>();
|
||||
for(QuartzProjectAttendanceUser u: list){
|
||||
workerIds.add(u.getWorkerId());
|
||||
}
|
||||
where.setWorkerIds(workerIds);
|
||||
List<QuartzProjectAttendanceUser> datas= quartzProjectAttendanceUserMapper.todayAttendanceData(workerIds);
|
||||
for (QuartzProjectAttendanceUser u:list) {
|
||||
u.setInTime(findDate(datas,u,"E"));
|
||||
u.setOutTime(findDate(datas,u,"L"));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long countTodayAttendance(QuartzProjectAttendanceUser where) {
|
||||
return quartzProjectAttendanceUserMapper.countTodayAttendance(where);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceUser> todayAttendance(QuartzProjectAttendanceUser where) {
|
||||
if(where.getIndex()<1){
|
||||
where.setIndex(1);
|
||||
}
|
||||
where.setIndex((where.getIndex()-1)* where.getSize());
|
||||
List<QuartzProjectAttendanceUser> list= quartzProjectAttendanceUserMapper.todayAttendance(where);
|
||||
List<String> workerIds=new ArrayList<>();
|
||||
for(QuartzProjectAttendanceUser u: list){
|
||||
workerIds.add(u.getWorkerId());
|
||||
}
|
||||
List<QuartzProjectAttendanceUser> datas= quartzProjectAttendanceUserMapper.todayAttendanceData(workerIds);
|
||||
for (QuartzProjectAttendanceUser u:list) {
|
||||
u.setInTime(findDate(datas,u,"E"));
|
||||
u.setOutTime(findDate(datas,u,"L"));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long countAttendance(QuartzProjectAttendanceUser user) {
|
||||
QuartzProAttendanceCfg where=new QuartzProAttendanceCfg();
|
||||
where.setCreateBy(user.getCreateBy());
|
||||
where.setDeptId(user.getSubDeptId());
|
||||
where.setProjectId(user.getProjectId());
|
||||
return quartzProjectAttendanceUserMapper.countAttendance(where);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceUser> selectSurProjectAttendanceUserListJgw(QuartzProjectAttendanceUser quartzProjectAttendanceUser) {
|
||||
return quartzProjectAttendanceUserMapper.selectSurProjectAttendanceUserListJgw(quartzProjectAttendanceUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 在岗工人查询
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceUser> queryWorkerOnDuty(QuartzProjectAttendanceUser where) {
|
||||
return quartzProjectAttendanceUserMapper.queryWorkerOnDuty(where);
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计人员数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> groupUserByParams(QuartzProjectAttendanceUser where){
|
||||
return quartzProjectAttendanceUserMapper.groupUserByParams(where);
|
||||
}
|
||||
|
||||
/**
|
||||
* 在岗工人查询
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceUser> attendanceUserList(QuartzProjectAttendanceUser where){
|
||||
return quartzProjectAttendanceUserMapper.attendanceUserList(where);
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计人员数据
|
||||
* @param projectId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> findUserAllByDays(Long projectId){
|
||||
return quartzProjectAttendanceUserMapper.findUserAllByDays(projectId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 按部门汇总在岗人数
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceData> groupByWorkerOnDutyByDept(QuartzProjectAttendanceUser where) {
|
||||
return quartzProjectAttendanceUserMapper.groupByWorkerOnDutyByDept(where);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceUser> querySurProjectAttendanceUserList(QuartzProjectAttendanceUser quartzProjectAttendanceUser) {
|
||||
return quartzProjectAttendanceUserMapper.querySurProjectAttendanceUserList(quartzProjectAttendanceUser);
|
||||
}
|
||||
/**
|
||||
* 按部门汇总在岗|离岗人数
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceData> groupByWorkerByDept(QuartzProjectAttendanceUser where) {
|
||||
return quartzProjectAttendanceUserMapper.groupByWorkerByDept(where);
|
||||
}
|
||||
/**
|
||||
* 在岗|离岗工人查询
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceUser> queryWorkerByState(QuartzProjectAttendanceUser where) {
|
||||
return quartzProjectAttendanceUserMapper.queryWorkerByState(where);
|
||||
}
|
||||
|
||||
private Date findDate(List<QuartzProjectAttendanceUser> datas, QuartzProjectAttendanceUser u, String type) {
|
||||
for (QuartzProjectAttendanceUser user:datas) {
|
||||
if(user.getWorkerId().equals(u.getWorkerId()) && user.getName().equals(type)){
|
||||
if(type.equals("L")){
|
||||
return user.getOutTime();
|
||||
}else{
|
||||
return user.getInTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,33 +1,25 @@
|
|||
package com.yanzhu.job.task;
|
||||
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.yanzhu.common.core.constant.SecurityConstants;
|
||||
import com.yanzhu.common.core.enums.*;
|
||||
import com.yanzhu.common.core.text.Convert;
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
import com.yanzhu.common.core.utils.Md5Utils;
|
||||
import com.yanzhu.common.core.utils.StringUtils;
|
||||
import com.yanzhu.common.core.utils.file.FileUtils;
|
||||
import com.yanzhu.common.core.utils.http.HttpUtils;
|
||||
import com.yanzhu.common.redis.service.RedisService;
|
||||
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||
import com.yanzhu.job.domain.*;
|
||||
import com.yanzhu.job.service.*;
|
||||
import com.yanzhu.system.api.RemoteFileService;
|
||||
import com.yanzhu.system.api.RemoteUserService;
|
||||
import com.yanzhu.system.api.domain.SysUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import okhttp3.*;
|
||||
import org.apache.logging.log4j.util.Strings;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
@ -54,20 +46,18 @@ public class AttendanceSzjTask {
|
|||
@Autowired
|
||||
private RemoteUserService remoteUserService;
|
||||
|
||||
@Autowired
|
||||
private IQuartzProSubdeptsService quartzProSubdeptsService;
|
||||
|
||||
@Autowired
|
||||
private IQuartzProSubdeptsGroupService quartzProSubdeptsGroupService;
|
||||
|
||||
@Autowired
|
||||
private IQuartzProSubdeptsUsersService quartzProSubdeptsUsersService;
|
||||
|
||||
@Autowired
|
||||
private IQuartzProAttendanceCfgService quartzProAttendanceCfgService;
|
||||
|
||||
@Autowired
|
||||
private IQuartzProAttendanceDataService quartzProAttendanceDataService;
|
||||
private IQuartzProjectAttendanceGroupService groupService;
|
||||
|
||||
@Autowired
|
||||
private IQuartzProjectAttendanceUserService userService;
|
||||
|
||||
@Autowired
|
||||
private IQuartzProjectAttendanceDataService attendanceDataService;
|
||||
|
||||
|
||||
private final String code = "szj";
|
||||
private static final String SZJ_HOST = "https://sc.uni-ubi.com/sc/api/";
|
||||
|
@ -109,40 +99,238 @@ public class AttendanceSzjTask {
|
|||
AttendanceSzjTask task = new AttendanceSzjTask();
|
||||
String secret = "185677eed140468fbb7d4dc47c1b2806";
|
||||
String token = task.getToken(secret);
|
||||
task.testEnterpriseQuery(token);
|
||||
//List<SzjEnterpriseInfo> enterpriseInfos= task.getEnterpriseQuery(token);
|
||||
//task.testTeamQuery(token,enterpriseInfos);
|
||||
//task.testPersonQuery(token);
|
||||
task.testAttendanceQuery(token);
|
||||
}
|
||||
|
||||
public void testEnterpriseQuery(String token){
|
||||
private void testAttendanceQuery(String token){
|
||||
Map<String, String> headerMap = new HashMap<>();
|
||||
headerMap.put("token",token);
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
try {
|
||||
params.put("offset",5);
|
||||
params.put("recordSize",5);
|
||||
params.put("startTime","2025-06-01");
|
||||
params.put("endTime","2025-06-07");
|
||||
String result = HttpUtils.sendJSONPost(SZJ_HOST + "v1/api/recognition/query", JSON.toJSONString(params), headerMap);
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
if (jsonObject != null && jsonObject.getBoolean("success")) {
|
||||
JSONObject data = jsonObject.getJSONObject("data");
|
||||
int offset= data.getInteger("offset");
|
||||
JSONArray records= data.getJSONArray("list");
|
||||
List<QuartzProjectAttendanceData> atts=toAttendance(records);
|
||||
System.out.println("offset="+offset);
|
||||
System.out.println(result);
|
||||
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
System.out.println(e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private List<QuartzProjectAttendanceData> toAttendance(JSONArray arr) {
|
||||
List<QuartzProjectAttendanceData> attendanceList = new ArrayList<>();
|
||||
for (int i = 0; i < arr.size(); i++) {
|
||||
JSONObject jo = arr.getJSONObject(i);
|
||||
QuartzProjectAttendanceData attendance = new QuartzProjectAttendanceData();
|
||||
attendance.setServerid(jo.getString("id"));
|
||||
if(1==jo.getInteger("doorType")){
|
||||
attendance.setAttendanceTime(jo.getString("showTime"));
|
||||
}else{
|
||||
attendance.setAttendanceOutTime(jo.getString("showTime"));
|
||||
}
|
||||
attendance.setIdentification(jo.getString("idCardNo"));
|
||||
attendance.setWorkerName(jo.getString("personName"));
|
||||
attendance.setScanPhoto(jo.getString("photoUrl"));
|
||||
attendance.setCompanyName(jo.getString("enterpriseName"));
|
||||
attendance.setGroupName(jo.getString("teamName"));
|
||||
attendance.setDeviceCode(jo.getString("deviceKey"));
|
||||
attendance.setRemark(jo.getString("deviceName"));
|
||||
attendanceList.add(attendance);
|
||||
}
|
||||
return attendanceList;
|
||||
}
|
||||
|
||||
private void testPersonQuery(String token) {
|
||||
Map<String, String> headerMap = new HashMap<>();
|
||||
headerMap.put("token",token);
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
try {
|
||||
params.put("offset",1);
|
||||
params.put("recordSize",100);
|
||||
String result = HttpUtils.sendJSONPost(SZJ_HOST + "v1/api/person/query", JSON.toJSONString(params), headerMap);
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
if (jsonObject != null && jsonObject.getBoolean("success")) {
|
||||
JSONObject data = jsonObject.getJSONObject("data");
|
||||
int total= data.getInteger("total");
|
||||
JSONArray records= data.getJSONArray("records");
|
||||
List<QuartzProjectAttendanceUser> users=toUsers(records);
|
||||
System.out.println("total="+total);
|
||||
System.out.println(result);
|
||||
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
}
|
||||
}
|
||||
|
||||
//将json转换为参建人员信息
|
||||
private List<QuartzProjectAttendanceUser> toUsers(JSONArray arr) {
|
||||
List<QuartzProjectAttendanceUser> users = new ArrayList<>();
|
||||
for (int i = 0; i < arr.size(); i++) {
|
||||
JSONObject jo = arr.getJSONObject(i);
|
||||
QuartzProjectAttendanceUser user = new QuartzProjectAttendanceUser();
|
||||
user.setWorkerId(jo.getString("id"));
|
||||
user.setName(jo.getString("personName"));
|
||||
user.setEthnic(jo.getString("national"));
|
||||
user.setNativePlace(jo.getString("nativePlace"));
|
||||
user.setGender("男".equals(jo.getString("gender"))?0L:1L);
|
||||
user.setBirthDate(DateUtil.parse( jo.getString("birthDate")).getTime());
|
||||
user.setPhone(jo.getString("phoneNumber"));
|
||||
user.setDegreeName(toQualification(jo.getString("qualification")));
|
||||
user.setPhoto(jo.getString("faceUrl"));
|
||||
user.setRecentPhoto(jo.getString("faceUrl"));
|
||||
user.setGroupId(jo.getString("teamId"));
|
||||
user.setGroupName(jo.getString("teamName"));
|
||||
user.setWorkTypeCode(jo.getString("workTypeCode"));
|
||||
user.setWorkTypeName(jo.getString("workType"));
|
||||
user.setState(jo.getInteger("personStatus")==1?0L:1L);
|
||||
String tmp=jo.getString("startTime");
|
||||
user.setEnterDate(StringUtils.isEmpty(tmp)?null:DateUtil.formatDateTime( DateUtil.parse(tmp)));
|
||||
tmp=jo.getString("leftTime");
|
||||
user.setExitDate(StringUtils.isEmpty(tmp)?null:DateUtil.formatDateTime( DateUtil.parse(tmp)));
|
||||
user.setCompanyId(jo.getString("enterpriseId"));
|
||||
user.setCompanyName(jo.getString("enterpriseName"));
|
||||
user.setTeamId(jo.getInteger("roleType"));
|
||||
user.setIdCardNo(jo.getString("idCardNo"));
|
||||
user.setIdTypeName(jo.getString("idTypeName"));
|
||||
user.setTeamName(jo.getString("role"));
|
||||
user.setOther(jo.toString());
|
||||
users.add(user);
|
||||
}
|
||||
return users;
|
||||
}
|
||||
|
||||
private String toQualification(String degreeName) {
|
||||
if("1".equals(degreeName)){
|
||||
return "初中";
|
||||
}
|
||||
if("2".equals(degreeName)){
|
||||
return "高中";
|
||||
}
|
||||
if("3".equals(degreeName)){
|
||||
return "大专";
|
||||
}
|
||||
if("4".equals(degreeName)){
|
||||
return "大学";
|
||||
}
|
||||
if("5".equals(degreeName)){
|
||||
return "硕士";
|
||||
}
|
||||
if("6".equals(degreeName)){
|
||||
return "博士";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
//试参建单位获取
|
||||
private List<SzjEnterpriseInfo> getEnterpriseQuery(String token){
|
||||
Map<String, String> headerMap = new HashMap<>();
|
||||
headerMap.put("token",token);
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
try {
|
||||
String result = HttpUtils.sendJSONPost(SZJ_HOST + "v1/api/enterprise/query", JSON.toJSONString(params), headerMap);
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
List<SzjEnterpriseInfo> list=toEnters(jsonObject);
|
||||
System.out.println(result);
|
||||
return list;
|
||||
}catch (Exception e){
|
||||
log.error("ERROR->",e);
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
public void testTeamQuery(String token,List<SzjEnterpriseInfo> enterpriseInfos){
|
||||
Map<String, String> headerMap = new HashMap<>();
|
||||
headerMap.put("token",token);
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
try {
|
||||
params.put("offset",1);
|
||||
params.put("recordSize",100);
|
||||
String result = HttpUtils.sendJSONPost(SZJ_HOST + "v1/api/team/query", JSON.toJSONString(params), headerMap);
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
if (jsonObject != null && jsonObject.getBoolean("success")) {
|
||||
JSONObject data = jsonObject.getJSONObject("data");
|
||||
int total= data.getInteger("total");
|
||||
JSONArray records= data.getJSONArray("records");
|
||||
List<QuartzProjectAttendanceGroup> groups=toGroups(records,enterpriseInfos);
|
||||
System.out.println("total="+total);
|
||||
System.out.println(result);
|
||||
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
}
|
||||
}
|
||||
public int updateAttendanceGroup(JSONObject jsonObject) {
|
||||
int result = 0;
|
||||
|
||||
//将json转换为参见班组信息
|
||||
private List<QuartzProjectAttendanceGroup> toGroups(JSONArray records, List<SzjEnterpriseInfo> enterpriseInfos) {
|
||||
List<QuartzProjectAttendanceGroup> groups = new ArrayList<>();
|
||||
for (int i = 0; i < records.size(); i++) {
|
||||
JSONObject jo = records.getJSONObject(i);
|
||||
QuartzProjectAttendanceGroup group = new QuartzProjectAttendanceGroup();
|
||||
group.setServerid(jo.getInteger("id")+"");
|
||||
SzjEnterpriseInfo szjEnterpriseInfo = findEnterperiseCreditCode(jo.getInteger("enterpriseId"),enterpriseInfos);
|
||||
group.setBizLicense(szjEnterpriseInfo!=null?szjEnterpriseInfo.getCreditCode():jo.getInteger("enterpriseId")+"");
|
||||
group.setCompanyId(jo.getInteger("enterpriseId")+"");
|
||||
group.setCompanyName(jo.getString("enterpriseName"));
|
||||
group.setCompanyTypeId(jo.getInteger("enterpriseType")+"");
|
||||
group.setName(jo.getString("teamName"));
|
||||
group.setTeamId(jo.getLong("id"));
|
||||
group.setLeaderName(jo.getString("teamLeader"));
|
||||
group.setLeaderPhone(jo.getString("teamLeaderTel"));
|
||||
group.setTeamName(jo.getString("teamContact"));
|
||||
group.setLeaderId(jo.getLongValue("personCount"));
|
||||
group.setRemark(jo.getString("remark"));
|
||||
group.setIsDel(jo.getInteger("isDeleted")==0?0L:1L);
|
||||
groups.add(group);
|
||||
}
|
||||
return groups;
|
||||
}
|
||||
|
||||
private SzjEnterpriseInfo findEnterperiseCreditCode(Integer enterpriseId, List<SzjEnterpriseInfo> enterpriseInfos) {
|
||||
for (SzjEnterpriseInfo enterpriseInfo : enterpriseInfos) {
|
||||
if(enterpriseInfo.getId().equals(enterpriseId)){
|
||||
return enterpriseInfo;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
//将json转换为参见单位
|
||||
public List<SzjEnterpriseInfo> toEnters(JSONObject jsonObject) {
|
||||
List<SzjEnterpriseInfo> szjEnterpriseInfos = new ArrayList<>();
|
||||
if (jsonObject != null && jsonObject.getBoolean("success")) {
|
||||
JSONArray jsonArray = jsonObject.getJSONArray("data");
|
||||
if (jsonArray.size() > 0) {
|
||||
for (int i = 0; i < jsonArray.size(); i++) {
|
||||
JSONObject json = jsonArray.getJSONObject(i);
|
||||
QuartzProSubdepts dept = new QuartzProSubdepts();
|
||||
|
||||
SzjEnterpriseInfo szjEnterpriseInfo = json.toJavaObject(SzjEnterpriseInfo.class);
|
||||
szjEnterpriseInfos.add(szjEnterpriseInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return szjEnterpriseInfos;
|
||||
}
|
||||
/**
|
||||
* 同步单位及班组信息
|
||||
* 同步班组信息
|
||||
*/
|
||||
public void syncContractorAndGroupData() {
|
||||
log.info("开始同步数智建单位&班组信息...{}",DateUtils.dateTimeStr());
|
||||
public void syncGroupData() {
|
||||
log.info("开始同步数智建班组信息...{}",DateUtils.dateTimeStr());
|
||||
QuartzProAttendanceCfg where = new QuartzProAttendanceCfg();
|
||||
where.setEnabled(ShiFouEnums.SHI.getCode());
|
||||
where.setIsDel(ShiFouEnums.FOU.getCode());
|
||||
|
@ -154,92 +342,62 @@ public class AttendanceSzjTask {
|
|||
JSONObject jSONObject = JSON.parseObject(param);
|
||||
try {
|
||||
String token = getToken(jSONObject.getString("secret"));
|
||||
doSyncProContractor(token, item);
|
||||
//doSyncDirectlyUnderGroup(jo, 0l, item);
|
||||
List<SzjEnterpriseInfo> enterpriseInfos= getEnterpriseQuery(token);
|
||||
doSyncGroup(token, item,enterpriseInfos,1);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
log.error("syncGroupData->",ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询直属班组
|
||||
*
|
||||
* @param token 请求令牌
|
||||
* @param it 配置信息
|
||||
* 同步班组信息
|
||||
* @param token
|
||||
* @param cfg 配置信息
|
||||
* @param enterpriseInfos 参建单位信息
|
||||
* @param pageIndex 页码
|
||||
*/
|
||||
private void doSyncProContractor(String token, QuartzProAttendanceCfg it){
|
||||
log.info("开始查询数智建参建单位信息...{}",it.getProjectId());
|
||||
private void doSyncGroup(String token, QuartzProAttendanceCfg cfg,List<SzjEnterpriseInfo> enterpriseInfos,int pageIndex) {
|
||||
Map<String, String> headerMap = new HashMap<>();
|
||||
headerMap.put("token",token);
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
try {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
String result = HttpUtils.sendJSONPost(SZJ_HOST+"v1/api/enterprise/query",JSON.toJSONString(params),headerMap);
|
||||
params.put("offset",pageIndex);
|
||||
params.put("recordSize",100);
|
||||
params.put("deleted",0);
|
||||
String result = HttpUtils.sendJSONPost(SZJ_HOST + "v1/api/team/query", JSON.toJSONString(params), headerMap);
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
if(jsonObject!=null && jsonObject.getBoolean("success")){
|
||||
JSONArray jsonArray = jsonObject.getJSONArray("data");
|
||||
if(jsonArray.size()>0){
|
||||
for (int i = 0; i < jsonArray.size(); i++){
|
||||
JSONObject json = jsonArray.getJSONObject(i);
|
||||
String subDeptType = convertSubDeptType(json.getString("enterpriseType"));
|
||||
// 总包单位不同步
|
||||
if(!"3".equals(subDeptType)){
|
||||
QuartzProSubdepts quartzProSubdeptsQuery = new QuartzProSubdepts();
|
||||
quartzProSubdeptsQuery.setProjectId(it.getProjectId());
|
||||
quartzProSubdeptsQuery.setSubDeptCode(json.getString("creditCode"));
|
||||
List<QuartzProSubdepts> list = quartzProSubdeptsService.selectQuartzProSubdeptsList(quartzProSubdeptsQuery);
|
||||
if(StringUtils.isEmpty(list)){
|
||||
QuartzProSubdepts quartzProSubdepts = new QuartzProSubdepts();
|
||||
quartzProSubdepts.setComId(it.getComId());
|
||||
quartzProSubdepts.setProjectId(it.getProjectId());
|
||||
quartzProSubdepts.setSubDeptType(subDeptType);
|
||||
quartzProSubdepts.setSubDeptName(json.getString("enterpriseName"));
|
||||
quartzProSubdepts.setSubDeptCode(json.getString("creditCode"));
|
||||
quartzProSubdepts.setSubDeptLeaderName(json.getString("contactPerson"));
|
||||
quartzProSubdepts.setSubDeptLeaderPhone(json.getString("contactNumber"));
|
||||
Map<String, Object> subDeptInfos = new HashMap<>();
|
||||
subDeptInfos.put("signDate",json.getString("registTime"));
|
||||
subDeptInfos.put("address",json.getString("enterpriseAddress"));
|
||||
subDeptInfos.put("businessAddress",json.getString("enterpriseAddress"));
|
||||
subDeptInfos.put("officePhone",json.getString("contactNumber"));
|
||||
quartzProSubdepts.setSubDeptInfos(JSON.toJSONString(subDeptInfos));
|
||||
quartzProSubdepts.setUseStatus(UseStateEnums.IN.getCode());
|
||||
quartzProSubdepts.setUseDates(DateUtils.getNowDate());
|
||||
quartzProSubdepts.setApproveStatus(ApproveStatus.passed.getCode());
|
||||
quartzProSubdepts.setSource(code.toUpperCase()+"::"+json.getString("id"));
|
||||
quartzProSubdepts.setCreateBy("SZJ-TASK");
|
||||
quartzProSubdepts.setCreateTime(DateUtils.getNowDate());
|
||||
quartzProSubdeptsService.insertQuartzProSubdepts(quartzProSubdepts);
|
||||
redisService.setCacheObject("doSyncProContractor.szj.contractorId::"+json.getString("id"),quartzProSubdepts,2L,TimeUnit.HOURS);
|
||||
}else{
|
||||
QuartzProSubdepts quartzProSubdepts = list.get(0);
|
||||
quartzProSubdepts.setSource(code.toUpperCase()+"::"+json.getString("contractorId"));
|
||||
quartzProSubdeptsService.updateQuartzProSubdepts(quartzProSubdepts);
|
||||
redisService.setCacheObject("doSyncProContractor.szj.contractorId::"+json.getString("id"),list.get(0),2L,TimeUnit.HOURS);
|
||||
}
|
||||
}else{
|
||||
QuartzProSubdepts quartzProSubdepts = new QuartzProSubdepts();
|
||||
quartzProSubdepts.setComId(it.getComId());
|
||||
quartzProSubdepts.setProjectId(it.getProjectId());
|
||||
quartzProSubdepts.setSubDeptType(subDeptType);
|
||||
quartzProSubdepts.setSubDeptName(json.getString("enterpriseName"));
|
||||
quartzProSubdepts.setSubDeptCode(json.getString("creditCode"));
|
||||
quartzProSubdepts.setSubDeptLeaderName(json.getString("contactPerson"));
|
||||
quartzProSubdepts.setSubDeptLeaderPhone(json.getString("contactNumber"));
|
||||
quartzProSubdepts.setUseStatus(UseStateEnums.IN.getCode());
|
||||
quartzProSubdepts.setUseDates(DateUtils.getNowDate());
|
||||
quartzProSubdepts.setApproveStatus(ApproveStatus.passed.getCode());
|
||||
quartzProSubdepts.setSource(code.toUpperCase()+"::"+json.getString("id"));
|
||||
quartzProSubdepts.setCreateBy("SZJ-TASK");
|
||||
quartzProSubdepts.setCreateTime(DateUtils.getNowDate());
|
||||
redisService.setCacheObject("doSyncProContractor.szj.contractorId::"+json.getString("id"),quartzProSubdepts,2L,TimeUnit.HOURS);
|
||||
}
|
||||
if (jsonObject != null && jsonObject.getBoolean("success")) {
|
||||
JSONObject data = jsonObject.getJSONObject("data");
|
||||
int total= data.getInteger("total");
|
||||
JSONArray records= data.getJSONArray("records");
|
||||
List<QuartzProjectAttendanceGroup> groups=toGroups(records,enterpriseInfos);
|
||||
for(QuartzProjectAttendanceGroup group:groups){
|
||||
group.setCfgid(cfg.getId());
|
||||
QuartzProjectAttendanceGroup where=new QuartzProjectAttendanceGroup();
|
||||
where.setServerid(group.getServerid());
|
||||
where.setCfgid(group.getCfgid());
|
||||
List<QuartzProjectAttendanceGroup> list=groupService.selectSurProjectAttendanceGroupList(where);
|
||||
if(list.size()==0){
|
||||
group.setCreateBy("TASK");
|
||||
group.setCreateTime(new Date());
|
||||
groupService.add(group);
|
||||
|
||||
}else{
|
||||
group.setUpdateBy("TASK");
|
||||
group.setUpdateTime(new Date());
|
||||
group.setId(list.get(0).getId());
|
||||
groupService.updateSurProjectAttendanceGroup(group);
|
||||
}
|
||||
}
|
||||
};
|
||||
if(total>pageIndex*100){
|
||||
doSyncGroup(token,cfg,enterpriseInfos,pageIndex+1);
|
||||
}
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
log.error("doSyncGroup->",e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -268,247 +426,211 @@ public class AttendanceSzjTask {
|
|||
}
|
||||
|
||||
/**
|
||||
* 查询直属班组
|
||||
*
|
||||
* @param token 请求令牌
|
||||
* @param it 配置信息
|
||||
* 同步人员
|
||||
*/
|
||||
private void doSyncDirectlyUnderGroup(String token, QuartzProAttendanceCfg it) {
|
||||
log.info("开始同步数智建直属班组信息...{}",it.getProjectId());
|
||||
Map<String, String> headerMap = new HashMap<>();
|
||||
headerMap.put("token",token);
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
try {
|
||||
String result = HttpUtils.sendJSONPost(SZJ_HOST+"v1/api/team/query",JSON.toJSONString(params),headerMap);
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
if(jsonObject!=null && jsonObject.getBoolean("success")) {
|
||||
JSONArray jsonArray = jsonObject.getJSONArray("data");
|
||||
if (jsonArray.size() > 0) {
|
||||
for (int i = 0; i < jsonArray.size(); i++) {
|
||||
JSONObject json = jsonArray.getJSONObject(i);
|
||||
Map<String, String> dataMap = convertSubJobTypes(json.getString("corpType"));
|
||||
QuartzProSubdeptsGroup quartzProSubdeptsGroupQuery = new QuartzProSubdeptsGroup();
|
||||
quartzProSubdeptsGroupQuery.setProjectId(it.getProjectId());
|
||||
quartzProSubdeptsGroupQuery.setGroupName(json.getString("teamName"));
|
||||
List<QuartzProSubdeptsGroup> list = quartzProSubdeptsGroupService.selectQuartzProSubdeptsGroupList(quartzProSubdeptsGroupQuery);
|
||||
if(StringUtils.isEmpty(list)){
|
||||
QuartzProSubdepts quartzProSubdepts = redisService.getCacheObject("doSyncProContractor.contractorId::"+json.getString("contractorId"));
|
||||
QuartzProSubdeptsGroup quartzProSubdeptsGroup = new QuartzProSubdeptsGroup();
|
||||
quartzProSubdeptsGroup.setComId(it.getComId());
|
||||
quartzProSubdeptsGroup.setProjectId(it.getProjectId());
|
||||
quartzProSubdeptsGroup.setSubDeptId(quartzProSubdepts.getId());
|
||||
quartzProSubdeptsGroup.setSubDeptType(quartzProSubdepts.getSubDeptType());
|
||||
quartzProSubdeptsGroup.setSubDeptName(quartzProSubdepts.getSubDeptName());
|
||||
quartzProSubdeptsGroup.setSubDeptCode(quartzProSubdepts.getSubDeptCode());
|
||||
quartzProSubdeptsGroup.setGroupName(json.getString("teamName"));
|
||||
if(StringUtils.eqObj(dataMap.get("type"),"2")){
|
||||
quartzProSubdeptsGroup.setGroupCode(DeptGroupEnums.SPECIAL.getCode());
|
||||
}else if(StringUtils.eqObj(dataMap.get("type"),"3")){
|
||||
quartzProSubdeptsGroup.setGroupCode(DeptGroupEnums.MANAGE.getCode());
|
||||
}
|
||||
quartzProSubdeptsGroup.setCraftType(dataMap.get("type"));
|
||||
quartzProSubdeptsGroup.setCraftPost(dataMap.get("post"));
|
||||
quartzProSubdeptsGroup.setUseStatus(UseStateEnums.IN.getCode());
|
||||
quartzProSubdeptsGroup.setApproveStatus(ApproveStatus.passed.getCode());
|
||||
quartzProSubdeptsGroup.setIsDel(Convert.toLong(json.getString("deleteFlag"),0L));
|
||||
quartzProSubdeptsGroup.setCreateBy("JGW-TASK");
|
||||
quartzProSubdeptsGroup.setCreateTime(DateUtils.getNowDate());
|
||||
quartzProSubdeptsGroup.setSource(code.toUpperCase()+"::"+json.getString("id"));
|
||||
quartzProSubdeptsGroupService.insertQuartzProSubdeptsGroup(quartzProSubdeptsGroup);
|
||||
redisService.setCacheObject("doSyncDirectlyUnderGroup.jgw.teamLeaderId::"+json.getString("leaderId"),quartzProSubdeptsGroup,2L,TimeUnit.HOURS);
|
||||
}else{
|
||||
QuartzProSubdeptsGroup quartzProSubdeptsGroup = list.get(0);
|
||||
quartzProSubdeptsGroup.setSource(code.toUpperCase()+"::"+json.getString("id"));
|
||||
quartzProSubdeptsGroup.setIsDel(Convert.toLong(json.getString("deleteFlag"),0L));
|
||||
quartzProSubdeptsGroup.setUpdateBy("JGW-TASK");
|
||||
quartzProSubdeptsGroup.setUpdateTime(DateUtils.getNowDate());
|
||||
quartzProSubdeptsGroupService.updateQuartzProSubdeptsGroup(quartzProSubdeptsGroup);
|
||||
redisService.setCacheObject("doSyncDirectlyUnderGroup.jgw.teamLeaderId::"+json.getString("leaderId"),quartzProSubdeptsGroup,2L,TimeUnit.HOURS);
|
||||
}
|
||||
}
|
||||
public void syncUser() {
|
||||
log.info("开始同步数智建人员信息...{}",DateUtils.dateTimeStr());
|
||||
QuartzProAttendanceCfg where = new QuartzProAttendanceCfg();
|
||||
where.setEnabled(ShiFouEnums.SHI.getCode());
|
||||
where.setIsDel(ShiFouEnums.FOU.getCode());
|
||||
where.setVendorsCode(code);
|
||||
List<QuartzProAttendanceCfg> list = quartzProAttendanceCfgService.selectProAttendanceCfgList(where);
|
||||
for (QuartzProAttendanceCfg item : list) {
|
||||
String param = item.getVendorsParameter();
|
||||
if (StringUtils.isNotEmpty(param)) {
|
||||
JSONObject jSONObject = JSON.parseObject(param);
|
||||
try {
|
||||
String token = getToken(jSONObject.getString("secret"));
|
||||
doSyncUser(token, item,1);
|
||||
} catch (Exception ex) {
|
||||
log.error("syncUser->",ex);
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换工种类型
|
||||
* @param jobTypes
|
||||
* @return
|
||||
* 执行同步人员
|
||||
* @param token
|
||||
* @param cfg
|
||||
* @param pageIndex
|
||||
*/
|
||||
private Map<String, String> convertSubJobTypes(String jobTypes){
|
||||
Map<String, String> dataMap = new HashMap<>();
|
||||
if(StringUtils.isEmpty(jobTypes)){
|
||||
dataMap.put("type","3");
|
||||
dataMap.put("post","4037");
|
||||
return dataMap;
|
||||
private void doSyncUser(String token, QuartzProAttendanceCfg cfg, int pageIndex) {
|
||||
Map<String, String> headerMap = new HashMap<>();
|
||||
headerMap.put("token",token);
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
try {
|
||||
params.put("offset",1);
|
||||
params.put("recordSize",100);
|
||||
String result = HttpUtils.sendJSONPost(SZJ_HOST + "v1/api/person/query", JSON.toJSONString(params), headerMap);
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
if (jsonObject != null && jsonObject.getBoolean("success")) {
|
||||
JSONObject data = jsonObject.getJSONObject("data");
|
||||
int total= data.getInteger("total");
|
||||
JSONArray records= data.getJSONArray("records");
|
||||
List<QuartzProjectAttendanceUser> users=toUsers(records);
|
||||
for(QuartzProjectAttendanceUser user:users) {
|
||||
user.setCfgid(cfg.getId());
|
||||
user.setVendorsCode(cfg.getVendorsCode());
|
||||
QuartzProjectAttendanceUser where = new QuartzProjectAttendanceUser();
|
||||
where.setWorkerId(user.getWorkerId());
|
||||
where.setCfgid(user.getCfgid());
|
||||
List<QuartzProjectAttendanceUser> list=userService.selectSurProjectAttendanceUserList(where);
|
||||
if(list.size()==0){
|
||||
user.setCreateBy("TASK");
|
||||
user.setCreateTime(new Date());
|
||||
userService.add(user);
|
||||
}else{
|
||||
user.setUpdateBy("TASK");
|
||||
user.setUpdateTime(new Date());
|
||||
user.setId(list.get(0).getId());
|
||||
userService.updateSurProjectAttendanceUser(user);
|
||||
}
|
||||
}
|
||||
if(total>pageIndex*100){
|
||||
doSyncUser(token,cfg,pageIndex+1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
log.error("doSyncUser-->",e);
|
||||
}
|
||||
switch (jobTypes){
|
||||
case "3001" : dataMap.put("type","2");dataMap.put("post","1015"); break;
|
||||
case "3002" : dataMap.put("type","2");dataMap.put("post","1014"); break;
|
||||
case "3003" :
|
||||
case "3004" : dataMap.put("type","2");dataMap.put("post","2021"); break;
|
||||
case "3005" : dataMap.put("type","2");dataMap.put("post","2022"); break;
|
||||
case "3006" : dataMap.put("type","2");dataMap.put("post","1013"); break;
|
||||
case "3007" : dataMap.put("type","1");dataMap.put("post","1006"); break;
|
||||
case "3008" : dataMap.put("type","1");dataMap.put("post","1004"); break;
|
||||
case "3009" : dataMap.put("type","1");dataMap.put("post","1001"); break;
|
||||
case "3010" : dataMap.put("type","1");dataMap.put("post","1003"); break;
|
||||
case "3011" : dataMap.put("type","1");dataMap.put("post","1017"); break;
|
||||
case "3012" : dataMap.put("type","1");dataMap.put("post","1007"); break;
|
||||
case "3013" : dataMap.put("type","1");dataMap.put("post","1008"); break;
|
||||
case "3014" : dataMap.put("type","1");dataMap.put("post","1009"); break;
|
||||
case "3015" : dataMap.put("type","1");dataMap.put("post","1012"); break;
|
||||
case "3016" : dataMap.put("type","3");dataMap.put("post","3024"); break;
|
||||
case "3017" : dataMap.put("type","1");dataMap.put("post","1010"); break;
|
||||
case "3018" : dataMap.put("type","3");dataMap.put("post","3025"); break;
|
||||
case "3019" : dataMap.put("type","2");dataMap.put("post","2017"); break;
|
||||
case "3020" : dataMap.put("type","2");dataMap.put("post","2018"); break;
|
||||
case "3021" : dataMap.put("type","2");dataMap.put("post","2016"); break;
|
||||
case "3031" :
|
||||
case "3032" :
|
||||
case "3042" : dataMap.put("type","2");dataMap.put("post","2019"); break;
|
||||
case "3072" :
|
||||
case "3039" :
|
||||
case "6002" :
|
||||
case "6003" :
|
||||
case "6004" :
|
||||
case "6005" :
|
||||
case "6006" :
|
||||
case "6007" :
|
||||
case "6008" :
|
||||
case "6009" :
|
||||
case "6010" :
|
||||
case "6012" :
|
||||
case "6013" :
|
||||
case "6014" :
|
||||
case "6015" :
|
||||
case "6016" :
|
||||
case "6017" :
|
||||
case "6018" :
|
||||
case "6019" :
|
||||
case "6020" :
|
||||
case "6021" :
|
||||
case "6022" :
|
||||
case "6023" :
|
||||
case "6024" :
|
||||
case "6025" :
|
||||
case "6026" :
|
||||
case "6027" :
|
||||
case "6028" :
|
||||
case "6029" :
|
||||
case "6030" :
|
||||
case "6031" :
|
||||
case "6032" :
|
||||
case "6033" :
|
||||
case "6034" :
|
||||
case "6035" :
|
||||
case "6036" :
|
||||
case "6037" :
|
||||
case "6038" :
|
||||
case "6039" :
|
||||
case "6040" :
|
||||
case "6041" :
|
||||
case "6042" :
|
||||
case "6043" :
|
||||
case "6044" :
|
||||
case "6045" :
|
||||
case "6046" :
|
||||
case "6047" :
|
||||
case "6048" :
|
||||
case "6049" :
|
||||
case "6050" :
|
||||
case "6051" :
|
||||
case "6052" :
|
||||
case "6053" :
|
||||
case "6054" :
|
||||
case "6055" :
|
||||
case "6056" :
|
||||
case "6057" :
|
||||
case "6058" :
|
||||
case "6059" :
|
||||
case "6060" :
|
||||
case "6061" :
|
||||
case "6062" :
|
||||
case "6063" :
|
||||
case "6064" :
|
||||
case "6065" :
|
||||
case "6066" :
|
||||
case "6067" :
|
||||
case "6068" :
|
||||
case "6069" :
|
||||
case "6070" :
|
||||
case "6071" :
|
||||
case "6072" :
|
||||
case "6073" :
|
||||
case "6074" :
|
||||
case "6075" :
|
||||
case "6076" :
|
||||
case "6077" :
|
||||
case "6078" :
|
||||
case "6079" :
|
||||
case "6080" :
|
||||
case "6081" :
|
||||
case "6082" :
|
||||
case "6083" :
|
||||
case "6084" :
|
||||
case "6085" :
|
||||
case "6086" :
|
||||
case "6087" :
|
||||
case "6088" :
|
||||
case "6089" :
|
||||
case "6090" :
|
||||
case "6091" :
|
||||
case "6092" :
|
||||
case "6093" :
|
||||
case "6094" :
|
||||
case "6095" :
|
||||
case "6096" :
|
||||
case "6097" :
|
||||
case "6001" : dataMap.put("type","3");dataMap.put("post","4037"); break;
|
||||
case "6011" : dataMap.put("type","3");dataMap.put("post","3023"); break;
|
||||
case "3036" :
|
||||
case "3054" :
|
||||
case "3056" :
|
||||
case "3057" :
|
||||
case "3058" :
|
||||
case "3059" :
|
||||
case "3060" :
|
||||
case "3061" :
|
||||
case "3062" :
|
||||
case "3063" :
|
||||
case "3064" :
|
||||
case "3065" :
|
||||
case "3055" : dataMap.put("type","1");dataMap.put("post","8888"); break;
|
||||
case "3041" :
|
||||
case "3040" :
|
||||
case "3037" :
|
||||
case "3038" :
|
||||
case "3043" :
|
||||
case "3044" :
|
||||
case "3045" :
|
||||
case "3046" :
|
||||
case "3047" :
|
||||
case "3048" :
|
||||
case "3049" :
|
||||
case "3050" :
|
||||
case "3051" :
|
||||
case "3052" :
|
||||
case "3053" :
|
||||
case "3033" :
|
||||
case "3066" :
|
||||
case "3067" :
|
||||
case "3068" :
|
||||
case "3069" :
|
||||
case "3070" :
|
||||
case "3035" :
|
||||
case "3071" :
|
||||
case "3034" : dataMap.put("type","2");dataMap.put("post","9999"); break;
|
||||
default : dataMap.put("type","3");dataMap.put("post","4037"); break;
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步当日考勤记录
|
||||
*/
|
||||
public void syncAttendanceData() {
|
||||
log.info("开始同步数智建考勤记录...{}",DateUtils.dateTimeStr());
|
||||
String startTime=DateUtil.formatDate(new Date());
|
||||
String endTime=DateUtil.formatDate(new Date());
|
||||
syncAttendanceData(startTime,endTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步最后一周考勤记录
|
||||
*/
|
||||
public void syncLastWeekAttendanceData() {
|
||||
log.info("开始同步数智建考勤记录...{}",DateUtils.dateTimeStr());
|
||||
String startTime=DateUtil.formatDate(DateUtil.offsetDay(new Date(),-7));
|
||||
String endTime=DateUtil.formatDate(new Date());
|
||||
syncAttendanceData(startTime,endTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步最近30天考勤记录
|
||||
*/
|
||||
public void syncLast30DayAttendanceData() {
|
||||
log.info("开始同步数智建考勤记录...{}",DateUtils.dateTimeStr());
|
||||
Date date=DateUtil.offsetDay(new Date(),-30);
|
||||
for(int i=0;i<30;i+=7){
|
||||
String startTime=DateUtil.formatDate(DateUtil.offsetDay(date,i));
|
||||
String endTime=DateUtil.formatDate(DateUtil.offsetDay(date,i+7));
|
||||
syncAttendanceData(startTime,endTime);
|
||||
}
|
||||
}
|
||||
|
||||
private void syncAttendanceData(String startTime, String endTime) {
|
||||
QuartzProAttendanceCfg where = new QuartzProAttendanceCfg();
|
||||
where.setEnabled(ShiFouEnums.SHI.getCode());
|
||||
where.setIsDel(ShiFouEnums.FOU.getCode());
|
||||
where.setVendorsCode(code);
|
||||
List<QuartzProAttendanceCfg> list = quartzProAttendanceCfgService.selectProAttendanceCfgList(where);
|
||||
for (QuartzProAttendanceCfg item : list) {
|
||||
String param = item.getVendorsParameter();
|
||||
if (StringUtils.isNotEmpty(param)) {
|
||||
JSONObject jSONObject = JSON.parseObject(param);
|
||||
try {
|
||||
String token = getToken(jSONObject.getString("secret"));
|
||||
doSyncAttendance(token, item,0,startTime,endTime);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void doSyncAttendance(String token, QuartzProAttendanceCfg cfg, int offset, String startTime, String endTime) {
|
||||
Map<String, String> headerMap = new HashMap<>();
|
||||
headerMap.put("token",token);
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
try {
|
||||
params.put("offset",offset);
|
||||
params.put("recordSize",100);
|
||||
params.put("startTime",startTime);
|
||||
params.put("endTime",endTime);
|
||||
String result = HttpUtils.sendJSONPost(SZJ_HOST + "v1/api/recognition/query", JSON.toJSONString(params), headerMap);
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
if (jsonObject != null && jsonObject.getBoolean("success")) {
|
||||
JSONObject data = jsonObject.getJSONObject("data");
|
||||
offset= data.getInteger("offset");
|
||||
JSONArray records= data.getJSONArray("list");
|
||||
List<QuartzProjectAttendanceData> atts=toAttendance(records);
|
||||
for(QuartzProjectAttendanceData att:atts) {
|
||||
att.setCfgid(cfg.getId());
|
||||
att.setVendorsCode(cfg.getVendorsCode());
|
||||
att.setProjectId(cfg.getProjectId());
|
||||
att.setProjectName(cfg.getProjectName());
|
||||
att.setDeptId(cfg.getDeptId());
|
||||
att.setDeptName(cfg.getDeptName());
|
||||
|
||||
QuartzProjectAttendanceUser userWhere=new QuartzProjectAttendanceUser();
|
||||
userWhere.setIdCardNo(att.getIdentification());
|
||||
userWhere.setCfgid(cfg.getId());
|
||||
List<QuartzProjectAttendanceUser> userList=userService.selectSurProjectAttendanceUserList(userWhere);
|
||||
if(userList.isEmpty()){
|
||||
continue;
|
||||
}
|
||||
QuartzProjectAttendanceUser user=userList.get(0);
|
||||
att.setWorkerId(user.getWorkerId());
|
||||
att.setWorkerName(user.getName());
|
||||
att.setWorkerPhoto(user.getPhoto());
|
||||
att.setWorkerGender(user.getGender());
|
||||
att.setBirthDate(user.getBirthDate());
|
||||
att.setEthnic(user.getEthnic());
|
||||
att.setNativePlace(user.getNativePlace());
|
||||
att.setPhone(user.getPhone());
|
||||
att.setWorkTypeName(user.getWorkTypeName());
|
||||
att.setGroupName(user.getGroupName());
|
||||
att.setCompanyName(user.getCompanyName());
|
||||
att.setCompanyTypeId(user.getCompanyTypeId());
|
||||
QuartzProjectAttendanceGroup groupWhere=new QuartzProjectAttendanceGroup();
|
||||
List<QuartzProjectAttendanceGroup> groupList=groupService.selectSurProjectAttendanceGroupList(groupWhere);
|
||||
if(!groupList.isEmpty()){
|
||||
QuartzProjectAttendanceGroup group=groupList.get(0);
|
||||
att.setCompanyTypeId(group.getCompanyTypeId());
|
||||
}
|
||||
groupWhere.setTeamId(NumberUtil.parseLong(user.getCompanyId()));
|
||||
QuartzProjectAttendanceData where = new QuartzProjectAttendanceData();
|
||||
where.setWorkerId(att.getWorkerId());
|
||||
where.setCfgid(att.getCfgid());
|
||||
if(StringUtils.isNotEmpty(att.getAttendanceTime())){
|
||||
where.setAttendanceTime(att.getAttendanceTime());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(att.getAttendanceOutTime())){
|
||||
where.setAttendanceTime(att.getAttendanceOutTime());
|
||||
}
|
||||
List<QuartzProjectAttendanceData> attList=attendanceDataService.selectSurProjectAttendanceDataListEx(where);
|
||||
if(attList.isEmpty()){
|
||||
att.setCreateBy("TASK");
|
||||
att.setCreateTime(new Date());
|
||||
attendanceDataService.insertSurProjectAttendanceData(att);
|
||||
}else{
|
||||
att.setUpdateBy("TASK");
|
||||
att.setUpdateTime(new Date());
|
||||
att.setId(attList.get(0).getId());
|
||||
attendanceDataService.updateSurProjectAttendanceData(att);
|
||||
}
|
||||
}
|
||||
if(atts.size()==100){
|
||||
doSyncAttendance(token,cfg,offset+1,startTime,endTime);
|
||||
}
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
log.error("doSyncAttendance->",e);
|
||||
}
|
||||
return dataMap;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,573 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yanzhu.job.mapper.QuartzProjectAttendanceDataMapper">
|
||||
|
||||
<resultMap type="QuartzProjectAttendanceData" id="SurProjectAttendanceDataResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="cfgid" column="cfgid" />
|
||||
<result property="appId" column="app_id" />
|
||||
<result property="projectId" column="projectId" />
|
||||
<result property="projectName" column="projectName" />
|
||||
<result property="deptId" column="deptId" />
|
||||
<result property="deptName" column="deptName" />
|
||||
<result property="vendorsCode" column="vendors_code" />
|
||||
<result property="serverid" column="serverid" />
|
||||
<result property="workerId" column="workerId" />
|
||||
<result property="workerName" column="workerName" />
|
||||
<result property="identification" column="identification" />
|
||||
<result property="workerPhoto" column="workerPhoto" />
|
||||
<result property="workerGender" column="workerGender" />
|
||||
<result property="birthDate" column="birthDate" />
|
||||
<result property="ethnic" column="ethnic" />
|
||||
<result property="nativePlace" column="nativePlace" />
|
||||
<result property="phone" column="phone" />
|
||||
<result property="workTypeName" column="workTypeName" />
|
||||
<result property="specWorkType" column="specWorkType" />
|
||||
<result property="groupName" column="groupName" />
|
||||
<result property="companyTypeId" column="companyTypeId" />
|
||||
<result property="companyName" column="companyName" />
|
||||
<result property="attendanceTime" column="attendance_time" />
|
||||
<result property="attendanceOutTime" column="attendance_out_time" />
|
||||
<result property="scanPhoto" column="scanPhoto" />
|
||||
<result property="teamId" column="teamId" />
|
||||
<result property="workTypeCode" column="workTypeCode" />
|
||||
<result property="companyId" column="companyId" />
|
||||
<result property="vendorId" column="vendorId" />
|
||||
<result property="deviceCode" column="device_code" />
|
||||
<result property="isDel" column="is_del" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSurProjectAttendanceDataVo">
|
||||
select
|
||||
id,
|
||||
cfgid,
|
||||
app_id,
|
||||
projectId,
|
||||
projectName,
|
||||
deptId,
|
||||
deptName,
|
||||
vendors_code,
|
||||
serverid,
|
||||
workerId,
|
||||
workerName,
|
||||
identification,
|
||||
workerPhoto,
|
||||
workerGender,
|
||||
birthDate,
|
||||
ethnic,
|
||||
nativePlace,
|
||||
phone,
|
||||
workTypeName,
|
||||
specWorkType,
|
||||
groupName,
|
||||
companyTypeId,
|
||||
companyName,
|
||||
attendance_time,
|
||||
attendance_out_time,
|
||||
scanPhoto,
|
||||
teamId,
|
||||
workTypeCode,
|
||||
companyId,
|
||||
vendorId,
|
||||
device_code,
|
||||
is_del,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
remark
|
||||
from sur_project_attendance_data_${year}
|
||||
</sql>
|
||||
|
||||
<select id="findCurrentAttendanceData" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
select * from sur_project_attendance_data_${year}
|
||||
<where>
|
||||
<if test="cfgid != null "> and cfgid = #{cfgid}</if>
|
||||
<if test="appId != null "> and app_id = #{appId}</if>
|
||||
<if test="workerId != null and workerId != ''"> and workerId = #{workerId}</if>
|
||||
<if test="attendanceTime != null and attendanceTime != ''"> and date(attendance_time) = date(#{attendanceTime})</if>
|
||||
</where>
|
||||
order by id desc LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="selectSurProjectAttendanceDataListEx" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
select * from sur_project_attendance_data_${year}
|
||||
<where>
|
||||
<if test="cfgid != null "> and cfgid = #{cfgid}</if>
|
||||
<if test="appId != null "> and app_id = #{appId}</if>
|
||||
<if test="projectId != null "> and projectId = #{projectId}</if>
|
||||
<if test="deptId != null "> and deptId = #{deptId}</if>
|
||||
<if test="vendorsCode != null and vendorsCode != ''"> and vendors_code = #{vendorsCode}</if>
|
||||
<if test="serverid != null "> and serverid = #{serverid}</if>
|
||||
<if test="workerId != null "> and workerId = #{workerId}</if>
|
||||
|
||||
<if test="identification != null and identification != ''"> and identification = #{identification}</if>
|
||||
<if test="teamId != null "> and teamId = #{teamId}</if>
|
||||
<if test="workTypeCode != null and workTypeCode != ''"> and workTypeCode = #{workTypeCode}</if>
|
||||
<if test="companyId != null "> and companyId = #{companyId}</if>
|
||||
<if test="vendorId != null "> and vendorId = #{vendorId}</if>
|
||||
<if test="deviceCode != null and deviceCode != ''"> and device_code = #{deviceCode}</if>
|
||||
<if test="companyTypeId!=null">
|
||||
<if test="companyTypeId>100">
|
||||
<if test="companyTypeId==101">
|
||||
and companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="companyTypeId==102">
|
||||
and companyTypeId =8
|
||||
</if>
|
||||
<if test="companyTypeId==103">
|
||||
and companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
</if>
|
||||
<if test="companyTypeId <100">
|
||||
and companyTypeId=#{companyTypeId}
|
||||
</if>
|
||||
</if>
|
||||
<if test="scanPhoto != null and scanPhoto != ''"> and scanPhoto = #{scanPhoto}</if>
|
||||
<if test="isDel != null "> and is_del = #{isDel}</if>
|
||||
<if test="attendanceTime != null and attendanceTime != ''"> and date(attendance_time) = date(#{attendanceTime})</if>
|
||||
</where>
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
<select id="selectSurProjectAttendanceDataList" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
<include refid="selectSurProjectAttendanceDataVo"/>
|
||||
<where>
|
||||
<if test="cfgid != null "> and cfgid = #{cfgid}</if>
|
||||
<if test="appId != null "> and app_id = #{appId}</if>
|
||||
<if test="projectId != null ">and cfgid in (select id from attendance_cfg where projectId = #{projectId})</if>
|
||||
<if test="deptId != null "> and deptId = #{deptId}</if>
|
||||
<if test="vendorsCode != null and vendorsCode != ''"> and vendors_code = #{vendorsCode}</if>
|
||||
<if test="serverid != null "> and serverid = #{serverid}</if>
|
||||
<if test="workerId != null "> and workerId = #{workerId}</if>
|
||||
<if test="attendanceOutTime!=null and attendanceOutTime!=''">
|
||||
and date(attendance_out_time) <=date(#{attendanceOutTime})
|
||||
</if>
|
||||
|
||||
<if test="teamId != null "> and teamId = #{teamId}</if>
|
||||
<if test="workTypeCode != null and workTypeCode != ''"> and workTypeCode = #{workTypeCode}</if>
|
||||
<if test="companyId != null "> and companyId = #{companyId}</if>
|
||||
<if test="companyTypeId!=null">
|
||||
<if test="companyTypeId>100">
|
||||
<if test="companyTypeId==101">
|
||||
and companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="companyTypeId==102">
|
||||
and companyTypeId =8
|
||||
</if>
|
||||
<if test="companyTypeId==103">
|
||||
and companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
</if>
|
||||
<if test="companyTypeId <100">
|
||||
and companyTypeId=#{companyTypeId}
|
||||
</if>
|
||||
</if>
|
||||
<if test="vendorId != null "> and vendorId = #{vendorId}</if>
|
||||
<if test="deviceCode != null and deviceCode != ''"> and device_code = #{deviceCode}</if>
|
||||
<if test="scanPhoto != null and scanPhoto != ''"> and scanPhoto like concat('%', #{scanPhoto}, '%')</if>
|
||||
<if test="workerName != null and workerName != ''"> and workerName like concat('%', #{workerName}, '%')</if>
|
||||
<if test="isDel != null "> and is_del = #{isDel}</if>
|
||||
<if test="attendanceTime != null and attendanceTime != ''"> and date(attendance_time) >= date(#{attendanceTime})</if>
|
||||
<if test="identification != null and identification != ''"> and identification = #{identification}</if>
|
||||
</where>
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
<select id="selectSurProjectAttendanceDataById" parameterType="Long" resultMap="SurProjectAttendanceDataResult">
|
||||
<include refid="selectSurProjectAttendanceDataVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSurProjectAttendanceData" parameterType="QuartzProjectAttendanceData" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sur_project_attendance_data_${year}
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="cfgid != null">cfgid,</if>
|
||||
<if test="appId != null">app_id,</if>
|
||||
<if test="projectId != null">projectId,</if>
|
||||
<if test="projectName != null">projectName,</if>
|
||||
<if test="deptId != null">deptId,</if>
|
||||
<if test="deptName != null">deptName,</if>
|
||||
<if test="vendorsCode != null">vendors_code,</if>
|
||||
<if test="serverid != null">serverid,</if>
|
||||
<if test="workerId != null">workerId,</if>
|
||||
<if test="workerName != null">workerName,</if>
|
||||
<if test="identification != null">identification,</if>
|
||||
<if test="workerPhoto != null">workerPhoto,</if>
|
||||
<if test="workerGender != null">workerGender,</if>
|
||||
<if test="birthDate != null">birthDate,</if>
|
||||
<if test="ethnic != null">ethnic,</if>
|
||||
<if test="nativePlace != null">nativePlace,</if>
|
||||
<if test="phone != null">phone,</if>
|
||||
<if test="workTypeName != null">workTypeName,</if>
|
||||
<if test="specWorkType != null">specWorkType,</if>
|
||||
<if test="groupName != null">groupName,</if>
|
||||
<if test="companyTypeId != null">companyTypeId,</if>
|
||||
<if test="companyName != null">companyName,</if>
|
||||
<if test="attendanceTime != null">attendance_time,</if>
|
||||
<if test="attendanceOutTime != null">attendance_out_time,</if>
|
||||
<if test="scanPhoto != null">scanPhoto,</if>
|
||||
<if test="teamId != null">teamId,</if>
|
||||
<if test="workTypeCode != null">workTypeCode,</if>
|
||||
<if test="companyId != null">companyId,</if>
|
||||
<if test="vendorId != null">vendorId,</if>
|
||||
<if test="deviceCode != null">device_code,</if>
|
||||
<if test="isDel != null">is_del,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="cfgid != null">#{cfgid},</if>
|
||||
<if test="appId != null">#{appId},</if>
|
||||
<if test="projectId != null">#{projectId},</if>
|
||||
<if test="projectName != null">#{projectName},</if>
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="deptName != null">#{deptName},</if>
|
||||
<if test="vendorsCode != null">#{vendorsCode},</if>
|
||||
<if test="serverid != null">#{serverid},</if>
|
||||
<if test="workerId != null">#{workerId},</if>
|
||||
<if test="workerName != null">#{workerName},</if>
|
||||
<if test="identification != null">#{identification},</if>
|
||||
<if test="workerPhoto != null">#{workerPhoto},</if>
|
||||
<if test="workerGender != null">#{workerGender},</if>
|
||||
<if test="birthDate != null">#{birthDate},</if>
|
||||
<if test="ethnic != null">#{ethnic},</if>
|
||||
<if test="nativePlace != null">#{nativePlace},</if>
|
||||
<if test="phone != null">#{phone},</if>
|
||||
<if test="workTypeName != null">#{workTypeName},</if>
|
||||
<if test="specWorkType != null">#{specWorkType},</if>
|
||||
<if test="groupName != null">#{groupName},</if>
|
||||
<if test="companyTypeId != null">#{companyTypeId},</if>
|
||||
<if test="companyName != null">#{companyName},</if>
|
||||
<if test="attendanceTime != null">#{attendanceTime},</if>
|
||||
<if test="attendanceOutTime != null">#{attendanceOutTime},</if>
|
||||
<if test="scanPhoto != null">#{scanPhoto},</if>
|
||||
<if test="teamId != null">#{teamId},</if>
|
||||
<if test="workTypeCode != null">#{workTypeCode},</if>
|
||||
<if test="companyId != null">#{companyId},</if>
|
||||
<if test="vendorId != null">#{vendorId},</if>
|
||||
<if test="deviceCode != null">#{deviceCode},</if>
|
||||
<if test="isDel != null">#{isDel},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSurProjectAttendanceData" parameterType="QuartzProjectAttendanceData">
|
||||
update sur_project_attendance_data_${year}
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="cfgid != null">cfgid = #{cfgid},</if>
|
||||
<if test="appId != null">app_id = #{appId},</if>
|
||||
<if test="projectId != null">projectId = #{projectId},</if>
|
||||
<if test="projectName != null">projectName = #{projectName},</if>
|
||||
<if test="deptId != null">deptId = #{deptId},</if>
|
||||
<if test="deptName != null">deptName = #{deptName},</if>
|
||||
<if test="vendorsCode != null">vendors_code = #{vendorsCode},</if>
|
||||
<if test="serverid != null">serverid = #{serverid},</if>
|
||||
<if test="workerId != null">workerId = #{workerId},</if>
|
||||
<if test="workerName != null">workerName = #{workerName},</if>
|
||||
<if test="identification != null">identification = #{identification},</if>
|
||||
<if test="workerPhoto != null">workerPhoto = #{workerPhoto},</if>
|
||||
<if test="workerGender != null">workerGender = #{workerGender},</if>
|
||||
<if test="birthDate != null">birthDate = #{birthDate},</if>
|
||||
<if test="ethnic != null">ethnic = #{ethnic},</if>
|
||||
<if test="nativePlace != null">nativePlace = #{nativePlace},</if>
|
||||
<if test="phone != null">phone = #{phone},</if>
|
||||
<if test="workTypeName != null">workTypeName = #{workTypeName},</if>
|
||||
<if test="specWorkType != null">specWorkType = #{specWorkType},</if>
|
||||
<if test="groupName != null">groupName = #{groupName},</if>
|
||||
<if test="companyTypeId != null">companyTypeId = #{companyTypeId},</if>
|
||||
<if test="companyName != null">companyName = #{companyName},</if>
|
||||
<if test="attendanceTime != null">attendance_time = #{attendanceTime},</if>
|
||||
<if test="attendanceOutTime != null">attendance_out_time = #{attendanceOutTime},</if>
|
||||
<if test="scanPhoto != null">scanPhoto = #{scanPhoto},</if>
|
||||
<if test="teamId != null">teamId = #{teamId},</if>
|
||||
<if test="workTypeCode != null">workTypeCode = #{workTypeCode},</if>
|
||||
<if test="companyId != null">companyId = #{companyId},</if>
|
||||
<if test="vendorId != null">vendorId = #{vendorId},</if>
|
||||
<if test="deviceCode != null">device_code = #{deviceCode},</if>
|
||||
<if test="isDel != null">is_del = #{isDel},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSurProjectAttendanceDataById" parameterType="Long">
|
||||
delete from sur_project_attendance_data_${year} where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSurProjectAttendanceDataByIds" parameterType="String">
|
||||
delete from sur_project_attendance_data_${year} where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSurProjectAttendanceDataByParams" parameterType="String">
|
||||
delete from sur_project_attendance_data_${year} where CONCAT(app_id,'-',serverid,'-',workerId) in
|
||||
<foreach collection="list" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchSurProjectAttendanceData">
|
||||
insert into sur_project_attendance_data_${year}( id, cfgid, app_id, projectId, projectName, deptId, deptName, vendors_code, serverid, workerId, workerName, identification, workerPhoto, workerGender, birthDate, ethnic, nativePlace, phone, workTypeName, specWorkType, groupName, companyTypeId,
|
||||
companyName, attendance_time, attendance_out_time, scanPhoto, teamId,workTypeCode, companyId, vendorId, device_code, is_del, create_by, create_time, update_by, update_time) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.id}, #{item.cfgid},#{item.appId}, #{item.projectId}, #{item.projectName}, #{item.deptId}, #{item.deptName}, #{item.vendorsCode}, #{item.serverid}, #{item.workerId}, #{item.workerName}, #{item.identification},#{item.workerPhoto}, #{item.workerGender}, #{item.birthDate},#{item.ethnic}, #{item.nativePlace}, #{item.phone}, #{item.workTypeName}, #{item.specWorkType}, #{item.groupName}, #{item.companyTypeId},
|
||||
#{item.companyName}, #{item.attendanceTime}, #{item.attendanceOutTime}, #{item.scanPhoto},#{item.teamId}, #{item.workTypeCode}, #{item.companyId}, #{item.vendorId}, #{item.deviceCode},#{item.isDel}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="getLastServerId" parameterType="QuartzProjectAttendanceData" resultType="Long">
|
||||
SELECT IF(MAX(serverid+0),MAX(serverid+0),0) serverid FROM sur_project_attendance_data_${year} WHERE cfgid=#{cfgid}
|
||||
</select>
|
||||
<select id="groupByComanyOld" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
select companyTypeId,count(1) id from ( <include refid="selectSurProjectAttendanceDataVo"/> ) x2 where id in (
|
||||
select min(id) from ( <include refid="selectSurProjectAttendanceDataVo"/> ) x1
|
||||
where date(attendance_time)=#{attendanceTime}
|
||||
<if test="subDeptId!=null and subDeptId>0"> and projectId in (
|
||||
SELECT id FROM pro_project_info WHERE is_del=0 AND dis_dept_id = #{subDeptId}
|
||||
)
|
||||
</if>
|
||||
<if test="prjIds !=null and prjIds.size()>0">
|
||||
and projectId in
|
||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="projectId!=null and projectId>0"> and projectId=#{projectId}</if>
|
||||
group by workerId )
|
||||
and companyTypeId in (1,2,3,4,5,6,8) group by companyTypeId
|
||||
</select>
|
||||
<select id="groupByComany" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
select g.companyTypeId,count(1) id from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g
|
||||
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
|
||||
and u.workerid in(
|
||||
SELECT workerid FROM sur_project_attendance_data WHERE DATE(attendance_time)=CURDATE()
|
||||
and cfgid in (select id from attendance_cfg
|
||||
<where>
|
||||
<if test="projectId!=null and projectId>0">
|
||||
and project_id=#{projectId}
|
||||
</if>
|
||||
<if test="subDeptId!=null and subDeptId>0">
|
||||
and project_id in (SELECT id FROM pro_project_info WHERE dis_dept_id=#{subDeptId})
|
||||
</if>
|
||||
<if test="prjIds !=null and prjIds.size()>0">
|
||||
and project_id in
|
||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
)
|
||||
)
|
||||
and g.companyTypeId in (1,2,3,4,5,6,8)
|
||||
|
||||
<if test="projectId!=null and projectId>0">
|
||||
and c.project_id=#{projectId}
|
||||
</if>
|
||||
<if test="subDeptId!=null and subDeptId>0">
|
||||
and c.project_id in (SELECT id FROM pro_project_info WHERE dis_dept_id=#{subDeptId})
|
||||
</if>
|
||||
<if test="prjIds !=null and prjIds.size()>0">
|
||||
and c.project_id in
|
||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
group by g.companyTypeId
|
||||
</select>
|
||||
|
||||
<select id="groupAllByComany" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
select g.companyTypeId,count(1) id
|
||||
from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g,
|
||||
pro_project_info sp
|
||||
where u.cfgid=c.id and u.companyId=g.companyId and u.state=#{id} and c.project_id = sp.id
|
||||
and sp.is_Del=0
|
||||
and g.companyTypeId in (0,1,2,3,4,5,6,8)
|
||||
<if test="projectId!=null and projectId>0">
|
||||
and c.project_id=#{projectId}
|
||||
</if>
|
||||
<if test="subDeptId!=null and subDeptId>0">
|
||||
and sp.dis_dept_id=#{subDeptId}
|
||||
</if>
|
||||
<if test='proType != null and proType != "" and proType != "0"'> and sp.project_Type = #{proType}</if>
|
||||
<if test="prjIds !=null and prjIds.size()>0">
|
||||
and c.project_id in
|
||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
group by g.companyTypeId
|
||||
</select>
|
||||
|
||||
<select id="getHuazhuPage" parameterType="QuartzProjectAttendanceData" resultType="Long">
|
||||
select max(vendorId) vendorId from sur_project_attendance_data_${year} WHERE cfgid=#{id}
|
||||
</select>
|
||||
|
||||
<select id="initOtherData" parameterType="map" resultType="map">
|
||||
select d.workerId,d.app_id,d.serverid,u.companyId,u.companyName,u.`name`,d.identification,u.recentPhoto,u.gender,u.birthDate,u.ethnic,u.nativePlace,u.phone,
|
||||
u.workTypeName,u.specWorkType,u.groupName,g.companyTypeId,d.teamId,u.workTypeCode,d.vendorId,d.device_code,d.scanPhoto,d.is_del
|
||||
from sur_project_attendance_data d
|
||||
left JOIN sur_project_attendance_user u on d.workerId = u.workerId and d.cfgid = u.cfgid
|
||||
left join sur_project_attendance_group g on u.companyId = g.companyId and g.cfgid = u.cfgid
|
||||
where d.cfgid=#{cfgid} and date(d.attendance_time) = #{date}
|
||||
GROUP BY d.workerId
|
||||
</select>
|
||||
|
||||
<select id="initHuaZhuData" parameterType="map" resultType="map">
|
||||
select d.workerId,d.app_id,d.serverid,u.companyId,u.companyName,u.`name`,d.identification,u.recentPhoto,u.gender,u.birthDate,u.ethnic,u.nativePlace,u.phone,
|
||||
u.workTypeName,u.specWorkType,u.groupName,d.teamId,u.workTypeCode,d.vendorId,d.device_code,d.scanPhoto,d.is_del,
|
||||
CASE WHEN sd.dept_type = 2 THEN '1' WHEN sd.dept_type = 3 THEN '2' WHEN sd.dept_type = 4 THEN '8' else '0' end as companyTypeId
|
||||
from sur_project_attendance_data d
|
||||
left JOIN sur_project_attendance_user u on d.workerId = u.workerId and d.cfgid = u.cfgid
|
||||
left join sys_dept sd on u.companyName = sd.dept_name
|
||||
where d.cfgid=#{cfgid} and date(d.attendance_time) = #{date}
|
||||
GROUP BY d.workerId
|
||||
</select>
|
||||
|
||||
<select id="findHuaZhuCompanyType" parameterType="string" resultType="string">
|
||||
select CASE WHEN sd.type_flag = 2 THEN '1' WHEN sd.type_flag = 3 THEN '2' WHEN sd.type_flag = 4 THEN '8' else '0' end as companyTypeId
|
||||
from sys_dept sd
|
||||
where sd.dept_name = #{deptName}
|
||||
</select>
|
||||
|
||||
<select id="todayAttendance" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
select ady.* from sur_project_attendance_data_${year} ady
|
||||
left join pro_project_info sp on sp.id = ady.projectId
|
||||
where sp.is_Del=0
|
||||
<if test="projectId!=null and projectId>0">
|
||||
and ady.projectId=#{projectId}
|
||||
</if>
|
||||
<if test="id==1">
|
||||
and ady.companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="id==2">
|
||||
and ady.companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
<if test="id==8">
|
||||
and ady.companyTypeId =8
|
||||
</if>
|
||||
<if test="deptId!=null and deptId>0">
|
||||
and sp.dis_dept_id=#{deptId}
|
||||
</if>
|
||||
<if test='proType != null and proType != "" and proType != "0"'> and sp.project_Type = #{proType}</if>
|
||||
<if test="prjIds !=null and prjIds.size()>0">
|
||||
and ady.projectId in
|
||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="attendanceTime != null and attendanceTime != ''"> and date(ady.attendance_time) =date(#{attendanceTime})</if>
|
||||
</select>
|
||||
|
||||
<select id="attendanceDataList" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
select ady.* from sur_project_attendance_data_${year} ady
|
||||
where ady.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||
<if test="companyTypeId==101">
|
||||
and ady.companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="companyTypeId==103">
|
||||
and ady.companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
<if test="companyTypeId==102">
|
||||
and ady.companyTypeId =8
|
||||
</if>
|
||||
<if test="workerId != null and workerId != ''"> and ady.workerId = #{workerId}</if>
|
||||
<if test="workerName != null and workerName != ''"> and ady.workerName like concat('%', #{workerName}, '%')</if>
|
||||
<if test="attendanceTime != null and attendanceTime != ''"> and date(ady.attendance_time) = date(#{attendanceTime})</if>
|
||||
and ady.is_del=0
|
||||
order by ady.id desc
|
||||
</select>
|
||||
|
||||
<select id="groupTodayCompanyTypeId" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
select ady.companyTypeId,count(1) id from sur_project_attendance_data_${year} ady
|
||||
where ady.cfgid in (select id from attendance_cfg where
|
||||
is_del=0
|
||||
<if test="projectId!=null and projectId>0">
|
||||
and projectId=#{projectId}
|
||||
</if>
|
||||
and projectId in (select id from pro_project_info sp where sp.is_Del=0
|
||||
|
||||
<if test="deptId!=null and deptId>0">
|
||||
and sp.dis_dept_id=#{deptId}
|
||||
</if>
|
||||
<if test="attendanceTime != null and attendanceTime != ''"> and date(ady.attendance_time) =date(#{attendanceTime})</if>
|
||||
|
||||
<if test='proType != null and proType != "" and proType != "0"'> and sp.project_type = #{proType}</if>
|
||||
<if test="prjIds !=null and prjIds.size()>0">
|
||||
and ady.projectId in
|
||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
group by ady.companyTypeId
|
||||
</select>
|
||||
|
||||
<select id="findGroupAllByParams" parameterType="QuartzProjectAttendanceData" resultType="Map">
|
||||
select '1' as type,g.companyTypeId,count(1) as total
|
||||
from sur_project_attendance_user u
|
||||
left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId
|
||||
where u.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||
and g.companyTypeId in (0,1,2,3,4,5,6,8)
|
||||
and u.state=0
|
||||
group by g.companyTypeId
|
||||
UNION ALL
|
||||
select '2' as type,g.companyTypeId,count(1) as total
|
||||
from sur_project_attendance_user u
|
||||
left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId
|
||||
where u.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||
and g.companyTypeId in (0,1,2,3,4,5,6,8)
|
||||
and u.state=1
|
||||
group by g.companyTypeId
|
||||
UNION ALL
|
||||
select '3' as type, d.companyTypeId,count(1) as total from sur_project_attendance_data_${year} d
|
||||
where d.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||
and d.is_del=0
|
||||
and date(d.attendance_time) = date(now())
|
||||
group by d.companyTypeId
|
||||
</select>
|
||||
|
||||
<select id="groupDataByParams" parameterType="QuartzProjectAttendanceData" resultType="Map">
|
||||
select d.companyTypeId,count(1) as total from sur_project_attendance_data_${year} d
|
||||
where d.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||
and d.is_del=0
|
||||
<if test="attendanceTime != null and attendanceTime != ''"> and date(d.attendance_time) = date(#{attendanceTime})</if>
|
||||
<if test="workerName != null and workerName != ''"> and d.workerName like concat('%', #{workerName}, '%')</if>
|
||||
group by d.companyTypeId
|
||||
</select>
|
||||
|
||||
<select id="findGroupAllByDays" parameterType="QuartzProjectAttendanceData" resultType="Map">
|
||||
select '3' as type, DATE_FORMAT(days.attendanceTime, '%m-%d') as attendanceTime,days.total from(
|
||||
select date(d.attendance_time) as attendanceTime, DATE_FORMAT(d.attendance_time, '%m-%d'),count(1) as total from sur_project_attendance_data_${year} d
|
||||
where d.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||
and d.is_del=0
|
||||
and date(d.attendance_time) between #{attendanceTime} and #{attendanceOutTime}
|
||||
group by date(d.attendance_time)
|
||||
order by date(d.attendance_time)
|
||||
)days
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,233 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yanzhu.job.mapper.QuartzProjectAttendanceGroupMapper">
|
||||
|
||||
<resultMap type="QuartzProjectAttendanceGroup" id="SurProjectAttendanceGroupResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="cfgid" column="cfgid" />
|
||||
<result property="appId" column="app_id" />
|
||||
<result property="serverid" column="serverid" />
|
||||
<result property="bizLicense" column="bizLicense" />
|
||||
<result property="companyCode" column="companyCode" />
|
||||
<result property="companyId" column="companyId" />
|
||||
<result property="companyName" column="companyName" />
|
||||
<result property="companyTypeId" column="companyTypeId" />
|
||||
<result property="vendorId" column="vendorId" />
|
||||
<result property="name" column="name" />
|
||||
<result property="leaderName" column="leaderName" />
|
||||
<result property="leaderPhone" column="leaderPhone" />
|
||||
<result property="teamId" column="teamId" />
|
||||
<result property="teamName" column="teamName" />
|
||||
<result property="type" column="type" />
|
||||
<result property="leaderId" column="leaderId" />
|
||||
<result property="deleted" column="deleted" />
|
||||
<result property="createTimestamp" column="createTimestamp" />
|
||||
<result property="platformGroupId" column="platformGroupId" />
|
||||
<result property="platformTeamId" column="platformTeamId" />
|
||||
<result property="enterDate" column="enterDate" />
|
||||
<result property="exitDate" column="exitDate" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="isDel" column="is_del" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSurProjectAttendanceGroupVo">
|
||||
select id, cfgid, app_id, serverid, bizLicense, companyCode, companyId, companyName, companyTypeId, vendorId, name, leaderName, leaderPhone, teamId, teamName, type, leaderId, deleted, createTimestamp, platformGroupId, platformTeamId, enterDate, exitDate, remark, is_del, create_by, create_time, update_by, update_time
|
||||
from view_sur_project_attendance_group
|
||||
</sql>
|
||||
|
||||
<select id="selectSurProjectAttendanceGroupViewList" parameterType="QuartzProjectAttendanceGroup" resultMap="SurProjectAttendanceGroupResult">
|
||||
<include refid="selectSurProjectAttendanceGroupVo"/>
|
||||
<where>
|
||||
<if test="cfgid != null "> and cfgid = #{cfgid}</if>
|
||||
<if test="appId != null "> and app_id = #{appId}</if>
|
||||
<if test="serverid != null "> and serverid = #{serverid}</if>
|
||||
<if test="bizLicense != null and bizLicense != ''"> and bizLicense = #{bizLicense}</if>
|
||||
<if test="companyCode != null and companyCode != ''"> and companyCode = #{companyCode}</if>
|
||||
<if test="companyId != null "> and companyId = #{companyId}</if>
|
||||
<if test="companyName != null and companyName != ''"> and companyName like concat('%', #{companyName}, '%')</if>
|
||||
<if test="companyTypeId != null and companyTypeId != ''"> and companyTypeId = #{companyTypeId}</if>
|
||||
<if test="vendorId != null "> and vendorId = #{vendorId}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="leaderName != null and leaderName != ''"> and leaderName like concat('%', #{leaderName}, '%')</if>
|
||||
<if test="leaderPhone != null and leaderPhone != ''"> and leaderPhone = #{leaderPhone}</if>
|
||||
<if test="teamId != null "> and teamId = #{teamId}</if>
|
||||
<if test="teamName != null and teamName != ''"> and teamName like concat('%', #{teamName}, '%')</if>
|
||||
<if test="type != null "> and type = #{type}</if>
|
||||
<if test="leaderId != null "> and leaderId = #{leaderId}</if>
|
||||
<if test="deleted != null "> and deleted = #{deleted}</if>
|
||||
<if test="createTime != null "> and create_Time = #{createTime}</if>
|
||||
<if test="platformGroupId != null "> and platformGroupId = #{platformGroupId}</if>
|
||||
<if test="platformTeamId != null "> and platformTeamId = #{platformTeamId}</if>
|
||||
<if test="enterDate != null "> and enterDate = #{enterDate}</if>
|
||||
<if test="exitDate != null "> and exitDate = #{exitDate}</if>
|
||||
<if test="isDel != null "> and is_del = #{isDel}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSurProjectAttendanceGroupList" parameterType="QuartzProjectAttendanceGroup" resultMap="SurProjectAttendanceGroupResult">
|
||||
select id, cfgid, app_id, serverid, bizLicense, companyCode, companyId, companyName, companyTypeId, vendorId, name, leaderName, leaderPhone, teamId, teamName, type, leaderId, deleted, createTimestamp, platformGroupId, platformTeamId, enterDate, exitDate, remark, is_del, create_by, create_time, update_by, update_time
|
||||
from sur_project_attendance_group
|
||||
<where>
|
||||
<if test="cfgid != null "> and cfgid = #{cfgid}</if>
|
||||
<if test="appId != null "> and app_id = #{appId}</if>
|
||||
<if test="serverid != null "> and serverid = #{serverid}</if>
|
||||
<if test="bizLicense != null and bizLicense != ''"> and bizLicense = #{bizLicense}</if>
|
||||
<if test="companyCode != null and companyCode != ''"> and companyCode = #{companyCode}</if>
|
||||
<if test="companyId != null "> and companyId = #{companyId}</if>
|
||||
<if test="companyName != null and companyName != ''"> and companyName like concat('%', #{companyName}, '%')</if>
|
||||
<if test="companyTypeId != null and companyTypeId != ''"> and companyTypeId = #{companyTypeId}</if>
|
||||
<if test="vendorId != null "> and vendorId = #{vendorId}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="leaderName != null and leaderName != ''"> and leaderName like concat('%', #{leaderName}, '%')</if>
|
||||
<if test="leaderPhone != null and leaderPhone != ''"> and leaderPhone = #{leaderPhone}</if>
|
||||
<if test="teamId != null "> and teamId = #{teamId}</if>
|
||||
<if test="teamName != null and teamName != ''"> and teamName like concat('%', #{teamName}, '%')</if>
|
||||
<if test="type != null "> and type = #{type}</if>
|
||||
<if test="leaderId != null "> and leaderId = #{leaderId}</if>
|
||||
<if test="deleted != null "> and deleted = #{deleted}</if>
|
||||
<if test="createTime != null "> and create_Time = #{createTime}</if>
|
||||
<if test="platformGroupId != null "> and platformGroupId = #{platformGroupId}</if>
|
||||
<if test="platformTeamId != null "> and platformTeamId = #{platformTeamId}</if>
|
||||
<if test="enterDate != null "> and enterDate = #{enterDate}</if>
|
||||
<if test="exitDate != null "> and exitDate = #{exitDate}</if>
|
||||
<if test="isDel != null "> and is_del = #{isDel}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSurProjectAttendanceGroupById" parameterType="Long" resultMap="SurProjectAttendanceGroupResult">
|
||||
<include refid="selectSurProjectAttendanceGroupVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSurProjectAttendanceGroup" parameterType="QuartzProjectAttendanceGroup" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sur_project_attendance_group
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="cfgid != null">cfgid,</if>
|
||||
<if test="appId != null">app_id,</if>
|
||||
<if test="serverid != null">serverid,</if>
|
||||
<if test="bizLicense != null">bizLicense,</if>
|
||||
<if test="companyCode != null">companyCode,</if>
|
||||
<if test="companyId != null">companyId,</if>
|
||||
<if test="companyName != null">companyName,</if>
|
||||
<if test="companyTypeId != null">companyTypeId,</if>
|
||||
<if test="vendorId != null">vendorId,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="leaderName != null">leaderName,</if>
|
||||
<if test="leaderPhone != null">leaderPhone,</if>
|
||||
<if test="teamId != null">teamId,</if>
|
||||
<if test="teamName != null">teamName,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="leaderId != null">leaderId,</if>
|
||||
<if test="deleted != null">deleted,</if>
|
||||
<if test="createTimestamp != null">createTimestamp,</if>
|
||||
<if test="platformGroupId != null">platformGroupId,</if>
|
||||
<if test="platformTeamId != null">platformTeamId,</if>
|
||||
<if test="enterDate != null">enterDate,</if>
|
||||
<if test="exitDate != null">exitDate,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="isDel != null">is_del,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="cfgid != null">#{cfgid},</if>
|
||||
<if test="appId != null">#{appId},</if>
|
||||
<if test="serverid != null">#{serverid},</if>
|
||||
<if test="bizLicense != null">#{bizLicense},</if>
|
||||
<if test="companyCode != null">#{companyCode},</if>
|
||||
<if test="companyId != null">#{companyId},</if>
|
||||
<if test="companyName != null">#{companyName},</if>
|
||||
<if test="companyTypeId != null">#{companyTypeId},</if>
|
||||
<if test="vendorId != null">#{vendorId},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="leaderName != null">#{leaderName},</if>
|
||||
<if test="leaderPhone != null">#{leaderPhone},</if>
|
||||
<if test="teamId != null">#{teamId},</if>
|
||||
<if test="teamName != null">#{teamName},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="leaderId != null">#{leaderId},</if>
|
||||
<if test="deleted != null">#{deleted},</if>
|
||||
<if test="createTimestamp != null">#{createTimestamp},</if>
|
||||
<if test="platformGroupId != null">#{platformGroupId},</if>
|
||||
<if test="platformTeamId != null">#{platformTeamId},</if>
|
||||
<if test="enterDate != null">#{enterDate},</if>
|
||||
<if test="exitDate != null">#{exitDate},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="isDel != null">#{isDel},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSurProjectAttendanceGroup" parameterType="QuartzProjectAttendanceGroup">
|
||||
update sur_project_attendance_group
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="cfgid != null">cfgid = #{cfgid},</if>
|
||||
<if test="appId != null">app_id = #{appId},</if>
|
||||
<if test="serverid != null">serverid = #{serverid},</if>
|
||||
<if test="bizLicense != null">bizLicense = #{bizLicense},</if>
|
||||
<if test="companyCode != null">companyCode = #{companyCode},</if>
|
||||
<if test="companyId != null">companyId = #{companyId},</if>
|
||||
<if test="companyName != null">companyName = #{companyName},</if>
|
||||
<if test="companyTypeId != null">companyTypeId = #{companyTypeId},</if>
|
||||
<if test="vendorId != null">vendorId = #{vendorId},</if>
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="leaderName != null">leaderName = #{leaderName},</if>
|
||||
<if test="leaderPhone != null">leaderPhone = #{leaderPhone},</if>
|
||||
<if test="teamId != null">teamId = #{teamId},</if>
|
||||
<if test="teamName != null">teamName = #{teamName},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="leaderId != null">leaderId = #{leaderId},</if>
|
||||
<if test="deleted != null">deleted = #{deleted},</if>
|
||||
<if test="createTimestamp != null">createTimestamp = #{createTimestamp},</if>
|
||||
<if test="platformGroupId != null">platformGroupId = #{platformGroupId},</if>
|
||||
<if test="platformTeamId != null">platformTeamId = #{platformTeamId},</if>
|
||||
<if test="enterDate != null">enterDate = #{enterDate},</if>
|
||||
<if test="exitDate != null">exitDate = #{exitDate},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="isDel != null">is_del = #{isDel},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSurProjectAttendanceGroupById" parameterType="Long">
|
||||
delete from sur_project_attendance_group where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSurProjectAttendanceGroupByIds" parameterType="String">
|
||||
delete from sur_project_attendance_group where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSurProjectAttendanceGroupByParams" parameterType="String">
|
||||
delete from sur_project_attendance_group where CONCAT(app_id,'-',serverid) in
|
||||
<foreach collection="list" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchSurProjectAttendanceGroup">
|
||||
insert into sur_project_attendance_group(id,cfgid,app_id,serverid,bizLicense,companyCode,companyId,companyName,companyTypeId,vendorId,name,leaderName,leaderPhone,teamId,teamName,type,leaderId,deleted,createTimestamp,platformGroupId,platformTeamId,enterDate,exitDate,remark,create_by,create_time,update_by,update_time) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.id}, #{item.cfgid}, #{item.appId}, #{item.serverid}, #{item.bizLicense}, #{item.companyCode}, #{item.companyId}, #{item.companyName},#{item.companyTypeId}, #{item.vendorId}, #{item.name}, #{item.leaderName}, #{item.leaderPhone}, #{item.teamId}, #{item.teamName}, #{item.type}, #{item.leaderId}, #{item.deleted}, #{item.createTimestamp}, #{item.platformGroupId}, #{item.platformTeamId}, #{item.enterDate},
|
||||
#{item.exitDate}, #{item.remark}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,753 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yanzhu.job.mapper.QuartzProjectAttendanceUserMapper">
|
||||
|
||||
<resultMap type="QuartzProjectAttendanceUser" id="SurProjectAttendanceUserResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="cfgid" column="cfgid" />
|
||||
<result property="appId" column="app_id" />
|
||||
<result property="vendorsCode" column="vendors_code" />
|
||||
<result property="workerId" column="workerId" />
|
||||
<result property="laborWorkerId" column="laborWorkerId" />
|
||||
<result property="workerCategory" column="workerCategory" />
|
||||
<result property="qrCode" column="qrCode" />
|
||||
<result property="name" column="name" />
|
||||
<result property="idCardNo" column="idCardNo" />
|
||||
<result property="idTypeName" column="idTypeName" />
|
||||
<result property="ethnic" column="ethnic" />
|
||||
<result property="nativePlace" column="nativePlace" />
|
||||
<result property="gender" column="gender" />
|
||||
<result property="birthDate" column="birthDate" />
|
||||
<result property="phone" column="phone" />
|
||||
<result property="degreeName" column="degreeName" />
|
||||
<result property="photo" column="photo" />
|
||||
<result property="recentPhoto" column="recentPhoto" />
|
||||
<result property="groupId" column="groupId" />
|
||||
<result property="groupName" column="groupName" />
|
||||
<result property="leader" column="leader" />
|
||||
<result property="workTypeCode" column="workTypeCode" />
|
||||
<result property="workTypeName" column="workTypeName" />
|
||||
<result property="specWorkType" column="specWorkType" />
|
||||
<result property="hatCode" column="hatCode" />
|
||||
<result property="state" column="state" />
|
||||
<result property="enterDate" column="enterDate" />
|
||||
<result property="exitDate" column="exitDate" />
|
||||
<result property="companyId" column="companyId" />
|
||||
<result property="companyName" column="companyName" />
|
||||
<result property="vendorId" column="vendorId" />
|
||||
<result property="teamId" column="teamId" />
|
||||
<result property="teamName" column="teamName" />
|
||||
<result property="enterType" column="enterType" />
|
||||
<result property="other" column="other" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="isDel" column="is_del" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="projectId" column="project_id"/>
|
||||
<result property="subDeptId" column="sub_dept_id"/>
|
||||
<result property="companyTypeId" column="companyTypeId"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSurProjectAttendanceUserVo">
|
||||
SELECT * FROM (
|
||||
SELECT a.*,b.project_id,b.dept_id
|
||||
FROM sur_project_attendance_user a,attendance_cfg b
|
||||
WHERE a.cfgid=b.id )
|
||||
sur_project_attendance_user
|
||||
</sql>
|
||||
<select id="selectSurProjectAttendanceUserListJgw" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
SELECT u.id,u.cfgid,u.app_id,u.vendors_code,u.workerId,u.laborWorkerId,u.workerCategory,u.qrCode,u.name,
|
||||
u.ethnic,u.nativePlace,u.gender,u.birthDate,u.phone,u.degreeName,u.photo,u.recentPhoto,
|
||||
u.groupId,u.leader,u.workTypeCode,u.specWorkType,u.idCardNo,u.idTypeName,
|
||||
u.hatCode,u.state,u.enterDate,u.exitDate,u.companyId,u.vendorId,
|
||||
u.teamId,u.teamName,u.enterType,u.is_del,u.create_by,u.create_time,u.update_by,u.update_time,
|
||||
c.project_id,c.dept_id,u.companyName,u.workTypeName,g.teamname groupName,g.companyName remark
|
||||
FROM sur_project_attendance_user u,attendance_cfg c,sur_project_attendance_group g
|
||||
WHERE u.cfgid=c.id AND g.companyid=u.companyid AND u.vendors_code='jgw'
|
||||
<if test="companyTypeId!=null">
|
||||
<if test="companyTypeId>100">
|
||||
<if test="companyTypeId==101">
|
||||
and g.companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="companyTypeId==102">
|
||||
and g.companyTypeId =8
|
||||
</if>
|
||||
<if test="companyTypeId==103">
|
||||
and g.companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
</if>
|
||||
<if test="companyTypeId <100">
|
||||
and g.companyTypeId=#{companyTypeId}
|
||||
</if>
|
||||
</if>
|
||||
<if test="cfgid != null "> and u.cfgid = #{cfgid}</if>
|
||||
<if test="appId != null "> and u.app_id = #{appId}</if>
|
||||
<if test="vendorsCode != null and vendorsCode != ''"> and u.vendors_code = #{vendorsCode}</if>
|
||||
<if test="workerId != null "> and u.workerId = #{workerId}</if>
|
||||
<if test="laborWorkerId != null "> and u.laborWorkerId = #{laborWorkerId}</if>
|
||||
<if test="workerCategory != null "> and u.workerCategory = #{workerCategory}</if>
|
||||
<if test="qrCode != null "> and u.qrCode = #{qrCode}</if>
|
||||
<if test="name != null and name != ''"> and u.name like concat('%', #{name}, '%')</if>
|
||||
<if test="idCardNo != null and idCardNo != ''"> and u.idCardNo = #{idCardNo}</if>
|
||||
<if test="ethnic != null and ethnic != ''"> and u.ethnic = #{ethnic}</if>
|
||||
<if test="nativePlace != null and nativePlace != ''"> and u.nativePlace = #{nativePlace}</if>
|
||||
<if test="gender != null "> and u.gender = #{gender}</if>
|
||||
<if test="birthDate != null "> and u.birthDate = #{birthDate}</if>
|
||||
<if test="phone != null and phone != ''"> and u.phone = #{phone}</if>
|
||||
<if test="degreeName != null and degreeName != ''"> and u.degreeName like concat('%', #{degreeName}, '%')</if>
|
||||
<if test="photo != null and photo != ''"> and u.photo = #{photo}</if>
|
||||
<if test="recentPhoto != null and recentPhoto != ''"> and u.recentPhoto = #{recentPhoto}</if>
|
||||
<if test="groupId != null "> and u.groupId = #{groupId}</if>
|
||||
<if test="groupName != null and groupName != ''"> and u.groupName like concat('%', #{groupName}, '%')</if>
|
||||
<if test="leader != null "> and u.leader = #{leader}</if>
|
||||
<if test="workTypeCode != null and workTypeCode != ''"> and u.workTypeCode = #{workTypeCode}</if>
|
||||
<if test="workTypeName != null and workTypeName != ''"> and u.workTypeName like concat('%', #{workTypeName}, '%')</if>
|
||||
<if test="specWorkType != null "> and u.specWorkType = #{specWorkType}</if>
|
||||
<if test="hatCode != null and hatCode != ''"> and u.hatCode = #{hatCode}</if>
|
||||
<if test="state != null "> and u.state = #{state}</if>
|
||||
<if test="enterDate != null and enterDate != ''"> and u.enterDate = #{enterDate}</if>
|
||||
<if test="exitDate != null and exitDate != ''"> and u.exitDate = #{exitDate}</if>
|
||||
<if test="companyId != null "> and u.companyId = #{companyId}</if>
|
||||
<if test="companyName != null and companyName != ''"> and u.companyName like concat('%', #{companyName}, '%')</if>
|
||||
<if test="vendorId != null "> and u.vendorId = #{vendorId}</if>
|
||||
<if test="teamId != null "> and u.teamId = #{teamId}</if>
|
||||
<if test="teamName != null and teamName != ''"> and u.teamName like concat('%', #{teamName}, '%')</if>
|
||||
<if test="enterType != null and enterType != ''"> and u.enterType = #{enterType}</if>
|
||||
<if test="other != null and other != ''"> and u.other = #{other}</if>
|
||||
<if test="projectId != null and projectId > 0 "> and c.project_id = #{projectId}</if>
|
||||
<if test="subDeptId != null and subDeptId >0 "> and c.dept_id = #{subDeptId}</if>
|
||||
<if test="isDel != null "> and u.is_del = #{isDel}</if>
|
||||
</select>
|
||||
|
||||
<select id="querySurProjectAttendanceUserList" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
SELECT * FROM (
|
||||
SELECT a.id,
|
||||
a.cfgid,
|
||||
a.app_id,
|
||||
a.vendors_code,
|
||||
a.workerId,
|
||||
a.laborWorkerId,
|
||||
a.workerCategory,
|
||||
a.qrCode,
|
||||
a.name,
|
||||
a.idCardNo,
|
||||
a.idTypeName,
|
||||
a.ethnic,
|
||||
a.nativePlace,
|
||||
a.gender,
|
||||
a.birthDate,
|
||||
a.phone,
|
||||
a.degreeName,
|
||||
a.photo,
|
||||
a.recentPhoto,
|
||||
a.groupId,
|
||||
a.groupName,
|
||||
a.leader,
|
||||
a.workTypeCode,
|
||||
a.workTypeName,
|
||||
a.specWorkType,
|
||||
a.hatCode,
|
||||
a.state,
|
||||
a.enterDate,
|
||||
a.exitDate,
|
||||
a.companyId,
|
||||
a.companyName,
|
||||
a.vendorId,
|
||||
a.teamId,
|
||||
a.teamName,
|
||||
a.enterType,
|
||||
a.other,
|
||||
a.is_del,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,b.project_id,b.dept_id,g.companyTypeId,g.companyName as remark
|
||||
FROM sur_project_attendance_user a,attendance_cfg b,view_sur_project_attendance_group g
|
||||
WHERE a.cfgid=b.id and a.companyId=g.companyId and g.id in(select min(id) from view_sur_project_attendance_group group by companyid)
|
||||
)
|
||||
sur_project_attendance_user
|
||||
<where>
|
||||
<if test="companyTypeId!=null">
|
||||
<if test="companyTypeId>100">
|
||||
<if test="companyTypeId==101">
|
||||
and companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="companyTypeId==102">
|
||||
and companyTypeId =8
|
||||
</if>
|
||||
<if test="companyTypeId==103">
|
||||
and companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
</if>
|
||||
<if test="companyTypeId <100">
|
||||
and companyTypeId=#{companyTypeId}
|
||||
</if>
|
||||
</if>
|
||||
<if test="cfgid != null "> and cfgid = #{cfgid}</if>
|
||||
<if test="appId != null "> and app_id = #{appId}</if>
|
||||
<if test="vendorsCode != null and vendorsCode != ''"> and vendors_code = #{vendorsCode}</if>
|
||||
<if test="workerId != null "> and workerId = #{workerId}</if>
|
||||
<if test="laborWorkerId != null "> and laborWorkerId = #{laborWorkerId}</if>
|
||||
<if test="workerCategory != null "> and workerCategory = #{workerCategory}</if>
|
||||
<if test="qrCode != null "> and qrCode = #{qrCode}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="idCardNo != null and idCardNo != ''"> and idCardNo = #{idCardNo}</if>
|
||||
<if test="ethnic != null and ethnic != ''"> and ethnic = #{ethnic}</if>
|
||||
<if test="nativePlace != null and nativePlace != ''"> and nativePlace = #{nativePlace}</if>
|
||||
<if test="gender != null "> and gender = #{gender}</if>
|
||||
<if test="birthDate != null "> and birthDate = #{birthDate}</if>
|
||||
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
||||
<if test="degreeName != null and degreeName != ''"> and degreeName like concat('%', #{degreeName}, '%')</if>
|
||||
<if test="photo != null and photo != ''"> and photo = #{photo}</if>
|
||||
<if test="recentPhoto != null and recentPhoto != ''"> and recentPhoto = #{recentPhoto}</if>
|
||||
<if test="groupId != null "> and groupId = #{groupId}</if>
|
||||
<if test="groupName != null and groupName != ''"> and groupName like concat('%', #{groupName}, '%')</if>
|
||||
<if test="leader != null "> and leader = #{leader}</if>
|
||||
<if test="workTypeCode != null and workTypeCode != ''"> and workTypeCode = #{workTypeCode}</if>
|
||||
<if test="workTypeName != null and workTypeName != ''"> and workTypeName like concat('%', #{workTypeName}, '%')</if>
|
||||
<if test="specWorkType != null "> and specWorkType = #{specWorkType}</if>
|
||||
<if test="hatCode != null and hatCode != ''"> and hatCode = #{hatCode}</if>
|
||||
<if test="state != null "> and state = #{state}</if>
|
||||
<if test="enterDate != null and enterDate != ''"> and enterDate = #{enterDate}</if>
|
||||
<if test="exitDate != null and exitDate != ''"> and exitDate = #{exitDate}</if>
|
||||
<if test="companyId != null "> and companyId = #{companyId}</if>
|
||||
<if test="companyName != null and companyName != ''"> and companyName like concat('%', #{companyName}, '%')</if>
|
||||
<if test="vendorId != null "> and vendorId = #{vendorId}</if>
|
||||
<if test="teamId != null "> and teamId = #{teamId}</if>
|
||||
<if test="teamName != null and teamName != ''"> and teamName like concat('%', #{teamName}, '%')</if>
|
||||
<if test="enterType != null and enterType != ''"> and enterType = #{enterType}</if>
|
||||
<if test="other != null and other != ''"> and other = #{other}</if>
|
||||
<if test="projectId != null and projectId > 0 "> and project_id = #{projectId}</if>
|
||||
<if test="subDeptId != null and subDeptId >0 "> and dept_id = #{subDeptId}</if>
|
||||
<if test="isDel != null "> and is_del = #{isDel}</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectSurProjectAttendanceUserList" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
<include refid="selectSurProjectAttendanceUserVo"/>
|
||||
<where>
|
||||
<if test="companyTypeId!=null">
|
||||
<if test="companyTypeId>100">
|
||||
<if test="companyTypeId==101">
|
||||
and companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="companyTypeId==102">
|
||||
and companyTypeId =8
|
||||
</if>
|
||||
<if test="companyTypeId==103">
|
||||
and companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
</if>
|
||||
<if test="companyTypeId <100">
|
||||
and companyTypeId=#{companyTypeId}
|
||||
</if>
|
||||
</if>
|
||||
<if test="cfgid != null "> and cfgid = #{cfgid}</if>
|
||||
<if test="appId != null "> and app_id = #{appId}</if>
|
||||
<if test="vendorsCode != null and vendorsCode != ''"> and vendors_code = #{vendorsCode}</if>
|
||||
<if test="workerId != null "> and workerId = #{workerId}</if>
|
||||
<if test="laborWorkerId != null "> and laborWorkerId = #{laborWorkerId}</if>
|
||||
<if test="workerCategory != null "> and workerCategory = #{workerCategory}</if>
|
||||
<if test="qrCode != null "> and qrCode = #{qrCode}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="idCardNo != null and idCardNo != ''"> and idCardNo = #{idCardNo}</if>
|
||||
<if test="ethnic != null and ethnic != ''"> and ethnic = #{ethnic}</if>
|
||||
<if test="nativePlace != null and nativePlace != ''"> and nativePlace = #{nativePlace}</if>
|
||||
<if test="gender != null "> and gender = #{gender}</if>
|
||||
<if test="birthDate != null "> and birthDate = #{birthDate}</if>
|
||||
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
||||
<if test="degreeName != null and degreeName != ''"> and degreeName like concat('%', #{degreeName}, '%')</if>
|
||||
<if test="photo != null and photo != ''"> and photo = #{photo}</if>
|
||||
<if test="recentPhoto != null and recentPhoto != ''"> and recentPhoto = #{recentPhoto}</if>
|
||||
<if test="groupId != null "> and groupId = #{groupId}</if>
|
||||
<if test="groupName != null and groupName != ''"> and groupName like concat('%', #{groupName}, '%')</if>
|
||||
<if test="leader != null "> and leader = #{leader}</if>
|
||||
<if test="workTypeCode != null and workTypeCode != ''"> and workTypeCode = #{workTypeCode}</if>
|
||||
<if test="workTypeName != null and workTypeName != ''"> and workTypeName like concat('%', #{workTypeName}, '%')</if>
|
||||
<if test="specWorkType != null "> and specWorkType = #{specWorkType}</if>
|
||||
<if test="hatCode != null and hatCode != ''"> and hatCode = #{hatCode}</if>
|
||||
<if test="state != null "> and state = #{state}</if>
|
||||
<if test="enterDate != null and enterDate != ''"> and enterDate = #{enterDate}</if>
|
||||
<if test="exitDate != null and exitDate != ''"> and exitDate = #{exitDate}</if>
|
||||
<if test="companyId != null "> and companyId = #{companyId}</if>
|
||||
<if test="companyName != null and companyName != ''"> and companyName like concat('%', #{companyName}, '%')</if>
|
||||
<if test="vendorId != null "> and vendorId = #{vendorId}</if>
|
||||
<if test="teamId != null "> and teamId = #{teamId}</if>
|
||||
<if test="teamName != null and teamName != ''"> and teamName like concat('%', #{teamName}, '%')</if>
|
||||
<if test="enterType != null and enterType != ''"> and enterType = #{enterType}</if>
|
||||
<if test="other != null and other != ''"> and other = #{other}</if>
|
||||
<if test="projectId != null and projectId > 0 "> and project_id = #{projectId}</if>
|
||||
<if test="subDeptId != null and subDeptId >0 "> and dept_id = #{subDeptId}</if>
|
||||
<if test="isDel != null "> and is_del = #{isDel}</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectSurProjectAttendanceUserById" parameterType="Long" resultMap="SurProjectAttendanceUserResult">
|
||||
<include refid="selectSurProjectAttendanceUserVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="findCurrentAttendanceUser" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
select u.companyId,u.companyName,u.`name`,u.recentPhoto,u.gender,u.birthDate,u.ethnic,u.nativePlace,u.phone,
|
||||
u.workTypeName,u.specWorkType,u.groupName,g.companyTypeId,u.workTypeCode
|
||||
from sur_project_attendance_user u
|
||||
left join sur_project_attendance_group g on u.companyId = g.companyId and g.cfgid = u.cfgid
|
||||
where u.cfgid=#{cfgid} and u.workerId=#{workerId}
|
||||
</select>
|
||||
|
||||
<select id="findYzCurrentAttendanceUser" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
select u.companyId,g.companyName,u.`name`,u.recentPhoto,u.gender,u.birthDate,u.ethnic,u.nativePlace,u.phone,
|
||||
u.workTypeName,u.specWorkType,u.groupName,g.companyTypeId,u.workTypeCode
|
||||
from sur_project_attendance_user u
|
||||
left join sur_project_attendance_group g on u.groupId = g.serverid and g.cfgid = u.cfgid
|
||||
where u.cfgid=#{cfgid} and u.workerId=#{workerId} ORDER BY u.id desc LIMIT 1
|
||||
</select>
|
||||
|
||||
<insert id="insertSurProjectAttendanceUser" parameterType="QuartzProjectAttendanceUser" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sur_project_attendance_user
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="cfgid != null">cfgid,</if>
|
||||
<if test="appId != null">app_id,</if>
|
||||
<if test="vendorsCode != null">vendors_code,</if>
|
||||
<if test="workerId != null">workerId,</if>
|
||||
<if test="laborWorkerId != null">laborWorkerId,</if>
|
||||
<if test="workerCategory != null">workerCategory,</if>
|
||||
<if test="qrCode != null">qrCode,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="idCardNo != null">idCardNo,</if>
|
||||
<if test="idTypeName != null">idTypeName,</if>
|
||||
<if test="ethnic != null">ethnic,</if>
|
||||
<if test="nativePlace != null">nativePlace,</if>
|
||||
<if test="gender != null">gender,</if>
|
||||
<if test="birthDate != null">birthDate,</if>
|
||||
<if test="phone != null and phone != ''">phone,</if>
|
||||
<if test="degreeName != null">degreeName,</if>
|
||||
<if test="photo != null">photo,</if>
|
||||
<if test="recentPhoto != null">recentPhoto,</if>
|
||||
<if test="groupId != null">groupId,</if>
|
||||
<if test="groupName != null">groupName,</if>
|
||||
<if test="leader != null">leader,</if>
|
||||
<if test="workTypeCode != null">workTypeCode,</if>
|
||||
<if test="workTypeName != null">workTypeName,</if>
|
||||
<if test="specWorkType != null">specWorkType,</if>
|
||||
<if test="hatCode != null">hatCode,</if>
|
||||
<if test="state != null">state,</if>
|
||||
<if test="enterDate != null">enterDate,</if>
|
||||
<if test="exitDate != null">exitDate,</if>
|
||||
<if test="companyId != null">companyId,</if>
|
||||
<if test="companyName != null">companyName,</if>
|
||||
<if test="vendorId != null">vendorId,</if>
|
||||
<if test="teamId != null">teamId,</if>
|
||||
<if test="teamName != null">teamName,</if>
|
||||
<if test="enterType != null">enterType,</if>
|
||||
<if test="other != null and other != ''">other,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="isDel != null">is_del,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="cfgid != null">#{cfgid},</if>
|
||||
<if test="appId != null">#{appId},</if>
|
||||
<if test="vendorsCode != null">#{vendorsCode},</if>
|
||||
<if test="workerId != null">#{workerId},</if>
|
||||
<if test="laborWorkerId != null">#{laborWorkerId},</if>
|
||||
<if test="workerCategory != null">#{workerCategory},</if>
|
||||
<if test="qrCode != null">#{qrCode},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="idCardNo != null">#{idCardNo},</if>
|
||||
<if test="idTypeName != null">#{idTypeName},</if>
|
||||
<if test="ethnic != null">#{ethnic},</if>
|
||||
<if test="nativePlace != null">#{nativePlace},</if>
|
||||
<if test="gender != null">#{gender},</if>
|
||||
<if test="birthDate != null">#{birthDate},</if>
|
||||
<if test="phone != null and phone != ''">#{phone},</if>
|
||||
<if test="degreeName != null">#{degreeName},</if>
|
||||
<if test="photo != null">#{photo},</if>
|
||||
<if test="recentPhoto != null">#{recentPhoto},</if>
|
||||
<if test="groupId != null">#{groupId},</if>
|
||||
<if test="groupName != null">#{groupName},</if>
|
||||
<if test="leader != null">#{leader},</if>
|
||||
<if test="workTypeCode != null">#{workTypeCode},</if>
|
||||
<if test="workTypeName != null">#{workTypeName},</if>
|
||||
<if test="specWorkType != null">#{specWorkType},</if>
|
||||
<if test="hatCode != null">#{hatCode},</if>
|
||||
<if test="state != null">#{state},</if>
|
||||
<if test="enterDate != null">#{enterDate},</if>
|
||||
<if test="exitDate != null">#{exitDate},</if>
|
||||
<if test="companyId != null">#{companyId},</if>
|
||||
<if test="companyName != null">#{companyName},</if>
|
||||
<if test="vendorId != null">#{vendorId},</if>
|
||||
<if test="teamId != null">#{teamId},</if>
|
||||
<if test="teamName != null">#{teamName},</if>
|
||||
<if test="enterType != null">#{enterType},</if>
|
||||
<if test="other != null and other != ''">#{other},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="isDel != null">#{isDel},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSurProjectAttendanceUser" parameterType="QuartzProjectAttendanceUser">
|
||||
update sur_project_attendance_user
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="cfgid != null">cfgid = #{cfgid},</if>
|
||||
<if test="appId != null">app_id = #{appId},</if>
|
||||
<if test="vendorsCode != null">vendors_code = #{vendorsCode},</if>
|
||||
<if test="workerId != null">workerId = #{workerId},</if>
|
||||
<if test="laborWorkerId != null">laborWorkerId = #{laborWorkerId},</if>
|
||||
<if test="workerCategory != null">workerCategory = #{workerCategory},</if>
|
||||
<if test="qrCode != null">qrCode = #{qrCode},</if>
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="idCardNo != null">name = #{idCardNo},</if>
|
||||
<if test="idTypeName != null">name = #{idTypeName},</if>
|
||||
<if test="ethnic != null">ethnic = #{ethnic},</if>
|
||||
<if test="nativePlace != null">nativePlace = #{nativePlace},</if>
|
||||
<if test="gender != null">gender = #{gender},</if>
|
||||
<if test="birthDate != null">birthDate = #{birthDate},</if>
|
||||
<if test="phone != null and phone != ''">phone = #{phone},</if>
|
||||
<if test="degreeName != null">degreeName = #{degreeName},</if>
|
||||
<if test="photo != null">photo = #{photo},</if>
|
||||
<if test="recentPhoto != null">recentPhoto = #{recentPhoto},</if>
|
||||
<if test="groupId != null">groupId = #{groupId},</if>
|
||||
<if test="groupName != null">groupName = #{groupName},</if>
|
||||
<if test="leader != null">leader = #{leader},</if>
|
||||
<if test="workTypeCode != null">workTypeCode = #{workTypeCode},</if>
|
||||
<if test="workTypeName != null">workTypeName = #{workTypeName},</if>
|
||||
<if test="specWorkType != null">specWorkType = #{specWorkType},</if>
|
||||
<if test="hatCode != null">hatCode = #{hatCode},</if>
|
||||
<if test="state != null">state = #{state},</if>
|
||||
<if test="enterDate != null">enterDate = #{enterDate},</if>
|
||||
<if test="exitDate != null">exitDate = #{exitDate},</if>
|
||||
<if test="companyId != null">companyId = #{companyId},</if>
|
||||
<if test="companyName != null">companyName = #{companyName},</if>
|
||||
<if test="vendorId != null">vendorId = #{vendorId},</if>
|
||||
<if test="teamId != null">teamId = #{teamId},</if>
|
||||
<if test="teamName != null">teamName = #{teamName},</if>
|
||||
<if test="enterType != null">enterType = #{enterType},</if>
|
||||
<if test="other != null and other != ''">other = #{other},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="isDel != null">is_del = #{isDel},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSurProjectAttendanceUserById" parameterType="Long">
|
||||
delete from sur_project_attendance_user where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSurProjectAttendanceUserByIds" parameterType="String">
|
||||
delete from sur_project_attendance_user where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSurProjectAttendanceUserByParams" parameterType="String">
|
||||
delete from sur_project_attendance_user where CONCAT(app_id,'-',workerId) in
|
||||
<foreach collection="list" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchSurProjectAttendanceUser">
|
||||
insert into sur_project_attendance_user( id, cfgid, vendors_code, workerId, laborWorkerId, workerCategory, qrCode, name,idCardNo,idTypeName, ethnic, nativePlace, gender, birthDate, phone, degreeName, photo, recentPhoto, groupId, groupName, leader, workTypeCode, workTypeName, specWorkType, hatCode, state, enterDate, exitDate, companyId, companyName, vendorId, teamId, teamName, enterType, other, remark, is_del, create_by, create_time, update_by, update_time) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.id}, #{item.cfgid}, #{item.vendorsCode}, #{item.workerId}, #{item.laborWorkerId}, #{item.workerCategory}, #{item.qrCode}, #{item.name}, #{item.idCardNo},#{item.idTypeName},#{item.ethnic}, #{item.nativePlace}, #{item.gender}, #{item.birthDate}, #{item.phone}, #{item.degreeName}, #{item.photo}, #{item.recentPhoto}, #{item.groupId}, #{item.groupName}, #{item.leader}, #{item.workTypeCode}, #{item.workTypeName}, #{item.specWorkType}, #{item.hatCode}, #{item.state}, #{item.enterDate}, #{item.exitDate}, #{item.companyId}, #{item.companyName}, #{item.vendorId}, #{item.teamId}, #{item.teamName}, #{item.enterType}, #{item.other}, #{item.remark}, #{item.isDel}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="countAttendance" resultType="Long" parameterType="QuartzProAttendanceCfg">
|
||||
select count(1) cnt from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g
|
||||
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
|
||||
and u.workerid in(
|
||||
SELECT workerid FROM sur_project_attendance_data WHERE DATE(attendance_time)=date(#{createBy}) AND cfgid IN (
|
||||
SELECT id FROM attendance_cfg WHERE project_id=#{projectId} AND dept_id=#{deptId}
|
||||
) group by workerid
|
||||
)
|
||||
</select>
|
||||
<select id="queryAttendanceByUserIds" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
select workerid,attendance_type name,min(attendance_time) inTime,max(attendance_time) outTime from sur_project_attendance_data
|
||||
where DATE(attendance_time)=date(#{createBy})
|
||||
<if test="workerIds !=null and workerIds.size()>0">
|
||||
and workerid in
|
||||
<foreach collection="workerIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
group by workerid,attendance_type
|
||||
</select>
|
||||
<select id="queryAttendanceUsers" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
|
||||
select u.* from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g
|
||||
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
|
||||
and u.workerid in(
|
||||
SELECT workerid FROM sur_project_attendance_data WHERE DATE(attendance_time)=date(#{createBy}) AND cfgid IN (
|
||||
SELECT id FROM attendance_cfg WHERE project_id=#{projectId} AND dept_id=#{subDeptId}
|
||||
) group by workerid
|
||||
)
|
||||
order by u.id limit #{index},#{size}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="countTodayAttendance" resultType="Long" parameterType="QuartzProjectAttendanceUser">
|
||||
select count(1) cnt from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g
|
||||
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
|
||||
and u.workerid in(
|
||||
SELECT workerid FROM sur_project_attendance_data WHERE DATE(attendance_time)=CURDATE() group by workerid
|
||||
)
|
||||
<if test="id==1">
|
||||
and g.companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="id==2">
|
||||
and g.companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
<if test="id==8">
|
||||
and g.companyTypeId =8
|
||||
</if>
|
||||
<if test="projectId!=null and projectId>0">
|
||||
and c.project_id=#{projectId}
|
||||
</if>
|
||||
<if test="deptId!=null and deptId>0">
|
||||
and c.project_id in (SELECT id FROM pro_project_info WHERE dis_dept_id=#{deptId})
|
||||
</if>
|
||||
<if test="prjIds !=null and prjIds.size()>0">
|
||||
and c.project_id in
|
||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="todayAttendance" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
|
||||
select u.* from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g
|
||||
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
|
||||
and u.workerid in(
|
||||
SELECT workerid FROM sur_project_attendance_data WHERE DATE(attendance_time)=CURDATE() group by workerid
|
||||
)
|
||||
|
||||
<if test="id==1">
|
||||
and g.companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="id==2">
|
||||
and g.companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
<if test="id==8">
|
||||
and g.companyTypeId =8
|
||||
</if>
|
||||
<if test="projectId!=null and projectId>0">
|
||||
and c.project_id=#{projectId}
|
||||
</if>
|
||||
<if test="deptId!=null and deptId>0">
|
||||
and c.project_id in (SELECT id FROM pro_project_info WHERE dis_dept_id=#{deptId})
|
||||
</if>
|
||||
<if test="prjIds !=null and prjIds.size()>0">
|
||||
and c.project_id in
|
||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
order by u.id limit #{index},#{size}
|
||||
</select>
|
||||
<select id="todayAttendanceData" parameterType="java.util.List" resultMap="SurProjectAttendanceUserResult">
|
||||
select workerid,attendance_type name,min(attendance_time) inTime,max(attendance_time) outTime from sur_project_attendance_data where DATE(attendance_time)=CURDATE()
|
||||
<if test="list !=null and list.size()>0">
|
||||
and workerid in
|
||||
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
group by workerid,attendance_type
|
||||
</select>
|
||||
|
||||
<select id="todayAttendanceOtherData" parameterType="map" resultMap="SurProjectAttendanceUserResult">
|
||||
select workerid,min(attendance_time) inTime,max(attendance_time) outTime from sur_project_attendance_data where cfgid=#{cfgid} and DATE(attendance_time)=#{date}
|
||||
<if test="list !=null and list.size()>0">
|
||||
and workerid in
|
||||
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
group by workerid
|
||||
</select>
|
||||
|
||||
<select id="queryWorkerOnDuty" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
SELECT u.id,u.cfgid,u.app_id,u.vendors_code,u.workerId,u.laborWorkerId,u.workerCategory,u.qrCode,u.name,
|
||||
u.ethnic,u.nativePlace,u.gender,u.birthDate,u.phone,u.photo,u.recentPhoto,
|
||||
u.groupId,u.leader,u.workTypeCode,u.specWorkType,u.idCardNo,u.idTypeName,
|
||||
u.hatCode,u.state,u.enterDate,u.exitDate,u.companyId,u.vendorId,
|
||||
u.teamId,u.teamName,u.enterType,u.is_del,u.create_by,u.create_time,u.update_by,u.update_time,
|
||||
u.companyName,u.workTypeName,u.groupName,
|
||||
b.project_id,b.dept_id, g.teamname remark,g.companyName degreeName
|
||||
FROM sur_project_attendance_user u,attendance_cfg b,view_sur_project_attendance_group g,pro_project_info sp
|
||||
WHERE u.cfgid=b.id and u.state=0 and u.companyId=g.companyId and sp.is_Del=0 and b.project_id = sp.id
|
||||
<if test="id==101">
|
||||
and g.companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="id==102">
|
||||
and g.companyTypeId =8
|
||||
</if>
|
||||
<if test="id==103">
|
||||
and g.companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
<if test="projectId!=null and projectId>0">
|
||||
and b.project_id=#{projectId}
|
||||
</if>
|
||||
<if test="deptId!=null and deptId>0">
|
||||
and sp.dis_dept_id=#{deptId}
|
||||
</if>
|
||||
<if test='proType != null and proType != "" and proType != "0"'> and sp.project_Type = #{proType}</if>
|
||||
<if test="prjIds !=null and prjIds.size()>0">
|
||||
and b.project_id in
|
||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="attendanceUserList" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
SELECT u.id,u.cfgid,u.app_id,u.vendors_code,u.workerId,u.laborWorkerId,u.workerCategory,u.qrCode,u.name,
|
||||
u.ethnic,u.nativePlace,u.gender,u.birthDate,u.phone,u.photo,u.recentPhoto,
|
||||
u.groupId,u.leader,u.workTypeCode,u.specWorkType,u.idCardNo,u.idTypeName,
|
||||
u.hatCode,u.state,u.enterDate,u.exitDate,u.companyId,u.vendorId,
|
||||
u.teamId,u.teamName,u.enterType,u.is_del,u.create_by,u.create_time,u.update_by,u.update_time,
|
||||
u.companyName,u.workTypeName,u.groupName,
|
||||
b.project_id,b.dept_id, g.teamname remark,g.companyName degreeName,g.companyTypeId
|
||||
FROM sur_project_attendance_user u,attendance_cfg b,view_sur_project_attendance_group g,pro_project_info sp
|
||||
WHERE u.cfgid=b.id and u.companyId=g.companyId and sp.is_Del=0 and b.project_id = sp.id
|
||||
<if test="companyTypeId==101">
|
||||
and g.companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="companyTypeId==102">
|
||||
and g.companyTypeId =8
|
||||
</if>
|
||||
<if test="companyTypeId==103">
|
||||
and g.companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
<if test="projectId!=null and projectId>0">
|
||||
and b.project_id=#{projectId}
|
||||
</if>
|
||||
<if test="id != null"> and u.id = #{id}</if>
|
||||
<if test="state != null "> and u.state = #{state}</if>
|
||||
<if test="name != null and name != ''"> and u.name like concat('%', #{name}, '%')</if>
|
||||
order by id
|
||||
</select>
|
||||
|
||||
<select id="groupByWorkerOnDutyByDept" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
SELECT p.id, p.project_name NAME,c.dept_name groupName,g.companyTypeId companyId,COUNT(1) cfgid
|
||||
FROM sur_project_attendance_user u,attendance_cfg b,view_sur_project_attendance_group g,pro_project_info p,sys_dept c
|
||||
where u.cfgid=b.id and u.state=0 and u.companyId=g.companyId and b.project_id=p.id and c.dept_id=b.dept_id
|
||||
and p.is_Del=0
|
||||
and g.companyTypeId in (1,6,0,2,3,4,5,8)
|
||||
<if test="deptId!=null and deptId>0">
|
||||
and p.dis_dept_id=#{deptId}
|
||||
</if>
|
||||
<if test='proType != null and proType != "" and proType != "0"'> and p.project_Type = #{proType}</if>
|
||||
<if test="prjIds !=null and prjIds.size()>0">
|
||||
and b.project_id in
|
||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
group by p.project_Name,c.dept_name,g.companyTypeId,p.id
|
||||
order by p.id
|
||||
</select>
|
||||
|
||||
<select id="groupUserByParams" parameterType="QuartzProjectAttendanceUser" resultType="Map">
|
||||
select '1' as type,g.companyTypeId,count(1) as total
|
||||
from sur_project_attendance_user u
|
||||
left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId
|
||||
where u.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||
and g.companyTypeId in (0,1,2,3,4,5,6,8)
|
||||
and u.state=0
|
||||
<if test="name != null and name != ''"> and u.name like concat('%', #{name}, '%')</if>
|
||||
group by g.companyTypeId
|
||||
UNION ALL
|
||||
select '2' as type,g.companyTypeId,count(1) as total
|
||||
from sur_project_attendance_user u
|
||||
left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId
|
||||
where u.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||
and g.companyTypeId in (0,1,2,3,4,5,6,8)
|
||||
and u.state=1
|
||||
<if test="name != null and name != ''"> and u.name like concat('%', #{name}, '%')</if>
|
||||
group by g.companyTypeId
|
||||
</select>
|
||||
|
||||
<select id="findUserAllByDays" parameterType="Long" resultType="Map">
|
||||
select '1' as type,g.companyTypeId,count(1) as total
|
||||
from sur_project_attendance_user u
|
||||
left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId
|
||||
where u.cfgid in (select cfg.id from attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||
and g.companyTypeId in (0,1,2,3,4,5,6,8)
|
||||
and u.state=0
|
||||
group by g.companyTypeId
|
||||
</select>
|
||||
|
||||
<select id="groupByWorkerByDept" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
SELECT p.id, p.project_Name NAME,c.dept_name groupName,g.companyTypeId companyId,COUNT(1) cfgid
|
||||
FROM sur_project_attendance_user u,attendance_cfg b,view_sur_project_attendance_group g,pro_project_info p,sys_dept c
|
||||
where u.cfgid=b.id and u.state= #{state} and u.companyId=g.companyId and b.project_id=p.id and c.dept_id=b.dept_id
|
||||
and p.is_Del=0
|
||||
and g.companyTypeId in (1,6,0,2,3,4,5,8)
|
||||
<if test="deptId!=null and deptId>0">
|
||||
and p.dis_dept_id=#{deptId}
|
||||
</if>
|
||||
<if test='proType != null and proType != "" and proType != "0"'> and p.project_Type = #{proType}</if>
|
||||
<if test="prjIds !=null and prjIds.size()>0">
|
||||
and b.project_id in
|
||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
group by p.project_Name,c.dept_name,g.companyTypeId,p.id
|
||||
order by p.id
|
||||
</select>
|
||||
|
||||
<select id="queryWorkerByState" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
SELECT u.id,u.cfgid,u.app_id,u.vendors_code,u.workerId,u.laborWorkerId,u.workerCategory,u.qrCode,u.name,
|
||||
u.ethnic,u.nativePlace,u.gender,u.birthDate,u.phone,u.photo,u.recentPhoto,u.idCardNo,u.idTypeName,
|
||||
u.groupId,u.leader,u.workTypeCode,u.specWorkType,
|
||||
u.hatCode,u.state,u.enterDate,u.exitDate,u.companyId,u.vendorId,
|
||||
u.teamId,u.teamName,u.enterType,u.is_del,u.create_by,u.create_time,u.update_by,u.update_time,
|
||||
u.companyName,u.workTypeName,u.groupName,
|
||||
b.project_id,b.dept_id, g.teamname remark,g.companyName degreeName
|
||||
FROM sur_project_attendance_user u,attendance_cfg b,view_sur_project_attendance_group g,pro_project_info sp
|
||||
WHERE u.cfgid=b.id and u.state=#{state} and u.companyId=g.companyId and sp.is_Del=0 and b.project_id = sp.id
|
||||
<if test="id==101">
|
||||
and g.companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="id==102">
|
||||
and g.companyTypeId =8
|
||||
</if>
|
||||
<if test="id==103">
|
||||
and g.companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
<if test="projectId!=null and projectId>0">
|
||||
and b.project_id=#{projectId}
|
||||
</if>
|
||||
<if test="deptId!=null and deptId>0">
|
||||
and sp.dis_dept_id=#{deptId}
|
||||
</if>
|
||||
<if test='proType != null and proType != "" and proType != "0"'> and sp.project_Type = #{proType}</if>
|
||||
<if test="prjIds !=null and prjIds.size()>0">
|
||||
and b.project_id in
|
||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -65,7 +65,7 @@ public class LaborController extends BaseController {
|
|||
@GetMapping("/groupAttendanceLastWeek/{type}/{prjId}")
|
||||
public AjaxResult groupAttendanceLastWeek(@PathVariable("type")String type, @PathVariable("prjId") Long prjId){
|
||||
Date dateEnd=new DateTime();
|
||||
Date dateStart=DateUtil.offsetDay(dateEnd,7);
|
||||
Date dateStart=DateUtil.offsetDay(dateEnd,-7);
|
||||
if("uni".equals(type.toLowerCase())){
|
||||
JSONArray sList=attendanceUbiDataService.groupAttendanceLastWeek(prjId,dateStart,dateEnd);
|
||||
return AjaxResult.success(sList);
|
||||
|
|
|
@ -1558,13 +1558,17 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
|
|||
if(isAdmin){
|
||||
SysUserExt userExt = new SysUserExt();
|
||||
userExt.setUserId(loginUser.getUserid());
|
||||
userExt.setComId(loginUser.getSysUser().getComId());
|
||||
//userExt.setComId(loginUser.getSysUser().getComId());
|
||||
|
||||
List<SysUserExt> userExts=sysUserExtMapper.selectSysUserExtList(userExt);
|
||||
if(userExts.size()>0){
|
||||
SysUserExt oldExt = userExts.get(0);
|
||||
oldExt.setProjectId(id);
|
||||
oldExt.setIsActive(1l);
|
||||
sysUserExtMapper.updateSysUserExt(oldExt);
|
||||
if(!oldExt.getProjectId().equals(id)){
|
||||
oldExt.setProjectId(id);
|
||||
oldExt.setIsActive(1l);
|
||||
sysUserExtMapper.updateSysUserExt(oldExt);
|
||||
}
|
||||
|
||||
}else{
|
||||
userExt.setProjectId(id);
|
||||
userExt.setStatus("0");
|
||||
|
|
|
@ -104,6 +104,9 @@ app.config.globalProperties.$formatDateTime = dt=>{
|
|||
app.config.globalProperties.$formatTime = dt=>{
|
||||
return dt?dayjs(dt).format("HH:mm:ss"):"" ;
|
||||
};
|
||||
app.config.globalProperties.$formatTime = dt=>{
|
||||
return dt?dayjs(dt).format("HH:mm:ss"):"" ;
|
||||
};
|
||||
app.config.globalProperties.$http = request;
|
||||
|
||||
// 全局组件挂载
|
||||
|
|
|
@ -37,14 +37,14 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="进场时间" align="center" prop="inTime" width="96">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.attendanceTime"> {{ $formatDate(scope.row.attendanceTime) }} }} </span>
|
||||
<span v-if="scope.row.attendanceTime"> {{ (scope.row.attendanceTime) }} </span>
|
||||
<i v-else class="el-icon-close" style="color: red"></i>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="离场时间" align="center" prop="outTime" width="96">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.attendanceOutTime">
|
||||
{{ $formatDate(scope.row.attendanceOutTime) }}
|
||||
{{ (scope.row.attendanceOutTime) }}
|
||||
</span>
|
||||
<i v-else class="el-icon-close" style="color: red"></i>
|
||||
</template>
|
||||
|
|
Loading…
Reference in New Issue