Commit f019179b authored by tianbo's avatar tianbo

气瓶同步功能

parent ab3bd93f
package com.yeejoin.amos.boot.module.cylinder.api.enums;
/**
*
* <pre>
* 气瓶字典枚举
* </pre>
*
* @author gwb
* @version $Id: LiftStatusEnum.java, v 0.1 2021年9月29日 上午9:32:16 gwb Exp $
*/
public enum CylDictEnum {
withinScope_0 (3141,"0", "withinScope"),
withinScope_1 (3142,"1", "withinScope"),
sealedState_0 (3143,"0", "sealedState"),
sealedState_1 (3144,"1", "sealedState"),
defective_0 (3145,"0", "defective"),
defective_1 (3146,"1", "defective"),
abnormaLTemperature_0 (3147,"0", "abnormaLTemperature"),
abnormaLTemperature_1 (3148,"1", "abnormaLTemperature"),
warningSign_0 (3149,"0", "warningSign"),
warningSign_1 (3150,"1", "warningSign");
/**
* 主键
*/
private Integer seqNbr;
/**
* 编码
*/
private String code;
/**
* key
*/
private String key;
// 构造方法
CylDictEnum(Integer seqNbr, String code, String key) {
this.seqNbr = seqNbr;
this.code = code;
this.key = key;
}
public Integer getSeqNbr() {
return seqNbr;
}
public String getCode()
{
return code;
}
public String getKey()
{
return code;
}
public static CylDictEnum getEnum(String code, String key)
{
for (CylDictEnum cylDictEnum : CylDictEnum.values())
{
if (cylDictEnum.getCode().equals(code) && cylDictEnum.getKey().equals(key))
{
return cylDictEnum;
}
}
return null;
}
}
package com.yeejoin.amos.boot.module.cylinder.flc.api.dto;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 液化气体气瓶充装信息-充装后复查
*
* @author system_generator
* @date 2022-03-04
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="CylCylinderFillingCheckDto", description="液化气体气瓶充装信息-充装后复查")
public class CylCylinderFillingCheckDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
private Long sequenceNbr;
@ApiModelProperty(value = "充装后复查ID")
private String fillingCheckId;
@ApiModelProperty(value = "充装量在规定范围内")
private Integer withinScope;
@ApiModelProperty(value = "瓶阀及其与瓶口连接的密封良好")
private Integer sealedState;
@ApiModelProperty(value = "瓶体未出现鼓包变形或泄露等严重缺陷")
private Integer defective;
@ApiModelProperty(value = "瓶体温度没有异常升高的迹象")
private Integer abnormalTemperature;
@ApiModelProperty(value = "气瓶粘贴警示标签和充装标签")
private Integer warningSign;
@ApiModelProperty(value = "液化气瓶充装量符合有关规定,充装后逐瓶称重")
private String compliance;
@ApiModelProperty(value = "检查人员姓名")
private String inspector;
@ApiModelProperty(value = "检查时间")
private String inspectionDate;
@ApiModelProperty(value = "创建时间")
private Date recDate;
@ApiModelProperty(value = "操作人员")
private String recUserId;
@ApiModelProperty(value = "同步时间 yyyy-MM-dd HH24:mi:ss")
private Date syncDate;
@ApiModelProperty(value = "0-新增 1-更新 2-删除")
private Integer syncState;
@ApiModelProperty(value = "对接公司编码")
private String appId;
@ApiModelProperty(value = "数据完整度")
private Double integrity;
@ApiModelProperty(value = "检查结果")
private String checkResults;
@ApiModelProperty(value = "不合格项")
private String nonconformances;
}
package com.yeejoin.amos.boot.module.cylinder.flc.api.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import java.util.Date;
/**
* 液化气体气瓶充装信息-充装后复查
*
* @author duanwei
* @date 2022-08-11
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("tm_cylinder_filling_check")
@ApiModel(value="TmCylinderFillingCheck对象", description="液化气体气瓶充装信息-充装后复查")
public class CylCylinderFillingCheck extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "充装后复查ID")
private String fillingCheckId;
@ApiModelProperty(value = "充装量在规定范围内")
private Integer withinScope;
@ApiModelProperty(value = "瓶阀及其与瓶口连接的密封良好")
private Integer sealedState;
@ApiModelProperty(value = "瓶体未出现鼓包变形或泄露等严重缺陷")
private Integer defective;
@ApiModelProperty(value = "瓶体温度没有异常升高的迹象")
private Integer abnormalTemperature;
@ApiModelProperty(value = "气瓶粘贴警示标签和充装标签")
private Integer warningSign;
@ApiModelProperty(value = "液化气瓶充装量符合有关规定,充装后逐瓶称重")
private String compliance;
@ApiModelProperty(value = "检查人员姓名")
private String inspector;
@ApiModelProperty(value = "检查时间")
private String inspectionDate;
@ApiModelProperty(value = "同步时间 yyyy-MM-dd HH24:mi:ss")
private Date syncDate;
@ApiModelProperty(value = "0-新增 1-更新 2-删除")
private Integer syncState;
@ApiModelProperty(value = "对接公司编码")
private String appId;
// @ApiModelProperty(value = "数据完整度")
// private Double integrity;
@ApiModelProperty(value = "检查结果")
private String checkResults;
@ApiModelProperty(value = "不合格项")
private String nonconformances;
}
package com.yeejoin.amos.boot.module.cylinder.flc.api.entity; package com.yeejoin.amos.boot.module.cylinder.flc.api.entity;
import java.util.Date; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.TableName;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity; import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import java.util.Date;
/** /**
* 液化气体气瓶充装信息-充装后复查 * 液化气体气瓶充装信息-充装后复查
* *
...@@ -24,9 +25,6 @@ public class CylinderFillingCheck extends BaseEntity { ...@@ -24,9 +25,6 @@ public class CylinderFillingCheck extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "充装后复查ID") @ApiModelProperty(value = "充装后复查ID")
private String fillingCheckId; private String fillingCheckId;
...@@ -54,8 +52,6 @@ public class CylinderFillingCheck extends BaseEntity { ...@@ -54,8 +52,6 @@ public class CylinderFillingCheck extends BaseEntity {
@ApiModelProperty(value = "检查时间") @ApiModelProperty(value = "检查时间")
private String inspectionDate; private String inspectionDate;
@ApiModelProperty(value = "同步时间 yyyy-MM-dd HH24:mi:ss") @ApiModelProperty(value = "同步时间 yyyy-MM-dd HH24:mi:ss")
private Date syncDate; private Date syncDate;
......
package com.yeejoin.amos.boot.module.cylinder.flc.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylCylinderFillingCheck;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
/**
* 液化气体气瓶充装信息-充装后复查 Mapper 接口
*
* @author system_generator
* @date 2022-03-04
*/
public interface CylCylinderFillingCheckMapper extends BaseMapper<CylCylinderFillingCheck> {
Double queryIntegirtyByAppId(String appId);
Integer getFillingCountByMonth(@Param("appId") String appId, @Param("time") Date time);
Integer getFillingPassedCountByMonth(@Param("appId") String appId, @Param("time") Date time);
}
package com.yeejoin.amos.boot.module.cylinder.flc.api.service;
/**
* 液化气体气瓶充装信息-充装后复查接口类
*
* @author system_generator
* @date 2022-03-04
*/
public interface ICylCylinderFillingCheckService {
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.cylinder.flc.api.mapper.CylCylinderFillingCheckMapper">
</mapper>
...@@ -12,6 +12,11 @@ ...@@ -12,6 +12,11 @@
<artifactId>amos-boot-module-cylinder-biz</artifactId> <artifactId>amos-boot-module-cylinder-biz</artifactId>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>com.amosframework.boot</groupId> <groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-cylinder-api</artifactId> <artifactId>amos-boot-module-cylinder-api</artifactId>
<version>1.0.0</version> <version>1.0.0</version>
......
package com.yeejoin.amos.boot.module.cylinder.flc.biz.controller;
import com.yeejoin.amos.boot.module.cylinder.flc.biz.service.impl.CylSyncServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
@RestController
@Api(tags = "气瓶同步Api")
@RequestMapping(value = "/cyl")
public class CylSyncController {
@Autowired
private CylSyncServiceImpl cylSyncService;
/**
* test
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "test", notes = "test")
@GetMapping(value = "/sync/test")
public ResponseModel<Object> testSync(){
return ResponseHelper.buildResponse(cylSyncService.testSync());
}
}
package com.yeejoin.amos.boot.module.cylinder.flc.biz.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylCylinderFillingCheckDto;
import com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylCylinderFillingCheck;
import com.yeejoin.amos.boot.module.cylinder.flc.api.mapper.CylCylinderFillingCheckMapper;
import com.yeejoin.amos.boot.module.cylinder.flc.api.service.ICylCylinderFillingCheckService;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.Date;
import java.util.List;
/**
* 液化气体气瓶充装信息-充装后复查服务实现类
*
* @author system_generator
* @date 2022-03-04
*/
@Service
@DS("cyl")
public class CylCylinderFillingCheckServiceImpl extends BaseService<CylCylinderFillingCheckDto, CylCylinderFillingCheck,
CylCylinderFillingCheckMapper> implements ICylCylinderFillingCheckService {
/**
* 分页查询
*/
public Page<CylCylinderFillingCheckDto> queryForCylinderFillingCheckPage(Page<CylCylinderFillingCheckDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<CylCylinderFillingCheckDto> queryForCylinderFillingCheckList() {
return this.queryForList("", false);
}
public Double queryIntegirtyByAppId(String appId) {
return this.baseMapper.queryIntegirtyByAppId(appId);
}
public Integer getFillingCountByMonth(String appId, Date time) {
return this.baseMapper.getFillingCountByMonth(appId, time);
}
public Integer getFillingPassedCountByMonth(String appId, Date time) {
return this.baseMapper.getFillingPassedCountByMonth(appId, time);
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.cylinder.flc.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylCylinderFillingCheck;
import com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderFillingCheck;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.Date;
import java.util.List;
@Service
public class CylSyncServiceImpl {
@Autowired
private CylCylinderFillingCheckServiceImpl sourceFillingCheckServiceImpl;
@Autowired
private CylinderFillingCheckServiceImpl targetFillingCheckServiceImpl;
public Object testSync() {
LambdaQueryWrapper<CylCylinderFillingCheck> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.last(" limit 1");
List<CylCylinderFillingCheck> rList = sourceFillingCheckServiceImpl.list(queryWrapper);
if (!ValidationUtil.isEmpty(rList)) {
List<CylinderFillingCheck> tList = Lists.newArrayList();
rList.stream().forEach(e -> {
CylinderFillingCheck t = new CylinderFillingCheck();
BeanUtils.copyProperties(e, t);
t.setSyncDate(new Date());
tList.add(t);
});
targetFillingCheckServiceImpl.saveOrUpdateBatch(tList);
return "success";
}
return "failed";
}
}
#DB properties:
spring.datasource.url=jdbc:vastbase://36.46.137.116:5432/tzs_amos_tzs_biz_init?currentSchema=amos_tzs_biz&allowMultiQueries=true
spring.datasource.username=admin
spring.datasource.password=Yeejoin@2023
spring.datasource.dynamic.primary=tzs
#ds tzs
spring.datasource.dynamic.datasource.tzs.url=jdbc:vastbase://36.46.137.116:5432/tzs_amos_tzs_biz_init?currentSchema=amos_tzs_biz&allowMultiQueries=true
spring.datasource.dynamic.datasource.tzs.username=admin
spring.datasource.dynamic.datasource.tzs.password=Yeejoin@2023
spring.datasource.dynamic.datasource.tzs.driver-class-name=cn.com.vastbase.Driver
#ds cyl
spring.datasource.dynamic.datasource.cyl.url=jdbc:vastbase://36.46.137.116:5432/tzs_amos_tzs_biz_init?currentSchema=amos_openapi_cyl&allowMultiQueries=true
spring.datasource.dynamic.datasource.cyl.username=admin
spring.datasource.dynamic.datasource.cyl.password=Yeejoin@2023
spring.datasource.dynamic.datasource.cyl.driver-class-name=cn.com.vastbase.Driver
eureka.client.service-url.defaultZone=http://172.16.10.210:10001/eureka/
eureka.instance.prefer-ip-address=true
management.endpoint.health.show-details=always
management.endpoints.web.exposure.include=*
eureka.instance.health-check-url=http://172.16.3.89:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator
eureka.instance.status-page-url=http://172.16.3.89:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://172.16.3.89:${server.port}${server.servlet.context-path}/doc\
.html
eureka.instance.ip-address=172.16.3.89
## ES properties:
elasticsearch.username=elastic
elasticsearch.password=a123456
spring.elasticsearch.rest.uris=http://172.16.10.210:9200
## unit(h)
alertcall.es.synchrony.time=48
#redis properties:
spring.redis.database=1
spring.redis.host=172.16.10.210
spring.redis.port=16379
spring.redis.password=yeejoin@2020
spring.redis.lettuce.pool.max-active=200
spring.redis.lettuce.pool.max-wait=-1
spring.redis.lettuce.pool.max-idle=10
spring.redis.lettuce.pool.min-idle=0
## emqx properties:
emqx.clean-session=false
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://36.46.151.113:1883
emqx.client-user-name=super
emqx.client-password=123456
emqx.keepAliveInterval=1000
tzs.cti.appkey=4e805006-3fef-ae43-3915-a153731007c4
tzs.cti.secretkey=7bd29115-99ee-4f7d-1fb1-7c4719d5f43a
tzs.cti.url=http://36.41.172.83:8000
##wechatToken
tzs.wechat.token=yeejoin_2021
##wechatTicketUrl
tzs.wechat.ticketurl=https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=
#tzs.wechat.tempId.kr=rjW8x9rRitIpa21Jekyx2nzBzpJy7tycssCXSN4YhWw
tzs.wechat.tempId.kr=bxchKYhYW7aHbGKM2pVyR_yY2-bG4sRMNU3ZRQbMKYM
tzs.wechat.url.kr=tzs.yeeamos.com/persondetail.html
#tzs.wechat.tempId.wx=ofBIZS8Bup9s0zKbrGa8BfhVhS18H_hyC_OYXuBN6hI
tzs.wechat.tempId.wx=rags-expfNSBB-h2WenuBI2c6pCEndH4uwTtOqlHqDM
tzs.wechat.url.wx=tzs.yeeamos.com/repairPersondetail.html
#tzs.wechat.tempId.ts=Kr7lcV8g4g_lgyW_RpwnNgw_HDxxRuVx759EoFWrIfU
tzs.wechat.tempId.ts=VWqgY-lXFt4dg2EL4pLjfDCBAU49Z0mRxVaQhAMMW8Q
tzs.wechat.url.ts=tzs.yeeamos.com/taskComplaintDetail.html
mqtt.topic.task.newtask=tzs-task-newtask
mqtt.topic.task.personinfo=tzs-task-personinfo
mqtt.topic.elevator.push=/tzs/tcb_elevator
mqtt.topic.alertInfo.push=/tzs/tcb_alertInfo
mqtt.topic.alertReport.push=/tzs/tcb_alertReport
mqtt.topic.alertHeart.push=/tzs/tcb_alertHeart
mqtt.topic.alertMatrix.push=/tzs/tcb_alertMatrix
mqtt.topic.cti.push=/cti/record
cti.user.name=tzs_cti
cti.user.pwd=a1234567
flc.sms.tempCode=SMS_TZS_0001
## ??????id
tzs.wechat.tempId.warning=-pHsHLIjW8j-_AemoZycf6Dmu6iYc-YWWaJ0cAPGeUY
##??????
tzs.wechat.tempId.supervise=P5XGbszS2Pc6kynvGjzPpZ--ikAwDZo6O7WdJ2EUxtE
## ???????id???userId?
tzs.wechat.test.userId=3413513
##new properties
org.filter.group.seq=1564150103147573249
fileserver.domain=http://172.16.10.210:19000/
log.level=INFO
duty.seats.role.ids=1585956200472674305,1585956257590706177
## ???? properties:
rule.definition.load=false
##rule.definition.model-package=com.yeejoin.amos.boot.module.jcs.api.dto
rule.definition.default-agency=tzs
rule.definition.local-ip=172.16.10.210
#\u6C14\u74F6\u5145\u88C5\u4FE1\u606F\u5B9A\u65F6\u540C\u6B65\u81F3es
tzs.cylinder.fill.cron=0 0 0 * * ?
#\u6C14\u74F6\u57FA\u672C\u4FE1\u606F\u5B9A\u65F6\u540C\u6B65\u81F3es
tzs.cylinder.info.cron=0 0 1 * * ?
# ??????????
minio.url.path=http://172.16.10.210:9000/
## ɼǰ׺
regulatory_code_prefix=https://nav.sspai.top/tzs?code=
outSystem.user.password=a1234560
amos.system.user.app-key=AMOS_STUDIO
amos.system.user.product=STUDIO_APP_WEB
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment