update code

dev_xds
haha 2024-03-23 18:32:18 +08:00
parent 0240c1a2a1
commit 41a8a5179d
4 changed files with 69 additions and 23 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

@ -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" />
@ -158,7 +166,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()
}, },
// //
@ -187,9 +196,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 +216,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();
@ -225,11 +234,17 @@ export default {
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; postData.projectId=this.queryParams.projectId;
postData.deptId=this.queryParams.subDeptId; postData.deptId=this.queryParams.deptId;
postData.pageNum=this.queryParams.pageNum; postData.pageNum=this.queryParams.pageNum;
postData.pageSize=this.queryParams.pageSize; postData.pageSize=this.queryParams.pageSize;
if(this.queryParams.companyTypeId && this.queryParams.companyTypeId>0){
postData.companyTypeId=this.queryParams.companyTypeId;
}
listAttendance(postData).then(response=>{ listAttendance(postData).then(response=>{
this.attendanceList = response.rows; this.attendanceList = (response.rows||[]).map(it=>{
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

@ -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);

View File

@ -76,6 +76,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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