修复数字建BUG

dev_xd
haha 2025-06-25 23:15:23 +08:00
parent 8a4261e572
commit b494391d44
6 changed files with 1030 additions and 953 deletions

View File

@ -207,7 +207,7 @@ export default {
if (tmps.length > 0) { if (tmps.length > 0) {
this.$store.dispatch("SetSelProject", tmps[0]); this.$store.dispatch("SetSelProject", tmps[0]);
this.selProject = tmps[0]; this.selProject = tmps[0];
if(this.sel.vendorsCode == "jgw" ){ if(this.selProject.vendorsCode == "jgw" ){
this.selProject.vendorsCode = "uni"; this.selProject.vendorsCode = "uni";
} }

File diff suppressed because it is too large Load Diff

View File

@ -399,12 +399,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="groupAllByComany" parameterType="SurProjectAttendanceData" resultMap="SurProjectAttendanceDataResult"> <select id="groupAllByComany" parameterType="SurProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
select g.companyTypeId,count(1) id select ct.sub_type companyTypeId,count(1) id
from sur_project_attendance_user u, attendance_cfg c,view_sur_project_attendance_group g, from sur_project_attendance_user u, attendance_cfg c,
pro_project_info sp view_sur_project_attendance_group g,
where u.cfgid=c.id and u.companyId=g.companyId and u.state=#{id} and c.project_id = sp.id pro_project_info sp,
and sp.is_Del=0 sur_project_attendance_company_type ct
and g.companyTypeId in (0,1,2,3,4,5,6,8) where u.cfgid=c.id and u.companyId=g.companyId and u.state=0 and c.project_id = sp.id
and u.vendors_code=ct.vendors_code and g.companyTypeId=ct.type_id
and sp.is_Del=0
and ct.sub_type in (0,1,2,3,4,5,6,8)
<if test="projectId!=null and projectId>0"> <if test="projectId!=null and projectId>0">
and c.project_id=#{projectId} and c.project_id=#{projectId}
</if> </if>
@ -418,7 +421,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item} #{item}
</foreach> </foreach>
</if> </if>
group by g.companyTypeId group by ct.sub_type
</select> </select>
<select id="getHuazhuPage" parameterType="SurProjectAttendanceData" resultType="Long"> <select id="getHuazhuPage" parameterType="SurProjectAttendanceData" resultType="Long">
@ -655,8 +658,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from sur_project_attendance_data_${year} where from sur_project_attendance_data_${year} where
is_del !=1 is_del !=1
and projectid=#{prjId} and projectid=#{prjId}
AND (date(attendance_time) &gt;= date(#{dateStart}) or date(attendance_out_time) &gt;= date(#{dateStart})) AND DATE( ifnull( attendance_time, attendance_out_time ) ) &gt;= date(#{dateStart})
AND (date(attendance_time) &lt;= date(#{dateEnd}) or date(attendance_out_time) &lt;= date(#{dateEnd})) AND DATE( ifnull( attendance_time, attendance_out_time ) ) &lt;= date(#{dateEnd})
) tmp ) tmp
group by dt group by dt

View File

@ -112,8 +112,8 @@ public class AttendanceSzjTask {
try { try {
params.put("offset",5); params.put("offset",5);
params.put("recordSize",5); params.put("recordSize",5);
params.put("startTime","2025-06-01"); params.put("startTime","2025-06-25");
params.put("endTime","2025-06-07"); params.put("endTime","2025-06-26");
String result = HttpUtils.sendJSONPost(SZJ_HOST + "v1/api/recognition/query", JSON.toJSONString(params), headerMap); String result = HttpUtils.sendJSONPost(SZJ_HOST + "v1/api/recognition/query", JSON.toJSONString(params), headerMap);
JSONObject jsonObject = JSONObject.parseObject(result); JSONObject jsonObject = JSONObject.parseObject(result);
if (jsonObject != null && jsonObject.getBoolean("success")) { if (jsonObject != null && jsonObject.getBoolean("success")) {
@ -460,7 +460,7 @@ public class AttendanceSzjTask {
headerMap.put("token",token); headerMap.put("token",token);
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
try { try {
params.put("offset",1); params.put("offset",pageIndex);
params.put("recordSize",100); params.put("recordSize",100);
String result = HttpUtils.sendJSONPost(SZJ_HOST + "v1/api/person/query", JSON.toJSONString(params), headerMap); String result = HttpUtils.sendJSONPost(SZJ_HOST + "v1/api/person/query", JSON.toJSONString(params), headerMap);
JSONObject jsonObject = JSONObject.parseObject(result); JSONObject jsonObject = JSONObject.parseObject(result);
@ -504,7 +504,7 @@ public class AttendanceSzjTask {
public void syncAttendanceData() { public void syncAttendanceData() {
log.info("开始同步数智建考勤记录...{}",DateUtils.dateTimeStr()); log.info("开始同步数智建考勤记录...{}",DateUtils.dateTimeStr());
String startTime=DateUtil.formatDate(new Date()); String startTime=DateUtil.formatDate(new Date());
String endTime=DateUtil.formatDate(new Date()); String endTime=DateUtil.formatDate(DateUtil.offsetDay(new Date(),1));
syncAttendanceData(startTime,endTime); syncAttendanceData(startTime,endTime);
} }
@ -513,8 +513,8 @@ public class AttendanceSzjTask {
*/ */
public void syncLastWeekAttendanceData() { public void syncLastWeekAttendanceData() {
log.info("开始同步数智建考勤记录...{}",DateUtils.dateTimeStr()); log.info("开始同步数智建考勤记录...{}",DateUtils.dateTimeStr());
String startTime=DateUtil.formatDate(DateUtil.offsetDay(new Date(),-7)); String startTime=DateUtil.formatDate(DateUtil.offsetDay(new Date(),-6));
String endTime=DateUtil.formatDate(new Date()); String endTime=DateUtil.formatDate(DateUtil.offsetDay(new Date(),1));
syncAttendanceData(startTime,endTime); syncAttendanceData(startTime,endTime);
} }
@ -544,6 +544,7 @@ public class AttendanceSzjTask {
try { try {
String token = getToken(jSONObject.getString("secret")); String token = getToken(jSONObject.getString("secret"));
doSyncAttendance(token, item,0,startTime,endTime); doSyncAttendance(token, item,0,startTime,endTime);
System.out.println("====完成====");
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
@ -596,6 +597,8 @@ public class AttendanceSzjTask {
att.setCompanyName(user.getCompanyName()); att.setCompanyName(user.getCompanyName());
att.setCompanyTypeId(user.getCompanyTypeId()); att.setCompanyTypeId(user.getCompanyTypeId());
QuartzProjectAttendanceGroup groupWhere=new QuartzProjectAttendanceGroup(); QuartzProjectAttendanceGroup groupWhere=new QuartzProjectAttendanceGroup();
groupWhere.setCfgid(cfg.getId());
groupWhere.setTeamId(NumberUtil.parseLong(user.getGroupId()));
List<QuartzProjectAttendanceGroup> groupList=groupService.selectSurProjectAttendanceGroupList(groupWhere); List<QuartzProjectAttendanceGroup> groupList=groupService.selectSurProjectAttendanceGroupList(groupWhere);
if(!groupList.isEmpty()){ if(!groupList.isEmpty()){
QuartzProjectAttendanceGroup group=groupList.get(0); QuartzProjectAttendanceGroup group=groupList.get(0);
@ -624,7 +627,7 @@ public class AttendanceSzjTask {
} }
} }
if(atts.size()==100){ if(atts.size()==100){
doSyncAttendance(token,cfg,offset+1,startTime,endTime); doSyncAttendance(token,cfg,offset,startTime,endTime);
} }
} }

View File

@ -132,7 +132,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</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>
<if test="attendanceTime != null and attendanceTime != ''"> and date(attendance_time) = date(#{attendanceTime})</if> <if test="attendanceTime != null and attendanceTime != ''"> and DATE( ifnull( attendance_time, attendance_out_time ) ) = date(#{attendanceTime})</if>
</where> </where>
order by id desc order by id desc
</select> </select>

View File

@ -65,7 +65,7 @@ public class LaborController extends BaseController {
@GetMapping("/groupAttendanceLastWeek/{type}/{prjId}") @GetMapping("/groupAttendanceLastWeek/{type}/{prjId}")
public AjaxResult groupAttendanceLastWeek(@PathVariable("type")String type, @PathVariable("prjId") Long prjId){ public AjaxResult groupAttendanceLastWeek(@PathVariable("type")String type, @PathVariable("prjId") Long prjId){
Date dateEnd=new DateTime(); Date dateEnd=new DateTime();
Date dateStart=DateUtil.offsetDay(dateEnd,-7); Date dateStart=DateUtil.offsetDay(dateEnd,-6);
if("uni".equals(type.toLowerCase())){ if("uni".equals(type.toLowerCase())){
JSONArray sList=attendanceUbiDataService.groupAttendanceLastWeek(prjId,dateStart,dateEnd); JSONArray sList=attendanceUbiDataService.groupAttendanceLastWeek(prjId,dateStart,dateEnd);
return AjaxResult.success(sList); return AjaxResult.success(sList);