工程进度及合同

This commit is contained in:
haozq 2024-12-10 10:43:36 +08:00
parent 87076d9ca9
commit 2800f9b97c
11 changed files with 534 additions and 14 deletions

View File

@ -140,6 +140,11 @@ public class GlobalConfig {
*/
public static final String JJ_GCJD= IP_URL+"/biz-api/ifsct/up/sel/prjConstrProgressNode";
/**
* 工程进度
*/
public static final String JJ_FILE= IP_URL+"/biz-api/ifsct/up/sel/smToolBoxTalkFile";
}

View File

@ -0,0 +1,117 @@
package com.xxl.job.executor.inter.entity;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @author 黑子
*/
@Data
public class DutyChildVo implements Serializable {
private String id;
private String ticketId;
private String type;
private String teamId;
private String code;
private String orgName;
private String jlUnit;
private String sgUnit;
private String bzaqy;
private String teamLeader;
private String teamNum;
private String voltageLevel;
private String proName;
private String prjType;
private String proStatus;
private String singCode;
private String imageProcess;
private String singType;
private String buildScale;
private String physicalQuantity;
private String yearDate;
private String kgTime;
private String tcTime;
private String startTime;
private String endTime;
private String signCode;
private String proCode;
private String buildCode;
private List<String> cityList;
private String teamName;
private String riskLevel;
private String riskLev;
private String bidName;
private String workContent;
private String workType;
private int xh;
private String projectName;
private String times;
private String workName;
private String jobGx;
private String jobSite;
private String jobLx;
private String jobName;
private String mainRisk;
/**班组负责人*/
private String workManage;
/**作业工序*/
private String workGx;
/**作业部位*/
private String workSiteName;
/**是否执行 0未执行 1已执行*/
private String execStatus;
}

View File

@ -0,0 +1,64 @@
package com.xxl.job.executor.inter.entity;
import lombok.Data;
/**
* jjFile 实体类
* 2024-12-06 16:22:50 zijixiangba
*/
@Data
public class JjFile{
//主键
private String id;
private String toolBoxTalkId;
//站班会id
private String ondutyRecordId;
//到岗到位人员表id
private String fileType;
//文件类型 01 -站班会交底-02安全措施 03 到岗到位 04 其他 05 作业票-安检-06 展板会-安检
private String prjCode;
//项目编码
private String shootingLongitude;
//
private String shootingLatitude;
//维度
private String shootingAddress;
//地址
private String shootingTime;
//时间
private String watermarkFileId;
//文件id
private String fileId;
//附件名称
private String fileName;
//
private String provinceCode;
//
private String createrId;
private String createTime;
private String updaterId;
private String updateTime;
private String deleteFlag;
private String suffixType;
//后缀类型
}

View File

@ -0,0 +1,37 @@
package com.xxl.job.executor.inter.entity;
import lombok.Data;
/**
* @author 黑子
*/
@Data
public class WeeksInfoVo {
private String id;
private String jlUnit;
private String sgUnit;
/**
* 班组负责人
*/
private String teamLeader;
/**
* 安全员
*/
private String bzaqy;
private String teamNum;
private String teamName;
private String relName;
private String relCode;
private String proCode;
}

View File

@ -255,11 +255,23 @@ public interface InterMapper {
*/
List<String> getClassCameraId();
void insertJjContractData(List<JjContract> list);
void insertJjContractData(@Param("list")List<JjContract> list);
/**
* 工程进度
* @param list
*/
void insertJjProProcessData(List<JjProProcess> list);
void insertJjProProcessData(@Param("list")List<JjProProcess> list);
void insertJjFile(@Param("list") List<JjFile> list);
List<DutyChildVo> getWeeksInfo(DutyChildVo vo);
List<WeeksInfoVo> getWeekUs(DutyChildVo vo);
WeeksInfoVo getUnit(DutyChildVo dutyChildVo);
String getTeamNum(DutyChildVo dutyChildVo);
void addWeeksInfo(WeeksInfoVo weeksInfoVo);
}

View File

@ -431,4 +431,67 @@ public class DataCenterService {
log.error(e.toString(),e);
}
}
public void insertJjFile(List<JjFile> list) {
try{
mapper.insertJjFile(list);
}catch (Exception e){
XxlJobHelper.log("文件接口插入失败--->{}",e.toString());
log.error(e.toString(),e);
}
}
public List<DutyChildVo> getWeeksInfo(DutyChildVo vo) {
try{
return mapper.getWeeksInfo(vo);
}catch (Exception e){
XxlJobHelper.log("---查询周计划异常>{}",e.toString());
log.error(e.toString(),e);
}
return new ArrayList<>();
}
public List<WeeksInfoVo> getWeekUs(DutyChildVo vo) {
try{
return mapper.getWeekUs(vo);
}catch (Exception e){
XxlJobHelper.log("---查询周计划异常>{}",e.toString());
log.error(e.toString(),e);
}
return new ArrayList<>();
}
public WeeksInfoVo getUnit(DutyChildVo dutyChildVo) {
try{
return mapper.getUnit(dutyChildVo);
}catch (Exception e){
XxlJobHelper.log("---查询定位>{}",e.toString());
log.error(e.toString(),e);
}
return new WeeksInfoVo();
}
public String getTeamNum(DutyChildVo dutyChildVo) {
try{
return mapper.getTeamNum(dutyChildVo);
}catch (Exception e){
XxlJobHelper.log("---查询定位>{}",e.toString());
log.error(e.toString(),e);
}
return "";
}
/**
* 数据新增
* @param weeksInfoVo
*/
public void addWeeksInfo(WeeksInfoVo weeksInfoVo) {
try{
mapper.addWeeksInfo(weeksInfoVo);
}catch (Exception e){
XxlJobHelper.log("--->{}",e.toString());
log.error(e.toString(),e);
}
}
}

View File

@ -15,9 +15,8 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* 业务工程管理
@ -1052,5 +1051,116 @@ public class InterService {
XxlJobHelper.handleFail(e.toString());
}
}
public void getJjFile(int pageNum) {
try {
JSONObject obj= DataUtils.getJsonObject(pageNum);
HttpResponse httpResponse = PostUtils.sendData(obj.toString(), GlobalConfig.JJ_FILE);
Map<String, Object> map = DataUtils.getArray(httpResponse);
Object objata=map.get("array");
if (objata != null) {
JSONArray array = (JSONArray) map.get("array");
List<JjFile> list = JSONArray.parseArray(array.toJSONString(), JjFile.class);
service.insertJjFile(list);
pageNum++;
if (pageNum <= (Integer) map.get("TOTAL_PAGE")) {
if (FY_BOOLEAN){
getJjFile(pageNum);
}
}
}
} catch (Exception e) {
XxlJobHelper.handleFail(e.toString());
}
}
public void getWeeksInfo() {
try{
DutyChildVo vo=new DutyChildVo();
String time= getNowDay();
//本周开始时间
String startWeek= getWeekStartOrEndTime(time,true);
//本周结束时间
String endWeek= getWeekStartOrEndTime(time,false);
vo.setStartTime(startWeek);
vo.setEndTime(endWeek);
List<DutyChildVo> list= service.getWeeksInfo(vo);
for (DutyChildVo dutyChildVo:list){
WeeksInfoVo weeksInfoVo=new WeeksInfoVo();
weeksInfoVo.setId(dutyChildVo.getId());
weeksInfoVo.setTeamName(dutyChildVo.getTeamName());
List<WeeksInfoVo> usList=service.getWeekUs(dutyChildVo);
if(usList!=null && !usList.isEmpty()){
usList.forEach(us->{
if("0900101".equals(us.getRelCode())){
weeksInfoVo.setTeamLeader(us.getRelName());
}else if("0900102".equals(us.getRelCode())) {
weeksInfoVo.setBzaqy(us.getRelName());
}
});
}
WeeksInfoVo da = service.getUnit(dutyChildVo);
String teamNum = service.getTeamNum(dutyChildVo);
weeksInfoVo.setTeamNum(teamNum);
if (da == null || StringHelper.isEmpty(da.getSgUnit())) {
dutyChildVo.setTeamId("");
da=service.getUnit(dutyChildVo);
}
if (da != null) {
dutyChildVo.setSgUnit(da.getSgUnit());
weeksInfoVo.setJlUnit(da.getJlUnit());
}
service.addWeeksInfo(weeksInfoVo);
}
}catch (Exception e){
XxlJobHelper.handleFail(e.toString());
}
}
/**
* 周开始和周结束时间
* @param time
* @param isStart
* @return
*/
public static String getWeekStartOrEndTime(String time,boolean isStart){
String returnTime=null;
try{
if(StringHelper.isEmpty(time)){
time=getNowDay();
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date dataTime = sdf.parse(time);
Calendar calendar = Calendar.getInstance();
calendar.setTime(dataTime);
// 如果是周日
if (calendar.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) {
calendar.add(Calendar.DAY_OF_YEAR,-1);
}
// 获取当前日期是当周的第i天
int i = calendar.get(Calendar.DAY_OF_WEEK) - 1;
// 获取当前日期所在周的第一天
calendar.add(Calendar.DATE , -i+1);
if(isStart){
return sdf.format(calendar.getTime());
}else{
calendar.add(Calendar.DATE , 6);
return sdf.format(calendar.getTime());
}
}catch (Exception e){
log.error(e.toString(),e);
}
return returnTime;
}
public static String getNowDay() {
String time = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
return time;
}
}

View File

@ -751,5 +751,28 @@ public class InterTwoService {
XxlJobHelper.handleFail(e.toString());
}
}
public void getJjFile(int pageNum) {
try {
JSONObject obj= DataUtils.getJsonObject2(pageNum);
HttpResponse httpResponse = PostUtils.sendData(obj.toString(), GlobalConfig.JJ_FILE);
Map<String, Object> map = DataUtils.getArray(httpResponse);
Object objata=map.get("array");
if (objata != null) {
JSONArray array = (JSONArray) map.get("array");
List<JjFile> list = JSONArray.parseArray(array.toJSONString(), JjFile.class);
service.insertJjFile(list);
pageNum++;
if (pageNum <= (Integer) map.get("TOTAL_PAGE")) {
if (FY_BOOLEAN){
getJjFile(pageNum);
}
}
}
} catch (Exception e) {
XxlJobHelper.handleFail(e.toString());
}
}
}

View File

@ -430,13 +430,29 @@ public class DataCenterXxlJob {
}
/**
* 工程数据 合同
* 工程数据进度
*/
@XxlJob("getProProcess")
public void getProProcess(){
interService.getProProcess(1);
twtoService.getProProcess(1);
}
/**
* 基建文件数据获取
*/
@XxlJob("getJjFile")
public void getJjFile(){
interService.getJjFile(1);
twtoService.getJjFile(1);
}
/**
* 周计划数据统计分析
*/
@XxlJob("getWeeksInfo")
public void getWeeksInfo(){
interService.getWeeksInfo();
}
}

View File

@ -4,8 +4,8 @@ server.port=18084
#spring.main.web-environment=false
# log config
logging.config=classpath:logback.xml
#xxl.job.admin.addresses=http://20.51.8.10:18083/xxl-job-admin
xxl.job.admin.addresses=http://127.0.0.1:18083/xxl-job-admin
xxl.job.admin.addresses=http://20.51.8.10:18083/xxl-job-admin
#xxl.job.admin.addresses=http://127.0.0.1:18083/xxl-job-admin
### xxl-job, access token
xxl.job.accessToken=default_token
### xxl-job executor appname
@ -23,12 +23,12 @@ xxl.job.executor.logretentiondays=30
mybatis.mapper-locations=classpath:/mapper/*Mapper.xml
### xxl-job, datasource
#spring.datasource.url=jdbc:mysql://20.51.8.11:13306/gwjjspaq?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8
#spring.datasource.username=admin_db
#spring.datasource.password=AHdlypt@2023
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/gwjjspaq?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai
spring.datasource.username=mroot
spring.datasource.password=bonus@admin123
spring.datasource.url=jdbc:mysql://20.51.8.11:13306/gwjjspaq?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8
spring.datasource.username=admin_db
spring.datasource.password=AHdlypt@2023
#spring.datasource.url=jdbc:mysql://127.0.0.1:3306/gwjjspaq?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai
#spring.datasource.username=mroot
#spring.datasource.password=bonus@admin123
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
### datasource-pool
spring.datasource.type=com.zaxxer.hikari.HikariDataSource

View File

@ -704,6 +704,26 @@
#{item.updateTime} )
</foreach>
</insert>
<insert id="insertJjFile">
REPLACE INTO jj_file(
id, tool_box_talk_id, onduty_record_id, file_type, prj_code,
shooting_longitude, shooting_latitude, shooting_address, shooting_time, watermark_file_id, file_id,
file_name, province_code, creater_id, create_time, updater_id, update_time,
delete_flag, suffix_type ) values
<foreach collection="list" item="item" separator=",">(
#{item.id}, #{item.toolBoxTalkId}, #{item.ondutyRecordId}, #{item.fileType}, #{item.prjCode},
#{item.shootingLongitude}, #{item.shootingLatitude}, #{item.shootingAddress}, #{item.shootingTime}, #{item.watermarkFileId}, #{item.fileId},
#{item.fileName}, #{item.provinceCode}, #{item.createrId}, #{item.createTime}, #{item.updaterId}, #{item.updateTime},
#{item.deleteFlag}, #{item.suffixType} )
</foreach>
</insert>
<insert id="addWeeksInfo">
REPLACE INTO jj_weeks_info(
id,jl_unit,sg_unit,team_leader,bzaqy,team_num,team_name)values
(#{id},#{jlUnit},#{sgUnit},#{teamLeader},#{bzaqy},#{teamNum},#{teamName})
</insert>
<select id="getMainRisk" resultType="java.lang.String">
@ -751,5 +771,58 @@
left join jj_ball jb on jcm.camera_id=jb.id
where jb.camera_no is null and jcm.current_constr_date=CURRENT_DATE
</select>
<select id="getWeeksInfo" resultType="com.xxl.job.executor.inter.entity.DutyChildVo">
SELECT so.city_name as orgName,jwp.bidding_section_name as bidName,jsi.single_project_name as projectName,
jwp.single_project_code proCode,
jsp.re_assessment_risk_level as riskLevel,jdc.value as workType,jt.working_team_name as teamName,
jsp.work_site_name as workSiteName,
jsp.work_content as workContent,jwp.id,
jsp.work_procedure workName,
(case
when jsp.re_assessment_risk_level='2' then '二级'
when jsp.re_assessment_risk_level='3' then '三级'
when jsp.re_assessment_risk_level='4' then '四级'
when jsp.re_assessment_risk_level='5' then '五级'
ELSE '其他' end
) riskLev,jwp.team_id teamId,
concat(jwp.planned_start_date,'至',jwp.planned_end_date) times,
jwp.planned_start_date as startTime,
jwp.planned_end_date as endTime
FROM jj_weeks_plan jwp
left JOIN jj_single_info jsi on jsi.single_project_code=jwp.single_project_code
left join jj_risk_precaution jsp on jsp.id=jwp.risk_precaution_id and jsp.delete_flag=0
LEFT JOIN sys_org so ON so.org_id=jwp.build_unit_code
left join jj_data_code jdc on jdc.code_value=jsp.work_type and jdc.code='WORK_TYPE'
left join jj_team jt on jt.id =jwp.team_id
WHERE (DATE_FORMAT(jwp.planned_start_date, '%Y-%m-%d') BETWEEN #{startTime} and #{endTime}
or DATE_FORMAT(jwp.planned_end_date, '%Y-%m-%d') BETWEEN #{startTime} and #{endTime}) AND jwp.plan_status = '04' AND jwp.delete_flag = '0'
AND jsp.re_assessment_risk_level IN ('2','3','4','5')
</select>
<select id="getWeekUs" resultType="com.xxl.job.executor.inter.entity.WeeksInfoVo">
SELECT jtp.real_name relName,jtp.position_code relCode
FROM jj_team_people jtp
where jtp.delete_flag=0 and jtp.position_code in ('0900101','0900102')
and jtp.team_id=#{teamId}
</select>
<select id="getUnit" resultType="com.xxl.job.executor.inter.entity.WeeksInfoVo">
select jcm.supervision_unit_name jlUnit -- 监理单位
,ju.unit_name sgUnit -- 施工单位
from jj_class_meetting jcm
left join jj_class_metting_info jcmi on jcmi.class_id=jcm.id
left join jj_unit ju on ju.unified_social_credit_id=jcm.constr_unified_social_credit_id and ju.delete_flag=0
where jcm.single_project_code=#{proCode} and ju.unit_name is not null
<if test="teamId!=null and teamId!=''">
and jcmi.team_id=#{teamId}
</if>
limit 1
</select>
<select id="getTeamNum" resultType="java.lang.String">
select IFNULL(count(1),0) num
from jj_team_people
where delete_flag=0 and team_id=#{teamId}
</select>
</mapper>