Commit 2e9aa63e authored by lisong's avatar lisong

微信小程序服务拆分

parent a235baae
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>amos-boot-module-app</artifactId>
<groupId>com.amosframework.boot</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<version>1.0.0</version>
<artifactId>amos-boot-module-app-api</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-elasticsearch</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-common-api</artifactId>
<version>${amos-biz-boot.version}</version>
</dependency>
<dependency>
<groupId>net.javacrumbs.shedlock</groupId>
<artifactId>shedlock-spring</artifactId>
</dependency>
<dependency>
<groupId>net.javacrumbs.shedlock</groupId>
<artifactId>shedlock-provider-redis-spring</artifactId>
</dependency>
<dependency>
<artifactId>amos-component-rule</artifactId>
<groupId>com.yeejoin</groupId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package com.yeejoin.amos.boot.module.app.api.common;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @description: 公共实体
* @author: duanwei
**/
@Data
public class BaseEntity implements Serializable {
private static final long serialVersionUID = -5464322936854328207L;
@TableId(type = IdType.ID_WORKER)
private Long id;
/**
* 创建时间
*/
@TableField(value = "create_date", fill = FieldFill.INSERT)
private Date createDate;
/**
* 更新时间
*/
@TableField(value = "update_time", fill = FieldFill.UPDATE)
private Date updateTime;
}
package com.yeejoin.amos.boot.module.app.api.common;
import com.yeejoin.amos.boot.module.app.api.enums.BaseExceptionEnum;
/**
* @Author cpp
* @Description基础异常类
* @Date 2023/4/23
*/
public class BaseException extends RuntimeException {
private static final long serialVersionUID = 194906846739586857L;
/**
* 错误码
*/
private int code;
/**
* 错误内容
*/
private String msg;
public BaseException(String msg) {
super(msg);
}
public BaseException(int code, String msg) {
super(msg);
this.code = code;
this.msg = msg;
}
public BaseException(BaseExceptionEnum baseExceptionEnum) {
super(baseExceptionEnum.getMsg());
this.msg = baseExceptionEnum.getMsg();
this.code = baseExceptionEnum.getCode();
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}
package com.yeejoin.amos.boot.module.app.api.common;
/**
* @Description: 通用常量类
* @Author: DELL
* @Date: 2021/5/26
*/
public interface BizCommonConstant {
/**
* 所有平台企业数据redisKey
*/
String COMPANY_TREE_REDIS_KEY = "REGULATOR_UNIT_TREE";
}
package com.yeejoin.amos.boot.module.app.api.common;
import com.yeejoin.amos.boot.module.app.api.enums.CommonErrorEnum;
/**
* @description: 共同异常类
* @author: duanwei
* @create: 2019-08-28 20:07
**/
public class CommonException extends BaseException {
private static final long serialVersionUID = 194906846739586857L;
/**
* 错误码
*/
private int code;
/**
* 错误内容
*/
private String msg;
public CommonException(int code, String msg) {
super(msg);
this.code = code;
this.msg = msg;
}
public CommonException(CommonErrorEnum menuExceptionEnum) {
super(menuExceptionEnum.getMsg());
this.msg = menuExceptionEnum.getMsg();
this.code = menuExceptionEnum.getCode();
}
@Override
public int getCode() {
return code;
}
@Override
public void setCode(int code) {
this.code = code;
}
@Override
public String getMsg() {
return msg;
}
@Override
public void setMsg(String msg) {
this.msg = msg;
}
}
package com.yeejoin.amos.boot.module.app.api.common;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang.StringUtils;
/**
*
* <pre>
* DES加密解密工具
* 加密:DesUtils.encode("admin","1,2,3");
* 解密:DesUtils.decode("012C2C9BA925FAF8045B2FD9B02A2664","1,2,3");
* </pre>
*
* @author amos
* @version $Id: DesUtil.java, v 0.1 2018年10月13日 下午3:56:27 amos Exp $
*/
public class DesUtil {
private static DesCore desCore = new DesCore();
/**
* DES加密(secretKey代表3个key,用逗号分隔)
*/
public static String encode(String data, String secretKey) {
if (StringUtils.isBlank(data)){
return "";
}
String[] ks = StringUtils.split(secretKey, ",");
if (ks.length >= 3){
return desCore.strEnc(data, ks[0], ks[1], ks[2]);
}
return desCore.strEnc(data, secretKey, "", "");
}
/**
* DES解密(secretKey代表3个key,用逗号分隔)
*/
public static String decode(String data, String secretKey) {
if (StringUtils.isBlank(data)){
return "";
}
String[] ks = StringUtils.split(secretKey, ",");
if (ks.length >= 3){
return desCore.strDec(data, ks[0], ks[1], ks[2]);
}
return desCore.strDec(data, secretKey, "", "");
}
/**
*
* <pre>
* DES加密/解密
* @Copyright Copyright (c) 2006
* </pre>
*
* @author amos
* @version $Id: DesUtil.java, v 0.1 2018年10月13日 下午3:56:59 amos Exp $
*/
@SuppressWarnings({"rawtypes","unused","unchecked"})
static class DesCore {
/*
* encrypt the string to string made up of hex return the encrypted string
*/
public String strEnc(String data, String firstKey, String secondKey, String thirdKey) {
int leng = data.length();
String encData = "";
List firstKeyBt = null, secondKeyBt = null, thirdKeyBt = null;
int firstLength = 0, secondLength = 0, thirdLength = 0;
if (firstKey != null && firstKey != "") {
firstKeyBt = getKeyBytes(firstKey);
firstLength = firstKeyBt.size();
}
if (secondKey != null && secondKey != "") {
secondKeyBt = getKeyBytes(secondKey);
secondLength = secondKeyBt.size();
}
if (thirdKey != null && thirdKey != "") {
thirdKeyBt = getKeyBytes(thirdKey);
thirdLength = thirdKeyBt.size();
}
if (leng > 0) {
if (leng < 4) {
int[] bt = strToBt(data);
int[] encByte = null;
if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "" && thirdKey != null && thirdKey != "") {
int[] tempBt;
int x, y, z;
tempBt = bt;
for (x = 0; x < firstLength; x++) {
tempBt = enc(tempBt, (int[]) firstKeyBt.get(x));
}
for (y = 0; y < secondLength; y++) {
tempBt = enc(tempBt, (int[]) secondKeyBt.get(y));
}
for (z = 0; z < thirdLength; z++) {
tempBt = enc(tempBt, (int[]) thirdKeyBt.get(z));
}
encByte = tempBt;
} else {
if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "") {
int[] tempBt;
int x, y;
tempBt = bt;
for (x = 0; x < firstLength; x++) {
tempBt = enc(tempBt, (int[]) firstKeyBt.get(x));
}
for (y = 0; y < secondLength; y++) {
tempBt = enc(tempBt, (int[]) secondKeyBt.get(y));
}
encByte = tempBt;
} else {
if (firstKey != null && firstKey != "") {
int[] tempBt;
int x = 0;
tempBt = bt;
for (x = 0; x < firstLength; x++) {
tempBt = enc(tempBt, (int[]) firstKeyBt.get(x));
}
encByte = tempBt;
}
}
}
encData = bt64ToHex(encByte);
} else {
int iterator = (leng / 4);
int remainder = leng % 4;
int i = 0;
for (i = 0; i < iterator; i++) {
String tempData = data.substring(i * 4 + 0, i * 4 + 4);
int[] tempByte = strToBt(tempData);
int[] encByte = null;
if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "" && thirdKey != null && thirdKey != "") {
int[] tempBt;
int x, y, z;
tempBt = tempByte;
for (x = 0; x < firstLength; x++) {
tempBt = enc(tempBt, (int[]) firstKeyBt.get(x));
}
for (y = 0; y < secondLength; y++) {
tempBt = enc(tempBt, (int[]) secondKeyBt.get(y));
}
for (z = 0; z < thirdLength; z++) {
tempBt = enc(tempBt, (int[]) thirdKeyBt.get(z));
}
encByte = tempBt;
} else {
if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "") {
int[] tempBt;
int x, y;
tempBt = tempByte;
for (x = 0; x < firstLength; x++) {
tempBt = enc(tempBt, (int[]) firstKeyBt.get(x));
}
for (y = 0; y < secondLength; y++) {
tempBt = enc(tempBt, (int[]) secondKeyBt.get(y));
}
encByte = tempBt;
} else {
if (firstKey != null && firstKey != "") {
int[] tempBt;
int x;
tempBt = tempByte;
for (x = 0; x < firstLength; x++) {
tempBt = enc(tempBt, (int[]) firstKeyBt.get(x));
}
encByte = tempBt;
}
}
}
encData += bt64ToHex(encByte);
}
if (remainder > 0) {
String remainderData = data.substring(iterator * 4 + 0, leng);
int[] tempByte = strToBt(remainderData);
int[] encByte = null;
if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "" && thirdKey != null && thirdKey != "") {
int[] tempBt;
int x, y, z;
tempBt = tempByte;
for (x = 0; x < firstLength; x++) {
tempBt = enc(tempBt, (int[]) firstKeyBt.get(x));
}
for (y = 0; y < secondLength; y++) {
tempBt = enc(tempBt, (int[]) secondKeyBt.get(y));
}
for (z = 0; z < thirdLength; z++) {
tempBt = enc(tempBt, (int[]) thirdKeyBt.get(z));
}
encByte = tempBt;
} else {
if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "") {
int[] tempBt;
int x, y;
tempBt = tempByte;
for (x = 0; x < firstLength; x++) {
tempBt = enc(tempBt, (int[]) firstKeyBt.get(x));
}
for (y = 0; y < secondLength; y++) {
tempBt = enc(tempBt, (int[]) secondKeyBt.get(y));
}
encByte = tempBt;
} else {
if (firstKey != null && firstKey != "") {
int[] tempBt;
int x;
tempBt = tempByte;
for (x = 0; x < firstLength; x++) {
tempBt = enc(tempBt, (int[]) firstKeyBt.get(x));
}
encByte = tempBt;
}
}
}
encData += bt64ToHex(encByte);
}
}
}
return encData;
}
/*
* decrypt the encrypted string to the original string
*
* return the original string
*/
public String strDec(String data, String firstKey, String secondKey, String thirdKey) {
int leng = data.length();
String decStr = "";
List firstKeyBt = null, secondKeyBt = null, thirdKeyBt = null;
int firstLength = 0, secondLength = 0, thirdLength = 0;
if (firstKey != null && firstKey != "") {
firstKeyBt = getKeyBytes(firstKey);
firstLength = firstKeyBt.size();
}
if (secondKey != null && secondKey != "") {
secondKeyBt = getKeyBytes(secondKey);
secondLength = secondKeyBt.size();
}
if (thirdKey != null && thirdKey != "") {
thirdKeyBt = getKeyBytes(thirdKey);
thirdLength = thirdKeyBt.size();
}
int iterator = leng / 16;
int i = 0;
for (i = 0; i < iterator; i++) {
String tempData = data.substring(i * 16 + 0, i * 16 + 16);
String strByte = hexToBt64(tempData);
int[] intByte = new int[64];
int j = 0;
for (j = 0; j < 64; j++) {
intByte[j] = Integer.parseInt(strByte.substring(j, j + 1));
}
int[] decByte = null;
if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "" && thirdKey != null && thirdKey != "") {
int[] tempBt;
int x, y, z;
tempBt = intByte;
for (x = thirdLength - 1; x >= 0; x--) {
tempBt = dec(tempBt, (int[]) thirdKeyBt.get(x));
}
for (y = secondLength - 1; y >= 0; y--) {
tempBt = dec(tempBt, (int[]) secondKeyBt.get(y));
}
for (z = firstLength - 1; z >= 0; z--) {
tempBt = dec(tempBt, (int[]) firstKeyBt.get(z));
}
decByte = tempBt;
} else {
if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "") {
int[] tempBt;
int x, y, z;
tempBt = intByte;
for (x = secondLength - 1; x >= 0; x--) {
tempBt = dec(tempBt, (int[]) secondKeyBt.get(x));
}
for (y = firstLength - 1; y >= 0; y--) {
tempBt = dec(tempBt, (int[]) firstKeyBt.get(y));
}
decByte = tempBt;
} else {
if (firstKey != null && firstKey != "") {
int[] tempBt;
int x, y, z;
tempBt = intByte;
for (x = firstLength - 1; x >= 0; x--) {
tempBt = dec(tempBt, (int[]) firstKeyBt.get(x));
}
decByte = tempBt;
}
}
}
decStr += byteToString(decByte);
}
return decStr;
}
/*
* chang the string into the bit array
*
* return bit array(it's length % 64 = 0)
*/
public List getKeyBytes(String key) {
List keyBytes = new ArrayList();
int leng = key.length();
int iterator = (leng / 4);
int remainder = leng % 4;
int i = 0;
for (i = 0; i < iterator; i++) {
keyBytes.add(i, strToBt(key.substring(i * 4 + 0, i * 4 + 4)));
}
if (remainder > 0) {
// keyBytes[i] = strToBt(key.substring(i*4+0,leng));
keyBytes.add(i, strToBt(key.substring(i * 4 + 0, leng)));
}
return keyBytes;
}
/*
* chang the string(it's length <= 4) into the bit array
*
* return bit array(it's length = 64)
*/
public int[] strToBt(String str) {
int leng = str.length();
int[] bt = new int[64];
if (leng < 4) {
int i = 0, j = 0, p = 0, q = 0;
for (i = 0; i < leng; i++) {
int k = str.charAt(i);
for (j = 0; j < 16; j++) {
int pow = 1, m = 0;
for (m = 15; m > j; m--) {
pow *= 2;
}
// bt.set(16*i+j,""+(k/pow)%2));
bt[16 * i + j] = (k / pow) % 2;
}
}
for (p = leng; p < 4; p++) {
int k = 0;
for (q = 0; q < 16; q++) {
int pow = 1, m = 0;
for (m = 15; m > q; m--) {
pow *= 2;
}
// bt[16*p+q]=parseInt(k/pow)%2;
// bt.add(16*p+q,""+((k/pow)%2));
bt[16 * p + q] = (k / pow) % 2;
}
}
} else {
for (int i = 0; i < 4; i++) {
int k = str.charAt(i);
for (int j = 0; j < 16; j++) {
int pow = 1;
for (int m = 15; m > j; m--) {
pow *= 2;
}
// bt[16*i+j]=parseInt(k/pow)%2;
// bt.add(16*i+j,""+((k/pow)%2));
bt[16 * i + j] = (k / pow) % 2;
}
}
}
return bt;
}
/*
* chang the bit(it's length = 4) into the hex
*
* return hex
*/
public String bt4ToHex(String binary) {
String hex = "";
if (binary.equalsIgnoreCase("0000")) {
hex = "0";
} else if (binary.equalsIgnoreCase("0001")) {
hex = "1";
} else if (binary.equalsIgnoreCase("0010")) {
hex = "2";
} else if (binary.equalsIgnoreCase("0011")) {
hex = "3";
} else if (binary.equalsIgnoreCase("0100")) {
hex = "4";
} else if (binary.equalsIgnoreCase("0101")) {
hex = "5";
} else if (binary.equalsIgnoreCase("0110")) {
hex = "6";
} else if (binary.equalsIgnoreCase("0111")) {
hex = "7";
} else if (binary.equalsIgnoreCase("1000")) {
hex = "8";
} else if (binary.equalsIgnoreCase("1001")) {
hex = "9";
} else if (binary.equalsIgnoreCase("1010")) {
hex = "A";
} else if (binary.equalsIgnoreCase("1011")) {
hex = "B";
} else if (binary.equalsIgnoreCase("1100")) {
hex = "C";
} else if (binary.equalsIgnoreCase("1101")) {
hex = "D";
} else if (binary.equalsIgnoreCase("1110")) {
hex = "E";
} else if (binary.equalsIgnoreCase("1111")) {
hex = "F";
}
return hex;
}
/*
* chang the hex into the bit(it's length = 4)
*
* return the bit(it's length = 4)
*/
public String hexToBt4(String hex) {
String binary = "";
if (hex.equalsIgnoreCase("0")) {
binary = "0000";
} else if (hex.equalsIgnoreCase("1")) {
binary = "0001";
}
if (hex.equalsIgnoreCase("2")) {
binary = "0010";
}
if (hex.equalsIgnoreCase("3")) {
binary = "0011";
}
if (hex.equalsIgnoreCase("4")) {
binary = "0100";
}
if (hex.equalsIgnoreCase("5")) {
binary = "0101";
}
if (hex.equalsIgnoreCase("6")) {
binary = "0110";
}
if (hex.equalsIgnoreCase("7")) {
binary = "0111";
}
if (hex.equalsIgnoreCase("8")) {
binary = "1000";
}
if (hex.equalsIgnoreCase("9")) {
binary = "1001";
}
if (hex.equalsIgnoreCase("A")) {
binary = "1010";
}
if (hex.equalsIgnoreCase("B")) {
binary = "1011";
}
if (hex.equalsIgnoreCase("C")) {
binary = "1100";
}
if (hex.equalsIgnoreCase("D")) {
binary = "1101";
}
if (hex.equalsIgnoreCase("E")) {
binary = "1110";
}
if (hex.equalsIgnoreCase("F")) {
binary = "1111";
}
return binary;
}
/*
* chang the bit(it's length = 64) into the string
*
* return string
*/
public String byteToString(int[] byteData) {
String str = "";
for (int i = 0; i < 4; i++) {
int count = 0;
for (int j = 0; j < 16; j++) {
int pow = 1;
for (int m = 15; m > j; m--) {
pow *= 2;
}
count += byteData[16 * i + j] * pow;
}
if (count != 0) {
str += "" + (char) (count);
}
}
return str;
}
public String bt64ToHex(int[] byteData) {
String hex = "";
for (int i = 0; i < 16; i++) {
String bt = "";
for (int j = 0; j < 4; j++) {
bt += byteData[i * 4 + j];
}
hex += bt4ToHex(bt);
}
return hex;
}
public String hexToBt64(String hex) {
String binary = "";
for (int i = 0; i < 16; i++) {
binary += hexToBt4(hex.substring(i, i + 1));
}
return binary;
}
/*
* the 64 bit des core arithmetic
*/
public int[] enc(int[] dataByte, int[] keyByte) {
int[][] keys = generateKeys(keyByte);
int[] ipByte = initPermute(dataByte);
int[] ipLeft = new int[32];
int[] ipRight = new int[32];
int[] tempLeft = new int[32];
int i = 0, j = 0, k = 0, m = 0, n = 0;
for (k = 0; k < 32; k++) {
ipLeft[k] = ipByte[k];
ipRight[k] = ipByte[32 + k];
}
for (i = 0; i < 16; i++) {
for (j = 0; j < 32; j++) {
tempLeft[j] = ipLeft[j];
ipLeft[j] = ipRight[j];
}
int[] key = new int[48];
for (m = 0; m < 48; m++) {
key[m] = keys[i][m];
}
int[] tempRight = xor(pPermute(sBoxPermute(xor(expandPermute(ipRight), key))), tempLeft);
for (n = 0; n < 32; n++) {
ipRight[n] = tempRight[n];
}
}
int[] finalData = new int[64];
for (i = 0; i < 32; i++) {
finalData[i] = ipRight[i];
finalData[32 + i] = ipLeft[i];
}
return finallyPermute(finalData);
}
public int[] dec(int[] dataByte, int[] keyByte) {
int[][] keys = generateKeys(keyByte);
int[] ipByte = initPermute(dataByte);
int[] ipLeft = new int[32];
int[] ipRight = new int[32];
int[] tempLeft = new int[32];
int i = 0, j = 0, k = 0, m = 0, n = 0;
for (k = 0; k < 32; k++) {
ipLeft[k] = ipByte[k];
ipRight[k] = ipByte[32 + k];
}
for (i = 15; i >= 0; i--) {
for (j = 0; j < 32; j++) {
tempLeft[j] = ipLeft[j];
ipLeft[j] = ipRight[j];
}
int[] key = new int[48];
for (m = 0; m < 48; m++) {
key[m] = keys[i][m];
}
int[] tempRight = xor(pPermute(sBoxPermute(xor(expandPermute(ipRight), key))), tempLeft);
for (n = 0; n < 32; n++) {
ipRight[n] = tempRight[n];
}
}
int[] finalData = new int[64];
for (i = 0; i < 32; i++) {
finalData[i] = ipRight[i];
finalData[32 + i] = ipLeft[i];
}
return finallyPermute(finalData);
}
public int[] initPermute(int[] originalData) {
int[] ipByte = new int[64];
int i = 0, m = 1, n = 0, j, k;
for (i = 0, m = 1, n = 0; i < 4; i++, m += 2, n += 2) {
for (j = 7, k = 0; j >= 0; j--, k++) {
ipByte[i * 8 + k] = originalData[j * 8 + m];
ipByte[i * 8 + k + 32] = originalData[j * 8 + n];
}
}
return ipByte;
}
public int[] expandPermute(int[] rightData) {
int[] epByte = new int[48];
int i, j;
for (i = 0; i < 8; i++) {
if (i == 0) {
epByte[i * 6 + 0] = rightData[31];
} else {
epByte[i * 6 + 0] = rightData[i * 4 - 1];
}
epByte[i * 6 + 1] = rightData[i * 4 + 0];
epByte[i * 6 + 2] = rightData[i * 4 + 1];
epByte[i * 6 + 3] = rightData[i * 4 + 2];
epByte[i * 6 + 4] = rightData[i * 4 + 3];
if (i == 7) {
epByte[i * 6 + 5] = rightData[0];
} else {
epByte[i * 6 + 5] = rightData[i * 4 + 4];
}
}
return epByte;
}
public int[] xor(int[] byteOne, int[] byteTwo) {
// var xorByte = new Array(byteOne.length);
// for(int i = 0;i < byteOne.length; i ++){
// xorByte[i] = byteOne[i] ^ byteTwo[i];
// }
// return xorByte;
int[] xorByte = new int[byteOne.length];
for (int i = 0; i < byteOne.length; i++) {
xorByte[i] = byteOne[i] ^ byteTwo[i];
}
return xorByte;
}
public int[] sBoxPermute(int[] expandByte) {
// var sBoxByte = new Array(32);
int[] sBoxByte = new int[32];
String binary = "";
int[][] s1 = { { 14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7 }, { 0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8 },
{ 4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0 }, { 15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13 } };
/* Table - s2 */
int[][] s2 = { { 15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10 }, { 3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5 },
{ 0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15 }, { 13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9 } };
/* Table - s3 */
int[][] s3 = { { 10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8 }, { 13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1 },
{ 13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7 }, { 1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12 } };
/* Table - s4 */
int[][] s4 = { { 7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15 }, { 13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9 },
{ 10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4 }, { 3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14 } };
/* Table - s5 */
int[][] s5 = { { 2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9 }, { 14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6 },
{ 4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14 }, { 11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3 } };
/* Table - s6 */
int[][] s6 = { { 12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11 }, { 10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8 },
{ 9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6 }, { 4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13 } };
/* Table - s7 */
int[][] s7 = { { 4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1 }, { 13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6 },
{ 1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2 }, { 6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12 } };
/* Table - s8 */
int[][] s8 = { { 13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7 }, { 1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2 },
{ 7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8 }, { 2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11 } };
for (int m = 0; m < 8; m++) {
int i = 0, j = 0;
i = expandByte[m * 6 + 0] * 2 + expandByte[m * 6 + 5];
j = expandByte[m * 6 + 1] * 2 * 2 * 2 + expandByte[m * 6 + 2] * 2 * 2 + expandByte[m * 6 + 3] * 2 + expandByte[m * 6 + 4];
switch (m) {
case 0:
binary = getBoxBinary(s1[i][j]);
break;
case 1:
binary = getBoxBinary(s2[i][j]);
break;
case 2:
binary = getBoxBinary(s3[i][j]);
break;
case 3:
binary = getBoxBinary(s4[i][j]);
break;
case 4:
binary = getBoxBinary(s5[i][j]);
break;
case 5:
binary = getBoxBinary(s6[i][j]);
break;
case 6:
binary = getBoxBinary(s7[i][j]);
break;
case 7:
binary = getBoxBinary(s8[i][j]);
break;
}
sBoxByte[m * 4 + 0] = Integer.parseInt(binary.substring(0, 1));
sBoxByte[m * 4 + 1] = Integer.parseInt(binary.substring(1, 2));
sBoxByte[m * 4 + 2] = Integer.parseInt(binary.substring(2, 3));
sBoxByte[m * 4 + 3] = Integer.parseInt(binary.substring(3, 4));
}
return sBoxByte;
}
public int[] pPermute(int[] sBoxByte) {
int[] pBoxPermute = new int[32];
pBoxPermute[0] = sBoxByte[15];
pBoxPermute[1] = sBoxByte[6];
pBoxPermute[2] = sBoxByte[19];
pBoxPermute[3] = sBoxByte[20];
pBoxPermute[4] = sBoxByte[28];
pBoxPermute[5] = sBoxByte[11];
pBoxPermute[6] = sBoxByte[27];
pBoxPermute[7] = sBoxByte[16];
pBoxPermute[8] = sBoxByte[0];
pBoxPermute[9] = sBoxByte[14];
pBoxPermute[10] = sBoxByte[22];
pBoxPermute[11] = sBoxByte[25];
pBoxPermute[12] = sBoxByte[4];
pBoxPermute[13] = sBoxByte[17];
pBoxPermute[14] = sBoxByte[30];
pBoxPermute[15] = sBoxByte[9];
pBoxPermute[16] = sBoxByte[1];
pBoxPermute[17] = sBoxByte[7];
pBoxPermute[18] = sBoxByte[23];
pBoxPermute[19] = sBoxByte[13];
pBoxPermute[20] = sBoxByte[31];
pBoxPermute[21] = sBoxByte[26];
pBoxPermute[22] = sBoxByte[2];
pBoxPermute[23] = sBoxByte[8];
pBoxPermute[24] = sBoxByte[18];
pBoxPermute[25] = sBoxByte[12];
pBoxPermute[26] = sBoxByte[29];
pBoxPermute[27] = sBoxByte[5];
pBoxPermute[28] = sBoxByte[21];
pBoxPermute[29] = sBoxByte[10];
pBoxPermute[30] = sBoxByte[3];
pBoxPermute[31] = sBoxByte[24];
return pBoxPermute;
}
public int[] finallyPermute(int[] endByte) {
int[] fpByte = new int[64];
fpByte[0] = endByte[39];
fpByte[1] = endByte[7];
fpByte[2] = endByte[47];
fpByte[3] = endByte[15];
fpByte[4] = endByte[55];
fpByte[5] = endByte[23];
fpByte[6] = endByte[63];
fpByte[7] = endByte[31];
fpByte[8] = endByte[38];
fpByte[9] = endByte[6];
fpByte[10] = endByte[46];
fpByte[11] = endByte[14];
fpByte[12] = endByte[54];
fpByte[13] = endByte[22];
fpByte[14] = endByte[62];
fpByte[15] = endByte[30];
fpByte[16] = endByte[37];
fpByte[17] = endByte[5];
fpByte[18] = endByte[45];
fpByte[19] = endByte[13];
fpByte[20] = endByte[53];
fpByte[21] = endByte[21];
fpByte[22] = endByte[61];
fpByte[23] = endByte[29];
fpByte[24] = endByte[36];
fpByte[25] = endByte[4];
fpByte[26] = endByte[44];
fpByte[27] = endByte[12];
fpByte[28] = endByte[52];
fpByte[29] = endByte[20];
fpByte[30] = endByte[60];
fpByte[31] = endByte[28];
fpByte[32] = endByte[35];
fpByte[33] = endByte[3];
fpByte[34] = endByte[43];
fpByte[35] = endByte[11];
fpByte[36] = endByte[51];
fpByte[37] = endByte[19];
fpByte[38] = endByte[59];
fpByte[39] = endByte[27];
fpByte[40] = endByte[34];
fpByte[41] = endByte[2];
fpByte[42] = endByte[42];
fpByte[43] = endByte[10];
fpByte[44] = endByte[50];
fpByte[45] = endByte[18];
fpByte[46] = endByte[58];
fpByte[47] = endByte[26];
fpByte[48] = endByte[33];
fpByte[49] = endByte[1];
fpByte[50] = endByte[41];
fpByte[51] = endByte[9];
fpByte[52] = endByte[49];
fpByte[53] = endByte[17];
fpByte[54] = endByte[57];
fpByte[55] = endByte[25];
fpByte[56] = endByte[32];
fpByte[57] = endByte[0];
fpByte[58] = endByte[40];
fpByte[59] = endByte[8];
fpByte[60] = endByte[48];
fpByte[61] = endByte[16];
fpByte[62] = endByte[56];
fpByte[63] = endByte[24];
return fpByte;
}
public String getBoxBinary(int i) {
String binary = "";
switch (i) {
case 0:
binary = "0000";
break;
case 1:
binary = "0001";
break;
case 2:
binary = "0010";
break;
case 3:
binary = "0011";
break;
case 4:
binary = "0100";
break;
case 5:
binary = "0101";
break;
case 6:
binary = "0110";
break;
case 7:
binary = "0111";
break;
case 8:
binary = "1000";
break;
case 9:
binary = "1001";
break;
case 10:
binary = "1010";
break;
case 11:
binary = "1011";
break;
case 12:
binary = "1100";
break;
case 13:
binary = "1101";
break;
case 14:
binary = "1110";
break;
case 15:
binary = "1111";
break;
}
return binary;
}
/*
* generate 16 keys for xor
*/
public int[][] generateKeys(int[] keyByte) {
int[] key = new int[56];
int[][] keys = new int[16][48];
// keys[ 0] = new Array();
// keys[ 1] = new Array();
// keys[ 2] = new Array();
// keys[ 3] = new Array();
// keys[ 4] = new Array();
// keys[ 5] = new Array();
// keys[ 6] = new Array();
// keys[ 7] = new Array();
// keys[ 8] = new Array();
// keys[ 9] = new Array();
// keys[10] = new Array();
// keys[11] = new Array();
// keys[12] = new Array();
// keys[13] = new Array();
// keys[14] = new Array();
// keys[15] = new Array();
int[] loop = new int[] { 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1 };
for (int i = 0; i < 7; i++) {
for (int j = 0, k = 7; j < 8; j++, k--) {
key[i * 8 + j] = keyByte[8 * k + i];
}
}
int i = 0;
for (i = 0; i < 16; i++) {
int tempLeft = 0;
int tempRight = 0;
for (int j = 0; j < loop[i]; j++) {
tempLeft = key[0];
tempRight = key[28];
for (int k = 0; k < 27; k++) {
key[k] = key[k + 1];
key[28 + k] = key[29 + k];
}
key[27] = tempLeft;
key[55] = tempRight;
}
// var tempKey = new Array(48);
int[] tempKey = new int[48];
tempKey[0] = key[13];
tempKey[1] = key[16];
tempKey[2] = key[10];
tempKey[3] = key[23];
tempKey[4] = key[0];
tempKey[5] = key[4];
tempKey[6] = key[2];
tempKey[7] = key[27];
tempKey[8] = key[14];
tempKey[9] = key[5];
tempKey[10] = key[20];
tempKey[11] = key[9];
tempKey[12] = key[22];
tempKey[13] = key[18];
tempKey[14] = key[11];
tempKey[15] = key[3];
tempKey[16] = key[25];
tempKey[17] = key[7];
tempKey[18] = key[15];
tempKey[19] = key[6];
tempKey[20] = key[26];
tempKey[21] = key[19];
tempKey[22] = key[12];
tempKey[23] = key[1];
tempKey[24] = key[40];
tempKey[25] = key[51];
tempKey[26] = key[30];
tempKey[27] = key[36];
tempKey[28] = key[46];
tempKey[29] = key[54];
tempKey[30] = key[29];
tempKey[31] = key[39];
tempKey[32] = key[50];
tempKey[33] = key[44];
tempKey[34] = key[32];
tempKey[35] = key[47];
tempKey[36] = key[43];
tempKey[37] = key[48];
tempKey[38] = key[38];
tempKey[39] = key[55];
tempKey[40] = key[33];
tempKey[41] = key[52];
tempKey[42] = key[45];
tempKey[43] = key[41];
tempKey[44] = key[49];
tempKey[45] = key[35];
tempKey[46] = key[28];
tempKey[47] = key[31];
int m;
switch (i) {
case 0:
for (m = 0; m < 48; m++) {
keys[0][m] = tempKey[m];
}
break;
case 1:
for (m = 0; m < 48; m++) {
keys[1][m] = tempKey[m];
}
break;
case 2:
for (m = 0; m < 48; m++) {
keys[2][m] = tempKey[m];
}
break;
case 3:
for (m = 0; m < 48; m++) {
keys[3][m] = tempKey[m];
}
break;
case 4:
for (m = 0; m < 48; m++) {
keys[4][m] = tempKey[m];
}
break;
case 5:
for (m = 0; m < 48; m++) {
keys[5][m] = tempKey[m];
}
break;
case 6:
for (m = 0; m < 48; m++) {
keys[6][m] = tempKey[m];
}
break;
case 7:
for (m = 0; m < 48; m++) {
keys[7][m] = tempKey[m];
}
break;
case 8:
for (m = 0; m < 48; m++) {
keys[8][m] = tempKey[m];
}
break;
case 9:
for (m = 0; m < 48; m++) {
keys[9][m] = tempKey[m];
}
break;
case 10:
for (m = 0; m < 48; m++) {
keys[10][m] = tempKey[m];
}
break;
case 11:
for (m = 0; m < 48; m++) {
keys[11][m] = tempKey[m];
}
break;
case 12:
for (m = 0; m < 48; m++) {
keys[12][m] = tempKey[m];
}
break;
case 13:
for (m = 0; m < 48; m++) {
keys[13][m] = tempKey[m];
}
break;
case 14:
for (m = 0; m < 48; m++) {
keys[14][m] = tempKey[m];
}
break;
case 15:
for (m = 0; m < 48; m++) {
keys[15][m] = tempKey[m];
}
break;
}
}
return keys;
}
}
}
package com.yeejoin.amos.boot.module.app.api.common;
import org.springframework.util.Assert;
import java.io.Closeable;
import java.io.Flushable;
import java.io.IOException;
/**
* IO流拓展工具类,补充IOUtils新版本中废弃的closeQuietly
*
* @author King
* @since 2018/12/27 17:56
*/
public class ExtendedIOUtils {
public static void flush(Flushable... resources) throws IOException {
Assert.noNullElements(resources, "resources invalid");
int length = resources.length;
for (int i = 0; i < length; ++i) {
Flushable resource = resources[i];
if (resource != null) {
resource.flush();
}
}
}
public static void closeQuietly(Closeable... resources) {
int length = resources.length;
for (int i = 0; i < length; ++i) {
Closeable resource = resources[i];
if (resource != null) {
try {
resource.close();
} catch (IOException e) {
//ignore exception
}
}
}
}
}
package com.yeejoin.amos.boot.module.app.api.common;
import java.util.HashMap;
import java.util.Map;
/**
* @Description: 全局单机缓存
* @Author: duanwei
* @Date: 2020/6/30
*/
public class GlobalCache {
/**
* 全局请求头
*/
public static Map<String, String> header = new HashMap<>();
/**
* 依赖参数容器
*/
public static Map<String, String> paramMap = new HashMap<>(1000);
}
package com.yeejoin.amos.boot.module.app.api.common;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.app.api.vo.ResponeVo;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.*;
import org.apache.http.config.Registry;
import org.apache.http.config.RegistryBuilder;
import org.apache.http.conn.socket.ConnectionSocketFactory;
import org.apache.http.conn.socket.PlainConnectionSocketFactory;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.conn.ssl.TrustStrategy;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.ssl.SSLContexts;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.Assert;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import java.io.*;
import java.security.KeyManagementException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/**
* @description: HTTP HTTPS 二次封装
* @author: duanwei
* @create: 2020-05-28 13:57
**/
public class HttpUtils {
/**
* 连接超时时间
*/
public static final int CONNECTION_TIMEOUT = 5000;
/**
* 请求超时时间
*/
public static final int CONNECTION_REQUEST_TIMEOUT = 5000;
/**
* 数据读取等待超时
*/
public static final int SOCKET_TIMEOUT = 10000;
/**
* http
*/
public static final String HTTP = "http";
/**
* https
*/
public static final String HTTPS = "https";
/**
* http端口
*/
public static final int DEFAULT_HTTP_PORT = 80;
/**
* https端口
*/
public static final int DEFAULT_HTTPS_PORT = 443;
/**
* 默认编码
*/
public static final String DEFAULT_ENCODING = "UTF-8";
private static final Logger log = LoggerFactory.getLogger(HttpUtils.class);
/**
* 根据请求头选择相应的client
* https HttpUtil.createSSLInsecureClient
* http createDefault
*
* @param url (url不带参数,例:http://test.com)
* @return CloseableHttpClient
*/
private static CloseableHttpClient getHttpClient(String url) {
CloseableHttpClient httpClient = null;
try {
if (url.startsWith(HTTPS)) {
// 创建一个SSL信任所有证书的httpClient对象
httpClient = HttpUtils.createSslInsecureClient();
} else {
httpClient = HttpClients.createDefault();
}
} catch (Exception e) {
log.error("请求client 初始化失败 请检查地址是否正确,url=" + url + " error" + e);
throw new RuntimeException(e);
}
return httpClient;
}
/**
* 获取post请求头
*
* @param url (url不带参数,例:http://test.com)
* @return HttpPost
*/
public static HttpPost getHttpPost(String url) {
HttpPost httpPost = new HttpPost(url);
RequestConfig requestConfig = RequestConfig.custom()
.setConnectTimeout(CONNECTION_TIMEOUT)
.setConnectionRequestTimeout(CONNECTION_REQUEST_TIMEOUT)
.setSocketTimeout(SOCKET_TIMEOUT)
.setRedirectsEnabled(true)
.build();
httpPost.setConfig(requestConfig);
return httpPost;
}
/**
* get请求(1.处理http请求;2.处理https请求,信任所有证书)
*
* @param url (只能是http或https请求)
*/
public static ResponeVo get(String url) throws IOException {
log.info("----->调用请求 url:" + url);
String result = "";
// 处理参数
HttpGet httpGet;
CloseableHttpClient httpClient = null;
httpClient = getHttpClient(url);
httpGet = new HttpGet(url);
//加入请求头
if (GlobalCache.header != null) {
for (String key : GlobalCache.header.keySet()) {
String value = GlobalCache.header.get(key);
httpGet.setHeader(key, value);
}
}
//加入全局请求令牌权限
httpGet.setHeader("Http-Authorization", GlobalCache.paramMap.get("token"));
RequestConfig requestConfig = RequestConfig.custom()
.setConnectTimeout(CONNECTION_TIMEOUT)
.setConnectionRequestTimeout(CONNECTION_REQUEST_TIMEOUT)
.setSocketTimeout(SOCKET_TIMEOUT)
//默认允许自动重定向
.setRedirectsEnabled(true)
.build();
httpGet.setConfig(requestConfig);
return baseRequest(httpClient, httpGet);
}
/**
* post请求(1.处理http请求;2.处理https请求,信任所有证书)
*
* @param url
* @param jsonParams 入参是个json字符串
* @return
*/
public static ResponeVo post(String url, String jsonParams) throws IOException,
NoSuchAlgorithmException, KeyStoreException, KeyManagementException {
Assert.hasText(url, "url invalid");
String result;
CloseableHttpClient httpClient;
if (url.startsWith(HTTPS)) {
// 创建一个SSL信任所有证书的httpClient对象
httpClient = HttpUtils.createSslInsecureClient();
} else {
httpClient = HttpClients.createDefault();
}
CloseableHttpResponse response = null;
HttpPost httpPost = getHttpPost(url);
if (GlobalCache.header != null) {
for (String key : GlobalCache.header.keySet()) {
String value = GlobalCache.header.get(key);
httpPost.setHeader(key, value);
}
}
//加入全局请求令牌权限
httpPost.setHeader("Http-Authorization", GlobalCache.paramMap.get("token"));
if (GlobalCache.header.get("Content-Type") != null) {
String contentType = GlobalCache.header.get("Content-Type");
if ("application/x-www-form-urlencoded".equals(contentType)) {
JSONObject jsonObject = JSONObject.parseObject(jsonParams);
List<NameValuePair> params = new ArrayList<>();
//循环json key value 仅能解决正常对象 若Json对象中嵌套数组 则可能需要单独处理
if (jsonObject != null) {
for (Map.Entry<String, Object> entry : jsonObject.entrySet()) {
params.add(new BasicNameValuePair(entry.getKey(), entry.getValue().toString()));
}
httpPost.setEntity(new UrlEncodedFormEntity(params, DEFAULT_ENCODING));
}
}
if ("application/json;charset=UTF-8".equals(contentType)) {
httpPost.setEntity(new StringEntity(jsonParams, ContentType.create("application/json", DEFAULT_ENCODING)));
}
} else {
httpPost.setEntity(new StringEntity(jsonParams, ContentType.create("application/json", DEFAULT_ENCODING)));
}
return baseRequest(httpClient, httpPost);
}
/**
* get请求(1.处理http请求;2.处理https请求,信任所有证书)
*
* @param url (只能是http或https请求)
* @return
*/
public static ResponeVo delete(String url) throws IOException, NoSuchAlgorithmException,
KeyStoreException, KeyManagementException {
CloseableHttpClient httpClient = null;
CloseableHttpResponse response = null;
if (url.startsWith(HTTPS)) {
// 创建一个SSL信任所有证书的httpClient对象
httpClient = HttpUtils.createSslInsecureClient();
} else {
httpClient = HttpClients.createDefault();
}
HttpDelete httpDelete = new HttpDelete(url);
if (GlobalCache.header != null) {
for (String key : GlobalCache.header.keySet()) {
String value = GlobalCache.header.get(key);
httpDelete.setHeader(key, value);
}
}
httpDelete.setHeader("Http-Authorization", GlobalCache.paramMap.get("token"));
return baseRequest(httpClient, httpDelete);
}
/**
* get请求(1.处理http请求;2.处理https请求,信任所有证书)
*
* @param url (只能是http或https请求)
* @return
*/
public static ResponeVo put(String url, String jsonParams) throws IOException, NoSuchAlgorithmException,
KeyStoreException, KeyManagementException {
log.info("----->调用请求 url:" + url + " ---->json参数:" + jsonParams);
CloseableHttpClient httpClient = null;
String content;
if (url.startsWith(HTTPS)) {
// 创建一个SSL信任所有证书的httpClient对象
httpClient = HttpUtils.createSslInsecureClient();
} else {
httpClient = HttpClients.createDefault();
}
CloseableHttpResponse response = null;
HttpPut httpPut = new HttpPut(url);
if (GlobalCache.header != null) {
for (String key : GlobalCache.header.keySet()) {
String value = GlobalCache.header.get(key);
httpPut.setHeader(key, value);
}
}
//加入全局请求令牌权限
httpPut.setHeader("Http-Authorization", GlobalCache.paramMap.get("token"));
if (GlobalCache.header.get("Content-Type") != null) {
String contentType = GlobalCache.header.get("Content-Type");
if ("application/x-www-form-urlencoded".equals(contentType)) {
JSONObject jsonObject = JSONObject.parseObject(jsonParams);
List<NameValuePair> params = new ArrayList<>();
//循环json key value 仅能解决正常对象 若Json对象中嵌套数组 则可能需要单独处理
if (jsonObject != null) {
for (Map.Entry<String, Object> entry : jsonObject.entrySet()) {
params.add(new BasicNameValuePair(entry.getKey(), entry.getValue().toString()));
}
httpPut.setEntity(new UrlEncodedFormEntity(params, DEFAULT_ENCODING));
}
}
if ("application/json;charset=UTF-8".equals(contentType)) {
httpPut.setEntity(new StringEntity(jsonParams, ContentType.create("application/json", DEFAULT_ENCODING)));
}
} else {
log.error("请求头为空");
}
return baseRequest(httpClient, httpPut);
}
/**
* 采用绕过验证的方式处理https请求
*
* @param url
* @param reqMap
* @param encoding
* @return
*/
public static ResponeVo postSslUrl(String url, Map<String, Object> reqMap, String encoding) throws IOException,
KeyManagementException, NoSuchAlgorithmException {
String result;
CloseableHttpClient httpClient = null;
CloseableHttpResponse response = null;
ResponeVo responeVo = null;
// 添加参数
List<NameValuePair> params = buildParams(reqMap);
try {
//采用绕过验证的方式处理https请求
HostnameVerifier hostnameVerifier = (hostname, session) -> true;
SSLContext sslcontext = createIgnoreVerifySsl();
//设置协议http和https对应的处理socket链接工厂的对象
Registry<ConnectionSocketFactory> socketFactoryRegistry = RegistryBuilder.<ConnectionSocketFactory>create()
.register("http", PlainConnectionSocketFactory.INSTANCE)
.register("https", new SSLConnectionSocketFactory(sslcontext, hostnameVerifier))
.build();
PoolingHttpClientConnectionManager connManager = new PoolingHttpClientConnectionManager(socketFactoryRegistry);
//创建自定义的httpclient对象
httpClient = HttpClients.custom().setConnectionManager(connManager).build();
//创建post方式请求对象
HttpPost httpPost = new HttpPost(url);
httpPost.setEntity(new UrlEncodedFormEntity(params, encoding));
//指定报文头Content-type、User-Agent
httpPost.setHeader("Content-type", "application/x-www-form-urlencoded");
//执行请求操作,并拿到结果(同步阻塞)
responeVo = baseRequest(httpClient, httpPost);
} finally {
ExtendedIOUtils.closeQuietly(httpClient);
ExtendedIOUtils.closeQuietly(response);
}
return responeVo;
}
private static List<NameValuePair> buildParams(Map<String, Object> reqMap) {
List<NameValuePair> params = new ArrayList<>();
if (reqMap != null && reqMap.keySet().size() > 0) {
Iterator<Map.Entry<String, Object>> iter = reqMap.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry<String, Object> entity = iter.next();
params.add(new BasicNameValuePair(entity.getKey(), entity.getValue().toString()));
}
}
return params;
}
/**
* 创建一个SSL信任所有证书的httpClient对象
*
* @return
*/
public static CloseableHttpClient createSslInsecureClient() throws KeyStoreException, NoSuchAlgorithmException, KeyManagementException {
// 默认信任所有证书
HostnameVerifier hostnameVerifier = (hostname, session) -> true;
SSLContext sslContext = SSLContexts.custom().loadTrustMaterial(null, (TrustStrategy) (chain, authType) -> true).build();
SSLConnectionSocketFactory sslConnectionSocketFactory = new SSLConnectionSocketFactory(sslContext, hostnameVerifier);
return HttpClients.custom().setSSLSocketFactory(sslConnectionSocketFactory).build();
}
/**
* 绕过验证
*
* @return
* @throws NoSuchAlgorithmException
* @throws KeyManagementException
*/
public static SSLContext createIgnoreVerifySsl() throws NoSuchAlgorithmException, KeyManagementException {
SSLContext sc = SSLContext.getInstance("SSLv3");
// 实现一个X509TrustManager接口,用于绕过验证,不用修改里面的方法
X509TrustManager trustManager = new X509TrustManager() {
@Override
public void checkClientTrusted(java.security.cert.X509Certificate[] paramArrayOfX509Certificate, String paramString) {
}
@Override
public void checkServerTrusted(java.security.cert.X509Certificate[] paramArrayOfX509Certificate, String paramString) {
}
@Override
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return new java.security.cert.X509Certificate[]{};
}
};
sc.init(null, new TrustManager[]{trustManager}, new java.security.SecureRandom());
return sc;
}
private static String inputStreamToString(InputStream is) {
String line = "";
StringBuilder total = new StringBuilder();
// Wrap a BufferedReader around the InputStream
BufferedReader rd = new BufferedReader(new InputStreamReader(is));
try {
// Read response until the end
while ((line = rd.readLine()) != null) {
total.append(line);
}
} catch (IOException e) {
log.error(e.getLocalizedMessage(), e);
}
// Return full string
return total.toString();
}
public static ResponeVo baseRequest(CloseableHttpClient httpClient, HttpUriRequest request) {
ResponeVo responeVo = new ResponeVo();
CloseableHttpResponse response = null;
try {
String content;
response = httpClient.execute(request);
HttpEntity entity = response.getEntity();
InputStream inputStream = entity.getContent();
responeVo.setInputStream(inputStream);
content = inputStreamToString(inputStream);
responeVo.setCode(response.getStatusLine().getStatusCode());
responeVo.setContent(content);
responeVo.setResponse(response);
log.info("http调用完成,返回数据" + content);
} catch (Exception e) {
log.error(" http调用失败:" + e);
}
ExtendedIOUtils.closeQuietly(httpClient);
ExtendedIOUtils.closeQuietly(response);
return responeVo;
}
static byte[] inputStreamToByteArray(String filePath) throws IOException {
InputStream in = new FileInputStream(filePath);
byte[] data = toByteArray(in);
in.close();
return data;
}
static byte[] toByteArray(InputStream in) throws IOException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
byte[] buffer = new byte[1024 * 4];
int n = 0;
while ((n = in.read(buffer)) != -1) {
out.write(buffer, 0, n);
}
return out.toByteArray();
}
public static void inputStreamToFile(InputStream ins, File file) {
OutputStream os = null;
try {
os = new FileOutputStream(file);
int bytesRead = 0;
byte[] buffer = new byte[8192];
while ((bytesRead = ins.read(buffer, 0, 8192)) != -1) {
os.write(buffer, 0, bytesRead);
}
os.close();
ins.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
package com.yeejoin.amos.boot.module.app.api.common;
import lombok.Data;
/**
* @Author cpp
* @Description
* @Date 2023/4/23
*/
@Data
public class MobileLoginParam {
/**
* 注册类型:1-微信授权快捷登录;2-手机验证登录
*/
private int registerType;
/**
* 是否需要需要短信验证: true-验证; false-不验证
*/
private Boolean isNeedVerify;
/**
* 注册类型为1时使用:微信用户数据字段1,根据1、2进行数据解密,计算出手机号
*/
private String encryptedData;
/**
* 注册类型为1时使用:微信用户数据字段2,根据1、2进行数据解密,计算出手机号
*/
private String iv;
/**
*注册类型为1时使用:微信用户数据字段3,根据1、2、3进行数据解密,计算出手机号
*/
private String code;
/**
* 账号或手机号
*/
private String phoneNo;
/**
* 密码
*/
private String verifyCode;
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.app.api.common;
import java.math.BigDecimal;
import java.util.Collection;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* 字符串工具类
*
* @author as-youjun
*/
public class StringUtil {
private static Pattern NOT_ZERO_AT_THE_END = Pattern.compile("[1-9](\\d*[1-9])?");
private static Pattern numericPattern = Pattern.compile("-?[0-9]+\\.?[0-9]*");
private static Pattern NUMBER_PATTERN = Pattern.compile("-?[0-9]+(\\.[0-9]+)?");
/**
* 判断对象是否为空
*
* @param str
* @return
*/
public static boolean isNotEmpty(Object str) {
boolean flag = true;
if (str != null && !"".equals(str)) {
if (str.toString().length() > 0) {
flag = true;
}
} else {
flag = false;
}
return flag;
}
/***************************************************************************
* repeat - 通过源字符串重复生成N次组成新的字符串。
*
* @param src
* - 源字符串 例如: 空格(" "), 星号("*"), "浙江" 等等...
* @param num
* - 重复生成次数
* @return 返回已生成的重复字符串
* @version 1.0 (2006.10.10) Wilson Lin
**************************************************************************/
public static String repeat(String src, int num) {
StringBuffer s = new StringBuffer();
for (int i = 0; i < num; i++) {
s.append(src);
}
return s.toString();
}
/**
* 判断是否数字表示
*
* @param str 源字符串
* @return 是否数字的标志
*/
public static boolean isNumeric(String str) {
// 该正则表达式可以匹配所有的数字 包括负数
String bigStr;
try {
bigStr = new BigDecimal(str).toString();
} catch (Exception e) {
return false;//异常 说明包含非数字。
}
Matcher isNum = NUMBER_PATTERN.matcher(bigStr); // matcher是全匹配
if (!isNum.matches()) {
return false;
}
return true;
}
public static int toInt(String s) {
if (s != null && !"".equals(s.trim())) {
try {
return Integer.parseInt(s);
} catch (Exception e) {
return 0;
}
}
return 0;
}
public static boolean isEmpty(Collection collection) {
return collection == null || collection.isEmpty();
}
public static boolean isNotEmpty(Collection collection) {
return collection != null && collection.size() > 0;
}
public static boolean isEmpty(Map map) {
return map == null || map.isEmpty();
}
/**
* 截取前后都不是0的数字字符串
* <p>
* 12010102 => 12010102 12010100 => 120101 ab1201100b => 12011
*
* @param str
* @return
*/
public static String delEndZero(String str) {
Matcher mat = NOT_ZERO_AT_THE_END.matcher(str);
boolean rs = mat.find();
if (rs) {
return mat.group(0);
}
return null;
}
/**
* <pre>
* 移除字符串后面的0
* </pre>
*
* @param s
* @return
*/
public static String removeSufixZero(String s) {
if (s == null) {
return "";
}
while (s.endsWith("0")) {
if ("0".equals(s)) {
s = "";
break;
}
s = s.substring(0, s.length() - 1);
}
return s;
}
public static String transforCode(String code) {
if (code.endsWith("0000000")) {
code = code.substring(0, 1);
} else if (code.endsWith("000000")) {
code = code.substring(0, 2);
} else if (code.endsWith("0000")) {
code = code.substring(0, 4);
} else if (code.endsWith("00")) {
code = code.substring(0, 6);
}
return code;
}
}
package com.yeejoin.amos.boot.module.app.api.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 单位注册许可信息表
*
* @author system_generator
* @date 2022-08-09
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="BaseUnitLicenceDto", description="单位注册许可信息表")
public class BaseUnitLicenceDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "单位编码")
private String unitCode;
@ApiModelProperty(value = "单位名称")
private String unitName;
@ApiModelProperty(value = "许可地址")
private String licAddress;
@ApiModelProperty(value = "证书类型")
private String certType;
@ApiModelProperty(value = "证书类型code")
private String certTypeCode;
@ApiModelProperty(value = "证书编号")
private String certNo;
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "有效期至")
private Date expiryDate;
@ApiModelProperty(value = "发证日期")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date issueDate;
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "变更日期")
private Date changeDate;
@ApiModelProperty(value = "许可方式/许可状态")
private String applyType;
@ApiModelProperty(value = "许可方式/许可状态code")
private String applyTypeCode;
@ApiModelProperty(value = "许可评审方式")
private String appraisalType;
@ApiModelProperty(value = "许可评审方式code")
private String appraisalTypeCode;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "许可项目/检验类型/设备品种编码")
private String itemCode;
@ApiModelProperty(value = "许可项目/检验类型/设备品种")
private String itemCodeName;
@ApiModelProperty(value = "许可子项目/检验项目/充装介质类别code")
private String subItemCode;
@ApiModelProperty(value = "许可子项目/检验项目/充装介质类别")
private String subItemName;
@ApiModelProperty(value = "许可参数/充装介质名称")
private String parameter;
@ApiModelProperty(value = "许可参数/充装介质code")
private String parameterCode;
@ApiModelProperty(value = "固定检验地址")
private String itemAddress;
@ApiModelProperty(value = "发证机关")
private String approvedOrgan;
@ApiModelProperty(value = "发证机关code")
private String approvedOrganCode;
@ApiModelProperty(value = "是否同步自许可(1是 0否)")
private String isNotSync;
}
package com.yeejoin.amos.boot.module.app.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 cpp
* @date 2023-04-06 15:21:22
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="constructionInfo", description="最近施工信息")
public class ConstructionInfoModel extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "")
private String instanceId;
@ApiModelProperty(value = "")
private String status;
@ApiModelProperty(value = "施工类型")
private String constructionType;
@ApiModelProperty(value = "施工单位统一社会信用代码")
private String uscUnitCreditCode;
@ApiModelProperty(value = "施工单位")
private String uscUnitName;
@ApiModelProperty(value = "施工时间")
private Date uscDate;
@ApiModelProperty(value = "")
private String uscInformId;
}
package com.yeejoin.amos.boot.module.app.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 cpp
* @date 2023-04-06 15:21:22
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="designInfo", description="设计信息")
public class DesignInfoModel extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "")
private String supervisoryCode;
@ApiModelProperty(value = "")
private String instanceId;
@ApiModelProperty(value = "")
private String status;
@ApiModelProperty(value = "设计单位统一社会信用代码")
private String designUnitCreditCode;
@ApiModelProperty(value = "设计单位")
private String designUnitName;
@ApiModelProperty(value = "设计许可编号")
private String designLicenseNum;
@ApiModelProperty(value = "设计使用年限")
private String designUseDate;
@ApiModelProperty(value = "设计日期")
private Date designDate;
@ApiModelProperty(value = "总图图号")
private String drawingDo;
@ApiModelProperty(value = "设计附件")
private String designDoc;
@ApiModelProperty(value = "设计文件鉴定单位")
private String appraisalUnit;
@ApiModelProperty(value = "设计单位鉴定日期")
private String appraisalDate;
@ApiModelProperty(value = "设计规范")
private String designStandard;
}
package com.yeejoin.amos.boot.module.app.api.dto;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
/**
* @Author cpp
* @Description
* @Date 2023/6/5
*/
@Data
@Accessors(chain = true)
@Document(indexName = "idx_biz_view_jg_all", shards = 6, replicas = 2)
public class ESEquipmentCategoryDto {
@Id
private String SEQUENCE_NBR;
@Field(type = FieldType.Text)
private String ORG_BRANCH_NAME;
@Field(type = FieldType.Text)
private String ORG_BRANCH_CODE;
@Field(type = FieldType.Text)
private String USE_UNIT_NAME;
@Field(type = FieldType.Text)
private String USE_UNIT_CREDIT_CODE;
@Field(type = FieldType.Text)
private String EQU_LIST_CODE;
@Field(type = FieldType.Text)
private String EQU_LIST;
@Field(type = FieldType.Text)
private String EQU_CATEGORY;
@Field(type = FieldType.Text)
private String USE_ORG_CODE;
@Field(type = FieldType.Text)
private String CODE96333;
@Field(type = FieldType.Text)
private String EQU_CODE;
@Field(type = FieldType.Text)
private String SUPERVISORY_CODE;
@Field(type = FieldType.Text)
private String USE_PLACE;
@Field(type = FieldType.Text)
private String ADDRESS;
@Field(type = FieldType.Integer)
private Integer EQU_STATE;
@Field(type = FieldType.Text)
private String STATUS;
@Field(type = FieldType.Long)
private Long REC_DATE;
}
package com.yeejoin.amos.boot.module.app.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "ElevatorBaseInfoForWXModel", description = "")
public class ElevatorBaseInfoForWXModel {
@ApiModelProperty(value = "电梯识别码")
private String code96333;
@ApiModelProperty(value = "设备代码")
private String equCode;
@ApiModelProperty(value = "使用登记证编号")
private String useOrgCode;
@ApiModelProperty(value = "设备类别")
private String equCategory;
@ApiModelProperty(value = "制造单位名")
private String produceUnitName;
@ApiModelProperty(value = "出厂编号")
private String factoryNum;
@ApiModelProperty(value = "所属区域")
private String area;
@ApiModelProperty(value = "使用地址")
private String address;
@ApiModelProperty(value = "单位内编号")
private String intraUnitNumber;
}
package com.yeejoin.amos.boot.module.app.api.dto;
import lombok.Data;
@Data
public class EquEnterDto {
/**
* 设备id
*/
private String sequenceNbr;
/**
* 使用登记代码
*/
private String useOrgCode;
/**
* 设备类别
*/
private String equCategory;
/**
* 设备名称
*/
private String productName;
/**
* 设备位置
*/
private String address;
}
package com.yeejoin.amos.boot.module.app.api.dto;
import lombok.Data;
@Data
public class EquInfoDto {
/**
* 城市编码
*/
private String city;
/**
* 区县编码
*/
private String county;
/**
* 设备类别
*/
private String equipCategory;
/**
* 设备种类
*/
private String equipList;
/**
* record
*/
private String record;
/**
* 电梯96333识别码
*/
private String code;
/**
* 监管码
*/
private String supervisor;
/**
* 设备认领状态
*/
private String status;
/**
* 设备状态
*/
private String equState;
}
package com.yeejoin.amos.boot.module.app.api.dto;
import lombok.Data;
import java.util.List;
@Data
public class EquipExportDto {
String ORG_BRANCH_NAME;
String USE_UNIT_NAME;
String EQU_LIST;
String EQU_CATEGORY;
String USE_ORG_CODE;
String CODE96333;
String SUPERVISORY_CODE;
String USE_PLACE;
String EQU_STATE;
String STATUS;
String USE_UNIT_CREDIT_CODE;
String ORG_BRANCH_CODE;
String EQU_CODE;
String EQU_LIST_CODE;
List<String> ids;
String tableName;
}
package com.yeejoin.amos.boot.module.app.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.math.BigDecimal;
/**
* 安全追溯-锅炉
*
* @author cpp
* @date 2023-04-06 15:21:22
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="paramBoiler", description="锅炉技术参数")
public class EquipTechParamBoilerModel extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "")
private String instanceId;
@ApiModelProperty(value = "")
private String status;
@ApiModelProperty(value = "设备等级")
private String deviceLevel;
@ApiModelProperty(value = "额定蒸发量(热功率)")
private BigDecimal ratedEvaporationCapacityThermalPower;
@ApiModelProperty(value = "额定工作压力")
private BigDecimal ratedWorkingPressure;
@ApiModelProperty(value = "额定工作温度")
private BigDecimal ratedOperatingTemperature;
@ApiModelProperty(value = "设计热效率")
private BigDecimal designThermalEfficiency;
@ApiModelProperty(value = "给水温度")
private BigDecimal feedwaterTemperature;
@ApiModelProperty(value = "额定出/回水(油)温度")
private BigDecimal ratedOutletReturnWaterOilTemperature;
@ApiModelProperty(value = "锅炉本体水(油)容积")
private BigDecimal waterOilVolumeOfBoilerProper;
@ApiModelProperty(value = "整装锅炉本体液压试验介质/压力")
private BigDecimal hydraulicTestMediumPressureOfPackagedBoilerBody;
@ApiModelProperty(value = "再热器进(出)口温度")
private BigDecimal inletOutletTemperatureOfReheater;
@ApiModelProperty(value = "再热器进(出)口压力")
private BigDecimal reheaterInletOutletPressure;
@ApiModelProperty(value = "再热蒸汽流量")
private BigDecimal reheatSteamFlow;
@ApiModelProperty(value = "燃料(热源)种类")
private String fuelType;
@ApiModelProperty(value = "受压部件名称")
private String nameOfPressureParts;
@ApiModelProperty(value = "受压部件材料")
private String materialOfPressureParts;
@ApiModelProperty(value = "受压部件壁厚")
private BigDecimal wallThicknessOfPressureParts;
@ApiModelProperty(value = "受压部件无损检测方法")
private String nonDestructiveTestingMethodsForPressureParts;
@ApiModelProperty(value = "受压部件无损检测比例")
private BigDecimal proportionOfNdtForPressureParts;
@ApiModelProperty(value = "受压部件热处理温度")
private BigDecimal heatTreatmentTemperatureOfPressureParts;
@ApiModelProperty(value = "受压部件热处理时间")
private BigDecimal heatTreatmentTimeOfPressureParts;
@ApiModelProperty(value = "受压部件水(耐)压试验介质")
private String hydrostaticTestMedium;
@ApiModelProperty(value = "受压部件水(耐)压试验压力")
private BigDecimal hydrostaticTestPressure;
@ApiModelProperty(value = "燃烧方式")
private String combustionMode;
@ApiModelProperty(value = "有机热载体锅炉气密试验介质/压力")
private BigDecimal glAirtightTest;
@ApiModelProperty(value = "安装附件与有关装置")
private String safetyAccessoriesAndRelatedDevices;
}
package com.yeejoin.amos.boot.module.app.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.math.BigDecimal;
/**
* 安全追溯-电梯
*
* @author cpp
* @date 2023-04-06 15:21:22
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="paramElevator", description="电梯技术参数")
public class EquipTechParamElevatorModel extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "")
private String instanceId;
@ApiModelProperty(value = "")
private String status;
@ApiModelProperty(value = "额定速度(上行)")
private BigDecimal ratedSpeedUp;
@ApiModelProperty(value = "额定速度(下行)")
private BigDecimal ratedSpeedDown;
@ApiModelProperty(value = "额定载重量")
private BigDecimal ratedLoadCapacity;
@ApiModelProperty(value = "轿厢尺寸")
private BigDecimal carSize;
@ApiModelProperty(value = "提升高度")
private BigDecimal liftingHeight;
@ApiModelProperty(value = "层")
private Integer storey;
@ApiModelProperty(value = "站")
private Integer stand;
@ApiModelProperty(value = "门数")
private Integer numberDoors;
@ApiModelProperty(value = "控制方式")
private String controlMode;
@ApiModelProperty(value = "油缸数量")
private Integer numberCylinders;
@ApiModelProperty(value = "顶升型式")
private String jackingType;
@ApiModelProperty(value = "额定压力")
private BigDecimal ratedPressure;
@ApiModelProperty(value = "防爆型式")
private String explosionproofType;
@ApiModelProperty(value = "防爆等级")
private String explosionproofGrade;
@ApiModelProperty(value = "燃爆物质")
private String explosiveSubstance;
@ApiModelProperty(value = "整机防爆标志")
private String explosionproofSignComplete;
@ApiModelProperty(value = "驱动主机额定功率")
private BigDecimal qdzjRatedPower;
@ApiModelProperty(value = "驱动主机额定转速")
private BigDecimal qdzjRatedSpeed;
@ApiModelProperty(value = "驱动主机减速比")
private BigDecimal qdzjReductionRatio;
@ApiModelProperty(value = "液压泵站满载工作压力")
private BigDecimal yabzFullloadPressure;
@ApiModelProperty(value = "悬挂系统悬挂介质种类")
private String xgxlMediaType;
@ApiModelProperty(value = "悬挂系统悬挂介质数量")
private Integer xgxlMediaNumber;
@ApiModelProperty(value = "悬挂系统悬挂介质型号")
private String xgxlMediaModel;
@ApiModelProperty(value = "悬挂系统悬挂介质规格")
private String xgxlMediaSpecification;
@ApiModelProperty(value = "驱动主机型号")
private String qdzjModel;
@ApiModelProperty(value = "驱动主机产品编号")
private String qdzjProductNo;
@ApiModelProperty(value = "驱动主机制造单位")
private String qdzjManufacturer;
@ApiModelProperty(value = "控制柜型号")
private String kzgModel;
@ApiModelProperty(value = "控制柜产品编号")
private String kzgProductNo;
@ApiModelProperty(value = "控制柜制造单位")
private String kzgManufacturer;
@ApiModelProperty(value = "限速器型号")
private String xsqModel;
@ApiModelProperty(value = "限速器产品编号")
private String xsqProductNo;
@ApiModelProperty(value = "限速器制造单位")
private String xsqManufacturer;
@ApiModelProperty(value = "安全钳型号")
private String aqqModel;
@ApiModelProperty(value = "安全钳产品编号")
private String aqqProductNo;
@ApiModelProperty(value = "安全钳制造单位")
private String aqqManufacturer;
@ApiModelProperty(value = "轿厢缓冲器型号")
private String jxhcqModel;
@ApiModelProperty(value = "轿厢缓冲器产品编号")
private String jxhcqProductNo;
@ApiModelProperty(value = "轿厢缓冲器制造单位")
private String jxhcqManufacturer;
@ApiModelProperty(value = "对重缓冲器型号")
private String dchcqModel;
@ApiModelProperty(value = "对重缓冲器产品编号")
private String dchcqProductNo;
@ApiModelProperty(value = "对重缓冲器制造单位")
private String dchcqManufacturer;
@ApiModelProperty(value = "层门门锁装置型号")
private String cmmszzModel;
@ApiModelProperty(value = "层门门锁装置产品编号")
private String cmmszzProductNo;
@ApiModelProperty(value = "层门门锁装置制造单位")
private String cmmszzManufacturer;
@ApiModelProperty(value = "轿门门锁装置型号")
private String jmmszzModel;
@ApiModelProperty(value = "轿门门锁装置产品编号")
private String jmmszzProductNo;
@ApiModelProperty(value = "轿门门锁装置制造单位")
private String jmmszzManufacturer;
@ApiModelProperty(value = "上行超速保护装置型号")
private String sxcsbhzzModel;
@ApiModelProperty(value = "上行超速保护装置产品编号")
private String sxcsbhzzProductNo;
@ApiModelProperty(value = "上行超速保护装置制造单位")
private String sxcsbhzzManufacturer;
@ApiModelProperty(value = "轿厢意外移动保护装置型号")
private String jxywydbhzzModel;
@ApiModelProperty(value = "轿厢意外移动保护装置")
private String jxywydbhzzProductNo;
@ApiModelProperty(value = "轿厢意外移动保护装置制造单位")
private String jxywydbhzzManufacturer;
@ApiModelProperty(value = "液压泵站型号")
private String yybzModel;
@ApiModelProperty(value = "液压泵站产品编号")
private String yybzProductNo;
@ApiModelProperty(value = "液压泵站制造单位")
private String yybzManufacturer;
@ApiModelProperty(value = "限速切断阀型号")
private String xsqdfModel;
@ApiModelProperty(value = "限速切断阀产品编号")
private String xsqdfProductNo;
@ApiModelProperty(value = "限速切断阀制造单位")
private String xsqdfManufacturer;
@ApiModelProperty(value = "名义速度")
private BigDecimal nominalSpeed;
@ApiModelProperty(value = "倾斜角")
private BigDecimal angleRoll;
@ApiModelProperty(value = "名义宽度")
private BigDecimal nominalWidth;
@ApiModelProperty(value = "使用区段长度")
private BigDecimal useSectionLength;
@ApiModelProperty(value = "输送能力")
private String conveyingCapacity;
@ApiModelProperty(value = "工作类型")
private String workType;
@ApiModelProperty(value = "工作环境")
private String workEnvironment;
@ApiModelProperty(value = "控制柜节能运行方式")
private String kzgOperationMode;
}
package com.yeejoin.amos.boot.module.app.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.math.BigDecimal;
/**
* 安全追溯-起重机械
*
* @author cpp
* @date 2023-04-06 15:21:22
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="MidEquipTechParamLiftingDto", description="安全追溯-起重机械Dto")
public class EquipTechParamLiftingModel extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "")
private String instanceId;
@ApiModelProperty(value = "")
private String status;
@ApiModelProperty(value = "额定起重量")
private BigDecimal ratedLiftingCapacity;
@ApiModelProperty(value = "最大起重量")
private BigDecimal maxLiftingCapacity;
@ApiModelProperty(value = "最大起重力矩")
private BigDecimal maxLiftingTorque;
@ApiModelProperty(value = "跨度(工作幅度)")
private BigDecimal spanWorkingRange;
@ApiModelProperty(value = "起升速度")
private BigDecimal liftingSpeed;
@ApiModelProperty(value = "起升高度")
private BigDecimal liftingHeight;
@ApiModelProperty(value = "下降速度")
private BigDecimal descentSpeed;
@ApiModelProperty(value = "变幅高度")
private BigDecimal luffingHeight;
@ApiModelProperty(value = "回转速度")
private BigDecimal slewingSpeed;
@ApiModelProperty(value = "高度")
private BigDecimal height;
@ApiModelProperty(value = "工作级别")
private String workLevel;
@ApiModelProperty(value = "额定起重力矩")
private BigDecimal ratedLiftingTorque;
@ApiModelProperty(value = "最大起升高度")
private BigDecimal maxiLiftingHeight;
@ApiModelProperty(value = "最大工作幅度")
private BigDecimal maxWorkRange;
@ApiModelProperty(value = "最大工作幅度对应的起重量")
private BigDecimal maxWokRangeWeight;
@ApiModelProperty(value = "最大附着高度")
private BigDecimal maxAttachmentHeight;
@ApiModelProperty(value = "最大计算轮压")
private BigDecimal maxCalculatedPressure;
@ApiModelProperty(value = "整机设计重量")
private BigDecimal machineDesignWeight;
@ApiModelProperty(value = "运行轨距")
private BigDecimal runGauge;
@ApiModelProperty(value = "整机功率")
private BigDecimal overallPower;
@ApiModelProperty(value = "供电电源")
private BigDecimal powerSupply;
@ApiModelProperty(value = "工作环境温度")
private BigDecimal workAmbientTemperature;
@ApiModelProperty(value = "层数/泊位数")
private Integer numberStorey;
@ApiModelProperty(value = "主体结构型式")
private String mainStructureType;
@ApiModelProperty(value = "主要受力结构件材料")
private String mainStressedStructuralMaterial;
@ApiModelProperty(value = "变幅方式")
private String luffingMode;
@ApiModelProperty(value = "塔身标准节型式")
private String towerStandardType;
@ApiModelProperty(value = "基座型式")
private String baseType;
@ApiModelProperty(value = "大车运行速度")
private BigDecimal bigcarRunSpeed;
@ApiModelProperty(value = "小车运行速度")
private BigDecimal smallcarrunSpeed;
@ApiModelProperty(value = "大车基距")
private BigDecimal bigcarBaseDistance;
@ApiModelProperty(value = "小车轨距")
private BigDecimal smallcarBaseDistance;
@ApiModelProperty(value = "主钩左右极限位置")
private BigDecimal mainHookLeftAndRightLimitPositions;
@ApiModelProperty(value = "主梁型式")
private String mainBeamType;
@ApiModelProperty(value = "支腿型式")
private String outriggerType;
@ApiModelProperty(value = "最小工作幅度")
private BigDecimal minWorkRange;
@ApiModelProperty(value = "最小幅度起重量")
private BigDecimal minLiftingCapacity;
@ApiModelProperty(value = "全程变幅时间")
private BigDecimal fullRangeLuffingTime;
@ApiModelProperty(value = "行走机械轨距")
private BigDecimal travelMachineGauge;
@ApiModelProperty(value = "行驶速度")
private BigDecimal travelSpeed;
@ApiModelProperty(value = "支腿调节长度")
private BigDecimal legAdjustmentLength;
@ApiModelProperty(value = "发动机型号/VIN代号/编号")
private String engineModel;
@ApiModelProperty(value = "臂架型式")
private String boomType;
@ApiModelProperty(value = "起升高度(轨上)")
private BigDecimal liftingHeightOnRail;
@ApiModelProperty(value = "起升高度(轨下)")
private BigDecimal liftingHeightUnderRail;
@ApiModelProperty(value = "整机最大高度")
private BigDecimal machineMaxHeight;
@ApiModelProperty(value = "用途")
private String use;
@ApiModelProperty(value = "臂架结构型式")
private String boomStructureType;
@ApiModelProperty(value = "门架结构型式")
private String gantryStructureType;
@ApiModelProperty(value = "额定载重量")
private BigDecimal ratedLoadCapacity;
@ApiModelProperty(value = "额定成员数")
private Integer ratedMembers;
@ApiModelProperty(value = "额定提升速度")
private BigDecimal ratedLiftingSpeed;
@ApiModelProperty(value = "自由端高度")
private BigDecimal heightFreeEnd;
@ApiModelProperty(value = "最大提升高度")
private BigDecimal maximumLiftingHeight;
@ApiModelProperty(value = "吊笼工作行程")
private BigDecimal workStrokeCage;
@ApiModelProperty(value = "吊笼尺寸(长×宽×高)")
private BigDecimal cageSize;
@ApiModelProperty(value = "标准节尺寸(长×宽×高)")
private BigDecimal standardSectionSize;
@ApiModelProperty(value = "操纵方式")
private String controlMode;
@ApiModelProperty(value = "驱动机构型式")
private String driveMechanismType;
@ApiModelProperty(value = "标准节加节方式")
private String standardSectionAddMethod;
@ApiModelProperty(value = "存容量")
private Integer storageCapacity;
@ApiModelProperty(value = "起升驱动方式")
private String liftingDriveMode;
@ApiModelProperty(value = "适停车辆尺寸 (长×宽×高)")
private BigDecimal parkingVehicleSize;
@ApiModelProperty(value = "额定升降速度")
private BigDecimal ratedLiftSpeed;
@ApiModelProperty(value = "额定横移速度")
private BigDecimal ratedTraverseSpeed;
@ApiModelProperty(value = "额定纵移速度")
private BigDecimal ratedLongitudinalSpeed;
@ApiModelProperty(value = "单车最大进(出)车时间")
private BigDecimal bicycleMaxExitTime;
@ApiModelProperty(value = "循环速度")
private BigDecimal cycleSpeed;
@ApiModelProperty(value = "适停车辆质量")
private BigDecimal parkingVehicleMass;
@ApiModelProperty(value = "层高")
private BigDecimal storeyHeight;
@ApiModelProperty(value = "操作方式")
private String operationMode;
@ApiModelProperty(value = "其 他")
private String other;
@ApiModelProperty(value = "起升方式")
private String liftingMode;
@ApiModelProperty(value = "最大轮压")
private BigDecimal maxPressure;
@ApiModelProperty(value = "下降深度")
private BigDecimal depthDescent;
@ApiModelProperty(value = "防爆等级")
private String explosionProofGrade;
@ApiModelProperty(value = "防爆型式")
private String explosionProofType;
@ApiModelProperty(value = "吊具型式")
private String slingType;
@ApiModelProperty(value = "主要受力机构件材料")
private String mainStressedMechanism;
@ApiModelProperty(value = "起升机构起升速度倍率")
private BigDecimal hoistLiftingMechanismSpeed;
@ApiModelProperty(value = "起升机构起升速度")
private BigDecimal hoistLiftingSpeedLifting;
@ApiModelProperty(value = "起升机构起升速度相应最大起重量")
private BigDecimal hoistLiftingCorrespondingMaxWeight;
@ApiModelProperty(value = "起升机构电机型号")
private String hoistMotorModel;
@ApiModelProperty(value = "起升机构电机数量")
private Integer hoistMotorsNumber;
@ApiModelProperty(value = "起升机构功率")
private BigDecimal hoistPower;
@ApiModelProperty(value = "起升机构制动器型号")
private String hoistBrakeModel;
@ApiModelProperty(value = "起升机构制动器数量")
private Integer hoistBrakesBrakes;
@ApiModelProperty(value = "起升机构工作级别")
private String hoistWorkingLevel;
@ApiModelProperty(value = "起升机构卷筒直径")
private BigDecimal hoistDrumDiameter;
@ApiModelProperty(value = "起升机构定滑轮直径")
private BigDecimal hoistFixedPulleyDiameter;
@ApiModelProperty(value = "起升机构传动比")
private String hoistTransmissionRatio;
@ApiModelProperty(value = "起升机构大车轮直径")
private BigDecimal hoistBigcarDiameter;
@ApiModelProperty(value = "起升机构小车轮直径")
private BigDecimal hoistSmallcarDiameter;
@ApiModelProperty(value = "大车行走机构速度")
private BigDecimal bigcarTraveSpeed;
@ApiModelProperty(value = "大车行走机构功率")
private BigDecimal bigcarTravePower;
@ApiModelProperty(value = "大车行走机构工作级别")
private String bigcarTraveWorkingLevel;
@ApiModelProperty(value = "大车行走机构减速器型号")
private String bigcarTraveReducerModel;
@ApiModelProperty(value = "大车行走机构传动比")
private String bigcarTraveTransmissionRatio;
@ApiModelProperty(value = "大车行走机构制动力矩")
private BigDecimal bigcarTraveBrakTorque;
@ApiModelProperty(value = "大车行走机构大车车轮路面直径")
private BigDecimal bigcarTraveRoadDiameter;
@ApiModelProperty(value = "大车行走机构适应轨道")
private String bigTraveAdaptTrack;
@ApiModelProperty(value = "大车行走机构电机型号")
private String bigcarTraveMotorModel;
@ApiModelProperty(value = "大车行走机构电机数量")
private Integer bigcarTraveMotorQuantity;
@ApiModelProperty(value = "大车行走机构制动器型号")
private String bigcarTraveControlBrakeModel;
@ApiModelProperty(value = "大车行走机构制动器数量")
private Integer bigcarTraveBrakeNumber;
@ApiModelProperty(value = "小车行走机构速度")
private BigDecimal smallcarTraveSpeed;
@ApiModelProperty(value = "小车行走机构功率")
private BigDecimal smallcarTravePower;
@ApiModelProperty(value = "小车行走机构转速")
private BigDecimal smallcarTraveRevolveSpeed;
@ApiModelProperty(value = "小车行走机构工作级别")
private String smallcarTraveWorkingLevel;
@ApiModelProperty(value = "小车行走机构减速器型号")
private String smallcarTraveReducerModel;
@ApiModelProperty(value = "小车行走机构传动比")
private String smallcarTraveTransmissionRatio;
@ApiModelProperty(value = "小车行走机构制动力矩")
private BigDecimal smallcarTraveBrakTorque;
@ApiModelProperty(value = "小车行走机构小车车轮路面直径")
private BigDecimal smallcarTraveRoadDiameter;
@ApiModelProperty(value = "小车行走机构小车轨道")
private String smallcarTraveTrolleyTrack;
@ApiModelProperty(value = "小车行走机构电机型号")
private String smallcarTraveMotorModel;
@ApiModelProperty(value = "小车行走机构电机数量")
private Integer smallcarTraveMotorQuantity;
@ApiModelProperty(value = "小车行走机构制动器型号")
private String smallcarTraveControlBrakeModel;
@ApiModelProperty(value = "小车行走机构制动器数量")
private Integer smallcarTraveBrakeNumber;
@ApiModelProperty(value = "电源电压")
private BigDecimal supplyVoltage;
@ApiModelProperty(value = "电源频率")
private BigDecimal powerFrequency;
@ApiModelProperty(value = "非工作风压")
private BigDecimal noWorkWindPresssure;
@ApiModelProperty(value = "工作风压")
private BigDecimal workWindPresssure;
@ApiModelProperty(value = "环境温度")
private BigDecimal ambientTemperature;
@ApiModelProperty(value = "吊钩部位辐射温度")
private BigDecimal radiationTemperatureOfHook;
@ApiModelProperty(value = "梁架跨度")
private BigDecimal beamFrameSpan;
@ApiModelProperty(value = "桥机跨度")
private BigDecimal bridgeCraneSpan;
@ApiModelProperty(value = "最大架设纵坡")
private BigDecimal maxErectionLongitudinalSlope;
@ApiModelProperty(value = "前支腿调节长度")
private BigDecimal adjustableLengthOfFrontOutrigger;
@ApiModelProperty(value = "最大架设横坡")
private BigDecimal maxErectionCrossSlope;
@ApiModelProperty(value = "整机高度")
private BigDecimal overallHeight;
@ApiModelProperty(value = "整机宽度")
private BigDecimal overallWidth;
@ApiModelProperty(value = "整机总功率")
private BigDecimal overallUnitPower;
@ApiModelProperty(value = "小车纵移速度")
private BigDecimal smallcarLongitudinalMovingSpeed;
@ApiModelProperty(value = "过孔速度")
private BigDecimal throughHoleVelocity;
@ApiModelProperty(value = "整机横移速度")
private BigDecimal overallTraverseSpeed;
@ApiModelProperty(value = "小车横移速度")
private BigDecimal smallcarTraverseSpeed;
@ApiModelProperty(value = "整机长度")
private BigDecimal overallLength;
@ApiModelProperty(value = "前导梁长度")
private BigDecimal lengthOfFrontGuideBeam;
@ApiModelProperty(value = "起升机构减速器型号")
private String hoistReducerModel;
@ApiModelProperty(value = "大车行走适应轨道")
private String bigcarTraveAdaptationTrack;
@ApiModelProperty(value = "大车行走制动器型号")
private String bigcarTraveBrakeModel;
@ApiModelProperty(value = "小车行走机构小车车轮踏面直径")
private BigDecimal smallcarTraveSmallTreadDiameter;
@ApiModelProperty(value = "小车行走机构制动器型号")
private String smallcarTraveBrakeModel;
@ApiModelProperty(value = "小车横移机构速度")
private BigDecimal smallcarSideswaySpeed;
@ApiModelProperty(value = "小车横移机构功率")
private BigDecimal smallcarSideswayPower;
@ApiModelProperty(value = "小车横移机构转速")
private BigDecimal smallcarSideswayRevolveSpeed;
@ApiModelProperty(value = "小车横移机构工作级别")
private String smallcarSideswayWorkingLevel;
@ApiModelProperty(value = "小车横移机构减速器型号")
private String smallcarSideswayReducerModel;
@ApiModelProperty(value = "小车横移机构传动比")
private String smallcarSideswayTransmissionRatio;
@ApiModelProperty(value = "小车横移机构小车横移轨道")
private String smallcarSideswaySmallTraverseTrack;
@ApiModelProperty(value = "小车横移机构制动器型号")
private String smallcarSideswayBrakeModel;
@ApiModelProperty(value = "小车横移机构制动力矩")
private BigDecimal smallcarSideswayBrakTorque;
@ApiModelProperty(value = "小车横移机构小车横移车轮踏面直径")
private BigDecimal smallcarSideswayTreadDiameter;
@ApiModelProperty(value = "小车横移机构电机型号")
private String smallcarSideswayMotorQuantity;
@ApiModelProperty(value = "小车横移机构电机数量")
private Integer smallcarSideswayMotorNumber;
@ApiModelProperty(value = "悬臂长度")
private BigDecimal cantileverLength;
@ApiModelProperty(value = "使用场所")
private String placeUse;
@ApiModelProperty(value = "变幅速度")
private BigDecimal derrickingSpeed;
@ApiModelProperty(value = "最大幅度起重量")
private BigDecimal maximumLiftingCapacity;
@ApiModelProperty(value = "导轨架")
private String guideRailFrame;
@ApiModelProperty(value = "层数")
private Integer numberOfPlies;
@ApiModelProperty(value = "整机重量")
private BigDecimal operatingWeight;
@ApiModelProperty(value = "起升机构制动力矩")
private BigDecimal hoistBrakingTorque;
@ApiModelProperty(value = "起升机构钢丝绳型号")
private String hoistWireRope;
@ApiModelProperty(value = "吊笼数量")
private String hangingCagesNumber;
@ApiModelProperty(value = "安全保护装置")
private String safetyProtectionDevice;
@ApiModelProperty(value = "主要零部件")
private String mainPart;
}
package com.yeejoin.amos.boot.module.app.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.math.BigDecimal;
/**
* 安全追溯-压力管道
*
* @author cpp
* @date 2023-04-06 15:21:22
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="paramPipeline", description="压力管道技术参数")
public class EquipTechParamPipelineModel extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "")
private String instanceId;
@ApiModelProperty(value = "")
private String status;
@ApiModelProperty(value = "工程(装置)名称")
private String deviceName;
@ApiModelProperty(value = "管道类别")
private String pipelineClass;
@ApiModelProperty(value = "管道名称(登记单元)")
private String pipeName;
@ApiModelProperty(value = "管道编号")
private String pipelineNumber;
@ApiModelProperty(value = "设备级别")
private String deviceLevel;
@ApiModelProperty(value = "设计标准")
private String designStandard;
@ApiModelProperty(value = "管道图号")
private String pipeDrawNumber;
@ApiModelProperty(value = "公称直径")
private BigDecimal nominalDiameter;
@ApiModelProperty(value = "公称壁厚")
private BigDecimal wallThickness;
@ApiModelProperty(value = "管道长度")
private BigDecimal pipeLength;
@ApiModelProperty(value = "起始位置起点")
private String startePosition;
@ApiModelProperty(value = "压力")
private BigDecimal pressure;
@ApiModelProperty(value = "温度")
private BigDecimal temperature;
@ApiModelProperty(value = "介质")
private String medium;
@ApiModelProperty(value = "备注")
private String remarks;
@ApiModelProperty(value = "管道信息")
private String pipeInfo;
}
package com.yeejoin.amos.boot.module.app.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.math.BigDecimal;
/**
* 安全追溯-游乐设施
*
* @author cpp
* @date 2023-04-06 15:21:22
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="paramRides", description="游乐设施技术参数")
public class EquipTechParamRidesModel extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "")
private String instanceId;
@ApiModelProperty(value = "")
private String status;
@ApiModelProperty(value = "设计寿命")
private Integer designLife;
@ApiModelProperty(value = "滑道长度")
private BigDecimal slideLength;
@ApiModelProperty(value = "滑道高度")
private BigDecimal slideHeight;
@ApiModelProperty(value = "滑道最小坡度")
private BigDecimal minimumSlopeOfSlide;
@ApiModelProperty(value = "滑道平均坡度")
private BigDecimal averageSlopeOfSlide;
@ApiModelProperty(value = "滑道无跳跃段最大坡度")
private BigDecimal maximumSlopeOfTheSlideWithoutJumping;
@ApiModelProperty(value = "滑道最小曲率半径")
private BigDecimal minimumRadiusOfCurvatureOfSlideway;
@ApiModelProperty(value = "滑道数量")
private Integer numberOfSlides;
@ApiModelProperty(value = "滑道主体材料")
private String mainMaterialOfSlide;
@ApiModelProperty(value = "滑车数量")
private Integer numberOfPulleys;
@ApiModelProperty(value = "乘坐人数")
private Integer numberOfPassengers;
@ApiModelProperty(value = "水平距离")
private BigDecimal horizontalDistance;
@ApiModelProperty(value = "高度")
private BigDecimal height;
@ApiModelProperty(value = "下滑速度")
private BigDecimal glideSpeed;
@ApiModelProperty(value = "乘员数")
private Integer countOfPassengers;
@ApiModelProperty(value = "运行速度")
private BigDecimal runningSpeed;
@ApiModelProperty(value = "车辆数")
private Integer numberOfVehicles;
@ApiModelProperty(value = "功率")
private BigDecimal power;
@ApiModelProperty(value = "轨道高度")
private BigDecimal trackHeight;
@ApiModelProperty(value = "成员数")
private Integer numberOfMembers;
@ApiModelProperty(value = "运行高度")
private BigDecimal operatingHeight;
@ApiModelProperty(value = "驱动功率")
private BigDecimal drivePower;
@ApiModelProperty(value = "回转直径")
private BigDecimal rotaryDiameter;
@ApiModelProperty(value = "额定乘客数")
private Integer ratedNumberOfPassengers;
@ApiModelProperty(value = "吊舱数量")
private Integer numberOfPods;
@ApiModelProperty(value = "设备高度")
private BigDecimal equipmentHeight;
@ApiModelProperty(value = "额定线速度")
private BigDecimal ratedLinearSpeed;
@ApiModelProperty(value = "转盘转速")
private BigDecimal rotaryTableSpeed;
@ApiModelProperty(value = "单边摆角")
private BigDecimal unilateralSwingAngle;
@ApiModelProperty(value = "座舱数量")
private Integer numberOfCabins;
@ApiModelProperty(value = "最大运行高度")
private BigDecimal maximumOperatingHeight;
@ApiModelProperty(value = "旋转直径")
private BigDecimal rotationDiameter;
@ApiModelProperty(value = "最大转速")
private BigDecimal maximumSpeed;
@ApiModelProperty(value = "倾角")
private BigDecimal dip;
@ApiModelProperty(value = "回转速度")
private BigDecimal slewingSpeed;
@ApiModelProperty(value = "升降速度")
private BigDecimal liftingSpeed;
@ApiModelProperty(value = "高差")
private BigDecimal heightDifference;
@ApiModelProperty(value = "主索直径")
private BigDecimal mainCableDiameter;
@ApiModelProperty(value = "弦倾角")
private BigDecimal angleOfChord;
@ApiModelProperty(value = "乘客人数")
private Integer passengerNum;
@ApiModelProperty(value = "弹跳高度")
private BigDecimal bounceHeight;
@ApiModelProperty(value = "最大载重")
private BigDecimal maximumLoad;
@ApiModelProperty(value = "设备功率")
private BigDecimal equipmentPower;
@ApiModelProperty(value = "占地面积")
private BigDecimal floorArea;
@ApiModelProperty(value = "升空高度")
private BigDecimal liftoffAltitude;
@ApiModelProperty(value = "场地直径")
private BigDecimal fieldDiameter;
@ApiModelProperty(value = "球体直径")
private BigDecimal sphereDiameter;
@ApiModelProperty(value = "球体体积")
private BigDecimal sphereVolume;
@ApiModelProperty(value = "操作人数")
private Integer operatorNumber;
}
package com.yeejoin.amos.boot.module.app.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.math.BigDecimal;
/**
* 安全追溯-索道
*
* @author cpp
* @date 2023-04-06 15:21:22
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="paramRopeway", description="索道技术参数")
public class EquipTechParamRopewayModel extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "")
private String instanceId;
@ApiModelProperty(value = "")
private String status;
@ApiModelProperty(value = "")
private BigDecimal horizontalDistance;
@ApiModelProperty(value = "支架数目")
private Integer supportsCount;
@ApiModelProperty(value = "斜长")
private BigDecimal obliqueLength;
@ApiModelProperty(value = "主电机型号和功率")
private BigDecimal mainMotorModelAndPower;
@ApiModelProperty(value = "高差")
private BigDecimal altitudeDifference;
@ApiModelProperty(value = "张紧油压(重锤)")
private BigDecimal oilPressureHeavyHammer;
@ApiModelProperty(value = "张紧油压(油压)")
private BigDecimal oilPressureOilPressure;
@ApiModelProperty(value = "运量")
private BigDecimal freightVolume;
@ApiModelProperty(value = "运载索")
private String carrierLine;
@ApiModelProperty(value = "速度")
private BigDecimal speed;
@ApiModelProperty(value = "承载索")
private String bearingCable;
@ApiModelProperty(value = "索距")
private BigDecimal cablePitch;
@ApiModelProperty(value = "运载工具数量和类型")
private String numberAndTypeOfVehicles;
@ApiModelProperty(value = "索引索")
private String tractionRope;
@ApiModelProperty(value = "平衡索")
private String balanceCable;
@ApiModelProperty(value = "主要部件")
private String mainComponents;
}
package com.yeejoin.amos.boot.module.app.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.math.BigDecimal;
/**
* 安全追溯-场内车辆
*
* @author cpp
* @date 2023-04-06 15:21:21
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="paramVehicle", description="场内车辆技术参数")
public class EquipTechParamVehicleModel extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "")
private String instanceId;
@ApiModelProperty(value = "")
private String status;
@ApiModelProperty(value = "车架编号")
private String frameNo;
@ApiModelProperty(value = "发动机(行走电机)编号")
private String engineNo;
@ApiModelProperty(value = "动力方式")
private String powerMode;
@ApiModelProperty(value = "传动方式")
private String transmissionMode;
@ApiModelProperty(value = "车架结构")
private String frameStructure;
@ApiModelProperty(value = "驾驶方式")
private String drivingMode;
@ApiModelProperty(value = "自重")
private BigDecimal weight;
@ApiModelProperty(value = "空载最大运行速度")
private BigDecimal carryingIdlerMaxRunningSpeed;
@ApiModelProperty(value = "空载最大起升速度")
private BigDecimal maxLiftingSpeed;
@ApiModelProperty(value = "设备保护等级(防爆)")
private String protectGrade;
@ApiModelProperty(value = "气体/粉尘组别(防爆)")
private String gasGroup;
@ApiModelProperty(value = "温度组别(防爆)")
private String temperatureGroup;
@ApiModelProperty(value = "额定起重量")
private BigDecimal liftingCapacity;
@ApiModelProperty(value = "系统电压")
private BigDecimal systemVoltage;
@ApiModelProperty(value = "载荷中心距")
private BigDecimal loadCenterDistance;
@ApiModelProperty(value = "发动机(电机)额定功率")
private BigDecimal enginePower;
@ApiModelProperty(value = "最大速度(额载)")
private BigDecimal maxSpeed;
@ApiModelProperty(value = "防爆使用场所")
private String explosionproofPlace;
@ApiModelProperty(value = "工作装置门架形式")
private String gantryForm;
@ApiModelProperty(value = "工作装置空载最大起升高度")
private BigDecimal maxLiftingHeight;
@ApiModelProperty(value = "工作装置(全)自由起升高度")
private BigDecimal freeLiftingHeight;
@ApiModelProperty(value = "工作装置门架倾角(前)")
private BigDecimal portalAngleFront;
@ApiModelProperty(value = "工作装置门架倾角(后)")
private BigDecimal portalAngleBehind;
@ApiModelProperty(value = "工作装置最大起升速度(空载)")
private BigDecimal maxLiftingSpeed1;
@ApiModelProperty(value = "工作装置最大起升速度(额载)")
private BigDecimal maxLiftingSpeed2;
@ApiModelProperty(value = "工作装置最大下降速度(空载)")
private BigDecimal maxDescentSpeed1;
@ApiModelProperty(value = "工作装置最大下降速度(额载)")
private BigDecimal maxDescentSpeed2;
@ApiModelProperty(value = "整车整备质量")
private BigDecimal vehicleMass;
@ApiModelProperty(value = "额定载客数")
private Integer passengersNumber;
@ApiModelProperty(value = "最大运行速度")
private BigDecimal maxRunningSpeed;
@ApiModelProperty(value = "轴距")
private BigDecimal wheelBase;
@ApiModelProperty(value = "轮距(前)")
private BigDecimal trackWidthFront;
@ApiModelProperty(value = "轮距(后)")
private BigDecimal trackWidthBehind;
@ApiModelProperty(value = "观光列车车厢数")
private Integer carsNumber;
@ApiModelProperty(value = "观光列车每节车厢座位数")
private Integer seatNumber;
@ApiModelProperty(value = "观光列车牵引车头座位数")
private Integer tractorSeatNumber;
@ApiModelProperty(value = "最大行驶坡度")
private BigDecimal maxDrivingSlope;
@ApiModelProperty(value = "制动距离")
private BigDecimal brakingDistance;
@ApiModelProperty(value = "全长")
private BigDecimal overallLength;
@ApiModelProperty(value = "全宽")
private BigDecimal overallWidth;
@ApiModelProperty(value = "全高")
private BigDecimal overallAltitude;
@ApiModelProperty(value = "最小离地间隙")
private BigDecimal minGroundClearance;
@ApiModelProperty(value = "最小外侧转弯半径")
private BigDecimal minTurningRadius;
@ApiModelProperty(value = "主要零部件、安全保护和防护装置")
private String mainParts;
@ApiModelProperty(value = "监管码")
private String supervisoryCode;
}
package com.yeejoin.amos.boot.module.app.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.math.BigDecimal;
/**
* 安全追溯-压力容器
*
* @author cpp
* @date 2023-04-06 15:21:21
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="paramVessel", description="压力容器技术参数")
public class EquipTechParamVesselModel extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "")
private String instanceId;
@ApiModelProperty(value = "")
private String status;
@ApiModelProperty(value = "额定质量")
private BigDecimal ratedQuality;
@ApiModelProperty(value = "使用环境温度")
private BigDecimal ambientTemperature;
@ApiModelProperty(value = "型号")
private String modelNumber;
@ApiModelProperty(value = "数量")
private Integer num;
@ApiModelProperty(value = "单瓶容积")
private BigDecimal singleBottleVolume;
@ApiModelProperty(value = "总容积")
private BigDecimal totalVolume;
@ApiModelProperty(value = "充装介质")
private String chargingMedium;
@ApiModelProperty(value = "规格")
private String specification;
@ApiModelProperty(value = "外径")
private BigDecimal outsideDiameter;
@ApiModelProperty(value = "壁厚")
private BigDecimal wallThickness;
@ApiModelProperty(value = "长度")
private BigDecimal length;
@ApiModelProperty(value = "公称工作压力")
private BigDecimal nominalWorkingPressure;
@ApiModelProperty(value = "材料(瓶体)")
private String bottleBody;
@ApiModelProperty(value = "材料(端塞)")
private String endPlug;
@ApiModelProperty(value = "材料(管路)")
private String piping;
@ApiModelProperty(value = "无损检测方法(气瓶)")
private String qpLossless;
@ApiModelProperty(value = "无损检测方法(管路)")
private String glLossless;
@ApiModelProperty(value = "无损检测比例(气瓶)")
private BigDecimal qpRatio;
@ApiModelProperty(value = "无损检测比例(管路)")
private BigDecimal glRatio;
@ApiModelProperty(value = "耐压试验压力(气瓶)")
private BigDecimal qpPressure;
@ApiModelProperty(value = "耐压试验压力(管路)")
private BigDecimal glPressure;
@ApiModelProperty(value = "气密性试验压力(气瓶)")
private BigDecimal qpAirTightness;
@ApiModelProperty(value = "气密性试验压力(管路)")
private BigDecimal glAirTightness;
@ApiModelProperty(value = "气体置换后压力")
private BigDecimal displacementPressure;
@ApiModelProperty(value = "瓶体内含氧量")
private BigDecimal oxygen;
@ApiModelProperty(value = "瓶体内含氧量")
private String heatTreatmentMethod;
@ApiModelProperty(value = "热处理温度")
private BigDecimal qpHeatTreatmentTemperature;
@ApiModelProperty(value = "气瓶安装位置")
private String installationPosition;
@ApiModelProperty(value = "容器容积")
private BigDecimal containerVolume;
@ApiModelProperty(value = "容器内径")
private BigDecimal pressureVesselDiameter;
@ApiModelProperty(value = "容器高(长)")
private BigDecimal height;
@ApiModelProperty(value = "材料(筒体(球壳))")
private String materialCylinderShell;
@ApiModelProperty(value = "材料(封头)")
private String pressureMaterialHead;
@ApiModelProperty(value = "材料(衬里)")
private String pressureMaterialLining;
@ApiModelProperty(value = "材料(夹套)")
private String materialJacket;
@ApiModelProperty(value = "厚度(筒体(球壳))")
private BigDecimal thickness;
@ApiModelProperty(value = "厚度(封头)")
private BigDecimal fixedHead;
@ApiModelProperty(value = "厚度(衬里)")
private BigDecimal fixedLining;
@ApiModelProperty(value = "厚度(夹套)")
private BigDecimal fixedJacket;
@ApiModelProperty(value = "容器自重")
private BigDecimal selfWeight;
@ApiModelProperty(value = "盛装介质重量")
private BigDecimal mediumWeight;
@ApiModelProperty(value = "设计压力(壳程)")
private BigDecimal pressureHousingPath;
@ApiModelProperty(value = "设计压力(管程)")
private BigDecimal pressurePipe;
@ApiModelProperty(value = "设计压力(夹套)")
private BigDecimal pressureJacket;
@ApiModelProperty(value = "设计温度(壳程)")
private BigDecimal temperatureShell;
@ApiModelProperty(value = "设计温度(管程)")
private BigDecimal temperaturePipe;
@ApiModelProperty(value = "设计温度(夹套)")
private BigDecimal temperatureJacket;
@ApiModelProperty(value = "最高允许工作压力(壳程)")
private BigDecimal maxPressureShell;
@ApiModelProperty(value = "最高允许工作压力(管程)")
private BigDecimal maxPressurePipe;
@ApiModelProperty(value = "最高允许工作压力(夹套)")
private BigDecimal maxPressureJacket;
@ApiModelProperty(value = "介质(壳程)")
private String mediumShell;
@ApiModelProperty(value = "介质(管程)")
private String mediumPipe;
@ApiModelProperty(value = "介质(夹套)")
private String mediumJacket;
@ApiModelProperty(value = "主体结构型式")
private String mainStructureType;
@ApiModelProperty(value = "支座型式")
private String support;
@ApiModelProperty(value = "安装型式")
private String installation;
@ApiModelProperty(value = "保温绝热方式")
private String insulation;
@ApiModelProperty(value = "无损检测方法")
private String checkLossless;
@ApiModelProperty(value = "耐压试验种类")
private String withstandVoltage;
@ApiModelProperty(value = "泄漏试验种类")
private String leakage;
@ApiModelProperty(value = "耐压试验压力")
private BigDecimal withstandPressureTest;
@ApiModelProperty(value = "泄漏试验压力")
private BigDecimal leakPressure;
@ApiModelProperty(value = "容器型号")
private String container;
@ApiModelProperty(value = "罐车编号")
private String carNum;
@ApiModelProperty(value = "容积")
private BigDecimal volume;
@ApiModelProperty(value = "最大充装量")
private BigDecimal maxFill;
@ApiModelProperty(value = "设计压力")
private BigDecimal designPressure;
@ApiModelProperty(value = "设计温度")
private BigDecimal designTemperature;
@ApiModelProperty(value = "工作压力")
private BigDecimal workingPressure;
@ApiModelProperty(value = "工作温度")
private BigDecimal workTemperature;
@ApiModelProperty(value = "材料(筒体)")
private String materialCylinder;
@ApiModelProperty(value = "厚度(筒体)")
private BigDecimal thicknessCylinder;
@ApiModelProperty(value = "腐蚀裕量")
private BigDecimal corrosionMargin;
@ApiModelProperty(value = "介质")
private String medium;
@ApiModelProperty(value = "氧舱品种")
private String oxygenChamber;
@ApiModelProperty(value = "额定进舱人数")
private Integer ratedEntryCapacity;
@ApiModelProperty(value = "主体结构")
private String chamberMain;
@ApiModelProperty(value = "压力")
private BigDecimal chamberPressure;
@ApiModelProperty(value = "温度")
private BigDecimal temperature;
@ApiModelProperty(value = "压力介质")
private BigDecimal pressureMedium;
@ApiModelProperty(value = "人均舱容")
private BigDecimal perCapitaCabinCapacity;
@ApiModelProperty(value = "固定安全附件")
private String fixedSafetyAccessory;
@ApiModelProperty(value = "气瓶")
private String gasCylinder;
@ApiModelProperty(value = "气瓶安全附件")
private String gasCylinderAccessories;
}
package com.yeejoin.amos.boot.module.app.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import lombok.Data;
/**
* 一码通总览数据统计
*
* @author system_generator
*/
@Data
@ApiModel(value = "EquipmentCategoryDataDto", description = "一码通总览数据统计")
public class EquipmentCategoryDataDto extends BaseDto {
/**
* 管辖分局组织机构代码
*/
@TableField("org_branch_code")
private String org_branch_code;
/**
* 单位统一信用代码
*/
@TableField("unit_code")
private String unitCode;
/**
* 电梯
*/
@TableField("elevator")
private String elevator;
/**
* 厂车
*/
@TableField("vehicle")
private String vehicle;
/**
* 索道
*/
@TableField("ropeway")
private String ropeway;
/**
* 游乐设施
*/
@TableField("rides")
private String rides;
/**
* 锅炉
*/
@TableField("boiler")
private String boiler;
/**
* 压力容器
*/
@TableField("vessel")
private String vessel;
/**
* 压力管道
*/
@TableField("pipeline")
private String pipeline;
/**
* 起重机械
*/
@TableField("lifting")
private String lifting;
}
package com.yeejoin.amos.boot.module.app.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* 装备分类
*
* @author system_generator
* @date 2021-10-20
*/
@Data
@ApiModel(value="EquipmentCategoryDto", description="装备分类")
public class EquipmentCategoryDto {
private static final long serialVersionUID = 1L;
private Long id;
private String parentId;
@ApiModelProperty(value = "装备分类编码")
private String code;
@ApiModelProperty(value = "装备分类名称")
private String name;
@ApiModelProperty(value = "描述")
private String description;
@ApiModelProperty(value = "备注")
private String remark;
private Date createDate;
@ApiModelProperty(value = "行业编码")
private String industryCode;
}
package com.yeejoin.amos.boot.module.app.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 特种设备搜索列表DTO
*/
@Data
@ApiModel(value="EsSpecialEquipmentListDto", description="特种设备搜索列表DTO")
public class EsSpecialEquipmentListDto {
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* 所属区域代码
*/
@ApiModelProperty(value = "所属区域代码")
private String regionCode;
/**
* 设备类别编码
*/
@ApiModelProperty(value = "设备类别编码")
private String categoryCode;
/**
* 搜索数量
*/
@ApiModelProperty(value = "搜索数量")
private Integer equipmentNumber;
}
package com.yeejoin.amos.boot.module.app.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 安全追溯-检验检测信息表
*
* @author cpp
* @date 2023-04-20 16:36:14
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="InspectionDetectionInfo", description="检验检测信息")
public class InspectionDetectionInfoModel extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "")
private String instanceId;
@ApiModelProperty(value = "")
private String status;
@ApiModelProperty(value = "检验类型")
private String inspectType;
@ApiModelProperty(value = "检验机构名称")
private String inspectOrgName;
@ApiModelProperty(value = "检验报告附件")
private String inspectReport;
@ApiModelProperty(value = "检验人员")
private String inspectStaff;
@ApiModelProperty(value = "检验日期")
private Date inspectDate;
@ApiModelProperty(value = "检验结论")
private String inspectConclusion;
@ApiModelProperty(value = "安全状况等级")
private String safetyLevel;
@ApiModelProperty(value = "检验问题备注")
private String problemRemark;
@ApiModelProperty(value = "下次检验日期")
private Date nextInspectDate;
@ApiModelProperty(value = "设备唯一标识")
private String sequenceCode;
private String superviseCode;
}
package com.yeejoin.amos.boot.module.app.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
@ApiModel(value="InspectionDetectionInfoModelForWX", description="")
public class InspectionDetectionInfoModelForWX {
@ApiModelProperty(value = "检验机构名称")
private String inspectOrgName;
@ApiModelProperty(value = "检验结论")
private String inspectConclusion;
@ApiModelProperty(value = "下次检验日期")
private Date nextInspectDate;
}
package com.yeejoin.amos.boot.module.app.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Date;
/**
* ${comments}
*
* @author cpp
* @date 2023-04-21 11:08:35
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="mainParts", description="主要零部件技术参数")
public class MainPartsModel extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "")
private String instanceId;
@ApiModelProperty(value = "")
private String status;
@ApiModelProperty(value = "零部件号")
private String mainPartNumber;
@ApiModelProperty(value = "型号规格")
private String typeSpecification;
@ApiModelProperty(value = "制造单位")
private String manufactureCompany;
@ApiModelProperty(value = "产品编号")
private String identificatioProduct;
@ApiModelProperty(value = "制造日期")
private Date manufacturingDate;
@ApiModelProperty(value = "名称")
private String designation;
@ApiModelProperty(value = "备注")
private String remarks;
@ApiModelProperty(value = "型号(厂车技术) ")
private String model;
@ApiModelProperty(value = "规格(厂车技术) ")
private String specification;
@ApiModelProperty(value = "型式试验证书编号")
private String certificateNumber;
@ApiModelProperty(value = "序号")
private String serialNumber;
@ApiModelProperty(value = "气瓶批号 ")
private String batchNumber;
@ApiModelProperty(value = "单位内编号")
private String intraUnitNumber;
@ApiModelProperty(value = "净重 ")
private BigDecimal weight;
@ApiModelProperty(value = "管道名称")
private String pipeName;
@ApiModelProperty(value = "管道编号 ")
private String pipelineNumber;
@ApiModelProperty(value = "设备级别")
private String deviceLevel;
@ApiModelProperty(value = "设计标准")
private String designCriterion;
@ApiModelProperty(value = "管道图号 ")
private String figureNumber;
@ApiModelProperty(value = "零部件名称")
private String partName;
}
package com.yeejoin.amos.boot.module.app.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 cpp
* @date 2023-04-06 15:21:22
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="maintenanceRecordInfo", description="最近维保备案信息")
public class MaintenanceInfoModel extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "")
private String instanceId;
@ApiModelProperty(value = "")
private String status;
@ApiModelProperty(value = "维保单位统一社会信用代码")
private String meUnitCreditCode;
@ApiModelProperty(value = "维保单位名称")
private String meUnitName;
@ApiModelProperty(value = "维保备案合同附件")
private String repairInform;
@ApiModelProperty(value = "维保合同开始日期")
private Date informStart;
@ApiModelProperty(value = "维保合同结束日期")
private Date informEnd;
@ApiModelProperty(value = "维保负责人姓名")
private String meMaster;
@ApiModelProperty(value = "维保负责人身份证")
private String meMasterId;
@ApiModelProperty(value = "紧急救援电话")
private String emergencycall;
@ApiModelProperty(value = "维保周期")
private String meCycle;
@ApiModelProperty(value = "大修周期")
private String overhaulCycle;
@ApiModelProperty(value = "24小时维保电话")
private String me24Telephone;
}
package com.yeejoin.amos.boot.module.app.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
@ApiModel(value="maintenanceRecordInfo", description="")
public class MaintenanceInfoModelForWX {
@ApiModelProperty(value = "最近维保日期")
private Date recentTime;
@ApiModelProperty(value = "维保单位")
private String meUnitName;
@ApiModelProperty(value = "维保电话")
private String me24Telephone;
}
package com.yeejoin.amos.boot.module.app.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "OtherEquBaseInfoForWXModel", description = "")
public class OtherEquBaseInfoForWXModel {
@ApiModelProperty(value = "设备代码")
private String equCode;
@ApiModelProperty(value = "使用登记证编号")
private String useOrgCode;
@ApiModelProperty(value = "设备类别")
private String equCategory;
@ApiModelProperty(value = "制造单位名")
private String produceUnitName;
@ApiModelProperty(value = "出厂编号")
private String factoryNum;
@ApiModelProperty(value = "所属区域")
private String area;
@ApiModelProperty(value = "使用地址")
private String address;
@ApiModelProperty(value = "单位内编号")
private String intraUnitNumber;
}
package com.yeejoin.amos.boot.module.app.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;
/**
* ${comments}
*
* @author cpp
* @date 2023-04-06 15:21:22
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="otherInfo", description="其他信息")
public class OtherInfoModel extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "保险机构")
private String insuranceOrg;
@ApiModelProperty(value = "保险到期日")
private String expiryDate;
@ApiModelProperty(value = "物联网接入标志")
private String iotOrg;
@ApiModelProperty(value = "物联网接入标志")
private String iotSign;
@ApiModelProperty(value = "有无监控")
private String isMonitor;
@ApiModelProperty(value = "96333识别码")
private String code96333;
@ApiModelProperty(value = "监管码")
private String supervisoryCode;
}
package com.yeejoin.amos.boot.module.app.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 cpp
* @date 2023-04-06 15:21:22
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="produceInfo", description="制造信息")
public class ProduceInfoModel extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "")
private String supervisoryCode;
private String instanceId;
@ApiModelProperty(value = "")
private String status;
@ApiModelProperty(value = "制造单位统一社会信用代码")
private String produceUnitCreditCode;
@ApiModelProperty(value = "制造单位名")
private String produceUnitName;
@ApiModelProperty(value = "制造许可编号")
private String produceLicenseNum;
@ApiModelProperty(value = "出厂编号")
private String factoryNum;
@ApiModelProperty(value = "制造日期")
private Date produceDate;
@ApiModelProperty(value = "是否进口")
private String imported;
@ApiModelProperty(value = "制造国")
private String produceCountry;
@ApiModelProperty(value = "制造标准")
private String factoryStandard;
@ApiModelProperty(value = "制造附件")
private String productQualityYieldProve;
@ApiModelProperty(value = "安装及使用维护保养说明附件")
private String insUseMaintainExplain;
@ApiModelProperty(value = "监督检验证书附件")
private String supervisionAgencyCredential;
@ApiModelProperty(value = "型式试验证书附件")
private String typeTestCredential;
}
package com.yeejoin.amos.boot.module.app.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 安全追溯-安全保护装置
*
* @author cpp
* @date 2023-04-21 11:08:36
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="protectionDevices", description="安全保护装置技术参数")
public class ProtectionDevicesModel extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "")
private String instanceId;
@ApiModelProperty(value = "")
private String status;
@ApiModelProperty(value = "装置号")
private String deviceNumber;
@ApiModelProperty(value = "型号规格")
private String typeSpecification;
@ApiModelProperty(value = "制造单位")
private String manufactureCompany;
@ApiModelProperty(value = "制造日期")
private Date manufacturingDate;
@ApiModelProperty(value = "产品编号")
private String code;
@ApiModelProperty(value = "型式试验证合格证号")
private String certificateNumber;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "数量")
private Integer quantity;
@ApiModelProperty(value = "名称")
private String designation;
@ApiModelProperty(value = "型号(锅炉,压力容器) ")
private String model;
@ApiModelProperty(value = "规格(锅炉,压力容器)")
private String specification;
}
package com.yeejoin.amos.boot.module.app.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.math.BigDecimal;
/**
* 注册登记信息表
*
* @author cpp
* @date 2023-04-06 15:21:22
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="registerInfo", description="注册登记信息")
public class RegistrationInfoModel extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "")
private String instanceId;
@ApiModelProperty(value = "")
private String status;
@ApiModelProperty(value = "登记机关")
private String organizationName;
@ApiModelProperty(value = "使用登记证编号")
private String useOrgCode;
@ApiModelProperty(value = "设备代码")
private String equCode;
@ApiModelProperty(value = "注册状态")
private String registerState;
@ApiModelProperty(value = "设备种类")
private String equList;
@ApiModelProperty(value = "设备类别")
private String equCategory;
@ApiModelProperty(value = "产品名称")
private String productName;
@ApiModelProperty(value = "品牌名称")
private String brandName;
@ApiModelProperty(value = "设备型号")
private String equType;
@ApiModelProperty(value = "设备总价值(万元)")
private BigDecimal equPrice;
@ApiModelProperty(value = "注册附件")
private String useRegistrationCertificate;
@ApiModelProperty(value = "使用标志附件")
private String useSign;
@ApiModelProperty(value = "产品照片附件")
private String productPhoto;
@ApiModelProperty(value = "登记机关组织机构代码")
private String organizationCode;
@ApiModelProperty(value = "设备品种")
private String equDefine;
@ApiModelProperty(value = "车辆牌号")
private String carNumber;
@ApiModelProperty(value = "车架编号")
private String frameNumber;
@ApiModelProperty(value = "发动机编号")
private String engineNumber;
@ApiModelProperty(value = "电动机编号")
private String motorNumber;
}
package com.yeejoin.amos.boot.module.app.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* 使用单位
*
* @author duanwei
* @date 2022-09-08
*/
@Data
@Accessors(chain = true)
@ApiModel(value="SpeUseUnit对象", description="使用单位")
public class SpeUseUnitDto implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "单位名称")
private String name;
@ApiModelProperty(value = "统一社会信用代码")
private String cerCode;
@ApiModelProperty(value = "单位性质")
private String unitNature;
@ApiModelProperty(value = "营业执照图片")
private String cerImgUrl;
@ApiModelProperty(value = "营业执照登记机关")
private String cerRegiOrg;
@ApiModelProperty(value = "注册地址_省")
private String cerAddrProvince;
@ApiModelProperty(value = "注册地址_市")
private String cerAddrCity;
@ApiModelProperty(value = "注册地址")
private String cerAddrArea;
@ApiModelProperty(value = "注册大厦(小区)")
private String cerAddrVillage;
@ApiModelProperty(value = "注册地址_街道")
private String cerAddrStreet;
@ApiModelProperty(value = "注册地址_详细地址")
private String cerAddrDetail;
@ApiModelProperty(value = "法定代表人")
private String legalPerson;
@ApiModelProperty(value = "法人手机")
private String legalPersonPhone;
@ApiModelProperty(value = "负责人")
private String responPerson;
@ApiModelProperty(value = "负责人手机")
private String responPersonPhone;
@ApiModelProperty(value = "所在地邮政编码")
private String zipCode;
@ApiModelProperty(value = "办公地址_省")
private String offiAddrProvince;
@ApiModelProperty(value = "办公地址_市")
private String offiAddrCity;
@ApiModelProperty(value = "办公地址")
private String offiAddrArea;
@ApiModelProperty(value = "办公地址_街道")
private String offiAddrStreet;
@ApiModelProperty(value = "办公大厦(小区)")
private String offiAddrVillage;
@ApiModelProperty(value = "办公地址_详细地址")
private String offiAddrDetail;
@ApiModelProperty(value = "冻结原因")
private String frozenReason;
@ApiModelProperty(value = "单位所属行业")
private String industry;
@ApiModelProperty(value = "值班电话")
private String onDutyPhone;
@ApiModelProperty(value = "管辖分局ID")
private String auditOrgId;
@ApiModelProperty(value = "管辖分局")
private String auditOrgName;
@ApiModelProperty(value = "管辖分局编码")
private String auditOrgCode;
@ApiModelProperty(value = "单位状态")
private Integer status;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "删除状态")
private Integer delFlag;
@ApiModelProperty(value = "创建人")
private String createBy;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "更新人")
private String updateBy;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "组织机构ID")
private String sysOrgId;
@ApiModelProperty(value = "所属组织机构编码")
private String sysOrgCode;
@ApiModelProperty(value = "96333救援电话")
private String rescueCall;
@ApiModelProperty(value = "同步id")
private String syncId;
}
package com.yeejoin.amos.boot.module.app.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;
/**
* 监督管理信息表
*
* @author cpp
* @date 2023-04-06 15:21:22
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="MidEquipSupervisionInfoDto", description="监督管理信息表Dto")
public class SuperviseInfoModel extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "$column.comments")
private String supervisoryCode;
@ApiModelProperty(value = "$column.comments")
private String instanceId;
@ApiModelProperty(value = "$column.comments")
private String status;
@ApiModelProperty(value = "管辖分局组织机构代码")
private String orgBranchCode;
@ApiModelProperty(value = "管辖分局名称")
private String orgBranchName;
@ApiModelProperty(value = "是否重点监察设备")
private String keyMonitoringEqu;
@ApiModelProperty(value = "是否在人口密集区")
private String denselyPopulatedAreas;
@ApiModelProperty(value = "是否在重要场所")
private String importantPlaces;
}
package com.yeejoin.amos.boot.module.app.api.dto;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.app.flc.api.dto.RegUnitIcDto;
import com.yeejoin.amos.boot.module.app.flc.api.dto.RegUnitInfoDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* 企业数据信息Dto
*
* @author duanwei
* @date 2022-07-26
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class TzBaseEnterpriseInfoDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
/**
* id
*/
private Long sequenceNbr;
@ApiModelProperty(value = "使用单位唯一标识")
/**
* 使用单位唯一标识
*/
private String useUnitCode;
@ApiModelProperty(value = "监管系统唯一编码")
/**
* 监管系统唯一编码
*/
private String superviseCode;
@ApiModelProperty(value = "使用单位证件类型")
/**
* 使用单位证件类型
*/
private String useUnitCertificate;
@ApiModelProperty(value = "单位类型")
/**
* 单位类型
*/
private String unitType;
@ApiModelProperty(value = "使用单位统一信用代码")
/**
* 使用单位统一信用代码
*/
private String useCode;
@ApiModelProperty(value = "根据统一信用代码生成的二维码")
private String qrCode;
@ApiModelProperty(value = "使用单位名称")
/**
* 使用单位名称
*/
private String useUnit;
@ApiModelProperty(value = "监管机构组织机构代码")
/**
* 监管机构组织机构代码
*/
private String superviseOrgCode;
@ApiModelProperty(value = "监管机构名称")
/**
* 监管机构名称
*/
private String superviseOrgName;
@ApiModelProperty(value = "是否重点监控单位")
/**
* 是否重点监控单位
*/
private String keyUnit;
@ApiModelProperty(value = "重点场所分类")
/**
* 重点场所分类
*/
private String classPlaces;
@ApiModelProperty(value = "单位所在省份名称")
/**
* 单位所在省份名称
*/
private String province;
@ApiModelProperty(value = "单位所在城市名称")
/**
* 单位所在城市名称
*/
private String city;
@ApiModelProperty(value = "单位所在区县名称")
/**
* 单位所在区县名称
*/
private String district;
@ApiModelProperty(value = "单位所在街道名称")
/**
* 单位所在街道名称
*/
private String street;
@ApiModelProperty(value = "单位所在社区名称")
/**
* 单位所在社区名称
*/
private String community;
@ApiModelProperty(value = "单位详细地址")
/**
* 单位详细地址
*/
private String address;
@ApiModelProperty(value = "使用单位法人")
/**
* 使用单位法人
*/
private String legalPerson;
@ApiModelProperty(value = "法人联系电话")
/**
* 法人联系电话
*/
private String legalPhone;
@ApiModelProperty(value = "使用单位联系人")
/**
* 使用单位联系人
*/
private String useContact;
@ApiModelProperty(value = "联系人联系电话")
/**
* 联系人联系电话
*/
private String contactPhone;
@ApiModelProperty(value = "安全管理人员1姓名")
/**
* 安全管理人员1姓名
*/
private String safetyOne;
@ApiModelProperty(value = "安全管理人员1身份证")
/**
* 安全管理人员1身份证
*/
private String safetyOneId;
@ApiModelProperty(value = "安全管理人员1联系电话")
/**
* 安全管理人员1联系电话
*/
private String safetyOnePhone;
@ApiModelProperty(value = "安全管理人员2")
/**
* 安全管理人员2
*/
private String safetyTwo;
@ApiModelProperty(value = "安全管理人员2身份证")
/**
* 安全管理人员2身份证
*/
private String safetyTwoId;
@ApiModelProperty(value = "安全管理人员2联系电话")
/**
* 安全管理人员2联系电话
*/
private String safetyTwoPhone;
@ApiModelProperty(value = "单位地理坐标经度")
/**
* 单位地理坐标经度
*/
private String longitude;
@ApiModelProperty(value = "单位地理坐标纬度")
/**
* 单位地理坐标纬度
*/
private String latitude;
@ApiModelProperty(value = "同步时间")
/**
* 同步时间
*/
private Date syncDate;
@ApiModelProperty(value = "同步状态(0-新增 1-更新 2-删除)")
/**
* 同步状态(0-新增 1-更新 2-删除)
*/
private Integer syncState;
@ApiModelProperty(value = "对接公司编码")
/**
* 对接公司编码
*/
private String appId;
@ApiModelProperty(value = "创建时间")
/**
* 创建时间
*/
private Date recDate;
@ApiModelProperty(value = "操作人员")
/**
* 操作人员
*/
private String recUserId;
@ApiModelProperty(value = "管辖机构")
/**
* 管辖机构
*/
private String governingBody;
@ApiModelProperty(value = "数据来源")
/**
* 数据来源
*/
private String dataSources;
@ApiModelProperty(value = "所属行业")
/**
* 所属行业
*/
private String industry;
@ApiModelProperty(value = "登记机关")
/**
* 登记机关
*/
private String registrationAuthority;
@ApiModelProperty(value = "核准时间")
/**
* 核准时间
*/
private Date approvalTime;
/**
* 核准时间(企业端基础信息使用)
*/
@ApiModelProperty(value = "核准时间")
private String approval;
@ApiModelProperty(value = "经营状态")
/**
* 经营状态
*/
private String operatingStatus;
@ApiModelProperty(value = "维保负责人")
/**
* 维保负责人
*/
private String maintenPerson;
@ApiModelProperty(value = "维保负责人联系电话")
/**
* 维保负责人联系电话
*/
private String maintenTelephone;
@ApiModelProperty(value = "质量保证工程师")
/**
* 质量保证工程师
*/
private String sqa;
@ApiModelProperty(value = "质量负责人")
/**
* 质量负责人
*/
private String qualityPerson;
@ApiModelProperty(value = "质量负责人电话")
/**
* 质量负责人电话
*/
private String qualityTelephone;
@ApiModelProperty(value = "技术负责人")
/**
* 技术负责人
*/
private String technicalPerson;
@ApiModelProperty(value = "涉及设备类型")
private List equipCategory;
@ApiModelProperty(value = "企业营业执照")
private List unitBusinessLicense;
@ApiModelProperty(value = "企业许可证书")
private List unitExequatur;
@ApiModelProperty(value = "安全管理人2身份证照片")
private List safetyTwoPhoto;
@ApiModelProperty(value = "安全管理人1身份证照片")
private List safetyOnePhoto;
@ApiModelProperty(value = "质量保证工程师电话")
private String sqaPhone;
@ApiModelProperty(value = "行业主管部门")
private String industrySupervisor;
private String region;
private String fullAddress;
private String superviseKey;
private List<BaseUnitLicenceDto> unitLicences;
private RegUnitIcDto regUnitIcDto;
//企业管理员信息
private RegUnitInfoDto regUnitInfoDto;
@ApiModelProperty(value = "企业标签信息")
private String regulatoryLabels;
}
package com.yeejoin.amos.boot.module.app.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;
/**
* 使用信息表
*
* @author cpp
* @date 2023-04-06 15:21:21
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="UseInfo", description="使用信息")
public class UseInfoModel extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "")
private String instanceId;
@ApiModelProperty(value = "")
private String status;
@ApiModelProperty(value = "使用单位统一信用代码")
private String useUnitCreditCode;
@ApiModelProperty(value = "使用单位名称")
private String useUnitName;
@ApiModelProperty(value = "产权单位统一信用代码")
private String estateUnitCreditCode;
@ApiModelProperty(value = "产权单位名称")
private String estateUnitName;
@ApiModelProperty(value = "使用状态变更日期")
private String useStateChangeDate;
@ApiModelProperty(value = "变更事项")
private String changes;
@ApiModelProperty(value = "使用内部编号")
private String useInnerCode;
@ApiModelProperty(value = "投入使用日期")
private String useDate;
@ApiModelProperty(value = "经办人")
private String agent;
@ApiModelProperty(value = "设备使用地点-省")
private String province;
@ApiModelProperty(value = "设备使用地点-市")
private String city;
@ApiModelProperty(value = "设备使用地点-区(县)")
private String county;
@ApiModelProperty(value = "设备使用地点-街道(镇)")
private String factoryUseSiteStreet;
@ApiModelProperty(value = "设备详细使用地址")
private String address;
@ApiModelProperty(value = "设备地理坐标经纬度")
private String longitudeLatitude;
@ApiModelProperty(value = "设备使用场所")
private String usePlace;
@ApiModelProperty(value = "设备主管部门")
private String equManageDt;
@ApiModelProperty(value = "安全管理部门名称")
private String safetyManageDt;
@ApiModelProperty(value = "安全管理员")
private String safetyManager;
@ApiModelProperty(value = "安全管理员移动电话")
private String phone;
@ApiModelProperty(value = "设备状态")
private String equState;
@ApiModelProperty(value = "")
private String provinceName;
@ApiModelProperty(value = "")
private String cityName;
@ApiModelProperty(value = "")
private String countyName;
}
package com.yeejoin.amos.boot.module.app.api.dto;
import lombok.Data;
/**
* @author Administrator
*/
@Data
public class UseUnitCreditCodeCategoryDto {
/**
* 使用单位编码
*/
private String useUnitCreditCode;
/**
* 管辖机构编码
*/
private String orgBranchCode;
/**
* 状态
*/
private String claimStatus;
/**
* 设备定义编码
*/
private String equList;
/**
* 数量
*/
private Long total;
}
package com.yeejoin.amos.boot.module.app.api.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
@Data
public abstract class AbstractEquipBaseEntity {
@TableId(
value = "\"SEQUENCE_NBR\"",
type = IdType.ID_WORKER
)
protected String sequenceNbr;
@TableField("\"REC_DATE\"")
protected String recDate;
@TableField("\"REC_USER_ID\"")
protected String recUserId;
/**
* * 监管码
* */
@TableField(value ="\"RECORD\"")
private String record;
/**
*
*/
private static final long serialVersionUID = 1L;
}
package com.yeejoin.amos.boot.module.app.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 单位注册许可信息表
*
* @author system_generator
* @date 2022-08-09
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("tz_base_unit_licence")
public class BaseUnitLicence extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 单位编码
*/
@TableField("unit_code")
private String unitCode;
/**
* 单位名称
*/
@TableField("unit_name")
private String unitName;
/**
* 许可地址
*/
@TableField("lic_address")
private String licAddress;
/**
* 证书类型
*/
@TableField("cert_type")
private String certType;
/**
* 证书类型code
*/
@TableField("cert_type_code")
private String certTypeCode;
/**
* 证书编号
*/
@TableField("cert_no")
private String certNo;
/**
* 有效期至
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@TableField("expiry_date")
private Date expiryDate;
/**
* 发证日期
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@TableField("issue_date")
private Date issueDate;
/**
* 变更日期
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@TableField("change_date")
private Date changeDate;
/**
* 许可方式/许可状态
*/
@TableField("apply_type")
private String applyType;
/**
* 许可方式/许可状态
*/
@TableField("apply_type_code")
private String applyTypeCode;
/**
* 许可评审方式
*/
private String appraisalType;
/**
* 许可评审方式code
*/
private String appraisalTypeCode;
/**
* 备注
*/
@TableField("remark")
private String remark;
/**
* 许可项目/检验类型/设备品种编码
*/
@TableField("item_code")
private String itemCode;
/**
* 许可项目/检验类型/设备品种
*/
@TableField("item_code_name")
private String itemCodeName;
/**
* 许可子项目/检验项目/充装介质类别code
*/
@TableField("sub_item_code")
private String subItemCode;
/**
* 许可子项目/检验项目/充装介质类别
*/
@TableField("sub_item_name")
private String subItemName;
/**
* 许可参数/充装介质名称
*/
@TableField("parameter")
private String parameter;
/**
* 许可参数/充装介质code
*/
@TableField("parameter_code")
private String parameterCode;
/**
* 固定检验地址
*/
@TableField("item_address")
private String itemAddress;
/**
* 发证机关
*/
private String approvedOrgan;
/**
* 发证机关code
*/
private String approvedOrganCode;
/**
* 是否同步自许可(1是 0否)
*/
@TableField("is_not_sync")
private String isNotSync;
}
package com.yeejoin.amos.boot.module.app.api.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
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 lombok.experimental.Accessors;
/**
* 八大类其他信息
*
*/
@Data
@Accessors(chain = true)
@TableName("idx_biz_jg_other_info")
@ApiModel(value="CategoryOtherInfo对象", description="八大类其他信息")
public class CategoryOtherInfo{
/**
*
*/
private static final long serialVersionUID = 1L;
@TableId(value = "SEQUENCE_NBR", type = IdType.ID_WORKER_STR)
@TableField("SEQUENCE_NBR")
private String sequenceNbr;
@ApiModelProperty(value = "RECORD")
@TableField("RECORD")
private String record;
@ApiModelProperty(value = "保险机构")
@TableField("INSURANCE_ORG")
private String insuranceOrg;
@ApiModelProperty(value = "保险到期日")
@TableField("EXPIRY_DATE")
private String expiryDate;
@ApiModelProperty(value = "物联网接入标志")
@TableField("IOT_ORG")
private String iotOrg;
@ApiModelProperty(value = "物联网接入标志")
@TableField("IOT_SIGN")
private String iotSign;
@ApiModelProperty(value = "有无监控")
@TableField("IS_MONITOR")
private String isMonitor;
@ApiModelProperty(value = "96333识别码")
@TableField("CODE96333")
private String code;
@ApiModelProperty(value = "监管码")
@TableField("SUPERVISORY_CODE")
private String supervisoryCode;
@ApiModelProperty(value = "认领状态:6035代表已认领,6036代表待认领,6037代表拒领")
@TableField("CLAIM_STATUS")
private String claimStatus;
@ApiModelProperty(value = "编辑状态")
@TableField("EDIT_STATUS")
private String editStatus;
}
package com.yeejoin.amos.boot.module.app.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* 施工信息表
*
* @author cpp
* @date 2023-04-06 15:21:22
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("idx_biz_jg_construction_info")
public class ConstructionInfo extends AbstractEquipBaseEntity {
private static final long serialVersionUID = 1L;
/**
* * $column.comments
* */
/**
* * $column.comments
* */
@TableField(value ="\"INSTANCE_ID\"")
private String instanceId;
/**
* * $column.comments
* */
@TableField(value ="\"STATUS\"")
private String status;
/**
* * 施工类型
* */
@TableField(value ="\"CONSTRUCTION_TYPE\"")
private String constructionType;
/**
* * 施工单位统一社会信用代码
* */
@TableField(value ="\"USC_UNIT_CREDIT_CODE\"")
private String uscUnitCreditCode;
/**
* * 施工单位名称
* */
@TableField(value ="\"USC_UNIT_NAME\"")
private String uscUnitName;
/**
* * 施工时间
* */
@TableField(value ="\"USC_DATE\"")
@JsonFormat(pattern="yyyy-MM-dd HH:mm",timezone = "GMT+8")
private String uscDate;
}
package com.yeejoin.amos.boot.module.app.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 安全追溯-设计信息表
*
* @author cpp
* @date 2023-04-06 15:21:22
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("idx_biz_jg_design_info")
public class DesignInfo extends AbstractEquipBaseEntity {
private static final long serialVersionUID = 1L;
/**
* * $column.comments
* */
/**
* * $column.comments
* */
@TableField(value ="\"INSTANCE_ID\"")
private String instanceId;
/**
* * $column.comments
* */
@TableField(value ="\"STATUS\"")
private String status;
/**
* * 设计单位统一社会信用代码
* */
@TableField(value ="\"DESIGN_UNIT_CREDIT_CODE\"")
private String designUnitCreditCode;
/**
* * 设计单位名称
* */
@TableField(value ="\"DESIGN_UNIT_NAME\"")
private String designUnitName;
/**
* * 设计许可编号
* */
@TableField(value ="\"DESIGN_LICENSE_NUM\"")
private String designLicenseNum;
/**
* * 设计使用年限
* */
@TableField(value ="\"DESIGN_USE_DATE\"")
private String designUseDate;
/**
* * 设计日期
* */
@TableField(value ="\"DESIGN_DATE\"")
private Date designDate;
/**
* * 总图图号
* */
@TableField(value ="\"DRAWING_DO\"")
private String drawingDo;
/**
* * 设计文件
* */
@TableField(value ="\"DESIGN_DOC\"")
private String designDoc;
/**
* * 设计文件鉴定单位
* */
@TableField(value ="\"APPRAISAL_UNIT\"")
private String appraisalUnit;
/**
* * 设计单位鉴定日期
* */
@TableField(value ="\"APPRAISAL_DATE\"")
private String appraisalDate;
/**
* * 设计规范
* */
@TableField(value ="\"DESIGN_STANDARD\"")
private String designStandard;
}
package com.yeejoin.amos.boot.module.app.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
/**
* 安全追溯-锅炉
*
* @author cpp
* @date 2023-04-06 15:21:22
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("idx_biz_jg_tech_params_boiler")
public class EquipTechParamBoiler extends AbstractEquipBaseEntity {
private static final long serialVersionUID = 1L;
/**
* * $column.comments
* */
/**
* * $column.comments
* */
@TableField(value ="\"INSTANCE_ID\"")
private String instanceId;
/**
* * $column.comments
* */
@TableField(value ="\"STATUS\"")
private String status;
/**
* * 设备等级
* */
@TableField(value ="\"DEVICE_LEVEL\"")
private String deviceLevel;
/**
* * 额定蒸发量(热功率)
* */
@TableField(value ="\"RATED_EVAPORATION_CAPACITY_THERMAL_POWER\"")
private BigDecimal ratedEvaporationCapacityThermalPower;
/**
* * 额定工作压力
* */
@TableField(value ="\"RATED_WORKING_PRESSURE\"")
private BigDecimal ratedWorkingPressure;
/**
* * 额定工作温度
* */
@TableField(value ="\"RATED_OPERATING_TEMPERATURE\"")
private BigDecimal ratedOperatingTemperature;
/**
* * 设计热效率
* */
@TableField(value ="\"DESIGN_THERMAL_EFFICIENCY\"")
private BigDecimal designThermalEfficiency;
/**
* * 给水温度
* */
@TableField(value ="\"FEEDWATER_TEMPERATURE\"")
private BigDecimal feedwaterTemperature;
/**
* * 额定出/回水(油)温度
* */
@TableField(value ="\"RATED_OUTLET_RETURN_WATER_OIL_TEMPERATURE\"")
private BigDecimal ratedOutletReturnWaterOilTemperature;
/**
* * 锅炉本体水(油)容积
* */
@TableField(value ="\"WATER_OIL_VOLUME_OF_BOILER_PROPER\"")
private BigDecimal waterOilVolumeOfBoilerProper;
/**
* * 整装锅炉本体液压试验介质/压力
* */
@TableField(value ="\"HYDRAULIC_TEST_MEDIUM_PRESSURE_OF_PACKAGED_BOILER_BODY\"")
private BigDecimal hydraulicTestMediumPressureOfPackagedBoilerBody;
/**
* * 再热器进(出)口温度
* */
@TableField(value ="\"INLET_OUTLET_TEMPERATURE_OF_REHEATER\"")
private BigDecimal inletOutletTemperatureOfReheater;
/**
* * 再热器进(出)口压力
* */
@TableField(value ="\"REHEATER_INLET_OUTLET_PRESSURE\"")
private BigDecimal reheaterInletOutletPressure;
/**
* * 再热蒸汽流量
* */
@TableField(value ="\"REHEAT_STEAM_FLOW\"")
private BigDecimal reheatSteamFlow;
/**
* * 燃料(热源)种类
* */
@TableField(value ="\"FUEL_TYPE\"")
private String fuelType;
/**
* * 受压部件名称
* */
@TableField(value ="\"NAME_OF_PRESSURE_PARTS\"")
private String nameOfPressureParts;
/**
* * 受压部件材料
* */
@TableField(value ="\"MATERIAL_OF_PRESSURE_PARTS\"")
private String materialOfPressureParts;
/**
* * 受压部件壁厚
* */
@TableField(value ="\"WALL_THICKNESS_OF_PRESSURE_PARTS\"")
private BigDecimal wallThicknessOfPressureParts;
/**
* * 受压部件无损检测方法
* */
@TableField(value ="\"NON_DESTRUCTIVE_TESTING_METHODS_FOR_PRESSURE_PARTS\"")
private String nonDestructiveTestingMethodsForPressureParts;
/**
* * 受压部件无损检测比例
* */
@TableField(value ="\"PROPORTION_OF_NDT_FOR_PRESSURE_PARTS\"")
private BigDecimal proportionOfNdtForPressureParts;
/**
* * 受压部件热处理温度
* */
@TableField(value ="\"HEAT_TREATMENT_TEMPERATURE_OF_PRESSURE_PARTS\"")
private BigDecimal heatTreatmentTemperatureOfPressureParts;
/**
* * 受压部件热处理时间
* */
@TableField(value ="\"HEAT_TREATMENT_TIME_OF_PRESSURE_PARTS\"")
private BigDecimal heatTreatmentTimeOfPressureParts;
/**
* * 受压部件水(耐)压试验介质
* */
@TableField(value ="\"HYDROSTATIC_TEST_MEDIUM\"")
private String hydrostaticTestMedium;
/**
* * 受压部件水(耐)压试验压力
* */
@TableField(value ="\"HYDROSTATIC_TEST_PRESSURE\"")
private BigDecimal hydrostaticTestPressure;
/**
* * 燃烧方式
* */
@TableField(value ="\"COMBUSTION_MODE\"")
private String combustionMode;
/**
* * 有机热载体锅炉气密试验介质/压力
* */
@TableField(value ="\"GL_AIRTIGHT_TEST\"")
private BigDecimal glAirtightTest;
}
package com.yeejoin.amos.boot.module.app.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
/**
* 安全追溯-电梯
*
* @author cpp
* @date 2023-04-06 15:21:22
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("idx_biz_jg_tech_params_elevator")
public class EquipTechParamElevator extends AbstractEquipBaseEntity {
private static final long serialVersionUID = 1L;
/**
* * $column.comments
* */
@TableField(value ="\"INSTANCE_ID\"")
private String instanceId;
/**
* * $column.comments
* */
@TableField(value ="\"STATUS\"")
private String status;
/**
* * 额定速度(上行)
* */
@TableField(value ="\"RATED_SPEED_UP\"")
private BigDecimal ratedSpeedUp;
/**
* * 额定速度(下行)
* */
@TableField(value ="\"RATED_SPEED_DOWN\"")
private BigDecimal ratedSpeedDown;
/**
* * 额定载重量
* */
@TableField(value ="\"RATED_LOAD_CAPACITY\"")
private BigDecimal ratedLoadCapacity;
/**
* * 轿厢尺寸
* */
@TableField(value ="\"CAR_SIZE\"")
private BigDecimal carSize;
/**
* * 提升高度
* */
@TableField(value ="\"LIFTING_HEIGHT\"")
private BigDecimal liftingHeight;
/**
* * 层
* */
@TableField(value ="\"STOREY\"")
private Integer storey;
/**
* * 站
* */
@TableField(value ="\"STAND\"")
private Integer stand;
/**
* * 门数
* */
@TableField(value ="\"NUMBER_DOORS\"")
private Integer numberDoors;
/**
* * 控制方式
* */
@TableField(value ="\"CONTROL_MODE\"")
private String controlMode;
/**
* * 油缸数量
* */
@TableField(value ="\"NUMBER_CYLINDERS\"")
private Integer numberCylinders;
/**
* * 顶升型式
* */
@TableField(value ="\"JACKING_TYPE\"")
private String jackingType;
/**
* * 额定压力
* */
@TableField(value ="\"RATED_PRESSURE\"")
private BigDecimal ratedPressure;
/**
* * 防爆型式
* */
@TableField(value ="\"EXPLOSIONPROOF_TYPE\"")
private String explosionproofType;
/**
* * 防爆等级
* */
@TableField(value ="\"EXPLOSIONPROOF_GRADE\"")
private String explosionproofGrade;
/**
* * 燃爆物质
* */
@TableField(value ="\"EXPLOSIVE_SUBSTANCE\"")
private String explosiveSubstance;
/**
* * 整机防爆标志
* */
@TableField(value ="\"EXPLOSIONPROOF_SIGN_COMPLETE\"")
private String explosionproofSignComplete;
/**
* * 驱动主机额定功率
* */
@TableField(value ="\"QDZJ_RATED_POWER\"")
private BigDecimal qdzjRatedPower;
/**
* * 驱动主机额定转速
* */
@TableField(value ="\"QDZJ_RATED_SPEED\"")
private BigDecimal qdzjRatedSpeed;
/**
* * 驱动主机减速比
* */
@TableField(value ="\"QDZJ_REDUCTION_RATIO\"")
private BigDecimal qdzjReductionRatio;
/**
* * 液压泵站满载工作压力
* */
@TableField(value ="\"YABZ_FULLLOAD_PRESSURE\"")
private BigDecimal yabzFullloadPressure;
/**
* * 悬挂系统悬挂介质种类
* */
@TableField(value ="\"XGXL_MEDIA_TYPE\"")
private String xgxlMediaType;
/**
* * 悬挂系统悬挂介质数量
* */
@TableField(value ="\"XGXL_MEDIA_NUMBER\"")
private Integer xgxlMediaNumber;
/**
* * 悬挂系统悬挂介质型号
* */
@TableField(value ="\"XGXL_MEDIA_MODEL\"")
private String xgxlMediaModel;
/**
* * 悬挂系统悬挂介质规格
* */
@TableField(value ="\"XGXL_MEDIA_SPECIFICATION\"")
private String xgxlMediaSpecification;
/**
* * 驱动主机型号
* */
@TableField(value ="\"QDZJ_MODEL\"")
private String qdzjModel;
/**
* * 驱动主机产品编号
* */
@TableField(value ="\"QDZJ_PRODUCT_NO\"")
private String qdzjProductNo;
/**
* * 驱动主机制造单位
* */
@TableField(value ="\"QDZJ_MANUFACTURER\"")
private String qdzjManufacturer;
/**
* * 控制柜型号
* */
@TableField(value ="\"KZG_MODEL\"")
private String kzgModel;
/**
* * 控制柜产品编号
* */
@TableField(value ="\"KZG_PRODUCT_NO\"")
private String kzgProductNo;
/**
* * 控制柜制造单位
* */
@TableField(value ="\"KZG_MANUFACTURER\"")
private String kzgManufacturer;
/**
* * 限速器型号
* */
@TableField(value ="\"XSQ_MODEL\"")
private String xsqModel;
/**
* * 限速器产品编号
* */
@TableField(value ="\"XSQ_PRODUCT_NO\"")
private String xsqProductNo;
/**
* * 限速器制造单位
* */
@TableField(value ="\"XSQ_MANUFACTURER\"")
private String xsqManufacturer;
/**
* * 安全钳型号
* */
@TableField(value ="\"AQQ_MODEL\"")
private String aqqModel;
/**
* * 安全钳产品编号
* */
@TableField(value ="\"AQQ_PRODUCT_NO\"")
private String aqqProductNo;
/**
* * 安全钳制造单位
* */
@TableField(value ="\"AQQ_MANUFACTURER\"")
private String aqqManufacturer;
/**
* * 轿厢缓冲器型号
* */
@TableField(value ="\"JXHCQ_MODEL\"")
private String jxhcqModel;
/**
* * 轿厢缓冲器产品编号
* */
@TableField(value ="\"JXHCQ_PRODUCT_NO\"")
private String jxhcqProductNo;
/**
* * 轿厢缓冲器制造单位
* */
@TableField(value ="\"JXHCQ_MANUFACTURER\"")
private String jxhcqManufacturer;
/**
* * 对重缓冲器型号
* */
@TableField(value ="\"DCHCQ_MODEL\"")
private String dchcqModel;
/**
* * 对重缓冲器产品编号
* */
@TableField(value ="\"DCHCQ_PRODUCT_NO\"")
private String dchcqProductNo;
/**
* * 对重缓冲器制造单位
* */
@TableField(value ="\"DCHCQ_MANUFACTURER\"")
private String dchcqManufacturer;
/**
* * 层门门锁装置型号
* */
@TableField(value ="\"CMMSZZ_MODEL\"")
private String cmmszzModel;
/**
* * 层门门锁装置产品编号
* */
@TableField(value ="\"CMMSZZ_PRODUCT_NO\"")
private String cmmszzProductNo;
/**
* * 层门门锁装置制造单位
* */
@TableField(value ="\"CMMSZZ_MANUFACTURER\"")
private String cmmszzManufacturer;
/**
* * 轿门门锁装置型号
* */
@TableField(value ="\"JMMSZZ_MODEL\"")
private String jmmszzModel;
/**
* * 轿门门锁装置产品编号
* */
@TableField(value ="\"JMMSZZ_PRODUCT_NO\"")
private String jmmszzProductNo;
/**
* * 轿门门锁装置制造单位
* */
@TableField(value ="\"JMMSZZ_MANUFACTURER\"")
private String jmmszzManufacturer;
/**
* * 上行超速保护装置型号
* */
@TableField(value ="\"SXCSBHZZ_MODEL\"")
private String sxcsbhzzModel;
/**
* * 上行超速保护装置产品编号
* */
@TableField(value ="\"SXCSBHZZ_PRODUCT_NO\"")
private String sxcsbhzzProductNo;
/**
* * 上行超速保护装置制造单位
* */
@TableField(value ="\"SXCSBHZZ_MANUFACTURER\"")
private String sxcsbhzzManufacturer;
/**
* * 轿厢意外移动保护装置型号
* */
@TableField(value ="\"JXYWYDBHZZ_MODEL\"")
private String jxywydbhzzModel;
/**
* * 轿厢意外移动保护装置
* */
@TableField(value ="\"JXYWYDBHZZ_PRODUCT_NO\"")
private String jxywydbhzzProductNo;
/**
* * 轿厢意外移动保护装置制造单位
* */
@TableField(value ="\"JXYWYDBHZZ_MANUFACTURER\"")
private String jxywydbhzzManufacturer;
/**
* * 液压泵站型号
* */
@TableField(value ="\"YYBZ_MODEL\"")
private String yybzModel;
/**
* * 液压泵站产品编号
* */
@TableField(value ="\"YYBZ_PRODUCT_NO\"")
private String yybzProductNo;
/**
* * 液压泵站制造单位
* */
@TableField(value ="\"YYBZ_MANUFACTURER\"")
private String yybzManufacturer;
/**
* * 限速切断阀型号
* */
@TableField(value ="\"XSQDF_MODEL\"")
private String xsqdfModel;
/**
* * 限速切断阀产品编号
* */
@TableField(value ="\"XSQDF_PRODUCT_NO\"")
private String xsqdfProductNo;
/**
* * 限速切断阀制造单位
* */
@TableField(value ="\"XSQDF_MANUFACTURER\"")
private String xsqdfManufacturer;
/**
* * 名义速度
* */
@TableField(value ="\"NOMINAL_SPEED\"")
private BigDecimal nominalSpeed;
/**
* * 倾斜角
* */
@TableField(value ="\"ANGLE_ROLL\"")
private BigDecimal angleRoll;
/**
* * 名义宽度
* */
@TableField(value ="\"NOMINAL_WIDTH\"")
private BigDecimal nominalWidth;
/**
* * 使用区段长度
* */
@TableField(value ="\"USE_SECTION_LENGTH\"")
private BigDecimal useSectionLength;
/**
* * 输送能力
* */
@TableField(value ="\"CONVEYING_CAPACITY\"")
private String conveyingCapacity;
/**
* * 工作类型
* */
@TableField(value ="\"WORK_TYPE\"")
private String workType;
/**
* * 工作环境
* */
@TableField(value ="\"WORK_ENVIRONMENT\"")
private String workEnvironment;
/**
* * 控制柜节能运行方式
* */
@TableField(value ="\"KZG_OPERATION_MODE\"")
private String kzgOperationMode;
}
package com.yeejoin.amos.boot.module.app.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
/**
* 安全追溯-起重机械
*
* @author cpp
* @date 2023-04-06 15:21:22
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("idx_biz_jg_tech_params_lifting")
public class EquipTechParamLifting extends AbstractEquipBaseEntity {
private static final long serialVersionUID = 1L;
/**
* * $column.comments
* */
@TableField(value ="\"INSTANCE_ID\"")
private String instanceId;
/**
* * $column.comments
* */
@TableField(value ="\"STATUS\"")
private String status;
/**
* * 额定起重量
* */
@TableField(value ="\"RATED_LIFTING_CAPACITY\"")
private BigDecimal ratedLiftingCapacity;
/**
* * 最大起重量
* */
@TableField(value ="\"MAX_LIFTING_CAPACITY\"")
private BigDecimal maxLiftingCapacity;
/**
* * 最大起重力矩
* */
@TableField(value ="\"MAX_LIFTING_TORQUE\"")
private BigDecimal maxLiftingTorque;
/**
* * 跨度(工作幅度)
* */
@TableField(value ="\"SPAN_WORKING_RANGE\"")
private BigDecimal spanWorkingRange;
/**
* * 起升速度
* */
@TableField(value ="\"LIFTING_SPEED\"")
private BigDecimal liftingSpeed;
/**
* * 起升高度
* */
@TableField(value ="\"LIFTING_HEIGHT\"")
private BigDecimal liftingHeight;
/**
* * 下降速度
* */
@TableField(value ="\"DESCENT_SPEED\"")
private BigDecimal descentSpeed;
/**
* * 变幅高度
* */
@TableField(value ="\"LUFFING_HEIGHT\"")
private BigDecimal luffingHeight;
/**
* * 回转速度
* */
@TableField(value ="\"SLEWING_SPEED\"")
private BigDecimal slewingSpeed;
/**
* * 高度
* */
@TableField(value ="\"HEIGHT\"")
private BigDecimal height;
/**
* * 工作级别
* */
@TableField(value ="\"WORK_LEVEL\"")
private String workLevel;
/**
* * 额定起重力矩
* */
@TableField(value ="\"RATED_LIFTING_TORQUE\"")
private BigDecimal ratedLiftingTorque;
/**
* * 最大起升高度
* */
@TableField(value ="\"MAXI_LIFTING_HEIGHT\"")
private BigDecimal maxiLiftingHeight;
/**
* * 最大工作幅度
* */
@TableField(value ="\"MAX_WORK_RANGE\"")
private BigDecimal maxWorkRange;
/**
* * 最大工作幅度对应的起重量
* */
@TableField(value ="\"MAX_WOK_RANGE_WEIGHT\"")
private BigDecimal maxWokRangeWeight;
/**
* * 最大附着高度
* */
@TableField(value ="\"MAX_ATTACHMENT_HEIGHT\"")
private BigDecimal maxAttachmentHeight;
/**
* * 最大计算轮压
* */
@TableField(value ="\"MAX_CALCULATED_PRESSURE\"")
private BigDecimal maxCalculatedPressure;
/**
* * 整机设计重量
* */
@TableField(value ="\"MACHINE_DESIGN_WEIGHT\"")
private BigDecimal machineDesignWeight;
/**
* * 运行轨距
* */
@TableField(value ="\"RUN_GAUGE\"")
private BigDecimal runGauge;
/**
* * 整机功率
* */
@TableField(value ="\"OVERALL_POWER\"")
private BigDecimal overallPower;
/**
* * 供电电源
* */
@TableField(value ="\"POWER_SUPPLY\"")
private BigDecimal powerSupply;
/**
* * 工作环境温度
* */
@TableField(value ="\"WORK_AMBIENT_TEMPERATURE\"")
private BigDecimal workAmbientTemperature;
/**
* * 层数/泊位数
* */
@TableField(value ="\"NUMBER_STOREY\"")
private Integer numberStorey;
/**
* * 主体结构型式
* */
@TableField(value ="\"MAIN_STRUCTURE_TYPE\"")
private String mainStructureType;
/**
* * 主要受力结构件材料
* */
@TableField(value ="\"MAIN_STRESSED_STRUCTURAL_MATERIAL\"")
private String mainStressedStructuralMaterial;
/**
* * 变幅方式
* */
@TableField(value ="\"LUFFING_MODE\"")
private String luffingMode;
/**
* * 塔身标准节型式
* */
@TableField(value ="\"TOWER_STANDARD_TYPE\"")
private String towerStandardType;
/**
* * 基座型式
* */
@TableField(value ="\"BASE_TYPE\"")
private String baseType;
/**
* * 大车运行速度
* */
@TableField(value ="\"BIGCAR_RUN_SPEED\"")
private BigDecimal bigcarRunSpeed;
/**
* * 小车运行速度
* */
@TableField(value ="\"SMALLCARRUN_SPEED\"")
private BigDecimal smallcarrunSpeed;
/**
* * 大车基距
* */
@TableField(value ="\"BIGCAR_BASE_DISTANCE\"")
private BigDecimal bigcarBaseDistance;
/**
* * 小车轨距
* */
@TableField(value ="\"SMALLCAR_BASE_DISTANCE\"")
private BigDecimal smallcarBaseDistance;
/**
* * 主钩左右极限位置
* */
@TableField(value ="\"MAIN_HOOK_LEFT_AND_RIGHT_LIMIT_POSITIONS\"")
private BigDecimal mainHookLeftAndRightLimitPositions;
/**
* * 主梁型式
* */
@TableField(value ="\"MAIN_BEAM_TYPE\"")
private String mainBeamType;
/**
* * 支腿型式
* */
@TableField(value ="\"OUTRIGGER_TYPE\"")
private String outriggerType;
/**
* * 最小工作幅度
* */
@TableField(value ="\"MIN_WORK_RANGE\"")
private BigDecimal minWorkRange;
/**
* * 最小幅度起重量
* */
@TableField(value ="\"MIN_LIFTING_CAPACITY\"")
private BigDecimal minLiftingCapacity;
/**
* * 全程变幅时间
* */
@TableField(value ="\"FULL_RANGE_LUFFING_TIME\"")
private BigDecimal fullRangeLuffingTime;
/**
* * 行走机械轨距
* */
@TableField(value ="\"TRAVEL_MACHINE_GAUGE\"")
private BigDecimal travelMachineGauge;
/**
* * 行驶速度
* */
@TableField(value ="\"TRAVEL_SPEED\"")
private BigDecimal travelSpeed;
/**
* * 支腿调节长度
* */
@TableField(value ="\"LEG_ADJUSTMENT_LENGTH\"")
private BigDecimal legAdjustmentLength;
/**
* * 发动机型号/VIN代号/编号
* */
@TableField(value ="\"ENGINE_MODEL\"")
private String engineModel;
/**
* * 臂架型式
* */
@TableField(value ="\"BOOM_TYPE\"")
private String boomType;
/**
* * 起升高度(轨上)
* */
@TableField(value ="\"LIFTING_HEIGHT_ON_RAIL\"")
private BigDecimal liftingHeightOnRail;
/**
* * 起升高度(轨下)
* */
@TableField(value ="\"LIFTING_HEIGHT_UNDER_RAIL\"")
private BigDecimal liftingHeightUnderRail;
/**
* * 整机最大高度
* */
@TableField(value ="\"MACHINE_MAX_HEIGHT\"")
private BigDecimal machineMaxHeight;
/**
* * 用途
* */
@TableField(value ="\"USE\"")
private String use;
/**
* * 臂架结构型式
* */
@TableField(value ="\"BOOM_STRUCTURE_TYPE\"")
private String boomStructureType;
/**
* * 门架结构型式
* */
@TableField(value ="\"GANTRY_STRUCTURE_TYPE\"")
private String gantryStructureType;
/**
* * 额定载重量
* */
@TableField(value ="\"RATED_LOAD_CAPACITY\"")
private BigDecimal ratedLoadCapacity;
/**
* * 额定成员数
* */
@TableField(value ="\"RATED_MEMBERS\"")
private Integer ratedMembers;
/**
* * 额定提升速度
* */
@TableField(value ="\"RATED_LIFTING_SPEED\"")
private BigDecimal ratedLiftingSpeed;
/**
* * 自由端高度
* */
@TableField(value ="\"HEIGHT_FREE_END\"")
private BigDecimal heightFreeEnd;
/**
* * 最大提升高度
* */
@TableField(value ="\"MAXIMUM_LIFTING_HEIGHT\"")
private BigDecimal maximumLiftingHeight;
/**
* * 吊笼工作行程
* */
@TableField(value ="\"WORK_STROKE_CAGE\"")
private BigDecimal workStrokeCage;
/**
* * 吊笼尺寸(长×宽×高)
* */
@TableField(value ="\"CAGE_SIZE\"")
private BigDecimal cageSize;
/**
* * 标准节尺寸(长×宽×高)
* */
@TableField(value ="\"STANDARD_SECTION_SIZE\"")
private BigDecimal standardSectionSize;
/**
* * 操纵方式
* */
@TableField(value ="\"CONTROL_MODE\"")
private String controlMode;
/**
* * 驱动机构型式
* */
@TableField(value ="\"DRIVE_MECHANISM_TYPE\"")
private String driveMechanismType;
/**
* * 标准节加节方式
* */
@TableField(value ="\"STANDARD_SECTION_ADD_METHOD\"")
private String standardSectionAddMethod;
/**
* * 存容量
* */
@TableField(value ="\"STORAGE_CAPACITY\"")
private Integer storageCapacity;
/**
* * 起升驱动方式
* */
@TableField(value ="\"LIFTING_DRIVE_MODE\"")
private String liftingDriveMode;
/**
* * 适停车辆尺寸 (长×宽×高)
* */
@TableField(value ="\"PARKING_VEHICLE_SIZE\"")
private BigDecimal parkingVehicleSize;
/**
* * 额定升降速度
* */
@TableField(value ="\"RATED_LIFT_SPEED\"")
private BigDecimal ratedLiftSpeed;
/**
* * 额定横移速度
* */
@TableField(value ="\"RATED_TRAVERSE_SPEED\"")
private BigDecimal ratedTraverseSpeed;
/**
* * 额定纵移速度
* */
@TableField(value ="\"RATED_LONGITUDINAL_SPEED\"")
private BigDecimal ratedLongitudinalSpeed;
/**
* * 单车最大进(出)车时间
* */
@TableField(value ="\"BICYCLE_MAX_EXIT_TIME\"")
private BigDecimal bicycleMaxExitTime;
/**
* * 循环速度
* */
@TableField(value ="\"CYCLE_SPEED\"")
private BigDecimal cycleSpeed;
/**
* * 适停车辆质量
* */
@TableField(value ="\"PARKING_VEHICLE_MASS\"")
private BigDecimal parkingVehicleMass;
/**
* * 层高
* */
@TableField(value ="\"STOREY_HEIGHT\"")
private BigDecimal storeyHeight;
/**
* * 操作方式
* */
@TableField(value ="\"OPERATION_MODE\"")
private String operationMode;
/**
* * 其 他
* */
@TableField(value ="\"OTHER\"")
private String other;
/**
* * 起升方式
* */
@TableField(value ="\"LIFTING_MODE\"")
private String liftingMode;
/**
* * 最大轮压
* */
@TableField(value ="\"MAX_PRESSURE\"")
private BigDecimal maxPressure;
/**
* * 下降深度
* */
@TableField(value ="\"DEPTH_DESCENT\"")
private BigDecimal depthDescent;
/**
* * 防爆等级
* */
@TableField(value ="\"EXPLOSION_PROOF_GRADE\"")
private String explosionProofGrade;
/**
* * 防爆型式
* */
@TableField(value ="\"EXPLOSION_PROOF_TYPE\"")
private String explosionProofType;
/**
* * 吊具型式
* */
@TableField(value ="\"SLING_TYPE\"")
private String slingType;
/**
* * 主要受力机构件材料
* */
@TableField(value ="\"MAIN_STRESSED_MECHANISM\"")
private String mainStressedMechanism;
/**
* * 起升机构起升速度倍率
* */
@TableField(value ="\"HOIST_LIFTING_MECHANISM_SPEED\"")
private BigDecimal hoistLiftingMechanismSpeed;
/**
* * 起升机构起升速度
* */
@TableField(value ="\"HOIST_LIFTING_SPEED_LIFTING\"")
private BigDecimal hoistLiftingSpeedLifting;
/**
* * 起升机构起升速度相应最大起重量
* */
@TableField(value ="\"HOIST_LIFTING_CORRESPONDING_MAX_WEIGHT\"")
private BigDecimal hoistLiftingCorrespondingMaxWeight;
/**
* * 起升机构电机型号
* */
@TableField(value ="\"HOIST_MOTOR_MODEL\"")
private String hoistMotorModel;
/**
* * 起升机构电机数量
* */
@TableField(value ="\"HOIST_MOTORS_NUMBER\"")
private Integer hoistMotorsNumber;
/**
* * 起升机构功率
* */
@TableField(value ="\"HOIST_POWER\"")
private BigDecimal hoistPower;
/**
* * 起升机构制动器型号
* */
@TableField(value ="\"HOIST_BRAKE_MODEL\"")
private String hoistBrakeModel;
/**
* * 起升机构制动器数量
* */
@TableField(value ="\"HOIST_BRAKES_BRAKES\"")
private Integer hoistBrakesBrakes;
/**
* * 起升机构工作级别
* */
@TableField(value ="\"HOIST_WORKING_LEVEL\"")
private String hoistWorkingLevel;
/**
* * 起升机构卷筒直径
* */
@TableField(value ="\"HOIST_DRUM_DIAMETER\"")
private BigDecimal hoistDrumDiameter;
/**
* * 起升机构定滑轮直径
* */
@TableField(value ="\"HOIST_FIXED_PULLEY_DIAMETER\"")
private BigDecimal hoistFixedPulleyDiameter;
/**
* * 起升机构传动比
* */
@TableField(value ="\"HOIST_TRANSMISSION_RATIO\"")
private String hoistTransmissionRatio;
/**
* * 起升机构大车轮直径
* */
@TableField(value ="\"HOIST_BIGCAR_DIAMETER\"")
private BigDecimal hoistBigcarDiameter;
/**
* * 起升机构小车轮直径
* */
@TableField(value ="\"HOIST_SMALLCAR_DIAMETER\"")
private BigDecimal hoistSmallcarDiameter;
/**
* * 大车行走机构速度
* */
@TableField(value ="\"BIGCAR_TRAVE_SPEED\"")
private BigDecimal bigcarTraveSpeed;
/**
* * 大车行走机构功率
* */
@TableField(value ="\"BIGCAR_TRAVE_POWER\"")
private BigDecimal bigcarTravePower;
/**
* * 大车行走机构工作级别
* */
@TableField(value ="\"BIGCAR_TRAVE_WORKING_LEVEL\"")
private String bigcarTraveWorkingLevel;
/**
* * 大车行走机构减速器型号
* */
@TableField(value ="\"BIGCAR_TRAVE_REDUCER_MODEL\"")
private String bigcarTraveReducerModel;
/**
* * 大车行走机构传动比
* */
@TableField(value ="\"BIGCAR_TRAVE_TRANSMISSION_RATIO\"")
private String bigcarTraveTransmissionRatio;
/**
* * 大车行走机构制动力矩
* */
@TableField(value ="\"BIGCAR_TRAVE_BRAK_TORQUE\"")
private BigDecimal bigcarTraveBrakTorque;
/**
* * 大车行走机构大车车轮路面直径
* */
@TableField(value ="\"BIGCAR_TRAVE_ROAD_DIAMETER\"")
private BigDecimal bigcarTraveRoadDiameter;
/**
* * 大车行走机构适应轨道
* */
@TableField(value ="\"BIG_TRAVE_ADAPT_TRACK\"")
private String bigTraveAdaptTrack;
/**
* * 大车行走机构电机型号
* */
@TableField(value ="\"BIGCAR_TRAVE_MOTOR_MODEL\"")
private String bigcarTraveMotorModel;
/**
* * 大车行走机构电机数量
* */
@TableField(value ="\"BIGCAR_TRAVE_MOTOR_QUANTITY\"")
private Integer bigcarTraveMotorQuantity;
/**
* * 大车行走机构制动器型号
* */
@TableField(value ="\"BIGCAR_TRAVE_CONTROL_BRAKE_MODEL\"")
private String bigcarTraveControlBrakeModel;
/**
* * 大车行走机构制动器数量
* */
@TableField(value ="\"BIGCAR_TRAVE_BRAKE_NUMBER\"")
private Integer bigcarTraveBrakeNumber;
/**
* * 小车行走机构速度
* */
@TableField(value ="\"SMALLCAR_TRAVE_SPEED\"")
private BigDecimal smallcarTraveSpeed;
/**
* * 小车行走机构功率
* */
@TableField(value ="\"SMALLCAR_TRAVE_POWER\"")
private BigDecimal smallcarTravePower;
/**
* * 小车行走机构转速
* */
@TableField(value ="\"SMALLCAR_TRAVE_REVOLVE_SPEED\"")
private BigDecimal smallcarTraveRevolveSpeed;
/**
* * 小车行走机构工作级别
* */
@TableField(value ="\"SMALLCAR_TRAVE_WORKING_LEVEL\"")
private String smallcarTraveWorkingLevel;
/**
* * 小车行走机构减速器型号
* */
@TableField(value ="\"SMALLCAR_TRAVE_REDUCER_MODEL\"")
private String smallcarTraveReducerModel;
/**
* * 小车行走机构传动比
* */
@TableField(value ="\"SMALLCAR_TRAVE_TRANSMISSION_RATIO\"")
private String smallcarTraveTransmissionRatio;
/**
* * 小车行走机构制动力矩
* */
@TableField(value ="\"SMALLCAR_TRAVE_BRAK_TORQUE\"")
private BigDecimal smallcarTraveBrakTorque;
/**
* * 小车行走机构小车车轮路面直径
* */
@TableField(value ="\"SMALLCAR_TRAVE_ROAD_DIAMETER\"")
private BigDecimal smallcarTraveRoadDiameter;
/**
* * 小车行走机构小车轨道
* */
@TableField(value ="\"SMALLCAR_TRAVE_TROLLEY_TRACK\"")
private String smallcarTraveTrolleyTrack;
/**
* * 小车行走机构电机型号
* */
@TableField(value ="\"SMALLCAR_TRAVE_MOTOR_MODEL\"")
private String smallcarTraveMotorModel;
/**
* * 小车行走机构电机数量
* */
@TableField(value ="\"SMALLCAR_TRAVE_MOTOR_QUANTITY\"")
private Integer smallcarTraveMotorQuantity;
/**
* * 小车行走机构制动器型号
* */
@TableField(value ="\"SMALLCAR_TRAVE_CONTROL_BRAKE_MODEL\"")
private String smallcarTraveControlBrakeModel;
/**
* * 小车行走机构制动器数量
* */
@TableField(value ="\"SMALLCAR_TRAVE_BRAKE_NUMBER\"")
private Integer smallcarTraveBrakeNumber;
/**
* * 电源电压
* */
@TableField(value ="\"SUPPLY_VOLTAGE\"")
private BigDecimal supplyVoltage;
/**
* * 电源频率
* */
@TableField(value ="\"POWER_FREQUENCY\"")
private BigDecimal powerFrequency;
/**
* * 非工作风压
* */
@TableField(value ="\"NO_WORK_WIND_PRESSSURE\"")
private BigDecimal noWorkWindPresssure;
/**
* * 工作风压
* */
@TableField(value ="\"WORK_WIND_PRESSSURE\"")
private BigDecimal workWindPresssure;
/**
* * 环境温度
* */
@TableField(value ="\"AMBIENT_TEMPERATURE\"")
private BigDecimal ambientTemperature;
/**
* * 吊钩部位辐射温度
* */
@TableField(value ="\"RADIATION_TEMPERATURE_OF_HOOK\"")
private BigDecimal radiationTemperatureOfHook;
/**
* * 梁架跨度
* */
@TableField(value ="\"BEAM_FRAME_SPAN\"")
private BigDecimal beamFrameSpan;
/**
* * 桥机跨度
* */
@TableField(value ="\"BRIDGE_CRANE_SPAN\"")
private BigDecimal bridgeCraneSpan;
/**
* * 最大架设纵坡
* */
@TableField(value ="\"MAX_ERECTION_LONGITUDINAL_SLOPE\"")
private BigDecimal maxErectionLongitudinalSlope;
/**
* * 前支腿调节长度
* */
@TableField(value ="\"ADJUSTABLE_LENGTH_OF_FRONT_OUTRIGGER\"")
private BigDecimal adjustableLengthOfFrontOutrigger;
/**
* * 最大架设横坡
* */
@TableField(value ="\"MAX_ERECTION_CROSS_SLOPE\"")
private BigDecimal maxErectionCrossSlope;
/**
* * 整机高度
* */
@TableField(value ="\"OVERALL_HEIGHT\"")
private BigDecimal overallHeight;
/**
* * 整机宽度
* */
@TableField(value ="\"OVERALL_WIDTH\"")
private BigDecimal overallWidth;
/**
* * 整机总功率
* */
@TableField(value ="\"OVERALL_UNIT_POWER\"")
private BigDecimal overallUnitPower;
/**
* * 小车纵移速度
* */
@TableField(value ="\"SMALLCAR_LONGITUDINAL_MOVING_SPEED\"")
private BigDecimal smallcarLongitudinalMovingSpeed;
/**
* * 过孔速度
* */
@TableField(value ="\"THROUGH_HOLE_VELOCITY\"")
private BigDecimal throughHoleVelocity;
/**
* * 整机横移速度
* */
@TableField(value ="\"OVERALL_TRAVERSE_SPEED\"")
private BigDecimal overallTraverseSpeed;
/**
* * 小车横移速度
* */
@TableField(value ="\"SMALLCAR_TRAVERSE_SPEED\"")
private BigDecimal smallcarTraverseSpeed;
/**
* * 整机长度
* */
@TableField(value ="\"OVERALL_LENGTH\"")
private BigDecimal overallLength;
/**
* * 前导梁长度
* */
@TableField(value ="\"LENGTH_OF_FRONT_GUIDE_BEAM\"")
private BigDecimal lengthOfFrontGuideBeam;
/**
* * 起升机构减速器型号
* */
@TableField(value ="\"HOIST_REDUCER_MODEL\"")
private String hoistReducerModel;
/**
* * 大车行走适应轨道
* */
@TableField(value ="\"BIGCAR_TRAVE_ADAPTATION_TRACK\"")
private String bigcarTraveAdaptationTrack;
/**
* * 大车行走制动器型号
* */
@TableField(value ="\"BIGCAR_TRAVE_BRAKE_MODEL\"")
private String bigcarTraveBrakeModel;
/**
* * 小车行走机构小车车轮踏面直径
* */
@TableField(value ="\"SMALLCAR_TRAVE_SMALL_TREAD_DIAMETER\"")
private BigDecimal smallcarTraveSmallTreadDiameter;
/**
* * 小车行走机构制动器型号
* */
@TableField(value ="\"SMALLCAR_TRAVE_BRAKE_MODEL\"")
private String smallcarTraveBrakeModel;
/**
* * 小车横移机构速度
* */
@TableField(value ="\"SMALLCAR_SIDESWAY_SPEED\"")
private BigDecimal smallcarSideswaySpeed;
/**
* * 小车横移机构功率
* */
@TableField(value ="\"SMALLCAR_SIDESWAY_POWER\"")
private BigDecimal smallcarSideswayPower;
/**
* * 小车横移机构转速
* */
@TableField(value ="\"SMALLCAR_SIDESWAY_REVOLVE_SPEED\"")
private BigDecimal smallcarSideswayRevolveSpeed;
/**
* * 小车横移机构工作级别
* */
@TableField(value ="\"SMALLCAR_SIDESWAY_WORKING_LEVEL\"")
private String smallcarSideswayWorkingLevel;
/**
* * 小车横移机构减速器型号
* */
@TableField(value ="\"SMALLCAR_SIDESWAY_REDUCER_MODEL\"")
private String smallcarSideswayReducerModel;
/**
* * 小车横移机构传动比
* */
@TableField(value ="\"SMALLCAR_SIDESWAY_TRANSMISSION_RATIO\"")
private String smallcarSideswayTransmissionRatio;
/**
* * 小车横移机构小车横移轨道
* */
@TableField(value ="\"SMALLCAR_SIDESWAY_SMALL_TRAVERSE_TRACK\"")
private String smallcarSideswaySmallTraverseTrack;
/**
* * 小车横移机构制动器型号
* */
@TableField(value ="\"SMALLCAR_SIDESWAY_BRAKE_MODEL\"")
private String smallcarSideswayBrakeModel;
/**
* * 小车横移机构制动力矩
* */
@TableField(value ="\"SMALLCAR_SIDESWAY_BRAK_TORQUE\"")
private BigDecimal smallcarSideswayBrakTorque;
/**
* * 小车横移机构小车横移车轮踏面直径
* */
@TableField(value ="\"SMALLCAR_SIDESWAY_TREAD_DIAMETER\"")
private BigDecimal smallcarSideswayTreadDiameter;
/**
* * 小车横移机构电机型号
* */
@TableField(value ="\"SMALLCAR_SIDESWAY_MOTOR_QUANTITY\"")
private String smallcarSideswayMotorQuantity;
/**
* * 小车横移机构电机数量
* */
@TableField(value ="\"SMALLCAR_SIDESWAY_MOTOR_NUMBER\"")
private Integer smallcarSideswayMotorNumber;
/**
* * 悬臂长度
* */
@TableField(value ="\"CANTILEVER_LENGTH\"")
private BigDecimal cantileverLength;
/**
* * 使用场所
* */
@TableField(value ="\"PLACE_USE\"")
private String placeUse;
/**
* * 变幅速度
* */
@TableField(value ="\"DERRICKING_SPEED\"")
private BigDecimal derrickingSpeed;
/**
* * 最大幅度起重量
* */
@TableField(value ="\"MAXIMUM_LIFTING_CAPACITY\"")
private BigDecimal maximumLiftingCapacity;
/**
* * 导轨架
* */
@TableField(value ="\"GUIDE_RAIL_FRAME\"")
private String guideRailFrame;
/**
* * 层数
* */
@TableField(value ="\"NUMBER_OF_PLIES\"")
private Integer numberOfPlies;
/**
* * 整机重量
* */
@TableField(value ="\"OPERATING_WEIGHT\"")
private BigDecimal operatingWeight;
/**
* * 起升机构制动力矩
* */
@TableField(value ="\"HOIST_BRAKING_TORQUE\"")
private BigDecimal hoistBrakingTorque;
/**
* * 起升机构钢丝绳型号
* */
@TableField(value ="\"HOIST_WIRE_ROPE\"")
private String hoistWireRope;
/**
* * 吊笼数量
* */
@TableField(value ="\"HANGING_CAGES_NUMBER\"")
private String hangingCagesNumber;
/**
* * 安全保护装置
* */
@TableField(value ="\"SAFETY_PROTECTION_DEVICE\"")
private String safetyProtectionDevice;
/**
* * 主要零部件
* */
@TableField(value ="\"MAIN_PART\"")
private String mainPart;
}
package com.yeejoin.amos.boot.module.app.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
/**
* 安全追溯-压力管道
*
* @author cpp
* @date 2023-04-06 15:21:22
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("idx_biz_jg_tech_params_pipeline")
public class EquipTechParamPipeline extends AbstractEquipBaseEntity {
private static final long serialVersionUID = 1L;
/**
* * $column.comments
* */
@TableField(value ="\"INSTANCE_ID\"")
private String instanceId;
/**
* * $column.comments
* */
@TableField(value ="\"STATUS\"")
private String status;
/**
* * 工程(装置)名称
* */
@TableField(value ="\"DEVICE_NAME\"")
private String deviceName;
/**
* * 管道类别
* */
@TableField(value ="\"PIPELINE_CLASS\"")
private String pipelineClass;
/**
* * 管道名称(登记单元)
* */
@TableField(value ="\"PIPE_NAME\"")
private String pipeName;
/**
* * 管道编号
* */
@TableField(value ="\"PIPELINE_NUMBER\"")
private String pipelineNumber;
/**
* * 设备级别
* */
@TableField(value ="\"DEVICE_LEVEL\"")
private String deviceLevel;
/**
* * 设计标准
* */
@TableField(value ="\"DESIGN_STANDARD\"")
private String designStandard;
/**
* * 管道图号
* */
@TableField(value ="\"PIPE_DRAW_NUMBER\"")
private String pipeDrawNumber;
/**
* * 公称直径
* */
@TableField(value ="\"NOMINAL_DIAMETER\"")
private BigDecimal nominalDiameter;
/**
* * 公称壁厚
* */
@TableField(value ="\"WALL_THICKNESS\"")
private BigDecimal wallThickness;
/**
* * 管道长度
* */
@TableField(value ="\"PIPE_LENGTH\"")
private BigDecimal pipeLength;
/**
* * 起始位置起点
* */
@TableField(value ="\"STARTE_POSITION\"")
private String startePosition;
/**
* * 压力
* */
@TableField(value ="\"PRESSURE\"")
private BigDecimal pressure;
/**
* * 温度
* */
@TableField(value ="\"TEMPERATURE\"")
private BigDecimal temperature;
/**
* * 介质
* */
@TableField(value ="\"MEDIUM\"")
private String medium;
/**
* * 备注
* */
@TableField(value ="\"REMARKS\"")
private String remarks;
}
package com.yeejoin.amos.boot.module.app.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
/**
* 安全追溯-游乐设施
*
* @author cpp
* @date 2023-04-06 15:21:22
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("idx_biz_jg_tech_params_rides")
public class EquipTechParamRides extends AbstractEquipBaseEntity {
private static final long serialVersionUID = 1L;
/**
* * $column.comments
* */
/**
* * $column.comments
* */
@TableField(value ="\"INSTANCE_ID\"")
private String instanceId;
/**
* * $column.comments
* */
@TableField(value ="\"STATUS\"")
private String status;
/**
* * 设计寿命
* */
@TableField(value ="\"DESIGN_LIFE\"")
private Integer designLife;
/**
* * 滑道长度
* */
@TableField(value ="\"SLIDE_LENGTH\"")
private BigDecimal slideLength;
/**
* * 滑道高度
* */
@TableField(value ="\"SLIDE_HEIGHT\"")
private BigDecimal slideHeight;
/**
* * 滑道最小坡度
* */
@TableField(value ="\"MINIMUM_SLOPE_OF_SLIDE\"")
private BigDecimal minimumSlopeOfSlide;
/**
* * 滑道平均坡度
* */
@TableField(value ="\"AVERAGE_SLOPE_OF_SLIDE\"")
private BigDecimal averageSlopeOfSlide;
/**
* * 滑道无跳跃段最大坡度
* */
@TableField(value ="\"MAXIMUM_SLOPE_OF_THE_SLIDE_WITHOUT_JUMPING\"")
private BigDecimal maximumSlopeOfTheSlideWithoutJumping;
/**
* * 滑道最小曲率半径
* */
@TableField(value ="\"MINIMUM_RADIUS_OF_CURVATURE_OF_SLIDEWAY\"")
private BigDecimal minimumRadiusOfCurvatureOfSlideway;
/**
* * 滑道数量
* */
@TableField(value ="\"NUMBER_OF_SLIDES\"")
private Integer numberOfSlides;
/**
* * 滑道主体材料
* */
@TableField(value ="\"MAIN_MATERIAL_OF_SLIDE\"")
private String mainMaterialOfSlide;
/**
* * 滑车数量
* */
@TableField(value ="\"NUMBER_OF_PULLEYS\"")
private Integer numberOfPulleys;
/**
* * 乘坐人数
* */
@TableField(value ="\"NUMBER_OF_PASSENGERS\"")
private Integer numberOfPassengers;
/**
* * 水平距离
* */
@TableField(value ="\"HORIZONTAL_DISTANCE\"")
private BigDecimal horizontalDistance;
/**
* * 高度
* */
@TableField(value ="\"HEIGHT\"")
private BigDecimal height;
/**
* * 下滑速度
* */
@TableField(value ="\"GLIDE_SPEED\"")
private BigDecimal glideSpeed;
/**
* * 乘员数
* */
@TableField(value ="\"COUNT_OF_PASSENGERS\"")
private Integer countOfPassengers;
/**
* * 运行速度
* */
@TableField(value ="\"RUNNING_SPEED\"")
private BigDecimal runningSpeed;
/**
* * 车辆数
* */
@TableField(value ="\"NUMBER_OF_VEHICLES\"")
private Integer numberOfVehicles;
/**
* * 功率
* */
@TableField(value ="\"POWER\"")
private BigDecimal power;
/**
* * 轨道高度
* */
@TableField(value ="\"TRACK_HEIGHT\"")
private BigDecimal trackHeight;
/**
* * 成员数
* */
@TableField(value ="\"NUMBER_OF_MEMBERS\"")
private Integer numberOfMembers;
/**
* * 运行高度
* */
@TableField(value ="\"OPERATING_HEIGHT\"")
private BigDecimal operatingHeight;
/**
* * 驱动功率
* */
@TableField(value ="\"DRIVE_POWER\"")
private BigDecimal drivePower;
/**
* * 回转直径
* */
@TableField(value ="\"ROTARY_DIAMETER\"")
private BigDecimal rotaryDiameter;
/**
* * 额定乘客数
* */
@TableField(value ="\"RATED_NUMBER_OF_PASSENGERS\"")
private Integer ratedNumberOfPassengers;
/**
* * 吊舱数量
* */
@TableField(value ="\"NUMBER_OF_PODS\"")
private Integer numberOfPods;
/**
* * 设备高度
* */
@TableField(value ="\"EQUIPMENT_HEIGHT\"")
private BigDecimal equipmentHeight;
/**
* * 额定线速度
* */
@TableField(value ="\"RATED_LINEAR_SPEED\"")
private BigDecimal ratedLinearSpeed;
/**
* * 转盘转速
* */
@TableField(value ="\"ROTARY_TABLE_SPEED\"")
private BigDecimal rotaryTableSpeed;
/**
* * 单边摆角
* */
@TableField(value ="\"UNILATERAL_SWING_ANGLE\"")
private BigDecimal unilateralSwingAngle;
/**
* * 座舱数量
* */
@TableField(value ="\"NUMBER_OF_CABINS\"")
private Integer numberOfCabins;
/**
* * 最大运行高度
* */
@TableField(value ="\"MAXIMUM_OPERATING_HEIGHT\"")
private BigDecimal maximumOperatingHeight;
/**
* * 旋转直径
* */
@TableField(value ="\"ROTATION_DIAMETER\"")
private BigDecimal rotationDiameter;
/**
* * 最大转速
* */
@TableField(value ="\"MAXIMUM_SPEED\"")
private BigDecimal maximumSpeed;
/**
* * 倾角
* */
@TableField(value ="\"DIP\"")
private BigDecimal dip;
/**
* * 回转速度
* */
@TableField(value ="\"SLEWING_SPEED\"")
private BigDecimal slewingSpeed;
/**
* * 升降速度
* */
@TableField(value ="\"LIFTING_SPEED\"")
private BigDecimal liftingSpeed;
/**
* * 高差
* */
@TableField(value ="\"HEIGHT_DIFFERENCE\"")
private BigDecimal heightDifference;
/**
* * 主索直径
* */
@TableField(value ="\"MAIN_CABLE_DIAMETER\"")
private BigDecimal mainCableDiameter;
/**
* * 弦倾角
* */
@TableField(value ="\"ANGLE_OF_CHORD\"")
private BigDecimal angleOfChord;
/**
* * 乘客人数
* */
@TableField(value ="\"PASSENGER_NUM\"")
private Integer passengerNum;
/**
* * 弹跳高度
* */
@TableField(value ="\"BOUNCE_HEIGHT\"")
private BigDecimal bounceHeight;
/**
* * 最大载重
* */
@TableField(value ="\"MAXIMUM_LOAD\"")
private BigDecimal maximumLoad;
/**
* * 设备功率
* */
@TableField(value ="\"EQUIPMENT_POWER\"")
private BigDecimal equipmentPower;
/**
* * 占地面积
* */
@TableField(value ="\"FLOOR_AREA\"")
private BigDecimal floorArea;
/**
* * 升空高度
* */
@TableField(value ="\"LIFTOFF_ALTITUDE\"")
private BigDecimal liftoffAltitude;
/**
* * 场地直径
* */
@TableField(value ="\"FIELD_DIAMETER\"")
private BigDecimal fieldDiameter;
/**
* * 球体直径
* */
@TableField(value ="\"SPHERE_DIAMETER\"")
private BigDecimal sphereDiameter;
/**
* * 球体体积
* */
@TableField(value ="\"SPHERE_VOLUME\"")
private BigDecimal sphereVolume;
/**
* * 操作人数
* */
@TableField(value ="\"OPERATOR_NUMBER\"")
private Integer operatorNumber;
}
package com.yeejoin.amos.boot.module.app.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
/**
* 安全追溯-索道
*
* @author cpp
* @date 2023-04-06 15:21:22
*/
@Data
@Accessors(chain = true)
@TableName(value = "idx_biz_jg_tech_params_ropeway")
public class EquipTechParamRopeway extends AbstractEquipBaseEntity {
private static final long serialVersionUID = 1L;
/**
* * $column.comments
* */
@TableField(value ="\"INSTANCE_ID\"")
private String instanceId;
/**
* * $column.comments
* */
@TableField(value ="\"STATUS\"")
private String status;
/**
* * $column.comments
* */
@TableField(value ="\"HORIZONTAL_DISTANCE\"")
private BigDecimal horizontalDistance;
/**
* * 支架数目
* */
@TableField(value ="\"SUPPORTS_COUNT\"")
private Integer supportsCount;
/**
* * 斜长
* */
@TableField(value ="\"OBLIQUE_LENGTH\"")
private BigDecimal obliqueLength;
/**
* * 主电机型号和功率
* */
@TableField(value ="\"MAIN_MOTOR_MODEL_AND_POWER\"")
private BigDecimal mainMotorModelAndPower;
/**
* * 高差
* */
@TableField(value ="\"ALTITUDE_DIFFERENCE\"")
private BigDecimal altitudeDifference;
/**
* * 张紧油压(重锤)
* */
@TableField(value ="\"OIL_PRESSURE_HEAVY_HAMMER\"")
private BigDecimal oilPressureHeavyHammer;
/**
* * 张紧油压(油压)
* */
@TableField(value ="\"OIL_PRESSURE_OIL_PRESSURE\"")
private BigDecimal oilPressureOilPressure;
/**
* * 运量
* */
@TableField(value ="\"FREIGHT_VOLUME\"")
private BigDecimal freightVolume;
/**
* * 运载索
* */
@TableField(value ="\"CARRIER_LINE\"")
private String carrierLine;
/**
* * 速度
* */
@TableField(value ="\"SPEED\"")
private BigDecimal speed;
/**
* * 承载索
* */
@TableField(value ="\"BEARING_CABLE\"")
private String bearingCable;
/**
* * 索距
* */
@TableField(value ="\"CABLE_PITCH\"")
private BigDecimal cablePitch;
/**
* * 运载工具数量和类型
* */
@TableField(value ="\"NUMBER_AND_TYPE_OF_VEHICLES\"")
private String numberAndTypeOfVehicles;
/**
* * 索引索
* */
@TableField(value ="\"TRACTION_ROPE\"")
private String tractionRope;
/**
* * 平衡索
* */
@TableField(value ="\"BALANCE_CABLE\"")
private String balanceCable;
}
package com.yeejoin.amos.boot.module.app.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
/**
* 安全追溯-场内车辆
*
* @author cpp
* @date 2023-04-06 15:21:21
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("idx_biz_jg_tech_params_vehicle")
public class EquipTechParamVehicle extends AbstractEquipBaseEntity {
private static final long serialVersionUID = 1L;
/**
* * $column.comments
* */
@TableField(value ="\"INSTANCE_ID\"")
private String instanceId;
/**
* * $column.comments
* */
@TableField(value ="\"STATUS\"")
private String status;
/**
* * 车架编号
* */
@TableField(value ="\"FRAME_NO\"")
private String frameNo;
/**
* * 发动机(行走电机)编号
* */
@TableField(value ="\"ENGINE_NO\"")
private String engineNo;
/**
* * 动力方式
* */
@TableField(value ="\"POWER_MODE\"")
private String powerMode;
/**
* * 传动方式
* */
@TableField(value ="\"TRANSMISSION_MODE\"")
private String transmissionMode;
/**
* * 车架结构
* */
@TableField(value ="\"FRAME_STRUCTURE\"")
private String frameStructure;
/**
* * 驾驶方式
* */
@TableField(value ="\"DRIVING_MODE\"")
private String drivingMode;
/**
* * 自重
* */
@TableField(value ="\"WEIGHT\"")
private BigDecimal weight;
/**
* * 空载最大运行速度
* */
@TableField(value ="\"CARRYING_IDLER_MAX_RUNNING_SPEED\"")
private BigDecimal carryingIdlerMaxRunningSpeed;
/**
* * 空载最大起升速度
* */
@TableField(value ="\"MAX_LIFTING_SPEED\"")
private BigDecimal maxLiftingSpeed;
/**
* * 设备保护等级(防爆)
* */
@TableField(value ="\"PROTECT_GRADE\"")
private String protectGrade;
/**
* * 气体/粉尘组别(防爆)
* */
@TableField(value ="\"GAS_GROUP\"")
private String gasGroup;
/**
* * 温度组别(防爆)
* */
@TableField(value ="\"TEMPERATURE_GROUP\"")
private String temperatureGroup;
/**
* * 额定起重量
* */
@TableField(value ="\"LIFTING_CAPACITY\"")
private BigDecimal liftingCapacity;
/**
* * 系统电压
* */
@TableField(value ="\"SYSTEM_VOLTAGE\"")
private BigDecimal systemVoltage;
/**
* * 载荷中心距
* */
@TableField(value ="\"LOAD_CENTER_DISTANCE\"")
private BigDecimal loadCenterDistance;
/**
* * 发动机(电机)额定功率
* */
@TableField(value ="\"ENGINE_POWER\"")
private BigDecimal enginePower;
/**
* * 最大速度(额载)
* */
@TableField(value ="\"MAX_SPEED\"")
private BigDecimal maxSpeed;
/**
* * 防爆使用场所
* */
@TableField(value ="\"EXPLOSIONPROOF_PLACE\"")
private String explosionproofPlace;
/**
* * 工作装置门架形式
* */
@TableField(value ="\"GANTRY_FORM\"")
private String gantryForm;
/**
* * 工作装置空载最大起升高度
* */
@TableField(value ="\"MAX_LIFTING_HEIGHT\"")
private BigDecimal maxLiftingHeight;
/**
* * 工作装置(全)自由起升高度
* */
@TableField(value ="\"FREE_LIFTING_HEIGHT\"")
private BigDecimal freeLiftingHeight;
/**
* * 工作装置门架倾角(前)
* */
@TableField(value ="\"PORTAL_ANGLE_FRONT\"")
private BigDecimal portalAngleFront;
/**
* * 工作装置门架倾角(后)
* */
@TableField(value ="\"PORTAL_ANGLE_BEHIND\"")
private BigDecimal portalAngleBehind;
/**
* * 工作装置最大起升速度(空载)
* */
@TableField(value ="\"MAX_LIFTING_SPEED1\"")
private BigDecimal maxLiftingSpeed1;
/**
* * 工作装置最大起升速度(额载)
* */
@TableField(value ="\"MAX_LIFTING_SPEED2\"")
private BigDecimal maxLiftingSpeed2;
/**
* * 工作装置最大下降速度(空载)
* */
@TableField(value ="\"MAX_DESCENT_SPEED1\"")
private BigDecimal maxDescentSpeed1;
/**
* * 工作装置最大下降速度(额载)
* */
@TableField(value ="\"MAX_DESCENT_SPEED2\"")
private BigDecimal maxDescentSpeed2;
/**
* * 整车整备质量
* */
@TableField(value ="\"VEHICLE_MASS\"")
private BigDecimal vehicleMass;
/**
* * 额定载客数
* */
@TableField(value ="\"PASSENGERS_NUMBER\"")
private Integer passengersNumber;
/**
* * 最大运行速度
* */
@TableField(value ="\"MAX_RUNNING_SPEED\"")
private BigDecimal maxRunningSpeed;
/**
* * 轴距
* */
@TableField(value ="\"WHEEL_BASE\"")
private BigDecimal wheelBase;
/**
* * 轮距(前)
* */
@TableField(value ="\"TRACK_WIDTH_FRONT\"")
private BigDecimal trackWidthFront;
/**
* * 轮距(后)
* */
@TableField(value ="\"TRACK_WIDTH_BEHIND\"")
private BigDecimal trackWidthBehind;
/**
* * 观光列车车厢数
* */
@TableField(value ="\"CARS_NUMBER\"")
private Integer carsNumber;
/**
* * 观光列车每节车厢座位数
* */
@TableField(value ="\"SEAT_NUMBER\"")
private Integer seatNumber;
/**
* * 观光列车牵引车头座位数
* */
@TableField(value ="\"TRACTOR_SEAT_NUMBER\"")
private Integer tractorSeatNumber;
/**
* * 最大行驶坡度
* */
@TableField(value ="\"MAX_DRIVING_SLOPE\"")
private BigDecimal maxDrivingSlope;
/**
* * 制动距离
* */
@TableField(value ="\"BRAKING_DISTANCE\"")
private BigDecimal brakingDistance;
/**
* * 全长
* */
@TableField(value ="\"OVERALL_LENGTH\"")
private BigDecimal overallLength;
/**
* * 全宽
* */
@TableField(value ="\"OVERALL_WIDTH\"")
private BigDecimal overallWidth;
/**
* * 全高
* */
@TableField(value ="\"OVERALL_ALTITUDE\"")
private BigDecimal overallAltitude;
/**
* * 最小离地间隙
* */
@TableField(value ="\"MIN_GROUND_CLEARANCE\"")
private BigDecimal minGroundClearance;
/**
* * 最小外侧转弯半径
* */
@TableField(value ="\"MIN_TURNING_RADIUS\"")
private BigDecimal minTurningRadius;
/**
* * 主要零部件、安全保护和防护装置
* */
@TableField(value ="\"MAIN_PARTS\"")
private String mainParts;
}
package com.yeejoin.amos.boot.module.app.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
/**
* 安全追溯-压力容器
*
* @author cpp
* @date 2023-04-06 15:21:21
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("idx_biz_jg_tech_params_vessel")
public class EquipTechParamVessel extends AbstractEquipBaseEntity {
private static final long serialVersionUID = 1L;
/**
* * $column.comments
* */
/**
* * $column.comments
* */
@TableField(value ="\"INSTANCE_ID\"")
private String instanceId;
/**
* * $column.comments
* */
@TableField(value ="\"STATUS\"")
private String status;
/**
* * 额定质量
* */
@TableField(value ="\"RATED_QUALITY\"")
private BigDecimal ratedQuality;
/**
* * 使用环境温度
* */
@TableField(value ="\"AMBIENT_TEMPERATURE\"")
private BigDecimal ambientTemperature;
/**
* * 型号
* */
@TableField(value ="\"MODEL_NUMBER\"")
private String modelNumber;
/**
* * 数量
* */
@TableField(value ="\"NUM\"")
private Integer num;
/**
* * 单瓶容积
* */
@TableField(value ="\"SINGLE_BOTTLE_VOLUME\"")
private BigDecimal singleBottleVolume;
/**
* * 总容积
* */
@TableField(value ="\"TOTAL_VOLUME\"")
private BigDecimal totalVolume;
/**
* * 充装介质
* */
@TableField(value ="\"CHARGING_MEDIUM\"")
private String chargingMedium;
/**
* * 规格
* */
@TableField(value ="\"SPECIFICATION\"")
private String specification;
/**
* * 外径
* */
@TableField(value ="\"OUTSIDE_DIAMETER\"")
private BigDecimal outsideDiameter;
/**
* * 壁厚
* */
@TableField(value ="\"WALL_THICKNESS\"")
private BigDecimal wallThickness;
/**
* * 长度
* */
@TableField(value ="\"LENGTH\"")
private BigDecimal length;
/**
* * 公称工作压力
* */
@TableField(value ="\"NOMINAL_WORKING_PRESSURE\"")
private BigDecimal nominalWorkingPressure;
/**
* * 材料(瓶体)
* */
@TableField(value ="\"BOTTLE_BODY\"")
private String bottleBody;
/**
* * 材料(端塞)
* */
@TableField(value ="\"END_PLUG\"")
private String endPlug;
/**
* * 材料(管路)
* */
@TableField(value ="\"PIPING\"")
private String piping;
/**
* * 无损检测方法(气瓶)
* */
@TableField(value ="\"QP_LOSSLESS\"")
private String qpLossless;
/**
* * 无损检测方法(管路)
* */
@TableField(value ="\"GL_LOSSLESS\"")
private String glLossless;
/**
* * 无损检测比例(气瓶)
* */
@TableField(value ="\"QP_RATIO\"")
private BigDecimal qpRatio;
/**
* * 无损检测比例(管路)
* */
@TableField(value ="\"GL_RATIO\"")
private BigDecimal glRatio;
/**
* * 耐压试验压力(气瓶)
* */
@TableField(value ="\"QP_PRESSURE\"")
private BigDecimal qpPressure;
/**
* * 耐压试验压力(管路)
* */
@TableField(value ="\"GL_PRESSURE\"")
private BigDecimal glPressure;
/**
* * 气密性试验压力(气瓶)
* */
@TableField(value ="\"QP_AIR_TIGHTNESS\"")
private BigDecimal qpAirTightness;
/**
* * 气密性试验压力(管路)
* */
@TableField(value ="\"GL_AIR_TIGHTNESS\"")
private BigDecimal glAirTightness;
/**
* * 气体置换后压力
* */
@TableField(value ="\"DISPLACEMENT_PRESSURE\"")
private BigDecimal displacementPressure;
/**
* * 瓶体内含氧量
* */
@TableField(value ="\"OXYGEN\"")
private BigDecimal oxygen;
/**
* * 瓶体内含氧量
* */
@TableField(value ="\"HEAT_TREATMENT_METHOD\"")
private String heatTreatmentMethod;
/**
* * 热处理温度
* */
@TableField(value ="\"QP_HEAT_TREATMENT_TEMPERATURE\"")
private BigDecimal qpHeatTreatmentTemperature;
/**
* * 气瓶安装位置
* */
@TableField(value ="\"INSTALLATION_POSITION\"")
private String installationPosition;
/**
* * 容器容积
* */
@TableField(value ="\"CONTAINER_VOLUME\"")
private BigDecimal containerVolume;
/**
* * 容器内径
* */
@TableField(value ="\"PRESSURE_VESSEL_DIAMETER\"")
private BigDecimal pressureVesselDiameter;
/**
* * 容器高(长)
* */
@TableField(value ="\"HEIGHT\"")
private BigDecimal height;
/**
* * 材料(筒体(球壳))
* */
@TableField(value ="\"MATERIAL_CYLINDER_SHELL\"")
private String materialCylinderShell;
/**
* * 材料(封头)
* */
@TableField(value ="\"PRESSURE_MATERIAL_HEAD\"")
private String pressureMaterialHead;
/**
* * 材料(衬里)
* */
@TableField(value ="\"PRESSURE_MATERIAL_LINING\"")
private String pressureMaterialLining;
/**
* * 材料(夹套)
* */
@TableField(value ="\"MATERIAL_JACKET\"")
private String materialJacket;
/**
* * 厚度(筒体(球壳))
* */
@TableField(value ="\"THICKNESS\"")
private BigDecimal thickness;
/**
* * 厚度(封头)
* */
@TableField(value ="\"FIXED_HEAD\"")
private BigDecimal fixedHead;
/**
* * 厚度(衬里)
* */
@TableField(value ="\"FIXED_LINING\"")
private BigDecimal fixedLining;
/**
* * 厚度(夹套)
* */
@TableField(value ="\"FIXED_JACKET\"")
private BigDecimal fixedJacket;
/**
* * 容器自重
* */
@TableField(value ="\"SELF_WEIGHT\"")
private BigDecimal selfWeight;
/**
* * 盛装介质重量
* */
@TableField(value ="\"MEDIUM_WEIGHT\"")
private BigDecimal mediumWeight;
/**
* * 设计压力(壳程)
* */
@TableField(value ="\"PRESSURE_HOUSING_PATH\"")
private BigDecimal pressureHousingPath;
/**
* * 设计压力(管程)
* */
@TableField(value ="\"PRESSURE_PIPE\"")
private BigDecimal pressurePipe;
/**
* * 设计压力(夹套)
* */
@TableField(value ="\"PRESSURE_JACKET\"")
private BigDecimal pressureJacket;
/**
* * 设计温度(壳程)
* */
@TableField(value ="\"TEMPERATURE_SHELL\"")
private BigDecimal temperatureShell;
/**
* * 设计温度(管程)
* */
@TableField(value ="\"TEMPERATURE_PIPE\"")
private BigDecimal temperaturePipe;
/**
* * 设计温度(夹套)
* */
@TableField(value ="\"TEMPERATURE_JACKET\"")
private BigDecimal temperatureJacket;
/**
* * 最高允许工作压力(壳程)
* */
@TableField(value ="\"MAX_PRESSURE_SHELL\"")
private BigDecimal maxPressureShell;
/**
* * 最高允许工作压力(管程)
* */
@TableField(value ="\"MAX_PRESSURE_PIPE\"")
private BigDecimal maxPressurePipe;
/**
* * 最高允许工作压力(夹套)
* */
@TableField(value ="\"MAX_PRESSURE_JACKET\"")
private BigDecimal maxPressureJacket;
/**
* * 介质(壳程)
* */
@TableField(value ="\"MEDIUM_SHELL\"")
private String mediumShell;
/**
* * 介质(管程)
* */
@TableField(value ="\"MEDIUM_PIPE\"")
private String mediumPipe;
/**
* * 介质(夹套)
* */
@TableField(value ="\"MEDIUM_JACKET\"")
private String mediumJacket;
/**
* * 主体结构型式
* */
@TableField(value ="\"MAIN_STRUCTURE_TYPE\"")
private String mainStructureType;
/**
* * 支座型式
* */
@TableField(value ="\"SUPPORT\"")
private String support;
/**
* * 安装型式
* */
@TableField(value ="\"INSTALLATION\"")
private String installation;
/**
* * 保温绝热方式
* */
@TableField(value ="\"INSULATION\"")
private String insulation;
/**
* * 无损检测方法
* */
@TableField(value ="\"CHECK_LOSSLESS\"")
private String checkLossless;
/**
* * 耐压试验种类
* */
@TableField(value ="\"WITHSTAND_VOLTAGE\"")
private String withstandVoltage;
/**
* * 泄漏试验种类
* */
@TableField(value ="\"LEAKAGE\"")
private String leakage;
/**
* * 耐压试验压力
* */
@TableField(value ="\"WITHSTAND_PRESSURE_TEST\"")
private BigDecimal withstandPressureTest;
/**
* * 泄漏试验压力
* */
@TableField(value ="\"LEAK_PRESSURE\"")
private BigDecimal leakPressure;
/**
* * 容器型号
* */
@TableField(value ="\"CONTAINER\"")
private String container;
/**
* * 罐车编号
* */
@TableField(value ="\"CAR_NUM\"")
private String carNum;
/**
* * 容积
* */
@TableField(value ="\"VOLUME\"")
private BigDecimal volume;
/**
* * 最大充装量
* */
@TableField(value ="\"MAX_FILL\"")
private BigDecimal maxFill;
/**
* * 设计压力
* */
@TableField(value ="\"DESIGN_PRESSURE\"")
private BigDecimal designPressure;
/**
* * 设计温度
* */
@TableField(value ="\"DESIGN_TEMPERATURE\"")
private BigDecimal designTemperature;
/**
* * 工作压力
* */
@TableField(value ="\"WORKING_PRESSURE\"")
private BigDecimal workingPressure;
/**
* * 工作温度
* */
@TableField(value ="\"WORK_TEMPERATURE\"")
private BigDecimal workTemperature;
/**
* * 材料(筒体)
* */
@TableField(value ="\"MATERIAL_CYLINDER\"")
private String materialCylinder;
/**
* * 厚度(筒体)
* */
@TableField(value ="\"THICKNESS_CYLINDER\"")
private BigDecimal thicknessCylinder;
/**
* * 腐蚀裕量
* */
@TableField(value ="\"CORROSION_MARGIN\"")
private BigDecimal corrosionMargin;
/**
* * 介质
* */
@TableField(value ="\"MEDIUM\"")
private String medium;
/**
* * 氧舱品种
* */
@TableField(value ="\"OXYGEN_CHAMBER\"")
private String oxygenChamber;
/**
* * 额定进舱人数
* */
@TableField(value ="\"RATED_ENTRY_CAPACITY\"")
private Integer ratedEntryCapacity;
/**
* * 主体结构
* */
@TableField(value ="\"CHAMBER_MAIN\"")
private String chamberMain;
/**
* * 压力
* */
@TableField(value ="\"CHAMBER_PRESSURE\"")
private BigDecimal chamberPressure;
/**
* * 温度
* */
@TableField(value ="\"TEMPERATURE\"")
private BigDecimal temperature;
/**
* * 压力介质
* */
@TableField(value ="\"PRESSURE_MEDIUM\"")
private BigDecimal pressureMedium;
/**
* * 人均舱容
* */
@TableField(value ="\"PER_CAPITA_CABIN_CAPACITY\"")
private BigDecimal perCapitaCabinCapacity;
}
package com.yeejoin.amos.boot.module.app.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 装备分类
*
* @author system_generator
* @date 2021-10-20
*/
@Data
@Accessors(chain = true)
@TableName("tz_equipment_category")
public class EquipmentCategory {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableField("id")
private Long id;
/**
*
*/
@TableField("parent_id")
private String parentId;
/**
* 装备分类编码
*/
@TableField("code")
private String code;
/**
* 装备分类名称
*/
@TableField("name")
private String name;
/**
* 描述
*/
@TableField("description")
private String description;
/**
* 备注
*/
@TableField("remark")
private String remark;
/**
*
*/
@TableField("create_date")
private Date createDate;
/**
* 行业编码
*/
@TableField("industry_code")
private String industryCode;
}
package com.yeejoin.amos.boot.module.app.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 一码通总览数据统计表
* @author system_generator
*/
@Data
@Accessors(chain = true)
@TableName("biz_jg_equipment_category_data")
public class EquipmentCategoryData extends BaseEntity {
/**
* 管辖分局组织机构代码
*/
@TableField("org_branch_code")
private String orgBranchCode;
/**
* 单位统一信用代码
*/
@TableField("unit_code")
private String unitCode;
/**
* 电梯
*/
@TableField("elevator")
private String elevator;
/**
* 厂车
*/
@TableField("vehicle")
private String vehicle;
/**
* 索道
*/
@TableField("ropeway")
private String ropeway;
/**
* 游乐设施
*/
@TableField("rides")
private String rides;
/**
* 锅炉
*/
@TableField("boiler")
private String boiler;
/**
* 压力容器
*/
@TableField("vessel")
private String vessel;
/**
* 压力管道
*/
@TableField("pipeline")
private String pipeline;
/**
* 起重机械
*/
@TableField("lifting")
private String lifting;
}
package com.yeejoin.amos.boot.module.app.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* 安全追溯-检验检测信息表
*
* @author cpp
* @date 2023-04-20 16:36:14
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("idx_biz_jg_inspection_detection_info")
public class InspectionDetectionInfo extends AbstractEquipBaseEntity {
private static final long serialVersionUID = 1L;
/**
* * $column.comments
* */
@TableField(value ="\"INSTANCE_ID\"")
private String instanceId;
/**
* * $column.comments
* */
@TableField(value ="\"STATUS\"")
private String status;
/**
* * 检验类型
* */
@TableField(value ="\"INSPECT_TYPE\"")
private String inspectType;
/**
* * 检验机构名称
* */
@TableField(value ="\"INSPECT_ORG_NAME\"")
private String inspectOrgName;
/**
* * 检验报告
* */
@TableField(value ="\"INSPECT_REPORT\"")
private String inspectReport;
/**
* * 检验人员
* */
@TableField(value ="\"INSPECT_STAFF\"")
private String inspectStaff;
/**
* * 检验日期
* */
@TableField(value ="\"INSPECT_DATE\"")
private Date inspectDate;
/**
* * 检验结论
* */
@TableField(value ="\"INSPECT_CONCLUSION\"")
private String inspectConclusion;
/**
* * 安全状况等级
* */
@TableField(value ="\"SAFETY_LEVEL\"")
private String safetyLevel;
/**
* * 检验问题备注
* */
@TableField(value ="\"PROBLEM_REMARK\"")
private String problemRemark;
/**
* * 下次检验日期
* */
@TableField(value ="\"NEXT_INSPECT_DATE\"")
private Date nextInspectDate;
/**
* * 设备唯一标识
* */
@TableField(value ="\"SEQUENCE_CODE\"")
private String sequenceCode;
}
package com.yeejoin.amos.boot.module.app.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
/**
*
*
* @author duanwei
* @date 2023-04-10
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="MidEquipMainParts对象", description="")
@TableName(value = "idx_biz_jg_main_parts")
public class MainParts extends AbstractEquipBaseEntity {
private static final long serialVersionUID = 1L;
@TableField("\"INSTANCE_ID\"")
private String instanceId;
@TableField("\"STATUS\"")
private String status;
@TableField("\"MAIN_PART_NUMBER\"")
private String mainPartNumber;
@TableField("\"TYPE_SPECIFICATION\"")
private String typeSpecification;
@TableField("\"MANUFACTURE_COMPANY\"")
private String manufactureCompany;
@TableField("\"IDENTIFICATIO_PRODUCT\"")
private String identificatioProduct;
@TableField("\"MANUFACTURING_DATE\"")
private String manufacturingDate;
@TableField("\"DESIGNATION\"")
private String designation;
@TableField("\"REMARKS\"")
private String remarks;
@TableField("\"MODEL\"")
private String model;
@TableField("\"SPECIFICATION\"")
private String specification;
@TableField("\"CERTIFICATE_NUMBER\"")
private String certificateNumber;
@TableField("\"SERIAL_NUMBER\"")
private String serialNumber;
@TableField("\"BATCH_NUMBER\"")
private String batchNumber;
@TableField("\"INTRA_UNIT_NUMBER\"")
private String intraUnitNumber;
@TableField("\"WEIGHT\"")
private BigDecimal weight;
@TableField("\"PIPE_NAME\"")
private String pipeName;
@TableField("\"PIPELINE_NUMBER\"")
private String pipelineNumber;
@TableField("\"DEVICE_LEVEL\"")
private String deviceLevel;
@TableField("\"DESIGN_CRITERION\"")
private String designCriterion;
@TableField("\"FIGURE_NUMBER\"")
private String figureNumber;
@TableField("\"PART_NAME\"")
private String partName;
}
package com.yeejoin.amos.boot.module.app.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* 安全追溯-维保备案信息表
*
* @author cpp
* @date 2023-04-06 15:21:22
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("idx_biz_jg_maintenance_record_info")
public class MaintenanceInfo extends AbstractEquipBaseEntity {
private static final long serialVersionUID = 1L;
/**
* * $column.comments
* */
/**
* * $column.comments
* */
@TableField(value ="\"INSTANCE_ID\"")
private String instanceId;
/**
* * $column.comments
* */
@TableField(value ="\"STATUS\"")
private String status;
/**
* * 维保单位统一社会信用代码
* */
@TableField(value ="\"ME_UNIT_CREDIT_CODE\"")
private String meUnitCreditCode;
/**
* * 维保单位名称
* */
@TableField(value ="\"ME_UNIT_NAME\"")
private String meUnitName;
/**
* * 维保备案合同
* */
@TableField(value ="\"REPAIR_INFORM\"")
private String repairInform;
/**
* * 维保合同开始日期
* */
@TableField(value ="\"INFORM_START\"")
private String informStart;
/**
* * 维保合同结束日期
* */
@TableField(value ="\"INFORM_END\"")
private String informEnd;
/**
* * 维保负责人姓名
* */
@TableField(value ="\"ME_MASTER\"")
private String meMaster;
/**
* * 维保负责人身份证
* */
@TableField(value ="\"ME_MASTER_ID\"")
private String meMasterId;
/**
* * 紧急救援电话
* */
@TableField(value ="\"EMERGENCYCALL\"")
private String emergencycall;
/**
* * 维保周期
* */
@TableField(value ="\"ME_CYCLE\"")
private String meCycle;
/**
* * 大修周期
* */
@TableField(value ="\"OVERHAUL_CYCLE\"")
private String overhaulCycle;
/**
* * 24小时维保电话
* */
@TableField(value ="\"ME24_TELEPHONE\"")
private String me24Telephone;
}
package com.yeejoin.amos.boot.module.app.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* ${comments}
*
* @author cpp
* @date 2023-04-06 15:21:22
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("idx_biz_jg_other_info")
public class OtherInfo extends AbstractEquipBaseEntity {
private static final long serialVersionUID = 1L;
/**
* * 保险机构
* */
@TableField(value ="\"INSURANCE_ORG\"")
private String insuranceOrg;
/**
* * 保险到期日
* */
@TableField(value ="\"EXPIRY_DATE\"")
private String expiryDate;
/**
* * 物联网接入标志
* */
@TableField(value ="\"IOT_ORG\"")
private String iotOrg;
/**
* * 物联网接入标志
* */
@TableField(value ="\"IOT_SIGN\"")
private String iotSign;
/**
* * 有无监控
* */
@TableField(value ="\"IS_MONITOR\"")
private String isMonitor;
/**
* * 96333识别码
* */
@TableField(value ="\"CODE96333\"")
private String code96333;
/**
* * 监管码
* */
@TableField(value ="\"SUPERVISORY_CODE\"")
private String supervisoryCode;
}
package com.yeejoin.amos.boot.module.app.api.entity;
import lombok.Data;
@Data
public class PageParam {
int current = 0;
int size = 10;
}
package com.yeejoin.amos.boot.module.app.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 安全追溯-制造信息
*
* @author cpp
* @date 2023-04-06 15:21:22
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("idx_biz_jg_factory_info")
public class ProduceInfo extends AbstractEquipBaseEntity {
private static final long serialVersionUID = 1L;
/**
* * $column.comments
* */
@TableField(value ="\"INSTANCE_ID\"")
private String instanceId;
/**
* * $column.comments
* */
@TableField(value ="\"STATUS\"")
private String status;
/**
* * 制造单位统一社会信用代码
* */
@TableField(value ="\"PRODUCE_UNIT_CREDIT_CODE\"")
private String produceUnitCreditCode;
/**
* * 制造单位名称
* */
@TableField(value ="\"PRODUCE_UNIT_NAME\"")
private String produceUnitName;
/**
* * 制造许可编号
* */
@TableField(value ="\"PRODUCE_LICENSE_NUM\"")
private String produceLicenseNum;
/**
* * 出厂编号
* */
@TableField(value ="\"FACTORY_NUM\"")
private String factoryNum;
/**
* * 制造日期
* */
@TableField(value ="\"PRODUCE_DATE\"")
private Date produceDate;
/**
* * 是否进口
* */
@TableField(value ="\"IMPORTED\"")
private String imported;
/**
* * 制造国
* */
@TableField(value ="\"PRODUCE_COUNTRY\"")
private String produceCountry;
/**
* * 制造标准
* */
@TableField(value ="\"FACTORY_STANDARD\"")
private String factoryStandard;
/**
* * 产品质量合格证明
* */
@TableField(value ="\"PRODUCT_QUALITY_YIELD_PROVE\"")
private String productQualityYieldProve;
/**
* * 安装及使用维护保养说明
* */
@TableField(value ="\"INS_USE_MAINTAIN_EXPLAIN\"")
private String insUseMaintainExplain;
/**
* * 监督检验证书
* */
@TableField(value ="\"SUPERVISION_AGENCY_CREDENTIAL\"")
private String supervisionAgencyCredential;
/**
* * 型式试验证书
* */
@TableField(value ="\"TYPE_TEST_CREDENTIAL\"")
private String typeTestCredential;
}
package com.yeejoin.amos.boot.module.app.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
*
*
* @author duanwei
* @date 2023-04-10
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="MidEquipProtectionDevices对象", description="")
@TableName(value = "idx_biz_jg_protection_devices")
public class ProtectionDevices extends AbstractEquipBaseEntity {
private static final long serialVersionUID = 1L;
@TableField("\"INSTANCE_ID\"")
private String instanceId;
@TableField("\"STATUS\"")
private String status;
@TableField("\"DEVICE_NUMBER\"")
private String deviceNumber;
@TableField("\"TYPE_SPECIFICATION\"")
private String typeSpecification;
@TableField("\"MANUFACTURE_COMPANY\"")
private String manufactureCompany;
@TableField("\"MANUFACTURING_DATE\"")
private String manufacturingDate;
@TableField("\"CODE\"")
private String code;
@TableField("\"CERTIFICATE_NUMBER\"")
private String certificateNumber;
@TableField("\"REMARK\"")
private String remark;
@TableField("\"QUANTITY\"")
private Integer quantity;
@TableField("\"DESIGNATION\"")
private String designation;
@TableField("\"MODEL\"")
private String model;
@TableField("\"SPECIFICATION\"")
private String specification;
}
package com.yeejoin.amos.boot.module.app.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
/**
* 注册登记信息表
*
* @author cpp
* @date 2023-04-06 15:21:22
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("idx_biz_jg_register_info")
public class RegistrationInfo extends AbstractEquipBaseEntity {
private static final long serialVersionUID = 1L;
/**
* * $column.comments
* */
/**
* * $column.comments
* */
@TableField(value ="\"INSTANCE_ID\"")
private String instanceId;
/**
* * $column.comments
* */
@TableField(value ="\"STATUS\"")
private String status;
/**
* * 登记机关组织机构代码
* */
@TableField(value ="\"ORGANIZATION_CODE\"")
private String organizationCode;
/**
* * 登记机关名称
* */
@TableField(value ="\"ORGANIZATION_NAME\"")
private String organizationName;
/**
* * 使用登记证编号
* */
@TableField(value ="\"USE_ORG_CODE\"")
private String useOrgCode;
/**
* * 注册状态
* */
@TableField(value ="\"REGISTER_STATE\"")
private String registerState;
/**
* * 设备代码
* */
@TableField(value ="\"EQU_CODE\"")
private String equCode;
/**
* * 设备种类
* */
@TableField(value ="\"EQU_LIST\"")
private String equList;
/**
* * 设备类别
* */
@TableField(value ="\"EQU_CATEGORY\"")
private String equCategory;
/**
* * 设备品种
* */
@TableField(value ="\"EQU_DEFINE\"")
private String equDefine;
/**
* * 产品名称
* */
@TableField(value ="\"PRODUCT_NAME\"")
private String productName;
/**
* * 品牌名称
* */
@TableField(value ="\"BRAND_NAME\"")
private String brandName;
/**
* * 设备型号
* */
@TableField(value ="\"EQU_TYPE\"")
private String equType;
/**
* * 设备总价值(万元)
* */
@TableField(value ="\"EQU_PRICE\"")
private BigDecimal equPrice;
/**
* * 使用登记证
* */
@TableField(value ="\"USE_REGISTRATION_CERTIFICATE\"")
private String useRegistrationCertificate;
/**
* * 使用标志
* */
@TableField(value ="\"USE_SIGN\"")
private String useSign;
/**
* * 产品照片
* */
@TableField(value ="\"PRODUCT_PHOTO\"")
private String productPhoto;
/**
* * 车辆牌号
* */
@TableField(value ="\"CAR_NUMBER\"")
private String carNumber;
/**
* * 车架编号
* */
@TableField(value ="\"FRAME_NUMBER\"")
private String frameNumber;
/**
* * 发动机编号
* */
@TableField(value ="\"ENGINE_NUMBER\"")
private String engineNumber;
/**
* * 电动机编号
* */
@TableField(value ="\"MOTOR_NUMBER\"")
private String motorNumber;
}
package com.yeejoin.amos.boot.module.app.api.entity;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 使用单位
*
* @author duanwei
* @date 2022-09-08
*/
@Data
@Accessors(chain = true)
@ApiModel(value="SpeUseUnit对象", description="使用单位")
public class SpeUseUnit implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
private String id;
@ApiModelProperty(value = "单位名称")
private String name;
@ApiModelProperty(value = "统一社会信用代码")
private String cerCode;
@ApiModelProperty(value = "单位性质")
private String unitNature;
@ApiModelProperty(value = "营业执照图片")
private String cerImgUrl;
@ApiModelProperty(value = "营业执照登记机关")
private String cerRegiOrg;
@ApiModelProperty(value = "注册地址_省")
private String cerAddrProvince;
@ApiModelProperty(value = "注册地址_市")
private String cerAddrCity;
@ApiModelProperty(value = "注册地址")
private String cerAddrArea;
@ApiModelProperty(value = "注册大厦(小区)")
private String cerAddrVillage;
@ApiModelProperty(value = "注册地址_街道")
private String cerAddrStreet;
@ApiModelProperty(value = "注册地址_详细地址")
private String cerAddrDetail;
@ApiModelProperty(value = "法定代表人")
private String legalPerson;
@ApiModelProperty(value = "法人手机")
private String legalPersonPhone;
@ApiModelProperty(value = "负责人")
private String responPerson;
@ApiModelProperty(value = "负责人手机")
private String responPersonPhone;
@ApiModelProperty(value = "所在地邮政编码")
private String zipCode;
@ApiModelProperty(value = "办公地址_省")
private String offiAddrProvince;
@ApiModelProperty(value = "办公地址_市")
private String offiAddrCity;
@ApiModelProperty(value = "办公地址")
private String offiAddrArea;
@ApiModelProperty(value = "办公地址_街道")
private String offiAddrStreet;
@ApiModelProperty(value = "办公大厦(小区)")
private String offiAddrVillage;
@ApiModelProperty(value = "办公地址_详细地址")
private String offiAddrDetail;
@ApiModelProperty(value = "冻结原因")
private String frozenReason;
@ApiModelProperty(value = "单位所属行业")
private String industry;
@ApiModelProperty(value = "值班电话")
private String onDutyPhone;
@ApiModelProperty(value = "管辖分局ID")
private String auditOrgId;
@ApiModelProperty(value = "管辖分局")
private String auditOrgName;
@ApiModelProperty(value = "管辖分局编码")
private String auditOrgCode;
@ApiModelProperty(value = "单位状态")
private Integer status;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "删除状态")
private Integer delFlag;
@ApiModelProperty(value = "创建人")
private String createBy;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "更新人")
private String updateBy;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "组织机构ID")
private String sysOrgId;
@ApiModelProperty(value = "所属组织机构编码")
private String sysOrgCode;
@ApiModelProperty(value = "96333救援电话")
private String rescueCall;
@ApiModelProperty(value = "同步id")
private String syncId;
@ApiModelProperty(value = "同步状态")
private Integer syncState;
}
package com.yeejoin.amos.boot.module.app.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* 监督管理信息表
*
* @author cpp
* @date 2023-04-06 15:21:22
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("idx_biz_jg_supervision_info")
public class SuperviseInfo extends AbstractEquipBaseEntity {
private static final long serialVersionUID = 1L;
/**
* * $column.comments
* */
@TableField(value ="\"INSTANCE_ID\"")
private String instanceId;
/**
* * $column.comments
* */
@TableField(value ="\"STATUS\"")
private String status;
/**
* * 管辖分局组织机构代码
* */
@TableField(value ="\"ORG_BRANCH_CODE\"")
private String orgBranchCode;
/**
* * 管辖分局名称
* */
@TableField(value ="\"ORG_BRANCH_NAME\"")
private String orgBranchName;
/**
* * 是否重点监察设备
* */
@TableField(value ="\"KEY_MONITORING_EQU\"")
private String keyMonitoringEqu;
/**
* * 是否在人口密集区
* */
@TableField(value ="\"DENSELY_POPULATED_AREAS\"")
private String denselyPopulatedAreas;
/**
* * 是否在重要场所
* */
@TableField(value ="\"IMPORTANT_PLACES\"")
private String importantPlaces;
}
package com.yeejoin.amos.boot.module.app.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 八大类其他信息
*
*/
@Data
@Accessors(chain = true)
@TableName("biz_jg_supervisory_code")
@ApiModel(value="SupervisoryCodeInfo", description="监管码")
public class SupervisoryCodeInfo extends BaseEntity {
@ApiModelProperty(value = "监管码")
@TableField("supervisory_code")
private String supervisoryCode;
@ApiModelProperty(value = "电梯救援码")
@TableField("code96333")
private String code96333;
@ApiModelProperty(value = "使用状态(0-初始,1-已使用,2-未使用)")
@TableField("status")
private String status;
@ApiModelProperty(value = "一码通码生成状态(0-手动生成,1-自动生成)")
@TableField("create_status")
private String createStatus;
}
package com.yeejoin.amos.boot.module.app.api.entity;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 企业数据信息
*
* @author duanwei
* @date 2022-08-10
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("tz_base_enterprise_info")
@ApiModel(value="TzBaseEnterpriseInfo对象", description="企业数据信息")
public class TzBaseEnterpriseInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "使用单位唯一标识")
private String useUnitCode;
@ApiModelProperty(value = "监管系统唯一编码")
private String superviseCode;
@ApiModelProperty(value = "使用单位证件类型")
private String useUnitCertificate;
@ApiModelProperty(value = "单位类型")
private String unitType;
@ApiModelProperty(value = "使用单位统一信用代码")
private String useCode;
@ApiModelProperty(value = "使用单位名称")
private String useUnit;
@ApiModelProperty(value = "监管机构组织机构代码")
private String superviseOrgCode;
@ApiModelProperty(value = "监管机构名称")
private String superviseOrgName;
@ApiModelProperty(value = "是否重点监控单位")
private String keyUnit;
@ApiModelProperty(value = "重点场所分类")
private String classPlaces;
@ApiModelProperty(value = "单位所在省份名称")
private String province;
@ApiModelProperty(value = "单位所在城市名称")
private String city;
@ApiModelProperty(value = "单位所在区县名称")
private String district;
@ApiModelProperty(value = "单位所在街道名称")
private String street;
@ApiModelProperty(value = "单位所在社区名称")
private String community;
@ApiModelProperty(value = "单位详细地址")
private String address;
@ApiModelProperty(value = "使用单位法人")
private String legalPerson;
@ApiModelProperty(value = "法人联系电话")
private String legalPhone;
@ApiModelProperty(value = "使用单位联系人")
private String useContact;
@ApiModelProperty(value = "联系人联系电话")
private String contactPhone;
@ApiModelProperty(value = "安全管理人员1姓名")
private String safetyOne;
@ApiModelProperty(value = "安全管理人员1身份证")
private String safetyOneId;
@ApiModelProperty(value = "安全管理人员1联系电话")
private String safetyOnePhone;
@ApiModelProperty(value = "安全管理人员2")
private String safetyTwo;
@ApiModelProperty(value = "安全管理人员2身份证")
private String safetyTwoId;
@ApiModelProperty(value = "安全管理人员2联系电话")
private String safetyTwoPhone;
@ApiModelProperty(value = "单位地理坐标经度")
private String longitude;
@ApiModelProperty(value = "单位地理坐标纬度")
private String latitude;
@ApiModelProperty(value = "同步时间")
private Date syncDate;
@ApiModelProperty(value = "同步状态(0-新增 1-更新 2-删除)")
private Integer syncState;
@ApiModelProperty(value = "对接公司编码")
private String appId;
@ApiModelProperty(value = "管辖机构")
private String governingBody;
@ApiModelProperty(value = "数据来源")
private String dataSources;
@ApiModelProperty(value = "所属行业")
private String industry;
@ApiModelProperty(value = "登记机关")
private String registrationAuthority;
@ApiModelProperty(value = "核准时间")
private Date approvalTime;
@ApiModelProperty(value = "经营状态")
private String operatingStatus;
@ApiModelProperty(value = "维保负责人")
private String maintenPerson;
@ApiModelProperty(value = "维保负责人联系电话")
private String maintenTelephone;
@ApiModelProperty(value = "质量保证工程师")
private String sqa;
@ApiModelProperty(value = "质量负责人")
private String qualityPerson;
@ApiModelProperty(value = "质量负责人电话")
private String qualityTelephone;
@ApiModelProperty(value = "技术负责人")
private String technicalPerson;
@ApiModelProperty(value = "涉及设备类型")
private String equipCategory;
@ApiModelProperty(value = "企业营业执照")
private String unitBusinessLicense;
@ApiModelProperty(value = "企业许可证书")
private String unitExequatur;
@ApiModelProperty(value = "安全管理人2身份证照片")
private String safetyTwoPhoto;
@ApiModelProperty(value = "安全管理人1身份证照片")
private String safetyOnePhoto;
@ApiModelProperty(value = "质量保证工程师电话")
private String sqaPhone;
@ApiModelProperty(value = "根据统一信用代码生成的二维码")
private String qrCode;
@ApiModelProperty(value = "行业主管部门")
private String industrySupervisor;
@ApiModelProperty(value = "企业标签信息")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private String regulatoryLabels;
}
package com.yeejoin.amos.boot.module.app.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* 使用信息表
*
* @author cpp
* @date 2023-04-06 15:21:21
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("idx_biz_jg_use_info")
public class UseInfo extends AbstractEquipBaseEntity {
private static final long serialVersionUID = 1L;
/**
* * $column.comments
* */
@TableField(value ="\"INSTANCE_ID\"")
private String instanceId;
/**
* * $column.comments
* */
@TableField(value ="\"STATUS\"")
private String status;
/**
* * 使用单位统一信用代码
* */
@TableField(value ="\"USE_UNIT_CREDIT_CODE\"")
private String useUnitCreditCode;
/**
* * 使用单位名称
* */
@TableField(value ="\"USE_UNIT_NAME\"")
private String useUnitName;
/**
* * 产权单位统一信用代码
* */
@TableField(value ="\"ESTATE_UNIT_CREDIT_CODE\"")
private String estateUnitCreditCode;
/**
* * 产权单位名称
* */
@TableField(value ="\"ESTATE_UNIT_NAME\"")
private String estateUnitName;
/**
* * 使用状态变更日期
* */
@TableField(value ="\"USE_STATE_CHANGE_DATE\"")
private String useStateChangeDate;
/**
* * 变更事项
* */
@TableField(value ="\"CHANGES\"")
private String changes;
/**
* * 使用内部编号
* */
@TableField(value ="\"USE_INNER_CODE\"")
private String useInnerCode;
/**
* * 投入使用日期
* */
@TableField(value ="\"USE_DATE\"")
private String useDate;
/**
* * 经办人
* */
@TableField(value ="\"AGENT\"")
private String agent;
/**
* * 设备使用地点-省
* */
@TableField(value ="\"PROVINCE\"")
private String province;
/**
* * 设备使用地点-市
* */
@TableField(value ="\"CITY\"")
private String city;
/**
* * 设备使用地点-区(县)
* */
@TableField(value ="\"COUNTY\"")
private String county;
/**
* * 设备使用地点-街道(镇)
* */
@TableField(value ="\"FACTORY_USE_SITE_STREET\"")
private String factoryUseSiteStreet;
/**
* * 设备详细使用地址
* */
@TableField(value ="\"ADDRESS\"")
private String address;
/**
* * 设备地理坐标经纬度
* */
@TableField(value ="\"LONGITUDE_LATITUDE\"")
private String longitudeLatitude;
/**
* * 设备使用场所
* */
@TableField(value ="\"USE_PLACE\"")
private String usePlace;
/**
* * 设备主管部门
* */
@TableField(value ="\"EQU_MANAGE_DT\"")
private String equManageDt;
/**
* * 安全管理部门名称
* */
@TableField(value ="\"SAFETY_MANAGE_DT\"")
private String safetyManageDt;
/**
* * 安全管理员
* */
@TableField(value ="\"SAFETY_MANAGER\"")
private String safetyManager;
/**
* * 安全管理员移动电话
* */
@TableField(value ="\"PHONE\"")
private String phone;
/**
* * 设备状态
* */
@TableField(value ="\"EQU_STATE\"")
private String equState;
/**
* * $column.comments
* */
@TableField(value ="\"PROVINCE_NAME\"")
private String provinceName;
/**
* * $column.comments
* */
@TableField(value ="\"CITY_NAME\"")
private String cityName;
/**
* * $column.comments
* */
@TableField(value ="\"COUNTY_NAME\"")
private String countyName;
/**
* 是否同步到es中
*/
@TableField(value ="\"IS_NOT_ES\"")
private Integer isNotEs;
}
package com.yeejoin.amos.boot.module.app.api.enums;
/**
* @description: 基础枚举类
**/
public enum BaseExceptionEnum {
/**
* 请求成功
*/
SUCCESS(0, "请求成功"),
/**
* 系统繁忙
*/
SYSTEM_BUSY(100, "系统繁忙"),
/**
* 请求超时
*/
REQUEST_TIME_OUT(300, "请求超时"),
/**
* 参数错误
*/
PARAMETER_ERROR(400, "参数错误"),
/**
* 网络异常
*/
NETWORK_ERROR(404, "网络异常"),
/**
* 数据不存在
*/
DATA_NOT_EXISTS(600, "数据不存在"),
/**
* 无权访问
*/
ACCESSDENIED_ERROR(501, "无权访问"),
/**
* 请求已经过期
*/
REQUEST_EXPIRATION(406, "请求已经过期"),
/**
* 请求失败
*/
REQUEST_ERROR(407, "请求失败"),
/**
* 未知错误
*/
FAILURE(999, "未知错误");
private Integer code;
private String msg;
BaseExceptionEnum(Integer code, String msg) {
this.code = code;
this.msg = msg;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}
package com.yeejoin.amos.boot.module.app.api.enums;
/**
* 通用错误码,code编码:10000000-10000999
*
* @author King
* @since 2018/12/14 10:30
*/
public enum CommonErrorEnum {
/**
* 服务器核心数据丢失
*/
SERVER_KEY_DATA_MISSING(10000000, "服务器核心数据丢失"),
/**
* 服务器数据查询错误
*/
SERVER_DATA_QUERY_ERROR(10000001, "服务器数据查询错误"),
/**
* 主键查询主键无效
*/
QUERY_PRIMARY_INVALID(10000002, "主键查询主键无效"),
/**
* 主键查询主键无效
*/
QUERY_ONE_PARAM_INVALID(10000003, "唯一性查询参数无效"),
/**
* 序列化异常
*/
SERIALIZATION_EXCEPTION(10000004, "序列化异常"),
/**
* 反序列化异常
*/
DESERIALIZATION_EXCEPTION(10000005, "反序列化异常"),
/**
* 入参无效
*/
PARAM_INVALID(10000006, "入参无效"),
/**
* 核心字段无效
*/
CRUCIAL_FIELD_INVALID(10000007, "核心字段无效"),
/**
* 解压缩异常
*/
DECOMPRESS_EXCEPTION(10000008, "解压缩异常"),
/**
* 缓存查询key值无效
*/
CACHE_QUERY_KEY_INVALID(10000009, "缓存查询key值无效"),
/**
* 缓存失效
*/
CACHE_LOSE_EFFICACY(10000010, "缓存失效"),
/**
* 未知错误
*/
UNKNOWN(10000999, "未知错误");
private Integer code;
private String msg;
CommonErrorEnum(Integer code, String msg) {
this.code = code;
this.msg = msg;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}
package com.yeejoin.amos.boot.module.app.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
*
* <pre>
* 平台单位等级枚举
* </pre>
*
* @author tb
* @date 2023-05-31
*/
@Getter
@AllArgsConstructor
public enum CompanyLevelEnum {
HEADQUARTER("headquarter", "省级"),
PREFECTURE_LEVEL("prefecture-level", "地市级"),
COUNTY("county", "区县级"),
ORGANIZATION("organization", "基层机构");
private String code;
private String name;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public static CompanyLevelEnum getEnum(String code) {
for (CompanyLevelEnum status : CompanyLevelEnum.values()) {
if (status.getCode().equals(code)) {
return status;
}
}
return null;
}
}
package com.yeejoin.amos.boot.module.app.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.HashMap;
import java.util.Map;
@AllArgsConstructor
@Getter
public enum EquimentEnum {
/**
* 设备状态枚举
*
*/
WEIDENGJI("未登记",0),
ZAIYONG("在用",1),
TINGYONG("停用",2),
BAOFEI("报废",3),
ZHUXIAO("注销",4);
// QIANCHU("迁出",5),
// CHAICHU("拆除",6),
// MULUWAI("目录外",7),
// FEIFASHEBEI("非法设备",8);
String name;
Integer code;
public static Map<Integer,String> getName=new HashMap<>();
public static Map<String,Integer> getCode=new HashMap<>();
static {
for (EquimentEnum e : EquimentEnum.values()){
getName.put(e.code, e.name);
getCode.put(e.name, e.code);
}
}
}
package com.yeejoin.amos.boot.module.app.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.HashMap;
import java.util.Map;
@AllArgsConstructor
@Getter
public enum EquipmentCategoryEnum {
/**
* *行政区划分及对应初始监管码
*/
XZQHDT("行政区划电梯", "XZQHDT", "行政区划电梯"),
XZQH("行政区划", "XZQH", "行政区划"),
BLW("补零位", "0", "补零位"),
JGM("监管码初始码", "0000001", "监管码初始码"),
XXCSM("西咸96333初始码", "85000", "31"),
BJCSM("宝鸡96333初始码", "13000", "32"),
XYCSM("咸阳96333初始码", "75000", "33"),
TCCSM("铜川96333初始码", "05000", "34"),
WNCSM("渭南96333初始码", "13000", "35"),
YACSM("延安96333初始码", "11000", "36"),
YUCSM("榆林96333初始码", "10000", "37"),
HZCSM("汉中96333初始码", "09000", "38"),
AKCSM("安康96333初始码", "11000", "39"),
SLCSM("商洛96333初始码", "06000", "40"),
YLCSM("杨凌96333初始码", "70000", "41"),
HCCSM("韩城96333初始码", "08000", "42"),
SMCSM("神木96333初始码", "06000", "43"),
FGCSM("府谷96333初始码", "02000", "44"),
YJL("已拒领", "6037", "已拒领"),
YRL("已认领", "6035", "已认领"),
DRL("待认领", "6036", "待认领"),
CSZT("初始状态", "0", "初始状态"),
YSY("已使用", "1", "已使用"),
WSY("未使用", "2", "未使用"),
BF("报废", "6", "报废");
private String name;
private String code;
private String value;
public static Map<String, String> getName = new HashMap<>();
public static Map<String, String> getCode = new HashMap<>();
public static Map<String, String> getValue = new HashMap<>();
static {
for (EquipmentCategoryEnum e : EquipmentCategoryEnum.values()) {
getName.put(e.code, e.name);
getCode.put(e.name, e.code);
getValue.put(e.value, e.code);
}
}
}
package com.yeejoin.amos.boot.module.app.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.HashMap;
import java.util.Map;
@AllArgsConstructor
@Getter
public enum EquipmentClassifityEnum {
/**
**设备分类
*/
GL("锅炉","1000"),
YLRQ("压力容器","2000"),
DT("电梯","3000"),
QZJX("起重机械","4000"),
CC("场(厂)内专用机动车辆","5000"),
YLSS("大型游乐设施","6000"),
YLGDYJ("压力管道元件","7000"),
YLGD("压力管道","8000"),
//树类型
//设备认领状态
SBRLZT("设备认领状态","rlzt"),
BDLS("八大类树","eightCategory"),
RENLING("其他","other");
private String name;
private String code;
public static Map<String,String> getName=new HashMap<>();
public static Map<String,String> getCode=new HashMap<>();
static {
for (EquipmentClassifityEnum e : EquipmentClassifityEnum.values()){
getName.put(e.code, e.name);
getCode.put(e.name, e.code);
}
}
}
package com.yeejoin.amos.boot.module.app.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.app.api.entity.BaseUnitLicence;
/**
* 单位注册许可信息表 Mapper 接口
*
* @author system_generator
* @date 2022-08-09
*/
public interface BaseUnitLicenceMapper extends BaseMapper<BaseUnitLicence> {
}
package com.yeejoin.amos.boot.module.app.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.app.api.dto.EquInfoDto;
import com.yeejoin.amos.boot.module.app.api.entity.CategoryOtherInfo;
import lombok.NonNull;
import org.apache.ibatis.annotations.Param;
import java.util.Map;
/**
* 装备分类 Mapper 接口
*
* @author system_generator
* @date 2021-10-20
*/
public interface CategoryOtherInfoMapper extends BaseMapper<CategoryOtherInfo> {
int updateSupervisorCode(String supervisorCode, String code, @Param("record") String record);
CategoryOtherInfo selectSupervisorCode(@Param("supervisorCode") String supervisorCode);
CategoryOtherInfo selectElevatorCode(@Param("elevatorCode") String elevatorCode, String status);
EquInfoDto selectEquipInfo(String record);
int updateCode(String supervisorCode, String equState);
int updateOtherInfo(String supervisorCode, String editStatus);
Map<String, Object> selectDataById(String id);
CategoryOtherInfo queryInitCode(@Param("initCode") @NonNull String initCode);
}
package com.yeejoin.amos.boot.module.app.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.app.api.entity.ConstructionInfo;
/**
* 特种设备基本信息-施工信息 Mapper 接口
*
* @author Zhang Yingbin
* @date 2022-07-19
*/
public interface ConstructionInfoMapper extends BaseMapper<ConstructionInfo> {
}
package com.yeejoin.amos.boot.module.app.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.app.api.entity.EquipTechParamBoiler;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface EquipTechParamBoilerMapper extends BaseMapper<EquipTechParamBoiler> {
}
package com.yeejoin.amos.boot.module.app.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.app.api.entity.EquipTechParamElevator;
public interface EquipTechParamElevatorMapper extends BaseMapper<EquipTechParamElevator> {
}
package com.yeejoin.amos.boot.module.app.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.app.api.entity.EquipTechParamLifting;
public interface EquipTechParamLiftingMapper extends BaseMapper<EquipTechParamLifting> {
}
package com.yeejoin.amos.boot.module.app.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.app.api.entity.EquipTechParamPipeline;
public interface EquipTechParamPipelineMapper extends BaseMapper<EquipTechParamPipeline> {
}
package com.yeejoin.amos.boot.module.app.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.app.api.entity.EquipTechParamRides;
public interface EquipTechParamRidesMapper extends BaseMapper<EquipTechParamRides> {
}
package com.yeejoin.amos.boot.module.app.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.app.api.entity.EquipTechParamRopeway;
public interface EquipTechParamRopewayMapper extends BaseMapper<EquipTechParamRopeway> {
}
package com.yeejoin.amos.boot.module.app.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.app.api.entity.EquipTechParamVehicle;
public interface EquipTechParamVehicleMapper extends BaseMapper<EquipTechParamVehicle> {
}
package com.yeejoin.amos.boot.module.app.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.app.api.entity.EquipTechParamVessel;
public interface EquipTechParamVesselMapper extends BaseMapper<EquipTechParamVessel> {
}
package com.yeejoin.amos.boot.module.app.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.app.api.entity.EquipmentCategoryData;
/**
* 一码通总览数据统计
*
* @author system_generator
*/
public interface EquipmentCategoryDataMapper extends BaseMapper<EquipmentCategoryData> {
}
package com.yeejoin.amos.boot.module.app.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.app.api.dto.EquipExportDto;
import com.yeejoin.amos.boot.module.app.api.dto.EquipmentCategoryDto;
import com.yeejoin.amos.boot.module.app.api.dto.UseUnitCreditCodeCategoryDto;
import com.yeejoin.amos.boot.module.app.api.vo.EquipExportVo;
import com.yeejoin.amos.boot.module.app.api.entity.EquipmentCategory;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
/**
* 装备分类 Mapper 接口
*
* @author system_generator
* @date 2021-10-20
*/
public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
@Select("select * from tz_equipment_category where code in('1000','2000','3000','4000','5000','6000','8000','9000')")
List<EquipmentCategoryDto> selectClassify();
List<Map<String, Object>> getCategoryCount(@Param("companyCode") String companyCode);
Map<String, Object> getAdministrativeDivision(@Param("division") String division, @Param("county") String county);
List<Map<String, Object>> getSrcee(@Param("tableName") String tableName,
@Param("orgBranchName") String orgBranchName,
@Param("equList") String equList,
@Param("equCategory") String equCategory,
@Param("usePlace") String usePlace,
@Param("equState") String equState);
Map<String, Object> getCategoryAndDefineByRecord(@Param("record") String record);
List<Map<String, Object>> getAllUnit(@Param("unitCodes") List<String> unitCodes, @Param("orgBranchCodes") List<String> orgBranchCodes);
List<Map<String, Object>> getCategoryData(String level, String orgCode, String companyCode);
String getUnitCodeByRecord(String record);
List<UseUnitCreditCodeCategoryDto> useUnitCreditCodeCategoryCount();
List<EquipExportVo> getEquipExportData(@Param("dto") EquipExportDto dto);
}
package com.yeejoin.amos.boot.module.app.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.app.api.entity.InspectionDetectionInfo;
import org.apache.ibatis.annotations.Mapper;
/**
* 安全追溯-检验检测信息表
*
* @author cpp
* @date 2023-04-06 19:18:21
*/
@Mapper
public interface InspectionDetectionInfoMapper extends BaseMapper<InspectionDetectionInfo> {
InspectionDetectionInfo selectInspection(String superviseCode);
}
package com.yeejoin.amos.boot.module.app.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.app.api.entity.MaintenanceInfo;
/**
* 特种设备基本信息-维保备案信息 Mapper 接口
*
* @author Zhang Yingbin
* @date 2022-07-19
*/
public interface MaintenanceInfoMapper extends BaseMapper<MaintenanceInfo> {
}
package com.yeejoin.amos.boot.module.app.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.app.api.entity.MainParts;
/**
* Mapper 接口
*
* @author duanwei
* @date 2023-04-10
*/
public interface MidEquipMainPartsMapper extends BaseMapper<MainParts> {
}
package com.yeejoin.amos.boot.module.app.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.app.api.entity.ProtectionDevices;
/**
* Mapper 接口
*
* @author duanwei
* @date 2023-04-10
*/
public interface MidEquipProtectionDevicesMapper extends BaseMapper<ProtectionDevices> {
}
package com.yeejoin.amos.boot.module.app.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.app.api.entity.OtherInfo;
/**
* 特种设备基本信息-其他信息 Mapper 接口
*
* @author Zhang Yingbin
* @date 2022-07-19
*/
public interface OtherInfoMapper extends BaseMapper<OtherInfo> {
}
package com.yeejoin.amos.boot.module.app.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.app.api.entity.ProduceInfo;
/**
* 特种设备基本信息-制造信息 Mapper 接口
*
* @author Zhang Yingbin
* @date 2022-07-19
*/
public interface ProduceInfoMapper extends BaseMapper<ProduceInfo> {
}
package com.yeejoin.amos.boot.module.app.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.app.api.entity.RegistrationInfo;
/**
* 特种设备基本信息-注册登记信息 Mapper 接口
*
* @author Zhang Yingbin
* @date 2022-07-19
*/
public interface RegistrationInfoMapper extends BaseMapper<RegistrationInfo> {
}
package com.yeejoin.amos.boot.module.app.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.app.api.entity.SpeUseUnit;
/**
* 使用单位 Mapper 接口
*
* @author duanwei
* @date 2022-09-08
*/
public interface SpeUseUnitMapper extends BaseMapper<SpeUseUnit> {
}
package com.yeejoin.amos.boot.module.app.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.app.api.entity.SuperviseInfo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 特种设备基本信息-监督管理信息 Mapper 接口
*
* @author Zhang Yingbin
* @date 2022-07-19
*/
public interface SuperviseInfoMapper extends BaseMapper<SuperviseInfo> {
void updateRecordBatch(@Param("recordList") List<String> recordList);
List<Map<String,Object>> selectUnitCodeList(@Param("records") List<String> records);
List<String> selectSuperviseCodeList(@Param("records") List<String> records);
void deleteDataAll(@Param("records") List<String> records);
}
package com.yeejoin.amos.boot.module.app.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.app.api.entity.SupervisoryCodeInfo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 装备分类 Mapper 接口
*
* @author system_generator
* @date 2021-10-20
*/
public interface SupervisoryCodeInfoMapper extends BaseMapper<SupervisoryCodeInfo> {
void updateStatus(@Param("superviseCodeList") List<String> superviseCodeList);
}
package com.yeejoin.amos.boot.module.app.api.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.app.api.dto.EquEnterDto;
import com.yeejoin.amos.boot.module.app.api.dto.TzBaseEnterpriseInfoDto;
import com.yeejoin.amos.boot.module.app.api.entity.TzBaseEnterpriseInfo;
/**
* 企业数据信息 Mapper 接口
*
* @author duanwei
* @date 2022-08-10
*/
public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseInfo> {
/**
* 查找企业关联设备详情列表
*
* @param sequenceNbr 企业id
* @return EquEnterDto 使用登记证代码、设备名称、设备类别、设备位置
*/
List<EquEnterDto> getInfo(String sequenceNbr);
/**
* 根据企业名称查找设备
*
* @param useUnit 企业名称
* @return
*/
List<EquEnterDto> getInfoByUseUnit(String useUnit);
/**
* 根据企业名称查找企业详情信息
* @param useUnit
* @return
*/
TzBaseEnterpriseInfo selectByUseUnit(String useUnit);
IPage<TzBaseEnterpriseInfoDto> page(Page<TzBaseEnterpriseInfoDto> page, TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto);
IPage<TzBaseEnterpriseInfoDto> pageList(Page<TzBaseEnterpriseInfoDto> page, TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto, List orgCodeList);
}
package com.yeejoin.amos.boot.module.app.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.app.api.entity.UseInfo;
/**
* 特种设备基本信息-使用信息 Mapper 接口
*
* @author Zhang Yingbin
* @date 2022-07-19
*/
public interface UseInfoMapper extends BaseMapper<UseInfo> {
}
package com.yeejoin.amos.boot.module.app.api.mapper;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
@Mapper
public interface ViewJgClaimMapper {
String supervisoryCode(String code);
List<Map<String, Object>> getDetialMapList(String record);
}
package com.yeejoin.amos.boot.module.app.api.service;
/**
* 单位注册许可信息表接口类
*
* @author system_generator
* @date 2022-08-09
*/
public interface IBaseUnitLicenceService {
}
package com.yeejoin.amos.boot.module.app.api.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.app.api.entity.CategoryOtherInfo;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/**
* 装备分类接口类
*
* @author system_generator
* @date 2021-10-20
*/
public interface IEquipmentCategoryService {
List<Map<String,Object>> equipTree(String type);
Page equipClaimOverview();
Map<String, String> createSupervisorCode(Map<String, Object> map, String record);
List<LinkedHashMap> getTree();
List<LinkedHashMap> creatTree();
List<LinkedHashMap> getRegion(String level, String parentId);
Map<String,Object> getCategoryAndDefineByRecord(String rowId);
List<CategoryOtherInfo> checkCode(Map<String, Object> obj);
List<String> updateOtherInfo(Map<String, Object> map);
Map<String,Map<String,Object>> getFormRecordById(Map<String, Object> map);
void checkEsData(String id);
void createEquipmentCategoryData();
List<String> deleteBatch(Map<String, Object> map);
ResponseModel submit(Map<String, Object> map);
}
package com.yeejoin.amos.boot.module.app.api.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.amos.boot.module.app.api.dto.EquEnterDto;
import com.yeejoin.amos.boot.module.app.api.dto.TzBaseEnterpriseInfoDto;
import com.yeejoin.amos.boot.module.app.api.entity.PageParam;
import com.yeejoin.amos.boot.module.app.api.entity.TzBaseEnterpriseInfo;
import java.util.List;
import java.util.Map;
/**
* 企业数据信息 服务类
*
* @author duanwei
* @date 2022-08-10
*/
public interface ITzBaseEnterpriseInfoService extends IService<TzBaseEnterpriseInfo> {
/**
* 查找企业关联设备详情列表
*
* @param sequenceNbr 企业id
* @return EquEnterDto 使用登记证代码、设备名称、设备类别、设备位置
*/
List<EquEnterDto> getInfo(String sequenceNbr);
IPage<TzBaseEnterpriseInfoDto> page(PageParam pageParam, TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto);
TzBaseEnterpriseInfoDto detail(Long id);
IPage<TzBaseEnterpriseInfoDto> page(PageParam pageParam, String companyName);
List<EquEnterDto> getInfoByUseUnit(String useUnit);
TzBaseEnterpriseInfoDto selectByUseUnit(String useUnit);
String syncEnterpriseInfo();
TzBaseEnterpriseInfoDto companyInfoUpdate(Map<String, Object> map);
Map<String,Object> adminInfoUpdate(Map<String, Object> map);
TzBaseEnterpriseInfoDto getInfoByUseCode(String useCode);
String setLabel(List<Long> enterpriseIds, List<String> enterpriseLabels);
}
package com.yeejoin.amos.boot.module.app.api.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
@Data
public class EquipExportVo {
@ExcelProperty(value = "管辖机构", index = 0)
String orgBranchName;
@ExcelProperty(value = "使用单位", index = 1)
String useUnitName;
@ExcelProperty(value = "设备种类", index = 2)
String equList;
@ExcelProperty(value = "设备类别", index = 3)
String equCategory;
@ExcelProperty(value = "使用登记证编号", index = 4)
String useOrgCode;
@ExcelProperty(value = "96333识别码", index = 5)
String code96333;
@ExcelProperty(value = "监管码", index = 6)
String supervisoryCode;
@ExcelProperty(value = "所属区域", index = 7)
String usePlace;
@ExcelProperty(value = "设备状态", index = 8)
String equState;
}
package com.yeejoin.amos.boot.module.app.api.vo;
import lombok.Data;
import org.apache.http.client.methods.CloseableHttpResponse;
import java.io.InputStream;
/**
* @description: http封装响应对象
* @author: duanwei
* @create: 2019-08-08 13:30
**/
@Data
public class ResponeVo {
int code;
CloseableHttpResponse response;
String content;
byte[] inStream;
InputStream inputStream;
}
package com.yeejoin.amos.boot.module.app.flc.api.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
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;
import java.util.List;
/**
* 注册单位工商信息表
*
* @author system_generator
* @date 2022-08-10
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="RegUnitIcDto", description="注册单位工商信息表")
public class RegUnitIcDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "单位名称")
private String unitName;
@ApiModelProperty(value = "证件code")
private String unitCode;
@ApiModelProperty(value = "所属行业")
private String industryName;
@ApiModelProperty(value = "登记机关")
private String registeredOrgan;
@ApiModelProperty(value = "登记机关编码")
private String registeredOrganCode;
@ApiModelProperty(value = "核准时间")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date approvedDate;
@ApiModelProperty(value = "经营状态:在业、吊销、注销、迁入、迁出、停业、清算")
private String businessState;
@ApiModelProperty(value = "经营状态code")
private String businessStateCode;
private String area;
private String stree;
private String community;
private String address;
private String legalPerson;
private String province;
private String city;
private String district;
private String registerAddress;
private List registerAddressList;
//是否从工商查询到数据(1是 0否)
private String isNotAccess;
}
package com.yeejoin.amos.boot.module.app.flc.api.dto;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.app.api.dto.BaseUnitLicenceDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.ArrayList;
import java.util.List;
/**
* 单位注册信息表
*
* @author system_generator
* @date 2022-08-09
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="RegUnitInfoDto", description="单位注册信息表")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class RegUnitInfoDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "单位名称")
private String name;
@ApiModelProperty(value = "证件code")
private String unitCode;
@ApiModelProperty(value = "证件类型")
private String unitCodeType;
@ApiModelProperty(value = "证件类型名称")
private String unitCodeTypeName;
@ApiModelProperty(value = "单位类型")
private List<String> unitTypeList;
@ApiModelProperty(value = "单位类型code")
private List<String> unitTypeCodeList;
@ApiModelProperty(value = "管辖机构")
private String managementUnit;
@ApiModelProperty(value = "管辖单位id")
private String managementUnitId;
@ApiModelProperty(value = "区域编码")
private String regionCode;
@ApiModelProperty(value = "国家")
private String country;
@ApiModelProperty(value = "省")
private String province;
@ApiModelProperty(value = "市")
private String city;
@ApiModelProperty(value = "县区")
private String district;
@ApiModelProperty(value = "街道")
private String stree;
@ApiModelProperty(value = "小区")
private String community;
@ApiModelProperty(value = "详细地址")
private String address;
@ApiModelProperty(value = "经度")
private String longitude;
@ApiModelProperty(value = "纬度")
private String latitude;
@ApiModelProperty(value = "单位法人")
private String legalPerson;
@ApiModelProperty(value = "法人电话")
private String legalPersonTel;
@ApiModelProperty(value = "单位联系人")
private String contactPerson;
@ApiModelProperty(value = "联系人电话")
private String contactPersonTel;
@ApiModelProperty(value = "管理员姓名")
private String adminName;
@ApiModelProperty(value = "管理员用户名")
private String adminLoginName;
@ApiModelProperty(value = "管理员密码")
private String adminLoginPwd;
@ApiModelProperty(value = "管理员手机号")
private String adminTel;
@ApiModelProperty(value = "管理员身份证号")
private String adminIdNumber;
@ApiModelProperty(value = "身份证照片(正反面)")
private List adminIdCardPhoto;
@ApiModelProperty(value = "审核状态:1-无需审核;2-待审核;3-已审核")
private String state;
@ApiModelProperty(value = "工商信息")
private RegUnitIcDto regUnitIc;
@ApiModelProperty(value = "行政许可")
private List<BaseUnitLicenceDto> unitLicences = new ArrayList<>();
@ApiModelProperty(value = "平台公司id,平台创建公司后更新")
private String amosCompanySeq;
@ApiModelProperty(value = "平台用户id,平台创建用户后更新")
private String adminUserId;
JSONObject form;
}
package com.yeejoin.amos.boot.module.app.flc.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 注册单位工商信息表
*
* @author system_generator
* @date 2022-08-10
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("tz_flc_reg_unit_ic")
public class RegUnitIc extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 单位名称
*/
@TableField("unit_name")
private String unitName;
/**
* 证件code
*/
@TableField("unit_code")
private String unitCode;
/**
* 所属行业
*/
@TableField("industry_name")
private String industryName;
/**
* 登记机关名称
*/
@TableField("registered_organ")
private String registeredOrgan;
/**
* 登记机关code
*/
@TableField("registered_organ_code")
private String registeredOrganCode;
/**
* 核准时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@TableField("approved_date")
private Date approvedDate;
/**
* 经营状态名称:在业、吊销、注销、迁入、迁出、停业、清算
*/
@TableField("business_state")
private String businessState;
/**
* 经营状态code
*/
@TableField("business_state_code")
private String businessStateCode;
}
package com.yeejoin.amos.boot.module.app.flc.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* 单位注册信息表
*
* @author system_generator
* @date 2022-08-09
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("tz_flc_reg_unit_info")
public class RegUnitInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 单位名称
*/
@TableField("name")
private String name;
/**
* 证件code
*/
@TableField("unit_code")
private String unitCode;
/**
* 证件类型
*/
@TableField("unit_code_type")
private String unitCodeType;
/**
* 证件类型名称
*/
private String unitCodeTypeName;
/**
* 单位类型
*/
@TableField("unit_type")
private String unitType;
/**
* 单位类型code
*/
@TableField("unit_type_code")
private String unitTypeCode;
/**
* 管辖机构
*/
@TableField("management_unit")
private String managementUnit;
/**
* 管辖单位id
*/
@TableField("management_unit_id")
private String managementUnitId;
/**
* 区域编码
*/
@TableField("region_code")
private String regionCode;
/**
* 国家
*/
@TableField("country")
private String country;
/**
* 省
*/
@TableField("province")
private String province;
/**
* 市
*/
@TableField("city")
private String city;
/**
* 县区
*/
@TableField("district")
private String district;
/**
* 街道
*/
@TableField("stree")
private String stree;
/**
* 小区
*/
@TableField("community")
private String community;
/**
* 详细地址
*/
@TableField("address")
private String address;
/**
* 经度
*/
@TableField("longitude")
private String longitude;
/**
* 纬度
*/
@TableField("latitude")
private String latitude;
/**
* 单位法人
*/
@TableField("legal_person")
private String legalPerson;
/**
* 法人电话
*/
@TableField("legal_person_tel")
private String legalPersonTel;
/**
* 单位联系人
*/
@TableField("contact_person")
private String contactPerson;
/**
* 联系人电话
*/
@TableField("contact_person_tel")
private String contactPersonTel;
/**
* 管理员姓名
*/
@TableField("admin_name")
private String adminName;
/**
* 管理员用户名
*/
@TableField("admin_login_name")
private String adminLoginName;
/**
* 管理员密码
*/
@TableField("admin_login_pwd")
private String adminLoginPwd;
/**
* 管理员手机号
*/
@TableField("admin_tel")
private String adminTel;
/**
* 管理元身份证号
*/
@TableField("admin_id_number")
private String adminIdNumber;
/**
* 审核状态:1-无需审核;2-待审核;3-已审核
*/
@TableField("state")
private String state;
/**
* 平台公司id,平台创建公司后更新
*/
@TableField("amos_company_seq")
private String amosCompanySeq;
/**
* 平台用户id,平台创建用户后更新
*/
private String adminUserId;
/**
* 身份证照片(正反面)
*/
private String adminIdCardPhoto;
}
package com.yeejoin.amos.boot.module.app.flc.api.feign;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Map;
//@FeignClient(url="http://172.16.3.34:11005",name = "AMOS-API-ACCESSAPI-ZYB", path = "/accessapi" )
@FeignClient(name = "AMOS-API-ACCESSAPI", path = "/accessapi" )
public interface AccessFeignService {
/**
* 调用accessApi的接口
* @param code
* @return
*/
@RequestMapping("/business/getData")
ResponseModel<Map<String, Object>> getData(@RequestParam String code);
/**
* 调用accessApi的接口
* @param sequenceNbr
* @return
*/
@RequestMapping("/business/updateSyncCompanyState")
ResponseModel<String> updateSyncCompanyState(@RequestParam String sequenceNbr);
}
package com.yeejoin.amos.boot.module.app.flc.api.feign;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.feign.FeignConfiguration;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List;
import java.util.Map;
@FeignClient(value = "AMOS-IDX", path = "idx", configuration = {FeignConfiguration.class})
public interface IdxFeignService {
@RequestMapping("/dimensionTable/getTreeChildIds")
ResponseModel<List<String>> getTreeChildIds(@RequestParam String dimensionTableId, @RequestParam String selectValue);
/**
* 查询表详情和表字段
*
* @param tableId
* @return
*/
@RequestMapping(value = "/table/{tableId}", method = RequestMethod.GET)
ResponseModel<JSONObject> queryByTableId(@PathVariable String tableId);
/**
* */
@RequestMapping(value = "/table/getPage", method = RequestMethod.GET)
ResponseModel<Page<Map<String,Object>>> getPage(@RequestParam Map map);
/**
*根据record查询表格数据详情
*/
@RequestMapping(value = "/report/form/getFormRecordById", method = RequestMethod.GET)
ResponseModel<Map<String,Map<String,Object>>>getFormRecordById(@RequestParam Map map);
/**
* 多表单页提交 数据填报
*/
@RequestMapping(value = "/table/batch/submit", method = RequestMethod.POST)
ResponseModel batchSubmit(@RequestParam(required = false) String taskId,
@RequestParam(required = false) String planInstanceId,
@RequestParam(required = false) String topic,
@RequestParam(required = false) String tableName,
@RequestBody Map<String, Object> kv) throws Exception;
/**
* 多表单页修改数据修改
*/
@RequestMapping(value = "/table/batch/update", method = RequestMethod.POST)
ResponseModel batchUpdate(@RequestParam(required = false) String topic,
@RequestParam(required = false) String tableName,
@RequestBody Map<String, Object> kv) throws Exception;
/**
*更新任务
*/
@RequestMapping(value = "/report/form/updateAmosTask/{taskId}", method = RequestMethod.POST)
FeignClientResult<JSONObject> updateAmosTask(@PathVariable("taskId") String taskId, @RequestBody JSONObject object);
/**
*查询任务第一个填报单
*/
@RequestMapping(value = "/report/form/getFirstFormByTaskId/{taskId}", method = RequestMethod.GET)
FeignClientResult<JSONObject> getFirstTask(@PathVariable("taskId") String taskId);
/**
*查询工作流task
*/
@RequestMapping(value = "/task-ins/{taskId}", method = RequestMethod.GET)
FeignClientResult<Map<String, Object>> getTaskId(@PathVariable("taskId") String taskId);
/**
*通用表单提交 数据填报
*/
@RequestMapping(value = "/table/submit", method = RequestMethod.POST)
FeignClientResult<String> submit(@RequestParam(value = "pageId") long pageId,
@RequestParam(value = "taskId", required = false) String taskId,
@RequestParam(value = "planInstanceId", required = false) String planInstanceId,
@RequestParam(value = "bizField", required = false) String bizField,
@RequestParam(value = "topic", required = false) String topic,
@RequestParam(value = "tableName", required = false) String tableName,
@RequestBody Map<String, Object> kv) throws Exception;
}
package com.yeejoin.amos.boot.module.app.flc.api.feign;
import com.yeejoin.amos.boot.biz.common.feign.FeignConfiguration;
import com.yeejoin.amos.component.feign.config.InnerInvokException;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.VerifyCodeAuthModel;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
@FeignClient(value = "AMOS-API-PRIVILEGE", configuration = {FeignConfiguration.class})
public interface PrivilegeFeginService {
@RequestMapping(value = "/privilege/v1/agencyuser/me", method = RequestMethod.GET)
ResponseModel<AgencyUserModel> getMe();
//获取单位树
@RequestMapping(value = "/privilege/v1/company/tree", method = RequestMethod.GET)
FeignClientResult tree(@RequestHeader("token") String token, @RequestHeader("appKey") String appKey, @RequestHeader("product") String product);
//获取省级行政区划
@RequestMapping(value = "systemctl/v1/region/level", method = RequestMethod.GET)
FeignClientResult getProvince(@RequestParam String level);
//获取行政区划树
@RequestMapping(value = "systemctl/v1/region/tree", method = RequestMethod.GET)
FeignClientResult getTree();
/**
* 手机号验证码登录
*/
@RequestMapping(value = "/privilege/v1/auth/mobile/verifycode", method = RequestMethod.POST)
FeignClientResult mobileVerifyCode(@RequestBody VerifyCodeAuthModel model) throws InnerInvokException;
}
package com.yeejoin.amos.boot.module.app.flc.api.feign;
import com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
@FeignClient(name = "UGP", path = "/ugp", configuration =
{MultipartSupportConfig.class})
public interface UgpServiceFeignClient {
/**
* 调用ugp的接口
* @param object 公司信息
* @return
*/
@RequestMapping(value = "/company/syncCompany", method = RequestMethod.POST)
ResponseModel<Boolean> syncCompany(@RequestBody Object object);
}
package com.yeejoin.amos.boot.module.app.flc.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.app.api.entity.DesignInfo;
/**
* 特种设备基本信息-设计信息 Mapper 接口
*
* @author Zhang Yingbin
* @date 2022-07-19
*/
public interface DesignInfoMapper extends BaseMapper<DesignInfo> {
}
package com.yeejoin.amos.boot.module.app.flc.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.app.flc.api.entity.RegUnitIc;
/**
* 注册单位工商信息表 Mapper 接口
*
* @author system_generator
* @date 2022-08-10
*/
public interface RegUnitIcMapper extends BaseMapper<RegUnitIc> {
}
package com.yeejoin.amos.boot.module.app.flc.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.app.flc.api.entity.RegUnitInfo;
import java.util.List;
/**
* 单位注册信息表 Mapper 接口
*
* @author system_generator
* @date 2022-08-09
*/
public interface RegUnitInfoMapper extends BaseMapper<RegUnitInfo> {
List<RegUnitInfo> userData(String phone);
RegUnitInfo userDataINfo(String adminLoginName, String adminLoginPwd);
RegUnitInfo userIdINfo(String userId);
}
package com.yeejoin.amos.boot.module.app.flc.api.service;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.module.app.flc.api.dto.RegUnitInfoDto;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
* 单位注册信息表接口类
*
* @author system_generator
* @date 2022-08-09
*/
public interface IRegUnitInfoService {
/**
* 单位注册
* @param model RegUnitInfoDto
* @return RegUnitInfoDto
*/
RegUnitInfoDto registerUnit(RegUnitInfoDto model);
/**
* 单位校验
* @param unitCode 单位唯一编号
* @param unitType 单位类型
* @return RegUnitInfoDto
*/
RegUnitInfoDto unitCheck(String unitCode, String unitType, String companyName);
/**
* 单位类型列表字典
* @return List<DataDictionary>
*/
List<DataDictionary> getUnitTypeList();
/**
* 获取管辖机构树
* @return 组织架构中单位级别为:省级、地市级、区县级的单位
*/
Collection getManagementUnitTree(String orgCode);
/**
* 单位注销
* @param unitCode 单位唯一标识
* @return 是否成功
*/
Boolean unitLogOut(String unitCode);
/**
* 校验是否已经存在相同的账号
* @param userName 账号
* @return true 已存在相同账号,不能注册 false 不存在账号,可以注册
*/
Boolean checkRepeatAccount(String userName);
/**
* 手机号重复校验
* @param phoneNo 手机号
* @return true 已存在不能注册 false 不存在可以注册
*/
Boolean checkRepeatPhone(String phoneNo);
void updateAdminInfo(JSONObject dataResult);
Boolean creatQrCode();
RegUnitInfoDto adminInfo(String unitCode);
String submit(Long pageId, String taskId, String planInstanceId, String topic, String tableName, Map<String, Object> objectMap) throws Exception;
}
<?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.app.api.mapper.CategoryOtherInfoMapper">
<select id="selectSupervisorCode" resultType="com.yeejoin.amos.boot.module.app.api.entity.CategoryOtherInfo">
SELECT SUPERVISORY_CODE
FROM biz_jg_supervisory_code bjsc
WHERE SUPERVISORY_CODE LIKE CONCAT(#{supervisorCode}, '%')
ORDER BY SUPERVISORY_CODE DESC LIMIT 1
</select>
<update id="updateSupervisorCode">
UPDATE idx_biz_jg_other_info
SET
"RECORD" = #{record}
<if test="supervisorCode != null and supervisorCode != ''">
, "SUPERVISORY_CODE" = #{supervisorCode}
</if>
<if test="code != ''">
, "CODE96333" = #{code}
</if>
WHERE
"RECORD" = #{record}
</update>
<select id="selectElevatorCode" resultType="com.yeejoin.amos.boot.module.app.api.entity.CategoryOtherInfo">
SELECT CODE96333 code
FROM biz_jg_supervisory_code bjsc
WHERE CODE96333 LIKE CONCAT(#{elevatorCode}, '%')
<if test="status != null and status != ''">
and status = #{status}
</if>
<if test="status != 2 ">ORDER BY CODE96333 DESC LIMIT 1 </if>
<if test="status == 2 ">ORDER BY CODE96333 ASC LIMIT 1 </if>
</select>
<select id="selectEquipInfo" resultType="com.yeejoin.amos.boot.module.app.api.dto.EquInfoDto">
SELECT "CITY",
"COUNTY",
"EQU_LIST" equipList,
"EQU_CATEGORY" equipCategory,
ibjoi."CODE96333" code,
ibjoi."CLAIM_STATUS" status,
ibjoi."SUPERVISORY_CODE" supervisor,
ibjoi."RECORD",
ibjui."EQU_STATE" equState
FROM idx_biz_jg_other_info ibjoi
LEFT JOIN idx_biz_jg_register_info ibjri ON ibjoi.RECORD = ibjri.RECORD
LEFT JOIN idx_biz_jg_use_info ibjui ON ibjoi.RECORD = ibjui.RECORD
WHERE ibjoi."RECORD" = #{record}
</select>
<select id="selectDataById" resultType="java.util.Map">
SELECT SEQUENCE_NBR,
ORG_BRANCH_NAME,
ORG_BRANCH_CODE,
USE_UNIT_NAME,
USE_UNIT_CREDIT_CODE,
EQU_LIST_CODE,
EQU_LIST,
EQU_CATEGORY,
USE_ORG_CODE,
CODE96333,
EQU_CODE,
SUPERVISORY_CODE,
USE_PLACE ,
ADDRESS,
EQU_STATE,
STATUS
from idx_biz_view_jg_all
WHERE SEQUENCE_NBR = #{id}
</select>
<select id="queryInitCode" resultType="com.yeejoin.amos.boot.module.app.api.entity.CategoryOtherInfo">
SELECT CODE96333 code
FROM biz_jg_supervisory_code
<where>
<if test="initCode != null and initCode != ''">
CODE96333 = #{initCode}
</if>
</where>
LIMIT 1
</select>
<update id="updateCode">
UPDATE biz_jg_supervisory_code bjsc
SET status = #{equState}
WHERE SUPERVISORY_CODE = #{supervisorCode}
</update>
<update id="updateOtherInfo">
UPDATE idx_biz_jg_other_info
SET "EDIT_STATUS" = #{editStatus}
WHERE "SUPERVISORY_CODE" = #{supervisorCode}
</update>
</mapper>
<?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.app.api.mapper.EquipmentCategoryMapper">
<select id="getCategoryCount" resultType="java.util.Map">
SELECT temp.code category,
IFNULL ( A.count, 0 ) waitClaim,
IFNULL ( b.count, 0 ) alreadyClaim,
IFNULL ( C.count, 0 ) refuseClaim
FROM
(
SELECT
code
FROM
"tz_equipment_category"
WHERE
code LIKE'%000'
AND code <![CDATA[ <> ]]> 7000
AND code <![CDATA[ <> ]]> 'F000') temp LEFT JOIN
(
SELECT
"EQU_LIST",
COUNT ( * )
FROM
idx_biz_jg_use_info ibjui
LEFT JOIN idx_biz_jg_supervision_info ibjsi ON ibjui.RECORD = ibjsi.RECORD
LEFT JOIN idx_biz_jg_register_info ibjri ON ibjui.RECORD = ibjri.RECORD
LEFT JOIN idx_biz_jg_other_info ibjoi ON ibjui.RECORD = ibjoi.RECORD
WHERE
ibjoi.claim_status = '待认领'
AND ibjui."USE_UNIT_CREDIT_CODE" = #{companyCode}
GROUP BY
"EQU_LIST"
) A on temp.code = A."EQU_LIST" LEFT JOIN (
SELECT
"EQU_LIST",
COUNT ( * )
FROM
idx_biz_jg_use_info ibjui
LEFT JOIN idx_biz_jg_supervision_info ibjsi ON ibjui.RECORD = ibjsi.RECORD
LEFT JOIN idx_biz_jg_register_info ibjri ON ibjui.RECORD = ibjri.RECORD
LEFT JOIN idx_biz_jg_other_info ibjoi ON ibjui.RECORD = ibjoi.RECORD
WHERE
ibjoi.claim_status = '已认领'
AND ibjui."USE_UNIT_CREDIT_CODE" = #{companyCode}
GROUP BY
"EQU_LIST"
) b ON temp.code = b."EQU_LIST"
LEFT JOIN (
SELECT
"EQU_LIST",
COUNT ( * )
FROM
idx_biz_jg_use_info ibjui
LEFT JOIN idx_biz_jg_supervision_info ibjsi ON ibjui.RECORD = ibjsi.RECORD
LEFT JOIN idx_biz_jg_register_info ibjri ON ibjui.RECORD = ibjri.RECORD
LEFT JOIN idx_biz_jg_other_info ibjoi ON ibjui.RECORD = ibjoi.RECORD
WHERE
ibjoi.claim_status = '已拒领'
AND ibjui."USE_UNIT_CREDIT_CODE" = #{companyCode}
GROUP BY
"EQU_LIST"
) C ON temp.code = C."EQU_LIST"
</select>
<select id="getAdministrativeDivision" resultType="java.util.Map">
SELECT
code,
type,
type_desc
FROM
cb_data_dictionary
WHERE
type= #{division}
AND extend LIKE CONCAT('%',#{county},'%')
</select>
<select id="getSrcee" resultType="java.util.Map">
SELECT
*
from
${tableName}
<where>
<if test="orgBranchName !=null and orgBranchName != ''">
and ORG_BRANCH_NAME is not NULL
and ORG_BRANCH_NAME !=''
GROUP BY ORG_BRANCH_NAME
</if>
<if test="equList !=null and equList != ''">
and EQU_LIST is not NULL
and EQU_LIST !=''
GROUP BY EQU_LIST
</if>
<if test="equCategory !=null and equCategory != ''">
and EQU_CATEGORY is not NULL
and EQU_CATEGORY !=''
GROUP BY EQU_CATEGORY
</if>
<if test="usePlace !=null and usePlace != ''">
and
USE_PLACE is not NULL
and USE_PLACE !=''
GROUP BY USE_PLACE
</if>
<if test="equState !=null and equState != ''">
and
EQU_STATE is not NULL
and EQU_STATE !=''
GROUP BY EQU_STATE
</if>
</where>
</select>
<select id="getCategoryAndDefineByRecord" resultType="java.util.Map">
SELECT
"EQU_CATEGORY",
"EQU_DEFINE"
FROM
idx_biz_jg_register_info
WHERE
"RECORD" = #{record}
</select>
<select id="getAllUnit" resultType="java.util.Map">
SELECT
ibjui.USE_UNIT_CREDIT_CODE use_code,
ibjsi.ORG_BRANCH_CODE supervise_org_code
FROM
idx_biz_jg_use_info ibjui
LEFT JOIN idx_biz_jg_supervision_info ibjsi ON ibjui."RECORD" = ibjsi."RECORD"
WHERE
ibjui.USE_UNIT_CREDIT_CODE <![CDATA[ <> ]]> ''
AND (lengthb(ibjui.USE_UNIT_CREDIT_CODE)= 15 or lengthb(ibjui.USE_UNIT_CREDIT_CODE)= 18)
<if test="unitCodes !=null and unitCodes.size>0">
and ibjui.USE_UNIT_CREDIT_CODE in
<foreach collection="unitCodes" separator="," item="unitCode" open="(" close=")">
#{unitCode}
</foreach>
</if>
<if test="orgBranchCodes !=null and orgBranchCodes.size>0">
and ibjsi.ORG_BRANCH_CODE in
<foreach collection="orgBranchCodes" separator="," item="orgBranchCode" open="(" close=")">
#{orgBranchCode}
</foreach>
</if>
GROUP BY use_code,supervise_org_code
</select>
<select id="getCategoryData" resultType="java.util.Map">
SELECT
(SELECT
to_json ( b ) :: json
FROM
(SELECT
ifnull ( SUM ( int4 ( ( elevator :: json -> 'waitClaim' ) ) ), 0 ) waitClaim,
ifnull ( SUM ( int4 ( ( elevator :: json -> 'alreadyClaim' ) ) ), 0 ) alreadyClaim,
ifnull ( SUM ( int4 ( ( elevator :: json -> 'refuseClaim' ) ) ), 0 ) refuseClaim
FROM
biz_jg_equipment_category_data bjecd
WHERE
<if test="level == 'company'">
bjecd."unit_code" = #{companyCode}
</if>
<if test="level != 'company'">
bjecd."org_branch_code" LIKE CONCAT('%',#{orgCode},'%')
</if>
) b
) elevator,
(SELECT
to_json ( b ) :: json
FROM
(SELECT
ifnull ( SUM ( int4 ( ( vehicle :: json -> 'waitClaim' ) ) ), 0 ) waitClaim,
ifnull ( SUM ( int4 ( ( vehicle :: json -> 'alreadyClaim' ) ) ), 0 ) alreadyClaim,
ifnull ( SUM ( int4 ( ( vehicle :: json -> 'refuseClaim' ) ) ), 0 ) refuseClaim
FROM
biz_jg_equipment_category_data bjecd
WHERE
<if test="level == 'company'">
bjecd."unit_code" = #{companyCode}
</if>
<if test="level != 'company'">
bjecd."org_branch_code" LIKE CONCAT('%',#{orgCode},'%')
</if>
) b
) vehicle,
(SELECT
to_json ( b ) :: json
FROM
(SELECT
ifnull ( SUM ( int4 ( ( ropeway :: json -> 'waitClaim' ) ) ), 0 ) waitClaim,
ifnull ( SUM ( int4 ( ( ropeway :: json -> 'alreadyClaim' ) ) ), 0 ) alreadyClaim,
ifnull ( SUM ( int4 ( ( ropeway :: json -> 'refuseClaim' ) ) ), 0 ) refuseClaim
FROM
biz_jg_equipment_category_data bjecd
WHERE
<if test="level == 'company'">
bjecd."unit_code" = #{companyCode}
</if>
<if test="level != 'company'">
bjecd."org_branch_code" LIKE CONCAT('%',#{orgCode},'%')
</if>
) b
) ropeway,
(SELECT
to_json ( b ) :: json
FROM
(SELECT
ifnull ( SUM ( int4 ( ( rides :: json -> 'waitClaim' ) ) ), 0 ) waitClaim,
ifnull ( SUM ( int4 ( ( rides :: json -> 'alreadyClaim' ) ) ), 0 ) alreadyClaim,
ifnull ( SUM ( int4 ( ( rides :: json -> 'refuseClaim' ) ) ), 0 ) refuseClaim
FROM
biz_jg_equipment_category_data bjecd
WHERE
<if test="level == 'company'">
bjecd."unit_code" = #{companyCode}
</if>
<if test="level != 'company'">
bjecd."org_branch_code" LIKE CONCAT('%',#{orgCode},'%')
</if>
) b
) rides,
(SELECT
to_json ( b ) :: json
FROM
(SELECT
ifnull ( SUM ( int4 ( ( boiler :: json -> 'waitClaim' ) ) ), 0 ) waitClaim,
ifnull ( SUM ( int4 ( ( boiler :: json -> 'alreadyClaim' ) ) ), 0 ) alreadyClaim,
ifnull ( SUM ( int4 ( ( boiler :: json -> 'refuseClaim' ) ) ), 0 ) refuseClaim
FROM
biz_jg_equipment_category_data bjecd
WHERE
<if test="level == 'company'">
bjecd."unit_code" = #{companyCode}
</if>
<if test="level != 'company'">
bjecd."org_branch_code" LIKE CONCAT('%',#{orgCode},'%')
</if>
) b
) boiler,
(SELECT
to_json ( b ) :: json
FROM
(SELECT
ifnull ( SUM ( int4 ( ( vessel :: json -> 'waitClaim' ) ) ), 0 ) waitClaim,
ifnull ( SUM ( int4 ( ( vessel :: json -> 'alreadyClaim' ) ) ), 0 ) alreadyClaim,
ifnull ( SUM ( int4 ( ( vessel :: json -> 'refuseClaim' ) ) ), 0 ) refuseClaim
FROM
biz_jg_equipment_category_data bjecd
WHERE
<if test="level == 'company'">
bjecd."unit_code" = #{companyCode}
</if>
<if test="level != 'company'">
bjecd."org_branch_code" LIKE CONCAT('%',#{orgCode},'%')
</if>
) b
) vessel,
(SELECT
to_json ( b ) :: json
FROM
(SELECT
ifnull ( SUM ( int4 ( ( pipeline :: json -> 'waitClaim' ) ) ), 0 ) waitClaim,
ifnull ( SUM ( int4 ( ( pipeline :: json -> 'alreadyClaim' ) ) ), 0 ) alreadyClaim,
ifnull ( SUM ( int4 ( ( pipeline :: json -> 'refuseClaim' ) ) ), 0 ) refuseClaim
FROM
biz_jg_equipment_category_data bjecd
WHERE
<if test="level == 'company'">
bjecd."unit_code" = #{companyCode}
</if>
<if test="level != 'company'">
bjecd."org_branch_code" LIKE CONCAT('%',#{orgCode},'%')
</if>
) b
) pipeline,
(SELECT
to_json ( b ) :: json
FROM
(SELECT
ifnull ( SUM ( int4 ( ( lifting :: json -> 'waitClaim' ) ) ), 0 ) waitClaim,
ifnull ( SUM ( int4 ( ( lifting :: json -> 'alreadyClaim' ) ) ), 0 ) alreadyClaim,
ifnull ( SUM ( int4 ( ( lifting :: json -> 'refuseClaim' ) ) ), 0 ) refuseClaim
FROM
biz_jg_equipment_category_data bjecd
WHERE
<if test="level == 'company'">
bjecd."unit_code" = #{companyCode}
</if>
<if test="level != 'company'">
bjecd."org_branch_code" LIKE CONCAT('%',#{orgCode},'%')
</if>
) b
) lifting
</select>
<select id="getUnitCodeByRecord" resultType="java.lang.String">
select "USE_UNIT_CREDIT_CODE" from idx_biz_jg_use_info where "RECORD" = #{id}
</select>
<select id="useUnitCreditCodeCategoryCount" resultType="com.yeejoin.amos.boot.module.app.api.dto.UseUnitCreditCodeCategoryDto">
SELECT
ibjsi."ORG_BRANCH_CODE",
ibjui."USE_UNIT_CREDIT_CODE",
ibjoi."CLAIM_STATUS",
ibjri."EQU_LIST",
COUNT ( * ) as TOTAL
FROM
idx_biz_jg_use_info ibjui
LEFT JOIN idx_biz_jg_register_info ibjri ON ibjui.RECORD = ibjri.RECORD
LEFT JOIN idx_biz_jg_other_info ibjoi ON ibjui.RECORD = ibjoi.RECORD
LEFT JOIN idx_biz_jg_supervision_info ibjsi ON ibjsi."RECORD" = ibjui."RECORD"
where
ibjoi."CLAIM_STATUS" <![CDATA[ <> ]]> ''
and ibjui."USE_UNIT_CREDIT_CODE" <![CDATA[ <> ]]> ''
and ibjri."EQU_LIST" <![CDATA[ <> ]]> ''
GROUP BY ibjui."USE_UNIT_CREDIT_CODE",ibjsi."ORG_BRANCH_CODE", ibjoi."CLAIM_STATUS",ibjri."EQU_LIST"
</select>
<select id="getEquipExportData" resultType="com.yeejoin.amos.boot.module.app.api.vo.EquipExportVo">
select ORG_BRANCH_NAME as orgBranchName,
USE_UNIT_NAME as useUnitName,
EQU_LIST as equList,
EQU_CATEGORY as equCategory,
USE_ORG_CODE as useOrgCode,
CODE96333 as code96333,
SUPERVISORY_CODE as supervisoryCode,
USE_PLACE as usePlace,
EQU_CODE as equCode,
CASE when EQU_STATE = 0 then '未登记'
when EQU_STATE = 1 then '在用'
when EQU_STATE = 2 then '停用'
when EQU_STATE = 3 then '报废'
when EQU_STATE = 4 then '注销'
ELSE EQU_STATE
END as equState
from ${dto.tableName}
<where>
<if test="dto.CODE96333 != '' and dto.CODE96333 != null">CODE96333 like concat('%', #{dto.CODE96333},'%')</if>
<if test="dto.EQU_CODE != '' and dto.EQU_CODE != null">and EQU_CODE like concat('%', #{dto.EQU_CODE},'%')</if>
<if test="dto.SUPERVISORY_CODE != '' and dto.SUPERVISORY_CODE != null">and SUPERVISORY_CODE like concat('%', #{dto.SUPERVISORY_CODE},'%')</if>
<if test="dto.USE_UNIT_NAME != '' and dto.USE_UNIT_NAME != null">and USE_UNIT_NAME like concat('%', #{dto.USE_UNIT_NAME},'%')</if>
<if test="dto.USE_ORG_CODE != '' and dto.USE_ORG_CODE != null">and USE_ORG_CODE like concat('%', #{dto.USE_ORG_CODE},'%')</if>
<if test="dto.EQU_LIST_CODE != '' and dto.EQU_LIST_CODE != null">and EQU_LIST_CODE = #{dto.EQU_LIST_CODE}</if>
<if test="dto.EQU_STATE != '' and dto.EQU_STATE != null">and EQU_STATE = #{dto.EQU_STATE}</if>
<if test="dto.ORG_BRANCH_NAME != '' and dto.ORG_BRANCH_NAME != null">and ORG_BRANCH_NAME = #{dto.ORG_BRANCH_NAME}</if>
<if test="dto.USE_PLACE != '' and dto.USE_PLACE != null">and USE_PLACE = #{dto.USE_PLACE}</if>
<if test="dto.STATUS != '' and dto.STATUS != null">and STATUS = #{dto.STATUS}</if>
<if test="dto.EQU_CATEGORY != '' and dto.EQU_CATEGORY != null">and EQU_CATEGORY = #{dto.EQU_CATEGORY}</if>
<if test="dto.USE_UNIT_CREDIT_CODE != '' and dto.USE_UNIT_CREDIT_CODE != null">and USE_UNIT_CREDIT_CODE like concat('%', #{dto.USE_UNIT_CREDIT_CODE},'%')</if>
<if test="dto.ORG_BRANCH_CODE != '' and dto.ORG_BRANCH_CODE != null">and ORG_BRANCH_CODE like concat('%', #{dto.ORG_BRANCH_CODE},'%')</if>
<if test='dto.ids != null'> and SEQUENCE_NBR in
<foreach collection="dto.ids" item="id" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
</where>
</select>
</mapper>
<?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.app.api.mapper.InspectionDetectionInfoMapper">
<select id="selectInspection" resultType="com.yeejoin.amos.boot.module.app.api.entity.InspectionDetectionInfo">
SELECT *
FROM idx_biz_jg_inspection_detection_info
WHERE "RECORD" = (SELECT "RECORD" FROM "idx_biz_jg_other_info" WHERE "SUPERVISORY_CODE" = #{superviseCode})
ORDER BY "INSPECT_DATE" DESC LIMIT 1
</select>
</mapper>
\ No newline at end of file
<?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.app.flc.api.mapper.RegUnitInfoMapper">
<select id="userData" resultType="com.yeejoin.amos.boot.module.app.flc.api.entity.RegUnitInfo">
SELECT
sequence_nbr,
name,
unit_code,
unit_code_type,
unit_type,
unit_type_code,
management_unit,
management_unit_id,
region_code,
country,
province,
city,
district,
stree,
community,
address,
longitude,
latitude,
industry_name,
legal_person,
legal_person_tel,
contact_person,
contact_person_tel,
admin_name,
admin_login_name,
admin_login_pwd,
admin_tel,
admin_id_number,
state,
admin_user_id,
amos_company_seq,
rec_user_id,
rec_user_name,
rec_date,
is_delete,
unit_code_type_name,
admin_id_card_photo
FROM tz_flc_reg_unit_info WHERE admin_tel=#{phone}
</select>
<select id="userDataINfo" resultType="com.yeejoin.amos.boot.module.app.flc.api.entity.RegUnitInfo">
SELECT
sequence_nbr,
name,
unit_code,
unit_code_type,
unit_type,
unit_type_code,
management_unit,
management_unit_id,
region_code,
country,
province,
city,
district,
stree,
community,
address,
longitude,
latitude,
industry_name,
legal_person,
legal_person_tel,
contact_person,
contact_person_tel,
admin_name,
admin_tel,
admin_id_number,
amos_company_seq,
unit_code_type_name,
admin_id_card_photo
FROM tz_flc_reg_unit_info WHERE admin_login_name=#{adminLoginName}
OR admin_tel=#{adminLoginName}
AND admin_login_pwd=#{adminLoginPwd}
</select>
<select id="userIdINfo" resultType="com.yeejoin.amos.boot.module.app.flc.api.entity.RegUnitInfo">
SELECT
sequence_nbr,
name,
unit_code,
unit_code_type,
unit_type,
unit_type_code,
management_unit,
management_unit_id,
region_code,
country,
province,
city,
district,
stree,
community,
address,
longitude,
latitude,
industry_name,
legal_person,
legal_person_tel,
contact_person,
contact_person_tel,
admin_name,
admin_tel,
admin_id_number,
amos_company_seq,
unit_code_type_name,
admin_id_card_photo
FROM tz_flc_reg_unit_info WHERE
admin_user_id=#{userId}
</select>
</mapper>
<?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.app.api.mapper.SuperviseInfoMapper">
<update id="updateRecordBatch">
UPDATE idx_biz_jg_use_info SET "IS_NOT_ES" = 1 WHERE "RECORD" IN
<foreach collection="recordList" separator="," item="record" open="(" close=")">
#{record}
</foreach>
</update>
<select id="selectUnitCodeList" resultType="java.util.Map">
SELECT
ui."USE_UNIT_CREDIT_CODE" unitCode,
si."ORG_BRANCH_CODE" orgBranchCode
FROM
idx_biz_jg_use_info ui
left join idx_biz_jg_supervision_info si ON ui."RECORD" = si."RECORD"
WHERE ui."RECORD" in
<foreach collection="records" separator="," item="record" open="(" close=")">
#{record}
</foreach>
GROUP BY unitCode,orgBranchCode
</select>
<select id="selectSuperviseCodeList" resultType="java.lang.String">
SELECT
SUPERVISORY_CODE code
FROM
idx_biz_jg_other_info oi
WHERE oi."RECORD" in
<foreach collection="records" separator="," item="record" open="(" close=")">
#{record}
</foreach>
</select>
<delete id="deleteDataAll" >
delete from idx_biz_jg_use_info where "RECORD" in
<foreach collection="records" separator="," item="record" open="(" close=");">
#{record}
</foreach>
delete from idx_biz_jg_design_info where "RECORD" in
<foreach collection="records" separator="," item="record" open="(" close=");">
#{record}
</foreach>
delete from idx_biz_jg_factory_info where "RECORD" in
<foreach collection="records" separator="," item="record" open="(" close=");">
#{record}
</foreach>
delete from idx_biz_jg_construction_info where "RECORD" in
<foreach collection="records" separator="," item="record" open="(" close=");">
#{record}
</foreach>
delete from idx_biz_jg_register_info where "RECORD" in
<foreach collection="records" separator="," item="record" open="(" close=");">
#{record}
</foreach>
delete from idx_biz_jg_maintenance_record_info where "RECORD" in
<foreach collection="records" separator="," item="record" open="(" close=");">
#{record}
</foreach>
delete from idx_biz_jg_other_info where "RECORD" in
<foreach collection="records" separator="," item="record" open="(" close=");">
#{record}
</foreach>
delete from idx_biz_jg_inspection_detection_info where "RECORD" in
<foreach collection="records" separator="," item="record" open="(" close=");">
#{record}
</foreach>
delete from idx_biz_jg_tech_params_elevator where "RECORD" in
<foreach collection="records" separator="," item="record" open="(" close=");">
#{record}
</foreach>
delete from idx_biz_jg_tech_params_vehicle where "RECORD" in
<foreach collection="records" separator="," item="record" open="(" close=");">
#{record}
</foreach>
delete from idx_biz_jg_tech_params_ropeway where "RECORD" in
<foreach collection="records" separator="," item="record" open="(" close=");">
#{record}
</foreach>
delete from idx_biz_jg_tech_params_rides where "RECORD" in
<foreach collection="records" separator="," item="record" open="(" close=");">
#{record}
</foreach>
delete from idx_biz_jg_tech_params_boiler where "RECORD" in
<foreach collection="records" separator="," item="record" open="(" close=");">
#{record}
</foreach>
delete from idx_biz_jg_tech_params_vessel where "RECORD" in
<foreach collection="records" separator="," item="record" open="(" close=");">
#{record}
</foreach>
delete from idx_biz_jg_tech_params_pipeline where "RECORD" in
<foreach collection="records" separator="," item="record" open="(" close=");">
#{record}
</foreach>
delete from idx_biz_jg_tech_params_lifting where "RECORD" in
<foreach collection="records" separator="," item="record" open="(" close=");">
#{record}
</foreach>
delete from idx_biz_jg_main_parts where "RECORD" in
<foreach collection="records" separator="," item="record" open="(" close=");">
#{record}
</foreach>
delete from idx_biz_jg_protection_devices where "RECORD" in
<foreach collection="records" separator="," item="record" open="(" close=");">
#{record}
</foreach>
</delete>
</mapper>
\ No newline at end of file
<?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.app.api.mapper.SupervisoryCodeInfoMapper">
<update id="updateStatus">
update biz_jg_supervisory_code set status = '2' where supervisory_code in
<foreach collection="superviseCodeList" separator="," item="superviseCode" open="(" close=")">
#{superviseCode}
</foreach>
</update>
</mapper>
\ No newline at end of file
<?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.app.api.mapper.TzBaseEnterpriseInfoMapper">
<select id="getInfoByUseUnit"
resultType="com.yeejoin.amos.boot.module.app.api.dto.EquEnterDto">
SELECT
RI.sequence_nbr,
RI.use_org_code,
RI.equ_category,
RI.product_name,
UI.address
FROM
idx_biz_jg_register_info RI LEFT JOIN
idx_biz_jg_use_info UI ON RI."RECORD" = UI."RECORD"
WHERE RI."RECORD" in (SELECT "RECORD" FROM
idx_biz_jg_use_info WHERE "USE_UNIT_NAME"=#{useUnit} ) and "USE_ORG_CODE" is not null
</select>
<select id="getInfo"
resultType="com.yeejoin.amos.boot.module.app.api.dto.EquEnterDto">
SELECT
RI.sequence_nbr,
RI.use_org_code,
RI.equ_category,
RI.product_name,
UI.address
FROM
tz_jg_registration_info AS RI
LEFT JOIN tz_jg_use_info UI ON RI.sequence_code = UI.sequence_code
LEFT JOIN tz_base_enterprise_info EI ON EI.sequence_nbr = #{sequenceNbr}
WHERE
EI.use_code = RI.organization_code
</select>
<select id="page"
resultType="com.yeejoin.amos.boot.module.app.api.dto.TzBaseEnterpriseInfoDto">
SELECT
*,
CONCAT(province,'/',city,'/',district) AS region,
CONCAT(street,'/',address) AS full_address
FROM
tz_base_enterprise_info
<where>
<if
test="tzBaseEnterpriseInfoDto.unitType!=null and tzBaseEnterpriseInfoDto.unitType!='' ">
AND unit_type = #{tzBaseEnterpriseInfoDto.unitType}
</if>
<if
test="tzBaseEnterpriseInfoDto.useUnit!=null and tzBaseEnterpriseInfoDto.useUnit!='' ">
AND use_unit LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.useUnit},'%')
</if>
<if
test="tzBaseEnterpriseInfoDto.useUnitCertificate!=null and tzBaseEnterpriseInfoDto.useUnitCertificate!='' ">
AND use_unit_certificate = #{tzBaseEnterpriseInfoDto.useUnitCertificate}
</if>
<if
test="tzBaseEnterpriseInfoDto.useCode!=null and tzBaseEnterpriseInfoDto.useCode!='' ">
AND use_code LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.useCode},'%')
</if>
<if
test="tzBaseEnterpriseInfoDto.region!=null and tzBaseEnterpriseInfoDto.region!='' ">
AND CONCAT(province,'/',city,'/',district) LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.region},'%')
</if>
<if
test="tzBaseEnterpriseInfoDto.legalPerson!=null and tzBaseEnterpriseInfoDto.legalPerson!='' ">
AND legal_person LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.legalPerson},'%')
</if>
<if
test="tzBaseEnterpriseInfoDto.legalPhone!=null and tzBaseEnterpriseInfoDto.legalPhone!='' ">
AND legal_phone LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.legalPhone},'%')
</if>
<if
test="tzBaseEnterpriseInfoDto.superviseOrgCode!=null and tzBaseEnterpriseInfoDto.superviseOrgCode!='' ">
AND supervise_org_code LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.superviseOrgCode},'%')
</if>
<if
test="tzBaseEnterpriseInfoDto.address!=null and tzBaseEnterpriseInfoDto.address!='' ">
AND supervise_org_code LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.address},'%')
</if>
AND is_delete = 0
</where>
</select>
<select id="pageList"
resultType="com.yeejoin.amos.boot.module.app.api.dto.TzBaseEnterpriseInfoDto">
SELECT
*,
CONCAT(province,'/',city,'/',district) AS region,
CONCAT(street,'/',address) AS full_address
FROM
tz_base_enterprise_info
<where>
<if
test="tzBaseEnterpriseInfoDto.unitType!=null and tzBaseEnterpriseInfoDto.unitType!='' ">
AND unit_type = #{tzBaseEnterpriseInfoDto.unitType}
</if>
<if
test="tzBaseEnterpriseInfoDto.useUnit!=null and tzBaseEnterpriseInfoDto.useUnit!='' ">
AND use_unit LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.useUnit},'%')
</if>
<if
test="tzBaseEnterpriseInfoDto.useUnitCertificate!=null and tzBaseEnterpriseInfoDto.useUnitCertificate!='' ">
AND use_unit_certificate = #{tzBaseEnterpriseInfoDto.useUnitCertificate}
</if>
<if
test="tzBaseEnterpriseInfoDto.useCode!=null and tzBaseEnterpriseInfoDto.useCode!='' ">
AND use_code LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.useCode},'%')
</if>
<if
test="tzBaseEnterpriseInfoDto.region!=null and tzBaseEnterpriseInfoDto.region!='' ">
AND CONCAT(province,'/',city,'/',district) LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.region},'%')
</if>
<if
test="tzBaseEnterpriseInfoDto.legalPerson!=null and tzBaseEnterpriseInfoDto.legalPerson!='' ">
AND legal_person LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.legalPerson},'%')
</if>
<if
test="tzBaseEnterpriseInfoDto.legalPhone!=null and tzBaseEnterpriseInfoDto.legalPhone!='' ">
AND legal_phone LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.legalPhone},'%')
</if>
<if
test="tzBaseEnterpriseInfoDto.superviseOrgCode!=null and tzBaseEnterpriseInfoDto.superviseOrgCode!='' ">
AND supervise_org_code LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.superviseOrgCode},'%')
</if>
<if
test="tzBaseEnterpriseInfoDto.address!=null and tzBaseEnterpriseInfoDto.address!='' ">
AND address LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.address},'%')
</if>
<if test="tzBaseEnterpriseInfoDto.regulatoryLabels!=null and tzBaseEnterpriseInfoDto.regulatoryLabels!='' ">
AND regulatory_labels LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.regulatoryLabels},'%')
</if>
<if test="orgCodeList != null and ! orgCodeList.isEmpty() and orgCodeList.size() > 0">
<foreach collection="orgCodeList" item="item" index="index" >
<if test="index==0">
AND
</if>
<if test="index!= 0">
OR
</if>
supervise_org_code LIKE CONCAT('%',#{item},'%')
</foreach>
</if>
AND is_delete = 0
</where>
order by rec_date desc
</select>
<select id="selectByUseUnit" resultType="com.yeejoin.amos.boot.module.app.api.entity.TzBaseEnterpriseInfo">
select * from tz_base_enterprise_info where use_unit = #{useUnit}
</select>
</mapper>
<?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.app.api.mapper.ViewJgClaimMapper">
<select id="supervisoryCode" resultType="java.lang.String">
SELECT "SEQUENCE_NBR" FROM idx_biz_view_jg_claim WHERE SUPERVISORY_CODE=#{code}
</select>
<select id="getDetialMapList" resultType="java.util.Map">
SELECT
SEQUENCE_NBR,
ORG_BRANCH_NAME,
ORG_BRANCH_CODE,
USE_UNIT_NAME,
REC_DATE,
USE_UNIT_CREDIT_CODE,
EQU_LIST_CODE,
EQU_LIST,
EQU_CATEGORY,
USE_ORG_CODE,
CODE96333,
EQU_CODE,
SUPERVISORY_CODE,
USE_PLACE,
ADDRESS,
EQU_STATE,
STATUS,
EDIT_STATUS
FROM idx_biz_view_jg_claim
<where>
<if test="record !=null and record != ''">
SEQUENCE_NBR =#{record}
</if>
</where>
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>amos-boot-module-app</artifactId>
<groupId>com.amosframework.boot</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>amos-boot-module-app-biz</artifactId>
<dependencies>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-app-api</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-common-biz</artifactId>
<version>${amos-biz-boot.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.7.8</version>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
package com.yeejoin.amos;
import com.yeejoin.amos.boot.biz.common.utils.oConvertUtils;
import com.yeejoin.amos.boot.module.app.biz.service.impl.StartPlatformTokenService;
import net.javacrumbs.shedlock.spring.annotation.EnableSchedulerLock;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
import java.net.InetAddress;
import java.net.UnknownHostException;
/**
* <pre>
* 特种设备服务启动类
* </pre>
*
* @author DELL
*/
@SpringBootApplication
@EnableTransactionManagement
@EnableConfigurationProperties
@ServletComponentScan
@EnableDiscoveryClient
@EnableFeignClients
@EnableAsync
@EnableSwagger2WebMvc
@EnableEurekaClient
@EnableSchedulerLock(defaultLockAtMostFor = "10m")
//@EnableScheduling
@MapperScan({"org.typroject.tyboot.demo.face.orm.dao*", "org.typroject.tyboot.face.*.orm.dao*",
"org.typroject.tyboot.core.auth.face.orm.dao*", "org.typroject.tyboot.component.*.face.orm.dao*",
"com.yeejoin.amos.boot.module.**.api.mapper", "com.yeejoin.amos.boot.biz.common.dao.mapper"})
@ComponentScan(basePackages = {"org.typroject", "com.yeejoin.amos"})
public class AmosWeAppApplication {
private static final Logger logger = LoggerFactory.getLogger(AmosWeAppApplication.class);
@Autowired
private StartPlatformTokenService startPlatformTokenService;
public static void main(String[] args) throws UnknownHostException {
ConfigurableApplicationContext context = SpringApplication.run(AmosWeAppApplication.class, args);
Environment env = context.getEnvironment();
String ip = InetAddress.getLocalHost().getHostAddress();
String port = env.getProperty("server.port");
String path = oConvertUtils.getString(env.getProperty("server.servlet.context-path"));
logger.info("\n----------------------------------------------------------\n\t"
+ "Application Amos-Biz-Boot is running! Access URLs:\n\t" + "Swagger文档: \thttp://" + ip + ":" + port
+ path + "/doc.html\n" + "----------------------------------------------------------");
}
@Bean
public void initToken() {
startPlatformTokenService.getToken();
}
}
package com.yeejoin.amos.boot.module.app.biz.config;
import org.apache.http.HttpHost;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.Arrays;
@Configuration
public class ElasticSearchClientConfig {
@Value("${spring.elasticsearch.rest.uris}")
private String uris;
@Value("${elasticsearch.username}")
private String username;
@Value("${elasticsearch.password}")
private String password;
@Bean(destroyMethod = "close")
public RestHighLevelClient restHighLevelClient() {
final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
credentialsProvider.setCredentials(AuthScope.ANY,
new UsernamePasswordCredentials(username, password));
try {
HttpHost[] httpHosts = Arrays.stream(uris.split(",")).map(HttpHost::create).toArray(HttpHost[]::new);
RestClientBuilder builder = RestClient.builder(httpHosts);
builder.setHttpClientConfigCallback(httpClientBuilder -> {
httpClientBuilder.disableAuthCaching();
return httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider);
});
// 该方法接收一个RequestConfig.Builder对象,对该对象进行修改后然后返回。
builder.setRequestConfigCallback(requestConfigBuilder -> {
// 连接超时(默认为1秒)
return requestConfigBuilder.setConnectTimeout(5000 * 1000)
// 套接字超时(默认为30秒)//更改客户端的超时限制默认30秒现在改为100*1000分钟
.setSocketTimeout(6000 * 1000);
});
return new RestHighLevelClient(builder);
} catch (Exception e) {
throw new IllegalStateException("Invalid ES nodes " + "property '" + uris + "'", e);
}
}
}
package com.yeejoin.amos.boot.module.app.biz.config;
import com.baomidou.mybatisplus.annotation.DbType;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
@Configuration(value="MybatisPlusConfig")
public class MybatisPlusConfig {
@Bean
public PaginationInterceptor paginationInterceptor()
{
PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
paginationInterceptor.setLimit(50000);
paginationInterceptor.setDialectType(DbType.POSTGRE_SQL.getDb());
return paginationInterceptor;
}
// @Bean
// public MybatisPlusInterceptor mybatisPlusInterceptor() {
// MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
// interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.H2));
// return interceptor;
// }
}
package com.yeejoin.amos.boot.module.app.biz.config;
import net.javacrumbs.shedlock.core.LockProvider;
import net.javacrumbs.shedlock.provider.redis.spring.RedisLockProvider;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
/**
* @author Administrator
*/
@Configuration
public class ShedLockConfig {
@Bean
public LockProvider lockProvider(RedisConnectionFactory connectionFactory) {
return new RedisLockProvider(connectionFactory);
}
}
package com.yeejoin.amos.boot.module.app.biz.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.app.api.common.MobileLoginParam;
import com.yeejoin.amos.boot.module.app.api.dto.TzBaseEnterpriseInfoDto;
import com.yeejoin.amos.boot.module.app.api.entity.PageParam;
import com.yeejoin.amos.boot.module.app.api.entity.TzBaseEnterpriseInfo;
import com.yeejoin.amos.boot.module.app.api.mapper.ViewJgClaimMapper;
import com.yeejoin.amos.boot.module.app.api.service.ITzBaseEnterpriseInfoService;
import com.yeejoin.amos.boot.module.app.biz.service.impl.EquipmentCategoryServiceImpl;
import com.yeejoin.amos.boot.module.app.biz.service.impl.TzsAppService;
import com.yeejoin.amos.boot.module.app.flc.api.entity.RegUnitInfo;
import com.yeejoin.amos.boot.module.app.flc.api.mapper.RegUnitInfoMapper;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.PermissionModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@RestController
@Slf4j
@Api(tags = "tzs小程序接口")
@RequestMapping(value = "/tzs-app")
public class TzsAppController {
@Autowired
TzsAppService appService;
@Autowired
private RegUnitInfoMapper regUnitInfoMapper;
@Autowired
private ViewJgClaimMapper viewJgClaimMapper;
@Autowired
ITzBaseEnterpriseInfoService iTzBaseEnterpriseInfoService;
@Autowired
private EquipmentCategoryServiceImpl equipmentCategoryService;
private static final String LEVEL = "company";
private static final String COMPANYPATH = "/company";
private static final String JIANGUAN="/";
/**
* 小程序获取设备详情
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/equipmentInfo")
@ApiOperation(httpMethod = "GET", value = "小程序获取设备详情", notes = "小程序获取设备详情")
public ResponseModel<Object> getEquipmentInfo(String record) {
return ResponseHelper.buildResponse(appService.getEquipmentInfo(record));
}
/**
* 小程序获取设备详情-微信扫一扫
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/equipmentInfoWX")
@ApiOperation(httpMethod = "GET", value = "小程序获取设备详情", notes = "小程序获取设备详情")
public ResponseModel<Object> getEquipmentInfoWX(String record) {
return ResponseHelper.buildResponse(appService.getEquipmentInfoWX(record));
}
/**
* 根据监管码查询设备详情
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getEquipInfoBySuperviseCode")
@ApiOperation(httpMethod = "GET", value = "根据监管码查询设备详情", notes = "根据监管码查询设备详情")
public ResponseModel<Object> getEquipInfoBySuperviseCode(String supervisoryCode) {
return ResponseHelper.buildResponse(appService.getEquipInfoBySuperviseCode(supervisoryCode));
}
/**
* 登录
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@PostMapping(value = "/mobile/login")
@ApiOperation(httpMethod = "POST", value = "小程序登录", notes = "小程序登录")
public ResponseModel<Map<String, Object>> login(@RequestBody MobileLoginParam param) {
return ResponseHelper.buildResponse(appService.login(param));
}
/**
* 小程序企业详情
* */
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/details", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "小程序企业详情", notes = "小程序企业详情")
public ResponseModel<IPage<TzBaseEnterpriseInfoDto>> pageInfo( String unitCode) {
PageParam pageParam = new PageParam();
LambdaQueryWrapper<TzBaseEnterpriseInfo> objectLambdaQueryWrapper = new LambdaQueryWrapper<>();
objectLambdaQueryWrapper.eq(!ValidationUtil.isEmpty(unitCode),TzBaseEnterpriseInfo::getUseCode,unitCode);
TzBaseEnterpriseInfo neInfo = iTzBaseEnterpriseInfoService.getOne(objectLambdaQueryWrapper, true);
return ResponseHelper.buildResponse(iTzBaseEnterpriseInfoService.page(pageParam, neInfo.getUseUnit()));
}
/**
* 小程序菜单权限
* */
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/permission/tree", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "小程序菜单权限", notes = "小程序菜单权限")
public FeignClientResult<Collection<PermissionModel>> tree(HttpServletRequest http,@RequestParam(value = "most",required = false)String most) {
FeignClientResult<Collection<PermissionModel>> app=new FeignClientResult<Collection<PermissionModel>>();
if (ValidationUtil.isEmpty(most)) {
//根据当前登录人的公司是企业还是监管来过滤
List<JSONObject> objectList = equipmentCategoryService.getCompanyType();
List<JSONObject> total = objectList.stream().filter(item -> !LEVEL.equals(item.getString("level"))).collect(Collectors.toList());
if (total.size()==0) {
//企业
app = Privilege.permissionClient.queryPermissionTree("APP", null, null, COMPANYPATH, null);
} else {
//监管
app = Privilege.permissionClient.queryPermissionTree("APP", null, null, JIANGUAN, null);
}
}else {
//更多应用
app = Privilege.permissionClient.queryPermissionTree("APP", null, null, most, null);
}
return app;
}
//修改密码
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{userId}/password", method = RequestMethod.PUT)
@ApiOperation(httpMethod = "PUT", value = "修改密码", notes = "修改密码")
public ResponseModel<Boolean> updatePassword( @PathVariable("userId") String userId ,@RequestBody AgencyUserModel AgencyUserModel) {
Boolean result =false;
if ( ValidationUtil.isEmpty(userId) ||
ValidationUtil.isEmpty(AgencyUserModel.getOriginalPassword()) ||
ValidationUtil.isEmpty(AgencyUserModel.getRePassword()) ||
ValidationUtil.isEmpty(AgencyUserModel.getPassword()) ) {
log.error("用户信息不能为空");
return ResponseHelper.buildResponse(result);
}
if (!AgencyUserModel.getRePassword().equals(AgencyUserModel.getPassword())) {
log.error("两次密码不一致");
return ResponseHelper.buildResponse(result);
}
//平台修改
AgencyUserModel.setUserId(userId);
FeignClientResult<AgencyUserModel> agencyUserModelFeignClientResult = Privilege.agencyUserClient.modifyPassword(userId, AgencyUserModel);
if ( agencyUserModelFeignClientResult.getStatus() !=200 ) {
log.error("Privilege远程调用失败");
return ResponseHelper.buildResponse(result);
}
if ( ValidationUtil.isEmpty(agencyUserModelFeignClientResult.getResult()) || ValidationUtil.isEmpty(agencyUserModelFeignClientResult.getResult().getUserId())) {
log.error("平台修改失败");
return ResponseHelper.buildResponse(result);
}
//走业务修改
LambdaQueryWrapper<RegUnitInfo> objectLambdaQueryWrapper = new LambdaQueryWrapper<>();
objectLambdaQueryWrapper.eq(RegUnitInfo::getAdminUserId,agencyUserModelFeignClientResult.getResult().getUserId());
RegUnitInfo regUnitInfo = new RegUnitInfo();
regUnitInfo.setAdminLoginPwd(AgencyUserModel.getRePassword());
int update = regUnitInfoMapper.update(regUnitInfo, objectLambdaQueryWrapper);
if (update == 0) {
log.error("业务更新失败");
return ResponseHelper.buildResponse(result);
}
result=true;
return ResponseHelper.buildResponse(result);
}
//扫一扫功能通过监管查询SEQUENCE_NBR
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/supervisoryCode", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "扫一扫功能通过监管查询SEQUENCE_NBR", notes = "扫一扫功能通过监管查询SEQUENCE_NBR")
public ResponseModel<String> supervisoryCode(String code) {
String sequenceNbr = viewJgClaimMapper.supervisoryCode(code);
return ResponseHelper.buildResponse(sequenceNbr);
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@RequestMapping(value = "/wxUserLogin", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "微信授权登陆", notes = "微信授权登陆")
public ResponseModel<JSONObject> wxUserLogin(@RequestBody JSONObject wx) {
return ResponseHelper.buildResponse(appService.wxUserLogin(wx));
}
//企业的设备总数统计
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "企业的认领设备总数", notes = "企业的认领设备总数")
@GetMapping(value = "/equipmentCount")
public ResponseModel<Object> equipClaimOverview(String unitCode) {
return ResponseHelper.buildResponse(appService.equipmentCount(unitCode));
}
//设备列表
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "设备列表", notes = "设备列表")
@GetMapping(value = "/getTable")
public ResponseModel<Page<Map<String,Object>>> getTable(@RequestParam Map<String,Object> map) {
return ResponseHelper.buildResponse(appService.getTable(map));
}
//行政区划树
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "行政区划code", notes = "行政区划code")
@GetMapping(value = "/getRegionName")
public ResponseModel<JSONArray> getRegionName() {
return ResponseHelper.buildResponse(appService.getRegionName());
}
}
package com.yeejoin.amos.boot.module.app.biz.core.async;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.Executor;
@Configuration
public class TaskExecutorPoolConfig {
@Bean("asyncTaskExecutor")
public Executor taskExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(10);//线程池维护线程的最少数量
executor.setMaxPoolSize(100); //线程池维护线程的最大数量
executor.setQueueCapacity(100);
executor.setKeepAliveSeconds(30);//线程池维护线程所允许的空闲时间,TimeUnit.SECONDS
executor.setThreadNamePrefix("asyncTaskExecutor-");
// 线程池对拒绝任务的处理策略: CallerRunsPolicy策略,当线程池没有处理能力的时候,该策略会直接在 execute 方法的调用线程中运行被拒绝的任务;如果执行程序已关闭,则会丢弃该任务
// executor.setRejectedExecutionHandler(ThreadPoolExecutor.CallerRunsPolicy());
return executor;
}
}
package com.yeejoin.amos.boot.module.app.biz.core.threadpool;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
* 线程池
*/
public class AmosThreadPool {
/**
* 日志记录器
*/
private static final Logger log = LoggerFactory.getLogger(AmosThreadPool.class);
/**
* 单例
*/
private static AmosThreadPool instance;
/**
* 执行服务
*/
private static ExecutorService executorService;
/**
* 获取单例
*
* @return
*/
public static AmosThreadPool getInstance() {
if (instance == null) {
synchronized (AmosThreadPool.class) {
if (instance == null) {
instance = new AmosThreadPool();
}
}
}
return instance;
}
static {
executorService = Executors
.newFixedThreadPool(20);
}
/**
* 执行线程
*
* @param task
*/
public void execute(Runnable task) {
executorService.execute(task);
}
}
package com.yeejoin.amos.boot.module.app.biz.dao;
import com.yeejoin.amos.boot.module.app.api.dto.ESEquipmentCategoryDto;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface ESEquipmentCategory extends PagingAndSortingRepository<ESEquipmentCategoryDto, String> {
}
package com.yeejoin.amos.boot.module.app.biz.service;
import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import java.util.List;
/**
* 特种设备权限服务类
*/
public interface TzsAuthService {
List<String> getUserRegionCode();
List<RegionModel> getUserReginTree();
}
package com.yeejoin.amos.boot.module.app.biz.service.impl;
import com.yeejoin.amos.boot.module.app.api.entity.BaseUnitLicence;
import com.yeejoin.amos.boot.module.app.api.mapper.BaseUnitLicenceMapper;
import com.yeejoin.amos.boot.module.app.api.dto.BaseUnitLicenceDto;
import com.yeejoin.amos.boot.module.app.api.service.IBaseUnitLicenceService;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
/**
* 单位注册许可信息表服务实现类
*
* @author system_generator
* @date 2022-08-09
*/
@Service
public class BaseUnitLicenceServiceImpl extends BaseService<BaseUnitLicenceDto,BaseUnitLicence, BaseUnitLicenceMapper> implements IBaseUnitLicenceService {
/**
* 分页查询
*/
public Page<BaseUnitLicenceDto> queryForBaseUnitLicencePage(Page<BaseUnitLicenceDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询
* @param unitCode 单位编号
*/
public List<BaseUnitLicenceDto> queryForBaseUnitLicenceList(String unitCode) {
return this.queryForList("" , false, unitCode);
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.app.biz.service.impl;
import com.yeejoin.amos.boot.module.app.api.dto.ConstructionInfoModel;
import com.yeejoin.amos.boot.module.app.api.entity.ConstructionInfo;
import com.yeejoin.amos.boot.module.app.api.mapper.ConstructionInfoMapper;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.core.rdbms.service.BaseService;
/**
* 特种设备基本信息-施工信息 服务类
*
* @author duanwei
* @date 2022-07-19
*/
@Component
public class ConstructionInfoService extends BaseService<ConstructionInfoModel, ConstructionInfo, ConstructionInfoMapper> {
}
package com.yeejoin.amos.boot.module.app.biz.service.impl;
import com.yeejoin.amos.boot.module.app.api.dto.DesignInfoModel;
import com.yeejoin.amos.boot.module.app.api.entity.DesignInfo;
import com.yeejoin.amos.boot.module.app.flc.api.mapper.DesignInfoMapper;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.core.rdbms.service.BaseService;
/**
* 特种设备基本信息-设计信息 服务类
*
* @author duanwei
* @date 2022-07-19
*/
@Component
public class DesignInfoService extends BaseService<DesignInfoModel, DesignInfo, DesignInfoMapper> {
}
package com.yeejoin.amos.boot.module.app.biz.service.impl;
import com.yeejoin.amos.boot.module.app.api.dto.EquipTechParamBoilerModel;
import com.yeejoin.amos.boot.module.app.api.entity.EquipTechParamBoiler;
import com.yeejoin.amos.boot.module.app.api.mapper.EquipTechParamBoilerMapper;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
@Service
public class EquipTechParamBoilerService extends BaseService<EquipTechParamBoilerModel, EquipTechParamBoiler, EquipTechParamBoilerMapper> {
}
package com.yeejoin.amos.boot.module.app.biz.service.impl;
import com.yeejoin.amos.boot.module.app.api.entity.EquipTechParamElevator;
import com.yeejoin.amos.boot.module.app.api.dto.EquipTechParamElevatorModel;
import com.yeejoin.amos.boot.module.app.api.mapper.EquipTechParamElevatorMapper;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
@Service
public class EquipTechParamElevatorService extends BaseService<EquipTechParamElevatorModel, EquipTechParamElevator, EquipTechParamElevatorMapper> {
}
package com.yeejoin.amos.boot.module.app.biz.service.impl;
import com.yeejoin.amos.boot.module.app.api.dto.EquipTechParamLiftingModel;
import com.yeejoin.amos.boot.module.app.api.entity.EquipTechParamLifting;
import com.yeejoin.amos.boot.module.app.api.mapper.EquipTechParamLiftingMapper;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
@Service
public class EquipTechParamLiftingService extends BaseService<EquipTechParamLiftingModel, EquipTechParamLifting, EquipTechParamLiftingMapper> {
}
package com.yeejoin.amos.boot.module.app.biz.service.impl;
import com.yeejoin.amos.boot.module.app.api.dto.EquipTechParamPipelineModel;
import com.yeejoin.amos.boot.module.app.api.entity.EquipTechParamPipeline;
import com.yeejoin.amos.boot.module.app.api.mapper.EquipTechParamPipelineMapper;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
@Service
public class EquipTechParamPipelineService extends BaseService<EquipTechParamPipelineModel, EquipTechParamPipeline, EquipTechParamPipelineMapper> {
}
package com.yeejoin.amos.boot.module.app.biz.service.impl;
import com.yeejoin.amos.boot.module.app.api.dto.EquipTechParamRidesModel;
import com.yeejoin.amos.boot.module.app.api.entity.EquipTechParamRides;
import com.yeejoin.amos.boot.module.app.api.mapper.EquipTechParamRidesMapper;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
@Service
public class EquipTechParamRidesService extends BaseService<EquipTechParamRidesModel, EquipTechParamRides, EquipTechParamRidesMapper> {
}
package com.yeejoin.amos.boot.module.app.biz.service.impl;
import com.yeejoin.amos.boot.module.app.api.dto.EquipTechParamRopewayModel;
import com.yeejoin.amos.boot.module.app.api.entity.EquipTechParamRopeway;
import com.yeejoin.amos.boot.module.app.api.mapper.EquipTechParamRopewayMapper;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
@Service
public class EquipTechParamRopewayService extends BaseService<EquipTechParamRopewayModel, EquipTechParamRopeway, EquipTechParamRopewayMapper> {
}
package com.yeejoin.amos.boot.module.app.biz.service.impl;
import com.yeejoin.amos.boot.module.app.api.dto.EquipTechParamVehicleModel;
import com.yeejoin.amos.boot.module.app.api.entity.EquipTechParamVehicle;
import com.yeejoin.amos.boot.module.app.api.mapper.EquipTechParamVehicleMapper;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
@Service
public class EquipTechParamVehicleService extends BaseService<EquipTechParamVehicleModel, EquipTechParamVehicle, EquipTechParamVehicleMapper> {
}
package com.yeejoin.amos.boot.module.app.biz.service.impl;
import com.yeejoin.amos.boot.module.app.api.dto.EquipTechParamVesselModel;
import com.yeejoin.amos.boot.module.app.api.entity.EquipTechParamVessel;
import com.yeejoin.amos.boot.module.app.api.mapper.EquipTechParamVesselMapper;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
@Service
public class EquipTechParamVesselService extends BaseService<EquipTechParamVesselModel, EquipTechParamVessel, EquipTechParamVesselMapper> {
}
package com.yeejoin.amos.boot.module.app.biz.service.impl;
import com.yeejoin.amos.boot.module.app.api.dto.EquipmentCategoryDataDto;
import com.yeejoin.amos.boot.module.app.api.entity.EquipmentCategoryData;
import com.yeejoin.amos.boot.module.app.api.mapper.EquipmentCategoryDataMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
/**
* 一码通总览数据实现类
*
* @author system_generator
*/
@Service
@Slf4j
public class EquipmentCategoryDataServiceImpl extends BaseService<EquipmentCategoryDataDto, EquipmentCategoryData, EquipmentCategoryDataMapper> {
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.app.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.app.api.dto.*;
import com.yeejoin.amos.boot.module.app.api.entity.*;
import com.yeejoin.amos.boot.module.app.api.enums.EquimentEnum;
import com.yeejoin.amos.boot.module.app.api.enums.EquipmentCategoryEnum;
import com.yeejoin.amos.boot.module.app.api.enums.EquipmentClassifityEnum;
import com.yeejoin.amos.boot.module.app.api.mapper.*;
import com.yeejoin.amos.boot.module.app.api.service.IEquipmentCategoryService;
import com.yeejoin.amos.boot.module.app.api.vo.EquipExportVo;
import com.yeejoin.amos.boot.module.app.biz.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.app.biz.utils.JsonUtils;
import com.yeejoin.amos.boot.module.app.flc.api.feign.IdxFeignService;
import com.yeejoin.amos.boot.module.app.flc.api.feign.PrivilegeFeginService;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import lombok.extern.slf4j.Slf4j;
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.elasticsearch.search.sort.SortOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.http.HttpStatus;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StopWatch;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.DateUtil;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.io.IOException;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
import static com.alibaba.fastjson.JSON.toJSONString;
/**
* 装备分类服务实现类
*
* @author system_generator
* @date 2021-10-20
*/
@Service
@Slf4j
public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryDto, EquipmentCategory, EquipmentCategoryMapper> implements IEquipmentCategoryService {
@Autowired
ESEquipmentCategory esEquipmentCategory;
@Autowired
private SuperviseInfoMapper superviseInfoMapper;
@Autowired
private UseInfoMapper useInfoMapper;
@Autowired
EquipmentCategoryMapper equipmentCategoryMapper;
@Value("classpath:/json/equipCategory.json")
private Resource equipCategory;
@Autowired
private JdbcTemplate bizJdbcTemplate;
@Autowired
CategoryOtherInfoMapper categoryOtherInfoMapper;
@Autowired
SupervisoryCodeInfoMapper supervisoryCodeInfoMapper;
@Autowired
SuperviseInfoService superviseInfoService;
@Autowired
EquipmentCategoryDataMapper equipmentCategoryDataMapper;
@Autowired
EquipmentCategoryDataServiceImpl equipmentCategoryDataService;
@Autowired
PrivilegeFeginService privilegeFeginService;
@Autowired
IdxFeignService idxFeignService;
@Autowired
private static final String TABLENAME = "tableName";
@Value("${regulator.unit.code}")
private String code;
@Autowired
private RedisUtils redisUtils;
//管辖机构redis缓存key
private static final String REGULATOR_UNIT_TREE = "REGULATOR_UNIT_TREE";
//行政区划redis缓存key
private static final String PROVINCE = "PROVINCE";
private static final String CITY = "CITY";
private static final String REGION = "REGION";
//西安行政区划code
private static final String XIAN = "610100";
//判断行政区划查询市还是区
private static final String END_CODE = "0000";
//一码通监督管理表单id
private static final String SUPERVISION_FROM_ID = "1627903532906602497";
//一码通使用信息表单id
private static final String USE_INFO_FROM_ID = "1627903393253056514";
//一码通码自动生成
final static String CREATE = "1";
//一码通码手动输入
final static String NOT_CREATE = "0";
//一码通复制功能url参数key
private static final String COPY_KEY = "stashType";
@Autowired
RestHighLevelClient restHighLevelClient;
private static String USE_CODE = "use_code";
private static String ORG_BRANCH_CODE = "supervise_org_code";
/**
* 分页查询
*/
public Page<EquipmentCategoryDto> queryForEquipmentCategoryPage(Page<EquipmentCategoryDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<EquipmentCategoryDto> queryForEquipmentCategoryList() {
return this.queryForList("", false);
}
public List<EquipmentCategoryDto> selectClassify() {
return equipmentCategoryMapper.selectClassify();
}
@Override
public List<Map<String, Object>> equipTree(String type) {
List<Map<String, Object>> menus = new ArrayList<>();
Map<String, List<Map<String, Object>>> resourceJson = JsonUtils.getResourceJson(equipCategory);
List<Map<String, Object>> mapList;
if (ValidationUtil.isEmpty(type)) {
mapList = resourceJson.get(EquipmentClassifityEnum.BDLS.getCode());
} else {
mapList = resourceJson.get(type);
}
for (Map map : mapList) {
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("instanceName", map.get("name"));
resultMap.put("instanceId", map.get("code"));
menus.add(resultMap);
}
return menus;
}
@Override
public Page equipClaimOverview() {
Page page = new Page<>();
Map<String, List<Map<String, Object>>> resourceJson = JsonUtils.getResourceJson(equipCategory);
List<Map<String, Object>> mapList = resourceJson.get(EquipmentClassifityEnum.BDLS.getCode());
List<Map<String, Object>> list = new ArrayList<>();
ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
if (ObjectUtils.isEmpty(reginParams)) {
return null;
}
String level = reginParams.getUserModel().getCompanys().get(0).getLevel();
String orgCode = reginParams.getUserModel().getCompanys().get(0).getOrgCode();
String companyCode = reginParams.getUserModel().getCompanys().get(0).getCompanyCode();
List<Map<String, Object>> listMap = equipmentCategoryMapper.getCategoryData(level, orgCode, companyCode);
for (Map<String, Object> map : mapList) {
for (Map<String, Object> map1 : listMap) {
for (String s : map1.keySet()) {
HashMap<String, Object> jsonMap = JSON.parseObject(map1.get(s).toString(), new TypeReference<HashMap<String, Object>>() {
});
if (s.equals(map.get("type"))) {
map.put("waitClaim", Long.valueOf(map.get("waitClaim").toString()) + Long.valueOf(jsonMap.get("waitClaim").toString()));
map.put("alreadyClaim", Long.valueOf(map.get("alreadyClaim").toString()) + Long.valueOf(jsonMap.get("alreadyClaim").toString()));
map.put("refuseClaim", Long.valueOf(map.get("refuseClaim").toString()) + Long.valueOf(jsonMap.get("refuseClaim").toString()));
Long sum = Long.valueOf(jsonMap.get("waitClaim").toString()) + Long.valueOf(jsonMap.get("alreadyClaim").toString()) + Long.valueOf(jsonMap.get("refuseClaim").toString());
map.put("sum", Long.valueOf(map.get("sum").toString()) + sum);
}
}
}
list.add(map);
}
page.setCurrent(1);
page.setTotal(list.size());
page.setRecords(list);
return page;
}
/**
* 生成监管码和电梯96333识别码
*/
@Override
public Map<String, String> createSupervisorCode(Map<String, Object> map, String record) {
String city, county, equipCategory;
EquInfoDto equInfoDto = new EquInfoDto();
if (ObjectUtils.isEmpty(record)) {
//获取对应行政区划
county = EquipmentCategoryEnum.XZQH.getCode();
city = map.get("regionCode").toString();
//获取对应设备分类
equipCategory = map.get("equCategory").toString();
} else {
equInfoDto = categoryOtherInfoMapper.selectEquipInfo(record);
//判断这条数据认领状态是否为已认领,否则直接返回
if (!ObjectUtils.isEmpty(equInfoDto) && EquipmentCategoryEnum.YRL.getName().equals(equInfoDto.getStatus())) {
city = equInfoDto.getCity();
county = equInfoDto.getCounty();
equipCategory = equInfoDto.getEquipCategory();
} else {
return new HashMap<>();
}
}
//生成码
Map<String, String> codeMap;
synchronized (EquipmentCategoryServiceImpl.class) {
codeMap = creatCode(city, county, equipCategory, null,null);
}
if (ObjectUtils.isEmpty(codeMap)) {
return new HashMap<>();
}
log.info(record + "已生成对应监管码或96333电梯识别码");
String equState = EquipmentCategoryEnum.CSZT.getCode();
SupervisoryCodeInfo supervisoryCodeInfo = new SupervisoryCodeInfo();
supervisoryCodeInfo.setCode96333(codeMap.get("code96333"));
supervisoryCodeInfo.setSupervisoryCode(codeMap.get("superviseCode"));
supervisoryCodeInfo.setStatus(equState);
if (!ObjectUtils.isEmpty(record)) {
String supervisorCode, elevatorCode;
//设备状态为报废,对应电梯码作废
equState = EquipmentCategoryEnum.BF.getCode().equals(equInfoDto.getEquState()) ? EquipmentCategoryEnum.WSY.getCode() : EquipmentCategoryEnum.YSY.getCode();
supervisorCode = codeMap.get("superviseCode");
elevatorCode = EquipmentCategoryEnum.BF.getCode().equals(equInfoDto.getEquState()) ? null : codeMap.get("code96333");
List<CategoryOtherInfo> categoryOtherInfo = categoryOtherInfoMapper.selectList(new QueryWrapper<CategoryOtherInfo>().eq("SUPERVISORY_CODE", supervisorCode));
if (categoryOtherInfo.size() > 0) {
// categoryOtherInfoMapper.updateCode(supervisorCode, equState);
supervisoryCodeInfoMapper.update(supervisoryCodeInfo,new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code",supervisoryCodeInfo.getSupervisoryCode()));
} else {
supervisoryCodeInfo.setStatus(equState);
supervisoryCodeInfoMapper.insert(supervisoryCodeInfo);
}
//修改源数据的电梯码
categoryOtherInfoMapper.updateSupervisorCode(supervisorCode, elevatorCode, record);
} else {
supervisoryCodeInfoMapper.insert(supervisoryCodeInfo);
}
return codeMap;
}
@Override
public List<LinkedHashMap> getTree() {
List<LinkedHashMap> result = (List<LinkedHashMap>) redisUtils.get(REGULATOR_UNIT_TREE);
//判断redis是否存在管辖机构树
return !ObjectUtils.isEmpty(result) ? result : creatTree();
}
@Override
public List<LinkedHashMap> creatTree() {
FeignClientResult tree = privilegeFeginService.tree(RequestContext.getToken(),RequestContext.getAppKey(),RequestContext.getProduct());
List<LinkedHashMap> result = (List<LinkedHashMap>) tree.getResult();
List<LinkedHashMap> treeData = deleteRegulatorTreeData(result);
List<LinkedHashMap> supervisionTree = treeData.stream().filter(e -> code.equals(e.get("orgCode"))).collect(Collectors.toList());
List<LinkedHashMap> resultTree = updateNullChildren(supervisionTree);
redisUtils.set(REGULATOR_UNIT_TREE, resultTree);
return resultTree;
}
/**
* 将管辖机构树中children为[]的修改为null
*
* @param result
* @return
*/
private List<LinkedHashMap> updateNullChildren(List<LinkedHashMap> result) {
Iterator it = result.iterator();
while (it.hasNext()) {
LinkedHashMap e = (LinkedHashMap) it.next();
//将管辖机构树中children为[]的修改为null
if (e.get("children") != null) {
if (((List<LinkedHashMap>) e.get("children")).size() == 0) {
e.put("children", null);
}
}
if (!ObjectUtils.isEmpty(e.get("children"))) {
updateNullChildren((List<LinkedHashMap>) e.get("children"));
}
}
return result;
}
/**
* 删除管辖机构树中level为使用单位的数据
*
* @param result 管辖机构树
* @return 筛选过滤后不包含使用单位的管辖机构树
*/
private List<LinkedHashMap> deleteRegulatorTreeData(List<LinkedHashMap> result) {
Iterator it = result.iterator();
while (it.hasNext()) {
LinkedHashMap e = (LinkedHashMap) it.next();
//删除使用单位
if ("company".equals(e.get("level"))) {
it.remove();
}
if (e.get("companyName").toString().contains("行政审批局")) {
it.remove();
}
if (!ObjectUtils.isEmpty(e.get("children"))) {
deleteRegulatorTreeData((List<LinkedHashMap>) e.get("children"));
}
}
return result;
}
@Override
public List<LinkedHashMap> getRegion(String level, String parentId) {
List<LinkedHashMap> list;
if (!ObjectUtils.isEmpty(level)) {
list = (List<LinkedHashMap>) redisUtils.get(PROVINCE);
return ObjectUtils.isEmpty(list) ? getProvinceList(level) : list;
} else if (!ObjectUtils.isEmpty(parentId)) {
String regionCode = parentId.split("_")[0];
//regionCode以0000结果查询市、否则查询区
Map<String, Object> map = regionCode.endsWith(END_CODE) ? (Map<String, Object>) redisUtils.get(CITY) : (Map<String, Object>) redisUtils.get(REGION);
if (ObjectUtils.isEmpty(map)) {
map = getRegionList();
}
list = (List<LinkedHashMap>) map.get(regionCode);
return list;
} else {
return new ArrayList<>();
}
}
public Map<String, Object> getRegionList() {
//查询省下所有的行政区划市,封装并存入redis
Map<String, Object> map1 = new HashMap<>();
List<LinkedHashMap> cityList;
FeignClientResult tree = privilegeFeginService.getTree();
List<LinkedHashMap> result = (List<LinkedHashMap>) tree.getResult();
//获取陕西省regionCode
String regionCode = ((List<LinkedHashMap>) privilegeFeginService.getProvince("1").getResult()).get(0).get("regionCode").toString();
cityList = deleteTreeData(result, regionCode);
Map<String, Object> cityMap = new HashMap<>();
cityMap.put(regionCode, cityList);
map1.put(regionCode, cityList);
redisUtils.set(CITY, cityMap);
//查询市下所有的行政区划区,封装并存入redis
if (!ObjectUtils.isEmpty(cityList)) {
List<LinkedHashMap> region = (List<LinkedHashMap>) privilegeFeginService.getTree().getResult();
Map<String, Object> map = new HashMap<>();
for (LinkedHashMap linkedHashMap : cityList) {
List<LinkedHashMap> regionList = deleteTreeData(region, linkedHashMap.get("regionCode").toString());
map.put(linkedHashMap.get("regionCode").toString(), regionList);
map1.put(linkedHashMap.get("regionCode").toString(), regionList);
}
redisUtils.set(REGION, map);
}
return map1;
}
public List<LinkedHashMap> getProvinceList(String level) {
List<LinkedHashMap> list;
FeignClientResult result = privilegeFeginService.getProvince(level);
list = (List<LinkedHashMap>) result.getResult();
list.get(0).put("sequenceNbr", list.get(0).get("regionCode"));
redisUtils.set(PROVINCE, list);
return list;
}
@Override
public Map<String, Object> getCategoryAndDefineByRecord(String record) {
if (ObjectUtils.isEmpty(record)) {
return new HashMap<>();
}
return equipmentCategoryMapper.getCategoryAndDefineByRecord(record);
}
@Override
public List<CategoryOtherInfo> checkCode(Map<String, Object> obj) {
List<CategoryOtherInfo> codeList;
if ("save".equals(obj.get("type"))) {
codeList = categoryOtherInfoMapper.selectList(new QueryWrapper<CategoryOtherInfo>().eq("CODE96333", obj.get("CODE96333")));
} else {
codeList = categoryOtherInfoMapper.selectList(new QueryWrapper<CategoryOtherInfo>().ne("RECORD", obj.get("id")).eq("CODE96333", obj.get("CODE96333")));
}
return codeList;
}
@Override
public List<String> updateOtherInfo(Map<String, Object> map) {
List<String> supervisoryCodeList = (ArrayList) map.get("supervisoryCode");
List<String> list = new ArrayList<>();
for (String supervisoryCode : supervisoryCodeList) {
CategoryOtherInfo categoryOtherInfo = categoryOtherInfoMapper.selectOne(new QueryWrapper<CategoryOtherInfo>().eq("SUPERVISORY_CODE", supervisoryCode));
if (ObjectUtils.isEmpty(categoryOtherInfo)) {
list.add(supervisoryCode + ":对应的数据修改失败,请查询对应监管码是否正确");
} else {
list.add(supervisoryCode + (categoryOtherInfoMapper.updateOtherInfo(supervisoryCode, "1") == 1 ? ":对应的数据已经修改成功" : ":对应的数据修改失败,请查询对应监管码是否正确"));
}
}
return list;
}
/**
* 获取行政区划以市或区的list集合
*
* @param result 需要删除的源数据
* @param type 匹配行政区划的regionCode,获取市则需要传省的regionCode,获取区则需要传市的regionCode
* @return 对应市或区的list集合
*/
private List<LinkedHashMap> deleteTreeData(List<LinkedHashMap> result, String type) {
Iterator it = result.iterator();
List<LinkedHashMap> list = new ArrayList<>();
while (it.hasNext()) {
LinkedHashMap e = (LinkedHashMap) it.next();
//修改数据
if (type.equals(e.get("parentRegionCode").toString())) {
e.put("children", null);
e.put("sequenceNbr", e.get("regionCode"));
list.add(e);
}
if (!ObjectUtils.isEmpty(e.get("children"))) {
List<LinkedHashMap> children = deleteTreeData((List<LinkedHashMap>) e.get("children"), type);
list.addAll(children);
}
}
return list;
}
/**
* 具体生成监管码和电梯96333识别码逻辑
*/
private synchronized Map<String, String> creatCode(String city, String county, String equipCategory, String code96333,String supervisionCode) {
Map<String, String> resultMap = new HashMap<>();
StringBuilder supervisorCode = new StringBuilder();
StringBuilder elevatorCode = new StringBuilder();
CategoryOtherInfo categoryOtherInfo = new CategoryOtherInfo();
String prefix;
//判断是否需要生成96333电梯码
if (equipCategory.startsWith("3") && !XIAN.equals(city)) {
//判断数据是否携带96333电梯码,携带则使用,不携带则生成
if("null".equals(code96333)){
prefix = getPrefix(EquipmentCategoryEnum.XZQHDT.getCode(), city);
//查询未使用的电梯码
categoryOtherInfo = categoryOtherInfoMapper.selectElevatorCode(prefix, EquipmentCategoryEnum.WSY.getCode());
//如果存在未使用的电梯码则启用未使用的否则创建
String elevator = ObjectUtils.isEmpty(categoryOtherInfo) ? createElevatorCode(city, county) : categoryOtherInfo.getCode();
if(!ObjectUtils.isEmpty(categoryOtherInfo)){
supervisoryCodeInfoMapper.delete(new QueryWrapper<SupervisoryCodeInfo>().eq("code96333",categoryOtherInfo.getCode()));
}
elevatorCode.append(elevator);
resultMap.put("creatStatus",CREATE);
} else {
elevatorCode.append(code96333);
resultMap.put("creatStatus",NOT_CREATE);
}
}
//判断原数据是否存在监管码,存在则用原监管码即可,不存在则生成
if("null".equals(supervisionCode)){
String supervisor = createSupervisorCode(city, county, equipCategory);
supervisorCode.append(supervisor);
} else {
supervisorCode = new StringBuilder(supervisionCode);
}
if (ObjectUtils.isEmpty(supervisorCode) && ObjectUtils.isEmpty(elevatorCode)) {
return new HashMap<>();
}
SupervisoryCodeInfo supervisoryCodeInfo = new SupervisoryCodeInfo();
SupervisoryCodeInfo selectOne = supervisoryCodeInfoMapper.selectOne(new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code", supervisionCode));
//将生成的码添加到码表中,码的使用状态为初始状态
String equState = EquipmentCategoryEnum.CSZT.getCode();
supervisoryCodeInfo.setCode96333(String.valueOf(elevatorCode));
supervisoryCodeInfo.setCreateStatus(resultMap.get("creatStatus"));
supervisoryCodeInfo.setSupervisoryCode(String.valueOf(supervisorCode));
supervisoryCodeInfo.setStatus(equState);
if(ObjectUtils.isEmpty(selectOne)){
supervisoryCodeInfoMapper.insert(supervisoryCodeInfo);
} else {
selectOne.setCode96333(String.valueOf(elevatorCode));
supervisoryCodeInfoMapper.update(selectOne,
new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code",selectOne.getSupervisoryCode()));
}
resultMap.put("superviseCode", ObjectUtils.isEmpty(supervisorCode) ? null : supervisorCode.toString());
resultMap.put("code96333", ObjectUtils.isEmpty(elevatorCode) ? null : elevatorCode.toString());
resultMap.put("qrCode", ObjectUtils.isEmpty(supervisorCode) ? null : supervisorCode.toString());
return resultMap;
}
private String getPrefix(String type, String county) {
return equipmentCategoryMapper.getAdministrativeDivision(type, county).get("code").toString();
}
/**
* 生成监管码
*
* @param city 行政区划市
* @param county 行政区划区
* @return 监管码
*/
private String createSupervisorCode(String city, String county, String equipCategory) {
StringBuilder supervisorCode = new StringBuilder();
//生成监管码前缀
Map<String, Object> divisionMap = equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQH.getCode(), county);
String division = ObjectUtils.isEmpty(divisionMap) ? equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQH.getCode(), city).get("code").toString() : divisionMap.get("code").toString();
supervisorCode.append(division).append(equipCategory).append("-");
//获取行政区划区县、市是否存在历史监管码
CategoryOtherInfo supervisor = categoryOtherInfoMapper.selectSupervisorCode(supervisorCode.toString());
//生成对应监管码
if (!ObjectUtils.isEmpty(supervisor) && supervisor.getSupervisoryCode() != null) {
//获取补零位长度
String supervisoryCode = supervisor.getSupervisoryCode().substring(6);
long num = Long.valueOf(supervisoryCode) + 1;
int numLength = String.valueOf(num).length();
int a = 7 - numLength;
StringBuilder zero = new StringBuilder();
for (int i = 0; i < a; i++) {
zero.append(EquipmentCategoryEnum.BLW.getCode());
}
zero.append(num);
supervisorCode.append(zero);
} else {
supervisorCode.append(EquipmentCategoryEnum.JGM.getCode());
}
return supervisorCode.toString();
}
/**
* 生成96333电梯识别码
*
* @param city 行政区划市
* @param county 行政区划区
* @return 96333电梯识别码
*/
private String createElevatorCode(String city, String county) {
StringBuilder elevatorCode = new StringBuilder();
//生成生成96333电梯码前缀
Map<String, Object> elevatorMap = equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQHDT.getCode(), county);
String elevator = ObjectUtils.isEmpty(elevatorMap) ? equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQHDT.getCode(), city).get("code").toString() : elevatorMap.get("code").toString();
elevatorCode.append(elevator);
String initCode = elevatorCode + EquipmentCategoryEnum.getValue.get(elevatorCode.toString());
CategoryOtherInfo initSupervisoryCode = categoryOtherInfoMapper.queryInitCode(initCode); // 查询是否已经生成过初始值
if (ValidationUtil.isEmpty(initSupervisoryCode)) {
elevatorCode.append(EquipmentCategoryEnum.getValue.get(elevator));
} else {
//获取行政区划区县、市是否存在历史96333电梯码
CategoryOtherInfo elevatorOtherInfo = categoryOtherInfoMapper.selectElevatorCode(elevatorCode.toString(), null);
if (!ObjectUtils.isEmpty(elevatorOtherInfo) && elevatorOtherInfo.getCode() != null) {
//获取补零位长度
String elevatorCode1 = elevatorOtherInfo.getCode().substring(2);
long num = Long.parseLong(elevatorCode1) + 1;
int numLength = String.valueOf(num).length();
int a = 5 - numLength;
StringBuilder zero = new StringBuilder();
for (int i = 0; i < a; i++) {
zero.append(EquipmentCategoryEnum.BLW.getCode());
}
zero.append(num);
elevatorCode.append(zero);
}
}
return elevatorCode.toString();
}
/**
* 获取当前登录人单位类型
*
* @return
*/
public List<JSONObject> getCompanyType() {
ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
List<CompanyModel> companys = reginParams.getUserModel().getCompanys();
List<JSONObject> objectList = new ArrayList<>();
for (CompanyModel company : companys) {
JSONObject object = new JSONObject();
object.put("level", company.getLevel());
object.put("orgCode", company.getOrgCode());
object.put("companyCode", company.getCompanyCode());
objectList.add(object);
}
return objectList;
}
@Override
public Map<String, Map<String, Object>> getFormRecordById(Map<String, Object> map) {
ResponseModel<Map<String, Map<String, Object>>> responseModel = idxFeignService.getFormRecordById(map);
Map<String, Map<String, Object>> result = responseModel.getResult();
if (!ObjectUtils.isEmpty(map.get(COPY_KEY))) {
result.get(SUPERVISION_FROM_ID).remove("CLAIM_STATUS");
result.get(SUPERVISION_FROM_ID).remove("CODE96333");
result.get(SUPERVISION_FROM_ID).remove("SUPERVISORY_CODE");
}
return result;
}
/**
* 分页查询数据
*/
public Page<Map<String, Object>> getPage(Map<String, Object> map) {
String tableName = map.get(TABLENAME).toString();
Object sort = map.get("sort");
Integer number = ValidationUtil.isEmpty(map.get("number")) ? 0 : Integer.valueOf(map.get("number").toString());
Integer size = ValidationUtil.isEmpty(map.get("size")) ? 0 : Integer.valueOf(map.get("size").toString());
Page<Map<String, Object>> page = new Page<>(number, size);
Assert.hasText(tableName, "表名不能为空");
String selectSql = "SELECT * FROM " + tableName;
String countSql = " SELECT COUNT(*) count FROM " + tableName;
StringJoiner andJoiner = new StringJoiner(" AND ");
for (Map.Entry<String, Object> entry : map.entrySet()) {
if (!(entry.getKey().equals("tableName") || entry.getKey().equals("number") || entry.getKey().equals("size") || entry.getKey().equals("sort")) && !ValidationUtil.isEmpty(entry.getValue())) {
if (!ValidationUtil.isEmpty(entry.getValue()) && entry.getValue().toString().contains("[") && entry.getValue().toString().contains("]")) {
String jsonValue = entry.getValue().toString().replace("[", "[\"").replace("]", "\"]").replaceAll(" ", "").replaceAll(",", "\",\"");
StringJoiner orJoiner = new StringJoiner(" or ");
// 兼容数据库存储String和list格式
JSON.parseArray(jsonValue).stream().forEach(x -> {
orJoiner.add(entry.getKey() + " like '%" + x + "%'");
});
andJoiner.add("(" + orJoiner + ")");
} else {
andJoiner.add(entry.getKey() + " like '%" + entry.getValue().toString() + "%'");
}
}
}
if (!ValidationUtil.isEmpty(andJoiner.toString())) {
selectSql = selectSql + " WHERE " + andJoiner;
countSql = countSql + " WHERE " + andJoiner;
}
if (!ValidationUtil.isEmpty(sort)) {
String[] split = sort.toString().split(",");
selectSql = selectSql + " ORDER BY " + split[0] + (split[1].equals("descend") ? " DESC " : " ASC ");
}
int begin = (number - 1) * size;
if (size > 0) {
selectSql += " LIMIT " + begin + "," + size;
}
Long count = bizJdbcTemplate.queryForObject(countSql, Long.class);
String finalSelectSql = selectSql;
System.out.println("列表查询sql为--------->>>>>>>>" + finalSelectSql);
List<Map<String, Object>> mapList = bizJdbcTemplate.queryForList(finalSelectSql);
page.setTotal(count);
page.setRecords(mapList);
return page;
}
/**
* levlel=company,是企业,如果不是都是监管单位,
* * 在接口中查询当前登录人所属单位是监管单位还是企业。
* * 如果为监管单位添加监管机构查询参数(ORG_BRANCH_CODE);
* * 如果为企业添加使用单位查询参数(USE_UNIT_CREDIT_CODE)
*/
private static final String LEVEL = "company";
private static final String EQUSTATE = "EQU_STATE";
private static final String USEPLACE = "USE_PLACE";
public Page<Map<String, Object>> getTable(Map<String, Object> map) {
if (!ValidationUtil.isEmpty(map.get(EQUSTATE))) {
map.put(EQUSTATE, EquimentEnum.getCode.get(map.get(EQUSTATE).toString()).toString());
}
ResponseModel<Page<Map<String, Object>>> model = new ResponseModel<>();
List<JSONObject> objectList = getCompanyType();
List<Map<String, Object>> res = new ArrayList<>();
if (!ObjectUtils.isEmpty(map.get(USEPLACE))) {
String uesPlace = map.get(USEPLACE).toString();
String address = uesPlace.substring(1, uesPlace.length() - 1);
address = address.replace(", ", "/");
map.put(USEPLACE, address);
}
Long total = 0L;
for (JSONObject object : objectList) {
String level = object.getString("level");
String code = object.getString("orgCode");
String companyCode = object.getString("companyCode");
if (!ValidationUtil.isEmpty(level)) {
Page<Map<String, Object>> m = new Page<>();
if (LEVEL.equals(level)) {
//企业
map.put("USE_UNIT_CREDIT_CODE", companyCode);
m = this.getPage(map);
map.remove("USE_UNIT_CREDIT_CODE");
} else {
//监管单位
map.put("ORG_BRANCH_CODE", code);
m = this.getPage(map);
map.remove("ORG_BRANCH_CODE");
}
total += m.getTotal();
if (!ValidationUtil.isEmpty(m) && !ValidationUtil.isEmpty(m.getRecords())) {
res.addAll(m.getRecords());
}
}
}
Page<Map<String, Object>> objectPage = new Page<>();
objectPage.setRecords(res);
objectPage.setTotal(total);
objectPage.setSize(Long.valueOf(map.get("size").toString()));
objectPage.setCurrent(Long.valueOf(map.get("number").toString()));
model.setResult(objectPage);
//设备状态码对应枚举值
List<Map<String, Object>> records = model.getResult().getRecords();
List<Map<String, Object>> result = new ArrayList<>();
for (Map<String, Object> record : records) {
if (!ValidationUtil.isEmpty(record.get(EQUSTATE))) {
Integer integer = Integer.valueOf(record.get(EQUSTATE).toString());
String status = EquimentEnum.getName.get(integer);
record.put(EQUSTATE, status);
}
result.add(record);
}
Page<Map<String, Object>> mapPage = model.getResult().setRecords(result);
return mapPage;
}
public List<Map<String, Object>> scalp(Map<String, Object> map) {
List<Map<String, Object>> list = new ArrayList<>();
if (!ValidationUtil.isEmpty(map.get("orgBranchName"))) {
list = equipmentCategoryMapper.getSrcee(map.get(TABLENAME).toString(),
map.get("orgBranchName").toString(), null, null, null, null);
}
if (!ValidationUtil.isEmpty(map.get("equList"))) {
list = equipmentCategoryMapper.getSrcee(map.get(TABLENAME).toString(),
null, map.get("equList").toString(), null, null, null);
}
if (!ValidationUtil.isEmpty(map.get("equCategory"))) {
list = equipmentCategoryMapper.getSrcee(map.get(TABLENAME).toString(),
null, null, map.get("equCategory").toString(), null, null);
}
if (!ValidationUtil.isEmpty(map.get("usePlace"))) {
list = equipmentCategoryMapper.getSrcee(map.get(TABLENAME).toString(),
null, null, null, map.get("usePlace").toString(), null);
}
if (!ValidationUtil.isEmpty(map.get("equState"))) {
list = equipmentCategoryMapper.getSrcee(map.get(TABLENAME).toString(),
null, null, null, null, map.get("equState").toString());
}
return list;
}
public List<EquipExportVo> getEquipExportData(EquipExportDto dto){
ArrayList<EquipExportVo> list = new ArrayList<>();
List<JSONObject> objectList = getCompanyType();
if (!ValidationUtil.isEmpty(dto.getEQU_STATE())) {
dto.setEQU_STATE(EquimentEnum.getCode.get(dto.getEQU_STATE()).toString());
}
for (JSONObject object : objectList) {
String level = object.getString("level");
String orgCode = object.getString("orgCode");
String companyCode = object.getString("companyCode");
if (!ValidationUtil.isEmpty(level)) {
if (LEVEL.equals(level)) {
//企业
dto.setUSE_UNIT_CREDIT_CODE(companyCode);
} else {
//监管单位
dto.setORG_BRANCH_CODE(orgCode);
}
List<EquipExportVo> equipExportData = equipmentCategoryMapper.getEquipExportData(dto);
if (!ObjectUtils.isEmpty(equipExportData) ) {
list.addAll(equipExportData);
}
}
}
return list;
}
/**
* 设备字典,通过设备父类code,获得子类
*/
public List<EquipmentCategory> getChildren(String code) {
LambdaQueryWrapper<EquipmentCategory> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(EquipmentCategory::getCode, code);
EquipmentCategory equipmentCategory = baseMapper.selectOne(wrapper);
LambdaQueryWrapper<EquipmentCategory> wrapper2 = new LambdaQueryWrapper<>();
wrapper2.eq(EquipmentCategory::getParentId, equipmentCategory.getId());
List<EquipmentCategory> equipmentCategories = baseMapper.selectList(wrapper2);
return equipmentCategories;
}
@Override
public void checkEsData(String id) {
Map<String, Object> map = categoryOtherInfoMapper.selectDataById(id);
UseInfo useInfo = new UseInfo();
useInfo.setIsNotEs(1);
useInfoMapper.update(useInfo, new QueryWrapper<UseInfo>().eq("RECORD", id));
ESEquipmentCategoryDto dto = JSON.parseObject(toJSONString(map), ESEquipmentCategoryDto.class);
Optional<ESEquipmentCategoryDto> data = esEquipmentCategory.findById(id);
if (!ObjectUtils.isEmpty(data)) {
esEquipmentCategory.deleteById(id);
}
if (!ObjectUtils.isEmpty(dto)) {
dto.setREC_DATE(System.currentTimeMillis());
esEquipmentCategory.save(dto);
}
}
@Override
@Async
public void createEquipmentCategoryData() {
if(log.isInfoEnabled()){
log.info("初始化一码通总览数据开始");
}
equipmentCategoryDataService.remove(new QueryWrapper<>());
getCategoryData(null,null);
}
private List<EquipmentCategoryData> getCategoryData(List<String> unitCodes,List<String> orgBranchCodes) {
StopWatch stopWatch = new StopWatch();
stopWatch.start();
List<EquipmentCategoryData> list = new ArrayList<>();
// 查询所有单位
List<Map<String, Object>> allUnitList = equipmentCategoryMapper.getAllUnit(unitCodes,orgBranchCodes);
// 统计查询不同单位、不同装备定义、不同状态下的设备数量
List<UseUnitCreditCodeCategoryDto> equipCountList = equipmentCategoryMapper.useUnitCreditCodeCategoryCount();
// 查询8大类设备定义
List<EquipmentCategory> equipmentCategories = getEquipmentCategories();
// 组织EquipmentCategoryData表数据
for (Map<String, Object> map : allUnitList) {
EquipmentCategoryData equipmentCategoryData = new EquipmentCategoryData();
if(ObjectUtils.isEmpty(map.get("supervise_org_code")) || ObjectUtils.isEmpty(map.get(USE_CODE))){
continue;
}
equipmentCategoryData.setOrgBranchCode(map.get("supervise_org_code").toString());
equipmentCategoryData.setUnitCode(map.get(USE_CODE).toString());
// 指定单位的设备统计信息
List<UseUnitCreditCodeCategoryDto> unitEquipCountList = equipCountList.stream().filter(r->r.getUseUnitCreditCode().equals(map.get(USE_CODE).toString())).collect(Collectors.toList());
unitEquipCountList = unitEquipCountList.stream().filter(r->r.getOrgBranchCode().equals(map.get(ORG_BRANCH_CODE).toString())).collect(Collectors.toList());
for (EquipmentCategory category : equipmentCategories) {
Map<String, Object> data = new HashMap<>();
data.put("waitClaim", unitEquipCountList.stream().filter(r->r.getEquList().equals(category.getCode()) && EquipmentCategoryEnum.DRL.getName().equals(r.getClaimStatus())).collect(Collectors.summarizingLong(UseUnitCreditCodeCategoryDto::getTotal)).getSum());
data.put("alreadyClaim", unitEquipCountList.stream().filter(r->r.getEquList().equals(category.getCode()) && EquipmentCategoryEnum.YRL.getName().equals(r.getClaimStatus())).collect(Collectors.summarizingLong(UseUnitCreditCodeCategoryDto::getTotal)).getSum());
data.put("refuseClaim", unitEquipCountList.stream().filter(r->r.getEquList().equals(category.getCode()) && EquipmentCategoryEnum.YJL.getName().equals(r.getClaimStatus())).collect(Collectors.summarizingLong(UseUnitCreditCodeCategoryDto::getTotal)).getSum());
this.set8CategoryCountData(equipmentCategoryData, category, data);
}
equipmentCategoryData.setRecDate(new Date());
list.add(equipmentCategoryData);
}
if(!ObjectUtils.isEmpty(unitCodes)){
equipmentCategoryDataMapper.delete(new QueryWrapper<EquipmentCategoryData>().in("unit_code",unitCodes));
}
equipmentCategoryDataService.saveOrUpdateBatch(list);
stopWatch.stop();
if(log.isInfoEnabled()){
log.info("总览数据刷新结束,耗时:{} 秒",stopWatch.getTotalTimeSeconds());
}
return list;
}
private void set8CategoryCountData(EquipmentCategoryData equipmentCategoryData, EquipmentCategory category, Map<String, Object> data) {
switch (category.getCode()) {
case "1000":
equipmentCategoryData.setBoiler(toJSONString(data));
break;
case "2000":
equipmentCategoryData.setVessel(toJSONString(data));
break;
case "3000":
equipmentCategoryData.setElevator(toJSONString(data));
break;
case "4000":
equipmentCategoryData.setLifting(toJSONString(data));
break;
case "5000":
equipmentCategoryData.setVehicle(toJSONString(data));
break;
case "6000":
equipmentCategoryData.setRides(toJSONString(data));
break;
case "8000":
equipmentCategoryData.setPipeline(toJSONString(data));
break;
case "9000":
equipmentCategoryData.setRopeway(toJSONString(data));
break;
default:
log.error("不支持的分类:{}", toJSONString(category));
break;
}
}
private List<EquipmentCategory> getEquipmentCategories() {
LambdaQueryWrapper<EquipmentCategory> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.likeLeft(EquipmentCategory::getCode,"000");
lambdaQueryWrapper.ne(EquipmentCategory::getCode,"7000");
lambdaQueryWrapper.ne(EquipmentCategory::getCode,"F000");
return equipmentCategoryMapper.selectList(lambdaQueryWrapper);
}
private List<EquipmentCategoryData> updateEquipmentCategoryData(String unitCode,String orgBranchCode) {
List<String> unitCodeList = new ArrayList<>();
unitCodeList.add(unitCode);
List<String> orgBranchCodeList = new ArrayList<>();
orgBranchCodeList.add(orgBranchCode);
List<EquipmentCategoryData> equipmentCategoryData = getCategoryData(unitCodeList,null);
return equipmentCategoryData;
}
@Override
@Transactional(rollbackFor = Exception.class)
public List<String> deleteBatch(Map<String, Object> map) {
Object recordList = map.get("recordList");
List<String> records = new ArrayList<>();
List<ESEquipmentCategoryDto> list = new ArrayList<>();
if(recordList.toString().contains("[")){
for (String record : (List<String>) recordList) {
records.add(record);
ESEquipmentCategoryDto esEquipmentCategoryDto = new ESEquipmentCategoryDto();
esEquipmentCategoryDto.setSEQUENCE_NBR(record);
list.add(esEquipmentCategoryDto);
}
} else {
records.add(recordList.toString());
ESEquipmentCategoryDto esEquipmentCategoryDto = new ESEquipmentCategoryDto();
esEquipmentCategoryDto.setSEQUENCE_NBR(recordList.toString());
list.add(esEquipmentCategoryDto);
}
//删除监管码表数据
List<String> superviseCodeList = superviseInfoMapper.selectSuperviseCodeList(records);
List<Map<String, Object>> unitCodeAndOrgBranchCodeList = superviseInfoMapper.selectUnitCodeList(records);
List<String> unitCodeList = new ArrayList<>();
List<String> orgBranchCodeList = new ArrayList<>();
for (Map<String, Object> objectMap : unitCodeAndOrgBranchCodeList) {
unitCodeList.add(String.valueOf(objectMap.get("unitCode")));
orgBranchCodeList.add(String.valueOf(objectMap.get("orgBranchCode")));
}
if(!ObjectUtils.isEmpty(superviseCodeList)){
supervisoryCodeInfoMapper.updateStatus(superviseCodeList);
}
//删除涉及的19张表的数据
superviseInfoMapper.deleteDataAll(records);
// 根据统一信用代码更新总览表
if(!ObjectUtils.isEmpty(unitCodeList)){
getCategoryData(unitCodeList,orgBranchCodeList);
}
//删除es中的数据
esEquipmentCategory.deleteAll(list);
return records;
}
@Override
@Transactional(rollbackFor = Exception.class)
public ResponseModel submit(Map<String, Object> map) {
StopWatch stopWatch = new StopWatch();
stopWatch.start();
SupervisoryCodeInfo supervisoryCodeInfo = new SupervisoryCodeInfo();
ResponseModel responseModel = new ResponseModel();
LinkedHashMap useInfoFrom = (LinkedHashMap) map.get(USE_INFO_FROM_ID);
Calendar calendar = Calendar.getInstance();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
useInfoFrom.put("REC_DATE", dateFormat.format(calendar.getTime()));
String unitCode = String.valueOf(useInfoFrom.get("USE_UNIT_CREDIT_CODE"));
LinkedHashMap supervisionMap = (LinkedHashMap) map.get(SUPERVISION_FROM_ID);
String orgBranchCode = String.valueOf(supervisionMap.get("ORG_BRANCH_CODE"));
try {
LinkedHashMap superviseMap = (LinkedHashMap) map.get("data");
String claimStatus = String.valueOf(superviseMap.get("claimStatus"));
String code96333 = String.valueOf(superviseMap.get("code96333"));
String operateType = String.valueOf(superviseMap.get("operateType"));
//生成码
Map<String, String> codeMap;
if (EquipmentCategoryEnum.YRL.getName().equals(claimStatus)) {
log.info("准备生成监管码或96333电梯识别码");
String city = String.valueOf(superviseMap.get("city"));
String county = String.valueOf(superviseMap.get("county"));
String equCategory = String.valueOf(superviseMap.get("equCategory"));
String supervisionCode = String.valueOf(superviseMap.get("supervisionCode"));
//生成码
codeMap = creatCode(city, county, equCategory, code96333, supervisionCode);
log.info("已生成对应监管码或96333电梯识别码");
//删除map中的冗余数据,添加对应监管码和96333码调用idx多表单页提交接口吧保存数据
map.remove("data");
supervisionMap.put("CODE96333", codeMap.get("code96333"));
supervisionMap.put("SUPERVISORY_CODE", codeMap.get("superviseCode"));
map.put(SUPERVISION_FROM_ID, supervisionMap);
//根据操作状态判断是调用新增还是修改接口
responseModel = "save".equals(operateType) ? idxFeignService.batchSubmit(null, null, null, null, map) :
idxFeignService.batchUpdate(null, null, map);
if (!ObjectUtils.isEmpty(responseModel) && "200".equals(String.valueOf(responseModel.getStatus()))) {
supervisoryCodeInfo.setStatus(EquipmentCategoryEnum.YSY.getCode());
} else {
supervisoryCodeInfo.setStatus(EquipmentCategoryEnum.BF.getCode());
}
} else if (EquipmentCategoryEnum.DRL.getName().equals(claimStatus)) {
map.remove("data");
supervisionMap.put("CODE96333", "null".equals(code96333) ? null : code96333);
map.put(SUPERVISION_FROM_ID, supervisionMap);
//根据操作状态判断是调用新增还是修改接口
responseModel = "save".equals(operateType) ? idxFeignService.batchSubmit(null, null, null, null, map) :
idxFeignService.batchUpdate(null, null, map);
} else {
map.remove("data");
responseModel = idxFeignService.batchUpdate(null, null, map);
}
stopWatch.stop();
if(log.isInfoEnabled()){
log.info("通用提交耗时:{} 秒",stopWatch.getTotalTimeSeconds());
}
} catch (Exception e) {
log.error(e.getMessage(),e);
supervisoryCodeInfo.setStatus(EquipmentCategoryEnum.BF.getCode());
ResponseModel<Object> response = new ResponseModel<>();
response.setDevMessage(e.getMessage());
response.setResult(null);
response.setMessage("操作失败,请检查数据输入后重新提交");
response.setStatus(HttpStatus.BAD_REQUEST.value());
return response;
} finally {
updateEquipmentCategoryData(unitCode,orgBranchCode);
supervisoryCodeInfoMapper.update(supervisoryCodeInfo,new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code",supervisoryCodeInfo.getSupervisoryCode()));
}
return responseModel;
}
//分页查询所有数据
public Page<Map<String, Object>> getAll(Map<String, Object> map) {
String tableName = map.get(TABLENAME).toString();
Assert.hasText(tableName, "表名不能为空");
String selectSql = " SELECT * FROM " + tableName + " WHERE IS_NOT_ES <> 1 or IS_NOT_ES IS NULL ";
Integer number = ValidationUtil.isEmpty(map.get("number")) ? 0 : Integer.valueOf(map.get("number").toString());
Integer size = ValidationUtil.isEmpty(map.get("size")) ? 0 : Integer.valueOf(map.get("size").toString());
Page<Map<String, Object>> page = new Page<>(number, size);
int begin = (number - 1) * size;
if (size > 0) {
selectSql = selectSql + " LIMIT " + begin + "," + size;
}
List<Map<String, Object>> mapList = bizJdbcTemplate.queryForList(selectSql);
page.setRecords(mapList);
page.setTotal(mapList.size());
return page;
}
//查询总条数
public Long counts(Map<String, Object> map) {
String tableName = map.get(TABLENAME).toString();
Assert.hasText(tableName, "表名不能为空");
String countSql = " SELECT COUNT(SEQUENCE_NBR) count FROM " + tableName + " WHERE IS_NOT_ES <> 1 or IS_NOT_ES IS NULL";
Long count = bizJdbcTemplate.queryForObject(countSql, Long.class);
return count;
}
/**
* es数据同步
*
* @return
*/
public void saveEs() {
long start = System.currentTimeMillis();
Map<String, Object> map = new HashMap<>();
map.put(TABLENAME, "idx_biz_view_jg_all");
Long counts = counts(map);
Long times = counts / 1000;
Long yushu = counts % 1000;
if (yushu > 0) {
times++;
}
long total = 0;
for (int i = 1; i <= times; i++) {
map.put("number", 1);
map.put("size", 1000);
Page<Map<String, Object>> page = getAll(map);
total = total + page.getTotal();
saveBatchEquipment2Es(page.getRecords());
// for (Map<String, Object> record : page.getRecords()) {
// if (ValidationUtil.isEmpty(record.get("IS_NOT_ES"))) {
// saveESEquipmentCategory(record);
// }
// }
}
long end = System.currentTimeMillis();
log.info("本次一码通同步设备数据:【" + total + "】条,耗时:" + (end - start) + " 毫秒");
}
public void saveBatchEquipment2Es(List<Map<String, Object>> equipList) {
List<ESEquipmentCategoryDto> esEquipDtoList = Lists.newArrayList();
List<String> recordList = Lists.newArrayList();
if (ValidationUtil.isEmpty(equipList)) {
return;
}
for (Map<String, Object> e : equipList) {
String recDate1 = "";
if (ValidationUtil.isEmpty(e.get("REC_DATE"))) {
try {
recDate1 = DateUtil.formatDate(new Date(), "yyyy-MM-dd hh:mm:ss");
} catch (Exception ex) {
ex.printStackTrace();
}
} else {
recDate1 = e.get("REC_DATE").toString().substring(0, 19);
}
long time = Timestamp.valueOf(recDate1).getTime();
e.put("REC_DATE", time);
ESEquipmentCategoryDto esEquipDto = JSONObject.parseObject(toJSONString(e),
ESEquipmentCategoryDto.class);
esEquipDtoList.add(esEquipDto);
recordList.add((String) e.get("SEQUENCE_NBR"));
}
long start = System.currentTimeMillis();
esEquipmentCategory.saveAll(esEquipDtoList);
long end = System.currentTimeMillis();
long cost = end - start;
System.out.println("批量存入es1000条数据耗时:" + cost);
long start1 = System.currentTimeMillis();
superviseInfoMapper.updateRecordBatch(recordList);
long end1 = System.currentTimeMillis();
long cost1 = end1 - start1;
System.out.println("批量更新1000条业务数据耗时:" + cost1);
}
/**
* es保存设备数据
*/
public ESEquipmentCategoryDto saveESEquipmentCategory(Map<String, Object> map) {
//处理时间问题
String recDate1 = map.get("REC_DATE").toString().substring(0,19);
long time = Timestamp.valueOf(recDate1).getTime();
map.put("REC_DATE",time);
ESEquipmentCategoryDto dto = JSONObject.parseObject(toJSONString(map), ESEquipmentCategoryDto.class);
ESEquipmentCategoryDto save = esEquipmentCategory.save(dto);
if (!ObjectUtils.isEmpty(save)) {
//同步到es后修改
UseInfo useInfo = new UseInfo();
useInfo.setIsNotEs(1);
useInfoMapper.update(useInfo, new QueryWrapper<UseInfo>().eq("RECORD",
map.get("SEQUENCE_NBR").toString()));
}
return save;
}
public Page<JSONObject> queryByKeys(JSONObject map) {
// //根据当前登录人查询
if (!ValidationUtil.isEmpty(map.get(EQUSTATE))) {
map.put(EQUSTATE, EquimentEnum.getCode.get(map.get(EQUSTATE).toString()).toString());
}
JSONObject object = getCompanyType().get(0);
String level = object.getString("level");
String code = object.getString("orgCode");
String companyCode = object.getString("companyCode");
if (!ValidationUtil.isEmpty(level)) {
if (LEVEL.equals(level)) {
//企业
map.put("USE_UNIT_CREDIT_CODE", companyCode);
} else {
//监管单位
map.put("ORG_BRANCH_CODE", code);
}
}
Page<JSONObject> result = new Page<>(map.getInteger("number"), map.getInteger("size"));
SearchRequest request = new SearchRequest();
request.indices("idx_biz_view_jg_all");
SearchSourceBuilder builder = new SearchSourceBuilder();
builder.trackTotalHits(true);
BoolQueryBuilder boolMust = QueryBuilders.boolQuery();
//通用匹配规则,条件构建
//SEQUENCE_NBR
if (!ObjectUtils.isEmpty(map.getString("SEQUENCE_NBR"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.matchPhraseQuery("SEQUENCE_NBR", "*"+map.getString("SEQUENCE_NBR")+"*"));
boolMust.must(meBuilder);
}
if (!ObjectUtils.isEmpty(map.getString("ORG_BRANCH_NAME"))) {
BoolQueryBuilder query = QueryBuilders.boolQuery();
query.must(QueryBuilders.matchPhraseQuery("ORG_BRANCH_NAME", "*"+map.getString("ORG_BRANCH_NAME")+"*" ));
boolMust.must(query);
}
if (!ObjectUtils.isEmpty(map.getString("ORG_BRANCH_CODE"))) {
BoolQueryBuilder query = QueryBuilders.boolQuery();
query.must(QueryBuilders.matchPhraseQuery("ORG_BRANCH_CODE", "*" + map.getString("ORG_BRANCH_CODE") + "*"));
boolMust.must(query);
}
if (!ObjectUtils.isEmpty(map.getString("USE_UNIT_NAME"))) {
BoolQueryBuilder query = QueryBuilders.boolQuery();
query.must(QueryBuilders.matchPhraseQuery("USE_UNIT_NAME", "*"+map.getString("USE_UNIT_NAME")+"*"));
boolMust.must(query);
}
if (!ObjectUtils.isEmpty(map.getString("USE_UNIT_CREDIT_CODE"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.matchPhraseQuery("USE_UNIT_CREDIT_CODE", "*"+map.getString("USE_UNIT_CREDIT_CODE")+"*"));
boolMust.must(meBuilder);
}
if (!ObjectUtils.isEmpty(map.getString("EQU_LIST_CODE"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.matchPhraseQuery("EQU_LIST_CODE", "*" + map.getString("EQU_LIST_CODE") + "*"));
boolMust.must(meBuilder);
}
if (!ObjectUtils.isEmpty(map.getString("EQU_LIST"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.matchPhraseQuery("EQU_LIST", "*"+map.getString("EQU_LIST")+"*"));
boolMust.must(meBuilder);
}
if (!ObjectUtils.isEmpty(map.getString("EQU_CATEGORY"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.matchPhraseQuery("EQU_CATEGORY", "*"+map.getString("EQU_CATEGORY")+"*"));
boolMust.must(meBuilder);
}
if (!ObjectUtils.isEmpty(map.getString("USE_ORG_CODE"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.wildcardQuery("USE_ORG_CODE", "*"+map.getString("USE_ORG_CODE").toLowerCase()+"*"));
boolMust.must(meBuilder);
}
if (!ObjectUtils.isEmpty(map.getString("CODE96333"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.wildcardQuery("CODE96333", "*"+map.getString("CODE96333").toLowerCase()+"*"));
boolMust.must(meBuilder);
}
if (!ObjectUtils.isEmpty(map.getString("EQU_CODE"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.wildcardQuery("EQU_CODE", "*" + map.getString("EQU_CODE") + "*"));
boolMust.must(meBuilder);
}
if (!ObjectUtils.isEmpty(map.getString("SUPERVISORY_CODE"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.wildcardQuery("SUPERVISORY_CODE", "*"+map.getString("SUPERVISORY_CODE").toLowerCase()+"*"));
boolMust.must(meBuilder);
}
if (!ObjectUtils.isEmpty(map.getString("USE_PLACE"))) {
BoolQueryBuilder query = QueryBuilders.boolQuery();
query.must(QueryBuilders.matchPhraseQuery("USE_PLACE", "*" + map.getString("USE_PLACE") + "*"));
boolMust.must(query);
}
if (!ObjectUtils.isEmpty(map.getString("ADDRESS"))) {
BoolQueryBuilder query = QueryBuilders.boolQuery();
query.must(QueryBuilders.matchPhraseQuery("ADDRESS", "*" + map.getString("ADDRESS") + "*"));
boolMust.must(query);
}
if (!ObjectUtils.isEmpty(map.getString("EQU_STATE")) ) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.matchQuery("EQU_STATE", map.getLong("EQU_STATE")));
boolMust.must(meBuilder);
}
if (!ObjectUtils.isEmpty(map.getString("STATUS"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.matchPhraseQuery("STATUS", "*"+map.getString("STATUS")+"*"));
boolMust.must(meBuilder);
}
builder.query(boolMust);
builder.sort("REC_DATE", SortOrder.DESC);
builder.from((map.getInteger("number") - 1) * map.getInteger("size"));
builder.size(map.getInteger("size"));
request.source(builder);
List<JSONObject> list = new LinkedList<>();
long totle = 0;
try {
SearchResponse response = restHighLevelClient.search(request, RequestOptions.DEFAULT);
for (org.elasticsearch.search.SearchHit hit : response.getHits().getHits()) {
System.out.println(hit);
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(hit);
JSONObject dto2 = jsonObject.getJSONObject("sourceAsMap");
if (!ValidationUtil.isEmpty(dto2.get(EQUSTATE))) {
Integer integer = Integer.valueOf(dto2.get(EQUSTATE).toString());
String status = EquimentEnum.getName.get(integer);
dto2.put(EQUSTATE, status);
}
list.add(dto2);
}
totle = response.getInternalResponse().hits().getTotalHits().value;
result.setRecords(list);
result.setTotal(totle);
} catch (IOException e) {
throw new RuntimeException(e);
}
return result;
}
//es统计总记录数
public Long getCount(String indexs, RestHighLevelClient esClient) {
Long totle = 0L;
SearchRequest searchRequest = new SearchRequest(indexs);
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
searchSourceBuilder.query(QueryBuilders.matchAllQuery());
searchSourceBuilder.trackTotalHits(true);
searchRequest.source(searchSourceBuilder);
try {
SearchResponse searchResponse = esClient.search(searchRequest, RequestOptions.DEFAULT);
totle = searchResponse.getInternalResponse().hits().getTotalHits().value;
} catch (IOException e) {
throw new RuntimeException(e);
}
return totle;
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.app.biz.service.impl;
import com.yeejoin.amos.boot.module.app.api.dto.InspectionDetectionInfoModel;
import com.yeejoin.amos.boot.module.app.api.entity.InspectionDetectionInfo;
import com.yeejoin.amos.boot.module.app.api.mapper.InspectionDetectionInfoMapper;
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 org.typroject.tyboot.core.rdbms.service.BaseService;
/**
* 安全追溯-检验检测信息表
*
* @author cpp
* @date 2023-04-06 19:18:21
*/
@Service
public class InspectionDetectionInfoServiceImpl extends BaseService<InspectionDetectionInfoModel, InspectionDetectionInfo, InspectionDetectionInfoMapper> {
@Autowired
private InspectionDetectionInfoMapper inspectionDetectionInfo;
public InspectionDetectionInfoModel selectInspect(String superviseCode) {
InspectionDetectionInfoModel inspectionDetectionInfoDto = new InspectionDetectionInfoModel();
if (ValidationUtil.isEmpty(superviseCode)) {
return inspectionDetectionInfoDto;
}
InspectionDetectionInfo inspectionDetectionInfo = this.inspectionDetectionInfo.selectInspection(superviseCode);
BeanUtils.copyProperties(inspectionDetectionInfo,inspectionDetectionInfoDto);
inspectionDetectionInfoDto.setSuperviseCode(superviseCode);
return inspectionDetectionInfoDto;
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.app.biz.service.impl;
import com.yeejoin.amos.boot.module.app.api.dto.MainPartsModel;
import com.yeejoin.amos.boot.module.app.api.entity.MainParts;
import com.yeejoin.amos.boot.module.app.api.mapper.MidEquipMainPartsMapper;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
/**
* 服务实现类
*
* @author duanwei
* @date 2023-04-10
*/
@Service
public class MainPartsServiceImpl extends BaseService<MainPartsModel, MainParts, MidEquipMainPartsMapper> {
}
package com.yeejoin.amos.boot.module.app.biz.service.impl;
import com.yeejoin.amos.boot.module.app.api.dto.MaintenanceInfoModel;
import com.yeejoin.amos.boot.module.app.api.entity.MaintenanceInfo;
import com.yeejoin.amos.boot.module.app.api.mapper.MaintenanceInfoMapper;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
/**
* 特种设备基本信息-维保备案信息 服务类
*
* @author duanwei
* @date 2022-07-19
*/
@Service
public class MaintenanceInfoService extends BaseService<MaintenanceInfoModel, MaintenanceInfo, MaintenanceInfoMapper> {
}
package com.yeejoin.amos.boot.module.app.biz.service.impl;
import com.yeejoin.amos.boot.module.app.api.dto.OtherInfoModel;
import com.yeejoin.amos.boot.module.app.api.entity.OtherInfo;
import com.yeejoin.amos.boot.module.app.api.mapper.OtherInfoMapper;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.core.rdbms.service.BaseService;
/**
* 特种设备基本信息-其他信息 服务类
*
* @author duanwei
* @date 2022-07-19
*/
@Component
public class OtherInfoService extends BaseService<OtherInfoModel, OtherInfo, OtherInfoMapper> {
}
package com.yeejoin.amos.boot.module.app.biz.service.impl;
import com.yeejoin.amos.boot.module.app.api.dto.ProduceInfoModel;
import com.yeejoin.amos.boot.module.app.api.entity.ProduceInfo;
import com.yeejoin.amos.boot.module.app.api.mapper.ProduceInfoMapper;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.core.rdbms.service.BaseService;
/**
* 特种设备基本信息-制造信息 服务类
*
* @author duanwei
* @date 2022-07-19
*/
@Component
public class ProduceInfoService extends BaseService<ProduceInfoModel, ProduceInfo, ProduceInfoMapper> {
}
package com.yeejoin.amos.boot.module.app.biz.service.impl;
import com.yeejoin.amos.boot.module.app.api.dto.ProtectionDevicesModel;
import com.yeejoin.amos.boot.module.app.api.entity.ProtectionDevices;
import com.yeejoin.amos.boot.module.app.api.mapper.MidEquipProtectionDevicesMapper;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
/**
* 服务实现类
*
* @author duanwei
* @date 2023-04-10
*/
@Service
public class ProtectionDevicesServiceImpl extends BaseService<ProtectionDevicesModel, ProtectionDevices, MidEquipProtectionDevicesMapper> {
}
package com.yeejoin.amos.boot.module.app.biz.service.impl;
import com.yeejoin.amos.boot.module.app.api.dto.RegistrationInfoModel;
import com.yeejoin.amos.boot.module.app.api.entity.RegistrationInfo;
import com.yeejoin.amos.boot.module.app.api.mapper.RegistrationInfoMapper;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.core.rdbms.service.BaseService;
/**
* 特种设备基本信息-注册登记信息 服务类
*
* @author duanwei
* @date 2022-07-19
*/
@Component
public class RegistrationInfoService extends BaseService<RegistrationInfoModel, RegistrationInfo, RegistrationInfoMapper> {
}
package com.yeejoin.amos.boot.module.app.biz.service.impl;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.amos.boot.module.app.api.dto.SpeUseUnitDto;
import com.yeejoin.amos.boot.module.app.api.entity.SpeUseUnit;
import com.yeejoin.amos.boot.module.app.api.mapper.SpeUseUnitMapper;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
/**
* 使用单位 服务实现类
*
* @author duanwei
* @date 2022-09-08
*/
@Service
public class SpeUseUnitServiceImpl extends BaseService<SpeUseUnitDto, SpeUseUnit, SpeUseUnitMapper> implements IService<SpeUseUnit> {
}
package com.yeejoin.amos.boot.module.app.biz.service.impl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import com.yeejoin.amos.boot.module.app.biz.utils.RedisUtil;
import com.yeejoin.amos.component.robot.AmosRequestContext;
@Service
public class StartPlatformTokenService {
@Value("${admin.product}")
String product;
@Value("${admin.appkey}")
String appkey;
@Value("${admin.user}")
String user;
@Value("${admin.password}")
String password;
@Value("${amos.secret.key}")
String secretKey;
@Autowired
RedisUtil redisUtil;
@Autowired
AmosRequestContext amosRequestContext;
public void getToken() {
RequestContext.setProduct(product);
RequestContext.setAppKey(appkey);
String token = amosRequestContext.getToken();
System.out.println("token:" + token);
RequestContext.setToken(token);
redisUtil.set("platform_token", token);
}
}
package com.yeejoin.amos.boot.module.app.biz.service.impl;
import com.yeejoin.amos.boot.module.app.api.dto.SuperviseInfoModel;
import com.yeejoin.amos.boot.module.app.api.mapper.SuperviseInfoMapper;
import com.yeejoin.amos.boot.module.app.api.entity.SuperviseInfo;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.core.rdbms.service.BaseService;
/**
* 特种设备基本信息-监督管理信息 服务类
*
* @author duanwei
* @date 2022-07-19
*/
@Component
public class SuperviseInfoService extends BaseService<SuperviseInfoModel, SuperviseInfo, SuperviseInfoMapper> {
}
package com.yeejoin.amos.boot.module.app.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.app.flc.biz.service.impl.RegUnitIcServiceImpl;
import com.yeejoin.amos.boot.module.app.flc.biz.service.impl.RegUnitInfoServiceImpl;
import com.yeejoin.amos.boot.module.app.api.dto.BaseUnitLicenceDto;
import com.yeejoin.amos.boot.module.app.api.dto.EquEnterDto;
import com.yeejoin.amos.boot.module.app.api.dto.TzBaseEnterpriseInfoDto;
import com.yeejoin.amos.boot.module.app.api.entity.BaseUnitLicence;
import com.yeejoin.amos.boot.module.app.api.entity.PageParam;
import com.yeejoin.amos.boot.module.app.api.entity.SpeUseUnit;
import com.yeejoin.amos.boot.module.app.api.entity.TzBaseEnterpriseInfo;
import com.yeejoin.amos.boot.module.app.api.mapper.TzBaseEnterpriseInfoMapper;
import com.yeejoin.amos.boot.module.app.api.service.IBaseUnitLicenceService;
import com.yeejoin.amos.boot.module.app.api.service.ITzBaseEnterpriseInfoService;
import com.yeejoin.amos.boot.module.app.biz.utils.RedisUtil;
import com.yeejoin.amos.boot.module.app.flc.api.dto.RegUnitIcDto;
import com.yeejoin.amos.boot.module.app.flc.api.dto.RegUnitInfoDto;
import com.yeejoin.amos.boot.module.app.flc.api.entity.RegUnitIc;
import com.yeejoin.amos.boot.module.app.flc.api.entity.RegUnitInfo;
import com.yeejoin.amos.boot.module.app.flc.api.feign.AccessFeignService;
import com.yeejoin.amos.boot.module.app.flc.api.mapper.RegUnitInfoMapper;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.IdPasswordAuthModel;
import com.yeejoin.amos.feign.privilege.util.DesUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.text.ParseException;
import java.util.*;
import java.util.stream.Collectors;
/**
* 企业数据信息 服务实现类
*
* @author duanwei
* @date 2022-08-10
*/
@Service
public class TzBaseEnterpriseInfoServiceImpl
extends BaseService<TzBaseEnterpriseInfoDto, TzBaseEnterpriseInfo, TzBaseEnterpriseInfoMapper>
implements ITzBaseEnterpriseInfoService {
@Autowired
RedisUtil redisUtil;
@Value("${admin.product}")
String product;
@Value("${admin.product.web}")
String webProduct;
@Value("${admin.appkey}")
String appkey;
@Autowired
private TzBaseEnterpriseInfoMapper tzBaseEnterpriseInfoMapper;
@Autowired
BaseUnitLicenceServiceImpl baseUnitLicenceService;
@Autowired
RegUnitIcServiceImpl regUnitIcService;
@Autowired
RegUnitInfoServiceImpl regUnitInfoService;
@Autowired
private IBaseUnitLicenceService iBaseUnitLicenceService;
@Autowired
private SpeUseUnitServiceImpl speUseUnitService;
@Autowired
private AccessFeignService accessFeignService;
@Autowired
private ITzBaseEnterpriseInfoService tzBaseEnterpriseInfoService;
@Autowired
DataDictionaryServiceImpl iDataDictionaryService;
@Autowired
RegUnitInfoMapper regUnitInfoMapper;
@Value("${tzs.admin.name:tzs_admin}")
private String tzsAdminName;
@Value("${tzs.admin.pwd:a1234567}")
private String tzsAdminPwd;
@Value("${redis.cache.failure.time}")
private Long redisRegionTimeSecond;
/**机器人用户token缓存key */
public static final String TZS_USER_TOKEN = "TZS_USER_TOKEN";
/**
* 企业管理员变更缓存key前缀
*/
private final String adminChange = "ADMIN_CHANGE_";
@Autowired
private EquipmentCategoryServiceImpl equipmentCategoryService;
@Override
public List<EquEnterDto> getInfo(String sequenceNbr) {
return tzBaseEnterpriseInfoMapper.getInfo(sequenceNbr);
}
@Override
public IPage<TzBaseEnterpriseInfoDto> page(PageParam pageParam, TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto) {
List<String> orgCodeList = new ArrayList<>();
if (tzBaseEnterpriseInfoDto.getSuperviseKey() != null) {
FeignClientResult<CompanyModel> result = Privilege.companyClient
.seleteOne(Long.valueOf(tzBaseEnterpriseInfoDto.getSuperviseKey()));
if (result.getResult() != null) {
tzBaseEnterpriseInfoDto.setSuperviseOrgCode(result.getResult().getOrgCode());
}
}
Page<TzBaseEnterpriseInfoDto> page = new Page<>(pageParam.getCurrent(), pageParam.getSize());
List<JSONObject> companyType1 = equipmentCategoryService.getCompanyType();
if (!ValidationUtil.isEmpty(companyType1)) {
for (JSONObject jsonObject : companyType1) {
String orgCode = jsonObject.getString("orgCode");
if (!ValidationUtil.isEmpty(orgCode)) {
orgCodeList.add(orgCode);
}
}
}
return this.baseMapper.pageList(page, tzBaseEnterpriseInfoDto,orgCodeList);
}
@Override
public TzBaseEnterpriseInfoDto detail(Long id) {
TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto = new TzBaseEnterpriseInfoDto();
TzBaseEnterpriseInfo tzBaseEnterpriseInfo = this.getById(id);
if (tzBaseEnterpriseInfo != null) {
BeanUtils.copyProperties(tzBaseEnterpriseInfo, tzBaseEnterpriseInfoDto);
tzBaseEnterpriseInfoDto.setSafetyTwoPhoto(ObjectUtils.isEmpty(tzBaseEnterpriseInfo.getSafetyTwoPhoto()) ? new ArrayList() : JSON.parseArray(tzBaseEnterpriseInfo.getSafetyTwoPhoto()));
tzBaseEnterpriseInfoDto.setSafetyOnePhoto(ObjectUtils.isEmpty(tzBaseEnterpriseInfo.getSafetyOnePhoto()) ? new ArrayList() : JSON.parseArray(tzBaseEnterpriseInfo.getSafetyOnePhoto()));
tzBaseEnterpriseInfoDto.setUnitBusinessLicense(ObjectUtils.isEmpty(tzBaseEnterpriseInfo.getUnitBusinessLicense()) ? new ArrayList() : JSON.parseArray(tzBaseEnterpriseInfo.getUnitBusinessLicense()));
tzBaseEnterpriseInfoDto.setUnitExequatur(ObjectUtils.isEmpty(tzBaseEnterpriseInfo.getUnitExequatur()) ? new ArrayList() : JSON.parseArray(tzBaseEnterpriseInfo.getUnitExequatur()));
tzBaseEnterpriseInfoDto.setEquipCategory(ObjectUtils.isEmpty(tzBaseEnterpriseInfo.getEquipCategory()) ? new ArrayList() : JSON.parseArray(tzBaseEnterpriseInfo.getEquipCategory()));
}
// 许可信息
List<BaseUnitLicence> unitLicences = baseUnitLicenceService.list(new LambdaQueryWrapper<BaseUnitLicence>()
.eq(BaseUnitLicence::getUnitCode, tzBaseEnterpriseInfo.getUseCode()));
List<BaseUnitLicenceDto> unitLicenceDtos = new ArrayList<BaseUnitLicenceDto>();
if (!ValidationUtil.isEmpty(unitLicences)) {
for (BaseUnitLicence baseUnitLicence : unitLicences) {
BaseUnitLicenceDto baseUnitLicenceDto = new BaseUnitLicenceDto();
BeanUtils.copyProperties(baseUnitLicence, baseUnitLicenceDto);
unitLicenceDtos.add(baseUnitLicenceDto);
}
}
tzBaseEnterpriseInfoDto.setUnitLicences(unitLicenceDtos);
// 管理员信息
RegUnitInfo regUnitInfo = regUnitInfoService.getOne(
new LambdaQueryWrapper<RegUnitInfo>().eq(RegUnitInfo::getUnitCode, tzBaseEnterpriseInfo.getUseCode()));
RegUnitInfoDto regUnitInfoDto = new RegUnitInfoDto();
if (regUnitInfo != null) {
BeanUtils.copyProperties(regUnitInfo, regUnitInfoDto);
}
regUnitInfoDto.setAdminIdCardPhoto((ValidationUtil.isEmpty(regUnitInfo)||ValidationUtil.isEmpty(regUnitInfo.getAdminIdCardPhoto())) ? new ArrayList() : JSON.parseArray(regUnitInfo.getAdminIdCardPhoto()));
tzBaseEnterpriseInfoDto.setRegUnitInfoDto(regUnitInfoDto);
// 工商信息
RegUnitIc regUnitIc = regUnitIcService.getOne(
new LambdaQueryWrapper<RegUnitIc>().eq(RegUnitIc::getUnitCode, tzBaseEnterpriseInfo.getUseCode()));
RegUnitIcDto regUnitIcDto = new RegUnitIcDto();
if (regUnitIc != null) {
BeanUtils.copyProperties(regUnitIc, regUnitIcDto);
}
tzBaseEnterpriseInfoDto.setRegUnitIcDto(regUnitIcDto);
return tzBaseEnterpriseInfoDto;
}
@Override
public TzBaseEnterpriseInfoDto getInfoByUseCode(String useCode) {
TzBaseEnterpriseInfo tzBaseEnterpriseInfo = tzBaseEnterpriseInfoMapper.selectOne(new QueryWrapper<TzBaseEnterpriseInfo>().eq("use_code", useCode));
return ObjectUtils.isEmpty(tzBaseEnterpriseInfo) ? null : getDetail(tzBaseEnterpriseInfo);
}
private TzBaseEnterpriseInfoDto getDetail(TzBaseEnterpriseInfo tzBaseEnterpriseInfo){
TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto = detail(tzBaseEnterpriseInfo.getSequenceNbr());
RegUnitIcDto regUnitIcDto = new RegUnitIcDto();
Map<String, Object> resultMap = accessFeignService.getData(tzBaseEnterpriseInfoDto.getUseCode()).getResult();
if (!ValidationUtil.isEmpty(resultMap)) {
String area = String.valueOf(resultMap.get("area"));
String city = area.substring(0, area.indexOf("市") + 1);
String district = area.substring(city.length());
if (district.equals("高新区")) {
district = "雁塔区";
}
String industryName = "";
DataDictionary dataDictionary = iDataDictionaryService.getByCode(String.valueOf(resultMap.get("industryCode")), "HYXLDM");
if (!ValidationUtil.isEmpty(dataDictionary)) {
industryName = dataDictionary.getName();
}
String approveDate = String.valueOf(resultMap.get("approval_time"));
approveDate = approveDate.contains("年") ? approveDate.replace("年", "-") : approveDate;
approveDate = approveDate.contains("月") ? approveDate.replace("月", "-") : approveDate;
approveDate = approveDate.contains("日") ? approveDate.replace("日", "-") : approveDate;
regUnitIcDto.setUnitCode(String.valueOf(resultMap.get("creditCode")));
String approve = approveDate.substring(0, 10) + "核准";
tzBaseEnterpriseInfoDto.setApproval(approve);
try {
regUnitIcDto.setApprovedDate(DateUtils.dateParse(approveDate, "yyyy-MM-dd"));
} catch (ParseException e) {
e.printStackTrace();
}
regUnitIcDto.setUnitName(String.valueOf(resultMap.get("unitName")));
regUnitIcDto.setRegisteredOrgan(String.valueOf(resultMap.get("registration_authority")));
for (DataDictionary djjg : iDataDictionaryService.getByType("DJJG")) {
if(djjg.getName().equals(resultMap.get("registration_authority"))){
regUnitIcDto.setRegisteredOrganCode(djjg.getSequenceNbr().toString());
}
}
regUnitIcDto.setBusinessState(String.valueOf(resultMap.get("operating_status")));
regUnitIcDto.setProvince("陕西省");
regUnitIcDto.setCity(city);
regUnitIcDto.setDistrict(district);
regUnitIcDto.setStree(String.valueOf(resultMap.get("street")));
regUnitIcDto.setCommunity(String.valueOf(resultMap.get("community")));
regUnitIcDto.setAddress(String.valueOf(resultMap.get("address")));
regUnitIcDto.setLegalPerson(String.valueOf(resultMap.get("legalPeople")));
regUnitIcDto.setIndustryName(industryName);
regUnitIcDto.setRegisterAddress("陕西省/" + city + "/" + district);
ArrayList<Object> objects = new ArrayList<>();
objects.add("陕西省");
objects.add(city);
objects.add(district);
regUnitIcDto.setRegisterAddressList(objects);
regUnitIcDto.setIsNotAccess("1");
} else {
regUnitIcDto = tzBaseEnterpriseInfoDto.getRegUnitIcDto();
regUnitIcDto.setIsNotAccess("0");
}
tzBaseEnterpriseInfoDto.setRegUnitIcDto(regUnitIcDto);
tzBaseEnterpriseInfoDto.setApprovalTime(regUnitIcDto.getApprovedDate());
return tzBaseEnterpriseInfoDto;
}
@Override
public IPage<TzBaseEnterpriseInfoDto> page(PageParam pageParam, String companyName) {
TzBaseEnterpriseInfo tzBaseEnterpriseInfo = tzBaseEnterpriseInfoMapper.selectOne(new QueryWrapper<TzBaseEnterpriseInfo>().eq("use_unit", companyName));
TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto = getDetail(tzBaseEnterpriseInfo);
ArrayList<TzBaseEnterpriseInfoDto> result = new ArrayList<>();
result.add(tzBaseEnterpriseInfoDto);
Page<TzBaseEnterpriseInfoDto> page = new Page<>(pageParam.getCurrent(), pageParam.getSize());
return page.setRecords(result);
}
@Override
public List<EquEnterDto> getInfoByUseUnit(String userUnit) {
return tzBaseEnterpriseInfoMapper.getInfoByUseUnit(userUnit);
}
@Override
public TzBaseEnterpriseInfoDto selectByUseUnit(String useUnit) {
if(ValidationUtil.isEmpty(useUnit)){
return new TzBaseEnterpriseInfoDto();
}
TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto = new TzBaseEnterpriseInfoDto();
TzBaseEnterpriseInfo tzBaseEnterpriseInfo = tzBaseEnterpriseInfoMapper.selectByUseUnit(useUnit);
if (tzBaseEnterpriseInfo != null) {
BeanUtils.copyProperties(tzBaseEnterpriseInfo, tzBaseEnterpriseInfoDto);
}
// 许可信息
List<BaseUnitLicence> unitLicences = baseUnitLicenceService.list(new LambdaQueryWrapper<BaseUnitLicence>()
.eq(BaseUnitLicence::getUnitCode, tzBaseEnterpriseInfo.getUseCode()));
List<BaseUnitLicenceDto> unitLicenceDtos = new ArrayList<BaseUnitLicenceDto>();
if (!ValidationUtil.isEmpty(unitLicences)) {
for (BaseUnitLicence baseUnitLicence : unitLicences) {
BaseUnitLicenceDto baseUnitLicenceDto = new BaseUnitLicenceDto();
BeanUtils.copyProperties(baseUnitLicence, baseUnitLicenceDto);
unitLicenceDtos.add(baseUnitLicenceDto);
}
}
tzBaseEnterpriseInfoDto.setUnitLicences(unitLicenceDtos);
// 工商信息
RegUnitIc regUnitIc = regUnitIcService.getOne(
new LambdaQueryWrapper<RegUnitIc>().eq(RegUnitIc::getUnitCode, tzBaseEnterpriseInfo.getUseCode()));
RegUnitIcDto regUnitIcDto = new RegUnitIcDto();
if (regUnitIc != null) {
BeanUtils.copyProperties(regUnitIc, regUnitIcDto);
}
tzBaseEnterpriseInfoDto.setRegUnitIcDto(regUnitIcDto);
return tzBaseEnterpriseInfoDto;
}
@Override
public String syncEnterpriseInfo() {
RequestContext.setAppKey(appkey);
RequestContext.setProduct(product);
RequestContext.setToken(String.valueOf(redisUtil.get("platform_token")));
List<TzBaseEnterpriseInfo> baseEnterpriseInfoList = new ArrayList<>();
//获取平台企业表企业名称及sequence_code,并装入map中
Collection<CompanyModel> companyModels = Privilege.companyClient.queryAgencyTree(null).getResult();
Map<String,CompanyModel> companyMap = new HashMap<>();
getCompanyInfoMap(companyModels,companyMap);
int size = 500;
int total = speUseUnitService.count();
int current = total/size;
current = current + 1;
for(int i = 1; i<=current; i++){
IPage<SpeUseUnit> page = new Page<>();
page.setCurrent(i);
page.setSize(size);
List<SpeUseUnit> speUseUnitList = speUseUnitService.page(page).getRecords();
for (SpeUseUnit speUseUnit : speUseUnitList) {
if(speUseUnit.getSyncState() != 3){
CompanyModel companyPrivilegeModel = Privilege.companyClient.queryByCompanyCode(speUseUnit.getCerCode()).getResult();
QueryWrapper<TzBaseEnterpriseInfo> queryWrapper = new QueryWrapper<TzBaseEnterpriseInfo>();
queryWrapper.eq("use_code",speUseUnit.getCerCode());
TzBaseEnterpriseInfo tzBaseEnterprisePrivilegeInfo = this.getOne(queryWrapper);
Map<String, Object> resultMap = accessFeignService.getData(speUseUnit.getCerCode()).getResult();
if (ValidationUtil.isEmpty(resultMap)){
if(!ValidationUtil.isEmpty(companyPrivilegeModel)){
List<AgencyUserModel> agencyUserModelList = Privilege.agencyUserClient.queryByCompanyId(companyPrivilegeModel.getSequenceNbr(),null,null,null).getResult();
if(ValidationUtil.isEmpty(agencyUserModelList)){
//spe表中的数据在工商查不到,且平台无用户,将删除企业数据
Privilege.companyClient.deleteCompany(String.valueOf(companyPrivilegeModel.getSequenceNbr()));
if (!ValidationUtil.isEmpty(tzBaseEnterprisePrivilegeInfo)) {
this.deleteBySeq(tzBaseEnterprisePrivilegeInfo.getSequenceNbr());
}
}
}
//spe表中的数据在工商查不到,设置spe表状态为1
speUseUnit.setSyncState(1);
speUseUnitService.updateById(speUseUnit);
}else {
CompanyModel privilegeCompanyModel = Privilege.companyClient.queryByCompanyName(String.valueOf(resultMap.get("registration_authority"))).getResult();
CompanyModel companyModel = new CompanyModel();
companyModel.setCompanyName(speUseUnit.getName());
companyModel.setCompanyCode(speUseUnit.getCerCode());
companyModel.setLevel("company");
companyModel.setAgencyCode("tzs");
companyModel.setCompanyType("使用单位");
companyModel.setAddress(String.valueOf(resultMap.get("address")));
companyModel.setParentId(privilegeCompanyModel.getSequenceNbr());
String area = String.valueOf(resultMap.get("area"));
String province = "";
if (area.contains("省")) {
province = area.substring(0, area.indexOf("省") + 1);
}
String city = "";
if (area.contains("市")) {
city = area.substring(province.length(), area.indexOf("市") + 1);
}
String district = area.substring(city.length() + province.length());
TzBaseEnterpriseInfo baseEnterpriseInfo = new TzBaseEnterpriseInfo();
baseEnterpriseInfo.setUseUnit(speUseUnit.getName());
baseEnterpriseInfo.setUseCode(speUseUnit.getCerCode());
baseEnterpriseInfo.setUnitType("使用单位");
baseEnterpriseInfo.setRegistrationAuthority(String.valueOf(resultMap.get("registration_authority")));
baseEnterpriseInfo.setProvince(province);
baseEnterpriseInfo.setCity(city);
baseEnterpriseInfo.setDistrict(district);
baseEnterpriseInfo.setStreet(String.valueOf(resultMap.get("street")));
baseEnterpriseInfo.setCommunity(String.valueOf(resultMap.get("community")));
baseEnterpriseInfo.setAddress(String.valueOf(resultMap.get("address")));
baseEnterpriseInfo.setLegalPerson(String.valueOf(resultMap.get("legalPeople")));
baseEnterpriseInfo.setIndustry(String.valueOf(resultMap.get("industry")));
baseEnterpriseInfo.setSuperviseOrgName(String.valueOf(resultMap.get("registration_authority")));
baseEnterpriseInfo.setSuperviseOrgCode(privilegeCompanyModel.getOrgCode());
baseEnterpriseInfo.setOperatingStatus(String.valueOf(resultMap.get("operating_status")));
baseEnterpriseInfo.setUnitType("使用单位");
baseEnterpriseInfoList.add(baseEnterpriseInfo);
//保存平台和业务的企业信息
try {
if (tzBaseEnterprisePrivilegeInfo == null && companyPrivilegeModel == null) {
//当企业表、平台表 中没有时
this.save(baseEnterpriseInfo);
Privilege.companyClient.create(companyModel);
} else if (tzBaseEnterprisePrivilegeInfo == null) {
//企业表没有,平台表有
this.save(baseEnterpriseInfo);
if (!companyPrivilegeModel.getCompanyType().contains(companyModel.getCompanyType())) {
companyPrivilegeModel.setCompanyType(companyPrivilegeModel.getCompanyType() + "," + companyModel.getCompanyType());
Privilege.companyClient.update(companyPrivilegeModel, companyPrivilegeModel.getSequenceNbr());
}
} else if (companyPrivilegeModel == null) {
//平台表没有,企业表有
if (!tzBaseEnterprisePrivilegeInfo.getUnitType().contains(baseEnterpriseInfo.getUnitType())) {
tzBaseEnterprisePrivilegeInfo.setUnitType(tzBaseEnterprisePrivilegeInfo.getUnitType() + "," + baseEnterpriseInfo.getUnitType());
this.updateById(tzBaseEnterprisePrivilegeInfo);
}
Privilege.companyClient.create(companyModel);
} else {
//企业表有 平台表有
if (!companyPrivilegeModel.getCompanyType().contains(companyModel.getCompanyType())) {
companyPrivilegeModel.setCompanyType(companyPrivilegeModel.getCompanyType() + "," + companyModel.getCompanyType());
Privilege.companyClient.update(companyPrivilegeModel, companyPrivilegeModel.getSequenceNbr());
}
if (!tzBaseEnterprisePrivilegeInfo.getUnitType().contains(baseEnterpriseInfo.getUnitType())) {
tzBaseEnterprisePrivilegeInfo.setUnitType(tzBaseEnterprisePrivilegeInfo.getUnitType() + "," + baseEnterpriseInfo.getUnitType());
this.updateById(tzBaseEnterprisePrivilegeInfo);
}
}
setSpeUseUnitState(3,speUseUnit);
} catch (Exception e) {
System.out.println(e.getMessage());
//当报错时 设置状态为 2
speUseUnit.setSyncState(2);
speUseUnitService.updateById(speUseUnit);
}
}
}
}
}
return "ok";
}
@Override
public TzBaseEnterpriseInfoDto companyInfoUpdate(Map<String, Object> map) {
TzBaseEnterpriseInfo tzBaseEnterpriseInfo = new TzBaseEnterpriseInfo();
tzBaseEnterpriseInfo.setSequenceNbr(Long.valueOf(map.get("sequenceNbr").toString()));
tzBaseEnterpriseInfo.setEquipCategory(JSON.toJSONString(map.get("equipCategory")));
Map<String, String> map1 = (Map<String, String>) map.get("longitudeLatitude");
tzBaseEnterpriseInfo.setAddress(ObjectUtils.isEmpty(map1.get("address")) ? null : map1.get("address"));
tzBaseEnterpriseInfo.setLongitude(ObjectUtils.isEmpty(map1.get("longitude")) ? null : String.valueOf(map1.get("longitude")));
tzBaseEnterpriseInfo.setLatitude(ObjectUtils.isEmpty(map1.get("latitude")) ? null : String.valueOf(map1.get("latitude")));
tzBaseEnterpriseInfo.setUseContact(ObjectUtils.isEmpty(map.get("useContact")) ? null : String.valueOf(map.get("useContact")));
tzBaseEnterpriseInfo.setContactPhone(ObjectUtils.isEmpty(map.get("contactPhone")) ? null : String.valueOf(map.get("contactPhone")));
tzBaseEnterpriseInfo.setUnitBusinessLicense(ObjectUtils.isEmpty(map.get("unitBusinessLicense")) ? null : JSON.toJSONString(map.get("unitBusinessLicense")));
tzBaseEnterpriseInfo.setIndustrySupervisor(ObjectUtils.isEmpty(map.get("industrySupervisor")) ? null : String.valueOf(map.get("industrySupervisor")));
tzBaseEnterpriseInfo.setSuperviseOrgCode(ObjectUtils.isEmpty(map.get("superviseOrgCode")) ? null : String.valueOf(map.get("superviseOrgCode")));
tzBaseEnterpriseInfo.setSuperviseOrgName(ObjectUtils.isEmpty(map.get("superviseOrgName")) ? null : String.valueOf(map.get("superviseOrgName")));
//修改工商信息
RegUnitIc regUnitIc = new RegUnitIc();
List<String> addressList = (List<String>) map.get("registerAddressList");
tzBaseEnterpriseInfo.setProvince(addressList.get(0));
tzBaseEnterpriseInfo.setCity(addressList.get(1));
tzBaseEnterpriseInfo.setDistrict(addressList.get(3));
tzBaseEnterpriseInfo.setCommunity(ObjectUtils.isEmpty(map.get("community")) ? null : String.valueOf(map.get("community")));
tzBaseEnterpriseInfo.setStreet(ObjectUtils.isEmpty(map.get("stree")) ? null : String.valueOf(map.get("stree")));
tzBaseEnterpriseInfo.setLegalPerson(ObjectUtils.isEmpty(map.get("legalPerson")) ? null : String.valueOf(map.get("legalPerson")));
regUnitIc.setIndustryName(ObjectUtils.isEmpty(map.get("industryName")) ? null : String.valueOf(map.get("industryName")));
regUnitIc.setRegisteredOrgan(ObjectUtils.isEmpty(map.get("registeredOrgan")) ? null : String.valueOf(map.get("registeredOrgan")));
Date approvedDate = new Date();
try {
approvedDate = DateUtils.dateParse(String.valueOf(map.get("approvedDate")), "yyyy-MM-dd");
} catch (ParseException e) {
throw new RuntimeException(e);
}
regUnitIc.setBusinessState(ObjectUtils.isEmpty(map.get("businessState")) ? null : String.valueOf(map.get("businessState")));
regUnitIc.setApprovedDate(ObjectUtils.isEmpty(map.get("approvedDate")) ? null : approvedDate);
RegUnitIcDto regUnitIcDto = JSON.parseObject(JSON.toJSONString(map.get("regUnitIcDto")), new TypeReference<RegUnitIcDto>() {
});
// regUnitIcService.update(regUnitIc, new QueryWrapper<RegUnitIc>().eq("unit_code", regUnitIcDto.getUnitCode()));
//修改许可信息
List<BaseUnitLicence> licences = (List<BaseUnitLicence>) map.get("unitLicences");
// baseUnitLicenceService.saveOrUpdateBatch(licences);
// boolean b = tzBaseEnterpriseInfoService.updateById(tzBaseEnterpriseInfo);
boolean b = true;
if (b) {
TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto = new TzBaseEnterpriseInfoDto();
BeanUtils.copyProperties(tzBaseEnterpriseInfo, tzBaseEnterpriseInfoDto);
return tzBaseEnterpriseInfoDto;
} else {
return null;
}
}
@Override
public String setLabel(List<Long> enterpriseIds, List<String> enterpriseLabels) {
List<TzBaseEnterpriseInfo> tzBaseEnterpriseInfos = tzBaseEnterpriseInfoMapper.selectBatchIds(enterpriseIds);
if (!ObjectUtils.isEmpty(enterpriseLabels)) {
for (TzBaseEnterpriseInfo tzBaseEnterpriseInfo : tzBaseEnterpriseInfos) {
// 标签递增逻辑
// if (!ObjectUtils.isEmpty(tzBaseEnterpriseInfo.getRegulatoryLabels())) {
// String result = checkLabel(enterpriseLabels, tzBaseEnterpriseInfo.getRegulatoryLabels());
// tzBaseEnterpriseInfo.setRegulatoryLabels(result);
// } else {
// String labels = String.join(",", enterpriseLabels);
// tzBaseEnterpriseInfo.setRegulatoryLabels(labels);
// }
String labels = String.join(",", enterpriseLabels);
tzBaseEnterpriseInfo.setRegulatoryLabels(labels);
}
} else {
tzBaseEnterpriseInfos.forEach(item -> {
item.setRegulatoryLabels(null);
});
}
this.updateBatchById(tzBaseEnterpriseInfos);
return "success";
}
private String checkLabel(List<String> enterpriseLabels, String result) {
List<String> strings = Arrays.asList(result.split(","));
ArrayList<String> res = new ArrayList<>(strings);
List<String> collect = enterpriseLabels.stream().filter(item -> !strings.contains(item)).collect(Collectors.toList());
res.addAll(collect);
return String.join(",", res);
}
public Map<String, Object> adminInfoUpdate(Map<String, Object> map) {
//每一个企业只有一个管理员,所以当前登录用户即管理员用户
AgencyUserModel me = Privilege.agencyUserClient.getme().getResult();
RequestContext.setAppKey(appkey);
RequestContext.setProduct(webProduct);
//获取机器人的token,获取不到则去登录
if (ObjectUtils.isEmpty(redisUtil.get(TZS_USER_TOKEN))) {
loginCtiUser();
}
RequestContext.setToken(String.valueOf(redisUtil.get(TZS_USER_TOKEN)));
Map<String, Object> resultMap = new HashMap<>();
if (!ObjectUtils.isEmpty(me)) {
RegUnitInfo regUnitInfo = new RegUnitInfo();
String unitCode = String.valueOf(map.get("unitCode"));
regUnitInfo.setAdminName(String.valueOf(map.get("adminName")));
regUnitInfo.setAdminIdNumber(String.valueOf(map.get("adminIdNumber")));
regUnitInfo.setAdminIdCardPhoto(JSON.toJSONString(map.get("adminIdCardPhoto")));
regUnitInfo.setAdminTel(String.valueOf(map.get("adminTel")));
me.setMobile(String.valueOf(map.get("adminTel")));
me.setRealName(String.valueOf(map.get("adminName")));
FeignClientResult<AgencyUserModel> updateResult = Privilege.agencyUserClient.update(me, String.valueOf(map.get("adminUserId")));
if (200 == updateResult.getStatus()) {
regUnitInfoService.update(regUnitInfo, new QueryWrapper<RegUnitInfo>().eq("unit_code", unitCode));
resultMap.put("success", regUnitInfo);
redisUtil.del(adminChange + map.get("adminTel"));
} else {
resultMap.put("fail", "平台用户修改失败,请联系管理员");
}
} else {
resultMap.put("fail", "平台用户不存在");
}
return resultMap;
}
//机器人用户登录
private void loginCtiUser() {
String passwd = DesUtil.encode(tzsAdminPwd, "qaz");
IdPasswordAuthModel loninData = new IdPasswordAuthModel();
loninData.setLoginId(tzsAdminName);
loninData.setPassword(passwd);
FeignClientResult loginResult = Privilege.authClient.idpassword(loninData);
if(loginResult.getStatus() == 200) {
HashMap resultMap = (HashMap) loginResult.getResult();
redisUtil.set(TZS_USER_TOKEN, resultMap.get("token").toString(), redisRegionTimeSecond);
}
}
public void setSpeUseUnitState(int state,SpeUseUnit speUseUnit){
speUseUnit.setSyncState(state);
speUseUnitService.updateById(speUseUnit);
}
public Map<String, CompanyModel> getCompanyInfoMap(Collection companyModels,Map<String, CompanyModel> map){
if(companyModels == null){
return map;
}
Iterator iter = companyModels.iterator();
while(iter.hasNext()){
String json = JSON.toJSONString(iter.next());
CompanyModel companyModel = JSON.parseObject(json,CompanyModel.class);
map.put(companyModel.getCompanyName(),companyModel);
getCompanyInfoMap(companyModel.getChildren(),map);
}
return map;
}
}
package com.yeejoin.amos.boot.module.app.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.MybatisConfiguration;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.TableInfoHelper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.app.api.common.CommonException;
import com.yeejoin.amos.boot.module.app.api.common.MobileLoginParam;
import com.yeejoin.amos.boot.module.app.api.dto.*;
import com.yeejoin.amos.boot.module.app.api.entity.*;
import com.yeejoin.amos.boot.module.app.api.enums.EquipmentClassifityEnum;
import com.yeejoin.amos.boot.module.app.api.mapper.CategoryOtherInfoMapper;
import com.yeejoin.amos.boot.module.app.api.mapper.EquipmentCategoryMapper;
import com.yeejoin.amos.boot.module.app.api.mapper.ViewJgClaimMapper;
import com.yeejoin.amos.boot.module.app.biz.utils.HttpUtils;
import com.yeejoin.amos.boot.module.app.biz.utils.JsonUtils;
import com.yeejoin.amos.boot.module.app.flc.api.feign.IdxFeignService;
import com.yeejoin.amos.boot.module.app.flc.api.mapper.RegUnitInfoMapper;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.IdPasswordAuthModel;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.ContentType;
import org.apache.ibatis.builder.MapperBuilderAssistant;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.security.AlgorithmParameters;
import java.security.Security;
import java.util.*;
import java.util.stream.Collectors;
@Service
@Slf4j
public class TzsAppService {
@Autowired
DesignInfoService designInfoService;
@Value("classpath:/json/equipCategory.json")
private Resource equipCategory;
@Autowired
DataDictionaryMapper dataDictionaryMapper;
@Autowired
IdxFeignService idxFeignService;
@Autowired
EquipmentCategoryMapper equipmentCategoryMapper;
@Autowired
EquipmentCategoryServiceImpl equipmentCategoryServiceImpl;
@Autowired
ProduceInfoService produceInfoService;
@Autowired
ConstructionInfoService constructionInfoService;
@Autowired
RegistrationInfoService registrationInfoService;
@Autowired
EquipTechParamBoilerService boilerService;
@Autowired
EquipTechParamElevatorService elevatorService;
@Autowired
EquipTechParamLiftingService liftingService;
@Autowired
EquipTechParamPipelineService pipelineService;
@Autowired
EquipTechParamRidesService ridesService;
@Autowired
EquipTechParamRopewayService ropewayService;
@Autowired
EquipTechParamVehicleService vehicleService;
@Autowired
EquipTechParamVesselService vesselService;
@Autowired
MainPartsServiceImpl mainPartsService;
@Autowired
ProtectionDevicesServiceImpl protectionDevicesService;
@Autowired
UseInfoService unseInfoService;
@Autowired
MaintenanceInfoService maintenanceInfoService;
@Autowired
InspectionDetectionInfoServiceImpl inspectionDetectionInfoService;
@Autowired
OtherInfoService otherInfoService;
@Autowired
CategoryOtherInfoMapper categoryOtherInfoMapper;
@Autowired
RedisUtils redisUtils;
@Value("${tzs.WxApp.appId}")
String WxAppAppId ;
@Value("${tzs.WxApp.secret}")
String WxAppSecret;
@Value("${tzs.WxApp.grant-type}")
String WxAppGrantType;
@Value("${minio.url.path}")
String minioPath;
@Autowired
private RegUnitInfoMapper regUnitInfoMapper;
@Autowired
ViewJgClaimMapper viewJgClaimMapper;
public static final String WXUSER_TOKEN = "wxUser_token";
/**
* token 过期时间,wechat 系统为7200 ,tzs 系统小于7200 防止获取到无效token
*/
private long time = 6000l;
/**
* 产品appkey
*/
private static final String appKey = "AMOS_STUDIO";
/**
* 产品product
*/
private static final String product = "AMOS_STUDIO_WEB";
private static final String regionRedis="app_region_redis";
private final int successsCode = 200;
public Map<String, Object> getEquipmentInfo(String record) {
List<DataDictionary> dictionaryList = getDictionary();
List<EquipmentCategory> equipmentCategories = equipmentCategoryMapper.selectList(null);
Map<String, Object> map = new HashMap();
map.put("SEQUENCE_NBR", record);
map.put("tableName", "idx_biz_view_jg_claim");
ResponseModel<Page<Map<String, Object>>> model=idxFeignService.getPage(map);
List<Map<String, Object>> detialMapList = model.getResult().getRecords();
if (!ValidationUtil.isEmpty(detialMapList)) {
map = detialMapList.iterator().next();
}
map.putAll(getQRCode(record));
JSONArray jsonArray = new JSONArray();
// 出厂
JSONObject exFactoryJsonObject = new JSONObject();
List exFactoryList = new ArrayList();
getGroupList(null ,record, DesignInfo.class, DesignInfoModel.class, designInfoService, exFactoryList, false,dictionaryList,equipmentCategories);
getGroupList(null ,record, ProduceInfo.class, ProduceInfoModel.class, produceInfoService, exFactoryList, false,dictionaryList,equipmentCategories);
exFactoryJsonObject.put("title", "出厂");
exFactoryJsonObject.put("tabValue", exFactoryList);
jsonArray.add(exFactoryJsonObject);
// 施工
JSONObject constructionJsonObject = new JSONObject();
List constructionList = new ArrayList();
getGroupList(null ,record, ConstructionInfo.class, ConstructionInfoModel.class, constructionInfoService, constructionList, true,dictionaryList,equipmentCategories);
constructionJsonObject.put("title", "施工");
constructionJsonObject.put("tabValue", constructionList);
jsonArray.add(constructionJsonObject);
// 注册
JSONObject registrationJsonObject = new JSONObject();
List registrationList = new ArrayList();
getGroupList(null ,record, RegistrationInfo.class, RegistrationInfoModel.class, registrationInfoService, registrationList, false,dictionaryList,equipmentCategories);
getGroupList(null ,record, EquipTechParamBoiler.class, EquipTechParamBoilerModel.class, boilerService, registrationList, false,dictionaryList,equipmentCategories);
getGroupList(null ,record, EquipTechParamElevator.class, EquipTechParamElevatorModel.class, elevatorService, registrationList, false,dictionaryList,equipmentCategories);
getGroupList(null ,record, EquipTechParamLifting.class, EquipTechParamLiftingModel.class, elevatorService, registrationList, false,dictionaryList,equipmentCategories);
getGroupList(null ,record, EquipTechParamPipeline.class, EquipTechParamPipelineModel.class, pipelineService, registrationList, false,dictionaryList,equipmentCategories);
getGroupList(null ,record, EquipTechParamRides.class, EquipTechParamRidesModel.class, ridesService, registrationList, false,dictionaryList,equipmentCategories);
getGroupList(null ,record, EquipTechParamRopeway.class, EquipTechParamRopewayModel.class, ropewayService, registrationList, false,dictionaryList,equipmentCategories);
getGroupList(null ,record, EquipTechParamVehicle.class, EquipTechParamVehicleModel.class, vehicleService, registrationList, false,dictionaryList,equipmentCategories);
getGroupList(null ,record, EquipTechParamVessel.class, EquipTechParamVesselModel.class, vesselService, registrationList, false,dictionaryList,equipmentCategories);
getGroupList(null ,record, MainParts.class, MainPartsModel.class, mainPartsService, registrationList, false,dictionaryList,equipmentCategories);
getGroupList(null ,record, ProtectionDevices.class, ProtectionDevicesModel.class, protectionDevicesService, registrationList, false,dictionaryList,equipmentCategories);
registrationJsonObject.put("title", "注册");
registrationJsonObject.put("tabValue", registrationList);
jsonArray.add(registrationJsonObject);
// 使用
JSONObject useJsonObject = new JSONObject();
List useList = new ArrayList();
getGroupList(null ,record, UseInfo.class, UseInfoModel.class, unseInfoService, useList, false,dictionaryList,equipmentCategories);
useJsonObject.put("title", "使用");
useJsonObject.put("tabValue", useList);
jsonArray.add(useJsonObject);
// 维保
JSONObject maintenanceJsonObject = new JSONObject();
List maintenanceList = new ArrayList();
getGroupList(null ,record, MaintenanceInfo.class, MaintenanceInfoModel.class, maintenanceInfoService, maintenanceList, true,dictionaryList,equipmentCategories);
maintenanceJsonObject.put("title", "维保");
maintenanceJsonObject.put("tabValue", maintenanceList);
jsonArray.add(maintenanceJsonObject);
// 检验
JSONObject inspectionJsonObject = new JSONObject();
List inspectionList = new ArrayList();
getGroupList(null ,record, InspectionDetectionInfo.class, InspectionDetectionInfoModel.class, inspectionDetectionInfoService, inspectionList, true,dictionaryList,equipmentCategories);
inspectionJsonObject.put("title", "检验");
inspectionJsonObject.put("tabValue", inspectionList);
jsonArray.add(inspectionJsonObject);
// 其他
JSONObject otherJsonObject = new JSONObject();
List otherList = new ArrayList();
getGroupList(null ,record, OtherInfo.class, OtherInfoModel.class, otherInfoService, otherList, false,dictionaryList,equipmentCategories);
otherJsonObject.put("title", "其他");
otherJsonObject.put("tabValue", otherList);
jsonArray.add(otherJsonObject);
map.put("tab", jsonArray);
return map;
}
public Map<String, Object> getEquipmentInfoWX(String record) {
List<DataDictionary> dictionaryList = getDictionary();
List<EquipmentCategory> equipmentCategories = equipmentCategoryMapper.selectList(null);
Map<String, Object> map = new HashMap();
map.put("SEQUENCE_NBR", record);
map.put("tableName", "idx_biz_view_jg_claim");
ResponseModel<Page<Map<String, Object>>> model=idxFeignService.getPage(map);
List<Map<String, Object>> detialMapList = model.getResult().getRecords();
if (!ValidationUtil.isEmpty(detialMapList)) {
map = detialMapList.iterator().next();
}
map.putAll(getQRCode(record));
if(map.get("EQU_LIST_CODE").equals("3000")) {
JSONArray jsonArray = new JSONArray();
// 基本信息
JSONObject exFactoryJsonObject = new JSONObject();
List exFactoryList = new ArrayList();
HashMap putMap = new HashMap();
Field[] fields = ElevatorBaseInfoForWXModel.class.getDeclaredFields();
for (Field f :fields
) {
putMap.put(f.getName(),"");
}
getGroupList( putMap ,record, RegistrationInfo.class, ElevatorBaseInfoForWXModel.class, registrationInfoService, exFactoryList, false,dictionaryList,equipmentCategories);
getGroupList( putMap , record, DesignInfo.class, ElevatorBaseInfoForWXModel.class, designInfoService, exFactoryList, false,dictionaryList,equipmentCategories);
getGroupList( putMap ,record, OtherInfo.class, ElevatorBaseInfoForWXModel.class, otherInfoService, exFactoryList, false,dictionaryList,equipmentCategories);
getGroupList( putMap , record, UseInfo.class, ElevatorBaseInfoForWXModel.class, unseInfoService, exFactoryList, false,dictionaryList,equipmentCategories);
getGroupList( putMap , record, ProduceInfo.class, ElevatorBaseInfoForWXModel.class, produceInfoService, exFactoryList, false,dictionaryList,equipmentCategories);
if(exFactoryList.size() > 0) {
String area = map.get("USE_PLACE").toString();
JSONObject jsonObject = (JSONObject) exFactoryList.get(0);
List<HashMap<String, Object>> groupValue = (List<HashMap<String, Object>>) jsonObject.get("groupValue");
groupValue.forEach(e->{
e.put("fieldValue", putMap.get(e.get("fieldKey")));
if(e.get("fieldKey").equals("area")) {
e.put("fieldValue", area);
}
});
Object ob = exFactoryList.get(0);
exFactoryList.clear();
exFactoryList.add(ob);
}
exFactoryJsonObject.put("title", "基本信息");
exFactoryJsonObject.put("tabValue", exFactoryList);
jsonArray.add(exFactoryJsonObject);
// 最近检验信息
JSONObject constructionJsonObject = new JSONObject();
List constructionList = new ArrayList();
getGroupList(null ,record, InspectionDetectionInfo.class, InspectionDetectionInfoModelForWX.class, constructionInfoService, constructionList, true,dictionaryList,equipmentCategories);
constructionJsonObject.put("title", "最近检验信息");
constructionJsonObject.put("tabValue", constructionList);
jsonArray.add(constructionJsonObject);
// 设备维保信息
JSONObject useJsonObject = new JSONObject();
List useList = new ArrayList();
getGroupList(null ,record, MaintenanceInfo.class, MaintenanceInfoModelForWX.class, unseInfoService, useList, false,dictionaryList,equipmentCategories);
useJsonObject.put("title", "设备维保信息");
useJsonObject.put("tabValue", useList);
jsonArray.add(useJsonObject);
map.put("tab", jsonArray);
} else {
JSONArray jsonArray = new JSONArray();
// 基本信息
JSONObject exFactoryJsonObject = new JSONObject();
List exFactoryList = new ArrayList();
HashMap putMap = new HashMap();
Field[] fields = OtherEquBaseInfoForWXModel.class.getDeclaredFields();
for (Field f :fields
) {
putMap.put(f.getName(),"");
}
getGroupList( putMap ,record, RegistrationInfo.class, OtherEquBaseInfoForWXModel.class, registrationInfoService, exFactoryList, false,dictionaryList,equipmentCategories);
getGroupList( putMap , record, DesignInfo.class, OtherEquBaseInfoForWXModel.class, designInfoService, exFactoryList, false,dictionaryList,equipmentCategories);
getGroupList( putMap ,record, OtherInfo.class, OtherEquBaseInfoForWXModel.class, otherInfoService, exFactoryList, false,dictionaryList,equipmentCategories);
getGroupList( putMap , record, UseInfo.class, OtherEquBaseInfoForWXModel.class, unseInfoService, exFactoryList, false,dictionaryList,equipmentCategories);
getGroupList( putMap , record, ProduceInfo.class, OtherEquBaseInfoForWXModel.class, produceInfoService, exFactoryList, false,dictionaryList,equipmentCategories);
if(exFactoryList.size() > 0) {
JSONObject jsonObject = (JSONObject) exFactoryList.get(0);
List<HashMap<String, Object>> groupValue = (List<HashMap<String, Object>>) jsonObject.get("groupValue");
groupValue.forEach(e->{
e.put("fieldValue", putMap.get(e.get("fieldKey")));
});
Object ob = exFactoryList.get(0);
exFactoryList.clear();
exFactoryList.add(ob);
}
exFactoryJsonObject.put("title", "基本信息");
exFactoryJsonObject.put("tabValue", exFactoryList);
jsonArray.add(exFactoryJsonObject);
// 最近检验信息
JSONObject constructionJsonObject = new JSONObject();
List constructionList = new ArrayList();
getGroupList(null ,record, InspectionDetectionInfo.class, InspectionDetectionInfoModelForWX.class, constructionInfoService, constructionList, true,dictionaryList,equipmentCategories);
constructionJsonObject.put("title", "最近检验信息");
constructionJsonObject.put("tabValue", constructionList);
jsonArray.add(constructionJsonObject);
}
return map;
}
public void getGroupList( HashMap putMap, String record, Class entity, Class dto, BaseService service, List list, boolean isOne,List<DataDictionary> dictionaryList,List<EquipmentCategory> equipmentCategories) {
TableInfoHelper.initTableInfo(new MapperBuilderAssistant(new MybatisConfiguration(), ""), entity);
QueryWrapper wrapper = new QueryWrapper();
wrapper.eq("RECORD", record);
if (isOne) {
wrapper.orderByDesc("REC_DATE");
}
List entityList = service.list(wrapper);
Iterator iterator = entityList.iterator();
JSONObject result =new JSONObject();
if (!isOne) {
if (!ValidationUtil.isEmpty(entityList)) {
if (entityList.size()>0) {
while (iterator.hasNext()) {
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(iterator.next()));
result = getFieldList(putMap ,dto, jsonObject, null,dictionaryList,equipmentCategories);
list.add(result);
}
}
}
} else {
int count = entityList.size();
JSONObject jsonObject = null;
if (count>0) {
jsonObject= JSON.parseObject(JSON.toJSONString(iterator.next()));
}else {
jsonObject=new JSONObject();
}
result = getFieldList( putMap ,dto, jsonObject, count,dictionaryList,equipmentCategories);
list.add(result);
}
}
public JSONObject getFieldList(HashMap putMap, Class clazz, JSONObject jsonObject, Integer count,List<DataDictionary> dictionaryList,List<EquipmentCategory> equipmentCategories) {
JSONObject result = new JSONObject();
JSONObject ApiModel = JSON.parseObject(JSON.toJSONString(clazz.getAnnotation(ApiModel.class)));
String groupName = ApiModel.getString("description");
Field[] declaredFields = clazz.getDeclaredFields();
List<Map<String, Object>> list = new ArrayList<>();
if (!ValidationUtil.isEmpty(declaredFields)) {
for (Field field : declaredFields) {
if (field.getAnnotation(ApiModelProperty.class) != null && !ValidationUtil.isEmpty(field.getAnnotation(ApiModelProperty.class).value())) {
Map<String, Object> map = new HashMap<>();
String filedName = field.getAnnotation(ApiModelProperty.class).value();
// key和value可根据需求存
// 这存的key为注解的值,value为类属性名
map.put("fieldName", filedName);
map.put("fieldKey", field.getName());
if (!ValidationUtil.isEmpty(jsonObject)) {
map.put("fieldValue", jsonObject.getString(field.getName()));
getCon(field.getName(),jsonObject,map,clazz,dictionaryList,equipmentCategories);
}else {
map.put("fieldValue", "");
}
if(null != putMap && putMap.containsKey(field.getName())) {
if(null != map.get("fieldValue")) {
putMap.put(field.getName(), map.get("fieldValue"));
}
}
list.add(map);
}
}
}
// 整理出现多个附件的情况
Iterator<Map<String, Object>> iterator = list.iterator();
JSONArray array = new JSONArray();
Boolean bool = true;
String name = "";
while (iterator.hasNext()) {
Map<String, Object> map = iterator.next();
String fieldName = map.get("fieldName").toString();
if (fieldName.contains("附件")) {
if (bool) {
// 第一个出现的附件名称为表单显示的名称
name = fieldName;
bool = false;
}
if (!ValidationUtil.isEmpty(map.get("fieldValue"))) {
JSONArray jsonArray = JSON.parseArray(String.valueOf(map.get("fieldValue")));
JSONArray json = new JSONArray();
for (Object obj : jsonArray) {
JSONObject object = JSON.parseObject(JSON.toJSONString(obj));
if (!ValidationUtil.isEmpty(object)) {
object.getString("url");
object.put("url",object.getString("url"));
json.add(object);
}
}
array.addAll(json);
}
// 删除所有附件
iterator.remove();
}
}
// 如果有附件 整理为一个附件 添加入list里
if (!bool) {
Map<String, Object> map = new HashMap<>();
map.put("fieldKey", "files");
map.put("fieldValue", array);
map.put("fieldName", name);
list.add(map);
}
if (!ValidationUtil.isEmpty(count)) {
result.put("groupCount", count);
}
result.put("groupName", ApiModel.getString("description"));
result.put("groupKey", ApiModel.getString("value"));
result.put("groupValue", list);
return result;
}
/**
* 获取焊口编号
*
* @return
*/
public JSONObject getQRCode(String code) {
String url = "";
JSONObject jsonObject = new JSONObject();
byte[] bytes = QRCodeUtil.generateQRCodeImageByteData(code, 50);
InputStream inputStream = new ByteArrayInputStream(bytes);
try {
MultipartFile file = new MockMultipartFile(code + ".jpg", code + ".jpg", ContentType.APPLICATION_OCTET_STREAM.toString(), inputStream);
FeignClientResult<Map<String, String>> date = Systemctl.fileStorageClient.updateCommonFileFree(file, "ugp/qrcode");
if (date != null) {
Map<String, String> map = date.getResult();
Iterator<String> it = map.keySet().iterator();
String urlString = it.next();
jsonObject.put("fileUrl", urlString);
jsonObject.put("fileName", code);
}
} catch (IOException e) {
e.printStackTrace();
}
return jsonObject;
}
public Object getEquipInfoBySuperviseCode(String supervisoryCode) {
CategoryOtherInfo categoryOtherInfo = categoryOtherInfoMapper.selectOne(new QueryWrapper<CategoryOtherInfo>().eq("SUPERVISORY_CODE", supervisoryCode));
return ObjectUtils.isEmpty(categoryOtherInfo) ? null : getEquipmentInfo(categoryOtherInfo.getRecord());
}
public Map<String, Object> login(MobileLoginParam param) {
Map<String, Object> result = new LinkedHashMap<>();
IdPasswordAuthModel idPasswordAuthModel = new IdPasswordAuthModel();
idPasswordAuthModel.setLoginId(param.getPhoneNo());
idPasswordAuthModel.setPassword(param.getVerifyCode());
FeignClientResult<Map<String, String>> idpassword = new FeignClientResult<>();
RequestContext.setToken("");
RequestContext.setProduct(product);
RequestContext.setAppKey(appKey);
try {
idpassword = Privilege.authClient.idpassword(idPasswordAuthModel);
} catch (Exception e) {
e.printStackTrace();
}
if (idpassword.getStatus() != successsCode) {
log.error("远程调用Privilege服务失败", idpassword.getDevMessage());
String message = idpassword.getMessage();
if (StringUtils.isEmpty(message)) {
message = "账号或密码错误";
}
throw new CommonException(600001, message);
}
if (ValidationUtil.isEmpty(idpassword) || ValidationUtil.isEmpty(idpassword.getResult()) ||
ValidationUtil.isEmpty(idpassword.getResult().get("userId"))) {
log.error("未修改成功");
return new HashMap<String, Object>();
}
HashMap<Object, Object> authInfo = new HashMap<>();// 设置authInfo信息
authInfo.put("token", idpassword.getResult().get("token"));
authInfo.put("personId", idpassword.getResult().get("userId"));
authInfo.put("appKey", appKey);
authInfo.put("product", product);
result.put("authInfo", authInfo);
//查询用户信息
RequestContext.setToken(idpassword.getResult().get("token"));
FeignClientResult<AgencyUserModel> getme = Privilege.agencyUserClient.getme();
getme.getResult().setPassword("");
getme.getResult().setAppCodes(new ArrayList());
result.put("userInfo", getme.getResult());
return result;
}
@SneakyThrows
public JSONObject wxUserLogin(JSONObject wx) {
JSONObject obj = getSessionKey(wx);
String sessionKey = obj.getString("session_key");
//被加密的数据
byte[] dataByte = Base64.getDecoder().decode(wx.getString("encryptedData"));
//加密秘钥
byte[] keyByte = Base64.getDecoder().decode(sessionKey);
//偏移量
byte[] ivByte = Base64.getDecoder().decode(wx.getString("iv"));
JSONObject res=null;
// 如果密钥不足16位,那么就补足. 这个if 中的内容很重要
int base = 16;
if (keyByte.length % base != 0) {
int groups = keyByte.length / base + (keyByte.length % base != 0 ? 1 : 0);
byte[] temp = new byte[groups * base];
Arrays.fill(temp, (byte) 0);
System.arraycopy(keyByte, 0, temp, 0, keyByte.length);
keyByte = temp;
}
// 初始化
Security.addProvider(new BouncyCastleProvider());
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS7Padding","BC");
SecretKeySpec spec = new SecretKeySpec(keyByte, "AES");
AlgorithmParameters parameters = AlgorithmParameters.getInstance("AES");
parameters.init(new IvParameterSpec(ivByte));
cipher.init(Cipher.DECRYPT_MODE, spec, parameters);// 初始化
byte[] resultByte = cipher.doFinal(dataByte);
if (null != resultByte && resultByte.length > 0) {
String result = new String(resultByte, "UTF-8");
res=JSONObject.parseObject(result);
return res ;
}
return res;
}
private JSONObject getSessionKey(JSONObject wx) {
StringBuffer buffer = new StringBuffer("https://api.weixin.qq.com/sns/jscode2session?appid=")
.append(WxAppAppId).append("&secret=").append(WxAppSecret).append("&js_code=").append(wx.getString("js_code"))
.append("&grant_type=").append(WxAppGrantType);
String responseStr = HttpUtils.doGet(buffer.toString());
JSONObject response = JSONObject.parseObject(responseStr);
return response;
}
public Page equipmentCount(String companyCode) {
Page page = new Page<>();
Map<String, List<Map<String, Object>>> resourceJson = JsonUtils.getResourceJson(equipCategory);
List<Map<String, Object>> mapList = resourceJson.get(EquipmentClassifityEnum.BDLS.getCode());
List<Map<String, Object>> list = new ArrayList<>();
List<Map<String, Object>> listMap = equipmentCategoryMapper.getCategoryCount(companyCode);
for (Map<String, Object> map : mapList) {
for (Map<String, Object> map1 : listMap) {
if (map.get("code").equals(map1.get("category"))) {
map.put("waitClaim", map1.get("waitClaim"));
map.put("alreadyClaim", map1.get("alreadyClaim"));
map.put("refuseClaim", map1.get("refuseClaim"));
Long sum = Long.valueOf(map1.get("waitClaim").toString()) + Long.valueOf(map1.get("alreadyClaim").toString()) + Long.valueOf(map1.get("refuseClaim").toString());
map.put("sum", sum);
}
}
list.add(map);
}
page.setCurrent(1);
page.setTotal(list.size());
page.setRecords(list);
return page;
}
public Page<Map<String,Object>> getTable(Map<String, Object> map) {
Page<Map<String, Object>> table=null;
String teqy = (String)map.get("teqy");
if (ValidationUtil.isEmpty(teqy) ) {
table = equipmentCategoryServiceImpl.getTable(map);
}else {
map.remove("teqy");
table = idxFeignService.getPage(map).getResult();
}
return table;
}
public JSONArray getRegionName(){
JSONArray jsonArray = new JSONArray();
if (redisUtils.hasKey(regionRedis)) {
jsonArray= JSONArray.parseArray(redisUtils.get(regionRedis).toString());
}else {
Collection<RegionModel> regionChild = new ArrayList<>();
RegionModel regionModel1 = new RegionModel();
regionChild.add(regionModel1);
FeignClientResult<Collection<RegionModel>> collectionFeignClientResult = Systemctl.regionClient.queryForTreeParent(610000L);
Collection<RegionModel> result = collectionFeignClientResult.getResult();
for (RegionModel regionModel : result) {
for (RegionModel child : regionModel.getChildren()) {
for (RegionModel childChild : child.getChildren()) {
jsonArray.add(childChild);
}
child.setChildren(regionChild);
jsonArray.add(child);
}
regionModel.setChildren(regionChild);
jsonArray.add(regionModel);
}
redisUtils.set(regionRedis,jsonArray);
}
return jsonArray;
}
//查询字典值(只针对设备一码通详情字典,其他勿用)
public List<DataDictionary> getDictionary(){
LambdaQueryWrapper<DataDictionary> wrapper = new LambdaQueryWrapper<>();
wrapper.ge(DataDictionary::getSequenceNbr ,5951L).le(DataDictionary::getSequenceNbr ,6529L);
List<DataDictionary> dataDictionaryList = dataDictionaryMapper.selectList(wrapper);
return dataDictionaryList;
}
public void getCon(String fileName,JSONObject jsonObject,Map<String, Object> map,Class clazz,List<DataDictionary> dictionaryList,List<EquipmentCategory> equipmentCategories) {
if ("province".indexOf(fileName) != -1 || "city".indexOf(fileName) != -1 || "county".indexOf(fileName) != -1) {
JSONArray regionName = getRegionName();
List<RegionModel> list = JSONArray.parseArray(regionName.toJSONString(),RegionModel.class);
for (RegionModel re : list) {
if (re.getRegionCode().equals(Integer.valueOf(jsonObject.getString(fileName)))) {
map.put("fieldValue", re.getRegionName());
}
}
}
if ("designStandard".indexOf(fileName) !=-1) {
JSONArray jsonArray = JSONArray.parseArray(jsonObject.getString(fileName));
map.put("fieldValue", jsonArray);
}
getIf("imported",fileName,"BOOLEN",dictionaryList,jsonObject,map);
getIf("changes",fileName,"BGSX",dictionaryList,jsonObject,map);
getIf("usePlace",fileName,"ADDRESS",dictionaryList,jsonObject,map);
getIf("equManageDt",fileName,"ZGBM",dictionaryList,jsonObject,map);
getIf("equState",fileName,"SHZT",dictionaryList,jsonObject,map);
getIf("denselyPopulatedAreas",fileName,"BOOLEN",dictionaryList,jsonObject,map);
getIf("importantPlaces",fileName,"BOOLEN",dictionaryList,jsonObject,map);
getIf("registerState",fileName,"ZC",dictionaryList,jsonObject,map);
getIf("inspectType",fileName,"JYLX",dictionaryList,jsonObject,map);
getIf("inspectConclusion",fileName,"JYJL",dictionaryList,jsonObject,map);
getIf("constructionType",fileName,"SGLX",dictionaryList,jsonObject,map);
for (EquipmentCategory equipmentCategory : equipmentCategories) {
if ("equDefine".indexOf(fileName) != -1 && !ValidationUtil.isEmpty(equipmentCategory) && !ValidationUtil.isEmpty(equipmentCategory.getCode()) &&
!ValidationUtil.isEmpty(fileName) && !ValidationUtil.isEmpty(jsonObject.getString(fileName)) && equipmentCategory.getCode().indexOf(jsonObject.getString(fileName)) !=-1) {
map.put("fieldValue",equipmentCategory.getName() );
}
if ("equCategory".indexOf(fileName) != -1 && !ValidationUtil.isEmpty(equipmentCategory) && !ValidationUtil.isEmpty(equipmentCategory.getCode()) &&
!ValidationUtil.isEmpty(fileName) && !ValidationUtil.isEmpty(jsonObject.getString(fileName)) && equipmentCategory.getCode().indexOf(jsonObject.getString(fileName)) !=-1) {
map.put("fieldValue",equipmentCategory.getName() );
}
}
getIf("carrierLine",fileName,"YZS",dictionaryList,jsonObject,map);
getIf("deviceLevel",fileName,"GLJB",dictionaryList,jsonObject,map);
getIf("fuelType",fileName,"GLZL",dictionaryList,jsonObject,map);
getIf("nameOfPressureParts",fileName,"GLBJMC",dictionaryList,jsonObject,map);
getIf("nonDestructiveTestingMethodsForPressureParts",fileName,"GLWSJCFF",dictionaryList,jsonObject,map);
getIf("qpLossless",fileName,"RQJCFF",dictionaryList,jsonObject,map);
getIf("glLossless",fileName,"RQJCFF",dictionaryList,jsonObject,map);
getIf("mainStructureType",fileName,"RQJG",dictionaryList,jsonObject,map);
getIf("checkLossless",fileName,"RQJCFF",dictionaryList,jsonObject,map);
getIf("pipelineClass",fileName,"GDLB",dictionaryList,jsonObject,map);
getIf("deviceLevel",fileName,"GBI",dictionaryList,jsonObject,map);
getIf("workLevel",fileName,"GZJB",dictionaryList,jsonObject,map);
getIf("mainStructureType",fileName,"JGS",dictionaryList,jsonObject,map);
getIf("luffingMode",fileName,"BFFS",dictionaryList,jsonObject,map);
getIf("towerStandardType",fileName,"JXS",dictionaryList,jsonObject,map);
getIf("baseType",fileName,"JZXS",dictionaryList,jsonObject,map);
getIf("outriggerType",fileName,"ZT",dictionaryList,jsonObject,map);
getIf("mainBeamType",fileName,"ZLXS",dictionaryList,jsonObject,map);
getIf("boomType",fileName,"BJXS",dictionaryList,jsonObject,map);
getIf("boomStructureType",fileName,"BJJGXS",dictionaryList,jsonObject,map);
getIf("gantryStructureType",fileName,"MJJG",dictionaryList,jsonObject,map);
getIf("use",fileName,"YT",dictionaryList,jsonObject,map);
getIf("controlMode",fileName,"CZFS",dictionaryList,jsonObject,map);
getIf("hangingCagesNumber",fileName,"DLSL",dictionaryList,jsonObject,map);
getIf("driveMechanismType",fileName,"QDJG",dictionaryList,jsonObject,map);
getIf("guideRailFrame",fileName,"DS",dictionaryList,jsonObject,map);
getIf("liftingDriveMode",fileName,"QD",dictionaryList,jsonObject,map);
getIf("operationMode",fileName,"JXCZ",dictionaryList,jsonObject,map);
getIf("liftingMode",fileName,"QSFS",dictionaryList,jsonObject,map);
getIf("explosionProofGrade",fileName,"FBDJ",dictionaryList,jsonObject,map);
getIf("hoistWorkingLevel",fileName,"GZJB",dictionaryList,jsonObject,map);
getIf("bigcarTraveWorkingLevel",fileName,"GZJB",dictionaryList,jsonObject,map);
getIf("smallcarTraveWorkingLevel",fileName,"GZJB",dictionaryList,jsonObject,map);
getIf("hoistWorkingLevel",fileName,"GZJB",dictionaryList,jsonObject,map);
getIf("smallcarSideswayWorkingLevel",fileName,"GZJB",dictionaryList,jsonObject,map);
getIf("partName",fileName,"ZYLBJ",dictionaryList,jsonObject,map);
getIf("workType",fileName,"GZLX",dictionaryList,jsonObject,map);
getIf("controlMode",fileName,"KZFS",dictionaryList,jsonObject,map);
getIf("jackingType",fileName,"DSXS",dictionaryList,jsonObject,map);
getIf("explosionproofType",fileName,"FBXS",dictionaryList,jsonObject,map);
getIf("explosionproofGrade",fileName,"FBDJ",dictionaryList,jsonObject,map);
getIf("xgxlMediaType",fileName,"XGJZZL",dictionaryList,jsonObject,map);
getIf("designation",fileName,"KYSDBJMC",dictionaryList,jsonObject,map);
getIf("designation",fileName,"CCFJDCLLBJMC",dictionaryList,jsonObject,map);
getIf("isMonitor",fileName,"HAVE",dictionaryList,jsonObject,map);
if ("equList".indexOf(fileName) !=-1) {
String equList = EquipmentClassifityEnum.getName.get(jsonObject.getString(fileName));
map.put("fieldValue", equList);
}
}
public void getIf(String name,String fileName,String type,List<DataDictionary> dictionaryList,JSONObject jsonObject,Map<String, Object> map){
if (name.indexOf(fileName) != -1) {
List<DataDictionary> list = dictionaryList.stream().filter(t -> t.getType().equals(type) && t.getCode().equals(jsonObject.getString(fileName))).collect(Collectors.toList());
if (list.size()>0) {
map.put("fieldValue", list.get(0).getName());
}
}
}
}
package com.yeejoin.amos.boot.module.app.biz.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.bo.DepartmentBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.bo.RoleBo;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.app.biz.service.TzsAuthService;
import com.yeejoin.amos.component.feign.config.TokenOperation;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
import com.yeejoin.amos.feign.privilege.model.IdPasswordAuthModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import com.yeejoin.amos.feign.privilege.util.DesUtil;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* 特种设备权限服务实现类
*/
@Service
public class TzsAuthServiceImpl implements TzsAuthService {
@Autowired
RedisUtils redisUtils;
@Value("${cti.user.name}")
private String ctiUserName;
@Value("${cti.user.pwd}")
private String ctiUserPwd;
/**
* saveUserRedis设置过期时间
*/
@Value("${redis.cache.failure.time}")
private Long redisRegionTimeSecond;
@Autowired
private StartPlatformTokenService startPlatformTokenService;
@Override
public List<String> getUserRegionCode() {
List<String> regionList = new ArrayList<>();
AgencyUserModel me = Privilege.agencyUserClient.getme().getResult();
CompanyModel userCompany = me.getCompanys().get(0);
String regions = userCompany.getRegionSeq();
if(regions != null) {
String[] regionsId = regions.split(",");
for(String regionId:regionsId) {
RegionModel region = Systemctl.regionClient.getRegion(Long.valueOf(regionId)).getResult();
regionList.add(region.getRegionCode() + "");
}
}
return regionList;
}
@Override
public List<RegionModel> getUserReginTree() {
List<String> regionList = this.getUserRegionCode();
//AgencyUserModel me = Privilege.agencyUserClient.getme().getResult();
startPlatformTokenService.getToken();
List<RegionModel> tree = (List<RegionModel>) Systemctl.regionClient.queryForTree(null).getResult();
// 循环list 将List 封装为 省市区 SET
Set<String> city = new HashSet<>();
Set<String> district = new HashSet<>();
for(String regionCode : regionList) {
// 判断是否是某个县
String districtCode = regionCode.substring(4,6);
if("00".equals(districtCode)) { // 为市
city.add(regionCode);
} else { // 为区
district.add(regionCode);
}
}
// 判断市区是否存在区域码的市,如果存在则移除区
Iterator<String> disIt = district.iterator();
while(disIt.hasNext()) {
String regionCode = disIt.next();
String tempCity = regionCode.substring(0,4) + "00";
if(city.contains(tempCity)) {
disIt.remove();
}
}
// 将tree 转换为K-V形式便于处理
Map<Integer, RegionModel> tempMap = new HashMap<Integer, RegionModel>();
RegionModel start = tree.get(0); // 省
setMap(tempMap,start);
List<RegionModel> newTree = new ArrayList<RegionModel>();
List<RegionModel> newCity = new ArrayList<RegionModel>();
// 如果管理市 取得整个市的数据 如果管理某个县 取得某市某县数据
Map<String, RegionModel> tempCityMap = new HashMap<String, RegionModel>();
for(String regionCode : district) {
// 先拿市 再封装新的城市
String cityCode = regionCode.substring(0,4) + "00";
RegionModel tempCity = tempCityMap.get(cityCode);
if(tempCity == null) {
List<RegionModel> tempDisList = new ArrayList<RegionModel>();
tempDisList.add(tempMap.get(Integer.parseInt(regionCode)));
tempCity = tempMap.get(Integer.parseInt(cityCode));
tempCity.setChildren(tempDisList);
tempCityMap.put(cityCode,tempCity);
} else {
List<RegionModel> tempDisList = (List<RegionModel>) tempCity.getChildren();
tempDisList.add(tempMap.get(Integer.parseInt(regionCode)));
}
}
for(String regionCode : city) {// 获取城市
newCity.add(tempMap.get(Integer.parseInt(regionCode)));
}
// 拼接城市
for(Map.Entry<String, RegionModel> entries : tempCityMap.entrySet()) {
newCity.add(entries.getValue());
}
//start.setChildren(newCity);
newTree.addAll(newCity);
return newTree;
}
private void setMap(Map<Integer, RegionModel> tempMap, RegionModel start) {
tempMap.put(start.getRegionCode(),start);
if(start.getChildren() != null) {
List<RegionModel> children = (List<RegionModel>) start.getChildren();
for (RegionModel temp : children) {
setMap(tempMap,temp);
}
}
}
private void loginCtiUser() {
String passwd = DesUtil.encode(ctiUserPwd, "qaz");
IdPasswordAuthModel loninData = new IdPasswordAuthModel();
loninData.setLoginId(ctiUserName);
loninData.setPassword(passwd);
FeignClientResult loginResult = Privilege.authClient.idpassword(loninData);
if(loginResult.getStatus() == 200) {
HashMap resultMap = (HashMap) loginResult.getResult();
redisUtils.set(RedisKey.CTI_USER_TOKEN, resultMap.get("token").toString(), redisRegionTimeSecond);
}
}
public void setRequestContext() {
// 需要登录后台账号
RequestContext.setAppKey("AMOS_STUDIO");
RequestContext.setProduct("AMOS_STUDIO_WEB");
synchronized (TzsAuthServiceImpl.class) {
if (redisUtils.hasKey(RedisKey.CTI_USER_TOKEN)) {
// 验证token
boolean validToken = TokenOperation.refresh(redisUtils.get(RedisKey.CTI_USER_TOKEN).toString());
// 登陆
if (!validToken) {
this.loginCtiUser();
}
} else { // 登陆
this.loginCtiUser();
}
}
String ctiToken = redisUtils.get(RedisKey.CTI_USER_TOKEN).toString();
RequestContext.setToken(ctiToken);
try {
FeignClientResult<AgencyUserModel> agencyUserModel = Privilege.agencyUserClient.queryByUserName(ctiUserName);
AgencyUserModel userModel = agencyUserModel.getResult();
RequestContext.setExeUserId(userModel.getUserId());
saveUserRedis(userModel, ctiToken);
} catch (Exception e) {
//删除失效token缓存
throw new RuntimeException(e.getMessage());
}
}
private void saveUserRedis(AgencyUserModel user, String token) {
String authToken = RedisKey.buildReginKey(user.getUserId(), token);
if (redisUtils.hasKey(authToken)) {
return;
}
CompanyBo company = new CompanyBo();
DepartmentBo department = new DepartmentBo();
RoleBo role = new RoleBo();
CompanyModel companyM = user.getCompanys() != null ? user.getCompanys().get(0) : null ;
Bean.copyExistPropertis(companyM, company);
Map<Long, List<DepartmentModel>> mapDepartments = user.getCompanyDepartments();
DepartmentModel departmentM = companyM != null ? mapDepartments.get(companyM.getSequenceNbr()).get(0) : null ;
Bean.copyExistPropertis(departmentM, department);
Map<Long, List<RoleModel>> roles = user.getOrgRoles();
Long sequenceNbr;
if (departmentM == null) {
sequenceNbr = null;
} else {
sequenceNbr = departmentM.getSequenceNbr();
}
RoleModel roleM = null;
if (sequenceNbr == null) {
roleM = companyM != null ?roles.get(companyM.getSequenceNbr()).get(0) : null;
} else {
roleM = roles.get(sequenceNbr).get(0);
}
Bean.copyExistPropertis(roleM, role);
ReginParams reginParams = new ReginParams();
reginParams.setCompany(company);
reginParams.setRole(role);
reginParams.setDepartment(department);
reginParams.setUserModel(user);
redisUtils.set(authToken, JSONObject.toJSONString(reginParams), redisRegionTimeSecond);
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.app.biz.service.impl;
import com.yeejoin.amos.boot.module.app.api.dto.UseInfoModel;
import com.yeejoin.amos.boot.module.app.api.mapper.UseInfoMapper;
import com.yeejoin.amos.boot.module.app.api.entity.UseInfo;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.core.rdbms.service.BaseService;
/**
* 特种设备基本信息-使用信息 服务类
*
* @author duanwei
* @date 2022-07-19
*/
@Component
public class UseInfoService extends BaseService<UseInfoModel, UseInfo, UseInfoMapper> {
}
package com.yeejoin.amos.boot.module.app.biz.utils;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang.StringUtils;
/**
*
* <pre>
* DES加密解密工具
* 加密:DesUtils.encode("admin","1,2,3");
* 解密:DesUtils.decode("012C2C9BA925FAF8045B2FD9B02A2664","1,2,3");
* </pre>
*
* @author amos
* @version $Id: DesUtil.java, v 0.1 2018年10月13日 下午3:56:27 amos Exp $
*/
public class DesUtil {
private static DesCore desCore = new DesCore();
/**
* DES加密(secretKey代表3个key,用逗号分隔)
*/
public static String encode(String data, String secretKey) {
if (StringUtils.isBlank(data)){
return "";
}
String[] ks = StringUtils.split(secretKey, ",");
if (ks.length >= 3){
return desCore.strEnc(data, ks[0], ks[1], ks[2]);
}
return desCore.strEnc(data, secretKey, "", "");
}
/**
* DES解密(secretKey代表3个key,用逗号分隔)
*/
public static String decode(String data, String secretKey) {
if (StringUtils.isBlank(data)){
return "";
}
String[] ks = StringUtils.split(secretKey, ",");
if (ks.length >= 3){
return desCore.strDec(data, ks[0], ks[1], ks[2]);
}
return desCore.strDec(data, secretKey, "", "");
}
/**
*
* <pre>
* DES加密/解密
* @Copyright Copyright (c) 2006
* </pre>
*
* @author amos
* @version $Id: DesUtil.java, v 0.1 2018年10月13日 下午3:56:59 amos Exp $
*/
@SuppressWarnings({"rawtypes","unused","unchecked"})
static class DesCore {
/*
* encrypt the string to string made up of hex return the encrypted string
*/
public String strEnc(String data, String firstKey, String secondKey, String thirdKey) {
int leng = data.length();
String encData = "";
List firstKeyBt = null, secondKeyBt = null, thirdKeyBt = null;
int firstLength = 0, secondLength = 0, thirdLength = 0;
if (firstKey != null && firstKey != "") {
firstKeyBt = getKeyBytes(firstKey);
firstLength = firstKeyBt.size();
}
if (secondKey != null && secondKey != "") {
secondKeyBt = getKeyBytes(secondKey);
secondLength = secondKeyBt.size();
}
if (thirdKey != null && thirdKey != "") {
thirdKeyBt = getKeyBytes(thirdKey);
thirdLength = thirdKeyBt.size();
}
if (leng > 0) {
if (leng < 4) {
int[] bt = strToBt(data);
int[] encByte = null;
if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "" && thirdKey != null && thirdKey != "") {
int[] tempBt;
int x, y, z;
tempBt = bt;
for (x = 0; x < firstLength; x++) {
tempBt = enc(tempBt, (int[]) firstKeyBt.get(x));
}
for (y = 0; y < secondLength; y++) {
tempBt = enc(tempBt, (int[]) secondKeyBt.get(y));
}
for (z = 0; z < thirdLength; z++) {
tempBt = enc(tempBt, (int[]) thirdKeyBt.get(z));
}
encByte = tempBt;
} else {
if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "") {
int[] tempBt;
int x, y;
tempBt = bt;
for (x = 0; x < firstLength; x++) {
tempBt = enc(tempBt, (int[]) firstKeyBt.get(x));
}
for (y = 0; y < secondLength; y++) {
tempBt = enc(tempBt, (int[]) secondKeyBt.get(y));
}
encByte = tempBt;
} else {
if (firstKey != null && firstKey != "") {
int[] tempBt;
int x = 0;
tempBt = bt;
for (x = 0; x < firstLength; x++) {
tempBt = enc(tempBt, (int[]) firstKeyBt.get(x));
}
encByte = tempBt;
}
}
}
encData = bt64ToHex(encByte);
} else {
int iterator = (leng / 4);
int remainder = leng % 4;
int i = 0;
for (i = 0; i < iterator; i++) {
String tempData = data.substring(i * 4 + 0, i * 4 + 4);
int[] tempByte = strToBt(tempData);
int[] encByte = null;
if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "" && thirdKey != null && thirdKey != "") {
int[] tempBt;
int x, y, z;
tempBt = tempByte;
for (x = 0; x < firstLength; x++) {
tempBt = enc(tempBt, (int[]) firstKeyBt.get(x));
}
for (y = 0; y < secondLength; y++) {
tempBt = enc(tempBt, (int[]) secondKeyBt.get(y));
}
for (z = 0; z < thirdLength; z++) {
tempBt = enc(tempBt, (int[]) thirdKeyBt.get(z));
}
encByte = tempBt;
} else {
if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "") {
int[] tempBt;
int x, y;
tempBt = tempByte;
for (x = 0; x < firstLength; x++) {
tempBt = enc(tempBt, (int[]) firstKeyBt.get(x));
}
for (y = 0; y < secondLength; y++) {
tempBt = enc(tempBt, (int[]) secondKeyBt.get(y));
}
encByte = tempBt;
} else {
if (firstKey != null && firstKey != "") {
int[] tempBt;
int x;
tempBt = tempByte;
for (x = 0; x < firstLength; x++) {
tempBt = enc(tempBt, (int[]) firstKeyBt.get(x));
}
encByte = tempBt;
}
}
}
encData += bt64ToHex(encByte);
}
if (remainder > 0) {
String remainderData = data.substring(iterator * 4 + 0, leng);
int[] tempByte = strToBt(remainderData);
int[] encByte = null;
if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "" && thirdKey != null && thirdKey != "") {
int[] tempBt;
int x, y, z;
tempBt = tempByte;
for (x = 0; x < firstLength; x++) {
tempBt = enc(tempBt, (int[]) firstKeyBt.get(x));
}
for (y = 0; y < secondLength; y++) {
tempBt = enc(tempBt, (int[]) secondKeyBt.get(y));
}
for (z = 0; z < thirdLength; z++) {
tempBt = enc(tempBt, (int[]) thirdKeyBt.get(z));
}
encByte = tempBt;
} else {
if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "") {
int[] tempBt;
int x, y;
tempBt = tempByte;
for (x = 0; x < firstLength; x++) {
tempBt = enc(tempBt, (int[]) firstKeyBt.get(x));
}
for (y = 0; y < secondLength; y++) {
tempBt = enc(tempBt, (int[]) secondKeyBt.get(y));
}
encByte = tempBt;
} else {
if (firstKey != null && firstKey != "") {
int[] tempBt;
int x;
tempBt = tempByte;
for (x = 0; x < firstLength; x++) {
tempBt = enc(tempBt, (int[]) firstKeyBt.get(x));
}
encByte = tempBt;
}
}
}
encData += bt64ToHex(encByte);
}
}
}
return encData;
}
/*
* decrypt the encrypted string to the original string
*
* return the original string
*/
public String strDec(String data, String firstKey, String secondKey, String thirdKey) {
int leng = data.length();
String decStr = "";
List firstKeyBt = null, secondKeyBt = null, thirdKeyBt = null;
int firstLength = 0, secondLength = 0, thirdLength = 0;
if (firstKey != null && firstKey != "") {
firstKeyBt = getKeyBytes(firstKey);
firstLength = firstKeyBt.size();
}
if (secondKey != null && secondKey != "") {
secondKeyBt = getKeyBytes(secondKey);
secondLength = secondKeyBt.size();
}
if (thirdKey != null && thirdKey != "") {
thirdKeyBt = getKeyBytes(thirdKey);
thirdLength = thirdKeyBt.size();
}
int iterator = leng / 16;
int i = 0;
for (i = 0; i < iterator; i++) {
String tempData = data.substring(i * 16 + 0, i * 16 + 16);
String strByte = hexToBt64(tempData);
int[] intByte = new int[64];
int j = 0;
for (j = 0; j < 64; j++) {
intByte[j] = Integer.parseInt(strByte.substring(j, j + 1));
}
int[] decByte = null;
if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "" && thirdKey != null && thirdKey != "") {
int[] tempBt;
int x, y, z;
tempBt = intByte;
for (x = thirdLength - 1; x >= 0; x--) {
tempBt = dec(tempBt, (int[]) thirdKeyBt.get(x));
}
for (y = secondLength - 1; y >= 0; y--) {
tempBt = dec(tempBt, (int[]) secondKeyBt.get(y));
}
for (z = firstLength - 1; z >= 0; z--) {
tempBt = dec(tempBt, (int[]) firstKeyBt.get(z));
}
decByte = tempBt;
} else {
if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "") {
int[] tempBt;
int x, y, z;
tempBt = intByte;
for (x = secondLength - 1; x >= 0; x--) {
tempBt = dec(tempBt, (int[]) secondKeyBt.get(x));
}
for (y = firstLength - 1; y >= 0; y--) {
tempBt = dec(tempBt, (int[]) firstKeyBt.get(y));
}
decByte = tempBt;
} else {
if (firstKey != null && firstKey != "") {
int[] tempBt;
int x, y, z;
tempBt = intByte;
for (x = firstLength - 1; x >= 0; x--) {
tempBt = dec(tempBt, (int[]) firstKeyBt.get(x));
}
decByte = tempBt;
}
}
}
decStr += byteToString(decByte);
}
return decStr;
}
/*
* chang the string into the bit array
*
* return bit array(it's length % 64 = 0)
*/
public List getKeyBytes(String key) {
List keyBytes = new ArrayList();
int leng = key.length();
int iterator = (leng / 4);
int remainder = leng % 4;
int i = 0;
for (i = 0; i < iterator; i++) {
keyBytes.add(i, strToBt(key.substring(i * 4 + 0, i * 4 + 4)));
}
if (remainder > 0) {
// keyBytes[i] = strToBt(key.substring(i*4+0,leng));
keyBytes.add(i, strToBt(key.substring(i * 4 + 0, leng)));
}
return keyBytes;
}
/*
* chang the string(it's length <= 4) into the bit array
*
* return bit array(it's length = 64)
*/
public int[] strToBt(String str) {
int leng = str.length();
int[] bt = new int[64];
if (leng < 4) {
int i = 0, j = 0, p = 0, q = 0;
for (i = 0; i < leng; i++) {
int k = str.charAt(i);
for (j = 0; j < 16; j++) {
int pow = 1, m = 0;
for (m = 15; m > j; m--) {
pow *= 2;
}
// bt.set(16*i+j,""+(k/pow)%2));
bt[16 * i + j] = (k / pow) % 2;
}
}
for (p = leng; p < 4; p++) {
int k = 0;
for (q = 0; q < 16; q++) {
int pow = 1, m = 0;
for (m = 15; m > q; m--) {
pow *= 2;
}
// bt[16*p+q]=parseInt(k/pow)%2;
// bt.add(16*p+q,""+((k/pow)%2));
bt[16 * p + q] = (k / pow) % 2;
}
}
} else {
for (int i = 0; i < 4; i++) {
int k = str.charAt(i);
for (int j = 0; j < 16; j++) {
int pow = 1;
for (int m = 15; m > j; m--) {
pow *= 2;
}
// bt[16*i+j]=parseInt(k/pow)%2;
// bt.add(16*i+j,""+((k/pow)%2));
bt[16 * i + j] = (k / pow) % 2;
}
}
}
return bt;
}
/*
* chang the bit(it's length = 4) into the hex
*
* return hex
*/
public String bt4ToHex(String binary) {
String hex = "";
if (binary.equalsIgnoreCase("0000")) {
hex = "0";
} else if (binary.equalsIgnoreCase("0001")) {
hex = "1";
} else if (binary.equalsIgnoreCase("0010")) {
hex = "2";
} else if (binary.equalsIgnoreCase("0011")) {
hex = "3";
} else if (binary.equalsIgnoreCase("0100")) {
hex = "4";
} else if (binary.equalsIgnoreCase("0101")) {
hex = "5";
} else if (binary.equalsIgnoreCase("0110")) {
hex = "6";
} else if (binary.equalsIgnoreCase("0111")) {
hex = "7";
} else if (binary.equalsIgnoreCase("1000")) {
hex = "8";
} else if (binary.equalsIgnoreCase("1001")) {
hex = "9";
} else if (binary.equalsIgnoreCase("1010")) {
hex = "A";
} else if (binary.equalsIgnoreCase("1011")) {
hex = "B";
} else if (binary.equalsIgnoreCase("1100")) {
hex = "C";
} else if (binary.equalsIgnoreCase("1101")) {
hex = "D";
} else if (binary.equalsIgnoreCase("1110")) {
hex = "E";
} else if (binary.equalsIgnoreCase("1111")) {
hex = "F";
}
return hex;
}
/*
* chang the hex into the bit(it's length = 4)
*
* return the bit(it's length = 4)
*/
public String hexToBt4(String hex) {
String binary = "";
if (hex.equalsIgnoreCase("0")) {
binary = "0000";
} else if (hex.equalsIgnoreCase("1")) {
binary = "0001";
}
if (hex.equalsIgnoreCase("2")) {
binary = "0010";
}
if (hex.equalsIgnoreCase("3")) {
binary = "0011";
}
if (hex.equalsIgnoreCase("4")) {
binary = "0100";
}
if (hex.equalsIgnoreCase("5")) {
binary = "0101";
}
if (hex.equalsIgnoreCase("6")) {
binary = "0110";
}
if (hex.equalsIgnoreCase("7")) {
binary = "0111";
}
if (hex.equalsIgnoreCase("8")) {
binary = "1000";
}
if (hex.equalsIgnoreCase("9")) {
binary = "1001";
}
if (hex.equalsIgnoreCase("A")) {
binary = "1010";
}
if (hex.equalsIgnoreCase("B")) {
binary = "1011";
}
if (hex.equalsIgnoreCase("C")) {
binary = "1100";
}
if (hex.equalsIgnoreCase("D")) {
binary = "1101";
}
if (hex.equalsIgnoreCase("E")) {
binary = "1110";
}
if (hex.equalsIgnoreCase("F")) {
binary = "1111";
}
return binary;
}
/*
* chang the bit(it's length = 64) into the string
*
* return string
*/
public String byteToString(int[] byteData) {
String str = "";
for (int i = 0; i < 4; i++) {
int count = 0;
for (int j = 0; j < 16; j++) {
int pow = 1;
for (int m = 15; m > j; m--) {
pow *= 2;
}
count += byteData[16 * i + j] * pow;
}
if (count != 0) {
str += "" + (char) (count);
}
}
return str;
}
public String bt64ToHex(int[] byteData) {
String hex = "";
for (int i = 0; i < 16; i++) {
String bt = "";
for (int j = 0; j < 4; j++) {
bt += byteData[i * 4 + j];
}
hex += bt4ToHex(bt);
}
return hex;
}
public String hexToBt64(String hex) {
String binary = "";
for (int i = 0; i < 16; i++) {
binary += hexToBt4(hex.substring(i, i + 1));
}
return binary;
}
/*
* the 64 bit des core arithmetic
*/
public int[] enc(int[] dataByte, int[] keyByte) {
int[][] keys = generateKeys(keyByte);
int[] ipByte = initPermute(dataByte);
int[] ipLeft = new int[32];
int[] ipRight = new int[32];
int[] tempLeft = new int[32];
int i = 0, j = 0, k = 0, m = 0, n = 0;
for (k = 0; k < 32; k++) {
ipLeft[k] = ipByte[k];
ipRight[k] = ipByte[32 + k];
}
for (i = 0; i < 16; i++) {
for (j = 0; j < 32; j++) {
tempLeft[j] = ipLeft[j];
ipLeft[j] = ipRight[j];
}
int[] key = new int[48];
for (m = 0; m < 48; m++) {
key[m] = keys[i][m];
}
int[] tempRight = xor(pPermute(sBoxPermute(xor(expandPermute(ipRight), key))), tempLeft);
for (n = 0; n < 32; n++) {
ipRight[n] = tempRight[n];
}
}
int[] finalData = new int[64];
for (i = 0; i < 32; i++) {
finalData[i] = ipRight[i];
finalData[32 + i] = ipLeft[i];
}
return finallyPermute(finalData);
}
public int[] dec(int[] dataByte, int[] keyByte) {
int[][] keys = generateKeys(keyByte);
int[] ipByte = initPermute(dataByte);
int[] ipLeft = new int[32];
int[] ipRight = new int[32];
int[] tempLeft = new int[32];
int i = 0, j = 0, k = 0, m = 0, n = 0;
for (k = 0; k < 32; k++) {
ipLeft[k] = ipByte[k];
ipRight[k] = ipByte[32 + k];
}
for (i = 15; i >= 0; i--) {
for (j = 0; j < 32; j++) {
tempLeft[j] = ipLeft[j];
ipLeft[j] = ipRight[j];
}
int[] key = new int[48];
for (m = 0; m < 48; m++) {
key[m] = keys[i][m];
}
int[] tempRight = xor(pPermute(sBoxPermute(xor(expandPermute(ipRight), key))), tempLeft);
for (n = 0; n < 32; n++) {
ipRight[n] = tempRight[n];
}
}
int[] finalData = new int[64];
for (i = 0; i < 32; i++) {
finalData[i] = ipRight[i];
finalData[32 + i] = ipLeft[i];
}
return finallyPermute(finalData);
}
public int[] initPermute(int[] originalData) {
int[] ipByte = new int[64];
int i = 0, m = 1, n = 0, j, k;
for (i = 0, m = 1, n = 0; i < 4; i++, m += 2, n += 2) {
for (j = 7, k = 0; j >= 0; j--, k++) {
ipByte[i * 8 + k] = originalData[j * 8 + m];
ipByte[i * 8 + k + 32] = originalData[j * 8 + n];
}
}
return ipByte;
}
public int[] expandPermute(int[] rightData) {
int[] epByte = new int[48];
int i, j;
for (i = 0; i < 8; i++) {
if (i == 0) {
epByte[i * 6 + 0] = rightData[31];
} else {
epByte[i * 6 + 0] = rightData[i * 4 - 1];
}
epByte[i * 6 + 1] = rightData[i * 4 + 0];
epByte[i * 6 + 2] = rightData[i * 4 + 1];
epByte[i * 6 + 3] = rightData[i * 4 + 2];
epByte[i * 6 + 4] = rightData[i * 4 + 3];
if (i == 7) {
epByte[i * 6 + 5] = rightData[0];
} else {
epByte[i * 6 + 5] = rightData[i * 4 + 4];
}
}
return epByte;
}
public int[] xor(int[] byteOne, int[] byteTwo) {
// var xorByte = new Array(byteOne.length);
// for(int i = 0;i < byteOne.length; i ++){
// xorByte[i] = byteOne[i] ^ byteTwo[i];
// }
// return xorByte;
int[] xorByte = new int[byteOne.length];
for (int i = 0; i < byteOne.length; i++) {
xorByte[i] = byteOne[i] ^ byteTwo[i];
}
return xorByte;
}
public int[] sBoxPermute(int[] expandByte) {
// var sBoxByte = new Array(32);
int[] sBoxByte = new int[32];
String binary = "";
int[][] s1 = { { 14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7 }, { 0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8 },
{ 4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0 }, { 15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13 } };
/* Table - s2 */
int[][] s2 = { { 15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10 }, { 3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5 },
{ 0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15 }, { 13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9 } };
/* Table - s3 */
int[][] s3 = { { 10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8 }, { 13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1 },
{ 13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7 }, { 1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12 } };
/* Table - s4 */
int[][] s4 = { { 7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15 }, { 13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9 },
{ 10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4 }, { 3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14 } };
/* Table - s5 */
int[][] s5 = { { 2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9 }, { 14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6 },
{ 4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14 }, { 11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3 } };
/* Table - s6 */
int[][] s6 = { { 12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11 }, { 10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8 },
{ 9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6 }, { 4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13 } };
/* Table - s7 */
int[][] s7 = { { 4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1 }, { 13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6 },
{ 1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2 }, { 6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12 } };
/* Table - s8 */
int[][] s8 = { { 13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7 }, { 1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2 },
{ 7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8 }, { 2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11 } };
for (int m = 0; m < 8; m++) {
int i = 0, j = 0;
i = expandByte[m * 6 + 0] * 2 + expandByte[m * 6 + 5];
j = expandByte[m * 6 + 1] * 2 * 2 * 2 + expandByte[m * 6 + 2] * 2 * 2 + expandByte[m * 6 + 3] * 2 + expandByte[m * 6 + 4];
switch (m) {
case 0:
binary = getBoxBinary(s1[i][j]);
break;
case 1:
binary = getBoxBinary(s2[i][j]);
break;
case 2:
binary = getBoxBinary(s3[i][j]);
break;
case 3:
binary = getBoxBinary(s4[i][j]);
break;
case 4:
binary = getBoxBinary(s5[i][j]);
break;
case 5:
binary = getBoxBinary(s6[i][j]);
break;
case 6:
binary = getBoxBinary(s7[i][j]);
break;
case 7:
binary = getBoxBinary(s8[i][j]);
break;
}
sBoxByte[m * 4 + 0] = Integer.parseInt(binary.substring(0, 1));
sBoxByte[m * 4 + 1] = Integer.parseInt(binary.substring(1, 2));
sBoxByte[m * 4 + 2] = Integer.parseInt(binary.substring(2, 3));
sBoxByte[m * 4 + 3] = Integer.parseInt(binary.substring(3, 4));
}
return sBoxByte;
}
public int[] pPermute(int[] sBoxByte) {
int[] pBoxPermute = new int[32];
pBoxPermute[0] = sBoxByte[15];
pBoxPermute[1] = sBoxByte[6];
pBoxPermute[2] = sBoxByte[19];
pBoxPermute[3] = sBoxByte[20];
pBoxPermute[4] = sBoxByte[28];
pBoxPermute[5] = sBoxByte[11];
pBoxPermute[6] = sBoxByte[27];
pBoxPermute[7] = sBoxByte[16];
pBoxPermute[8] = sBoxByte[0];
pBoxPermute[9] = sBoxByte[14];
pBoxPermute[10] = sBoxByte[22];
pBoxPermute[11] = sBoxByte[25];
pBoxPermute[12] = sBoxByte[4];
pBoxPermute[13] = sBoxByte[17];
pBoxPermute[14] = sBoxByte[30];
pBoxPermute[15] = sBoxByte[9];
pBoxPermute[16] = sBoxByte[1];
pBoxPermute[17] = sBoxByte[7];
pBoxPermute[18] = sBoxByte[23];
pBoxPermute[19] = sBoxByte[13];
pBoxPermute[20] = sBoxByte[31];
pBoxPermute[21] = sBoxByte[26];
pBoxPermute[22] = sBoxByte[2];
pBoxPermute[23] = sBoxByte[8];
pBoxPermute[24] = sBoxByte[18];
pBoxPermute[25] = sBoxByte[12];
pBoxPermute[26] = sBoxByte[29];
pBoxPermute[27] = sBoxByte[5];
pBoxPermute[28] = sBoxByte[21];
pBoxPermute[29] = sBoxByte[10];
pBoxPermute[30] = sBoxByte[3];
pBoxPermute[31] = sBoxByte[24];
return pBoxPermute;
}
public int[] finallyPermute(int[] endByte) {
int[] fpByte = new int[64];
fpByte[0] = endByte[39];
fpByte[1] = endByte[7];
fpByte[2] = endByte[47];
fpByte[3] = endByte[15];
fpByte[4] = endByte[55];
fpByte[5] = endByte[23];
fpByte[6] = endByte[63];
fpByte[7] = endByte[31];
fpByte[8] = endByte[38];
fpByte[9] = endByte[6];
fpByte[10] = endByte[46];
fpByte[11] = endByte[14];
fpByte[12] = endByte[54];
fpByte[13] = endByte[22];
fpByte[14] = endByte[62];
fpByte[15] = endByte[30];
fpByte[16] = endByte[37];
fpByte[17] = endByte[5];
fpByte[18] = endByte[45];
fpByte[19] = endByte[13];
fpByte[20] = endByte[53];
fpByte[21] = endByte[21];
fpByte[22] = endByte[61];
fpByte[23] = endByte[29];
fpByte[24] = endByte[36];
fpByte[25] = endByte[4];
fpByte[26] = endByte[44];
fpByte[27] = endByte[12];
fpByte[28] = endByte[52];
fpByte[29] = endByte[20];
fpByte[30] = endByte[60];
fpByte[31] = endByte[28];
fpByte[32] = endByte[35];
fpByte[33] = endByte[3];
fpByte[34] = endByte[43];
fpByte[35] = endByte[11];
fpByte[36] = endByte[51];
fpByte[37] = endByte[19];
fpByte[38] = endByte[59];
fpByte[39] = endByte[27];
fpByte[40] = endByte[34];
fpByte[41] = endByte[2];
fpByte[42] = endByte[42];
fpByte[43] = endByte[10];
fpByte[44] = endByte[50];
fpByte[45] = endByte[18];
fpByte[46] = endByte[58];
fpByte[47] = endByte[26];
fpByte[48] = endByte[33];
fpByte[49] = endByte[1];
fpByte[50] = endByte[41];
fpByte[51] = endByte[9];
fpByte[52] = endByte[49];
fpByte[53] = endByte[17];
fpByte[54] = endByte[57];
fpByte[55] = endByte[25];
fpByte[56] = endByte[32];
fpByte[57] = endByte[0];
fpByte[58] = endByte[40];
fpByte[59] = endByte[8];
fpByte[60] = endByte[48];
fpByte[61] = endByte[16];
fpByte[62] = endByte[56];
fpByte[63] = endByte[24];
return fpByte;
}
public String getBoxBinary(int i) {
String binary = "";
switch (i) {
case 0:
binary = "0000";
break;
case 1:
binary = "0001";
break;
case 2:
binary = "0010";
break;
case 3:
binary = "0011";
break;
case 4:
binary = "0100";
break;
case 5:
binary = "0101";
break;
case 6:
binary = "0110";
break;
case 7:
binary = "0111";
break;
case 8:
binary = "1000";
break;
case 9:
binary = "1001";
break;
case 10:
binary = "1010";
break;
case 11:
binary = "1011";
break;
case 12:
binary = "1100";
break;
case 13:
binary = "1101";
break;
case 14:
binary = "1110";
break;
case 15:
binary = "1111";
break;
}
return binary;
}
/*
* generate 16 keys for xor
*/
public int[][] generateKeys(int[] keyByte) {
int[] key = new int[56];
int[][] keys = new int[16][48];
// keys[ 0] = new Array();
// keys[ 1] = new Array();
// keys[ 2] = new Array();
// keys[ 3] = new Array();
// keys[ 4] = new Array();
// keys[ 5] = new Array();
// keys[ 6] = new Array();
// keys[ 7] = new Array();
// keys[ 8] = new Array();
// keys[ 9] = new Array();
// keys[10] = new Array();
// keys[11] = new Array();
// keys[12] = new Array();
// keys[13] = new Array();
// keys[14] = new Array();
// keys[15] = new Array();
int[] loop = new int[] { 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1 };
for (int i = 0; i < 7; i++) {
for (int j = 0, k = 7; j < 8; j++, k--) {
key[i * 8 + j] = keyByte[8 * k + i];
}
}
int i = 0;
for (i = 0; i < 16; i++) {
int tempLeft = 0;
int tempRight = 0;
for (int j = 0; j < loop[i]; j++) {
tempLeft = key[0];
tempRight = key[28];
for (int k = 0; k < 27; k++) {
key[k] = key[k + 1];
key[28 + k] = key[29 + k];
}
key[27] = tempLeft;
key[55] = tempRight;
}
// var tempKey = new Array(48);
int[] tempKey = new int[48];
tempKey[0] = key[13];
tempKey[1] = key[16];
tempKey[2] = key[10];
tempKey[3] = key[23];
tempKey[4] = key[0];
tempKey[5] = key[4];
tempKey[6] = key[2];
tempKey[7] = key[27];
tempKey[8] = key[14];
tempKey[9] = key[5];
tempKey[10] = key[20];
tempKey[11] = key[9];
tempKey[12] = key[22];
tempKey[13] = key[18];
tempKey[14] = key[11];
tempKey[15] = key[3];
tempKey[16] = key[25];
tempKey[17] = key[7];
tempKey[18] = key[15];
tempKey[19] = key[6];
tempKey[20] = key[26];
tempKey[21] = key[19];
tempKey[22] = key[12];
tempKey[23] = key[1];
tempKey[24] = key[40];
tempKey[25] = key[51];
tempKey[26] = key[30];
tempKey[27] = key[36];
tempKey[28] = key[46];
tempKey[29] = key[54];
tempKey[30] = key[29];
tempKey[31] = key[39];
tempKey[32] = key[50];
tempKey[33] = key[44];
tempKey[34] = key[32];
tempKey[35] = key[47];
tempKey[36] = key[43];
tempKey[37] = key[48];
tempKey[38] = key[38];
tempKey[39] = key[55];
tempKey[40] = key[33];
tempKey[41] = key[52];
tempKey[42] = key[45];
tempKey[43] = key[41];
tempKey[44] = key[49];
tempKey[45] = key[35];
tempKey[46] = key[28];
tempKey[47] = key[31];
int m;
switch (i) {
case 0:
for (m = 0; m < 48; m++) {
keys[0][m] = tempKey[m];
}
break;
case 1:
for (m = 0; m < 48; m++) {
keys[1][m] = tempKey[m];
}
break;
case 2:
for (m = 0; m < 48; m++) {
keys[2][m] = tempKey[m];
}
break;
case 3:
for (m = 0; m < 48; m++) {
keys[3][m] = tempKey[m];
}
break;
case 4:
for (m = 0; m < 48; m++) {
keys[4][m] = tempKey[m];
}
break;
case 5:
for (m = 0; m < 48; m++) {
keys[5][m] = tempKey[m];
}
break;
case 6:
for (m = 0; m < 48; m++) {
keys[6][m] = tempKey[m];
}
break;
case 7:
for (m = 0; m < 48; m++) {
keys[7][m] = tempKey[m];
}
break;
case 8:
for (m = 0; m < 48; m++) {
keys[8][m] = tempKey[m];
}
break;
case 9:
for (m = 0; m < 48; m++) {
keys[9][m] = tempKey[m];
}
break;
case 10:
for (m = 0; m < 48; m++) {
keys[10][m] = tempKey[m];
}
break;
case 11:
for (m = 0; m < 48; m++) {
keys[11][m] = tempKey[m];
}
break;
case 12:
for (m = 0; m < 48; m++) {
keys[12][m] = tempKey[m];
}
break;
case 13:
for (m = 0; m < 48; m++) {
keys[13][m] = tempKey[m];
}
break;
case 14:
for (m = 0; m < 48; m++) {
keys[14][m] = tempKey[m];
}
break;
case 15:
for (m = 0; m < 48; m++) {
keys[15][m] = tempKey[m];
}
break;
}
}
return keys;
}
}
}
package com.yeejoin.amos.boot.module.app.biz.utils;
import org.apache.commons.io.IOUtils;
import org.apache.http.Header;
import org.apache.http.HeaderElement;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.conn.ssl.TrustStrategy;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.entity.mime.HttpMultipartMode;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.ssl.SSLContextBuilder;
import org.apache.http.util.EntityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.multipart.MultipartFile;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
import java.security.GeneralSecurityException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class HttpUtils {
private static PoolingHttpClientConnectionManager connMgr;
private static RequestConfig requestConfig;
private static final int MAX_TIMEOUT = 50000;
private static final Logger logger = LoggerFactory.getLogger(HttpUtils.class);
static {
// 设置连接池
connMgr = new PoolingHttpClientConnectionManager();
// 设置连接池大小
connMgr.setMaxTotal(100);
connMgr.setDefaultMaxPerRoute(connMgr.getMaxTotal());
// Validate connections after 1 sec of inactivity
connMgr.setValidateAfterInactivity(5000);
RequestConfig.Builder configBuilder = RequestConfig.custom();
// 设置连接超时
configBuilder.setConnectTimeout(MAX_TIMEOUT);
// 设置读取超时
configBuilder.setSocketTimeout(MAX_TIMEOUT);
// 设置从连接池获取连接实例的超时
configBuilder.setConnectionRequestTimeout(MAX_TIMEOUT);
requestConfig = configBuilder.build();
}
/**
* 发送 GET 请求(HTTP),不带输入数据
*
* @param url
* @return
*/
public static String doGet(String url) {
return doGet(url, new HashMap<String, Object>());
}
/**
* 发送 GET 请求(HTTP),K-V形式
*
* @param url
* @param params
* @return
*/
public static String doGet(String url, Map<String, Object> params) {
String apiUrl = url;
StringBuffer param = new StringBuffer();
int i = 0;
for (String key : params.keySet()) {
if (i == 0)
param.append("?");
else
param.append("&");
param.append(key).append("=").append(params.get(key));
i++;
}
apiUrl += param;
String result = null;
HttpClient httpClient = null;
if (apiUrl.startsWith("https")) {
httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory())
.setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build();
} else {
httpClient = HttpClients.createDefault();
}
try {
HttpGet httpGet = new HttpGet(apiUrl);
HttpResponse response = httpClient.execute(httpGet);
HttpEntity entity = response.getEntity();
if (entity != null) {
InputStream instream = entity.getContent();
result = IOUtils.toString(instream, "UTF-8");
}
} catch (IOException e) {
e.printStackTrace();
}
return result;
}
/**
* 发送 POST 请求(HTTP),不带输入数据
*
* @param apiUrl
* @return
*/
public static String doPost(String apiUrl) {
return doPost(apiUrl, new HashMap<String, Object>());
}
/**
* 发送 POST 请求,K-V形式
*
* @param apiUrl
* API接口URL
* @param params
* 参数map
* @return
*/
public static String doPost(String apiUrl, Map<String, Object> params) {
CloseableHttpClient httpClient = null;
if (apiUrl.startsWith("https")) {
httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory())
.setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build();
} else {
httpClient = HttpClients.createDefault();
}
String httpStr = null;
HttpPost httpPost = new HttpPost(apiUrl);
CloseableHttpResponse response = null;
try {
httpPost.setConfig(requestConfig);
List<NameValuePair> pairList = new ArrayList<>(params.size());
for (Map.Entry<String, Object> entry : params.entrySet()) {
NameValuePair pair = new BasicNameValuePair(entry.getKey(), entry.getValue()!=null?entry.getValue().toString():"");
pairList.add(pair);
}
httpPost.setEntity(new UrlEncodedFormEntity(pairList, Charset.forName("UTF-8")));
response = httpClient.execute(httpPost);
HttpEntity entity = response.getEntity();
httpStr = EntityUtils.toString(entity, "UTF-8");
} catch (IOException e) {
e.printStackTrace();
} finally {
if (response != null) {
try {
EntityUtils.consume(response.getEntity());
} catch (IOException e) {
e.printStackTrace();
}
}
}
return httpStr;
}
/**
* 发送 POST 请求,K-V形式
*
* @param apiUrl
* API接口URL
* @param params
* 参数map
* @return
*/
public static String doPostWithHeader(String apiUrl, Map<String, Object> params, Map<String, String> headerMap) {
CloseableHttpClient httpClient = null;
if (apiUrl.startsWith("https")) {
httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory())
.setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build();
} else {
httpClient = HttpClients.createDefault();
}
String httpStr = null;
HttpPost httpPost = new HttpPost(apiUrl);
for (Map.Entry<String, String> entry : headerMap.entrySet()) {
httpPost.setHeader(entry.getKey(), entry.getValue());
}
CloseableHttpResponse response = null;
try {
httpPost.setConfig(requestConfig);
List<NameValuePair> pairList = new ArrayList<>(params.size());
for (Map.Entry<String, Object> entry : params.entrySet()) {
NameValuePair pair = new BasicNameValuePair(entry.getKey(), entry.getValue()!=null?entry.getValue().toString():"");
pairList.add(pair);
}
httpPost.setEntity(new UrlEncodedFormEntity(pairList, Charset.forName("UTF-8")));
response = httpClient.execute(httpPost);
HttpEntity entity = response.getEntity();
httpStr = EntityUtils.toString(entity, "UTF-8");
} catch (IOException e) {
e.printStackTrace();
} finally {
if (response != null) {
try {
EntityUtils.consume(response.getEntity());
} catch (IOException e) {
e.printStackTrace();
}
}
}
return httpStr;
}
/**
* 发送 POST 请求,JSON形式,接收端需要支持json形式,否则取不到数据
*
* @param apiUrl
* @param json
* json对象
* @return
*/
public static String doPost(String apiUrl, String json) {
CloseableHttpClient httpClient = null;
if (apiUrl.startsWith("https")) {
httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory()).setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build();
} else {
httpClient = HttpClients.createDefault();
}
String httpStr = null;
HttpPost httpPost = new HttpPost(apiUrl);
CloseableHttpResponse response = null;
try {
httpPost.setConfig(requestConfig);
StringEntity stringEntity = new StringEntity(json, "UTF-8");// 解决中文乱码问题
stringEntity.setContentEncoding("UTF-8");
stringEntity.setContentType("application/json");
httpPost.setEntity(stringEntity);
response = httpClient.execute(httpPost);
HttpEntity entity = response.getEntity();
httpStr = EntityUtils.toString(entity, "UTF-8");
} catch (IOException e) {
e.printStackTrace();
} finally {
if (response != null) {
try {
EntityUtils.consume(response.getEntity());
} catch (IOException e) {
e.printStackTrace();
}
}
}
return httpStr;
}
/**
* 发送 POST 请求,JSON形式,接收端需要支持json形式,否则取不到数据
*
* @param apiUrl
* @param json
* json对象
* @return
*/
public static String doPostWithHeader(String apiUrl, String json, Map<String, String> headerMap) {
CloseableHttpClient httpClient = null;
if (apiUrl.startsWith("https")) {
httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory()).setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build();
} else {
httpClient = HttpClients.createDefault();
}
String httpStr = null;
HttpPost httpPost = new HttpPost(apiUrl);
for (Map.Entry<String, String> entry : headerMap.entrySet()) {
httpPost.setHeader(entry.getKey(), entry.getValue());
}
CloseableHttpResponse response = null;
try {
httpPost.setConfig(requestConfig);
StringEntity stringEntity = new StringEntity(json, "UTF-8");// 解决中文乱码问题
stringEntity.setContentEncoding("UTF-8");
stringEntity.setContentType("application/json");
httpPost.setEntity(stringEntity);
response = httpClient.execute(httpPost);
HttpEntity entity = response.getEntity();
httpStr = EntityUtils.toString(entity, "UTF-8");
} catch (IOException e) {
e.printStackTrace();
} finally {
if (response != null) {
try {
EntityUtils.consume(response.getEntity());
} catch (IOException e) {
e.printStackTrace();
}
}
}
return httpStr;
}
/**
* 发送post 请求并且获取下载字节流
* @param apiUrl
* @param json
* @param headerMap
* @return
*/
public static byte[] doPostWithHeaderDownload(String apiUrl, String json, Map<String, String> headerMap) {
InputStream inputStream = null;
CloseableHttpClient httpClient = null;
if (apiUrl.startsWith("https")) {
httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory()).setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build();
} else {
httpClient = HttpClients.createDefault();
}
String httpStr = null;
HttpPost httpPost = new HttpPost(apiUrl);
for (Map.Entry<String, String> entry : headerMap.entrySet()) {
httpPost.setHeader(entry.getKey(), entry.getValue());
}
CloseableHttpResponse response = null;
ByteArrayOutputStream swapStream = new ByteArrayOutputStream();
try {
httpPost.setConfig(requestConfig);
StringEntity stringEntity = new StringEntity(json, "UTF-8");// 解决中文乱码问题
stringEntity.setContentEncoding("UTF-8");
stringEntity.setContentType("application/json");
httpPost.setEntity(stringEntity);
response = httpClient.execute(httpPost);
HttpEntity entity = response.getEntity();
inputStream = entity.getContent();
byte[] buff = new byte[1024];
int rc = 0;
while ((rc = inputStream.read(buff, 0, buff.length)) > 0) {
swapStream.write(buff, 0, rc);
}
} catch (IOException e) {
e.printStackTrace();
} finally {
if (response != null) {
try {
EntityUtils.consume(response.getEntity());
} catch (IOException e) {
e.printStackTrace();
}
}
}
return swapStream.toByteArray();
}
/**
* 发送get请求并且获取下载字节流
* @param apiUrl
* @return
*/
public static Map<String, Object> doGetDownload(String apiUrl) {
Map<String, Object> result = new HashMap<>();
InputStream inputStream = null;
CloseableHttpClient httpClient = null;
if (apiUrl.startsWith("https")) {
httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory()).setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build();
} else {
httpClient = HttpClients.createDefault();
}
HttpGet httpGet = new HttpGet(apiUrl);
CloseableHttpResponse response = null;
ByteArrayOutputStream swapStream = new ByteArrayOutputStream();
try {
response = httpClient.execute(httpGet);
Header[] heads = response.getHeaders("Content-disposition");
if(heads != null && heads[0] != null) {
HeaderElement[] elements = heads[0].getElements();
for (HeaderElement el : elements) {
NameValuePair pair = el.getParameterByName("filename");
result.put("filename",pair.getValue());
}
}
HttpEntity entity = response.getEntity();
inputStream = entity.getContent();
byte[] buff = new byte[1024];
int rc = 0;
while ((rc = inputStream.read(buff, 0, buff.length)) > 0) {
swapStream.write(buff, 0, rc);
}
} catch (IOException e) {
e.printStackTrace();
} finally {
if (response != null) {
try {
EntityUtils.consume(response.getEntity());
} catch (IOException e) {
e.printStackTrace();
}
}
}
result.put("bytes",swapStream.toByteArray());
return result;
}
/**
* 发送上传post 文件
* @param apiUrl
* @param file
* @return
*/
public static String doPostWithFile(String apiUrl, MultipartFile file, String fileParam, String token , String type) {
CloseableHttpClient httpClient = null;
if (apiUrl.startsWith("https")) {
httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory())
.setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build();
} else {
httpClient = HttpClients.createDefault();
}
String httpStr = null;
HttpPost httpPost = new HttpPost(apiUrl);
CloseableHttpResponse response = null;
try {
httpPost.addHeader("Connection", "keep-alive");
httpPost.addHeader("Accept", "*/*");
httpPost.addHeader("Content-Type", "multipart/form-data;boundary=------------7da2e536604c8");
httpPost.addHeader("User-Agent",
"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0) ");
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
builder.setBoundary("------------7da2e536604c8")
.setCharset(Charset.forName("UTF-8"))
.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
builder.addTextBody("type", type);
// 设置access_token,
builder.addTextBody("access_token", token);
String fileName = null;
fileName = file.getOriginalFilename();
builder.addBinaryBody(fileParam, file.getBytes(), ContentType.APPLICATION_OCTET_STREAM, fileName);// 文件流
//解决中文乱码
// for (Map.Entry<String, Object> entry : params.entrySet()) {
// if(entry.getValue() == null) {
// continue;
// }
// // 类似浏览器表单提交,对应input的name和value
// builder.addTextBody(entry.getKey(), entry.getValue().toString());
// }
HttpEntity entity = builder.build();
httpPost.setEntity(entity);
response = httpClient.execute(httpPost);// 执行提交
HttpEntity result = response.getEntity();
httpStr = EntityUtils.toString(result, "UTF-8");
} catch (IOException e) {
e.printStackTrace();
} finally {
if (response != null) {
try {
EntityUtils.consume(response.getEntity());
} catch (IOException e) {
e.printStackTrace();
}
}
}
return httpStr;
}
/**
* 创建SSL安全连接
*
* @return
*/
private static SSLConnectionSocketFactory createSSLConnSocketFactory() {
SSLConnectionSocketFactory sslsf = null;
try {
SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(null, new TrustStrategy() {
public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException {
return true;
}
}).build();
sslsf = new SSLConnectionSocketFactory(sslContext, new HostnameVerifier() {
@Override
public boolean verify(String arg0, SSLSession arg1) {
return true;
}
});
} catch (GeneralSecurityException e) {
e.printStackTrace();
}
return sslsf;
}
}
package com.yeejoin.amos.boot.module.app.biz.utils;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.MultiFormatWriter;
import com.google.zxing.common.BitMatrix;
import com.itextpdf.text.pdf.qrcode.ErrorCorrectionLevel;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletResponse;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.*;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
public class ImageUtils {
private static final int QRCOLOR = 0x201f1f; // 二维码颜色:黑色
private static final int BGWHITE = 0xFFFFFF; //二维码背景颜色:白色
private static Map<EncodeHintType, Object> hints = new HashMap<EncodeHintType, Object>() {
private static final long serialVersionUID = 1L;
{
put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.M);// 设置QR二维码的纠错级别(H为最高级别)
put(EncodeHintType.CHARACTER_SET, "utf-8");// 设置编码方式
put(EncodeHintType.MARGIN, 0);// 白边
}
};
/**
* 生成二维码图片+背景+文字描述
*
* @param codeFile 生成图地址
* @param bgImgFile 背景图地址
* @param width 二维码宽度
* @param height 二维码高度
* @param qrUrl 内容
* @param note 文字说明
* @param tui 文字说明2
* @param size 文字大小
* @param imagesX 二维码x轴方向
* @param imagesY 二维码y轴方向
* @param text1X 文字描述1x轴方向
* @param text1Y 文字描述1y轴方向
* @param text2X 文字描述2x轴方向
* @param text2Y 文字描述2y轴方向
*/
public static void creatQRCode(File codeFile, InputStream bgImgFile, Integer width, Integer height, String qrUrl,
String note, String tui, Integer size, Integer imagesX, Integer imagesY, Integer text1X, Integer text1Y
, Integer text2X, Integer text2Y) throws IOException {
try {
MultiFormatWriter multiFormatWriter = new MultiFormatWriter();
BitMatrix bm = multiFormatWriter.encode(qrUrl, BarcodeFormat.QR_CODE, width, height, hints);
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
image.setRGB(x, y, bm.get(x, y) ? QRCOLOR : BGWHITE);
}
}
BufferedImage backgroundImage = ImageIO.read(bgImgFile);
int bgWidth = backgroundImage.getWidth();
int qrWidth = image.getWidth();
int disx = (bgWidth - qrWidth) - imagesX;
int disy = imagesY;
Graphics2D rng = backgroundImage.createGraphics();
rng.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_ATOP));
rng.drawImage(image, disx, disy, width, height, null);
// 抗锯齿
rng.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
// 文字描述参数设置
Color textColor = Color.white;
rng.setColor(textColor);
rng.drawImage(backgroundImage, 0, 0, null);
// 设置字体类型和大小(BOLD加粗/ PLAIN平常)
rng.setFont(new Font("Microsoft YaHei", Font.BOLD, size));
// 设置字体颜色
rng.setColor(Color.black);
int strWidth = rng.getFontMetrics().stringWidth(note);
// 文字1显示位置
int disx1 = (bgWidth - strWidth) - text1X;//左右
rng.drawString(note, disx1, text1Y);//上下
// 文字2显示位置
int disx2 = (bgWidth - strWidth) - text2X;//左右
rng.drawString(tui, disx2, text2Y);//上下
rng.dispose();
image = backgroundImage;
image.flush();
ImageIO.write(image, "png", codeFile);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (null != bgImgFile) {
bgImgFile.close();
}
}
}
/**
* 下载图片
*
* @param fileName
* @param resourceName
* @param response
*/
public static void downloadResource(String fileName, String resourceName, HttpServletResponse response) {
DataInputStream in = null;
OutputStream out = null;
InputStream fileInputStream = null;
try {
response.reset();
response.setCharacterEncoding("UTF-8");
response.setHeader("content-Type", "image/png");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
fileInputStream = new FileInputStream(resourceName);
in = new DataInputStream(fileInputStream);
out = response.getOutputStream();
int bytes = 0;
byte[] bufferOut = new byte[1024];
while ((bytes = in.read(bufferOut)) != -1) {
out.write(bufferOut, 0, bytes);
}
} catch (Exception e) {
e.printStackTrace();
response.reset();
} finally {
try {
if (out != null) {
out.close();
}
} catch (IOException e) {
e.printStackTrace();
}
try {
if (in != null) {
in.close();
}
} catch (IOException e) {
e.printStackTrace();
}
try {
if (fileInputStream != null) {
fileInputStream.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
/**
* 下载压缩包
*
* @param fileName
* @param resourceName
* @param response
*/
public static void downloadResourceZip(String fileName, String resourceName, HttpServletResponse response) {
DataInputStream in = null;
OutputStream out = null;
InputStream fileInputStream = null;
try {
response.reset();
response.setCharacterEncoding("UTF-8");
response.setHeader("content-Type", "application/zip");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
fileInputStream = new FileInputStream(resourceName);
in = new DataInputStream(fileInputStream);
out = response.getOutputStream();
int bytes = 0;
byte[] bufferOut = new byte[1024];
while ((bytes = in.read(bufferOut)) != -1) {
out.write(bufferOut, 0, bytes);
}
} catch (Exception e) {
e.printStackTrace();
response.reset();
} finally {
try {
if (out != null) {
out.close();
}
} catch (IOException e) {
e.printStackTrace();
}
try {
if (in != null) {
in.close();
}
} catch (IOException e) {
e.printStackTrace();
}
try {
if (fileInputStream != null) {
fileInputStream.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
/**
* 压缩文件
*
* @param srcFiles
* @param zipFile
*/
public static void zipFiles(List<File> srcFiles, File zipFile) {
try {
if (srcFiles.size() != 0) {
// 判断压缩后的文件存在不,不存在则创建
if (!zipFile.exists()) {
zipFile.createNewFile();
} else {
zipFile.delete();
zipFile.createNewFile();
}
// 创建 FileInputStream 对象
InputStream fileInputStream = null;
// 实例化 FileOutputStream 对象
FileOutputStream fileOutputStream = new FileOutputStream(zipFile);
// 实例化 ZipOutputStream 对象
ZipOutputStream zipOutputStream = new ZipOutputStream(fileOutputStream);
// 创建 ZipEntry 对象
ZipEntry zipEntry = null;
// 遍历源文件数组
// for (int i = 0; i < srcFiles.size(); i++) {
// // 将源文件数组中的当前文件读入 FileInputStream 流中
// File file = srcFiles.get(i);
// fileInputStream = new FileInputStream(file);
// // 实例化 ZipEntry 对象,源文件数组中的当前文件
// zipEntry = new ZipEntry(i + ".jpg");
// zipOutputStream.putNextEntry(zipEntry);
// // 该变量记录每次真正读的字节个数
// int len;
// // 定义每次读取的字节数组
// byte[] buffer = new byte[1024];
// while ((len = fileInputStream.read(buffer)) > 0) {
// zipOutputStream.write(buffer, 0, len);
// }
// }
for (File srcFile : srcFiles) {
fileInputStream = new FileInputStream(srcFile);
// 实例化 ZipEntry 对象,源文件数组中的当前文件
zipEntry = new ZipEntry(srcFile.getName());
zipOutputStream.putNextEntry(zipEntry);
// 该变量记录每次真正读的字节个数
int len;
// 定义每次读取的字节数组
byte[] buffer = new byte[1024];
while ((len = fileInputStream.read(buffer)) > 0) {
zipOutputStream.write(buffer, 0, len);
}
}
zipOutputStream.closeEntry();
zipOutputStream.close();
fileInputStream.close();
fileOutputStream.close();
System.out.println("下载完成");
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 删除文件夹(强制删除)
*
* @param file
*/
public static void deleteAllFilesOfDir(File file) {
if (null != file) {
if (!file.exists())
return;
if (file.isFile()) {
boolean result = file.delete();
int tryCount = 0;
while (!result && tryCount++ < 10) {
System.gc(); // 回收资源
result = file.delete();
}
}
File[] files = file.listFiles();
if (null != files) {
for (int i = 0; i < files.length; i++) {
deleteAllFilesOfDir(files[i]);
}
}
file.delete();
}
}
}
package com.yeejoin.amos.boot.module.app.biz.utils;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.io.IOUtils;
import org.springframework.core.io.Resource;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Map;
public class JsonUtils {
//将json文件转化为Map<list<Map<>>>
public static Map getResourceJson(Resource resource) {
String json = null;
try {
json = IOUtils.toString(resource.getInputStream(), String.valueOf(StandardCharsets.UTF_8));
} catch (IOException e) {
throw new RuntimeException(resource + "json文件转化失败");
}
return JSONObject.parseObject(json, Map.class);
}
}
package com.yeejoin.amos.boot.module.app.biz.utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
/**
* @program: redis工具类
* @description:
* @author: duanwei
* @create: 2019-04-12 14:16
**/
@Component
public class RedisUtil {
@Autowired
private RedisTemplate<String, Object> redisTemplate;
/**
* 指定缓存失效时间
*
* @param key 键
* @param time 时间(秒)
* @return
*/
public boolean expire(String key, long time) {
try {
if (time > 0) {
redisTemplate.expire(key, time, TimeUnit.SECONDS);
}
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 根据key 获取过期时间
*
* @param key 键 不能为null
* @return 时间(秒) 返回0代表为永久有效
*/
public long getExpire(String key) {
return redisTemplate.getExpire(key, TimeUnit.SECONDS);
}
/**
* 判断key是否存在
*
* @param key 键
* @return true 存在 false不存在
*/
public boolean hasKey(String key) {
try {
return redisTemplate.hasKey(key);
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 删除缓存
*
* @param key 可以传一个值 或多个
*/
@SuppressWarnings("unchecked")
public void del(String... key) {
if (key != null && key.length > 0) {
if (key.length == 1) {
redisTemplate.delete(key[0]);
} else {
redisTemplate.delete(CollectionUtils.arrayToList(key));
}
}
}
//============================String=============================
/**
* 普通缓存获取
*
* @param key 键
* @return 值
*/
public Object get(String key) {
return key == null ? null : redisTemplate.opsForValue().get(key);
}
/**
* 普通缓存放入
*
* @param key 键
* @param value 值
* @return true成功 false失败
*/
public boolean set(String key, Object value) {
try {
redisTemplate.opsForValue().set(key, value);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 普通缓存放入并设置时间
*
* @param key 键
* @param value 值
* @param time 时间(秒) time要大于0 如果time小于等于0 将设置无限期
* @return true成功 false 失败
*/
public boolean set(String key, Object value, long time) {
try {
if (time > 0) {
redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS);
} else {
set(key, value);
}
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 递增
*
* @param key 键
* @param delta 要增加几(大于0)
* @return
*/
public long incr(String key, long delta) {
if (delta < 0) {
throw new RuntimeException("递增因子必须大于0");
}
return redisTemplate.opsForValue().increment(key, delta);
}
/**
* 递减
*
* @param key 键
* @param delta 要减少几(小于0)
* @return
*/
public long decr(String key, long delta) {
if (delta < 0) {
throw new RuntimeException("递减因子必须大于0");
}
return redisTemplate.opsForValue().increment(key, -delta);
}
//================================Map=================================
/**
* HashGet
*
* @param key 键 不能为null
* @param item 项 不能为null
* @return 值
*/
public Object hget(String key, String item) {
return redisTemplate.opsForHash().get(key, item);
}
/**
* 获取hashKey对应的所有键值
*
* @param key 键
* @return 对应的多个键值
*/
public Map<Object, Object> hmget(String key) {
return redisTemplate.opsForHash().entries(key);
}
/**
* HashSet
*
* @param key 键
* @param map 对应多个键值
* @return true 成功 false 失败
*/
public boolean hmset(String key, Map<String, Object> map) {
try {
redisTemplate.opsForHash().putAll(key, map);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* HashSet 并设置时间
*
* @param key 键
* @param map 对应多个键值
* @param time 时间(秒)
* @return true成功 false失败
*/
public boolean hmset(String key, Map<String, Object> map, long time) {
try {
redisTemplate.opsForHash().putAll(key, map);
if (time > 0) {
expire(key, time);
}
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 向一张hash表中放入数据,如果不存在将创建
*
* @param key 键
* @param item 项
* @param value 值
* @return true 成功 false失败
*/
public boolean hset(String key, String item, Object value) {
try {
redisTemplate.opsForHash().put(key, item, value);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 向一张hash表中放入数据,如果不存在将创建
*
* @param key 键
* @param item 项
* @param value 值
* @param time 时间(秒) 注意:如果已存在的hash表有时间,这里将会替换原有的时间
* @return true 成功 false失败
*/
public boolean hset(String key, String item, Object value, long time) {
try {
redisTemplate.opsForHash().put(key, item, value);
if (time > 0) {
expire(key, time);
}
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 删除hash表中的值
*
* @param key 键 不能为null
* @param item 项 可以使多个 不能为null
*/
public void hdel(String key, Object... item) {
redisTemplate.opsForHash().delete(key, item);
}
/**
* 判断hash表中是否有该项的值
*
* @param key 键 不能为null
* @param item 项 不能为null
* @return true 存在 false不存在
*/
public boolean hHasKey(String key, String item) {
return redisTemplate.opsForHash().hasKey(key, item);
}
/**
* hash递增 如果不存在,就会创建一个 并把新增后的值返回
*
* @param key 键
* @param item 项
* @param by 要增加几(大于0)
* @return
*/
public double hincr(String key, String item, double by) {
return redisTemplate.opsForHash().increment(key, item, by);
}
/**
* hash递减
*
* @param key 键
* @param item 项
* @param by 要减少记(小于0)
* @return
*/
public double hdecr(String key, String item, double by) {
return redisTemplate.opsForHash().increment(key, item, -by);
}
//============================set=============================
/**
* 根据key获取Set中的所有值
*
* @param key 键
* @return
*/
public Set<Object> sGet(String key) {
try {
return redisTemplate.opsForSet().members(key);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* 根据value从一个set中查询,是否存在
*
* @param key 键
* @param value 值
* @return true 存在 false不存在
*/
public boolean sHasKey(String key, Object value) {
try {
return redisTemplate.opsForSet().isMember(key, value);
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 将数据放入set缓存
*
* @param key 键
* @param values 值 可以是多个
* @return 成功个数
*/
public long sSet(String key, Object... values) {
try {
return redisTemplate.opsForSet().add(key, values);
} catch (Exception e) {
e.printStackTrace();
return 0;
}
}
/**
* 将set数据放入缓存
*
* @param key 键
* @param time 时间(秒)
* @param values 值 可以是多个
* @return 成功个数
*/
public long sSetAndTime(String key, long time, Object... values) {
try {
Long count = redisTemplate.opsForSet().add(key, values);
if (time > 0) {
expire(key, time);
}
return count;
} catch (Exception e) {
e.printStackTrace();
return 0;
}
}
/**
* 获取set缓存的长度
*
* @param key 键
* @return
*/
public long sGetSetSize(String key) {
try {
return redisTemplate.opsForSet().size(key);
} catch (Exception e) {
e.printStackTrace();
return 0;
}
}
/**
* 移除值为value的
*
* @param key 键
* @param values 值 可以是多个
* @return 移除的个数
*/
public long setRemove(String key, Object... values) {
try {
Long count = redisTemplate.opsForSet().remove(key, values);
return count;
} catch (Exception e) {
e.printStackTrace();
return 0;
}
}
//===============================list=================================
/**
* 获取list缓存的内容
*
* @param key 键
* @param start 开始
* @param end 结束 0 到 -1代表所有值
* @return
*/
public List<Object> lGet(String key, long start, long end) {
try {
return redisTemplate.opsForList().range(key, start, end);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* 获取list缓存的长度
*
* @param key 键
* @return
*/
public long lGetListSize(String key) {
try {
return redisTemplate.opsForList().size(key);
} catch (Exception e) {
e.printStackTrace();
return 0;
}
}
/**
* 通过索引 获取list中的值
*
* @param key 键
* @param index 索引 index>=0时, 0 表头,1 第二个元素,依次类推;index<0时,-1,表尾,-2倒数第二个元素,依次类推
* @return
*/
public Object lGetIndex(String key, long index) {
try {
return redisTemplate.opsForList().index(key, index);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* 将list放入缓存
*
* @param key 键
* @param value 值
* @return
*/
public boolean lSet(String key, Object value) {
try {
redisTemplate.opsForList().rightPush(key, value);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 将list放入缓存
*
* @param key 键
* @param value 值
* @param time 时间(秒)
* @return
*/
public boolean lSet(String key, Object value, long time) {
try {
redisTemplate.opsForList().rightPush(key, value);
if (time > 0) {
expire(key, time);
}
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 将list放入缓存
*
* @param key 键
* @param value 值
* @return
*/
public boolean lSet(String key, List<Object> value) {
try {
redisTemplate.opsForList().rightPushAll(key, value);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 将list放入缓存
*
* @param key 键
* @param value 值
* @param time 时间(秒)
* @return
*/
public boolean lSet(String key, List<Object> value, long time) {
try {
redisTemplate.opsForList().rightPushAll(key, value);
if (time > 0) {
expire(key, time);
}
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 根据索引修改list中的某条数据
*
* @param key 键
* @param index 索引
* @param value 值
* @return
*/
public boolean lUpdateIndex(String key, long index, Object value) {
try {
redisTemplate.opsForList().set(key, index, value);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 移除N个值为value
*
* @param key 键
* @param count 移除多少个
* @param value 值
* @return 移除的个数
*/
public long lRemove(String key, long count, Object value) {
try {
Long remove = redisTemplate.opsForList().remove(key, count, value);
return remove;
} catch (Exception e) {
e.printStackTrace();
return 0;
}
}
}
package com.yeejoin.amos.boot.module.app.biz.utils;
import java.util.Map;
import java.util.StringJoiner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @Author: xl
* @Description:
* @Date: 2022/8/4 9:08
*/
public class StringUtils {
public static StringJoiner getWhereSql(String operator, Map<String, String> map){
StringJoiner stringJoiner = new StringJoiner(" " + operator +" ");
for (Map.Entry entry :map.entrySet()) {
stringJoiner.add(entry.getKey() + "=" + str2sqlValue(entry.getValue().toString()));
}
return stringJoiner;
}
public static String str2sqlValue(String str){
return "'" + str + "'";
}
public static String getStrByPattern(String str, Pattern reg){
Matcher mat = reg.matcher(str);
while (mat.find()) {
return mat.group(0);
}
return "";
}
}
package com.yeejoin.amos.boot.module.app.flc.biz.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.app.flc.api.dto.RegUnitIcDto;
import com.yeejoin.amos.boot.module.app.flc.api.entity.RegUnitIc;
import com.yeejoin.amos.boot.module.app.flc.api.mapper.RegUnitIcMapper;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List;
/**
* 注册单位工商信息表服务实现类
*
* @author system_generator
* @date 2022-08-10
*/
@Service
public class RegUnitIcServiceImpl extends BaseService<RegUnitIcDto, RegUnitIc, RegUnitIcMapper> {
/**
* 分页查询
*/
public Page<RegUnitIcDto> queryForRegUnitIcPage(Page<RegUnitIcDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<RegUnitIcDto> queryForRegUnitIcList() {
return this.queryForList("", false);
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.app.flc.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService;
import com.yeejoin.amos.boot.module.app.flc.api.service.IRegUnitInfoService;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.app.api.common.BizCommonConstant;
import com.yeejoin.amos.boot.module.app.api.dto.BaseUnitLicenceDto;
import com.yeejoin.amos.boot.module.app.api.entity.BaseUnitLicence;
import com.yeejoin.amos.boot.module.app.api.entity.TzBaseEnterpriseInfo;
import com.yeejoin.amos.boot.module.app.api.enums.CompanyLevelEnum;
import com.yeejoin.amos.boot.module.app.api.mapper.TzBaseEnterpriseInfoMapper;
import com.yeejoin.amos.boot.module.app.biz.service.impl.BaseUnitLicenceServiceImpl;
import com.yeejoin.amos.boot.module.app.biz.service.impl.EquipmentCategoryServiceImpl;
import com.yeejoin.amos.boot.module.app.biz.service.impl.StartPlatformTokenService;
import com.yeejoin.amos.boot.module.app.biz.service.impl.TzBaseEnterpriseInfoServiceImpl;
import com.yeejoin.amos.boot.module.app.biz.service.impl.TzsAuthServiceImpl;
import com.yeejoin.amos.boot.module.app.biz.utils.RedisUtil;
import com.yeejoin.amos.boot.module.app.flc.api.dto.RegUnitIcDto;
import com.yeejoin.amos.boot.module.app.flc.api.dto.RegUnitInfoDto;
import com.yeejoin.amos.boot.module.app.flc.api.entity.RegUnitIc;
import com.yeejoin.amos.boot.module.app.flc.api.entity.RegUnitInfo;
import com.yeejoin.amos.boot.module.app.flc.api.feign.AccessFeignService;
import com.yeejoin.amos.boot.module.app.flc.api.feign.IdxFeignService;
import com.yeejoin.amos.boot.module.app.flc.api.feign.UgpServiceFeignClient;
import com.yeejoin.amos.boot.module.app.flc.api.mapper.RegUnitInfoMapper;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.ContentType;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.text.ParseException;
import java.util.*;
import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* 单位注册信息表服务实现类
*
* @author system_generator
* @date 2022-08-09
*/
@Service
public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitInfo, RegUnitInfoMapper>
implements IRegUnitInfoService {
@Autowired
RedisUtil redisUtil;
@Autowired
BaseUnitLicenceServiceImpl baseUnitLicenceService;
@Autowired
DataDictionaryServiceImpl iDataDictionaryService;
@Autowired
OrgUsrServiceImpl iOrgUsrService;
@Autowired
RegUnitIcServiceImpl regUnitIcService;
@Autowired
private TzsAuthServiceImpl tzsAuthServiceImpl;
@Autowired
TzBaseEnterpriseInfoServiceImpl tzBaseEnterpriseInfoService;
@Autowired
TzBaseEnterpriseInfoMapper tzBaseEnterpriseInfoMapper;
@Autowired
RestTemplate restTemplate;
@Autowired
AccessFeignService accessFeignService;
@Autowired
UgpServiceFeignClient ugpServiceFeignClient;
@Autowired
RegUnitInfoMapper regUnitInfoMapper;
@Autowired
StartPlatformTokenService startPlatformTokenService;
@Autowired
EquipmentCategoryServiceImpl equipmentCategoryService;
@Autowired
IdxFeignService idxFeignService;
@Autowired
WorkflowFeignService workflowFeignService;
private final Logger logger = LogManager.getLogger(RegUnitInfoServiceImpl.class);
/**
* 使用单位的类型,数据来源:cb_data_dictionary code = 1232
*/
private static String USE_UNIT_TYPE_CODE = "1232";
/**
* 生产单位的类型,数据来源:cb_data_dictionary code = 1230
*/
private static String PRODUCT_UNIT_TYPE_CODE = "1230";
/**
* 充装单位的类型,数据来源:cb_data_dictionary code = 1231
*/
private static String FILLING_UNIT_TYPE_CODE = "1231";
/**
* 单位类型,数据来源:cb_data_dictionary type = UNIT_TYPE
*/
private static String DICT_TYPE_UNIT_TYPE = "UNIT_TYPE_NEW";
@Value("${org.filter.group.seq}")
private Long groupSeq;
@Value("${is.ugp}")
private boolean isUgp;
@Override
@Transactional(rollbackFor = Exception.class)
public RegUnitInfoDto registerUnit(RegUnitInfoDto model) {
if(ValidationUtil.isEmpty(model.getUnitCode())){
model.setUnitCode(model.getForm().getString("unitCode"));
}
RegUnitInfo regUnitInfo = new RegUnitInfo();
try {
tzsAuthServiceImpl.setRequestContext();
// 注册用统一信用码注册,默认证件类型为营业执照,数据来源:cb_data_dictionary code = 1060
model.setUnitCodeType("1060");
model.setUnitCodeTypeName("营业执照");
Bean.copyExistPropertis(model, regUnitInfo);
regUnitInfo.setUnitType(StringUtils.join(model.getUnitTypeList(), ","));
regUnitInfo.setUnitTypeCode(StringUtils.join(model.getUnitTypeCodeList(), ","));
// 3.2 自动创建:调用平台进行创建单位、用户信息
this.createCompanyAndUser(regUnitInfo);
//多线程同步ugp信息(tzs和ugp一起后放开)
FutureTask<ResponseModel<Boolean>> future = null;
if(isUgp) {
String token = RequestContext.getToken();
String appKey = RequestContext.getAppKey();
String product = RequestContext.getProduct();
Callable callable = new Callable() {
@Override
public Object call() throws Exception {
RequestContext.setToken(token);
RequestContext.setAppKey(appKey);
RequestContext.setProduct(product);
//同步企业至ugp,成功返回true,失败返回false
return ugpServiceFeignClient.syncCompany(model);
}
};
future = new FutureTask(callable);
Thread thread = new Thread(future);
thread.start();
}
// 1.插入单位注册许可信息表:tz_base_unit_licence
List<BaseUnitLicenceDto> unitLicenceDtos = model.getUnitLicences();
List<BaseUnitLicence> baseUnitLicences = unitLicenceDtos.stream().map(s -> {
s.setUnitCode(model.getUnitCode());
s.setUnitName(model.getName());
BaseUnitLicence target = new BaseUnitLicence();
Bean.copyExistPropertis(s, target);
return target;
}).collect(Collectors.toList());
if (!baseUnitLicences.isEmpty()) {
baseUnitLicenceService.saveOrUpdateBatch(baseUnitLicences);
}
// 2.插入工商单位信息表:tz_flc_reg_unit_ic
RegUnitIc regUnitIc = new RegUnitIc();
model.getRegUnitIc().setUnitCode(model.getUnitCode());
model.getRegUnitIc().setUnitName(model.getName());
Bean.copyExistPropertis(model.getRegUnitIc(), regUnitIc);
regUnitIcService.saveOrUpdate(regUnitIc);
// 3.调用平台进行创建单位、用户信息,同步用户信息
// if (UnitReviewStateEnum.NO_NEED_REVIEW.getCode().equals(model.getState())) {
// 3.1 创建企业信息
this.createBaseEnterpriseInfo(model);
// }
if (!ObjectUtils.isEmpty(regUnitInfo.getAdminName())){
regUnitInfo.setContactPerson(regUnitInfo.getAdminName());
}
if (!ObjectUtils.isEmpty(regUnitInfo.getAdminTel())){
regUnitInfo.setContactPersonTel(regUnitInfo.getAdminTel());
}
// 4.插入注册单位基本信息表:tz_flc_reg_unit_info
this.save(regUnitInfo);
// 5.组织返回数据
// 5.1企业基本信息
Bean.copyExistPropertis(regUnitInfo, model);
// 5.2行政许可数据
model.setUnitLicences(Bean.toModels(baseUnitLicences, BaseUnitLicenceDto.class));
// 5.3工商信息
model.setRegUnitIc(Bean.toModel(regUnitIc, new RegUnitIcDto()));
//获取多线程执行结果 true成功 false失败(tzs和ugp一起后放开)
if(isUgp) {
if (!future.get().getResult()) {
throw new Exception("UGP信息同步失败");
}
}
} catch (Exception e) {
log.error(e.getMessage(), e);
// 失败后回滚:删除已经创建的企业信息
if (StringUtils.isNotEmpty(regUnitInfo.getAmosCompanySeq())) {
FeignClientResult<CompanyModel> feignClientResult = Privilege.companyClient
.seleteOne(Long.parseLong(regUnitInfo.getAmosCompanySeq()));
if (feignClientResult != null) {
Privilege.companyClient.deleteCompany(regUnitInfo.getAmosCompanySeq());
}
}
// 失败后回滚:删除已经创建的管理员账号
if (StringUtils.isNotEmpty(regUnitInfo.getAdminUserId())) {
FeignClientResult<AgencyUserModel> feignClientResult = Privilege.agencyUserClient
.queryByUserId(regUnitInfo.getAdminUserId());
if (feignClientResult != null) {
Privilege.agencyUserClient.multDeleteUser(regUnitInfo.getAdminUserId());
}
}
throw new RuntimeException(e.getMessage());
}
return model;
}
private static String createQRCode(String unitCode) {
String urlString = null;
byte[] bytes = QRCodeUtil.generateQRCodeImageByteData(unitCode, 150);
InputStream inputStream = new ByteArrayInputStream(bytes);
try {
MultipartFile file = new MockMultipartFile(unitCode+".png",unitCode+".png", ContentType.APPLICATION_OCTET_STREAM.toString(), inputStream);
FeignClientResult<Map<String, String>> date = Systemctl.fileStorageClient.updateCommonFileFree(file, "tzs/qrcode");
if (date != null) {
Map<String, String> map = date.getResult();
Iterator<String> it = map.keySet().iterator();
urlString=it.next();
}
} catch (IOException e) {
e.printStackTrace();
throw new BadRequest(unitCode + ":生成二维码失败");
}
return urlString;
}
public void createBaseEnterpriseInfo(RegUnitInfoDto regUnitInfo) {
// 1.查询管辖公司的信息
FeignClientResult<CompanyModel> feignClientResult = Privilege.companyClient
.seleteOne(Long.parseLong(regUnitInfo.getManagementUnitId()));
CompanyModel managementCompany = feignClientResult.getResult();
// 2.填充数据
TzBaseEnterpriseInfo baseEnterpriseInfo = new TzBaseEnterpriseInfo();
baseEnterpriseInfo.setUseUnitCertificate(regUnitInfo.getUnitCodeTypeName());
baseEnterpriseInfo.setUnitType(StringUtils.join(regUnitInfo.getUnitTypeList(), "#"));
baseEnterpriseInfo.setUseCode(regUnitInfo.getUnitCode());
TzBaseEnterpriseInfo useCodeResult = tzBaseEnterpriseInfoMapper.selectOne(new QueryWrapper<TzBaseEnterpriseInfo>().eq("use_code", regUnitInfo.getUnitCode()));
if (ObjectUtils.isEmpty(useCodeResult)) {
baseEnterpriseInfo.setQrCode(createQRCode(regUnitInfo.getUnitCode()));
} else {
baseEnterpriseInfo.setQrCode(ObjectUtils.isEmpty(useCodeResult.getQrCode()) ? createQRCode(regUnitInfo.getUnitCode()) : useCodeResult.getQrCode());
}
baseEnterpriseInfo.setUseUnit(regUnitInfo.getName());
baseEnterpriseInfo.setProvince(regUnitInfo.getProvince());
baseEnterpriseInfo.setCity(regUnitInfo.getCity());
baseEnterpriseInfo.setDistrict(regUnitInfo.getDistrict());
baseEnterpriseInfo.setStreet(regUnitInfo.getStree());
baseEnterpriseInfo.setCommunity(regUnitInfo.getCommunity());
baseEnterpriseInfo.setAddress(regUnitInfo.getAddress());
baseEnterpriseInfo.setLegalPerson(regUnitInfo.getLegalPerson());
baseEnterpriseInfo.setLegalPhone(regUnitInfo.getLegalPersonTel());
baseEnterpriseInfo.setUseContact(regUnitInfo.getAdminName());
baseEnterpriseInfo.setContactPhone(regUnitInfo.getAdminTel());
baseEnterpriseInfo.setLongitude(regUnitInfo.getLongitude());
baseEnterpriseInfo.setLatitude(regUnitInfo.getLatitude());
// 管辖机构信息
baseEnterpriseInfo.setSuperviseCode(managementCompany.getCompanyCode());
baseEnterpriseInfo.setSuperviseOrgCode(managementCompany.getOrgCode());
// 这个表有两个字段所以赋值两字段
baseEnterpriseInfo.setSuperviseOrgName(regUnitInfo.getManagementUnit());
baseEnterpriseInfo.setGoverningBody(regUnitInfo.getManagementUnit());
baseEnterpriseInfo.setDataSources("企业注册");
baseEnterpriseInfo.setIndustry(regUnitInfo.getRegUnitIc().getIndustryName());
baseEnterpriseInfo.setRegistrationAuthority(regUnitInfo.getRegUnitIc().getRegisteredOrgan());
baseEnterpriseInfo.setApprovalTime(regUnitInfo.getRegUnitIc().getApprovedDate());
baseEnterpriseInfo.setOperatingStatus(regUnitInfo.getRegUnitIc().getBusinessState());
baseEnterpriseInfo.setSyncDate(new Date());
baseEnterpriseInfo.setSyncState(0);
LambdaQueryWrapper<TzBaseEnterpriseInfo> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(TzBaseEnterpriseInfo::getUseCode,regUnitInfo.getUnitCode());
tzBaseEnterpriseInfoService.saveOrUpdate(baseEnterpriseInfo,wrapper);
}
@Override
public RegUnitInfoDto unitCheck(String unitCode, String unitType,String companyName) {
tzsAuthServiceImpl.setRequestContext();
RequestContext.setToken(RequestContext.getToken());
RequestContext.setAppKey(RequestContext.getAppKey());
RequestContext.setProduct(RequestContext.getProduct());
if (!ValidationUtil.isEmpty(companyName)) {
FeignClientResult<CompanyModel> result =Privilege.companyClient.queryByCompanyName(companyName);
if(result.getResult()!=null)
{
throw new RuntimeException("重复的公司名称");
}
}
if (!ValidationUtil.isEmpty(unitCode)) {
FeignClientResult<CompanyModel> result =Privilege.companyClient.queryByCompanyCode(unitCode);
if(result.getResult()!=null)
{
throw new RuntimeException("重复的公司编码");
}
}
// 1.校验重复性
// RegUnitInfo regUnitInfo = this
// .getOne(new LambdaQueryWrapper<RegUnitInfo>().eq(RegUnitInfo::getUnitCode, unitCode));
// if (regUnitInfo != null) {
// throw new RuntimeException("该单位已注册,请联系企业管理员!");
// }
// 2.组织返回数据
RegUnitInfoDto regUnitInfoDto = new RegUnitInfoDto();
// MultiValueMap<String, String> headers = new HttpHeaders();
// headers.add("product","AMOS_STUDIO_WEB");
// headers.add("appKey","AMOS_STUDIO");
// headers.add("token",token);
// RequestContext.setToken();
// RequestContext.setAppKey();
// RequestContext.setProduct();
// RequestEntity requestEntity = new RequestEntity(
// null, //body部分数据
// headers, //头
// HttpMethod.GET,//请求方法
// URI.create("/accessapi/business/getData"));
// ResponseEntity<JSONObject> responseEntity = restTemplate.exchange(requestEntity,JSONObject.class);
// JSONObject result = responseEntity.getBody();
// 2.1 使用单位调用行政许可系统接口进行查询工商信息
Map<String, Object> resultMap = accessFeignService.getData(unitCode).getResult();
if(!ValidationUtil.isEmpty(resultMap)){
// 2.2 工商信息组装
String area = String.valueOf(resultMap.get("area"));
String city = area.substring(0,area.indexOf("市")+1);
String district = area.substring(city.length());
if(district.equals("高新区")){
district = "雁塔区";
}
regUnitInfoDto.setCity(city);
regUnitInfoDto.setDistrict(district);
regUnitInfoDto.setStree(String.valueOf(resultMap.get("street")));
regUnitInfoDto.setCommunity(String.valueOf(resultMap.get("community")));
regUnitInfoDto.setAddress(String.valueOf(resultMap.get("address")));
regUnitInfoDto.setUnitCode(String.valueOf(resultMap.get("creditCode")));
regUnitInfoDto.setName(String.valueOf(resultMap.get("unitName")));
regUnitInfoDto.setLegalPerson(String.valueOf(resultMap.get("legalPeople")));
String industryName = "";
DataDictionary dataDictionary = iDataDictionaryService.getByCode(String.valueOf(resultMap.get("industryCode")),"HYXLDM");
if(!ValidationUtil.isEmpty(dataDictionary)) {
industryName = dataDictionary.getName();
}
String approveDate = String.valueOf(resultMap.get("approval_time"));
approveDate = approveDate.contains("年")?approveDate.replace("年","-"):approveDate;
approveDate = approveDate.contains("月")?approveDate.replace("月","-"):approveDate;
approveDate = approveDate.contains("日")?approveDate.replace("日","-"):approveDate;
RegUnitIcDto regUnitIcDto = new RegUnitIcDto();
regUnitIcDto.setUnitCode(regUnitInfoDto.getUnitCode());
try {
regUnitIcDto.setApprovedDate(DateUtils.dateParse(approveDate,"yyyy-MM-dd"));
} catch (ParseException e) {
e.printStackTrace();
}
regUnitIcDto.setUnitName(regUnitInfoDto.getName());
regUnitIcDto.setRegisteredOrgan(String.valueOf(resultMap.get("registration_authority")));
regUnitIcDto.setBusinessState(String.valueOf(resultMap.get("operating_status")));
regUnitIcDto.setProvince("陕西省");
regUnitIcDto.setCity(regUnitInfoDto.getCity());
regUnitIcDto.setDistrict(regUnitInfoDto.getDistrict());
regUnitIcDto.setStree(regUnitInfoDto.getStree());
regUnitIcDto.setCommunity(regUnitInfoDto.getCommunity());
regUnitIcDto.setAddress(regUnitInfoDto.getAddress());
regUnitIcDto.setLegalPerson(regUnitInfoDto.getLegalPerson());
regUnitIcDto.setIndustryName(industryName);
regUnitInfoDto.setRegUnitIc(regUnitIcDto);
} else {
regUnitInfoDto.setRegUnitIc(new RegUnitIcDto());
}
// 2.3 许可信息组装
List<BaseUnitLicence> unitLicences = baseUnitLicenceService
.list(new LambdaQueryWrapper<BaseUnitLicence>().eq(BaseUnitLicence::getUnitCode, unitCode));
regUnitInfoDto.setUnitLicences(Bean.toModels(unitLicences, BaseUnitLicenceDto.class));
return regUnitInfoDto;
}
@Override
public List<DataDictionary> getUnitTypeList() {
return iDataDictionaryService.getByType(DICT_TYPE_UNIT_TYPE);
}
@Override
public Collection getManagementUnitTree(String orgCode) {
List<LinkedHashMap> companyModels = (List<LinkedHashMap>) redisUtil.get(BizCommonConstant.COMPANY_TREE_REDIS_KEY);
if (ValidationUtil.isEmpty(companyModels)) {
tzsAuthServiceImpl.setRequestContext();
companyModels = equipmentCategoryService.creatTree();
}
if (!ValidationUtil.isEmpty(orgCode)) {
companyModels = findNodesByCondition(companyModels, "orgCode", orgCode, "children");
companyModels = (List<LinkedHashMap>) companyModels.get(0).get("children");
}
return companyModels;
}
// public Collection getManagementUnitTree2(String orgCode) {
// tzsAuthServiceImpl.setRequestContext();
// // 组织架构中单位级别为:省级、地市级、区县级、的单位
// List<CompanyModel> companyModels = new ArrayList<CompanyModel>();
// if (StringUtils.isEmpty(orgCode)) {
// if (redisUtil.hasKey(BizCommonConstant.COMPANY_TREE_REDIS_KEY)) {
// companyModels = (List<CompanyModel>) redisUtil.get(BizCommonConstant.COMPANY_TREE_REDIS_KEY);
// } else {
// companyModels = (List<CompanyModel>) Privilege.companyClient.queryAgencyTree(null).getResult();
// redisUtil.set(BizCommonConstant.COMPANY_TREE_REDIS_KEY, companyModels);
// }
// } else {
// LinkedHashMap<Object, Object> l = (LinkedHashMap<Object, Object>) Privilege.companyClient
// .queryByOrgcode(orgCode).getResult();
// for (Map.Entry<Object, Object> it : l.entrySet()) {
// CompanyModel companyModel = JSONObject.parseObject(JSONObject.toJSONString(it.getValue()),
// CompanyModel.class);
// if (companyModel != null) {
// companyModels = (List<CompanyModel>) Privilege.companyClient
// .querySubAgencyTree(companyModel.getSequenceNbr()).getResult();
// }
// break;
// }
// }
// List<CompanyModel> result =
// companyModels.stream().filter(c -> !ValidationUtil.isEmpty(CompanyLevelEnum.getEnum(c.getLevel()))).map(this::dealChildCompany)
// .collect(Collectors.toList());
// return result;
// }
public static List<LinkedHashMap> findNodesByCondition(List<LinkedHashMap> nodes, String conditionName,
String condition, String childName) {
return nodes.stream()
.flatMap(node -> Stream.concat(
node.get(conditionName).equals(condition) ? Stream.of(node) : Stream.empty(),
node.get(childName) != null ? findNodesByCondition((List<LinkedHashMap>) node.get(childName),
conditionName, condition, condition).stream() :
Stream.empty()
))
.collect(Collectors.toList());
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean unitLogOut(String unitCode) {
RegUnitInfo regUnitInfo = this
.getOne(new LambdaQueryWrapper<RegUnitInfo>().eq(RegUnitInfo::getUnitCode, unitCode));
if (regUnitInfo == null) {
return Boolean.FALSE;
}
try {
// 1.删除已经创建的企业信息
if (StringUtils.isNotEmpty(regUnitInfo.getAmosCompanySeq())) {
CompanyModel companyModel = Privilege.companyClient
.seleteOne(Long.parseLong(regUnitInfo.getAmosCompanySeq())).getResult();
if (companyModel != null) {
Privilege.companyClient.deleteCompany(regUnitInfo.getAmosCompanySeq());
}
}
// 2.删除已经创建的管理员账号
FeignClientResult<AgencyUserModel> feignClientResult = Privilege.agencyUserClient
.queryByUserId(regUnitInfo.getAdminUserId());
if (feignClientResult != null) {
Privilege.agencyUserClient.multDeleteUser(regUnitInfo.getAdminUserId());
}
} catch (Exception e) {
log.error(e.getMessage(), e);
}
// 3.企业注册表删除
this.remove(new LambdaQueryWrapper<RegUnitInfo>().eq(RegUnitInfo::getUnitCode, unitCode));
// 4.工商信息表删除
regUnitIcService.remove(new LambdaQueryWrapper<RegUnitIc>().eq(RegUnitIc::getUnitCode, unitCode));
// 5.许可信息删除
baseUnitLicenceService
.remove(new LambdaQueryWrapper<BaseUnitLicence>().eq(BaseUnitLicence::getUnitCode, unitCode));
// 6.企业数据信息删除
tzBaseEnterpriseInfoService
.remove(new LambdaQueryWrapper<TzBaseEnterpriseInfo>().eq(TzBaseEnterpriseInfo::getUseCode, unitCode));
// 7.机场单位表信息删除
iOrgUsrService
.remove(new LambdaQueryWrapper<OrgUsr>().eq(OrgUsr::getAmosOrgId, regUnitInfo.getAmosCompanySeq()));
return Boolean.TRUE;
}
@Override
public Boolean checkRepeatAccount(String userName) {
return this.count(new LambdaQueryWrapper<RegUnitInfo>().eq(RegUnitInfo::getAdminLoginName, userName)) > 0;
}
@Override
public Boolean checkRepeatPhone(String phoneNo) {
return this.count(new LambdaQueryWrapper<RegUnitInfo>().eq(RegUnitInfo::getAdminTel, phoneNo)) > 0;
}
@Override
public void updateAdminInfo(JSONObject dataResult) {
RegUnitInfo regUnitInfo = regUnitInfoMapper.selectOne(new QueryWrapper<RegUnitInfo>().eq("admin_user_id", dataResult.get("userId")));
if(!ObjectUtils.isEmpty(regUnitInfo)){
regUnitInfo.setAdminTel(String.valueOf(dataResult.get("mobile")));
regUnitInfo.setAdminName(String.valueOf(dataResult.get("realName")));
regUnitInfoMapper.updateById(regUnitInfo);
}
}
@Override
public Boolean creatQrCode() {
List<TzBaseEnterpriseInfo> tzBaseEnterpriseInfoList = tzBaseEnterpriseInfoMapper.selectList(new QueryWrapper<TzBaseEnterpriseInfo>().isNull("qr_code"));
if (!ObjectUtils.isEmpty(tzBaseEnterpriseInfoList) && tzBaseEnterpriseInfoList.size() > 0) {
for (TzBaseEnterpriseInfo tzBaseEnterpriseInfo : tzBaseEnterpriseInfoList) {
String qrCode = createQRCode(tzBaseEnterpriseInfo.getUseCode());
tzBaseEnterpriseInfoMapper.updateById(tzBaseEnterpriseInfo.setQrCode(qrCode));
}
return true;
} else {
return false;
}
}
@Override
public RegUnitInfoDto adminInfo(String unitCode) {
// 管理员信息
RegUnitInfo regUnitInfo = this.getOne(
new LambdaQueryWrapper<RegUnitInfo>().eq(RegUnitInfo::getUnitCode, unitCode));
RegUnitInfoDto regUnitInfoDto = new RegUnitInfoDto();
if (regUnitInfo != null) {
BeanUtils.copyProperties(regUnitInfo, regUnitInfoDto);
}
regUnitInfoDto.setAdminIdCardPhoto(ObjectUtils.isEmpty(regUnitInfo.getAdminIdCardPhoto()) ? new ArrayList() : JSON.parseArray(regUnitInfo.getAdminIdCardPhoto()));
return regUnitInfoDto;
}
private CompanyModel dealChildCompany(CompanyModel cm) {
cm.setChildren(this.getFilterChild(cm.getChildren() != null ? cm.getChildren() : new ArrayList()));
cm.getChildren().stream().filter(n -> {
CompanyModel c = JSONObject.parseObject(JSON.toJSONString(n), CompanyModel.class);
return !ValidationUtil.isEmpty(CompanyLevelEnum.getEnum(c.getLevel()));
}).map(n -> {
CompanyModel c = JSONObject.parseObject(JSON.toJSONString(n), CompanyModel.class);
return dealChildCompany(c);
}).collect(Collectors.toList());
return cm;
}
private List getFilterChild(Collection children) {
return (List) children.stream().filter(n -> {
CompanyModel c = JSONObject.parseObject(JSON.toJSONString(n), CompanyModel.class);
return !ValidationUtil.isEmpty(CompanyLevelEnum.getEnum(c.getLevel()));
}).map(s -> {
CompanyModel c = JSONObject.parseObject(JSON.toJSONString(s), CompanyModel.class);
c.setChildren(this.getFilterChild(c.getChildren() != null ? c.getChildren() : new ArrayList()));
return c;
}).collect(Collectors.toList());
}
private void createCompanyAndUser(RegUnitInfo regUnitInfo) {
CompanyModel companyInfo = new CompanyModel();
FeignClientResult<AgencyUserModel> userResult = null;
try {
FeignClientResult<List<RoleModel>> roleListResult = Privilege.roleClient.queryRoleList(null, null);
List<RoleModel> allRoleList = roleListResult.getResult();
List<RoleModel> userRoleList = new ArrayList<>();
List<Long> roleIds = new ArrayList<>();
Set<String> roleNameSet = new HashSet<>();
// 3.1创建公司
companyInfo.setAddress(dealNull2EmptyString(regUnitInfo.getProvince())
+ dealNull2EmptyString(regUnitInfo.getCity()) + dealNull2EmptyString(regUnitInfo.getDistrict())
+ dealNull2EmptyString(regUnitInfo.getStree()) + dealNull2EmptyString(regUnitInfo.getCommunity())
+ dealNull2EmptyString(regUnitInfo.getAddress()));
companyInfo.setAgencyCode("tzs");
companyInfo.setParentId(Long.parseLong(regUnitInfo.getManagementUnitId()));
companyInfo.setLevel("company");
companyInfo.setCompanyName(regUnitInfo.getName());
companyInfo.setCompanyCode(regUnitInfo.getUnitCode());
companyInfo.setContact(regUnitInfo.getLegalPerson());
companyInfo.setCompanyType(regUnitInfo.getUnitType());
companyInfo.setLandlinePhone(regUnitInfo.getLegalPersonTel());
FeignClientResult<CompanyModel> companyResult = Privilege.companyClient.create(companyInfo);
if (companyResult == null || companyResult.getResult() == null) {
throw new BadRequest("单位注册失败");
}
String adminUserName = regUnitInfo.getAdminName();
String loginName = regUnitInfo.getAdminLoginName();
String pwd = regUnitInfo.getAdminLoginPwd();
String adminTel = regUnitInfo.getAdminTel();
// 3.2 创建平台用户
companyInfo = companyResult.getResult();
AgencyUserModel agencyUserModel = new AgencyUserModel();
agencyUserModel.setUserName(loginName);
agencyUserModel.setRealName(adminUserName);
agencyUserModel.setLockStatus("UNLOCK");
agencyUserModel.setPassword(pwd);
agencyUserModel.setRePassword(pwd);
agencyUserModel.setAgencyCode("tzs");
agencyUserModel.setMobile(adminTel);
String unitTypeCode = regUnitInfo.getUnitTypeCode();
// 根据unitTypeCode 获取应用和角色 数据字典配置
String[] units = unitTypeCode.split(",");
Set<String> appCodesSet = new HashSet<>();
Map<Long, List<Long>> roleSeqMap = new HashMap<>();
Map<Long, List<RoleModel>> orgRoles = new HashMap<>();
for (String TypeCode : units) {
DataDictionary unitType = iDataDictionaryService
.getOne(new LambdaQueryWrapper<DataDictionary>().eq(DataDictionary::getCode, TypeCode));
String appCode = unitType.getTypeDesc() != null ? unitType.getTypeDesc() : "";
String[] appCodes = appCode.split(",");
Collections.addAll(appCodesSet, appCodes);
roleNameSet.add(unitType.getName());
// userRoleList = allRoleList.stream().filter(r -> r.getRoleName().equals(unitType.getName()))
// .collect(Collectors.toList());
for (RoleModel roleModel : allRoleList.stream()
.filter(r -> unitType.getExtend().contains(r.getSequenceNbr().toString())).collect(Collectors.toList())) {
userRoleList.add(roleModel);
}
userRoleList.forEach(r -> {
if (!roleIds.contains(r.getSequenceNbr())) {
roleIds.add(r.getSequenceNbr());
}
});
roleSeqMap.put(companyInfo.getSequenceNbr(), roleIds);
orgRoles.put(companyInfo.getSequenceNbr(), userRoleList);
}
agencyUserModel.setAppCodes(new ArrayList<>(appCodesSet));
agencyUserModel.setOrgRoles(orgRoles);
agencyUserModel.setOrgRoleSeqs(roleSeqMap);
userResult = Privilege.agencyUserClient.create(agencyUserModel);
if (userResult == null || userResult.getResult() == null) {
throw new BadRequest("单位注册失败");
}
String[] userIds = { userResult.getResult().getUserId() };
regUnitInfo.setAdminUserId(userResult.getResult().getUserId());
regUnitInfo.setAmosCompanySeq(companyInfo.getSequenceNbr().toString());
// 3.3 org_user 创建组织机构
OrgUsr org = new OrgUsr();
org.setBizOrgCode(TreeParser.genTreeCode());
org.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_COMPANY);
org.setBizOrgName(regUnitInfo.getName());
org.setRecDate(new Date());
org.setRecUserId(userResult.getResult().getUserId());
org.setRecUserName(userResult.getResult().getUserName());
org.setAmosOrgId(companyInfo.getSequenceNbr() + "");
org.setAmosOrgCode(companyInfo.getOrgCode());
iOrgUsrService.save(org);
// if (groupSeq != null) {
// Privilege.groupUserClient.create(groupSeq, Arrays.asList(userIds));
// }
} catch (Exception e) {
// 删除已经创建的 企业信息
if (companyInfo != null && companyInfo.getSequenceNbr() != null) {
Privilege.companyClient.deleteCompany(companyInfo.getSequenceNbr() + "");
}
if (userResult != null && userResult.getResult() != null
&& StringUtils.isNotEmpty(userResult.getResult().getUserId())) {
Privilege.agencyUserClient.multDeleteUser(userResult.getResult().getUserId());
}
log.error(e.getMessage(), e);
throw new RuntimeException(e.getMessage());
}
}
@Override
public String submit(Long pageId, String taskId, String planInstanceId, String topic, String tableName, Map<String, Object> objectMap) throws Exception {
String roleId = "";
// 根据指标taskId查询
FeignClientResult<Map<String, Object>> taskMessage = idxFeignService.getTaskId(taskId);
logger.info("idx返回任务信息,{}", JSONObject.toJSONString(taskMessage));
if ("200".equals(String.valueOf(taskMessage.getStatus())) && !ObjectUtils.isEmpty(taskMessage)) {
Object id = taskMessage.getResult().get("processInstanceId");
// 根据processInstanceId查询workFlow服务对应的taskId
JSONObject flowTask = workflowFeignService.getTaskId(String.valueOf(id));
logger.info("workFlow返回任务id,{}", JSONObject.toJSONString(flowTask));
if (!ObjectUtils.isEmpty(flowTask) && !ObjectUtils.isEmpty(flowTask.get("data"))) {
JSONObject data = JSON.parseObject(JSON.toJSONString(flowTask.get("data")));
Object id1 = data.get("id");
// 根据taskId查询流程节点绑定角色id
JSONObject result = workflowFeignService.getRoleId(String.valueOf(id1));
logger.info("workFlow返回角色id,{}", JSONObject.toJSONString(result));
if (!ObjectUtils.isEmpty(result) && !ObjectUtils.isEmpty(result.get("result"))) {
JSONObject result1 = JSON.parseObject(JSON.toJSONString(result.get("result")));
roleId = String.valueOf(result1.get("roleId"));
}
}
}
// 企业下所有用户(上送工作流企业整改用户参数)
ArrayList<String> flow = new ArrayList<>();
// 企业下所有用户(更新任务)
ArrayList<String> task = new ArrayList<>();
// 查询第一个填报信息获取企业
String companyName = "";
// 查询流程第一个节点所选择的执行企业信息
FeignClientResult<JSONObject> firstTask = idxFeignService.getFirstTask(taskId);
logger.info("idx返回第一个节点任务信息,{}", JSONObject.toJSONString(firstTask));
if (!ObjectUtils.isEmpty(firstTask)) {
companyName = String.valueOf(firstTask.getResult().get("CHECKED_COMPANY"));
}
if (!ObjectUtils.isEmpty(objectMap)) {
FeignClientResult<CompanyModel> companyModelFeignClientResult = Privilege.companyClient.queryByCompanyName(companyName);
if (!ObjectUtils.isEmpty(companyModelFeignClientResult.getResult()) && !ObjectUtils.isEmpty(companyModelFeignClientResult.getResult().getOrgCode())) {
//FeignClientResult<Set<AgencyUserModel>> setFeignClientResult = Privilege.agencyUserClient.queryByOrgCode(companyModelFeignClientResult.getResult().getOrgCode(), null);
Long sequenceNbr = companyModelFeignClientResult.getResult().getSequenceNbr();
// 查询企业对应角色下的用户
logger.info("向privilege发送参数roleId,companyId,{},{}", roleId, sequenceNbr);
FeignClientResult<List<AgencyUserModel>> listFeignClientResult = Privilege.agencyUserClient.queryByCompanyRoles(sequenceNbr, roleId, null, null);
logger.info("privilege返回用户信息,{}", JSONObject.toJSONString(listFeignClientResult));
if (!ObjectUtils.isEmpty(listFeignClientResult) && !ObjectUtils.isEmpty(listFeignClientResult.getResult())){
listFeignClientResult.getResult().forEach(item ->{
flow.add(item.getUserName());
task.add(item.getUserId());
});
}else {
throw new BadRequest("没有对应企业整改执行人!");
}
// if (!ObjectUtils.isEmpty(setFeignClientResult)) {
// setFeignClientResult.getResult().forEach(item -> {
// flow.add(item.getUserName());
// task.add(item.getUserId());
// });
// }
}
}
String userIds = String.join(",", flow);
String userIdsTask = String.join(",", task);
// 添加被检查企业下的人员id
objectMap.put("CHECKED_COMPANY_USERS", userIds);
objectMap.put("CHECKED_COMPANY_USER_ids", userIdsTask);
// 表单信息提交
FeignClientResult<String> submit = idxFeignService.submit(pageId, taskId, planInstanceId,"CHECKED_COMPANY_USER_ids", topic, tableName, objectMap);
// if ("200".equals(String.valueOf(submit.getStatus()))) {
// JSONObject jsonObject = new JSONObject();
// jsonObject.put("title", "企业整改");
// jsonObject.put("userIds", userIdsTask);
// logger.info("idx执行任务更新参数,{}", JSONObject.toJSONString(jsonObject));
// //FeignClientResult<JSONObject> jsonObjectFeignClientResult = idxFeignService.updateAmosTask(taskId, jsonObject);
// updateAmosTask(taskId, jsonObject);
// //logger.info("idx执行任务更新任务返回参数,{}", JSONObject.toJSONString(jsonObjectFeignClientResult));
//
// }
return "ok";
}
/***
* idx通用提交接口为异步,解决任务还未创建成功时执行更新失败
* @param taskId
* @param object
* @throws InterruptedException
*/
@Async
void updateAmosTask(String taskId, JSONObject object) throws InterruptedException {
Thread.sleep(1000*2);
FeignClientResult<JSONObject> jsonObjectFeignClientResult = idxFeignService.updateAmosTask(taskId, object);
logger.info("idx执行任务更新任务返回参数,{}", JSONObject.toJSONString(jsonObjectFeignClientResult));
}
private String dealNull2EmptyString(String t) {
return StringUtils.isEmpty(t) ? "" : t;
}
}
\ No newline at end of file
spring.datasource.url=jdbc:vastbase://${POSTGRESQL_IP_port}/${POSTGRESQL_NAME}?currentSchema=${TZS_IDX_BIZ_DATABASE}&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&noAccessToProcedureBodies=true&allowMultiQueries=true
spring.datasource.username=${POSTGRESQL_USER}
spring.datasource.password=${POSTGRESQL_PASSWORD}
#注册中心地址
eureka.client.service-url.defaultZone =http://admin:a1234560@192.168.249.13:10001/eureka/,http://admin:a1234560@192.168.249.139:10001/eureka/
eureka.instance.prefer-ip-address=true
eureka.instance.ip-address = 192.168.249.139
management.endpoint.health.show-details=always
management.endpoints.web.exposure.include=*
eureka.instance.health-check-url=http://elevator:${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://elevator:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://elevator:${server.port}${server.servlet.context-path}/doc.html
## ES properties:
spring.elasticsearch.rest.uris=${ELASTICSEARCH_REST_URIS}
elasticsearch.username=${ELASTICSEARCH_USERNAME}
elasticsearch.password= ${ELASTICSEARCH_PASSWORD}
## unit(h)
alertcall.es.synchrony.time=48
#redis properties:
spring.redis.cluster.nodes=${REDIS_CLUSTER_NODES}
spring.redis.password=${REDIS_PASSWORD}
spring.redis.cluster.max-redirects=3
spring.redis.timeout=10000
spring.redis.lettuce.cluster.refresh.adaptive=true
spring.redis.lettuce.cluster.refresh.period=2000
spring.redis.mode=cluster
#springboot指标显示器不使用默认的,使用自定义的MyRedisHealthIndicator
management.health.redis.enabled=false
##emqx
emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=${EMQX_BROKER}
emqx.client-user-name=${EMQX_USER}
emqx.client-password=${EMQX_PASSWORD}
tzs.cti.appkey=0a1b1cf1-a55b-447a-d275-02931f13b2fa
tzs.cti.secretkey=cae7c0f8-a7b8-9876-d69b-3eba8262898a
tzs.cti.url=http://192.168.249.178: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
fileserver.domain=https://rpm.yeeamos.com:8888/
org.filter.group.seq=1564150103147573249
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=192.168.249.139
tzs.auth.user.photo=/public/common/userPic.png
minio.url.path=${MINIO_FILESERVER_DOMAIN}/
#### 管理员变更机器人账号
tzs.admin.name=tzs_robot
tzs.admin.pwd=a1234567
##小程序appid
tzs.WxApp.appId=wx48a1b1915b10d14b
tzs.WxApp.secret=ac4f4a9d3c97676badb70c19a2f37b16
tzs.WxApp.grant-type=authorization_code
#气瓶充装信息定时同步至es
tzs.cylinder.fill.cron=0 0 12 * * ?
#气瓶基本信息定时同步至es
tzs.cylinder.info.cron=0 0 1 * * ?
outSystem.user.password=a1234560
amos.system.user.app-key=AMOS_STUDIO
amos.system.user.product=STUDIO_APP_WEB
##生成监管码前缀域名
regulatory_code_prefix=https://nav.sspai.top/tzs?code=
#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
eureka.client.service-url.defaultZone=http://172.16.10.230: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.32:${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.32:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://172.16.3.32:${server.port}${server.servlet.context-path}/doc.html
eureka.instance.ip-address=172.16.3.32
## ES properties:
elasticsearch.username=elastic
elasticsearch.password=a123456
spring.elasticsearch.rest.uris=http://172.16.10.230:9200
## unit(h)
alertcall.es.synchrony.time=48
#redis properties:
spring.redis.database=1
spring.redis.host=172.16.10.230
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.230: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.230
#\u6C14\u74F6\u5145\u88C5\u4FE1\u606F\u5B9A\u65F6\u540C\u6B65\u81F3es
tzs.cylinder.fill.cron=0 0 12 * * ?
#\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.230: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
spring.application.name=TZS-WEAPP
server.servlet.context-path=/weapp
server.port=11006
spring.profiles.active=dev
spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
logging.config=classpath:logback-${spring.profiles.active}.xml
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
logging.level.net.javacrumbs.shedlock=DEBUG
##liquibase
spring.liquibase.change-log = classpath:/db/changelog/changelog-master.xml
spring.liquibase.enabled= false
feign.client.config.default.connect-timeout=30000
feign.client.config.default.read-timeout=30000
## eureka properties:
eureka.client.registry-fetch-interval-seconds=5
eureka.instance.prefer-ip-address=true
management.endpoint.health.show-details=always
management.endpoints.web.exposure.include=*
eureka.instance.health-check-url-path=/actuator/health
eureka.instance.lease-expiration-duration-in-seconds=10
eureka.instance.lease-renewal-interval-in-seconds=5
eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator
eureka.instance.status-page-url-path=/actuator/info
eureka.instance.metadata-map.management.api-docs=http://localhost:${server.port}${server.servlet.context-path}/doc.html
#DB properties:
spring.datasource.driver-class-name=cn.com.vastbase.Driver
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.minimum-idle=10
spring.datasource.hikari.maximum-pool-size=25
spring.datasource.hikari.auto-commit=true
spring.datasource.hikari.idle-timeout=30000
spring.datasource.hikari.pool-name=DatebookHikariCP
spring.datasource.hikari.max-lifetime=120000
spring.datasource.hikari.connection-timeout=30000
spring.datasource.hikari.connection-test-query=SELECT 1
iot.fegin.name=AMOS-API-IOT
equip.fegin.name=AMOS-EQUIPMANAGE
supervision.feign.name = AMOS-SUPERVISION-API
security.systemctl.name=AMOS-API-SYSTEMCTL
jcs.company.topic.add=jcs/company/topic/add
jcs.company.topic.delete=jcs/company/topic/delete
## \uFFFD\u8C78\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uD94E\uDE33\uFFFD\uFFFD\uFFFD\uFFFD\u0161\uFFFD\uFFFD\u3CA5\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u58E9
control.fegin.name=JCS-API-CONTROL
## redis\uFFFD\uFFFD\u02B1\u02B1\uFFFD\uFFFD
redis.cache.failure.time=10800
failure.work.flow.processDefinitionKey=malfunction_repair
video.fegin.name=video
latentDanger.feign.name=AMOS-LATENT-DANGER
Knowledgebase.fegin.name=AMOS-API-KNOWLEDGEBASE
## \uFFFD\u8C78\uFFFD\uFFFD\u05AA\uFFFD\uFFFD\uFFFD\uFFFDv1
inform.work.flow.processDefinitionKey=equipment_inform_process_v1
## \uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u052E\uFFFD\uFFFD\uFFFD\u03F2\uFFFDID
fire-rescue=1432549862557130753
tzs.cti.appkey=4e805006-3fef-ae43-3915-a153731007c4
tzs.cti.secretkey=7bd29115-99ee-4f7d-1fb1-7c4719d5f43a
tzs.wechat.url=https://api.weixin.qq.com
tzs.wechat.appid=wx79aca5bb1cb4af92
tzs.wechat.secret=f3a12323ba731d282c3d4698c27c3e97
##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
mqtt.topic.cyl.warning.push=/tzs/cyl_cyl_warning
cti.user.name=tzs_cti
cti.user.pwd=a1234567
flc.sms.tempCode=SMS_TZS_0001
### \u7BA1\u7406\u5458\u53D8\u66F4\u673A\u5668\u4EBA\u8D26\u53F7
#tzs.admin.name=tzs_admin
## \u0524\uFFFD\uFFFD\u0368\u05AA\u0123\uFFFD\uFFFDid
tzs.wechat.tempId.warning=-pHsHLIjW8j-_AemoZycf6Dmu6iYc-YWWaJ0cAPGeUY
##\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0368\u05AA
tzs.wechat.tempId.supervise=P5XGbszS2Pc6kynvGjzPpZ--ikAwDZo6O7WdJ2EUxtE
## \uFFFD\uFFFD\uFFFD\u06BA\u0172\uFFFD\uFFFD\uFFFD\uFFFD\u00FB\uFFFDid\uFFFD\uFFFD\u01BD\u0328userId\uFFFD\uFFFD
tzs.wechat.test.userId=3393279
admin.product=AMOS-SERVICE-ADMIN
admin.appkey=AMOS_ADMIN
admin.user=admin_tzs
admin.password=a1234560
admin.product.web=AMOS-WEB-ADMIN
amos.secret.key=qazknife4j.production=false
knife4j.production=false
knife4j.enable=true
knife4j.basic.enable=true
knife4j.basic.username=admin
knife4j.basic.password=a1234560
spring.security.user.name=admin
spring.security.user.password=a1234560
spring.security.user.roles=SBA_ADMIN
## \u540E\u53F0\u6267\u884C\u673A\u5668\u4EBA\u8D26\u53F7\u914D\u7F6E
amos.system.user.user-name=robot_admin
amos.system.user.password=a1234567
amos.system.user.app-key=AMOS_STUDIO
amos.system.user.product=AMOS_STUDIO_WEB
## ??????????????topic
amos.operation.log=$share/${spring.application.name}//amos/operation/log
amos.agency.code=tzs
## ?????orgCode
regulator.unit.code=50
spring.main.allow-bean-definition-overriding=true
# \u82E5tzs\u548Cugp\u4E00\u8D77\uFF0C\u5219true
is.ugp=false
#\u5DE5\u4F5C\u53F0\u7528\u6237\u7EDF\u4E00\u663E\u793A\u5934\u50CF
tzs.auth.user.photo=/public/common/userPic.png
tzs.WxApp.appId=wx48a1b1915b10d14b
tzs.WxApp.secret=ac4f4a9d3c97676badb70c19a2f37b16
tzs.WxApp.grant-type=authorization_code
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd">
</databaseChangeLog>
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd">
<include file="applet-1.0.0.0.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">
<!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
<property name="LOG_HOME" value="log" />
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<property name="LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %-50.50logger{50} - %msg [%file:%line] %n" />
<!-- 按照每天生成日志文件 -->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<FileNamePattern>${LOG_HOME}/Tcm.log.%d{yyyy-MM-dd}.%i.log</FileNamePattern>
<!--日志文件保留天数-->
<MaxHistory>30</MaxHistory>
<!--日志文件大小-->
<MaxFileSize>30mb</MaxFileSize>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${LOG_PATTERN}</pattern>
</encoder>
</appender>
<!-- 控制台输出 -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${LOG_PATTERN}</pattern>
</encoder>
</appender>
<!-- &lt;!&ndash; ELK管理 &ndash;&gt;-->
<!-- <appender name="ELK" class="net.logstash.logback.appender.LogstashTcpSocketAppender">-->
<!-- <destination>172.16.10.230:4560</destination>-->
<!-- <encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder"/>-->
<!-- </appender>-->
<!-- show parameters for hibernate sql 专为 Hibernate 定制
<logger name="org.hibernate.type.descriptor.sql.BasicBinder" level="TRACE" />
<logger name="org.hibernate.type.descriptor.sql.BasicExtractor" level="DEBUG" />
<logger name="org.hibernate.SQL" level="DEBUG" />
<logger name="org.hibernate.engine.QueryParameters" level="DEBUG" />
<logger name="org.hibernate.engine.query.HQLQueryPlan" level="DEBUG" />
-->
<!--myibatis log configure-->
<logger name="com.apache.ibatis" level="debug"/>
<logger name="org.mybatis" level="debug" />
<logger name="java.sql.Connection" level="debug"/>
<logger name="java.sql.Statement" level="debug"/>
<logger name="java.sql.PreparedStatement" level="debug"/>
<logger name="org.springframework" level="debug"/>
<logger name="com.baomidou.mybatisplus" level="debug"/>
<logger name="org.apache.activemq" level="debug"/>
<logger name="org.typroject" level="debug"/>
<logger name="com.yeejoin" level="debug"/>
<!-- 日志输出级别 -->
<root level="error">
<!-- <appender-ref ref="FILE" /> -->
<appender-ref ref="STDOUT" />
<!-- <appender-ref ref="ELK" />-->
</root>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">
<!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
<property name="LOG_HOME" value="log" />
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<property name="LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %-50.50logger{50} - %msg [%file:%line] %n" />
<!-- 按照每天生成日志文件 -->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<FileNamePattern>${LOG_HOME}/96333.log.%d{yyyy-MM-dd}.%i.log</FileNamePattern>
<!--日志文件保留天数-->
<MaxHistory>30</MaxHistory>
<!--日志文件大小-->
<MaxFileSize>30mb</MaxFileSize>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${LOG_PATTERN}</pattern>
</encoder>
</appender>
<!-- 控制台输出 -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${LOG_PATTERN}</pattern>
</encoder>
</appender>
<!-- &lt;!&ndash; ELK管理 &ndash;&gt;-->
<!-- <appender name="ELK" class="net.logstash.logback.appender.LogstashTcpSocketAppender">-->
<!-- <destination>172.16.10.230:4560</destination>-->
<!-- <encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder"/>-->
<!-- </appender>-->
<!-- show parameters for hibernate sql 专为 Hibernate 定制
<logger name="org.hibernate.type.descriptor.sql.BasicBinder" level="TRACE" />
<logger name="org.hibernate.type.descriptor.sql.BasicExtractor" level="DEBUG" />
<logger name="org.hibernate.SQL" level="DEBUG" />
<logger name="org.hibernate.engine.QueryParameters" level="DEBUG" />
<logger name="org.hibernate.engine.query.HQLQueryPlan" level="DEBUG" />
-->
<!--myibatis log configure-->
<logger name="com.apache.ibatis" level="INFO"/>
<logger name="org.mybatis" level="INFO" />
<logger name="java.sql.Connection" level="INFO"/>
<logger name="java.sql.Statement" level="INFO"/>
<logger name="java.sql.PreparedStatement" level="INFO"/>
<logger name="org.springframework" level="INFO"/>
<logger name="com.baomidou.mybatisplus" level="INFO"/>
<logger name="org.apache.activemq" level="INFO"/>
<logger name="org.typroject" level="INFO"/>
<logger name="com.yeejoin" level="INFO"/>
<!-- 日志输出级别 -->
<root level="DEBUG">
<!-- <appender-ref ref="FILE" /> -->
<appender-ref ref="STDOUT" />
<!-- <appender-ref ref="ELK" />-->
</root>
</configuration>
\ 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