dev_xds
姜玉琦 2024-03-24 01:38:50 +08:00
commit 668912e91c
6 changed files with 95 additions and 25 deletions

View File

@ -9,7 +9,7 @@ ruoyi:
# 实例演示开关 # 实例演示开关
demoEnabled: true demoEnabled: true
# 文件路径 示例( Windows配置D:/ruoyi/uploadPathLinux配置 /home/ruoyi/uploadPath # 文件路径 示例( Windows配置D:/ruoyi/uploadPathLinux配置 /home/ruoyi/uploadPath
profile: D:/data/uploadPath profile: D:/data2/uploadPath
# 获取ip地址开关 # 获取ip地址开关
addressEnabled: false addressEnabled: false
# 验证码类型 math 数字计算 char 字符验证 # 验证码类型 math 数字计算 char 字符验证

View File

@ -17,7 +17,7 @@ const service = axios.create({
// axios中请求配置有baseURL选项表示请求URL公共部分 // axios中请求配置有baseURL选项表示请求URL公共部分
baseURL: process.env.VUE_APP_BASE_API, baseURL: process.env.VUE_APP_BASE_API,
// 超时 // 超时
timeout: 10000 timeout: 100000
}) })
// request拦截器 // request拦截器

View File

@ -1,18 +1,26 @@
<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="82px">
<el-form-item label="项目名称" prop="projectId"> <el-form-item label="项目名称" prop="projectId">
<el-select :disabled="prjDisabled" v-model="queryParams.projectId" placeholder="请选择项目" clearable @change="doQuerySub()"> <el-select :disabled="prjDisabled" v-model="queryParams.projectId" placeholder="请选择项目" clearable @change="doQuerySub()">
<el-option v-for="(item, index) in projectOptions" :key="index" :label="item.projectName" :value="item.id"> <el-option v-for="(item, index) in projectOptions" :key="index" :label="item.projectName" :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="总包单位" prop="subDeptId"> <el-form-item label="总包单位" prop="deptId">
<el-select v-model="queryParams.subDeptId" placeholder="请选择总包单位" clearable> <el-select v-model="queryParams.deptId" placeholder="请选择总包单位" clearable>
<el-option v-for="(item, index) in depts" :key="index" :label="item.deptName" :value="item.deptId"> <el-option v-for="(item, index) in depts" :key="index" :label="item.deptName" :value="item.deptId">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="分包商类型" prop="companyTypeId">
<el-select v-model="queryParams.companyTypeId" placeholder="请选择分包商类型" clearable>
<el-option value="0" label="所有"></el-option>
<el-option value="101" label="总包人员"></el-option>
<el-option value="102" label="监理人员"></el-option>
<el-option value="103" label="劳务人员"></el-option>
</el-select>
</el-form-item>
<el-form-item label="日期" prop="createBy"> <el-form-item label="日期" prop="createBy">
<el-date-picker v-model="queryParams.attendanceTime" type="date" placeholder="选择日期"> <el-date-picker v-model="queryParams.attendanceTime" type="date" placeholder="选择日期">
</el-date-picker> </el-date-picker>
@ -52,7 +60,7 @@
<el-table-column label="照片" align="center" prop="id"> <el-table-column label="照片" align="center" prop="id">
<template slot-scope="{row}"> <template slot-scope="{row}">
<el-image :src="row.workerPhoto||row.scanPhoto" :preview-src-list="[row.workerPhoto||row.scanPhoto]" style="height:60px"/> <el-image :src="row.scanPhoto||row.workerPhoto" :preview-src-list="[row.scanPhoto||row.workerPhoto]" style="height:60px"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="姓名" align="center" prop="workerName" /> <el-table-column label="姓名" align="center" prop="workerName" />
@ -126,6 +134,7 @@
<script> <script>
import { listAttendance, getAttendance, delAttendance, addAttendance, updateAttendance } from "@/api/project/attendance"; import { listAttendance, getAttendance, delAttendance, addAttendance, updateAttendance } from "@/api/project/attendance";
import { listAttendanceWorker, getAttendanceWorker, delAttendanceWorker, addAttendanceWorker, updateAttendanceWorker, queryAttendanceData } from "@/api/project/attendanceWorker"; import { listAttendanceWorker, getAttendanceWorker, delAttendanceWorker, addAttendanceWorker, updateAttendanceWorker, queryAttendanceData } from "@/api/project/attendanceWorker";
import {listAttendanceConfig} from '@/api/project/attendanceConfig.js'
import attConfigDrawer from '../attendanceConfig/attendanceConfigDrawer.vue' import attConfigDrawer from '../attendanceConfig/attendanceConfigDrawer.vue'
export default { export default {
name: "Attendance", name: "Attendance",
@ -158,7 +167,8 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectId:null, projectId:null,
subDeptId:null, deptId:null,
companyTypeId:"0",
attendanceTime:new Date() attendanceTime:new Date()
}, },
// //
@ -169,12 +179,16 @@ export default {
projectOptions: [], projectOptions: [],
depts: [], depts: [],
prjDisabled:false, prjDisabled:false,
cfgList:[],
}; };
}, },
created() { created() {
this.$api.publics.getMyProjectList({}).then((response) => { this.$api.publics.getMyProjectList({}).then((response) => {
this.projectOptions = response.rows; this.projectOptions = response.rows;
}); });
listAttendanceConfig({}).then(d=>{
this.cfgList=d.rows||[];
});
}, },
methods: { methods: {
init(prj){ init(prj){
@ -187,9 +201,9 @@ export default {
if (tmps.length > 0) { if (tmps.length > 0) {
this.depts = tmps; this.depts = tmps;
if (tmps.length == 1) { if (tmps.length == 1) {
this.queryParams.subDeptId = tmps[0].deptId; this.queryParams.deptId = tmps[0].deptId;
} else { } else {
this.queryParams.subDeptId = ''; this.queryParams.deptId = '';
} }
if(init){ if(init){
this.getList(); this.getList();
@ -207,9 +221,9 @@ export default {
this.prjDept2[this.queryParams.projectId] = objs; this.prjDept2[this.queryParams.projectId] = objs;
this.depts = objs; this.depts = objs;
if (objs.length == 1) { if (objs.length == 1) {
this.queryParams.subDeptId = objs[0].deptId; this.queryParams.deptId = objs[0].deptId;
} else { } else {
this.queryParams.subDeptId = ''; this.queryParams.deptId = '';
} }
if(init){ if(init){
this.getList(); this.getList();
@ -224,10 +238,23 @@ export default {
this.loading = true; this.loading = true;
let postData={}; let postData={};
postData.attendanceTime=this.$dt(this.queryParams.attendanceTime).format("YYYY-MM-DD"); postData.attendanceTime=this.$dt(this.queryParams.attendanceTime).format("YYYY-MM-DD");
postData.projectId=this.queryParams.projectId; let tmps=this.cfgList.filter(d=>d.projectId==this.queryParams.projectId && d.subDeptId==this.queryParams.deptId);
postData.deptId=this.queryParams.subDeptId; if(tmps.length>0){
listAttendance(postData).then(response=>{ postData.cfgid=tmps[0].id;
this.attendanceList = response.rows; }else{
postData.projectId=this.queryParams.projectId;
postData.deptId=this.queryParams.deptId;
}
postData.pageNum=this.queryParams.pageNum;
postData.pageSize=this.queryParams.pageSize;
if(this.queryParams.companyTypeId && this.queryParams.companyTypeId>0){
postData.companyTypeId=this.queryParams.companyTypeId;
}
listAttendance(postData).then(response=>{
this.attendanceList = (response.rows||[]).map(it=>{
it.scanPhoto=it.scanPhoto && it.scanPhoto.indexOf("/profile")==0?"/jhapi"+it.scanPhoto:it.scanPhoto;
return it;
});
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
}) })

View File

@ -2,6 +2,11 @@ package com.yanzhu.jh.project.controller;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.yanzhu.jh.project.domain.SurProjectAttendanceCfg;
import com.yanzhu.jh.project.service.ISurProjectAttendanceCfgService;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -34,6 +39,8 @@ public class SurProjectAttendanceDataController extends BaseController
@Autowired @Autowired
private ISurProjectAttendanceDataService surProjectAttendanceDataService; private ISurProjectAttendanceDataService surProjectAttendanceDataService;
@Autowired
private ISurProjectAttendanceCfgService surProjectAttendanceCfgService;
/** /**
* *
*/ */
@ -42,6 +49,11 @@ public class SurProjectAttendanceDataController extends BaseController
public TableDataInfo list(SurProjectAttendanceData surProjectAttendanceData) public TableDataInfo list(SurProjectAttendanceData surProjectAttendanceData)
{ {
startPage(); startPage();
String tmp=surProjectAttendanceData.getAttendanceTime();
if(StrUtil.isNotEmpty(tmp)){
int year= DateUtil.parse(tmp).year();
surProjectAttendanceData.setYear(year);
}
List<SurProjectAttendanceData> list = surProjectAttendanceDataService.selectSurProjectAttendanceDataList(surProjectAttendanceData); List<SurProjectAttendanceData> list = surProjectAttendanceDataService.selectSurProjectAttendanceDataList(surProjectAttendanceData);
return getDataTable(list); return getDataTable(list);
} }

View File

@ -82,16 +82,16 @@ public class AttendanceJgwTask {
String appid="6a6f24fe35b04ee0bcf31cfb46ed1051"; String appid="6a6f24fe35b04ee0bcf31cfb46ed1051";
String secret="c3h5enh4MjAyNHN1Yw=="; String secret="c3h5enh4MjAyNHN1Yw==";
String prjId="db955e11ef774e63968a47c3dc2acc15";//"b67f1baa6dca4558a16bf90a4681b82e"; String prjId="db955e11ef774e63968a47c3dc2acc15";//"b67f1baa6dca4558a16bf90a4681b82e";//
String token= getToken(appid,secret); String token= getToken(appid,secret);
if(token==null || token.length()==0){ if(token==null || token.length()==0){
return; return;
} }
System.out.println(token); System.out.println(token);
System.out.println(DateUtil.format(DateTime.now(),"yyyy-MM-dd")); System.out.println(DateUtil.format(DateTime.now(),"yyyy-MM-dd"));
findAddWorkerByProject(appid,token,prjId,0); //findAddWorkerByProject(appid,token,prjId,0);
//findAttendanceByProject(appid,token,prjId); //findAttendanceByProject(appid,token,prjId);
//findTeamByProjectId(appid,token,prjId); findTeamByProjectId(appid,token,prjId);
//findProContractorByProjectId(appid,token,prjId); //findProContractorByProjectId(appid,token,prjId);
} }
public static void findAttendanceByProject(String appId,String token,String projectId){ public static void findAttendanceByProject(String appId,String token,String projectId){
@ -152,7 +152,6 @@ public class AttendanceJgwTask {
String purl=joData.getString("result"); String purl=joData.getString("result");
byte[] buffer= HttpUtil.downloadBytes(purl); byte[] buffer= HttpUtil.downloadBytes(purl);
String filePath= RuoYiConfig.getUploadPath(); String filePath= RuoYiConfig.getUploadPath();
filePath="D:/data/uploadPath";
try { try {
return FileUtils.writeBytes(buffer, filePath+"/jgw"); return FileUtils.writeBytes(buffer, filePath+"/jgw");
}catch (Exception ex){ }catch (Exception ex){
@ -191,9 +190,9 @@ public class AttendanceJgwTask {
} }
} }
public static void findTeamByProjectId(String appId,String token,String projectId){ public static void findTeamByProjectId(String appId,String token,String projectId){
String path="/webapi/project/findTeamByProjectId"; String path="webapi/project/findTeamByProjectId";
String time = System.currentTimeMillis() + ""; String time = System.currentTimeMillis() + "";
String startId="34549"; String startId="0";
String url=host+path+"?appId=" + appId + "&tokenSign=" + token +"&timestamp=" + time; String url=host+path+"?appId=" + appId + "&tokenSign=" + token +"&timestamp=" + time;
String tokenSign = Md5Utils.hash(url); String tokenSign = Md5Utils.hash(url);
@ -215,7 +214,7 @@ public class AttendanceJgwTask {
JSONArray arr=joData.getJSONArray("teamList"); JSONArray arr=joData.getJSONArray("teamList");
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); SurProjectAttendanceGroup group=SurProjectAttendanceGroup.createJgw(json);
group.setBizLicense(json.getString("corpCode")); group.setBizLicense(json.getString("corpCode"));
String type=json.getString("corpType"); String type=json.getString("corpType");

View File

@ -75,7 +75,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="workTypeCode != null and workTypeCode != ''"> and workTypeCode = #{workTypeCode}</if> <if test="workTypeCode != null and workTypeCode != ''"> and workTypeCode = #{workTypeCode}</if>
<if test="companyId != null "> and companyId = #{companyId}</if> <if test="companyId != null "> and companyId = #{companyId}</if>
<if test="vendorId != null "> and vendorId = #{vendorId}</if> <if test="vendorId != null "> and vendorId = #{vendorId}</if>
<if test="deviceCode != null and deviceCode != ''"> and device_code = #{deviceCode}</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="scanPhoto != null and scanPhoto != ''"> and scanPhoto = #{scanPhoto}</if>
<if test="isDel != null "> and is_del = #{isDel}</if> <if test="isDel != null "> and is_del = #{isDel}</if>
</where> </where>
@ -97,6 +113,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="teamId != null "> and teamId = #{teamId}</if> <if test="teamId != null "> and teamId = #{teamId}</if>
<if test="workTypeCode != null and workTypeCode != ''"> and workTypeCode = #{workTypeCode}</if> <if test="workTypeCode != null and workTypeCode != ''"> and workTypeCode = #{workTypeCode}</if>
<if test="companyId != null "> and companyId = #{companyId}</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="vendorId != null "> and vendorId = #{vendorId}</if>
<if test="deviceCode != null and deviceCode != ''"> and device_code = #{deviceCode}</if> <if test="deviceCode != null and deviceCode != ''"> and device_code = #{deviceCode}</if>
<if test="scanPhoto != null and scanPhoto != ''"> and scanPhoto = #{scanPhoto}</if> <if test="scanPhoto != null and scanPhoto != ''"> and scanPhoto = #{scanPhoto}</if>
@ -385,7 +417,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and projectId=#{projectId} and projectId=#{projectId}
</if> </if>
<if test="deptId!=null and deptId>0"> <if test="deptId!=null and deptId>0">
and deptid=#{deptId} and projectId in (SELECT id FROM sur_project WHERE deptid=#{deptId})
</if> </if>
<if test="prjIds !=null and prjIds.size()>0"> <if test="prjIds !=null and prjIds.size()>0">
and projectId in and projectId in
@ -404,7 +436,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and projectId=#{projectId} and projectId=#{projectId}
</if> </if>
<if test="deptId!=null and deptId>0"> <if test="deptId!=null and deptId>0">
and deptid=#{deptId} and projectId in (SELECT id FROM sur_project WHERE deptid=#{deptId})
</if> </if>
<if test="prjIds !=null and prjIds.size()>0"> <if test="prjIds !=null and prjIds.size()>0">
and projectId in and projectId in