修改企业更新定时任务;

添加企业更新日志表
main
吴顺杰 4 weeks ago
parent 81ebb3c407
commit 07ff2ad9f4

@ -1,6 +1,7 @@
package com.mudu.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.mudu.entity.dto.response.EnterpriseResponse;
import io.swagger.annotations.ApiModel;
@ -24,6 +25,7 @@ import java.util.Date;
public class ASafeQyjcxx implements Serializable {
private static final long serialVersionUID = -50281110442061251L;
@TableId
private String xxbh;
/**
*

@ -0,0 +1,673 @@
package com.mudu.entity;
import com.baomidou.mybatisplus.annotation.TableId;
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.math.BigDecimal;
import java.util.Date;
/**
* (ASafeQyjcxxMdLog)
*
* @author wu
* @since 2024-10-17 16:11:03
*/
@Data
@ApiModel("实体类")
@TableName(value = "a_safe_qyjcxx_md_log")
public class ASafeQyjcxxMdLog implements Serializable {
private static final long serialVersionUID = 761032740346727183L;
@TableId
private String xxbh;
/**
*
*/
@ApiModelProperty(value = "企业名称")
private String qymc;
/**
*
*/
@ApiModelProperty(value = "其他名称")
private String qtmc;
/**
*
*/
@ApiModelProperty(value = "统一社会信用编码")
private String tyshxybm;
/**
*
*/
@ApiModelProperty(value = "经度")
private BigDecimal jd;
/**
*
*/
@ApiModelProperty(value = "纬度")
private BigDecimal wd;
/**
*
*/
@ApiModelProperty(value = "注册地址")
private String zcdz;
/**
*
*/
@ApiModelProperty(value = "经营地址")
private String jydz;
/**
*
*/
@ApiModelProperty(value = "是否自有房屋")
private Integer zyfw;
/**
*
*/
@ApiModelProperty(value = "房东性质")
private String fdxz;
/**
*
*/
@ApiModelProperty(value = "房东企业名称")
private String fdqymc;
/**
*
*/
@ApiModelProperty(value = "房东企业信用代码")
private String fdqyxydm;
/**
*
*/
@ApiModelProperty(value = "房东企业联系人")
private String fdqylxr;
/**
*
*/
@ApiModelProperty(value = "房东企业联系电话")
private String fdqylxdh;
/**
*
*/
@ApiModelProperty(value = "是否发包出租")
private Integer sffbcz;
/**
*
*/
@ApiModelProperty(value = "是否异地经营")
private Integer sfydjy;
/**
*
*/
@ApiModelProperty(value = "行政区划编号")
private String xzqhbh;
/**
*
*/
@ApiModelProperty(value = "行政区划名称")
private String xzqhmc;
/**
*
*/
@ApiModelProperty(value = "行政区划内部编码")
private String xzqhnbbm;
/**
*
*/
@ApiModelProperty(value = "网格编号")
private String wgbh;
/**
*
*/
@ApiModelProperty(value = "网格名称")
private String wgmc;
/**
*
*/
@ApiModelProperty(value = "成立日期")
private Date clrq;
/**
* ID
*/
@ApiModelProperty(value = "企业性质ID")
private String qyxzid;
/**
* VALUE
*/
@ApiModelProperty(value = "企业性质VALUE")
private String qyxzvalue;
/**
* ID
*/
@ApiModelProperty(value = "行业类别门类ID")
private String hylbmlid;
/**
* VALUE
*/
@ApiModelProperty(value = "行业类别门类VALUE")
private String hylbmlvalue;
/**
* ID
*/
@ApiModelProperty(value = "行业类别大类ID")
private String hylbdlid;
/**
* VALUE
*/
@ApiModelProperty(value = "行业类别大类VALUE")
private String hylbdlvalue;
/**
* ID
*/
@ApiModelProperty(value = "行业类别中类ID")
private String hylbzlid;
/**
* VALUE
*/
@ApiModelProperty(value = "行业类别中类VALUE")
private String hylbzlvalue;
/**
* ID
*/
@ApiModelProperty(value = "行业类别小类ID")
private String hylbxlid;
/**
* VALUE
*/
@ApiModelProperty(value = "行业类别小类VALUE")
private String hylbxlvalue;
/**
*
*/
@ApiModelProperty(value = "注册资本")
private String zczb;
/**
* ID
*/
@ApiModelProperty(value = "企业规模ID")
private String qygmid;
/**
* VALUE
*/
@ApiModelProperty(value = "企业国模VALUE")
private String qygmvalue;
/**
*
*/
@ApiModelProperty(value = "从业人员数量")
private String cyrysl;
/**
* id
*/
@ApiModelProperty(value = "行业监管大类id")
private String hyjgdlid;
/**
* value
*/
@ApiModelProperty(value = "行业监管大类value")
private String hyjgdlvalue;
/**
* ID
*/
@ApiModelProperty(value = "行业监管种类ID")
private String hyjgzlid;
/**
* VALUE
*/
@ApiModelProperty(value = "行业监管种类VALUE")
private String hyjgzlvalue;
/**
* ID
*/
@ApiModelProperty(value = "行业监管小类ID")
private String hyjgxlid;
/**
* VALUE
*/
@ApiModelProperty(value = "行业监管小类VALUE")
private String hyjgxlvalue;
/**
* ID
*/
@ApiModelProperty(value = "安全生产标准化等级ID")
private String aqscdjid;
/**
*
*/
@ApiModelProperty(value = "经营范围")
private String jyfw;
/**
* -
*/
@ApiModelProperty(value = "有限空间-主要危险因素")
private String yxkjZywxys;
/**
* -
*/
@ApiModelProperty(value = "粉尘涉爆-粉尘种类")
private String fcsbFczl;
/**
* -
*/
@ApiModelProperty(value = "粉尘涉爆-主要涉粉工艺")
private String fcsbZysffy;
/**
* -
*/
@ApiModelProperty(value = "粉尘涉爆-单班涉粉作业人数")
private String fcsbDbsfzyrs;
/**
* -
*/
@ApiModelProperty(value = "粉尘涉爆-除尘器信息")
private String fcsbCcqxx;
/**
* -
*/
@ApiModelProperty(value = "粉尘涉爆-除尘系统是否经过验收")
private String fcsbSfjgys;
/**
* -
*/
@ApiModelProperty(value = "粉尘涉爆-是否有安全评价")
private String fcsbSfyap;
/**
*
*/
@ApiModelProperty(value = "企业标签")
private String qybq;
/**
* -
*/
@ApiModelProperty(value = "粉尘涉爆-备注")
private String fcsbBz;
/**
* -使
*/
@ApiModelProperty(value = "涉氨制冷-液氨储存、使用量")
private String sazlYaccsyl;
/**
* -
*/
@ApiModelProperty(value = "涉案制冷-涉氨作业人数")
private String sazlSazyrs;
/**
* -
*/
@ApiModelProperty(value = "涉案制冷-进行重大危险源安全评估")
private String sazlZdwxyaqpg;
/**
* -
*/
@ApiModelProperty(value = "机械铸造-年产量")
private String jxzzNcl;
/**
* -/
*/
@ApiModelProperty(value = "机械铸造-主要产品/重点产品")
private String jxzzZycpzdpz;
/**
* -
*/
@ApiModelProperty(value = "机械铸造-高温熔融金属类型")
private String jxzzGwrrjslx;
/**
* -
*/
@ApiModelProperty(value = "机械铸造-涉高温熔融金属岗位人数")
private String jxzzSgwrrjsgwrs;
/**
* --
*/
@ApiModelProperty(value = "机械铸造-吊运熔融金属起重机-数量")
private String jxzzQzjsl;
/**
* -
*/
@ApiModelProperty(value = "机械铸造-是否检验")
private String jxzzSfjy;
/**
* -
*/
@ApiModelProperty(value = "机械铸造-熔炼炉信息")
private String jxzzRlljrxx;
/**
* -
*/
@ApiModelProperty(value = "机械铸造-铸造信息")
private String jxzzZzxx;
/**
* -
*/
@ApiModelProperty(value = "铝镁切削-废屑类型")
private String lmqxFxlx;
/**
* -
*/
@ApiModelProperty(value = "铝镁切削-涉粉作业人员人数")
private String lmqxSfzyryrs;
/**
* -
*/
@ApiModelProperty(value = "铝镁切削-清理频次")
private String lmqxQlpc;
/**
* -/
*/
@ApiModelProperty(value = "旅美切削-粉尘/废屑储存方式")
private String lmqxCcfs;
/**
* -/
*/
@ApiModelProperty(value = "旅美切削-粉尘/废屑回收单位")
private String lmqxFcfxhsdw;
/**
* -
*/
@ApiModelProperty(value = "旅美切削-回收频次")
private String lmqxHspc;
/**
* -
*/
@ApiModelProperty(value = "高镁合金-高美含量信息")
private String gmhjMhl;
/**
* -
*/
@ApiModelProperty(value = "危险化学品-是否有安全三同时手续")
private String wxhxpSfyaqstssx;
/**
* -
*/
@ApiModelProperty(value = "危险化学品-是否做安全评价")
private String wxhxpSfzaqpj;
/**
* -
*/
@ApiModelProperty(value = "危险化学品-开展安全评价及备案情况日期")
private String wxhxpKzaqpjjbaqkrq;
/**
* -
*/
@ApiModelProperty(value = "有色企业-年产量")
private String ysqyNcl;
/**
* -/
*/
@ApiModelProperty(value = "有色企业-主要产品/重点产品")
private String ysqyZycp;
/**
* -
*/
@ApiModelProperty(value = "有色企业-高温熔融金属类型")
private String ysqyGwrrjslx;
/**
* -
*/
@ApiModelProperty(value = "有色企业-涉高温熔融金属岗位人数")
private String ysqySgwrrjsgwrs;
/**
* -
*/
@ApiModelProperty(value = "有色企业-熔炼炉信息")
private String ysqyRlljrxx;
/**
* -
*/
@ApiModelProperty(value = "有色企业-铸造信息")
private String ysqyZzxx;
/**
*
*/
@ApiModelProperty(value = "入库时间")
private Date rksj;
/**
*
*/
@ApiModelProperty(value = "更新时间")
private Date gxsj;
/**
*
*/
@ApiModelProperty(value = "入库人员")
private String rkry;
/**
*
*/
@ApiModelProperty(value = "更新人员")
private String gxry;
/**
*
*/
@ApiModelProperty(value = "记录状态")
private Integer jlzt;
/**
*
*/
@ApiModelProperty(value = "安监办企业列表")
private String ajbqylb;
/**
*
*/
@ApiModelProperty(value = "局内人员企业列表")
private String jnryqylb;
/**
* VALUE
*/
@ApiModelProperty(value = "安全生产标准化等级VALUE")
private String aqscdjvalue;
/**
*
*/
@ApiModelProperty(value = "启用状态")
private String qyzt;
/**
*
*/
@ApiModelProperty(value = "数据来源")
private String sjly;
/**
*
*/
@ApiModelProperty(value = "登陆账号")
private String dlzh;
/**
*
*/
@ApiModelProperty(value = "风险评估等级")
private String fxpgdj;
/**
* id
*/
@ApiModelProperty(value = "重大危险源等级id")
private String zdwxydjid;
/**
* value
*/
@ApiModelProperty(value = "重大危险源等级value")
private String zdwxydjvalue;
/**
* id
*/
@ApiModelProperty(value = "企业分类id")
private String qyflid;
/**
* value
*/
@ApiModelProperty(value = "企业分类value")
private String qyflvalue;
/**
* -
*/
@ApiModelProperty(value = "诚信管理-诚信等级")
private String cxglcxdj;
/**
* -
*/
@ApiModelProperty(value = "诚信管理-是否黑名单")
private String cxglsfhmd;
/**
* -
*/
@ApiModelProperty(value = "诚信管理-不良记录数")
private Integer cxglbljls;
/**
* -
*/
@ApiModelProperty(value = "诚信管理-跟新时间")
private Date cxglgxsj;
/**
*
*/
@ApiModelProperty(value = "法人代表姓名")
private String frdbxm;
/**
*
*/
@ApiModelProperty(value = "法人代表电话")
private String frdbdh;
/**
*
*/
@ApiModelProperty(value = "房东姓名")
private String fdxm;
/**
*
*/
@ApiModelProperty(value = "房东联系方式")
private String fdlxfs;
/**
*
*/
@ApiModelProperty(value = "所属部门")
private String ajbbmbh;
/**
*
*/
@ApiModelProperty(value = "所属部门")
private String jnrybmbh;
/**
* 0 1
*/
@ApiModelProperty(value = "是否推入市局 0否 1是")
private String sftrsj;
/**
* 0,1
*/
@ApiModelProperty(value = "0为更新,1为新增")
private Integer gxorxz;
}

@ -40,5 +40,12 @@ public interface ASafeQyjcxxMapper extends BaseMapper<ASafeQyjcxx> {
* @return
*/
FxdwzResponse findByEnterPeriseId(@Param("enterPriseId") String enterPriseId);
/**
* jlzt
*
* @param xxbh
*/
void updateJlztById(String xxbh);
}

@ -0,0 +1,15 @@
package com.mudu.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mudu.entity.ASafeQyjcxxMdLog;
/**
* (ASafeQyjcxxMdLog)访
*
* @author wu
* @since 2024-10-17 16:11:03
*/
public interface ASafeQyjcxxMdLogMapper extends BaseMapper<ASafeQyjcxxMdLog> {
}

@ -16,7 +16,6 @@ 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 org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
@ -52,9 +51,6 @@ public class BqbhTszyQuartz {
@Resource
private ASafeQyjcxxService aSafeQyjcxxService;
@Resource
private EnterpriseService enterpriseService;
@Value("${bqbhUrl}")
private String bqbhUrl;

@ -1,11 +1,14 @@
package com.mudu.quartz;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
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.entity.ASafeQyjcxxMdLog;
import com.mudu.service.ASafeQyjcxxMdLogService;
import com.mudu.service.ASafeQyjcxxService;
import com.mudu.service.ASafeWgcyService;
import com.mudu.service.impl.LoginService;
@ -17,7 +20,6 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;
/**
*
@ -39,6 +41,9 @@ public class EntQuartz {
@Resource
private LoginService loginService;
@Resource
private ASafeQyjcxxMdLogService qyjcxxMdLogService;
@Value("${addEntUrl}")
private String addEntUrl;
@ -53,7 +58,7 @@ public class EntQuartz {
/**
*
*/
@Scheduled(cron = "0 30 12 * * ? ")
@Scheduled(cron = "0 30 00 * * ? ")
public void addqyjcxxAndWgcy() {
// 获取token
String token = getToken();
@ -68,16 +73,33 @@ public class EntQuartz {
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);
for (ASafeQyjcxx x : qyjcxxList) {
ASafeQyjcxx entity = qyjcxxService.findOneByqymcOrXybm(null, x.getTyshxybm());
if (BeanUtil.isNotEmpty(entity)) {
if (entity.getJlzt() == 0) {
qyjcxxService.updateJlztById(entity.getXxbh());
// 添加更新日志
ASafeQyjcxxMdLog qyjcxxMdLog = BeanUtil.copyProperties(entity, ASafeQyjcxxMdLog.class);
qyjcxxMdLog.setGxorxz(0);
qyjcxxMdLogService.save(qyjcxxMdLog);
}
} else {
qyjcxxService.save(x);
// 添加新增日志
ASafeQyjcxxMdLog qyjcxxMdLog = BeanUtil.copyProperties(x, ASafeQyjcxxMdLog.class);
qyjcxxMdLog.setGxorxz(0);
qyjcxxMdLogService.save(qyjcxxMdLog);
}
}
// List<ASafeWgcy> wgcyList = qyjcxxList.stream().map(ASafeQyjcxx::getASafeWgcy).collect(Collectors.toList());
// wgcyService.saveBatch(wgcyList);
}
/**
*
*/
@Scheduled(cron = "0 30 12 * * ? ")
@Scheduled(cron = "0 30 00 * * ? ")
public void findEntDel() {
// 获取token
String token = getToken();
@ -92,6 +114,8 @@ public class EntQuartz {
return;
}
List<String> tyshxybmList = JSON.parseArray(dataList, String.class);
qyjcxxService.updateByTyshxybm(tyshxybmList);
if (CollectionUtil.isNotEmpty(tyshxybmList)) {
qyjcxxService.updateByTyshxybm(tyshxybmList);
}
}
}

@ -0,0 +1,15 @@
package com.mudu.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mudu.entity.ASafeQyjcxxMdLog;
/**
* (ASafeQyjcxxMdLog)
*
* @author wu
* @since 2024-10-17 16:11:04
*/
public interface ASafeQyjcxxMdLogService extends IService<ASafeQyjcxxMdLog> {
}

@ -43,5 +43,12 @@ public interface ASafeQyjcxxService extends IService<ASafeQyjcxx> {
* @return
*/
FxdwzResponse findByEnterPeriseId(String enterPriseId);
/**
* jlzt
*
* @param xxbh
*/
void updateJlztById(String xxbh);
}

@ -0,0 +1,19 @@
package com.mudu.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mudu.entity.ASafeQyjcxxMdLog;
import com.mudu.mapper.ASafeQyjcxxMdLogMapper;
import com.mudu.service.ASafeQyjcxxMdLogService;
import org.springframework.stereotype.Service;
/**
* (ASafeQyjcxxMdLog)
*
* @author wu
* @since 2024-10-17 16:11:04
*/
@Service("aSafeQyjcxxMdLogService")
public class ASafeQyjcxxMdLogServiceImpl extends ServiceImpl<ASafeQyjcxxMdLogMapper, ASafeQyjcxxMdLog> implements ASafeQyjcxxMdLogService {
}

@ -101,5 +101,15 @@ public class ASafeQyjcxxServiceImpl extends ServiceImpl<ASafeQyjcxxMapper, ASafe
public FxdwzResponse findByEnterPeriseId(String enterPriseId) {
return baseMapper.findByEnterPeriseId(enterPriseId);
}
/**
* jlzt
*
* @param xxbh
*/
@Override
public void updateJlztById(String xxbh) {
baseMapper.updateJlztById(xxbh);
}
}

@ -100,7 +100,9 @@ xczqUrl: http://localhost:9028/mudu/aSafeXcrwRead/getByxxbh
# 获取新增企业信息
addEntUrl: https://www.jichuanglanhai.com:88/csapi/mudu/enterprise/findAddEnt
#addEntUrl: https://www.jichuanglanhai.com:88/csapi/mudu/enterprise/findAddEnt
addEntUrl: http://localhost:9028/mudu/enterprise/findAddEnt
# 获取删除企业信息
findEntDelUrl: https://www.jichuanglanhai.com:88/csapi/mudu/enterprise/findEntDel
#findEntDelUrl: https://www.jichuanglanhai.com:88/csapi/mudu/enterprise/findEntDel
findEntDelUrl: http://localhost:9028/mudu/enterprise/findEntDel

@ -12,7 +12,7 @@ spring:
logging:
level:
com.mudu: debug
org.springframework: warn
org.springframework: debug
# MyBatis配置
mybatis-plus:

@ -11,11 +11,17 @@
#{item}
</foreach>
</update>
<update id="updateJlztById">
update a_safe_qyjcxx_md
set jlzt = 1,
gxsj = CURDATE()
where xxbh = #{xxbh}
</update>
<select id="findOneByqymcOrXybm" resultType="com.mudu.entity.ASafeQyjcxx">
SELECT asq.*
FROM a_safe_qyjcxx asq
FROM a_safe_qyjcxx_md asq
<where>
<if test="qymc != null and qymc.trim() != ''">
<if test="xybm == null or xybm.trim() == ''">

Loading…
Cancel
Save