Compare commits

...

2 Commits

Author SHA1 Message Date
姜玉琦 1a292837c9 Merge branch 'dev' of http://62.234.3.186:3000/sxyanzhu/jhprjv2 into dev 2024-08-08 00:33:35 +08:00
姜玉琦 64e3d335cf 提交代码 2024-08-08 00:33:25 +08:00
44 changed files with 6758 additions and 436 deletions

View File

@ -0,0 +1,179 @@
package com.ruoyi.quartz.domain;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* sur_project_attendance_cfg
*
* @author ruoyi
* @date 2023-09-24
*/
public class QuartzProjectAttendanceCfg extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 项目编号 */
@Excel(name = "项目编号")
private Long projectId;
/** 总包单位 */
@Excel(name = "总包单位")
private Long subDeptId;
/** 厂商编号参考字典attendance_vendors */
@Excel(name = "厂商编号参考字典attendance_vendors")
private String vendorsCode;
/** 厂商参数 */
@Excel(name = "厂商参数")
private String vendorsParameter;
/** 1-启用,0-停用 */
@Excel(name = "1-启用,0-停用")
private Long enabled;
/** 状态 */
@Excel(name = "状态")
private Long state;
private String deptName;
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
private String projectName;
private String unitName;
private String vendorName;
public String getVendorName() {
return vendorName;
}
public void setVendorName(String vendorName) {
this.vendorName = vendorName;
}
public String getProjectName() {
return projectName;
}
public void setProjectName(String projectName) {
this.projectName = projectName;
}
public String getUnitName() {
return unitName;
}
public void setUnitName(String unitName) {
this.unitName = unitName;
}
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Long isDel;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setProjectId(Long projectId)
{
this.projectId = projectId;
}
public Long getProjectId()
{
return projectId;
}
public void setSubDeptId(Long subDeptId)
{
this.subDeptId = subDeptId;
}
public Long getSubDeptId()
{
return subDeptId;
}
public void setVendorsCode(String vendorsCode)
{
this.vendorsCode = vendorsCode;
}
public String getVendorsCode()
{
return vendorsCode;
}
public void setVendorsParameter(String vendorsParameter)
{
this.vendorsParameter = vendorsParameter;
}
public String getVendorsParameter()
{
return vendorsParameter;
}
public void setEnabled(Long enabled)
{
this.enabled = enabled;
}
public Long getEnabled()
{
return enabled;
}
public void setState(Long state)
{
this.state = state;
}
public Long getState()
{
return state;
}
public void setIsDel(Long isDel)
{
this.isDel = isDel;
}
public Long getIsDel()
{
return isDel;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("projectId", getProjectId())
.append("subDeptId", getSubDeptId())
.append("vendorsCode", getVendorsCode())
.append("vendorsParameter", getVendorsParameter())
.append("enabled", getEnabled())
.append("state", getState())
.append("remark", getRemark())
.append("isDel", getIsDel())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,512 @@
package com.ruoyi.quartz.domain;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.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();
}
}

View File

@ -0,0 +1,429 @@
package com.ruoyi.quartz.domain;
import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.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();
}
}

View File

@ -0,0 +1,733 @@
package com.ruoyi.quartz.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.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.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;
/** 近照 */
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();
}
}

View File

@ -1,8 +1,8 @@
package com.yanzhu.jh.base.domain; package com.ruoyi.quartz.domain;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
public class SysNative extends BaseEntity { public class SysNative extends BaseEntity {
private Long id; private Long id;
private String address; private String address;

View File

@ -0,0 +1,64 @@
package com.ruoyi.quartz.mapper;
import com.ruoyi.quartz.domain.QuartzProjectAttendanceCfg;
import java.util.List;
/**
* Mapper
*
* @author ruoyi
* @date 2023-09-24
*/
public interface QuartzProjectAttendanceCfgMapper
{
/**
*
*
* @param id
* @return
*/
public QuartzProjectAttendanceCfg selectSurProjectAttendanceCfgById(Long id);
/**
*
*
* @param quartzProjectAttendanceCfg
* @return
*/
public List<QuartzProjectAttendanceCfg> selectSurProjectAttendanceCfgList(QuartzProjectAttendanceCfg quartzProjectAttendanceCfg);
/**
*
*
* @param quartzProjectAttendanceCfg
* @return
*/
public int insertSurProjectAttendanceCfg(QuartzProjectAttendanceCfg quartzProjectAttendanceCfg);
/**
*
*
* @param quartzProjectAttendanceCfg
* @return
*/
public int updateSurProjectAttendanceCfg(QuartzProjectAttendanceCfg quartzProjectAttendanceCfg);
/**
*
*
* @param id
* @return
*/
public int deleteSurProjectAttendanceCfgById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteSurProjectAttendanceCfgByIds(Long[] ids);
public List<QuartzProjectAttendanceCfg> selectSurProjectAttendanceCfgListForAllInfo(QuartzProjectAttendanceCfg where);
}

View File

@ -0,0 +1,135 @@
package com.ruoyi.quartz.mapper;
import com.ruoyi.quartz.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);
}

View File

@ -0,0 +1,86 @@
package com.ruoyi.quartz.mapper;
import com.ruoyi.quartz.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);
}

View File

@ -0,0 +1,169 @@
package com.ruoyi.quartz.mapper;
import com.ruoyi.quartz.domain.QuartzProjectAttendanceCfg;
import com.ruoyi.quartz.domain.QuartzProjectAttendanceData;
import com.ruoyi.quartz.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(QuartzProjectAttendanceCfg 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);
}

View File

@ -1,6 +1,6 @@
package com.yanzhu.jh.base.mapper; package com.ruoyi.quartz.mapper;
import com.yanzhu.jh.base.domain.SysNative; import com.ruoyi.quartz.domain.SysNative;
import java.util.List; import java.util.List;

View File

@ -81,4 +81,31 @@ public interface TaskMapper {
* @return openId * @return openId
*/ */
public List<Map<String, Object>> findMsgProMagUsers(Long proId); public List<Map<String, Object>> findMsgProMagUsers(Long proId);
/**
* 使
* @param date
* @return
*/
public Long findTowerMaxIdByDate(String date);
/**
*
* @param id
* @return
*/
public int deleteDevTowerDataRunByMaxId(Long id);
/**
*
* @return
*/
public List<Map<String, Object>> findAllTowerMaxId();
/**
*
* @param map
* @return
*/
public int updateTowerConfigOnline(Map<String, Object> map);
} }

View File

@ -0,0 +1,62 @@
package com.ruoyi.quartz.service;
import com.ruoyi.quartz.domain.QuartzProjectAttendanceCfg;
import java.util.List;
/**
* Service
*
* @author ruoyi
* @date 2023-09-24
*/
public interface IQuartzProjectAttendanceCfgService
{
/**
*
*
* @param id
* @return
*/
public QuartzProjectAttendanceCfg selectSurProjectAttendanceCfgById(Long id);
/**
*
*
* @param quartzProjectAttendanceCfg
* @return
*/
public List<QuartzProjectAttendanceCfg> selectSurProjectAttendanceCfgList(QuartzProjectAttendanceCfg quartzProjectAttendanceCfg);
/**
*
*
* @param quartzProjectAttendanceCfg
* @return
*/
public int insertSurProjectAttendanceCfg(QuartzProjectAttendanceCfg quartzProjectAttendanceCfg);
/**
*
*
* @param quartzProjectAttendanceCfg
* @return
*/
public int updateSurProjectAttendanceCfg(QuartzProjectAttendanceCfg quartzProjectAttendanceCfg);
/**
*
*
* @param ids
* @return
*/
public int deleteSurProjectAttendanceCfgByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteSurProjectAttendanceCfgById(Long id);
}

View File

@ -0,0 +1,141 @@
package com.ruoyi.quartz.service;
import com.ruoyi.quartz.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>> initOtherData(Map<String,Object> data);
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);
}

View File

@ -0,0 +1,94 @@
package com.ruoyi.quartz.service;
import com.ruoyi.quartz.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);
}

View File

@ -0,0 +1,162 @@
package com.ruoyi.quartz.service;
import com.ruoyi.quartz.domain.QuartzProjectAttendanceData;
import com.ruoyi.quartz.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);
}

View File

@ -1,6 +1,6 @@
package com.yanzhu.jh.base.service; package com.ruoyi.quartz.service;
import com.yanzhu.jh.base.domain.SysNative; import com.ruoyi.quartz.domain.SysNative;
import java.util.List; import java.util.List;

View File

@ -71,4 +71,31 @@ public interface ITaskService {
* @return openId * @return openId
*/ */
public List<Map<String, Object>> findMsgProMagUsers(Long proId); public List<Map<String, Object>> findMsgProMagUsers(Long proId);
/**
* 使
* @param date
* @return
*/
public Long findTowerMaxIdByDate(String date);
/**
*
* @param id
* @return
*/
public int deleteDevTowerDataRunByMaxId(Long id);
/**
*
* @return
*/
public List<Map<String, Object>> findAllTowerMaxId();
/**
*
* @param map
* @return
*/
public int updateTowerConfigOnline(Map<String, Object> map);
} }

View File

@ -0,0 +1,148 @@
package com.ruoyi.quartz.service.impl;
import com.ruoyi.common.enums.ApplyCfgTypeEnum;
import com.ruoyi.common.enums.ShiFouEnum;
import com.ruoyi.common.enums.VendorsCodeEnum;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.quartz.domain.QuartzProjectAttendanceCfg;
import com.ruoyi.quartz.mapper.QuartzProjectAttendanceCfgMapper;
import com.ruoyi.quartz.service.IQuartzProjectAttendanceCfgService;
import com.ruoyi.system.domain.SysApplyConfig;
import com.ruoyi.system.service.ISysApplyConfigService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* Service
*
* @author ruoyi
* @date 2023-09-24
*/
@Service
public class QuartzProjectAttendanceCfgServiceImpl implements IQuartzProjectAttendanceCfgService
{
@Autowired
private ISysApplyConfigService sysApplyConfigService;
@Autowired
private QuartzProjectAttendanceCfgMapper quartzProjectAttendanceCfgMapper;
/**
*
*
* @param id
* @return
*/
@Override
public QuartzProjectAttendanceCfg selectSurProjectAttendanceCfgById(Long id)
{
return quartzProjectAttendanceCfgMapper.selectSurProjectAttendanceCfgById(id);
}
/**
*
*
* @param quartzProjectAttendanceCfg
* @return
*/
@Override
public List<QuartzProjectAttendanceCfg> selectSurProjectAttendanceCfgList(QuartzProjectAttendanceCfg quartzProjectAttendanceCfg)
{
return quartzProjectAttendanceCfgMapper.selectSurProjectAttendanceCfgList(quartzProjectAttendanceCfg);
}
/**
*
*
* @param quartzProjectAttendanceCfg
* @return
*/
@Override
public int insertSurProjectAttendanceCfg(QuartzProjectAttendanceCfg quartzProjectAttendanceCfg)
{
quartzProjectAttendanceCfg.setCreateBy(SecurityUtils.getUsername());
quartzProjectAttendanceCfg.setCreateTime(DateUtils.getNowDate());
return quartzProjectAttendanceCfgMapper.insertSurProjectAttendanceCfg(quartzProjectAttendanceCfg);
}
/**
*
*
* @param quartzProjectAttendanceCfg
* @return
*/
@Override
public int updateSurProjectAttendanceCfg(QuartzProjectAttendanceCfg quartzProjectAttendanceCfg)
{
quartzProjectAttendanceCfg.setUpdateBy(SecurityUtils.getUsername());
quartzProjectAttendanceCfg.setUpdateTime(DateUtils.getNowDate());
if(VendorsCodeEnum.YANZHU.getCode().equals(quartzProjectAttendanceCfg.getVendorsCode())){
SysApplyConfig sysApplyConfig = new SysApplyConfig();
sysApplyConfig.setCfgType(ApplyCfgTypeEnum.LABOUR.getCode());
sysApplyConfig.setCfgId(quartzProjectAttendanceCfg.getId());
List<SysApplyConfig> list = sysApplyConfigService.selectSysApplyConfigList(sysApplyConfig);
if(CollectionUtils.isNotEmpty(list)){
sysApplyConfig = list.get(0);
sysApplyConfig.setIsDel(quartzProjectAttendanceCfg.getEnabled().equals(ShiFouEnum.FOU.getLongCode())?ShiFouEnum.SHI.getCode():ShiFouEnum.FOU.getCode());
sysApplyConfigService.updateSysApplyConfig(sysApplyConfig);
}
}
return quartzProjectAttendanceCfgMapper.updateSurProjectAttendanceCfg(quartzProjectAttendanceCfg);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteSurProjectAttendanceCfgByIds(Long[] ids)
{
List<Long> cfgIds = new ArrayList<>();
for(Long id:ids){
QuartzProjectAttendanceCfg quartzProjectAttendanceCfg = quartzProjectAttendanceCfgMapper.selectSurProjectAttendanceCfgById(id);
if(VendorsCodeEnum.YANZHU.getCode().equals(quartzProjectAttendanceCfg.getVendorsCode())){
SysApplyConfig sysApplyConfig = new SysApplyConfig();
sysApplyConfig.setCfgType(ApplyCfgTypeEnum.LABOUR.getCode());
sysApplyConfig.setCfgId(id);
List<SysApplyConfig> list = sysApplyConfigService.selectSysApplyConfigList(sysApplyConfig);
if(CollectionUtils.isNotEmpty(list)){
cfgIds.add(list.get(0).getId());
}
}
}
if(CollectionUtils.isNotEmpty(cfgIds)){
sysApplyConfigService.deleteSysApplyConfigByIds(cfgIds.stream().toArray(Long[]::new));
}
return quartzProjectAttendanceCfgMapper.deleteSurProjectAttendanceCfgByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteSurProjectAttendanceCfgById(Long id)
{
QuartzProjectAttendanceCfg quartzProjectAttendanceCfg = quartzProjectAttendanceCfgMapper.selectSurProjectAttendanceCfgById(id);
if(VendorsCodeEnum.YANZHU.getCode().equals(quartzProjectAttendanceCfg.getVendorsCode())){
SysApplyConfig sysApplyConfig = new SysApplyConfig();
sysApplyConfig.setCfgType(ApplyCfgTypeEnum.LABOUR.getCode());
sysApplyConfig.setCfgId(id);
List<SysApplyConfig> list = sysApplyConfigService.selectSysApplyConfigList(sysApplyConfig);
if(CollectionUtils.isNotEmpty(list)){
sysApplyConfigService.deleteSysApplyConfigById(list.get(0).getId());
}
}
return quartzProjectAttendanceCfgMapper.deleteSurProjectAttendanceCfgById(id);
}
}

View File

@ -0,0 +1,520 @@
package com.ruoyi.quartz.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.quartz.domain.QuartzProjectAttendanceCfg;
import com.ruoyi.quartz.domain.QuartzProjectAttendanceData;
import com.ruoyi.quartz.domain.QuartzProjectAttendanceGroup;
import com.ruoyi.quartz.domain.QuartzProjectAttendanceUser;
import com.ruoyi.quartz.mapper.QuartzProjectAttendanceCfgMapper;
import com.ruoyi.quartz.mapper.QuartzProjectAttendanceDataMapper;
import com.ruoyi.quartz.mapper.QuartzProjectAttendanceGroupMapper;
import com.ruoyi.quartz.mapper.QuartzProjectAttendanceUserMapper;
import com.ruoyi.quartz.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 QuartzProjectAttendanceCfgMapper quartzProjectAttendanceCfgMapper;
/**
*
*
* @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)
{
if(StringUtils.isEmpty(quartzProjectAttendanceData.getCreateBy())){
quartzProjectAttendanceData.setCreateBy("task");
quartzProjectAttendanceData.setCreateTime(DateUtils.getNowDate());
}
return quartzProjectAttendanceDataMapper.insertSurProjectAttendanceData(quartzProjectAttendanceData);
}
/**
*
*
* @param quartzProjectAttendanceData
* @return
*/
@Override
public int updateSurProjectAttendanceData(QuartzProjectAttendanceData quartzProjectAttendanceData)
{
if(StringUtils.isEmpty(quartzProjectAttendanceData.getCreateBy())){
quartzProjectAttendanceData.setUpdateBy("task");
}
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());
}
//查询项目部门信息
QuartzProjectAttendanceCfg cfgWhere=new QuartzProjectAttendanceCfg();
cfgWhere.setId(sdata.getCfgid());
List<QuartzProjectAttendanceCfg> cfgList= quartzProjectAttendanceCfgMapper.selectSurProjectAttendanceCfgListForAllInfo(cfgWhere);
if(cfgList.size()==0){
return;
}
QuartzProjectAttendanceCfg cfg=cfgList.get(0);
sdata.setProjectId(cfg.getProjectId());
sdata.setDeptId(cfg.getSubDeptId());
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>> initOtherData(Map<String,Object> data) {
List<Map<String,Object>> dataList = new ArrayList<>();
List<Map<String,Object>> list = quartzProjectAttendanceDataMapper.initOtherData(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<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());
}
//查询项目部门信息
QuartzProjectAttendanceCfg cfgWhere=new QuartzProjectAttendanceCfg();
cfgWhere.setId(sdata.getCfgid());
List<QuartzProjectAttendanceCfg> cfgList= quartzProjectAttendanceCfgMapper.selectSurProjectAttendanceCfgListForAllInfo(cfgWhere);
if(cfgList.size()==0){
return;
}
QuartzProjectAttendanceCfg cfg=cfgList.get(0);
sdata.setProjectId(cfg.getProjectId());
sdata.setDeptId(cfg.getSubDeptId());
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);
}
}
}
}

View File

@ -0,0 +1,163 @@
package com.ruoyi.quartz.service.impl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.quartz.domain.QuartzProjectAttendanceGroup;
import com.ruoyi.quartz.mapper.QuartzProjectAttendanceGroupMapper;
import com.ruoyi.quartz.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)
{
if(StringUtils.isEmpty(quartzProjectAttendanceGroup.getCreateBy())){
quartzProjectAttendanceGroup.setCreateBy("task");
}
return quartzProjectAttendanceGroupMapper.insertSurProjectAttendanceGroup(quartzProjectAttendanceGroup);
}
/**
* 广
*
* @param quartzProjectAttendanceGroup 广
* @return
*/
@Override
public int updateSurProjectAttendanceGroup(QuartzProjectAttendanceGroup quartzProjectAttendanceGroup)
{
if(StringUtils.isEmpty(quartzProjectAttendanceGroup.getCreateBy())){
quartzProjectAttendanceGroup.setUpdateBy("task");
}
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());
List<QuartzProjectAttendanceGroup> list=selectSurProjectAttendanceGroupList(where);
for(QuartzProjectAttendanceGroup g:list){
g.setCompanyTypeId(group.getCompanyTypeId());
updateSurProjectAttendanceGroup(g);
}
}
}

View File

@ -0,0 +1,315 @@
package com.ruoyi.quartz.service.impl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.quartz.domain.QuartzProjectAttendanceCfg;
import com.ruoyi.quartz.domain.QuartzProjectAttendanceData;
import com.ruoyi.quartz.domain.QuartzProjectAttendanceUser;
import com.ruoyi.quartz.mapper.QuartzProjectAttendanceUserMapper;
import com.ruoyi.quartz.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) {
QuartzProjectAttendanceCfg where=new QuartzProjectAttendanceCfg();
where.setCreateBy(user.getCreateBy());
where.setSubDeptId(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;
}
}

View File

@ -1,17 +1,19 @@
package com.yanzhu.jh.base.service.impl; package com.ruoyi.quartz.service.impl;
import com.yanzhu.jh.base.domain.SysNative; import com.ruoyi.quartz.domain.SysNative;
import com.yanzhu.jh.base.mapper.SysNativeMapper; import com.ruoyi.quartz.mapper.SysNativeMapper;
import com.yanzhu.jh.base.service.ISysNativeService; import com.ruoyi.quartz.service.ISysNativeService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
@Service @Service
public class SysNativeServiceImpl implements ISysNativeService { public class SysNativeServiceImpl implements ISysNativeService {
@Autowired @Autowired
SysNativeMapper sysNativeMapper; SysNativeMapper sysNativeMapper;
@Override @Override
public List<SysNative> selectSysNativeListById(Long id) { public List<SysNative> selectSysNativeListById(Long id) {
return sysNativeMapper.selectSysNativeListById(id); return sysNativeMapper.selectSysNativeListById(id);

View File

@ -16,7 +16,7 @@ import java.util.Map;
* @author JiangYuQi * @author JiangYuQi
*/ */
@Service @Service
public class ITaskServiceImpl implements ITaskService { public class TaskServiceImpl implements ITaskService {
@Autowired @Autowired
private TaskMapper taskMapper; private TaskMapper taskMapper;
@ -114,4 +114,43 @@ public class ITaskServiceImpl implements ITaskService {
public List<Map<String, Object>> findMsgProMagUsers(Long proId) { public List<Map<String, Object>> findMsgProMagUsers(Long proId) {
return taskMapper.findMsgProMagUsers(proId); return taskMapper.findMsgProMagUsers(proId);
} }
/**
* 使
* @param date
* @return
*/
@Override
public Long findTowerMaxIdByDate(String date){
return taskMapper.findTowerMaxIdByDate(date);
}
/**
*
* @param id
* @return
*/
@Override
public int deleteDevTowerDataRunByMaxId(Long id){
return taskMapper.deleteDevTowerDataRunByMaxId(id);
}
/**
*
* @return
*/
@Override
public List<Map<String, Object>> findAllTowerMaxId(){
return taskMapper.findAllTowerMaxId();
}
/**
*
* @param map
* @return
*/
@Override
public int updateTowerConfigOnline(Map<String, Object> map){
return taskMapper.updateTowerConfigOnline(map);
}
} }

View File

@ -1,17 +1,17 @@
package com.yanzhu.jh.project.task; package com.ruoyi.quartz.task;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.yanzhu.jh.project.domain.SurProjectAttendanceCfg; import com.ruoyi.quartz.domain.QuartzProjectAttendanceCfg;
import com.yanzhu.jh.project.domain.SurProjectAttendanceData; import com.ruoyi.quartz.domain.QuartzProjectAttendanceData;
import com.yanzhu.jh.project.domain.SurProjectAttendanceGroup; import com.ruoyi.quartz.domain.QuartzProjectAttendanceGroup;
import com.yanzhu.jh.project.domain.SurProjectAttendanceUser; import com.ruoyi.quartz.domain.QuartzProjectAttendanceUser;
import com.yanzhu.jh.project.service.ISurProjectAttendanceCfgService; import com.ruoyi.quartz.service.IQuartzProjectAttendanceCfgService;
import com.yanzhu.jh.project.service.ISurProjectAttendanceDataService; import com.ruoyi.quartz.service.IQuartzProjectAttendanceDataService;
import com.yanzhu.jh.project.service.ISurProjectAttendanceGroupService; import com.ruoyi.quartz.service.IQuartzProjectAttendanceGroupService;
import com.yanzhu.jh.project.service.ISurProjectAttendanceUserService; import com.ruoyi.quartz.service.IQuartzProjectAttendanceUserService;
import okhttp3.*; import okhttp3.*;
import org.apache.logging.log4j.util.Strings; import org.apache.logging.log4j.util.Strings;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -21,18 +21,18 @@ import java.util.*;
@Component("attendanceHuazhuTask") @Component("attendanceHuazhuTask")
public class AttendanceHuazhuTask { public class AttendanceHuazhuTask {
@Autowired
ISurProjectAttendanceUserService attendanceUserService;
@Autowired @Autowired
ISurProjectAttendanceCfgService attendanceCfgService; IQuartzProjectAttendanceUserService attendanceUserService;
@Autowired @Autowired
ISurProjectAttendanceDataService attendanceDataService; IQuartzProjectAttendanceCfgService attendanceCfgService;
@Autowired @Autowired
ISurProjectAttendanceGroupService attendanceGroupService; IQuartzProjectAttendanceDataService attendanceDataService;
@Autowired
IQuartzProjectAttendanceGroupService attendanceGroupService;
public static void main(String[] args) { public static void main(String[] args) {
//String host="http://tapi.huazhukeji.cn:82/hz-labour"; //String host="http://tapi.huazhukeji.cn:82/hz-labour";
@ -78,12 +78,7 @@ public class AttendanceHuazhuTask {
} }
} }
//380649600000
public static void main2(String[] args) {
//String s= DateUtil.format(DateUtil.date(1704167341751l),"yyyy-MM-dd HH:mm:ss");
System.out.println(DateUtil.current());
}
public static void main3(String[] args) { public static void main3(String[] args) {
String path="/api/open/labour/findLabourWorkerByPage"; String path="/api/open/labour/findLabourWorkerByPage";
Map<String,String> map=new HashMap<>(); Map<String,String> map=new HashMap<>();
@ -94,7 +89,7 @@ public class AttendanceHuazhuTask {
map.put("tenantId","1666337067184893953"); map.put("tenantId","1666337067184893953");
JSONObject jo=JSON.parseObject(JSON.toJSONString(map)); JSONObject jo=JSON.parseObject(JSON.toJSONString(map));
int page=1; int page=1;
SurProjectAttendanceCfg it=new SurProjectAttendanceCfg(); QuartzProjectAttendanceCfg it=new QuartzProjectAttendanceCfg();
it.setId(0l);; it.setId(0l);;
//new AttendanceHuazhuTask().doSyncWorker(jo,1,it); //new AttendanceHuazhuTask().doSyncWorker(jo,1,it);
//long p=jo.getLongValue("page",1); //long p=jo.getLongValue("page",1);
@ -152,12 +147,12 @@ public class AttendanceHuazhuTask {
} }
public void syncGroup(){ public void syncGroup(){
SurProjectAttendanceCfg where =new SurProjectAttendanceCfg(); QuartzProjectAttendanceCfg where =new QuartzProjectAttendanceCfg();
where.setEnabled(1l); where.setEnabled(1l);
where.setIsDel(0l); where.setIsDel(0l);
where.setVendorsCode("huazhu"); where.setVendorsCode("huazhu");
List<SurProjectAttendanceCfg> list=attendanceCfgService.selectSurProjectAttendanceCfgList(where); List<QuartzProjectAttendanceCfg> list=attendanceCfgService.selectSurProjectAttendanceCfgList(where);
for(SurProjectAttendanceCfg it :list){ for(QuartzProjectAttendanceCfg it :list){
String param= it.getVendorsParameter(); String param= it.getVendorsParameter();
if(Strings.isNotEmpty(param)){ if(Strings.isNotEmpty(param)){
try{ try{
@ -170,7 +165,7 @@ public class AttendanceHuazhuTask {
} }
} }
private void doSyncGroup(JSONObject jdata, long page, SurProjectAttendanceCfg it) { private void doSyncGroup(JSONObject jdata, long page, QuartzProjectAttendanceCfg it) {
String path="/api/open/labour/findUnitProjectByPage"; String path="/api/open/labour/findUnitProjectByPage";
Request request=getRequest(path,jdata,page); Request request=getRequest(path,jdata,page);
String data=AttendanceTask.getResult(request); String data=AttendanceTask.getResult(request);
@ -181,7 +176,7 @@ public class AttendanceHuazhuTask {
if(arr!=null && arr.size()>0){ if(arr!=null && arr.size()>0){
for(int i=0;i<arr.size();i++) { for(int i=0;i<arr.size();i++) {
JSONObject json = arr.getJSONObject(i); JSONObject json = arr.getJSONObject(i);
SurProjectAttendanceGroup group=SurProjectAttendanceGroup.createHuazhu(json); QuartzProjectAttendanceGroup group= QuartzProjectAttendanceGroup.createHuazhu(json);
group.setCfgid(it.getId()); group.setCfgid(it.getId());
group.setAppId(jdata.getString("appId")); group.setAppId(jdata.getString("appId"));
attendanceGroupService.add(group); attendanceGroupService.add(group);
@ -193,17 +188,17 @@ public class AttendanceHuazhuTask {
} }
private void syncAttendanceData(long startTime){ private void syncAttendanceData(long startTime){
SurProjectAttendanceCfg where =new SurProjectAttendanceCfg(); QuartzProjectAttendanceCfg where =new QuartzProjectAttendanceCfg();
where.setEnabled(1l); where.setEnabled(1l);
where.setIsDel(0l); where.setIsDel(0l);
where.setVendorsCode("huazhu"); where.setVendorsCode("huazhu");
List<SurProjectAttendanceCfg> list=attendanceCfgService.selectSurProjectAttendanceCfgList(where); List<QuartzProjectAttendanceCfg> list=attendanceCfgService.selectSurProjectAttendanceCfgList(where);
Map<String,Object> map=new HashMap<>(); Map<String,Object> map=new HashMap<>();
long endTime=DateUtil.current(); long endTime=DateUtil.current();
//map.put("endTime",endTime); //map.put("endTime",endTime);
map.put("startTime",startTime); map.put("startTime",startTime);
for(SurProjectAttendanceCfg it :list){ for(QuartzProjectAttendanceCfg it :list){
String param= it.getVendorsParameter(); String param= it.getVendorsParameter();
if(Strings.isNotEmpty(param)){ if(Strings.isNotEmpty(param)){
try{ try{
@ -220,18 +215,18 @@ public class AttendanceHuazhuTask {
/** /**
* *
*/ */
public void syncAllAttendanceData(){ public void syncAllAttendanceData(){
SurProjectAttendanceCfg where =new SurProjectAttendanceCfg(); QuartzProjectAttendanceCfg where =new QuartzProjectAttendanceCfg();
where.setEnabled(1l); where.setEnabled(1l);
where.setIsDel(0l); where.setIsDel(0l);
where.setVendorsCode("huazhu"); where.setVendorsCode("huazhu");
List<SurProjectAttendanceCfg> list=attendanceCfgService.selectSurProjectAttendanceCfgList(where); List<QuartzProjectAttendanceCfg> list=attendanceCfgService.selectSurProjectAttendanceCfgList(where);
for(SurProjectAttendanceCfg it :list){ for(QuartzProjectAttendanceCfg it :list){
String param= it.getVendorsParameter(); String param= it.getVendorsParameter();
if(Strings.isNotEmpty(param)){ if(Strings.isNotEmpty(param)){
try{ try{
JSONObject jo=JSON.parseObject(param); JSONObject jo=JSON.parseObject(param);
SurProjectAttendanceData attWhere=new SurProjectAttendanceData(); QuartzProjectAttendanceData attWhere=new QuartzProjectAttendanceData();
attWhere.setId(it.getId()); attWhere.setId(it.getId());
Long page=attendanceDataService.getHuazhuPage(attWhere); Long page=attendanceDataService.getHuazhuPage(attWhere);
if(null==page){ if(null==page){
@ -246,7 +241,8 @@ public class AttendanceHuazhuTask {
} }
} }
} }
private void doSyncAttendanceData(JSONObject jdata,long page,SurProjectAttendanceCfg it,Map<String,Object> ps){
private void doSyncAttendanceData(JSONObject jdata, long page, QuartzProjectAttendanceCfg it, Map<String,Object> ps){
String path="/api/open/labour/findCardRecordByPage"; String path="/api/open/labour/findCardRecordByPage";
Request request=getRequest(path,jdata,page,ps); Request request=getRequest(path,jdata,page,ps);
String data=AttendanceTask.getResult(request); String data=AttendanceTask.getResult(request);
@ -257,7 +253,7 @@ public class AttendanceHuazhuTask {
if(arr!=null && arr.size()>0){ if(arr!=null && arr.size()>0){
for(int i=0;i<arr.size();i++) { for(int i=0;i<arr.size();i++) {
JSONObject json = arr.getJSONObject(i); JSONObject json = arr.getJSONObject(i);
SurProjectAttendanceData sdata = SurProjectAttendanceData.createFromHuazhu(json); QuartzProjectAttendanceData sdata = QuartzProjectAttendanceData.createFromHuazhu(json);
sdata.setVendorId(page); //VendorId保存华筑的页 sdata.setVendorId(page); //VendorId保存华筑的页
sdata.setCfgid(it.getId()); sdata.setCfgid(it.getId());
sdata.setAppId(jdata.getString("appId")); sdata.setAppId(jdata.getString("appId"));
@ -274,12 +270,12 @@ public class AttendanceHuazhuTask {
* *
*/ */
public void syncWorker(){ public void syncWorker(){
SurProjectAttendanceCfg where =new SurProjectAttendanceCfg(); QuartzProjectAttendanceCfg where =new QuartzProjectAttendanceCfg();
where.setEnabled(1l); where.setEnabled(1l);
where.setIsDel(0l); where.setIsDel(0l);
where.setVendorsCode("huazhu"); where.setVendorsCode("huazhu");
List<SurProjectAttendanceCfg> list=attendanceCfgService.selectSurProjectAttendanceCfgList(where); List<QuartzProjectAttendanceCfg> list=attendanceCfgService.selectSurProjectAttendanceCfgList(where);
for(SurProjectAttendanceCfg it :list){ for(QuartzProjectAttendanceCfg it :list){
String param= it.getVendorsParameter(); String param= it.getVendorsParameter();
if(Strings.isNotEmpty(param)){ if(Strings.isNotEmpty(param)){
try{ try{
@ -292,10 +288,12 @@ public class AttendanceHuazhuTask {
} }
} }
} }
public static Request getRequest(String path,JSONObject jo,long page) {
public static Request getRequest(String path,JSONObject jo,long page) {
return getRequest(path,jo,page,null); return getRequest(path,jo,page,null);
} }
public static Request getRequest(String path,JSONObject jo,long page,Map<String,Object> ps){
public static Request getRequest(String path,JSONObject jo,long page,Map<String,Object> ps){
String appId=jo.getString("appId"); String appId=jo.getString("appId");
String secret=jo.getString("secret"); String secret=jo.getString("secret");
String projectId=jo.getString("projectId"); String projectId=jo.getString("projectId");
@ -326,7 +324,8 @@ public class AttendanceHuazhuTask {
.build(); .build();
return request; return request;
} }
private void doSyncWorker(JSONObject jdata,long page,SurProjectAttendanceCfg it){
private void doSyncWorker(JSONObject jdata, long page, QuartzProjectAttendanceCfg it){
String path="/api/open/labour/findLabourWorkerByPage"; String path="/api/open/labour/findLabourWorkerByPage";
Request request=getRequest(path,jdata,page); Request request=getRequest(path,jdata,page);
String data=AttendanceTask.getResult(request); String data=AttendanceTask.getResult(request);
@ -337,7 +336,7 @@ public class AttendanceHuazhuTask {
if(arr!=null && arr.size()>0){ if(arr!=null && arr.size()>0){
for(int i=0;i<arr.size();i++){ for(int i=0;i<arr.size();i++){
JSONObject json=arr.getJSONObject(i); JSONObject json=arr.getJSONObject(i);
SurProjectAttendanceUser user=SurProjectAttendanceUser.createFromHuazhu(json); QuartzProjectAttendanceUser user= QuartzProjectAttendanceUser.createFromHuazhu(json);
user.setVendorsCode(it.getVendorsCode()); user.setVendorsCode(it.getVendorsCode());
user.setCfgid(it.getId()); user.setCfgid(it.getId());
user.setAppId(jdata.getString("appId")); user.setAppId(jdata.getString("appId"));

View File

@ -1,10 +1,9 @@
package com.yanzhu.jh.project.task; package com.ruoyi.quartz.task;
import cn.hutool.core.codec.Base64; import cn.hutool.core.codec.Base64;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil; import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSON;
@ -15,45 +14,38 @@ import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.file.FileUtils; import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.common.utils.sign.Md5Utils; import com.ruoyi.common.utils.sign.Md5Utils;
import com.yanzhu.jh.base.domain.SysNative; import com.ruoyi.quartz.domain.*;
import com.yanzhu.jh.base.service.ISysNativeService; import com.ruoyi.quartz.service.*;
import com.yanzhu.jh.project.domain.SurProjectAttendanceCfg;
import com.yanzhu.jh.project.domain.SurProjectAttendanceData;
import com.yanzhu.jh.project.domain.SurProjectAttendanceGroup;
import com.yanzhu.jh.project.domain.SurProjectAttendanceUser;
import com.yanzhu.jh.project.service.ISurProjectAttendanceCfgService;
import com.yanzhu.jh.project.service.ISurProjectAttendanceDataService;
import com.yanzhu.jh.project.service.ISurProjectAttendanceGroupService;
import com.yanzhu.jh.project.service.ISurProjectAttendanceUserService;
import okhttp3.*; import okhttp3.*;
import org.apache.logging.log4j.util.Strings; import org.apache.logging.log4j.util.Strings;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.io.File; import java.io.File;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@Component("attendanceJgwTask") @Component("attendanceJgwTask")
public class AttendanceJgwTask { public class AttendanceJgwTask {
@Autowired
ISurProjectAttendanceUserService attendanceUserService;
@Autowired
ISurProjectAttendanceCfgService attendanceCfgService;
@Autowired
ISurProjectAttendanceDataService attendanceDataService;
@Autowired
ISurProjectAttendanceGroupService attendanceGroupService;
@Autowired @Autowired
private RedisCache redisCache; private RedisCache redisCache;
@Autowired @Autowired
private ISysNativeService sysNativeService; private ISysNativeService sysNativeService;
@Autowired
IQuartzProjectAttendanceUserService attendanceUserService;
@Autowired
IQuartzProjectAttendanceCfgService attendanceCfgService;
@Autowired
IQuartzProjectAttendanceDataService attendanceDataService;
@Autowired
IQuartzProjectAttendanceGroupService attendanceGroupService;
private String getNative(long id){ private String getNative(long id){
String ckey="attendance_jgw_native_"+id; String ckey="attendance_jgw_native_"+id;
Object obj=redisCache.getCacheObject(ckey); Object obj=redisCache.getCacheObject(ckey);
@ -167,11 +159,11 @@ public class AttendanceJgwTask {
private void clearDatePhone(String path,String url){ private void clearDatePhone(String path,String url){
File file=new File(path); File file=new File(path);
if(file.isDirectory()){ if(file.isDirectory()){
SurProjectAttendanceData where=new SurProjectAttendanceData(); QuartzProjectAttendanceData where=new QuartzProjectAttendanceData();
where.setScanPhoto(url); where.setScanPhoto(url);
List<SurProjectAttendanceData> list=attendanceDataService.selectSurProjectAttendanceDataList(where); List<QuartzProjectAttendanceData> list=attendanceDataService.selectSurProjectAttendanceDataList(where);
List<String> names=new ArrayList<>(); List<String> names=new ArrayList<>();
for(SurProjectAttendanceData it:list){ for(QuartzProjectAttendanceData it:list){
names.add(it.getScanPhoto()); names.add(it.getScanPhoto());
} }
for(String f : file.list()){ for(String f : file.list()){
@ -362,6 +354,7 @@ public class AttendanceJgwTask {
} }
return map; return map;
} }
public static void findAttendanceByProject(String appId,String token,String projectId,String startId){ public static void findAttendanceByProject(String appId,String token,String projectId,String startId){
String path="/webapi/project/findAttendanceByProject"; String path="/webapi/project/findAttendanceByProject";
String time = System.currentTimeMillis() + ""; String time = System.currentTimeMillis() + "";
@ -394,7 +387,7 @@ public class AttendanceJgwTask {
String photo=json.getString("signimg"); String photo=json.getString("signimg");
System.out.println(json.getString("machineType")); System.out.println(json.getString("machineType"));
String photoUrl=getPhoto(appId,token,photo); String photoUrl=getPhoto(appId,token,photo);
SurProjectAttendanceData sdata = SurProjectAttendanceData.createFromJgw(json); QuartzProjectAttendanceData sdata = QuartzProjectAttendanceData.createFromJgw(json);
if(sdata.getWorkerId().equals("63e0e09858624979b97291977afe352b")){ if(sdata.getWorkerId().equals("63e0e09858624979b97291977afe352b")){
System.out.println("--->"+sdata.getRemark()); System.out.println("--->"+sdata.getRemark());
} }
@ -522,7 +515,7 @@ public class AttendanceJgwTask {
if(arr.size()>0){ if(arr.size()>0){
for(int i=0;i<arr.size();i++){ for(int i=0;i<arr.size();i++){
JSONObject json=arr.getJSONObject(i); JSONObject json=arr.getJSONObject(i);
SurProjectAttendanceGroup group=SurProjectAttendanceGroup.createJgw(json,false); QuartzProjectAttendanceGroup group= QuartzProjectAttendanceGroup.createJgw(json,false);
group.setBizLicense(json.getString("corpCode")); group.setBizLicense(json.getString("corpCode"));
String type=json.getString("corpType"); String type=json.getString("corpType");
if("009".equals(type)){ //总包人员 if("009".equals(type)){ //总包人员
@ -565,7 +558,7 @@ public class AttendanceJgwTask {
if(arr.size()>0){ if(arr.size()>0){
for(int i=0;i<arr.size();i++){ for(int i=0;i<arr.size();i++){
JSONObject json=arr.getJSONObject(i); JSONObject json=arr.getJSONObject(i);
SurProjectAttendanceGroup group=SurProjectAttendanceGroup.createJgw(json,true); QuartzProjectAttendanceGroup group= QuartzProjectAttendanceGroup.createJgw(json,true);
group.setBizLicense(json.getString("corpCode")); group.setBizLicense(json.getString("corpCode"));
String type=json.getString("corpType"); String type=json.getString("corpType");
if("009".equals(type)){ //总包人员 if("009".equals(type)){ //总包人员
@ -610,7 +603,7 @@ public class AttendanceJgwTask {
if(arr.size()>0){ if(arr.size()>0){
for(int i=0;i<arr.size();i++){ for(int i=0;i<arr.size();i++){
JSONObject json=arr.getJSONObject(i); JSONObject json=arr.getJSONObject(i);
SurProjectAttendanceGroup group=SurProjectAttendanceGroup.createJgw(json,true); QuartzProjectAttendanceGroup group= QuartzProjectAttendanceGroup.createJgw(json,true);
group.setBizLicense(json.getString("corpCode")); group.setBizLicense(json.getString("corpCode"));
String type=json.getString("corpType"); String type=json.getString("corpType");
if("009".equals(type)){ //总包人员 if("009".equals(type)){ //总包人员
@ -664,7 +657,7 @@ public class AttendanceJgwTask {
if("02".equals(workerStatus)){ if("02".equals(workerStatus)){
cnt++; cnt++;
} }
SurProjectAttendanceUser user=SurProjectAttendanceUser.createFromJgw(json); QuartzProjectAttendanceUser user= QuartzProjectAttendanceUser.createFromJgw(json);
if(user.getName().equals("唐红吉")){ if(user.getName().equals("唐红吉")){
String k=user.getName(); String k=user.getName();
JSONArray arr2= json.getJSONArray("corpName"); JSONArray arr2= json.getJSONArray("corpName");
@ -707,7 +700,7 @@ public class AttendanceJgwTask {
if("02".equals(workerStatus)){ if("02".equals(workerStatus)){
cnt++; cnt++;
} }
SurProjectAttendanceUser user=SurProjectAttendanceUser.createFromJgw(json); QuartzProjectAttendanceUser user= QuartzProjectAttendanceUser.createFromJgw(json);
if(user.getName().equals("李文国")){ if(user.getName().equals("李文国")){
String k=user.getName(); String k=user.getName();
JSONArray arr2= json.getJSONArray("corpName"); JSONArray arr2= json.getJSONArray("corpName");
@ -722,12 +715,12 @@ public class AttendanceJgwTask {
* *
*/ */
public void syncWorker(){ public void syncWorker(){
SurProjectAttendanceCfg where =new SurProjectAttendanceCfg(); QuartzProjectAttendanceCfg where =new QuartzProjectAttendanceCfg();
where.setEnabled(1l); where.setEnabled(1l);
where.setIsDel(0l); where.setIsDel(0l);
where.setVendorsCode("jgw"); where.setVendorsCode("jgw");
List<SurProjectAttendanceCfg> list=attendanceCfgService.selectSurProjectAttendanceCfgList(where); List<QuartzProjectAttendanceCfg> list=attendanceCfgService.selectSurProjectAttendanceCfgList(where);
for(SurProjectAttendanceCfg it :list){ for(QuartzProjectAttendanceCfg it :list){
String param= it.getVendorsParameter(); String param= it.getVendorsParameter();
if(Strings.isNotEmpty(param)){ if(Strings.isNotEmpty(param)){
try{ try{
@ -751,12 +744,12 @@ public class AttendanceJgwTask {
* *
*/ */
public void syncWorkerByLeader(){ public void syncWorkerByLeader(){
SurProjectAttendanceCfg where =new SurProjectAttendanceCfg(); QuartzProjectAttendanceCfg where =new QuartzProjectAttendanceCfg();
where.setEnabled(1l); where.setEnabled(1l);
where.setIsDel(0l); where.setIsDel(0l);
where.setVendorsCode("jgw"); where.setVendorsCode("jgw");
List<SurProjectAttendanceCfg> list=attendanceCfgService.selectSurProjectAttendanceCfgList(where); List<QuartzProjectAttendanceCfg> list=attendanceCfgService.selectSurProjectAttendanceCfgList(where);
for(SurProjectAttendanceCfg it :list){ for(QuartzProjectAttendanceCfg it :list){
String param= it.getVendorsParameter(); String param= it.getVendorsParameter();
if(Strings.isNotEmpty(param)){ if(Strings.isNotEmpty(param)){
try{ try{
@ -767,11 +760,11 @@ public class AttendanceJgwTask {
jo.put("secret",secret); jo.put("secret",secret);
String token= getToken(appId,secret); String token= getToken(appId,secret);
jo.put("token",token); jo.put("token",token);
SurProjectAttendanceGroup groupWhere=new SurProjectAttendanceGroup(); QuartzProjectAttendanceGroup groupWhere=new QuartzProjectAttendanceGroup();
groupWhere.setCfgid(it.getId()); groupWhere.setCfgid(it.getId());
groupWhere.setLeaderPhone("directly"); groupWhere.setLeaderPhone("directly");
List<SurProjectAttendanceGroup> groupList=attendanceGroupService.selectSurProjectAttendanceGroupList(groupWhere); List<QuartzProjectAttendanceGroup> groupList=attendanceGroupService.selectSurProjectAttendanceGroupList(groupWhere);
for(SurProjectAttendanceGroup g:groupList) { for(QuartzProjectAttendanceGroup g:groupList) {
if(StrUtil.isNotEmpty(g.getLeaderName()) && StrUtil.isNotEmpty(g.getCompanyId())) { if(StrUtil.isNotEmpty(g.getLeaderName()) && StrUtil.isNotEmpty(g.getCompanyId())) {
jo.put("subcontractorId", g.getLeaderName()); jo.put("subcontractorId", g.getLeaderName());
jo.put("leaderTeamId", g.getCompanyId()); jo.put("leaderTeamId", g.getCompanyId());
@ -786,7 +779,7 @@ public class AttendanceJgwTask {
} }
} }
private void dosyncWorkerByLeader(JSONObject jo, long startId, SurProjectAttendanceCfg it){ private void dosyncWorkerByLeader(JSONObject jo, long startId, QuartzProjectAttendanceCfg it){
String appId=jo.getString("appId"); String appId=jo.getString("appId");
String token=jo.getString("token"); String token=jo.getString("token");
String path="/webapi/project/findWorkerByLeader"; String path="/webapi/project/findWorkerByLeader";
@ -813,12 +806,12 @@ public class AttendanceJgwTask {
for(int i=0;i<arr.size();i++){ for(int i=0;i<arr.size();i++){
JSONObject json=arr.getJSONObject(i); JSONObject json=arr.getJSONObject(i);
String workerId=json.getString("workerId"); String workerId=json.getString("workerId");
SurProjectAttendanceUser userWhere=new SurProjectAttendanceUser(); QuartzProjectAttendanceUser userWhere=new QuartzProjectAttendanceUser();
userWhere.setWorkerId(workerId); userWhere.setWorkerId(workerId);
userWhere.setCfgid(it.getId()); userWhere.setCfgid(it.getId());
List<SurProjectAttendanceUser> userList=attendanceUserService.selectSurProjectAttendanceUserList(userWhere); List<QuartzProjectAttendanceUser> userList=attendanceUserService.selectSurProjectAttendanceUserList(userWhere);
if(userList.size()>0){ if(userList.size()>0){
SurProjectAttendanceUser upUser=userList.get(0); QuartzProjectAttendanceUser upUser=userList.get(0);
upUser.setCompanyId(json.getString("leaderTeamId")); upUser.setCompanyId(json.getString("leaderTeamId"));
upUser.setWorkTypeName(json.getString("jobType")); upUser.setWorkTypeName(json.getString("jobType"));
upUser.setCompanyName(jo.getString("companyName")); upUser.setCompanyName(jo.getString("companyName"));
@ -827,7 +820,7 @@ public class AttendanceJgwTask {
} }
} }
} }
private void doSyncWorker(JSONObject jo, long startId, SurProjectAttendanceCfg it) { private void doSyncWorker(JSONObject jo, long startId, QuartzProjectAttendanceCfg it) {
String appId=jo.getString("appId"); String appId=jo.getString("appId");
String token=jo.getString("token"); String token=jo.getString("token");
String projectId=jo.getString("projectId"); String projectId=jo.getString("projectId");
@ -855,7 +848,7 @@ public class AttendanceJgwTask {
if(arr.size()>0) { if(arr.size()>0) {
for(int i=0;i<arr.size();i++){ for(int i=0;i<arr.size();i++){
JSONObject json=arr.getJSONObject(i); JSONObject json=arr.getJSONObject(i);
SurProjectAttendanceUser user=SurProjectAttendanceUser.createFromJgw(json); QuartzProjectAttendanceUser user= QuartzProjectAttendanceUser.createFromJgw(json);
user.setVendorsCode(it.getVendorsCode()); user.setVendorsCode(it.getVendorsCode());
user.setCfgid(it.getId()); user.setCfgid(it.getId());
user.setAppId(appId); user.setAppId(appId);
@ -881,12 +874,12 @@ public class AttendanceJgwTask {
* *
*/ */
public void syncGroup(){ public void syncGroup(){
SurProjectAttendanceCfg where =new SurProjectAttendanceCfg(); QuartzProjectAttendanceCfg where =new QuartzProjectAttendanceCfg();
where.setEnabled(1l); where.setEnabled(1l);
where.setIsDel(0l); where.setIsDel(0l);
where.setVendorsCode("jgw"); where.setVendorsCode("jgw");
List<SurProjectAttendanceCfg> list=attendanceCfgService.selectSurProjectAttendanceCfgList(where); List<QuartzProjectAttendanceCfg> list=attendanceCfgService.selectSurProjectAttendanceCfgList(where);
for(SurProjectAttendanceCfg it :list){ for(QuartzProjectAttendanceCfg it :list){
String param= it.getVendorsParameter(); String param= it.getVendorsParameter();
if(Strings.isNotEmpty(param)){ if(Strings.isNotEmpty(param)){
try{ try{
@ -913,7 +906,7 @@ public class AttendanceJgwTask {
* @param startId * @param startId
* @param it * @param it
*/ */
private void doSyncProContractor(JSONObject jo, long startId, SurProjectAttendanceCfg it) { private void doSyncProContractor(JSONObject jo, long startId, QuartzProjectAttendanceCfg it) {
String appId=jo.getString("appId"); String appId=jo.getString("appId");
String token=jo.getString("token"); String token=jo.getString("token");
String projectId=jo.getString("projectId"); String projectId=jo.getString("projectId");
@ -943,7 +936,7 @@ public class AttendanceJgwTask {
for(int i=0;i<arr.size();i++){ for(int i=0;i<arr.size();i++){
JSONObject json=arr.getJSONObject(i); JSONObject json=arr.getJSONObject(i);
rowId=json.getLong("id"); rowId=json.getLong("id");
SurProjectAttendanceGroup group=SurProjectAttendanceGroup.createJgw(json,true); QuartzProjectAttendanceGroup group= QuartzProjectAttendanceGroup.createJgw(json,true);
group.setBizLicense(json.getString("corpCode")); group.setBizLicense(json.getString("corpCode"));
String type=json.getString("corpType"); String type=json.getString("corpType");
if("009".equals(type)){ //总包人员 if("009".equals(type)){ //总包人员
@ -971,7 +964,7 @@ public class AttendanceJgwTask {
* @param startId * @param startId
* @param it * @param it
*/ */
private void doSyncDirectlyUnderGroup(JSONObject jo, long startId, SurProjectAttendanceCfg it) { private void doSyncDirectlyUnderGroup(JSONObject jo, long startId, QuartzProjectAttendanceCfg it) {
String appId=jo.getString("appId"); String appId=jo.getString("appId");
String token=jo.getString("token"); String token=jo.getString("token");
String projectId=jo.getString("projectId"); String projectId=jo.getString("projectId");
@ -1002,14 +995,14 @@ public class AttendanceJgwTask {
long rowId=0; long rowId=0;
for(int i=0;i<arr.size();i++){ for(int i=0;i<arr.size();i++){
JSONObject json=arr.getJSONObject(i); JSONObject json=arr.getJSONObject(i);
SurProjectAttendanceGroup group=SurProjectAttendanceGroup.createJgw(json,true); QuartzProjectAttendanceGroup group= QuartzProjectAttendanceGroup.createJgw(json,true);
group.setCfgid(it.getId()); group.setCfgid(it.getId());
group.setAppId(appId); group.setAppId(appId);
rowId=json.getLong("id"); rowId=json.getLong("id");
SurProjectAttendanceGroup where=new SurProjectAttendanceGroup(); QuartzProjectAttendanceGroup where=new QuartzProjectAttendanceGroup();
where.setCompanyId(group.getCompanyId()); where.setCompanyId(group.getCompanyId());
where.setCfgid(group.getCfgid()); where.setCfgid(group.getCfgid());
List<SurProjectAttendanceGroup> list=attendanceGroupService.selectSurProjectAttendanceGroupList(where); List<QuartzProjectAttendanceGroup> list=attendanceGroupService.selectSurProjectAttendanceGroupList(where);
if(list.size()==0){ if(list.size()==0){
attendanceGroupService.add(group); attendanceGroupService.add(group);
}else{ }else{
@ -1029,7 +1022,7 @@ public class AttendanceJgwTask {
* @param startId * @param startId
* @param it * @param it
*/ */
private void doSyncGroup(JSONObject jo, long startId, SurProjectAttendanceCfg it) { private void doSyncGroup(JSONObject jo, long startId, QuartzProjectAttendanceCfg it) {
String appId=jo.getString("appId"); String appId=jo.getString("appId");
String token=jo.getString("token"); String token=jo.getString("token");
String projectId=jo.getString("projectId"); String projectId=jo.getString("projectId");
@ -1058,14 +1051,14 @@ public class AttendanceJgwTask {
long rowId=0; long rowId=0;
for(int i=0;i<arr.size();i++){ for(int i=0;i<arr.size();i++){
JSONObject json=arr.getJSONObject(i); JSONObject json=arr.getJSONObject(i);
SurProjectAttendanceGroup group=SurProjectAttendanceGroup.createJgw(json,false); QuartzProjectAttendanceGroup group= QuartzProjectAttendanceGroup.createJgw(json,false);
group.setCfgid(it.getId()); group.setCfgid(it.getId());
group.setAppId(appId); group.setAppId(appId);
rowId=json.getLong("id"); rowId=json.getLong("id");
SurProjectAttendanceGroup where=new SurProjectAttendanceGroup(); QuartzProjectAttendanceGroup where=new QuartzProjectAttendanceGroup();
where.setCompanyId(group.getCompanyId()); where.setCompanyId(group.getCompanyId());
where.setCfgid(group.getCfgid()); where.setCfgid(group.getCfgid());
List<SurProjectAttendanceGroup> list=attendanceGroupService.selectSurProjectAttendanceGroupList(where); List<QuartzProjectAttendanceGroup> list=attendanceGroupService.selectSurProjectAttendanceGroupList(where);
if(list.size()==0){ if(list.size()==0){
attendanceGroupService.add(group); attendanceGroupService.add(group);
} }
@ -1107,12 +1100,12 @@ public class AttendanceJgwTask {
private void syncAttendanceData(String dtStart,String dtEnd){ private void syncAttendanceData(String dtStart,String dtEnd){
SurProjectAttendanceCfg where =new SurProjectAttendanceCfg(); QuartzProjectAttendanceCfg where =new QuartzProjectAttendanceCfg();
where.setEnabled(1l); where.setEnabled(1l);
where.setIsDel(0l); where.setIsDel(0l);
where.setVendorsCode("jgw"); where.setVendorsCode("jgw");
List<SurProjectAttendanceCfg> list=attendanceCfgService.selectSurProjectAttendanceCfgList(where); List<QuartzProjectAttendanceCfg> list=attendanceCfgService.selectSurProjectAttendanceCfgList(where);
for(SurProjectAttendanceCfg it :list){ for(QuartzProjectAttendanceCfg it :list){
String param= it.getVendorsParameter(); String param= it.getVendorsParameter();
if(Strings.isNotEmpty(param)){ if(Strings.isNotEmpty(param)){
try{ try{
@ -1133,7 +1126,7 @@ public class AttendanceJgwTask {
} }
} }
private void doSyncAttendanceData(JSONObject jo, String startId, SurProjectAttendanceCfg it) { private void doSyncAttendanceData(JSONObject jo, String startId, QuartzProjectAttendanceCfg it) {
String appId=jo.getString("appId"); String appId=jo.getString("appId");
String token=jo.getString("token"); String token=jo.getString("token");
String projectId=jo.getString("projectId"); String projectId=jo.getString("projectId");
@ -1168,7 +1161,7 @@ public class AttendanceJgwTask {
JSONObject json = arr.getJSONObject(i); JSONObject json = arr.getJSONObject(i);
String photo=json.getString("signimg"); String photo=json.getString("signimg");
String photoUrl=getPhoto(appId,token,photo); String photoUrl=getPhoto(appId,token,photo);
SurProjectAttendanceData sdata = SurProjectAttendanceData.createFromJgw(json); QuartzProjectAttendanceData sdata = QuartzProjectAttendanceData.createFromJgw(json);
sdata.setScanPhoto(photoUrl); sdata.setScanPhoto(photoUrl);
sdata.setCfgid(it.getId()); sdata.setCfgid(it.getId());
sdata.setAppId(appId); sdata.setAppId(appId);

View File

@ -1,22 +1,13 @@
package com.yanzhu.jh.project.task; package com.ruoyi.quartz.task;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.common.constant.Constants; import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.core.redis.RedisCache;
import com.yanzhu.jh.base.domain.SysNative; import com.ruoyi.quartz.domain.*;
import com.yanzhu.jh.base.service.ISysNativeService; import com.ruoyi.quartz.service.*;
import com.yanzhu.jh.project.domain.SurProjectAttendanceCfg;
import com.yanzhu.jh.project.domain.SurProjectAttendanceData;
import com.yanzhu.jh.project.domain.SurProjectAttendanceGroup;
import com.yanzhu.jh.project.domain.SurProjectAttendanceUser;
import com.yanzhu.jh.project.service.ISurProjectAttendanceCfgService;
import com.yanzhu.jh.project.service.ISurProjectAttendanceDataService;
import com.yanzhu.jh.project.service.ISurProjectAttendanceGroupService;
import com.yanzhu.jh.project.service.ISurProjectAttendanceUserService;
import okhttp3.HttpUrl; import okhttp3.HttpUrl;
import okhttp3.OkHttpClient; import okhttp3.OkHttpClient;
import okhttp3.Request; import okhttp3.Request;
@ -34,22 +25,24 @@ import java.util.stream.Collectors;
@Component("attendanceTask") @Component("attendanceTask")
public class AttendanceTask { public class AttendanceTask {
@Autowired
ISurProjectAttendanceUserService attendanceUserService;
@Autowired
ISurProjectAttendanceCfgService attendanceCfgService;
@Autowired
ISurProjectAttendanceDataService attendanceDataService;
@Autowired
ISurProjectAttendanceGroupService attendanceGroupService;
@Autowired @Autowired
private RedisCache redisCache; private RedisCache redisCache;
@Autowired @Autowired
private ISysNativeService sysNativeService; private ISysNativeService sysNativeService;
@Autowired
IQuartzProjectAttendanceUserService attendanceUserService;
@Autowired
IQuartzProjectAttendanceCfgService attendanceCfgService;
@Autowired
IQuartzProjectAttendanceDataService attendanceDataService;
@Autowired
IQuartzProjectAttendanceGroupService attendanceGroupService;
private String getNative(long id){ private String getNative(long id){
String ckey="attendance_jgw_native_"+id; String ckey="attendance_jgw_native_"+id;
Object obj=redisCache.getCacheObject(ckey); Object obj=redisCache.getCacheObject(ckey);
@ -79,12 +72,12 @@ public class AttendanceTask {
} }
public void syncWorker(){ public void syncWorker(){
SurProjectAttendanceCfg where =new SurProjectAttendanceCfg(); QuartzProjectAttendanceCfg where =new QuartzProjectAttendanceCfg();
where.setEnabled(1l); where.setEnabled(1l);
where.setIsDel(0l); where.setIsDel(0l);
where.setVendorsCode("gld"); where.setVendorsCode("gld");
List<SurProjectAttendanceCfg> list=attendanceCfgService.selectSurProjectAttendanceCfgList(where); List<QuartzProjectAttendanceCfg> list=attendanceCfgService.selectSurProjectAttendanceCfgList(where);
for(SurProjectAttendanceCfg it :list){ for(QuartzProjectAttendanceCfg it :list){
String param= it.getVendorsParameter(); String param= it.getVendorsParameter();
if(Strings.isNotEmpty(param)){ if(Strings.isNotEmpty(param)){
try{ try{
@ -101,12 +94,12 @@ public class AttendanceTask {
} }
public void syncGroup(){ public void syncGroup(){
SurProjectAttendanceCfg where =new SurProjectAttendanceCfg(); QuartzProjectAttendanceCfg where =new QuartzProjectAttendanceCfg();
where.setEnabled(1l); where.setEnabled(1l);
where.setIsDel(0l); where.setIsDel(0l);
where.setVendorsCode("gld"); where.setVendorsCode("gld");
List<SurProjectAttendanceCfg> list=attendanceCfgService.selectSurProjectAttendanceCfgList(where); List<QuartzProjectAttendanceCfg> list=attendanceCfgService.selectSurProjectAttendanceCfgList(where);
for(SurProjectAttendanceCfg it :list){ for(QuartzProjectAttendanceCfg it :list){
String param= it.getVendorsParameter(); String param= it.getVendorsParameter();
if(Strings.isNotEmpty(param)){ if(Strings.isNotEmpty(param)){
try{ try{
@ -122,7 +115,7 @@ public class AttendanceTask {
} }
} }
private void doSyncGroup(String appId, String secret, String projectId, SurProjectAttendanceCfg it) { private void doSyncGroup(String appId, String secret, String projectId, QuartzProjectAttendanceCfg it) {
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("projectId", projectId); params.put("projectId", projectId);
params.put("appid",appId); params.put("appid",appId);
@ -143,7 +136,7 @@ public class AttendanceTask {
if(arr!=null && arr.size()>0) { if(arr!=null && arr.size()>0) {
for (int i = 0; i < arr.size(); i++) { for (int i = 0; i < arr.size(); i++) {
JSONObject json=arr.getJSONObject(i); JSONObject json=arr.getJSONObject(i);
SurProjectAttendanceGroup group=SurProjectAttendanceGroup.create(json); QuartzProjectAttendanceGroup group= QuartzProjectAttendanceGroup.create(json);
group.setAppId(appId); group.setAppId(appId);
group.setCfgid(it.getId()); group.setCfgid(it.getId());
attendanceGroupService.add(group); attendanceGroupService.add(group);
@ -151,7 +144,7 @@ public class AttendanceTask {
} }
} }
private void doSyncWorker(String appid,String secret,String projectld,int page,SurProjectAttendanceCfg it){ private void doSyncWorker(String appid, String secret, String projectld, int page, QuartzProjectAttendanceCfg it){
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("projectId", projectld); params.put("projectId", projectld);
params.put("start", "2000-01-01 00:00:00"); params.put("start", "2000-01-01 00:00:00");
@ -176,7 +169,7 @@ public class AttendanceTask {
if(arr!=null && arr.size()>0){ if(arr!=null && arr.size()>0){
for(int i=0;i<arr.size();i++){ for(int i=0;i<arr.size();i++){
JSONObject json=arr.getJSONObject(i); JSONObject json=arr.getJSONObject(i);
SurProjectAttendanceUser user=SurProjectAttendanceUser.create(json); QuartzProjectAttendanceUser user= QuartzProjectAttendanceUser.create(json);
String idNumber=json.getString("identification");//身份证 String idNumber=json.getString("identification");//身份证
if(StrUtil.isNotEmpty(idNumber) && idNumber.length()>6){ if(StrUtil.isNotEmpty(idNumber) && idNumber.length()>6){
try { try {
@ -199,18 +192,14 @@ public class AttendanceTask {
doSyncWorker(appid,secret,projectld,page+1,it); doSyncWorker(appid,secret,projectld,page+1,it);
} }
} }
public static void main1(String[] args) {
//syncWorker("8fba899a21c64be4aa25bf0f3314ad5c","426b3d8280620176d80a826eebef3579","719148569880576",1);
//doSyncAttendanceData("8fba899a21c64be4aa25bf0f3314ad5c","426b3d8280620176d80a826eebef3579","719148569880576",0,null);
}
public void syncAttendanceData(){ public void syncAttendanceData(){
SurProjectAttendanceCfg where =new SurProjectAttendanceCfg(); QuartzProjectAttendanceCfg where =new QuartzProjectAttendanceCfg();
where.setEnabled(1l); where.setEnabled(1l);
where.setIsDel(0l); where.setIsDel(0l);
where.setVendorsCode("gld"); where.setVendorsCode("gld");
List<SurProjectAttendanceCfg> list=attendanceCfgService.selectSurProjectAttendanceCfgList(where); List<QuartzProjectAttendanceCfg> list=attendanceCfgService.selectSurProjectAttendanceCfgList(where);
for(SurProjectAttendanceCfg it :list){ for(QuartzProjectAttendanceCfg it :list){
String param= it.getVendorsParameter(); String param= it.getVendorsParameter();
if(Strings.isNotEmpty(param)){ if(Strings.isNotEmpty(param)){
try{ try{
@ -218,7 +207,7 @@ public class AttendanceTask {
String appId=jo.getString("appId"); String appId=jo.getString("appId");
String secret=jo.getString("secret"); String secret=jo.getString("secret");
String projectId=jo.getString("projectId"); String projectId=jo.getString("projectId");
SurProjectAttendanceData dwhere=new SurProjectAttendanceData(); QuartzProjectAttendanceData dwhere=new QuartzProjectAttendanceData();
dwhere.setCfgid(it.getId()); dwhere.setCfgid(it.getId());
String startId=attendanceDataService.getLastServerId(dwhere); String startId=attendanceDataService.getLastServerId(dwhere);
doSyncAttendanceData(appId,secret,projectId,startId,it); doSyncAttendanceData(appId,secret,projectId,startId,it);
@ -228,7 +217,8 @@ public class AttendanceTask {
} }
} }
} }
private void doSyncAttendanceData(String appid,String secret,String projectId,String id,SurProjectAttendanceCfg it){
private void doSyncAttendanceData(String appid, String secret, String projectId, String id, QuartzProjectAttendanceCfg it){
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("projectId", projectId); params.put("projectId", projectId);
params.put("startId",""+id); params.put("startId",""+id);
@ -252,7 +242,7 @@ public class AttendanceTask {
if(arr!=null && arr.size()>0){ if(arr!=null && arr.size()>0){
for(int i=0;i<arr.size();i++){ for(int i=0;i<arr.size();i++){
JSONObject json=arr.getJSONObject(i); JSONObject json=arr.getJSONObject(i);
SurProjectAttendanceData sdata=SurProjectAttendanceData.create(json); QuartzProjectAttendanceData sdata= QuartzProjectAttendanceData.create(json);
lastId=sdata.getServerid(); lastId=sdata.getServerid();
sdata.setCfgid(it.getId()); sdata.setCfgid(it.getId());
sdata.setAppId(appid); sdata.setAppId(appid);

View File

@ -1,8 +1,14 @@
package com.ruoyi.quartz.task; package com.ruoyi.quartz.task;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.quartz.service.ITaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import java.util.*;
/** /**
* *
* *
@ -11,6 +17,12 @@ import com.ruoyi.common.utils.StringUtils;
@Component("ryTask") @Component("ryTask")
public class RyTask public class RyTask
{ {
@Autowired
private RedisCache redisCache;
@Autowired
private ITaskService taskService;
public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i)
{ {
System.out.println(StringUtils.format("执行多参方法: 字符串类型{},布尔类型{},长整型{},浮点型{},整形{}", s, b, l, d, i)); System.out.println(StringUtils.format("执行多参方法: 字符串类型{},布尔类型{},长整型{},浮点型{},整形{}", s, b, l, d, i));
@ -25,4 +37,39 @@ public class RyTask
{ {
System.out.println("执行无参方法"); System.out.println("执行无参方法");
} }
/**
*
*/
public void expiredTowerData()
{
Calendar cal = Calendar.getInstance();
Date date = new Date();
cal.setTime(date);
cal.add(Calendar.DATE,-15);
String dateStr = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,cal.getTime());
Long maxId = taskService.findTowerMaxIdByDate(dateStr);
if(maxId!=null){
taskService.deleteDevTowerDataRunByMaxId(maxId);
}
}
/**
*
*/
public void findDeviceTowerOnline()
{
List<Map<String, Object>> list = taskService.findAllTowerMaxId();
for (Map<String, Object> map:list){
Date date = (Date)map.get("createTime");
long times = System.currentTimeMillis()-(5*60000);
if(date.getTime()<times){
map.put("online","2");
}else{
map.put("online","1");
}
taskService.updateTowerConfigOnline(map);
}
}
} }

View File

@ -0,0 +1,123 @@
<?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.ruoyi.quartz.mapper.QuartzProjectAttendanceCfgMapper">
<resultMap type="QuartzProjectAttendanceCfg" id="SurProjectAttendanceCfgResult">
<result property="id" column="id" />
<result property="projectId" column="project_id" />
<result property="subDeptId" column="sub_dept_id" />
<result property="vendorsCode" column="vendors_code" />
<result property="vendorsParameter" column="vendors_parameter" />
<result property="enabled" column="enabled" />
<result property="state" column="state" />
<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="projectName" column="projectName"/>
<result property="deptName" column="dept_name"/>
<result property="unitName" column="unitName"/>
<result property="vendorName" column="vendorName"/>
</resultMap>
<sql id="selectSurProjectAttendanceCfgVo">
select *
from (
SELECT a.*,sp.projectName,pu.unitName,sdd1.dict_label vendorName FROM sur_project_attendance_cfg a
LEFT JOIN sur_project sp ON a.project_id = sp.id
LEFT JOIN sur_project_unit_info pu ON a.sub_dept_id=pu.unitId AND a.project_id=pu.projectId
LEFT JOIN sys_dict_data sdd1 ON sdd1.dict_type = 'attendance_vendors' AND sdd1.dict_value = a.vendors_code
) sur_project_attendance_cfg
</sql>
<select id="selectSurProjectAttendanceCfgList" parameterType="QuartzProjectAttendanceCfg" resultMap="SurProjectAttendanceCfgResult">
<include refid="selectSurProjectAttendanceCfgVo"/>
<where>
<if test="projectId != null "> and project_id = #{projectId}</if>
<if test="subDeptId != null "> and sub_dept_id = #{subDeptId}</if>
<if test="vendorsCode != null and vendorsCode != ''"> and vendors_code = #{vendorsCode}</if>
<if test="vendorsParameter != null and vendorsParameter != ''"> and vendors_parameter = #{vendorsParameter}</if>
<if test="enabled != null "> and enabled = #{enabled}</if>
<if test="state != null "> and state = #{state}</if>
<if test="isDel != null "> and is_del = #{isDel}</if>
</where>
</select>
<select id="selectSurProjectAttendanceCfgListForAllInfo" parameterType="QuartzProjectAttendanceCfg" resultMap="SurProjectAttendanceCfgResult">
SELECT a.*,b.projectName,c.dept_name
FROM sur_project_attendance_cfg a,sur_project b,sys_dept c WHERE c.dept_id=a.sub_dept_id AND a.project_id=b.id
<if test="id != null "> and a.id = #{id}</if>
</select>
<select id="selectSurProjectAttendanceCfgById" parameterType="Long" resultMap="SurProjectAttendanceCfgResult">
<include refid="selectSurProjectAttendanceCfgVo"/>
where id = #{id}
</select>
<insert id="insertSurProjectAttendanceCfg" parameterType="QuartzProjectAttendanceCfg" useGeneratedKeys="true" keyProperty="id">
insert into sur_project_attendance_cfg
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="projectId != null">project_id,</if>
<if test="subDeptId != null">sub_dept_id,</if>
<if test="vendorsCode != null">vendors_code,</if>
<if test="vendorsParameter != null">vendors_parameter,</if>
<if test="enabled != null">enabled,</if>
<if test="state != null">state,</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="projectId != null">#{projectId},</if>
<if test="subDeptId != null">#{subDeptId},</if>
<if test="vendorsCode != null">#{vendorsCode},</if>
<if test="vendorsParameter != null">#{vendorsParameter},</if>
<if test="enabled != null">#{enabled},</if>
<if test="state != null">#{state},</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="updateSurProjectAttendanceCfg" parameterType="QuartzProjectAttendanceCfg">
update sur_project_attendance_cfg
<trim prefix="SET" suffixOverrides=",">
<if test="projectId != null">project_id = #{projectId},</if>
<if test="subDeptId != null">sub_dept_id = #{subDeptId},</if>
<if test="vendorsCode != null">vendors_code = #{vendorsCode},</if>
<if test="vendorsParameter != null">vendors_parameter = #{vendorsParameter},</if>
<if test="enabled != null">enabled = #{enabled},</if>
<if test="state != null">state = #{state},</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="deleteSurProjectAttendanceCfgById" parameterType="Long">
delete from sur_project_attendance_cfg where id = #{id}
</delete>
<delete id="deleteSurProjectAttendanceCfgByIds" parameterType="String">
delete from sur_project_attendance_cfg where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -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.ruoyi.quartz.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 &lt;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 sur_project_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) &lt;=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 &lt;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) &gt;= 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 project_id in (
SELECT id FROM sur_project WHERE isdel=0 AND deptid = #{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>
<if test="projectId!=null and projectId>0"> and project_id=#{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, sur_project_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 sur_project_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 sur_project WHERE deptid=#{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 sur_project WHERE deptid=#{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, sur_project_attendance_cfg c,view_sur_project_attendance_group g,
sur_project sp
where u.cfgid=c.id and u.companyId=g.companyId and u.state=#{id} and c.project_id = sp.id
and sp.isDel=0 and sp.progressVisible=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.deptId=#{subDeptId}
</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{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.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 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 sur_project sp on sp.id = ady.projectId
where sp.isDel=0 and sp.progressVisible=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.deptId=#{deptId}
</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{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 sur_project_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 sur_project_attendance_cfg where
is_del=0
<if test="projectId!=null and projectId>0">
and projectId=#{projectId}
</if>
and projectId in (select id from sur_project sp where sp.isDel=0 and sp.progressVisible=0
<if test="deptId!=null and deptId>0">
and sp.deptId=#{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.projectType = #{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 sur_project_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 sur_project_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 sur_project_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 sur_project_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 sur_project_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>

View File

@ -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.ruoyi.quartz.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 createTime = #{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 createTime = #{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>

View File

@ -0,0 +1,812 @@
<?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.ruoyi.quartz.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="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.sub_dept_id
FROM sur_project_attendance_user a,sur_project_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.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.sub_dept_id,u.companyName,u.workTypeName,g.teamname groupName,g.companyName remark
FROM sur_project_attendance_user u,sur_project_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 &lt;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="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.sub_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.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.sub_dept_id,g.companyTypeId,g.companyName as remark
FROM sur_project_attendance_user a,sur_project_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 &lt;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="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 sub_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 &lt;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="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 sub_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="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="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="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, 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.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>
<sql id="sqlAttendanceData">
(
SELECT * FROM sur_project_attendance_data WHERE DATE(attendance_time)=date(#{createBy}) AND cfgid IN (
SELECT id FROM sur_project_attendance_cfg WHERE project_id=#{projectId} AND sub_dept_id=#{subDeptId}
) ) xx
</sql>
<select id="queryAttendanceData" parameterType="SurProjectAttendanceCfg" resultMap="SurProjectAttendanceUserResult">
select * from (
select n.*,m.inTime,m.outTime from (
SELECT * FROM (
SELECT workerId,attendance_time inTime,null outtime FROM sur_project_attendance_data WHERE id IN (
SELECT min(id) id FROM <include refid="sqlAttendanceData"/> WHERE attendance_type='e' GROUP BY workerId )) X WHERE workerId NOT IN (
SELECT workerId FROM <include refid="sqlAttendanceData"/> WHERE attendance_type='l' GROUP BY workerId
)
union
select * from (
select workerId,null inTime,attendance_time outTime from sur_project_attendance_data where id in (
select max(id) id from <include refid="sqlAttendanceData"/> where attendance_type='l' group by workerId )) x where workerId not in (
SELECT workerId FROM <include refid="sqlAttendanceData"/> WHERE attendance_type='e' GROUP BY workerId
)
union
select x.workerId,y.attendance_time inTime,x.attendance_time outTime from (
SELECT id,workerId,attendance_time FROM sur_project_attendance_data WHERE id IN (
SELECT MAX(id) id FROM <include refid="sqlAttendanceData"/> WHERE attendance_type='l' GROUP BY workerId )
) x cross join (
SELECT id,workerId,attendance_time FROM sur_project_attendance_data WHERE id IN (
SELECT MIN(id) id FROM <include refid="sqlAttendanceData"/> WHERE attendance_type='e' GROUP BY workerId )
) y on x.workerId=y.workerId
) m left join sur_project_attendance_user n on m.workerId=n.workerId
) oo
</select>
<select id="countAttendance" resultType="Long" parameterType="SurProjectAttendanceCfg">
select count(1) cnt from sur_project_attendance_user u, sur_project_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 sur_project_attendance_cfg WHERE project_id=#{projectId} AND sub_dept_id=#{subDeptId}
) 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, sur_project_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 sur_project_attendance_cfg WHERE project_id=#{projectId} AND sub_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, sur_project_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 sur_project WHERE deptid=#{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="todayAttendanceOld" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
select a.* ,
(select min(attendance_time) from sur_project_attendance_data b where b.workerId=a.workerId and date(b.attendance_time)=CURDATE() and b.attendance_type='e') inTime,
(SELECT Max(attendance_time) FROM sur_project_attendance_data b WHERE b.workerId=a.workerId AND DATE(b.attendance_time)=CURDATE() AND b.attendance_type='l') outTime
from (
select u.* from sur_project_attendance_user u, sur_project_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()
)
<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 sur_project WHERE deptid=#{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} ) a
</select>
<select id="todayAttendance" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
select u.* from sur_project_attendance_user u, sur_project_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 sur_project WHERE deptid=#{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.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,
b.project_id,b.sub_dept_id,u.companyName,u.workTypeName,u.groupName,
b.project_id,b.sub_dept_id, g.teamname remark,g.companyName degreeName
FROM sur_project_attendance_user u,sur_project_attendance_cfg b,view_sur_project_attendance_group g,sur_project sp
WHERE u.cfgid=b.id and u.state=0 and u.companyId=g.companyId and sp.isDel=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.deptId=#{deptId}
</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{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.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,
b.project_id,b.sub_dept_id,u.companyName,u.workTypeName,u.groupName,
b.project_id,b.sub_dept_id, g.teamname remark,g.companyName degreeName,g.companyTypeId
FROM sur_project_attendance_user u,sur_project_attendance_cfg b,view_sur_project_attendance_group g,sur_project sp
WHERE u.cfgid=b.id and u.companyId=g.companyId and sp.isDel=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.projectName NAME,c.dept_name groupName,g.companyTypeId companyId,COUNT(1) cfgid
FROM sur_project_attendance_user u,sur_project_attendance_cfg b,view_sur_project_attendance_group g,sur_project 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.sub_dept_id
and p.isDel=0
and g.companyTypeId in (1,6,0,2,3,4,5,8)
<if test="deptId!=null and deptId>0">
and p.deptId=#{deptId}
</if>
<if test='proType != null and proType != "" and proType != "0"'> and p.projectType = #{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.projectName,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 sur_project_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 sur_project_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 sur_project_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.projectName NAME,c.dept_name groupName,g.companyTypeId companyId,COUNT(1) cfgid
FROM sur_project_attendance_user u,sur_project_attendance_cfg b,view_sur_project_attendance_group g,sur_project 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.sub_dept_id
and p.isDel=0 and p.progressVisible=0
and g.companyTypeId in (1,6,0,2,3,4,5,8)
<if test="deptId!=null and deptId>0">
and p.deptId=#{deptId}
</if>
<if test='proType != null and proType != "" and proType != "0"'> and p.projectType = #{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.projectName,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.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,
b.project_id,b.sub_dept_id,u.companyName,u.workTypeName,u.groupName,
b.project_id,b.sub_dept_id, g.teamname remark,g.companyName degreeName
FROM sur_project_attendance_user u,sur_project_attendance_cfg b,view_sur_project_attendance_group g,sur_project sp
WHERE u.cfgid=b.id and u.state=#{state} and u.companyId=g.companyId and sp.isDel=0 and sp.progressVisible=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.deptId=#{deptId}
</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{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>

View File

@ -2,7 +2,7 @@
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yanzhu.jh.base.mapper.SysNativeMapper"> <mapper namespace="com.ruoyi.quartz.mapper.SysNativeMapper">
<resultMap type="SysNative" id="SysNativeResult"> <resultMap type="SysNative" id="SysNativeResult">
<result property="id" column="id" /> <result property="id" column="id" />
@ -12,8 +12,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="areas" column="areas" /> <result property="areas" column="areas" />
</resultMap> </resultMap>
<select id="selectSysNativeListById" parameterType="Long" resultMap="SysNativeResult"> <select id="selectSysNativeListById" parameterType="Long" resultMap="SysNativeResult">
SELECT * FROM sys_native WHERE id=#{id} SELECT * FROM sys_native WHERE id=#{id}
</select> </select>

View File

@ -144,4 +144,20 @@
where spu.project_id = #{proId} and spu.job_type=21 and spu.is_del = 0 and su.del_flag = '0' and suo.isDel=0 where spu.project_id = #{proId} and spu.job_type=21 and spu.is_del = 0 and su.del_flag = '0' and suo.isDel=0
</select> </select>
<!--查询项目甲方代表-->
<select id="findTowerMaxIdByDate" parameterType="String" resultType="Integer">
select max(id) from dev_tower_data_run where date(create_time)=${date}
</select>
<delete id="deleteDevTowerDataRunByMaxId" parameterType="Long">
delete from dev_tower_data_run where id <![CDATA[ < ]]> #{id} and
</delete>
<select id="findAllTowerMaxId" resultType="Map">
select * from dev_tower_data_run where id in (select max(r.id) from dev_tower_data_run r GROUP BY r.device_key)
</select>
<update id="updateTowerConfigOnline" parameterType="Map">
update dev_tower_project_config set online = #{online} where device_sn=#{deviceSn}
</update>
</mapper> </mapper>

View File

@ -82,28 +82,26 @@
<el-table v-loading="loading" :data="towerDataCollideList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="towerDataCollideList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="项目名称" align="center" prop="projectName" /> <el-table-column label="项目名称" align="center" prop="projectName" width="200" />
<el-table-column label="总包单位" align="center" prop="deptName" /> <el-table-column label="总包单位" align="center" prop="deptName" width="200" />
<el-table-column label="设备序列号" align="center" prop="deviceKey" /> <el-table-column label="设备序列号" align="center" prop="deviceKey" width="200" />
<el-table-column label="设备来源" align="center" prop="deviceSource" /> <el-table-column label="塔机坐标x" align="center" prop="coordinateX" width="120" />
<el-table-column label="塔机编号" align="center" prop="towerId" /> <el-table-column label="塔机坐标y" align="center" prop="coordinateY" width="120" />
<el-table-column label="塔机坐标x" align="center" prop="coordinateX" /> <el-table-column label="前臂长度" align="center" prop="frontBrachium" width="100" />
<el-table-column label="塔机坐标y" align="center" prop="coordinateY" /> <el-table-column label="平衡臂长度" align="center" prop="afterBrachium" width="120" />
<el-table-column label="前臂长度" align="center" prop="frontBrachium" /> <el-table-column label="塔身高度" align="center" prop="towerBodyHeight" width="100" />
<el-table-column label="平衡臂长度" align="center" prop="afterBrachium" /> <el-table-column label="吊钩实时高度" align="center" prop="height" width="160" />
<el-table-column label="塔身高度" align="center" prop="towerBodyHeight" /> <el-table-column label="塔机实时回转角度" align="center" prop="angle" width="200" />
<el-table-column label="吊钩实时高度" align="center" prop="height" /> <el-table-column label="吊钩实时幅度" align="center" prop="range" width="160" />
<el-table-column label="塔机实时回转角度" align="center" prop="angle" /> <el-table-column label="设置的预警距离" align="center" prop="earlyWarningDistance" width="180" />
<el-table-column label="吊钩实时幅度" align="center" prop="range" /> <el-table-column label="设置的报警距离" align="center" prop="alarmWarningDistance" width="180" />
<el-table-column label="设置的预警距离" align="center" prop="earlyWarningDistance" /> <el-table-column label="塔身高度相差" align="center" prop="contourValue" width="160" />
<el-table-column label="设置的报警距离" align="center" prop="alarmWarningDistance" /> <el-table-column label="是否有效" align="center" prop="isDel" width="100">
<el-table-column label="塔身高度相差" align="center" prop="contourValue" />
<el-table-column label="是否有效" align="center" prop="isDel">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.sys_common_isdel" :value="scope.row.isDel"/> <dict-tag :options="dict.type.sys_common_isdel" :value="scope.row.isDel"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> <el-table-column label="创建时间" align="center" prop="createTime" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
</template> </template>

View File

@ -82,51 +82,49 @@
<el-table v-loading="loading" :data="towerDataLimitList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="towerDataLimitList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="项目名称" align="center" prop="projectName" /> <el-table-column label="项目名称" align="center" prop="projectName" width="200" />
<el-table-column label="总包单位" align="center" prop="deptName" /> <el-table-column label="总包单位" align="center" prop="deptName" width="200" />
<el-table-column label="设备序列号" align="center" prop="deviceKey" /> <el-table-column label="设备序列号" align="center" prop="deviceKey" width="200" />
<el-table-column label="设备来源" align="center" prop="deviceSource" /> <el-table-column label="风速预警" align="center" prop="windSpeedWarning" width="120" />
<el-table-column label="塔机编号" align="center" prop="towerId" /> <el-table-column label="风速报警" align="center" prop="windSpeedAlarm" width="120" />
<el-table-column label="风速预警" align="center" prop="windSpeedWarning" /> <el-table-column label="超载预警" align="center" prop="loadWarning" width="120" />
<el-table-column label="风速报警" align="center" prop="windSpeedAlarm" /> <el-table-column label="超载报警" align="center" prop="loadAlarm" width="120" />
<el-table-column label="超载预警" align="center" prop="loadWarning" /> <el-table-column label="力矩预警" align="center" prop="momentWarning" width="120" />
<el-table-column label="超载报警" align="center" prop="loadAlarm" /> <el-table-column label="力矩报警" align="center" prop="momentAlarm" width="120" />
<el-table-column label="力矩预警" align="center" prop="momentWarning" /> <el-table-column label="高限位预警" align="center" prop="highLimitWarning" width="150" />
<el-table-column label="力矩报警" align="center" prop="momentAlarm" /> <el-table-column label="高限位报警" align="center" prop="highLimitAlarm" width="150" />
<el-table-column label="高限位预警" align="center" prop="highLimitWarning" /> <el-table-column label="低限位预警" align="center" prop="lowLimitWarning" width="150"/>
<el-table-column label="高限位报警" align="center" prop="highLimitAlarm" /> <el-table-column label="低限位报警" align="center" prop="lowLimitAlarm" width="150"/>
<el-table-column label="低限位预警" align="center" prop="lowLimitWarning" /> <el-table-column label="左限位预警" align="center" prop="leftLimitWarning" width="150"/>
<el-table-column label="低限位报警" align="center" prop="lowLimitAlarm" /> <el-table-column label="左限位报警" align="center" prop="leftLimitAlarm" width="150"/>
<el-table-column label="左限位预警" align="center" prop="leftLimitWarning" /> <el-table-column label="右限位预警" align="center" prop="rightLimitWarning" width="150"/>
<el-table-column label="左限位报警" align="center" prop="leftLimitAlarm" /> <el-table-column label="右限位报警" align="center" prop="rightLimitAlarm" width="150"/>
<el-table-column label="右限位预警" align="center" prop="rightLimitWarning" /> <el-table-column label="前限位预警" align="center" prop="frontLimitWarning" width="150"/>
<el-table-column label="右限位报警" align="center" prop="rightLimitAlarm" /> <el-table-column label="前限位报警" align="center" prop="frontLimitAlarm" width="150"/>
<el-table-column label="前限位预警" align="center" prop="frontLimitWarning" /> <el-table-column label="后限位预警" align="center" prop="backLimitWarning" width="150"/>
<el-table-column label="前限位报警" align="center" prop="frontLimitAlarm" /> <el-table-column label="后限位报警" align="center" prop="backLimitAlarm" width="150"/>
<el-table-column label="后限位预警" align="center" prop="backLimitWarning" /> <el-table-column label="防碰角度预警" align="center" prop="collisionAngleWarning" width="160"/>
<el-table-column label="后限位报警" align="center" prop="backLimitAlarm" /> <el-table-column label="防碰角度报警" align="center" prop="collisionAngleAlarm" width="160"/>
<el-table-column label="防碰角度预警" align="center" prop="collisionAngleWarning" /> <el-table-column label="防碰距离预警" align="center" prop="collisionDistanceWarning" width="160"/>
<el-table-column label="防碰角度报警" align="center" prop="collisionAngleAlarm" /> <el-table-column label="防碰距离报警" align="center" prop="collisionDistanceAlarm" width="160"/>
<el-table-column label="防碰距离预警" align="center" prop="collisionDistanceWarning" /> <el-table-column label="水平距离预警值" align="center" prop="hDistanceWarning" width="180"/>
<el-table-column label="防碰距离报警" align="center" prop="collisionDistanceAlarm" /> <el-table-column label="水平距离报警值" align="center" prop="hDistanceAlarm" width="180"/>
<el-table-column label="水平距离预警值" align="center" prop="hDistanceWarning" /> <el-table-column label="垂直距离预警值" align="center" prop="vDistanceWarning" width="180"/>
<el-table-column label="水平距离报警值" align="center" prop="hDistanceAlarm" /> <el-table-column label="垂直距离报警值" align="center" prop="vDistanceAlarm" width="180"/>
<el-table-column label="垂直距离预警值" align="center" prop="vDistanceWarning" /> <el-table-column label="倾斜预警值" align="center" prop="leanWarning" width="160"/>
<el-table-column label="垂直距离报警值" align="center" prop="vDistanceAlarm" /> <el-table-column label="倾斜报警值" align="center" prop="leanAlarm" width="160"/>
<el-table-column label="倾斜预警值" align="center" prop="leanWarning" /> <el-table-column label="幅度限位起点值" align="center" prop="rangeLimitStart" width="180"/>
<el-table-column label="倾斜报警值" align="center" prop="leanAlarm" /> <el-table-column label="幅度限位终点值" align="center" prop="rangeLimitEnd" width="180"/>
<el-table-column label="幅度限位起点值" align="center" prop="rangeLimitStart" /> <el-table-column label="高度限位起点值" align="center" prop="heightLimitStart" width="180"/>
<el-table-column label="幅度限位终点值" align="center" prop="rangeLimitEnd" /> <el-table-column label="高度限位终点值" align="center" prop="heightLimitEnd" width="180"/>
<el-table-column label="高度限位起点值" align="center" prop="heightLimitStart" /> <el-table-column label="回转限位起点值" align="center" prop="rotationLimitStart" width="180"/>
<el-table-column label="高度限位终点值" align="center" prop="heightLimitEnd" /> <el-table-column label="回转限位终点值" align="center" prop="rotationLimitEnd" width="180"/>
<el-table-column label="回转限位起点值" align="center" prop="rotationLimitStart" /> <el-table-column label="是否有效" align="center" prop="isDel" width="100">
<el-table-column label="回转限位终点值" align="center" prop="rotationLimitEnd" />
<el-table-column label="是否有效" align="center" prop="isDel">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.sys_common_isdel" :value="scope.row.isDel"/> <dict-tag :options="dict.type.sys_common_isdel" :value="scope.row.isDel"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> <el-table-column label="创建时间" align="center" prop="createTime" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
</template> </template>

View File

@ -1,6 +1,13 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="项目名称" prop="projectName"> <el-form-item label="项目名称" prop="projectName">
<el-input <el-input
v-model="queryParams.projectName" v-model="queryParams.projectName"
@ -29,7 +36,9 @@
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -65,7 +74,8 @@
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['device:towerDataRound:remove']" v-hasPermi="['device:towerDataRound:remove']"
>删除</el-button> >删除</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -75,54 +85,192 @@
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['device:towerDataRound:export']" v-hasPermi="['device:towerDataRound:export']"
>导出</el-button> >导出</el-button
>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="towerDataRoundList" @selection-change="handleSelectionChange"> <el-table
v-loading="loading"
:data="towerDataRoundList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="项目名称" align="center" prop="projectName" /> <el-table-column label="项目名称" align="center" prop="projectName" width="200" />
<el-table-column label="总包单位" align="center" prop="deptName" /> <el-table-column label="总包单位" align="center" prop="deptName" width="200" />
<el-table-column label="设备序列号" align="center" prop="deviceKey" /> <el-table-column label="设备序列号" align="center" prop="deviceKey" width="200" />
<el-table-column label="设备来源" align="center" prop="deviceSource" /> <el-table-column
<el-table-column label="数据编号" align="center" prop="dataId" /> label="工作循环开始"
<el-table-column label="工作循环开始" align="center" prop="workStartTime" /> align="center"
<el-table-column label="工作循环结束" align="center" prop="workEndTime" /> prop="workStartTime"
<el-table-column label="工作循环最小高度" align="center" prop="minHeight" /> width="180"
<el-table-column label="工作循环最大高度" align="center" prop="maxHeight" /> />
<el-table-column label="工作循环最小幅度" align="center" prop="minRange" /> <el-table-column
<el-table-column label="工作循环最大幅度" align="center" prop="maxRange" /> label="工作循环结束"
<el-table-column label="工作循环开始高度" align="center" prop="startHeight" /> align="center"
<el-table-column label="工作循环结束高度" align="center" prop="endHeight" /> prop="workEndTime"
<el-table-column label="工作循环开始幅度" align="center" prop="startRange" /> width="180"
<el-table-column label="工作循环结束幅度单位米" align="center" prop="endRange" /> />
<el-table-column label="工作循环开始回转角度单位度" align="center" prop="startRotation" /> <el-table-column label="警报信息" align="center" prop="warnings" width="200">
<el-table-column label="工作循环结束回转角度单位度" align="center" prop="endRotation" />
<el-table-column label="工作循环最大吊重单位吨" align="center" prop="maxLoad" />
<el-table-column label="工作循环最大重量百分比" align="center" prop="maxLoadPercent" />
<el-table-column label="工作循环最大力矩" align="center" prop="maxMoment" />
<el-table-column label="工作循环最大力矩百分比" align="center" prop="maxMomentPercent" />
<el-table-column label="工作循环开始风速" align="center" prop="startWindSpeed" />
<el-table-column label="工作循环结束风速" align="center" prop="endWindSpeed" />
<el-table-column label="工作循环开始风速等级" align="center" prop="startWindSpeedPercent" />
<el-table-column label="工作循环结束风速等级" align="center" prop="endWindSpeedPercent" />
<el-table-column label="工作循环开始水平倾角" align="center" prop="startLeanAngleX" />
<el-table-column label="工作循环结束水平倾角" align="center" prop="endLeanAngleX" />
<el-table-column label="工作循环开始垂直倾角" align="center" prop="startLeanAngleY" />
<el-table-column label="工作循环结束垂直倾角" align="center" prop="endLeanAngleY" />
<el-table-column label="警报信息" align="center" prop="warnings" />
<el-table-column label="是否有效" align="center" prop="isDel">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.sys_common_isdel" :value="scope.row.isDel"/> <div class="tag-group">
<dict-tag
:options="dict.type.device_tower_warning"
:value="scope.row.warnings ? scope.row.warnings.split(',') : '0'"
/>
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> <el-table-column
label="工作循环最小高度"
align="center"
prop="minHeight"
width="200"
/>
<el-table-column
label="工作循环最大高度"
align="center"
prop="maxHeight"
width="200"
/>
<el-table-column
label="工作循环最小幅度"
align="center"
prop="minRange"
width="200"
/>
<el-table-column
label="工作循环最大幅度"
align="center"
prop="maxRange"
width="200"
/>
<el-table-column
label="工作循环开始高度"
align="center"
prop="startHeight"
width="200"
/>
<el-table-column
label="工作循环结束高度"
align="center"
prop="endHeight"
width="200"
/>
<el-table-column
label="工作循环开始幅度"
align="center"
prop="startRange"
width="200"
/>
<el-table-column
label="工作循环结束幅度"
align="center"
prop="endRange"
width="200"
/>
<el-table-column
label="工作循环开始回转角度"
align="center"
prop="startRotation"
width="220"
/>
<el-table-column
label="工作循环结束回转角度"
align="center"
prop="endRotation"
width="220"
/>
<el-table-column
label="工作循环最大吊重"
align="center"
prop="maxLoad"
width="200"
/>
<el-table-column
label="工作循环最大重量"
align="center"
prop="maxLoadPercent"
width="200"
/>
<el-table-column
label="工作循环最大力矩"
align="center"
prop="maxMoment"
width="200"
/>
<el-table-column
label="工作循环最大力矩百分比"
align="center"
prop="maxMomentPercent"
width="240"
/>
<el-table-column
label="工作循环开始风速"
align="center"
prop="startWindSpeed"
width="200"
/>
<el-table-column
label="工作循环结束风速"
align="center"
prop="endWindSpeed"
width="200"
/>
<el-table-column
label="工作循环开始风速等级"
align="center"
prop="startWindSpeedPercent"
width="220"
/>
<el-table-column
label="工作循环结束风速等级"
align="center"
prop="endWindSpeedPercent"
width="220"
/>
<el-table-column
label="工作循环开始水平倾角"
align="center"
prop="startLeanAngleX"
width="220"
/>
<el-table-column
label="工作循环结束水平倾角"
align="center"
prop="endLeanAngleX"
width="220"
/>
<el-table-column
label="工作循环开始垂直倾角"
align="center"
prop="startLeanAngleY"
width="220"
/>
<el-table-column
label="工作循环结束垂直倾角"
align="center"
prop="endLeanAngleY"
width="220"
/>
<el-table-column label="是否有效" align="center" prop="isDel" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span> <dict-tag :options="dict.type.sys_common_isdel" :value="scope.row.isDel" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100" fixed="right"> <el-table-column label="创建时间" align="center" prop="createTime" width="120">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
width="100"
fixed="right"
>
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button <!-- <el-button
size="mini" size="mini"
@ -137,13 +285,14 @@
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['device:towerDataRound:remove']" v-hasPermi="['device:towerDataRound:remove']"
>删除</el-button> >删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total > 0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@ -199,22 +348,34 @@
<el-input v-model="form.endRange" placeholder="请输入工作循环结束幅度单位米" /> <el-input v-model="form.endRange" placeholder="请输入工作循环结束幅度单位米" />
</el-form-item> </el-form-item>
<el-form-item label="工作循环开始回转角度单位度" prop="startRotation"> <el-form-item label="工作循环开始回转角度单位度" prop="startRotation">
<el-input v-model="form.startRotation" placeholder="请输入工作循环开始回转角度单位度" /> <el-input
v-model="form.startRotation"
placeholder="请输入工作循环开始回转角度单位度"
/>
</el-form-item> </el-form-item>
<el-form-item label="工作循环结束回转角度单位度" prop="endRotation"> <el-form-item label="工作循环结束回转角度单位度" prop="endRotation">
<el-input v-model="form.endRotation" placeholder="请输入工作循环结束回转角度单位度" /> <el-input
v-model="form.endRotation"
placeholder="请输入工作循环结束回转角度单位度"
/>
</el-form-item> </el-form-item>
<el-form-item label="工作循环最大吊重单位吨" prop="maxLoad"> <el-form-item label="工作循环最大吊重单位吨" prop="maxLoad">
<el-input v-model="form.maxLoad" placeholder="请输入工作循环最大吊重单位吨" /> <el-input v-model="form.maxLoad" placeholder="请输入工作循环最大吊重单位吨" />
</el-form-item> </el-form-item>
<el-form-item label="工作循环最大重量百分比" prop="maxLoadPercent"> <el-form-item label="工作循环最大重量百分比" prop="maxLoadPercent">
<el-input v-model="form.maxLoadPercent" placeholder="请输入工作循环最大重量百分比" /> <el-input
v-model="form.maxLoadPercent"
placeholder="请输入工作循环最大重量百分比"
/>
</el-form-item> </el-form-item>
<el-form-item label="工作循环最大力矩" prop="maxMoment"> <el-form-item label="工作循环最大力矩" prop="maxMoment">
<el-input v-model="form.maxMoment" placeholder="请输入工作循环最大力矩" /> <el-input v-model="form.maxMoment" placeholder="请输入工作循环最大力矩" />
</el-form-item> </el-form-item>
<el-form-item label="工作循环最大力矩百分比" prop="maxMomentPercent"> <el-form-item label="工作循环最大力矩百分比" prop="maxMomentPercent">
<el-input v-model="form.maxMomentPercent" placeholder="请输入工作循环最大力矩百分比" /> <el-input
v-model="form.maxMomentPercent"
placeholder="请输入工作循环最大力矩百分比"
/>
</el-form-item> </el-form-item>
<el-form-item label="工作循环开始风速" prop="startWindSpeed"> <el-form-item label="工作循环开始风速" prop="startWindSpeed">
<el-input v-model="form.startWindSpeed" placeholder="请输入工作循环开始风速" /> <el-input v-model="form.startWindSpeed" placeholder="请输入工作循环开始风速" />
@ -223,22 +384,40 @@
<el-input v-model="form.endWindSpeed" placeholder="请输入工作循环结束风速" /> <el-input v-model="form.endWindSpeed" placeholder="请输入工作循环结束风速" />
</el-form-item> </el-form-item>
<el-form-item label="工作循环开始风速等级" prop="startWindSpeedPercent"> <el-form-item label="工作循环开始风速等级" prop="startWindSpeedPercent">
<el-input v-model="form.startWindSpeedPercent" placeholder="请输入工作循环开始风速等级" /> <el-input
v-model="form.startWindSpeedPercent"
placeholder="请输入工作循环开始风速等级"
/>
</el-form-item> </el-form-item>
<el-form-item label="工作循环结束风速等级" prop="endWindSpeedPercent"> <el-form-item label="工作循环结束风速等级" prop="endWindSpeedPercent">
<el-input v-model="form.endWindSpeedPercent" placeholder="请输入工作循环结束风速等级" /> <el-input
v-model="form.endWindSpeedPercent"
placeholder="请输入工作循环结束风速等级"
/>
</el-form-item> </el-form-item>
<el-form-item label="工作循环开始水平倾角" prop="startLeanAngleX"> <el-form-item label="工作循环开始水平倾角" prop="startLeanAngleX">
<el-input v-model="form.startLeanAngleX" placeholder="请输入工作循环开始水平倾角" /> <el-input
v-model="form.startLeanAngleX"
placeholder="请输入工作循环开始水平倾角"
/>
</el-form-item> </el-form-item>
<el-form-item label="工作循环结束水平倾角" prop="endLeanAngleX"> <el-form-item label="工作循环结束水平倾角" prop="endLeanAngleX">
<el-input v-model="form.endLeanAngleX" placeholder="请输入工作循环结束水平倾角" /> <el-input
v-model="form.endLeanAngleX"
placeholder="请输入工作循环结束水平倾角"
/>
</el-form-item> </el-form-item>
<el-form-item label="工作循环开始垂直倾角" prop="startLeanAngleY"> <el-form-item label="工作循环开始垂直倾角" prop="startLeanAngleY">
<el-input v-model="form.startLeanAngleY" placeholder="请输入工作循环开始垂直倾角" /> <el-input
v-model="form.startLeanAngleY"
placeholder="请输入工作循环开始垂直倾角"
/>
</el-form-item> </el-form-item>
<el-form-item label="工作循环结束垂直倾角" prop="endLeanAngleY"> <el-form-item label="工作循环结束垂直倾角" prop="endLeanAngleY">
<el-input v-model="form.endLeanAngleY" placeholder="请输入工作循环结束垂直倾角" /> <el-input
v-model="form.endLeanAngleY"
placeholder="请输入工作循环结束垂直倾角"
/>
</el-form-item> </el-form-item>
<el-form-item label="警报信息" prop="warnings"> <el-form-item label="警报信息" prop="warnings">
<el-input v-model="form.warnings" placeholder="请输入警报信息" /> <el-input v-model="form.warnings" placeholder="请输入警报信息" />
@ -266,11 +445,17 @@
</template> </template>
<script> <script>
import { listTowerDataRound, getTowerDataRound, delTowerDataRound, addTowerDataRound, updateTowerDataRound } from "@/api/device/towerDataRound"; import {
listTowerDataRound,
getTowerDataRound,
delTowerDataRound,
addTowerDataRound,
updateTowerDataRound,
} from "@/api/device/towerDataRound";
export default { export default {
name: "TowerDataRound", name: "TowerDataRound",
dicts: ['sys_common_isdel'], dicts: ["sys_common_isdel", "device_tower_warning"],
data() { data() {
return { return {
// //
@ -309,8 +494,7 @@ export default {
// //
form: {}, form: {},
// //
rules: { rules: {},
}
}; };
}, },
created() { created() {
@ -321,11 +505,11 @@ export default {
getList() { getList() {
this.loading = true; this.loading = true;
this.queryParams.params = {}; this.queryParams.params = {};
if (null != this.daterangeCreateTime && '' != this.daterangeCreateTime) { if (null != this.daterangeCreateTime && "" != this.daterangeCreateTime) {
this.queryParams.params["beginCreateTime"] = this.daterangeCreateTime[0]; this.queryParams.params["beginCreateTime"] = this.daterangeCreateTime[0];
this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1]; this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1];
} }
listTowerDataRound(this.queryParams).then(response => { listTowerDataRound(this.queryParams).then((response) => {
this.towerDataRoundList = response.rows; this.towerDataRoundList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
@ -375,7 +559,7 @@ export default {
createTime: null, createTime: null,
updateBy: null, updateBy: null,
updateTime: null, updateTime: null,
remark: null remark: null,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -392,9 +576,9 @@ export default {
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map((item) => item.id);
this.single = selection.length!==1 this.single = selection.length !== 1;
this.multiple = !selection.length this.multiple = !selection.length;
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
@ -405,8 +589,8 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const id = row.id || this.ids const id = row.id || this.ids;
getTowerDataRound(id).then(response => { getTowerDataRound(id).then((response) => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改塔机工作循环"; this.title = "修改塔机工作循环";
@ -414,16 +598,16 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if (this.form.id != null) { if (this.form.id != null) {
updateTowerDataRound(this.form).then(response => { updateTowerDataRound(this.form).then((response) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
} else { } else {
addTowerDataRound(this.form).then(response => { addTowerDataRound(this.form).then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
@ -435,19 +619,34 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除塔机工作循环编号为"' + ids + '"的数据项?').then(function() { this.$modal
return delTowerDataRound(ids); .confirm('是否确认删除塔机工作循环编号为"' + ids + '"的数据项?')
}).then(() => { .then(function () {
this.getList(); return delTowerDataRound(ids);
this.$modal.msgSuccess("删除成功"); })
}).catch(() => {}); .then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('device/towerDataRound/export', { this.download(
...this.queryParams "device/towerDataRound/export",
}, `towerDataRound_${new Date().getTime()}.xlsx`) {
} ...this.queryParams,
} },
`towerDataRound_${new Date().getTime()}.xlsx`
);
},
},
}; };
</script> </script>
<style lang="scss" scope>
.tag-group {
.el-tag {
margin-bottom: 5px;
}
}
</style>

View File

@ -1,6 +1,13 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="项目名称" prop="projectName"> <el-form-item label="项目名称" prop="projectName">
<el-input <el-input
v-model="queryParams.projectName" v-model="queryParams.projectName"
@ -29,7 +36,9 @@
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -65,7 +74,8 @@
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['device:towerDataRun:remove']" v-hasPermi="['device:towerDataRun:remove']"
>删除</el-button> >删除</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -75,49 +85,170 @@
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['device:towerDataRun:export']" v-hasPermi="['device:towerDataRun:export']"
>导出</el-button> >导出</el-button
>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-row>
<el-alert
title="温馨提示:"
type="warning"
description="塔基监测实时数据只保留最近15天数据历史数据永久性删除且不可找回"
show-icon
>
</el-alert>
</el-row>
<el-table v-loading="loading" :data="towerDataRunList" @selection-change="handleSelectionChange"> <el-table
v-loading="loading"
:data="towerDataRunList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="项目名称" align="center" prop="projectName" /> <el-table-column label="项目名称" align="center" prop="projectName" width="200" />
<el-table-column label="总包单位" align="center" prop="deptName" /> <el-table-column label="总包单位" align="center" prop="deptName" width="200" />
<el-table-column label="设备序列号" align="center" prop="deviceKey" /> <el-table-column label="设备序列号" align="center" prop="deviceKey" width="200" />
<el-table-column label="设备来源" align="center" prop="deviceSource" /> <el-table-column label="警报信息" align="center" prop="warnings" width="200">
<el-table-column label="当前高度" align="center" prop="height" />
<el-table-column label="当前幅度" align="center" prop="range" />
<el-table-column label="回转" align="center" prop="rotation" />
<el-table-column label="当前吊重" align="center" prop="load" />
<el-table-column label="风速" align="center" prop="windSpeed" />
<el-table-column label="水平倾角" align="center" prop="leanAngleX" />
<el-table-column label="垂直倾角" align="center" prop="leanAngleY" />
<el-table-column label="重量百分比" align="center" prop="loadPercent" />
<el-table-column label="力矩百分比" align="center" prop="momentPercent" />
<el-table-column label="风速等级" align="center" prop="windSpeedPercent" />
<el-table-column label="倾斜百分比" align="center" prop="leanAnglePercent" />
<el-table-column label="警报信息" align="center" prop="warnings" />
<el-table-column label="倍率" align="center" prop="rate" />
<el-table-column label="回转传感器状态" align="center" prop="rotationSensorState" />
<el-table-column label="重量传感器状态" align="center" prop="loadSensorState" />
<el-table-column label="风速传感器状态" align="center" prop="windSpeedSensorState" />
<el-table-column label="倾角传感器状态" align="center" prop="leanAngleSensorState" />
<el-table-column label="幅度传感器状态" align="center" prop="rangeSensorState" />
<el-table-column label="高度传感器状态" align="center" prop="heightSensorState" />
<el-table-column label="控制状态" align="center" prop="brakingStatus" />
<el-table-column label="时间戳" align="center" prop="timeLongs" />
<el-table-column label="是否有效" align="center" prop="isDel">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.sys_common_isdel" :value="scope.row.isDel"/> <div class="tag-group">
<dict-tag
:options="dict.type.device_tower_warning"
:value="scope.row.warnings ? scope.row.warnings.split(',') : '0'"
/>
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> <el-table-column label="当前高度" align="center" prop="height" width="100" />
<el-table-column label="当前幅度" align="center" prop="range" width="100" />
<el-table-column label="回转" align="center" prop="rotation" width="80" />
<el-table-column label="当前吊重" align="center" prop="load" width="100" />
<el-table-column label="风速" align="center" prop="windSpeed" width="80" />
<el-table-column label="水平倾角" align="center" prop="leanAngleX" width="100" />
<el-table-column label="垂直倾角" align="center" prop="leanAngleY" width="100" />
<el-table-column label="重量百分比" align="center" prop="loadPercent" width="120" />
<el-table-column
label="力矩百分比"
align="center"
prop="momentPercent"
width="120"
/>
<el-table-column
label="风速等级"
align="center"
prop="windSpeedPercent"
width="100"
/>
<el-table-column
label="倾斜百分比"
align="center"
prop="leanAnglePercent"
width="120"
/>
<el-table-column label="倍率" align="center" prop="rate" width="100" />
<el-table-column
label="回转传感器状态"
align="center"
prop="rotationSensorState"
width="160"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span> <dict-tag
:options="dict.type.device_rotation_state"
:value="scope.row.rotationSensorState"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100" fixed="right"> <el-table-column
label="重量传感器状态"
align="center"
prop="loadSensorState"
width="160"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.device_rotation_state"
:value="scope.row.loadSensorState"
/>
</template>
</el-table-column>
<el-table-column
label="风速传感器状态"
align="center"
prop="windSpeedSensorState"
width="160"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.device_rotation_state"
:value="scope.row.windSpeedSensorState"
/>
</template>
</el-table-column>
<el-table-column
label="倾角传感器状态"
align="center"
prop="leanAngleSensorState"
width="160"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.device_rotation_state"
:value="scope.row.leanAngleSensorState"
/>
</template>
</el-table-column>
<el-table-column
label="幅度传感器状态"
align="center"
prop="rangeSensorState"
width="160"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.device_rotation_state"
:value="scope.row.rangeSensorState"
/>
</template>
</el-table-column>
<el-table-column
label="高度传感器状态"
align="center"
prop="heightSensorState"
width="160"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.device_rotation_state"
:value="scope.row.heightSensorState"
/>
</template>
</el-table-column>
<el-table-column label="控制状态" align="center" prop="brakingStatus" width="100">
<template slot-scope="scope">
<dict-tag
:options="dict.type.device_braking_status"
:value="scope.row.brakingStatus"
/>
</template>
</el-table-column>
<el-table-column label="是否有效" align="center" prop="isDel" width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_common_isdel" :value="scope.row.isDel" />
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="120">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
width="100"
fixed="right"
>
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button <!-- <el-button
size="mini" size="mini"
@ -132,13 +263,14 @@
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['device:towerDataRun:remove']" v-hasPermi="['device:towerDataRun:remove']"
>删除</el-button> >删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total > 0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@ -200,16 +332,25 @@
<el-input v-model="form.rate" placeholder="请输入倍率" /> <el-input v-model="form.rate" placeholder="请输入倍率" />
</el-form-item> </el-form-item>
<el-form-item label="回转传感器状态" prop="rotationSensorState"> <el-form-item label="回转传感器状态" prop="rotationSensorState">
<el-input v-model="form.rotationSensorState" placeholder="请输入回转传感器状态" /> <el-input
v-model="form.rotationSensorState"
placeholder="请输入回转传感器状态"
/>
</el-form-item> </el-form-item>
<el-form-item label="重量传感器状态" prop="loadSensorState"> <el-form-item label="重量传感器状态" prop="loadSensorState">
<el-input v-model="form.loadSensorState" placeholder="请输入重量传感器状态" /> <el-input v-model="form.loadSensorState" placeholder="请输入重量传感器状态" />
</el-form-item> </el-form-item>
<el-form-item label="风速传感器状态" prop="windSpeedSensorState"> <el-form-item label="风速传感器状态" prop="windSpeedSensorState">
<el-input v-model="form.windSpeedSensorState" placeholder="请输入风速传感器状态" /> <el-input
v-model="form.windSpeedSensorState"
placeholder="请输入风速传感器状态"
/>
</el-form-item> </el-form-item>
<el-form-item label="倾角传感器状态" prop="leanAngleSensorState"> <el-form-item label="倾角传感器状态" prop="leanAngleSensorState">
<el-input v-model="form.leanAngleSensorState" placeholder="请输入倾角传感器状态" /> <el-input
v-model="form.leanAngleSensorState"
placeholder="请输入倾角传感器状态"
/>
</el-form-item> </el-form-item>
<el-form-item label="幅度传感器状态" prop="rangeSensorState"> <el-form-item label="幅度传感器状态" prop="rangeSensorState">
<el-input v-model="form.rangeSensorState" placeholder="请输入幅度传感器状态" /> <el-input v-model="form.rangeSensorState" placeholder="请输入幅度传感器状态" />
@ -243,11 +384,22 @@
</template> </template>
<script> <script>
import { listTowerDataRun, getTowerDataRun, delTowerDataRun, addTowerDataRun, updateTowerDataRun } from "@/api/device/towerDataRun"; import {
listTowerDataRun,
getTowerDataRun,
delTowerDataRun,
addTowerDataRun,
updateTowerDataRun,
} from "@/api/device/towerDataRun";
export default { export default {
name: "TowerDataRun", name: "TowerDataRun",
dicts: ['sys_common_isdel'], dicts: [
"sys_common_isdel",
"device_tower_warning",
"device_braking_status",
"device_rotation_state",
],
data() { data() {
return { return {
// //
@ -285,8 +437,7 @@ export default {
// //
form: {}, form: {},
// //
rules: { rules: {},
}
}; };
}, },
created() { created() {
@ -297,11 +448,11 @@ export default {
getList() { getList() {
this.loading = true; this.loading = true;
this.queryParams.params = {}; this.queryParams.params = {};
if (null != this.daterangeCreateTime && '' != this.daterangeCreateTime) { if (null != this.daterangeCreateTime && "" != this.daterangeCreateTime) {
this.queryParams.params["beginCreateTime"] = this.daterangeCreateTime[0]; this.queryParams.params["beginCreateTime"] = this.daterangeCreateTime[0];
this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1]; this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1];
} }
listTowerDataRun(this.queryParams).then(response => { listTowerDataRun(this.queryParams).then((response) => {
this.towerDataRunList = response.rows; this.towerDataRunList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
@ -346,7 +497,7 @@ export default {
createTime: null, createTime: null,
updateBy: null, updateBy: null,
updateTime: null, updateTime: null,
remark: null remark: null,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -363,9 +514,9 @@ export default {
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map((item) => item.id);
this.single = selection.length!==1 this.single = selection.length !== 1;
this.multiple = !selection.length this.multiple = !selection.length;
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
@ -376,8 +527,8 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const id = row.id || this.ids const id = row.id || this.ids;
getTowerDataRun(id).then(response => { getTowerDataRun(id).then((response) => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改塔机实时数据"; this.title = "修改塔机实时数据";
@ -385,16 +536,16 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if (this.form.id != null) { if (this.form.id != null) {
updateTowerDataRun(this.form).then(response => { updateTowerDataRun(this.form).then((response) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
} else { } else {
addTowerDataRun(this.form).then(response => { addTowerDataRun(this.form).then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
@ -406,19 +557,34 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除塔机实时数据编号为"' + ids + '"的数据项?').then(function() { this.$modal
return delTowerDataRun(ids); .confirm('是否确认删除塔机实时数据编号为"' + ids + '"的数据项?')
}).then(() => { .then(function () {
this.getList(); return delTowerDataRun(ids);
this.$modal.msgSuccess("删除成功"); })
}).catch(() => {}); .then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('device/towerDataRun/export', { this.download(
...this.queryParams "device/towerDataRun/export",
}, `towerDataRun_${new Date().getTime()}.xlsx`) {
} ...this.queryParams,
} },
`towerDataRun_${new Date().getTime()}.xlsx`
);
},
},
}; };
</script> </script>
<style lang="scss" scope>
.tag-group {
.el-tag {
margin-bottom: 5px;
}
}
</style>

View File

@ -1,6 +1,13 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="项目名称" prop="projectName"> <el-form-item label="项目名称" prop="projectName">
<el-input <el-input
v-model="queryParams.projectName" v-model="queryParams.projectName"
@ -17,7 +24,7 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="设备序号" prop="deviceSn"> <el-form-item label="设备序号" prop="deviceSn">
<el-input <el-input
v-model="queryParams.deviceSn" v-model="queryParams.deviceSn"
placeholder="请输入设备序列号" placeholder="请输入设备序列号"
@ -26,7 +33,9 @@
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -40,7 +49,8 @@
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['device:towerProjectConfig:add']" v-hasPermi="['device:towerProjectConfig:add']"
>新增</el-button> >新增</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -51,7 +61,8 @@
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['device:towerProjectConfig:edit']" v-hasPermi="['device:towerProjectConfig:edit']"
>修改</el-button> >修改</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -62,7 +73,8 @@
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['device:towerProjectConfig:remove']" v-hasPermi="['device:towerProjectConfig:remove']"
>删除</el-button> >删除</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -72,18 +84,26 @@
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['device:towerProjectConfig:export']" v-hasPermi="['device:towerProjectConfig:export']"
>导出</el-button> >导出</el-button
>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="towerProjectConfigList" @selection-change="handleSelectionChange"> <el-table
v-loading="loading"
:data="towerProjectConfigList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="项目名称" align="center" prop="projectName" /> <el-table-column label="项目名称" align="center" prop="projectName" width="180" />
<el-table-column label="总包单位" align="center" prop="deptName" /> <el-table-column label="总包单位" align="center" prop="deptName" width="180" />
<el-table-column label="设备序列号" align="center" prop="deviceSn" /> <el-table-column label="设备序号" align="center" prop="deviceSn" width="180" />
<el-table-column label="设备来源" align="center" prop="deviceSource" /> <el-table-column label="塔机类型" align="center" prop="towerType">
<el-table-column label="塔机类型" align="center" prop="towerType" /> <template slot-scope="scope">
<dict-tag :options="dict.type.device_tower_type" :value="scope.row.towerType"/>
</template>
</el-table-column>
<el-table-column label="塔机坐标x" align="center" prop="coordinateX" /> <el-table-column label="塔机坐标x" align="center" prop="coordinateX" />
<el-table-column label="塔机坐标y" align="center" prop="coordinateY" /> <el-table-column label="塔机坐标y" align="center" prop="coordinateY" />
<el-table-column label="前臂长度" align="center" prop="frontBrachium" /> <el-table-column label="前臂长度" align="center" prop="frontBrachium" />
@ -91,18 +111,33 @@
<el-table-column label="塔身高度" align="center" prop="towerBodyHeight" /> <el-table-column label="塔身高度" align="center" prop="towerBodyHeight" />
<el-table-column label="塔帽高度" align="center" prop="towerCapHeight" /> <el-table-column label="塔帽高度" align="center" prop="towerCapHeight" />
<el-table-column label="塔节高度" align="center" prop="towerSectionHeight" /> <el-table-column label="塔节高度" align="center" prop="towerSectionHeight" />
<el-table-column label="是否有效" align="center" prop="isDel"> <el-table-column label="塔机状态" align="center" prop="online">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.sys_common_isdel" :value="scope.row.isDel"/> <dict-tag :options="dict.type.project_video_signal_state" :value="scope.row.online"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建人" align="center" prop="createBy" /> <el-table-column label="启用状态" align="center" prop="isDel" width="80">
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span> <el-switch
v-model="scope.row.isDel + ''"
active-value="0"
inactive-value="1"
@change="setStatus(scope.row, $event)"
></el-switch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100" fixed="right"> <el-table-column label="更新时间" align="center" prop="updateTime" width="160">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updateTime, "{y}-{m}-{d} {h}:{i}") }}</span>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
width="100"
fixed="right"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
@ -110,20 +145,21 @@
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['device:towerProjectConfig:edit']" v-hasPermi="['device:towerProjectConfig:edit']"
>修改</el-button> >修改</el-button
<el-button >
<!-- <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['device:towerProjectConfig:remove']" v-hasPermi="['device:towerProjectConfig:remove']"
>删除</el-button> >删除</el-button> -->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total > 0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@ -131,19 +167,61 @@
/> />
<!-- 添加或修改塔基检测配置对话框 --> <!-- 添加或修改塔基检测配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="680px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="项目编号" prop="projectId"> <el-form-item label="所属项目" prop="projectId">
<el-input v-model="form.projectId" placeholder="请输入项目编号" /> <el-select
v-model="form.projectId"
:disabled="form.id != null"
filterable
placeholder="请选择所属项目"
style="width: 100%"
@change="projectChange"
>
<el-option
v-for="item in projectOptions"
:key="item.id"
:label="item.projectName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="总包单位编号" prop="deptId"> <el-form-item label="所属单位" prop="deptId">
<el-input v-model="form.deptId" placeholder="请输入总包单位编号" /> <el-select
v-model="form.deptId"
:disabled="form.id != null"
placeholder="请选择所属单位"
style="width: 100%"
>
<el-option
v-for="item in deptOptions"
:key="item.deptId"
:label="item.deptName"
:value="item.deptId"
>
</el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="设备序列号" prop="deviceSn"> <el-form-item label="设备序列号" prop="deviceSn">
<el-input v-model="form.deviceSn" placeholder="请输入设备序列号" /> <el-input v-model="form.deviceSn" placeholder="请输入设备序列号" />
</el-form-item> </el-form-item>
<el-form-item label="设备来源" prop="deviceSource"> <el-alert
<el-input v-model="form.deviceSource" placeholder="请输入设备来源" /> title="温馨提示:"
type="warning"
description="以下数据在设备运行过程中,不定时更新。无需填写,填写后会被定时覆盖!!!"
show-icon
>
</el-alert>
<el-form-item label="塔机类型" prop="towerType" style="margin-top: 16px;">
<el-select v-model="form.towerType" placeholder="请选择塔机类型" style="width:100%">
<el-option
v-for="dict in dict.type.device_tower_type"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="塔机坐标x" prop="coordinateX"> <el-form-item label="塔机坐标x" prop="coordinateX">
<el-input v-model="form.coordinateX" placeholder="请输入塔机坐标x" /> <el-input v-model="form.coordinateX" placeholder="请输入塔机坐标x" />
@ -176,11 +254,17 @@
</template> </template>
<script> <script>
import { listTowerProjectConfig, getTowerProjectConfig, delTowerProjectConfig, addTowerProjectConfig, updateTowerProjectConfig } from "@/api/device/towerProjectConfig"; import {
listTowerProjectConfig,
getTowerProjectConfig,
delTowerProjectConfig,
addTowerProjectConfig,
updateTowerProjectConfig,
} from "@/api/device/towerProjectConfig";
export default { export default {
name: "TowerProjectConfig", name: "TowerProjectConfig",
dicts: ['sys_common_isdel'], dicts: ["sys_common_isdel","device_tower_type","project_video_signal_state"],
data() { data() {
return { return {
// //
@ -217,17 +301,56 @@ export default {
form: {}, form: {},
// //
rules: { rules: {
} projectId: [{ required: true, message: "请选择所属项目", trigger: "change" }],
deptId: [{ required: true, message: "请选择所属单位", trigger: "change" }],
deviceSn: [
{ required: true, message: "设备序列表不能为空", trigger: "blur" },
{ max: 64, message: "最多输入64个字符" },
],
},
projectOptions: [],
deptOptions: [],
}; };
}, },
created() { created() {
this.getList(); this.getList();
this.getProjectList();
}, },
methods: { methods: {
//
getProjectList() {
let param = {
data: {},
};
//
this.$api.publics.getProjectList(param).then((response) => {
this.projectOptions = response.rows;
});
},
projectChange(val) {
this.form.deptId = null;
//
this.initDept(val);
},
initDept(val) {
this.$api.publics
.queryUnitList({
projectId: val,
unitType: 2,
})
.then((d) => {
this.deptOptions = d.rows;
if (d.rows.length > 0) {
//
} else {
this.$message.error("当前项目未分配总包单位!");
}
});
},
/** 查询塔基检测配置列表 */ /** 查询塔基检测配置列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listTowerProjectConfig(this.queryParams).then(response => { listTowerProjectConfig(this.queryParams).then((response) => {
this.towerProjectConfigList = response.rows; this.towerProjectConfigList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
@ -259,7 +382,7 @@ export default {
createTime: null, createTime: null,
updateBy: null, updateBy: null,
updateTime: null, updateTime: null,
remark: null remark: null,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -275,9 +398,9 @@ export default {
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map((item) => item.id);
this.single = selection.length!==1 this.single = selection.length !== 1;
this.multiple = !selection.length this.multiple = !selection.length;
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
@ -288,8 +411,8 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const id = row.id || this.ids const id = row.id || this.ids;
getTowerProjectConfig(id).then(response => { getTowerProjectConfig(id).then((response) => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改塔基检测配置"; this.title = "修改塔基检测配置";
@ -297,16 +420,16 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if (this.form.id != null) { if (this.form.id != null) {
updateTowerProjectConfig(this.form).then(response => { updateTowerProjectConfig(this.form).then((response) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
} else { } else {
addTowerProjectConfig(this.form).then(response => { addTowerProjectConfig(this.form).then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
@ -318,19 +441,49 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除塔基检测配置编号为"' + ids + '"的数据项?').then(function() { this.$modal
return delTowerProjectConfig(ids); .confirm('是否确认删除塔基检测配置编号为"' + ids + '"的数据项?')
}).then(() => { .then(function () {
this.getList(); return delTowerProjectConfig(ids);
this.$modal.msgSuccess("删除成功"); })
}).catch(() => {}); .then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('device/towerProjectConfig/export', { this.download(
...this.queryParams "device/towerProjectConfig/export",
}, `towerProjectConfig_${new Date().getTime()}.xlsx`) {
} ...this.queryParams,
} },
`towerProjectConfig_${new Date().getTime()}.xlsx`
);
},
//
setStatus(row, val) {
this.$confirm(`是否确认${val == 0 ? "启用" : "停用"}当前数据配置?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(async () => {
delTowerProjectConfig(row.id).then((response) => {
this.$modal.msgSuccess("修改成功");
this.getList();
});
})
.catch(() => {
//
if (val == "0") {
row.isDel = "1";
} else {
row.isDel = "0";
}
});
},
},
}; };
</script> </script>

View File

@ -830,7 +830,7 @@ export default {
}, },
}; };
</script> </script>
<style lang="scss"> <style lang="scss" scope>
.prj-suprj-edit-dialog { .prj-suprj-edit-dialog {
.el-dialog__body { .el-dialog__body {
padding-bottom: 0px; padding-bottom: 0px;

View File

@ -20,7 +20,7 @@ spring:
# 国际化资源文件路径 # 国际化资源文件路径
basename: i18n/messages basename: i18n/messages
profiles: profiles:
active: prod active: druid
# 文件上传 # 文件上传
servlet: servlet:
multipart: multipart:

View File

@ -76,6 +76,10 @@ public class DevTowerProjectConfig extends BaseEntity
@Excel(name = "塔节高度") @Excel(name = "塔节高度")
private String towerSectionHeight; private String towerSectionHeight;
/** 设备状态 */
@Excel(name = "设备状态")
private String online;
/** 是否有效 */ /** 是否有效 */
@Excel(name = "是否有效") @Excel(name = "是否有效")
private Long isDel; private Long isDel;
@ -206,7 +210,16 @@ public class DevTowerProjectConfig extends BaseEntity
{ {
return towerSectionHeight; return towerSectionHeight;
} }
public void setIsDel(Long isDel)
public String getOnline() {
return online;
}
public void setOnline(String online) {
this.online = online;
}
public void setIsDel(Long isDel)
{ {
this.isDel = isDel; this.isDel = isDel;
} }
@ -248,6 +261,7 @@ public class DevTowerProjectConfig extends BaseEntity
.append("towerBodyHeight", getTowerBodyHeight()) .append("towerBodyHeight", getTowerBodyHeight())
.append("towerCapHeight", getTowerCapHeight()) .append("towerCapHeight", getTowerCapHeight())
.append("towerSectionHeight", getTowerSectionHeight()) .append("towerSectionHeight", getTowerSectionHeight())
.append("online", getOnline())
.append("isDel", getIsDel()) .append("isDel", getIsDel())
.append("createBy", getCreateBy()) .append("createBy", getCreateBy())
.append("createTime", getCreateTime()) .append("createTime", getCreateTime())

View File

@ -102,7 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="towerBodyHeight != null">tower_body_height,</if> <if test="towerBodyHeight != null">tower_body_height,</if>
<if test="height != null">height,</if> <if test="height != null">height,</if>
<if test="angle != null">angle,</if> <if test="angle != null">angle,</if>
<if test="range != null">range,</if> <if test="range != null">`range`,</if>
<if test="earlyWarningDistance != null">early_warning_distance,</if> <if test="earlyWarningDistance != null">early_warning_distance,</if>
<if test="alarmWarningDistance != null">alarm_warning_distance,</if> <if test="alarmWarningDistance != null">alarm_warning_distance,</if>
<if test="contourValue != null">contour_value,</if> <if test="contourValue != null">contour_value,</if>
@ -156,7 +156,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="towerBodyHeight != null">tower_body_height = #{towerBodyHeight},</if> <if test="towerBodyHeight != null">tower_body_height = #{towerBodyHeight},</if>
<if test="height != null">height = #{height},</if> <if test="height != null">height = #{height},</if>
<if test="angle != null">angle = #{angle},</if> <if test="angle != null">angle = #{angle},</if>
<if test="range != null">range = #{range},</if> <if test="range != null">`range` = #{range},</if>
<if test="earlyWarningDistance != null">early_warning_distance = #{earlyWarningDistance},</if> <if test="earlyWarningDistance != null">early_warning_distance = #{earlyWarningDistance},</if>
<if test="alarmWarningDistance != null">alarm_warning_distance = #{alarmWarningDistance},</if> <if test="alarmWarningDistance != null">alarm_warning_distance = #{alarmWarningDistance},</if>
<if test="contourValue != null">contour_value = #{contourValue},</if> <if test="contourValue != null">contour_value = #{contourValue},</if>

View File

@ -77,9 +77,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deviceKey != null">device_key,</if> <if test="deviceKey != null">device_key,</if>
<if test="deviceSource != null">device_source,</if> <if test="deviceSource != null">device_source,</if>
<if test="height != null">height,</if> <if test="height != null">height,</if>
<if test="range != null">range,</if> <if test="range != null">`range`,</if>
<if test="rotation != null">rotation,</if> <if test="rotation != null">rotation,</if>
<if test="load != null">load,</if> <if test="load != null">`load`,</if>
<if test="windSpeed != null">wind_speed,</if> <if test="windSpeed != null">wind_speed,</if>
<if test="leanAngleX != null">lean_angle_x,</if> <if test="leanAngleX != null">lean_angle_x,</if>
<if test="leanAngleY != null">lean_angle_y,</if> <if test="leanAngleY != null">lean_angle_y,</if>
@ -149,9 +149,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deviceKey != null">device_key = #{deviceKey},</if> <if test="deviceKey != null">device_key = #{deviceKey},</if>
<if test="deviceSource != null">device_source = #{deviceSource},</if> <if test="deviceSource != null">device_source = #{deviceSource},</if>
<if test="height != null">height = #{height},</if> <if test="height != null">height = #{height},</if>
<if test="range != null">range = #{range},</if> <if test="range != null">`range` = #{range},</if>
<if test="rotation != null">rotation = #{rotation},</if> <if test="rotation != null">rotation = #{rotation},</if>
<if test="load != null">load = #{load},</if> <if test="load != null">`load` = #{load},</if>
<if test="windSpeed != null">wind_speed = #{windSpeed},</if> <if test="windSpeed != null">wind_speed = #{windSpeed},</if>
<if test="leanAngleX != null">lean_angle_x = #{leanAngleX},</if> <if test="leanAngleX != null">lean_angle_x = #{leanAngleX},</if>
<if test="leanAngleY != null">lean_angle_y = #{leanAngleY},</if> <if test="leanAngleY != null">lean_angle_y = #{leanAngleY},</if>

View File

@ -21,6 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="towerBodyHeight" column="tower_body_height" /> <result property="towerBodyHeight" column="tower_body_height" />
<result property="towerCapHeight" column="tower_cap_height" /> <result property="towerCapHeight" column="tower_cap_height" />
<result property="towerSectionHeight" column="tower_section_height" /> <result property="towerSectionHeight" column="tower_section_height" />
<result property="online" column="online" />
<result property="isDel" column="is_del" /> <result property="isDel" column="is_del" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
@ -30,7 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectDevTowerProjectConfigVo"> <sql id="selectDevTowerProjectConfigVo">
select dtpc.id, dtpc.project_id, dtpc.dept_id, sp.projectName, sd.dept_name, dtpc.device_sn, dtpc.device_source, dtpc.tower_id, dtpc.tower_type, dtpc.coordinate_x, dtpc.coordinate_y, dtpc.front_brachium, dtpc.after_brachium, dtpc.tower_body_height, dtpc.tower_cap_height, dtpc.tower_section_height, dtpc.is_del, dtpc.create_by, dtpc.create_time, dtpc.update_by, dtpc.update_time, dtpc.remark from dev_tower_project_config dtpc select dtpc.id, dtpc.project_id, dtpc.dept_id, sp.projectName, sd.dept_name, dtpc.device_sn, dtpc.device_source, dtpc.tower_id, dtpc.tower_type, dtpc.coordinate_x, dtpc.coordinate_y, dtpc.front_brachium, dtpc.after_brachium, dtpc.tower_body_height, dtpc.tower_cap_height, dtpc.tower_section_height, dtpc.online, dtpc.is_del, dtpc.create_by, dtpc.create_time, dtpc.update_by, dtpc.update_time, dtpc.remark from dev_tower_project_config dtpc
left join sur_project sp on sp.id = dtpc.project_id left join sur_project sp on sp.id = dtpc.project_id
left join sys_dept sd on sd.dept_id = dtpc.dept_id left join sys_dept sd on sd.dept_id = dtpc.dept_id
</sql> </sql>
@ -46,7 +47,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deviceSource != null and deviceSource != ''"> and dtpc.device_source = #{deviceSource}</if> <if test="deviceSource != null and deviceSource != ''"> and dtpc.device_source = #{deviceSource}</if>
<if test="towerId != null and towerId != ''"> and dtpc.tower_id = #{towerId}</if> <if test="towerId != null and towerId != ''"> and dtpc.tower_id = #{towerId}</if>
<if test="towerType != null and towerType != ''"> and dtpc.tower_type = #{towerType}</if> <if test="towerType != null and towerType != ''"> and dtpc.tower_type = #{towerType}</if>
and dtpc.is_del=0
</where> </where>
order by dtpc.id desc order by dtpc.id desc
</select> </select>
@ -72,6 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="towerBodyHeight != null">tower_body_height,</if> <if test="towerBodyHeight != null">tower_body_height,</if>
<if test="towerCapHeight != null">tower_cap_height,</if> <if test="towerCapHeight != null">tower_cap_height,</if>
<if test="towerSectionHeight != null">tower_section_height,</if> <if test="towerSectionHeight != null">tower_section_height,</if>
<if test="online != null">online,</if>
<if test="isDel != null">is_del,</if> <if test="isDel != null">is_del,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
@ -93,6 +94,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="towerBodyHeight != null">#{towerBodyHeight},</if> <if test="towerBodyHeight != null">#{towerBodyHeight},</if>
<if test="towerCapHeight != null">#{towerCapHeight},</if> <if test="towerCapHeight != null">#{towerCapHeight},</if>
<if test="towerSectionHeight != null">#{towerSectionHeight},</if> <if test="towerSectionHeight != null">#{towerSectionHeight},</if>
<if test="online != null">#{online},</if>
<if test="isDel != null">#{isDel},</if> <if test="isDel != null">#{isDel},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
@ -118,6 +120,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="towerBodyHeight != null">tower_body_height = #{towerBodyHeight},</if> <if test="towerBodyHeight != null">tower_body_height = #{towerBodyHeight},</if>
<if test="towerCapHeight != null">tower_cap_height = #{towerCapHeight},</if> <if test="towerCapHeight != null">tower_cap_height = #{towerCapHeight},</if>
<if test="towerSectionHeight != null">tower_section_height = #{towerSectionHeight},</if> <if test="towerSectionHeight != null">tower_section_height = #{towerSectionHeight},</if>
<if test="online != null">online = #{online},</if>
<if test="isDel != null">is_del = #{isDel},</if> <if test="isDel != null">is_del = #{isDel},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>