dongdingding 6 months ago
commit 54687cff0b

@ -50,7 +50,7 @@ public class ACheckQuatzEntity {
private String isFinal;
/**
*
* (,
*/
@ApiModelProperty("上报时间(如果巡查一起提交,获取巡查的巡查日期")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")

@ -1,11 +1,11 @@
package com.mudu.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.mudu.entity.dto.response.EnterpriseResponse;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.Data;
import java.io.Serializable;
import java.text.NumberFormat;
@ -18,8 +18,7 @@ import java.util.Date;
* @author wu
* @since 2024-02-26 10:43:24
*/
@Getter
@Setter
@Data
@ApiModel("实体类")
@TableName(value = "a_safe_qyjcxx")
public class ASafeQyjcxx implements Serializable {
@ -562,8 +561,12 @@ public class ASafeQyjcxx implements Serializable {
@ApiModelProperty(value = "科达企业编号,用来对照")
private String kdqybh;
public ASafeQyjcxx() {
}
/**
*
*/
@TableField(exist = false)
private ASafeWgcy aSafeWgcy;
public ASafeQyjcxx(EnterpriseResponse res) {

@ -0,0 +1,111 @@
package com.mudu.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* (ASafeWgcy)
*
* @author wu
* @since 2024-08-24 18:14:06
*/
@Data
@ApiModel("实体类")
@TableName(value = "a_safe_wgcy")
public class ASafeWgcy implements Serializable {
private static final long serialVersionUID = -54375539799721806L;
private String xxbh;
/**
*
*/
@ApiModelProperty(value = "人员编号")
private String rybh;
/**
*
*/
@ApiModelProperty(value = "人员姓名")
private String ryxm;
/**
*
*/
@ApiModelProperty(value = "固定电话")
private String gddh;
/**
*
*/
@ApiModelProperty(value = "人员职务")
private String ryzw;
/**
*
*/
@ApiModelProperty(value = "电子邮箱")
private String dzyx;
/**
*
*/
@ApiModelProperty(value = "移动电话")
private String yddh;
/**
*
*/
@ApiModelProperty(value = "父级编号")
private String pid;
/**
* 1,2
*/
@ApiModelProperty(value = "1,网格成员2企业专职安全员")
private Integer rylx;
/**
*
*/
@ApiModelProperty(value = "记录状态")
private Integer jlzt;
/**
*
*/
@ApiModelProperty(value = "显示顺序")
private Integer xssx;
/**
*
*/
@ApiModelProperty(value = "入库人员")
private String rkry;
/**
*
*/
@ApiModelProperty(value = "更新时间")
private String gxry;
/**
*
*/
@ApiModelProperty(value = "入库时间")
private Date rksj;
/**
*
*/
@ApiModelProperty(value = "更新时间")
private Date gxsj;
}

@ -1,15 +1,13 @@
package com.mudu.entity;
import java.util.Date;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* (ASafeXcrwjcxzgxx)
@ -50,9 +48,9 @@ public class ASafeXcrwjcxzgxx implements Serializable {
@ApiModelProperty(value = "数据来源")
private String sjlx;
/**
*
* /
*/
@ApiModelProperty(value = "时间")
@ApiModelProperty(value = "每一次整改/复查时间")
private Date sj;
/**
*

@ -1,7 +1,6 @@
package com.mudu.entity.dto.request;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mudu.entity.ACheckQuatzEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -45,7 +44,7 @@ public class ACheckQuatzRequest {
private String entCode;
/**
*
* (,
*/
@ApiModelProperty("上报时间(如果巡查一起提交,获取巡查的巡查日期")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")

@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mudu.entity.ASafeQyjcxx;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* (ASafeQyjcxx)访
*
@ -20,5 +22,12 @@ public interface ASafeQyjcxxMapper extends BaseMapper<ASafeQyjcxx> {
* @return
*/
ASafeQyjcxx findOneByqymcOrXybm(@Param("qymc") String qymc, @Param("xybm") String xybm);
/**
*
*
* @param list
*/
void updateByTyshxybm(List<String> list);
}

@ -0,0 +1,15 @@
package com.mudu.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mudu.entity.ASafeWgcy;
/**
* (ASafeWgcy)访
*
* @author wu
* @since 2024-08-24 18:14:06
*/
public interface ASafeWgcyMapper extends BaseMapper<ASafeWgcy> {
}

@ -6,23 +6,46 @@ import cn.hutool.http.HttpRequest;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.mudu.entity.*;
import com.mudu.entity.ACheckQuatzEntity;
import com.mudu.entity.ACheckQuatzZichaEntity;
import com.mudu.entity.ASafeQyjcxx;
import com.mudu.entity.ASafeRwfj;
import com.mudu.entity.ASafeRwzq;
import com.mudu.entity.ASafeTfg;
import com.mudu.entity.ASafeTfgsh;
import com.mudu.entity.ASafeXcrw;
import com.mudu.entity.ASafeXcrwjcx;
import com.mudu.entity.ASafeXcrwjcxzgxx;
import com.mudu.entity.ASafeXcrwwz;
import com.mudu.entity.ASafeYhzgxx;
import com.mudu.entity.ASafeZcrw;
import com.mudu.entity.ASafeZcrwjl;
import com.mudu.entity.ASafeZcrwwz;
import com.mudu.entity.SzsASafeZcyhxx;
import com.mudu.entity.dto.request.ACheckQuatzRequest;
import com.mudu.entity.dto.request.ACheckQuatzZichaRequest;
import com.mudu.entity.dto.response.ACheckXcTpResponse;
import com.mudu.entity.dto.response.RwzqUuidResponse;
import com.mudu.service.*;
import com.mudu.service.ASafeQyjcxxService;
import com.mudu.service.ASafeRwfjService;
import com.mudu.service.ASafeRwzqService;
import com.mudu.service.ASafeTfgService;
import com.mudu.service.ASafeTfgshService;
import com.mudu.service.ASafeXcrwService;
import com.mudu.service.ASafeXcrwjcxService;
import com.mudu.service.ASafeXcrwjcxzgxxService;
import com.mudu.service.ASafeXcrwwzService;
import com.mudu.service.ASafeYhzgxxService;
import com.mudu.service.ASafeZcrwService;
import com.mudu.service.ASafeZcrwjlService;
import com.mudu.service.ASafeZcrwwzService;
import com.mudu.service.SzsASafeZcyhxxService;
import com.mudu.service.impl.LoginService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -331,7 +354,7 @@ public class AcheckTaskQuartz {
aSafeYhzgxx.setLsyq(0);
//整改时间
aSafeYhzgxx.setZgsj(b.getReportDateTime());
//完成状态
//完成状态 todo 1
aSafeYhzgxx.setWczt(1);
//整改状态
aSafeYhzgxx.setZgzt(1);
@ -366,7 +389,7 @@ public class AcheckTaskQuartz {
aSafeXcrwwz.setWzmc(b.getWzmc());
//周期编号
aSafeXcrwwz.setZqbh(rwzqUuid);
//完成状态
//完成状态 todo 1
aSafeXcrwwz.setWczt(1);
//入库时间
aSafeXcrwwz.setRksj(new Date());
@ -396,7 +419,7 @@ public class AcheckTaskQuartz {
//巡查检查项编号 a_safe_xcrwjcx的XXBH
aSafeXcrwjcxzgxx.setXcjcxbh(xcrwjcxUuid);
//时间
aSafeXcrwjcxzgxx.setSj(a.getFinalDateTime());
aSafeXcrwjcxzgxx.setSj(b.getReviewDateTime());
//类型
aSafeXcrwjcxzgxx.setSjlx("ZG");
//是否合格
@ -483,8 +506,8 @@ public class AcheckTaskQuartz {
aSafeXcrwjcx.setFclsyq(0);
//复查信息
aSafeXcrwjcx.setFcxx(b.getReviewContent());
//位置编号
aSafeXcrwjcx.setWzbh(xcrwuuid);
//位置编号 todo 企业风险点位置的位置编号即 企业风险位置的xxbh
aSafeXcrwjcx.setWzbh(b.getWzxxbh());
//巡查位置编号
aSafeXcrwjcx.setXcwzbh(xcrwwzUuid);
//巡查风险点编号
@ -520,11 +543,11 @@ public class AcheckTaskQuartz {
//任务类型
aSafeXcrw.setRwlx("WGXC");
//巡查项
aSafeXcrw.setXcx(list.size());
aSafeXcrw.setXcx(a.getList().size());
//完成项
aSafeXcrw.setWcx(list.size());
aSafeXcrw.setWcx(a.getList().size());
//发现隐患数
aSafeXcrw.setFxyhs(list.size());
aSafeXcrw.setFxyhs(a.getList().size());
//检查时间
if (a.getReportDateTime() != null) {
aSafeXcrw.setJcsj(a.getReportDateTime());

@ -12,23 +12,17 @@ import com.mudu.entity.ASafeQyjcxx;
import com.mudu.entity.ASafeQyzypgl;
import com.mudu.entity.dto.request.ASafeBqbhpxRequest;
import com.mudu.entity.dto.request.ASafeQyzypglRequest;
import com.mudu.entity.dto.response.EnterpriseResponse;
import com.mudu.entity.dto.response.XcTpResponse;
import com.mudu.service.ASafeBqbhpxService;
import com.mudu.service.ASafeQyjcxxService;
import com.mudu.service.ASafeQyzypglService;
import com.mudu.service.EnterpriseService;
import com.mudu.service.impl.LoginService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.ArrayList;
@ -151,7 +145,7 @@ public class BqbhTszyQuartz {
List<ASafeQyzypgl> aSafeQyzypgls = new ArrayList<>();
List<ASafeQyzypglRequest> list = JSON.parseArray(dataList, ASafeQyzypglRequest.class);
for (ASafeQyzypglRequest x : list) {
// EnterpriseResponse a = enterpriseService.findByQybh(x.getQybh());
// EnterpriseResponse a = enterpriseService.findByQybh(x.getQybh());
// if (a!=null){
// ASafeQyjcxx aSafeQyjcxx = aSafeQyjcxxService.findOneByqymcOrXybm(a.getName(), a.getCertificateCode());
// if (aSafeQyjcxx==null){
@ -161,8 +155,8 @@ public class BqbhTszyQuartz {
// }
ASafeQyjcxx aSafeQyjcxx = aSafeQyjcxxService.findOneByqymcOrXybm(x.getQymc(), x.getEntCode());
ASafeQyzypgl aSafeQyzypgl = BeanUtil.copyProperties(x, ASafeQyzypgl.class);
aSafeQyzypgl.setQybh(aSafeQyjcxx.getXxbh());
aSafeQyzypgls.add(aSafeQyzypgl);
aSafeQyzypgl.setQybh(aSafeQyjcxx.getXxbh());
aSafeQyzypgls.add(aSafeQyzypgl);
}
if (CollectionUtil.isNotEmpty(aSafeQyzypgls)) {
safeQyzypglService.saveBatch(aSafeQyzypgls);

@ -0,0 +1,97 @@
package com.mudu.quartz;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.mudu.entity.ASafeQyjcxx;
import com.mudu.entity.ASafeWgcy;
import com.mudu.service.ASafeQyjcxxService;
import com.mudu.service.ASafeWgcyService;
import com.mudu.service.impl.LoginService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;
/**
*
*
* @author wu
* @since 2024/8/24 18:11
*/
@Transactional(rollbackFor = Exception.class)
@Configuration
@EnableScheduling
public class EntQuartz {
@Resource
private ASafeQyjcxxService qyjcxxService;
@Resource
private ASafeWgcyService wgcyService;
@Resource
private LoginService loginService;
@Value("${addEntUrl}")
private String addEntUrl;
@Value("${findEntDelUrl}")
private String findEntDelUrl;
private String getToken() {
return "Bearer " + loginService.getToken();
}
/**
*
*/
@Scheduled(cron = "0 30 12 * * ? ")
public void addqyjcxxAndWgcy() {
// 获取token
String token = getToken();
// 获取所有信息
String res = HttpRequest.get(addEntUrl)
.contentType("application/x-www-form-urlencoded;charset=UTF-8")
.header("Authorization", token)
.execute().body();
JSONObject resObj = JSON.parseObject(res);
String dataList = resObj.getString("data");
if (StrUtil.isEmpty(dataList)) {
return;
}
List<ASafeQyjcxx> qyjcxxList = JSON.parseArray(dataList, ASafeQyjcxx.class);
qyjcxxService.saveBatch(qyjcxxList);
List<ASafeWgcy> wgcyList = qyjcxxList.stream().map(ASafeQyjcxx::getASafeWgcy).collect(Collectors.toList());
wgcyService.saveBatch(wgcyList);
}
/**
*
*/
@Scheduled(cron = "0 30 12 * * ? ")
public void findEntDel() {
// 获取token
String token = getToken();
// 获取所有信息
String res = HttpRequest.get(findEntDelUrl)
.contentType("application/x-www-form-urlencoded;charset=UTF-8")
.header("Authorization", token)
.execute().body();
JSONObject resObj = JSON.parseObject(res);
String dataList = resObj.getString("data");
if (StrUtil.isEmpty(dataList)) {
return;
}
List<String> tyshxybmList = JSON.parseArray(dataList, String.class);
qyjcxxService.updateByTyshxybm(tyshxybmList);
}
}

@ -3,6 +3,8 @@ package com.mudu.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mudu.entity.ASafeQyjcxx;
import java.util.List;
/**
* (ASafeQyjcxx)
*
@ -24,5 +26,12 @@ public interface ASafeQyjcxxService extends IService<ASafeQyjcxx> {
* @return
*/
ASafeQyjcxx findOneByqymcOrXybm(String qymc, String xybm);
/**
*
*
* @param tyshxybmList
*/
void updateByTyshxybm(List<String> tyshxybmList);
}

@ -0,0 +1,15 @@
package com.mudu.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mudu.entity.ASafeWgcy;
/**
* (ASafeWgcy)
*
* @author wu
* @since 2024-08-24 18:14:06
*/
public interface ASafeWgcyService extends IService<ASafeWgcy> {
}

@ -15,7 +15,6 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* (ASafeQyjcxx)
@ -86,5 +85,15 @@ public class ASafeQyjcxxServiceImpl extends ServiceImpl<ASafeQyjcxxMapper, ASafe
public ASafeQyjcxx findOneByqymcOrXybm(String qymc, String xybm) {
return baseMapper.findOneByqymcOrXybm(qymc, xybm);
}
/**
*
*
* @param tyshxybmList
*/
@Override
public void updateByTyshxybm(List<String> tyshxybmList) {
baseMapper.updateByTyshxybm(tyshxybmList);
}
}

@ -0,0 +1,19 @@
package com.mudu.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mudu.entity.ASafeWgcy;
import com.mudu.mapper.ASafeWgcyMapper;
import com.mudu.service.ASafeWgcyService;
import org.springframework.stereotype.Service;
/**
* (ASafeWgcy)
*
* @author wu
* @since 2024-08-24 18:14:07
*/
@Service("aSafeWgcyService")
public class ASafeWgcyServiceImpl extends ServiceImpl<ASafeWgcyMapper, ASafeWgcy> implements ASafeWgcyService {
}

@ -59,3 +59,9 @@ xczqUrl: https://www.jichuanglanhai.com:88/csapi/mudu/aSafeXcrwRead/getByxxbh
#停复工url
tfgUrl: https://www.jichuanglanhai.com:88/csapi/mudu/aSafeTfg
# 获取新增企业信息
addEntUrl: https://www.jichuanglanhai.com:88/csapi/mudu/enterprise/findAddEnt
# 获取删除企业信息
findEntDelUrl: https://www.jichuanglanhai.com:88/csapi/mudu/enterprise/findEntDel

@ -63,4 +63,10 @@ xczqUrl: https://www.jichuanglanhai.com:88/csapi/mudu/aSafeXcrwRead/getByxxbh
#停复工url
tfgUrl: https://www.jichuanglanhai.com:88/csapi/mudu/aSafeTfg
# 获取新增企业信息
addEntUrl: https://www.jichuanglanhai.com:88/csapi/mudu/enterprise/findAddEnt
# 获取删除企业信息
findEntDelUrl: https://www.jichuanglanhai.com:88/csapi/mudu/enterprise/findEntDel

@ -3,6 +3,14 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mudu.mapper.ASafeQyjcxxMapper">
<update id="updateByTyshxybm">
update a_safe_qyjcxx set jlzt = 0 where
tyshxybm in
<foreach item="item" index="index" collection="list"
open="(" separator="," close=")">
#{item}
</foreach>
</update>
<select id="findOneByqymcOrXybm" resultType="com.mudu.entity.ASafeQyjcxx">

Loading…
Cancel
Save