新增手机短信登录模块

master
Bbt 2 months ago
parent 380fb7340b
commit c3cde443ed

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="nbzhpc@120.195.33.173" uuid="7fb2efef-3a46-49d5-8f83-8772c1669ec0">
<driver-ref>mysql.8</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
<jdbc-url>jdbc:mysql://120.195.33.173:55306/nbzhpc</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
</component>
</project>

@ -4,7 +4,9 @@
<file url="file://$PROJECT_DIR$/ruoyi-admin/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/ruoyi-admin/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/ruoyi-common/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/ruoyi-common/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/ruoyi-framework/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/ruoyi-framework/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/ruoyi-generator/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/ruoyi-generator/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/ruoyi-quartz/src/main/java" charset="UTF-8" />
@ -13,6 +15,8 @@
<file url="file://$PROJECT_DIR$/ruoyi-safecompany/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/ruoyi-system/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/ruoyi-system/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
<file url="PROJECT" charset="UTF-8" />
</component>
</project>

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="TemplatesSettings">
<option name="templateConfigs">
<TemplateContext>
<option name="generateConfig">
<GenerateConfig>
<option name="annotationType" value="NONE" />
<option name="basePackage" value="com.ruoyi.business.enterpriserectification" />
<option name="basePath" value="src/main/java" />
<option name="classNameStrategy" value="camel" />
<option name="encoding" value="UTF-8" />
<option name="extraClassSuffix" value="" />
<option name="ignoreFieldPrefix" value="" />
<option name="ignoreFieldSuffix" value="" />
<option name="ignoreTablePrefix" value="" />
<option name="ignoreTableSuffix" value="" />
<option name="moduleName" value="ruoyi-safecompany" />
<option name="modulePath" value="$PROJECT_DIR$/ruoyi-safecompany" />
<option name="moduleUIInfoList">
<list>
<ModuleInfoGo>
<option name="basePath" value="src/main/java" />
<option name="configFileName" value="domain.ftl" />
<option name="configName" value="domain" />
<option name="encoding" value="UTF-8" />
<option name="fileName" value="${domain.fileName}" />
<option name="fileNameWithSuffix" value="${domain.fileName}.java" />
<option name="modulePath" value="$PROJECT_DIR$/ruoyi-safecompany" />
<option name="packageName" value="com.ruoyi.business.enterpriserectification.pojo" />
</ModuleInfoGo>
</list>
</option>
<option name="needToStringHashcodeEquals" value="true" />
<option name="needsComment" value="true" />
<option name="needsModel" value="true" />
<option name="relativePackage" value="pojo" />
<option name="superClass" value="" />
<option name="tableUIInfoList">
<list>
<TableUIInfo>
<option name="className" value="TbSafeCompanyStatisticsScore" />
<option name="tableName" value="tb_safe_company_statistics_score" />
</TableUIInfo>
</list>
</option>
<option name="templatesName" value="custom-model-swagger" />
</GenerateConfig>
</option>
<option name="moduleName" value="ruoyi-safecompany" />
<option name="projectPath" value="$PROJECT_DIR$" />
<option name="templateName" value="custom-model-swagger" />
</TemplateContext>
</option>
</component>
</project>

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

@ -169,6 +169,12 @@
<artifactId>ruoyi-common</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 安惠商企-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-safecompany</artifactId>
<version>${ruoyi.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

@ -74,6 +74,10 @@
<artifactId>ruoyi-safecompany</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
</dependencies>

@ -2,13 +2,34 @@ package com.ruoyi.web.controller.common;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.security.MessageDigest;
import java.util.Random;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.annotation.Resource;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.enums.UserStatus;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.service.ISysConfigService;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.web.core.config.SmsConfig;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.FastByteArrayOutputStream;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import com.google.code.kaptcha.Producer;
import com.ruoyi.common.config.RuoYiConfig;
@ -18,13 +39,13 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.sign.Base64;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.system.service.ISysConfigService;
/**
*
*
* @author ruoyi
*/
@Api(tags = "验证码")
@RestController
public class CaptchaController
{
@ -39,10 +60,16 @@ public class CaptchaController
@Autowired
private ISysConfigService configService;
@Autowired
private ISysUserService userService;
@Autowired
private SmsConfig smsConfig;
/**
*
*/
@GetMapping("/captchaImage")
@ApiOperation("生成验证码")
public AjaxResult getCode(HttpServletResponse response) throws IOException
{
AjaxResult ajax = AjaxResult.success();
@ -91,4 +118,150 @@ public class CaptchaController
ajax.put("img", Base64.encode(os.toByteArray()));
return ajax;
}
/**
*
* @param phoneNumber
*/
@ApiOperation("发送短信验证码")
@PostMapping("/sendSmsCode")
@ApiImplicitParams({
@ApiImplicitParam(name = "phoneNumber", value = "手机号")
})
public AjaxResult sendSmsCode(String phoneNumber) throws Exception {
// 手机号码
AjaxResult ajax = AjaxResult.success();
if (!isValidPhoneNumber(phoneNumber)) {
throw new ServiceException("登录用户:" + phoneNumber+ " 手机号不符合规范");
}
// 校验手机号
SysUser user = userService.selectUserByPhonenumber(phoneNumber);
if (StringUtils.isNull(user)) {
throw new ServiceException("登录用户:" + phoneNumber+ " 不存在");
}else if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) {
throw new ServiceException("对不起,您的账号:" + phoneNumber+ " 已被删除");
}else if (UserStatus.DISABLE.getCode().equals(user.getStatus())) {
throw new ServiceException("对不起,您的账号:" + phoneNumber+ " 已停用");
}
// 生成短信验证码
String smsCode = generateVerificationCode();
// 发送短信(实际按系统业务实现)
sendSms(phoneNumber,ajax,smsCode);
// 保存redis缓存
String uuid = IdUtils.simpleUUID();
String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid;
redisCache.setCacheObject(verifyKey, smsCode, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
ajax.put("uuid", uuid);
return ajax;
}
// 发送短信的方法
public void sendSms(String phoneNumber,AjaxResult ajax,String verificationCode) throws Exception {
// if (!isValidPhoneNumber(phoneNumber)) {
// ajax.put("flag", "false");
// ajax.put("msg", "手机号格式不正确");
// return ajax;
// }
//// String verificationCode = generateVerificationCode();
// String ecName = "宁波市公安局镇海分局";
// String apId = "nbzhpc";
// String secretKey = "WaTu123!@#";
// String content = "您的安惠商企验证码是:" + verificationCode;
// String sign = "0GTEcXOJl";
// String addSerial = "";
String ecName = smsConfig.getEcName();
String apId = smsConfig.getApId();
String secretKey = smsConfig.getSecretKey();
String content = "您的安惠商企登陆平台验证码是:" + verificationCode;
String sign = smsConfig.getSign();
String addSerial = smsConfig.getAddSerial();
// 生成MAC
String mac = generateMAC(ecName, apId, secretKey, phoneNumber, content, sign, addSerial);
// 创建请求体的JSON字符串
String jsonInputString = String.format(
"{\"addSerial\":\"%s\",\"apId\":\"%s\",\"content\":\"%s\",\"ecName\":\"%s\",\"mAC\":\"%s\",\"mobiles\":\"%s\",\"secretKey\":\"%s\",\"sign\":\"%s\"}",
addSerial, apId, content, ecName, mac, phoneNumber, secretKey, sign
);
// 将JSON字符串编码为Base64
String base64EncodedJson = java.util.Base64.getEncoder().encodeToString(jsonInputString.getBytes("utf-8"));
try {
// 创建URL对象
URL url = new URL("http://112.35.1.155:1992/sms/norsubmit");
// 打开连接
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
// 设置请求方法为POST
connection.setRequestMethod("POST");
// 设置请求头
connection.setRequestProperty("Content-Type", "application/json; utf-8");
connection.setRequestProperty("Accept", "application/json");
connection.setDoOutput(true);
// 发送请求
try (OutputStream os = connection.getOutputStream()) {
byte[] input = base64EncodedJson.getBytes("utf-8");
os.write(input, 0, input.length);
}
// 获取响应码
int responseCode = connection.getResponseCode();
if (responseCode != HttpURLConnection.HTTP_OK) {
ajax.put("flag", "false");
ajax.put("msg", "短信发送失败");
}
ajax.put("flag", "true");
ajax.put("msg", "短信发送成功");
} catch (Exception e) {
ajax.put("flag", "false");
ajax.put("msg", "短信发送失败");
}
}
// 生成6位数验证码
public static String generateVerificationCode() {
Random random = new Random();
int code = 100000 + random.nextInt(900000);
return String.valueOf(code);
}
// 验证手机号格式
public static boolean isValidPhoneNumber(String phoneNumber) {
// 这里只是一个简单的验证示例,实际验证可能根据具体国家或运营商规则不同
String regex = "^[1][3-9][0-9]{9}$";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(phoneNumber);
return matcher.matches();
}
// 生成MAC
public static String generateMAC(String ecName, String apId, String secretKey, String mobiles, String content, String sign, String addSerial) {
String input = ecName + apId + secretKey + mobiles + content + sign + addSerial;
return md5(input);
}
private static String md5(String input) {
try {
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] messageDigest = md.digest(input.getBytes());
StringBuilder sb = new StringBuilder();
for (byte b : messageDigest) {
sb.append(String.format("%02x", b));
}
return sb.toString();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}

@ -4,6 +4,9 @@ import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -26,6 +29,7 @@ import com.ruoyi.framework.config.ServerConfig;
*
* @author ruoyi
*/
@Api(tags = "公共方法")
@RestController
@RequestMapping("/common")
public class CommonController
@ -44,6 +48,7 @@ public class CommonController
* @param delete
*/
@GetMapping("/download")
@ApiOperation("通用下载请求")
public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request)
{
try
@ -73,6 +78,7 @@ public class CommonController
*
*/
@PostMapping("/upload")
@ApiOperation("通用上传请求(单个)")
public AjaxResult uploadFile(MultipartFile file) throws Exception
{
try
@ -99,6 +105,7 @@ public class CommonController
*
*/
@PostMapping("/uploads")
@ApiOperation("通用上传请求(单个)")
public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception
{
try

@ -2,11 +2,14 @@ package com.ruoyi.web.controller.system;
import java.util.List;
import java.util.Set;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysMenu;
@ -22,6 +25,7 @@ import com.ruoyi.system.service.ISysMenuService;
*
* @author ruoyi
*/
@Api(tags = "登录验证")
@RestController
public class SysLoginController
{
@ -34,6 +38,7 @@ public class SysLoginController
@Autowired
private SysPermissionService permissionService;
/**
*
*
@ -41,6 +46,7 @@ public class SysLoginController
* @return
*/
@PostMapping("/login")
@ApiOperation("登录方法")
public AjaxResult login(@RequestBody LoginBody loginBody)
{
AjaxResult ajax = AjaxResult.success();
@ -57,6 +63,7 @@ public class SysLoginController
* @return
*/
@GetMapping("getInfo")
@ApiOperation("获取用户信息")
public AjaxResult getInfo()
{
SysUser user = SecurityUtils.getLoginUser().getUser();
@ -71,6 +78,32 @@ public class SysLoginController
return ajax;
}
/**
* @description
* @author
* @param[1] null
* @throws
* @time 2024/7/5 11:46
*
*/
@ApiOperation("短信验证码登录验证")
@PostMapping("/smsLogin")
@ApiImplicitParams({
@ApiImplicitParam(name = "phoneNumber", value = "手机号"),
@ApiImplicitParam(name = "code", value = "验证码"),
@ApiImplicitParam(name = "uuid", value = "唯一标识符")
})
public AjaxResult verifySmsCode(String phoneNumber, String code, String uuid) {
return loginService.smsLogin(phoneNumber, code, uuid);
}
/**
*
*

@ -0,0 +1,37 @@
package com.ruoyi.web.core.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
/**
* @Author
* @Date 2024/7/5 14:30
* @Version 1.0
*/
@ConfigurationProperties(prefix = "tencent.sms")
@Configuration
@Data
public class SmsConfig {
/**
*
*/
private String ecName;
/**
*
*/
private String secretKey;
/**
* SDKAppID
*/
private String apId;
/**
*
*/
private String sign;
/**
*
*/
private String addSerial;
}

@ -113,7 +113,7 @@ public class SwaggerConfig
// 用ApiInfoBuilder进行定制
return new ApiInfoBuilder()
// 设置标题
.title("标题:若依管理系统_接口文档")
.title("标题:安惠商企管理系统_接口文档")
// 描述
.description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
// 作者信息

@ -6,16 +6,16 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://120.195.33.173:55306/nbzhpc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://192.168.0.80:55306/nbzhpc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: '!QAZ1qaz'
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
enabled: true
url: jdbc:mysql://192.168.0.80:55306/nbzh?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: '!QAZ1qaz'
# 初始连接数
initialSize: 5
# 最小连接池数量

@ -18,10 +18,10 @@ ruoyi:
# 开发环境配置
server:
# 服务器的HTTP端口默认为8080
port: 8080
port: 8799
servlet:
# 应用的访问路径
context-path: /
context-path: /zhpcapi
tomcat:
# tomcat的URI编码
uri-encoding: UTF-8
@ -70,7 +70,8 @@ spring:
# redis 配置
redis:
# 地址
host: 120.195.33.173
# host: 120.195.33.173
host: 192.168.0.78
# 端口默认为6379
port: 26379
# 数据库索引
@ -132,7 +133,7 @@ swagger:
# 是否开启swagger
enabled: true
# 请求前缀
pathMapping: /dev-api
pathMapping: /zhpcapi
knife4j:
@ -153,3 +154,15 @@ snowid:
workerId: 1
#数据中心id
datacenterId: 1
tencent:
sms:
# 企业名称
ecName: "宁波市公安局镇海分局"
# 短信账户名称
apId: "nbzhpc"
# 账号密码
secretKey: "WaTu123!@#"
# 配置签名内容
sign: "0GTEcXOJl"
# 配置模板ID
addSerial:

@ -113,6 +113,10 @@ public class SysUser extends BaseTenantEntity {
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
private Date loginDate;
public Long getTenantId() {
return tenantId;
}
@ -226,6 +230,18 @@ public class SysUser extends BaseTenantEntity {
return phoneNumber;
}
@Excel(name = "所属公司")
private String companyName;
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
@ -349,6 +365,7 @@ public class SysUser extends BaseTenantEntity {
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("companyName", getCompanyName())
.append("dept", getDept())
.toString();

@ -1,6 +1,8 @@
package com.ruoyi.framework.config;
import com.ruoyi.framework.security.SmsCodeAuthenticationProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.http.HttpMethod;
import org.springframework.security.authentication.AuthenticationManager;
@ -32,7 +34,20 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
*
*/
@Autowired
private UserDetailsService userDetailsService;
@Qualifier("userDetailsByUsername")
private UserDetailsService userDetailsByUsername;
/**
* @description
* @author
* @param[1] null
* @throws
* @time 2024/7/5 16:04
*
*/
@Autowired
@Qualifier("userDetailsByPhonenumber")
private UserDetailsService userDetailsByPhonenumber;
/**
*
@ -98,7 +113,6 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
// 注解标记允许匿名访问的url
ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry registry = httpSecurity.authorizeRequests();
permitAllUrl.getUrls().forEach(url -> registry.antMatchers(url).permitAll());
httpSecurity
// CSRF禁用因为不使用session
.csrf().disable()
@ -111,7 +125,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
// 过滤请求
.authorizeRequests()
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
.antMatchers("/login", "/register", "/captchaImage").permitAll()
.antMatchers("/login", "/register", "/captchaImage","/sendSmsCode","/smsLogin").permitAll()
// 静态资源,可匿名访问
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
@ -126,6 +140,10 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
// 添加CORS filter
httpSecurity.addFilterBefore(corsFilter, JwtAuthenticationTokenFilter.class);
httpSecurity.addFilterBefore(corsFilter, LogoutFilter.class);
// httpSecurity.addFilterBefore(corsFilter, LogoutFilter.class)
// //手机验证码的provider
// .authenticationProvider(smsCodeAuthenticationProvider);
}
/**
@ -143,6 +161,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception
{
auth.userDetailsService(userDetailsService).passwordEncoder(bCryptPasswordEncoder());
//手机验证码的orovider
auth.authenticationProvider(new SmsCodeAuthenticationProvider(userDetailsByPhonenumber));
auth.userDetailsService(userDetailsByUsername).passwordEncoder(bCryptPasswordEncoder());
}
}

@ -0,0 +1,52 @@
package com.ruoyi.framework.security;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
/**
* @Author
* @Date 2024/7/5 15:55
* @Version 1.0
* token
*/
public class SmsCodeAuthenticationProvider implements AuthenticationProvider {
private UserDetailsService userDetailsService;
public SmsCodeAuthenticationProvider(UserDetailsService userDetailsService){
setUserDetailsService(userDetailsService);
}
/**
* authenticate
*/
@Override
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
SmsCodeAuthenticationToken authenticationToken = (SmsCodeAuthenticationToken) authentication;
String telephone = (String) authenticationToken.getPrincipal();
// 委托 UserDetailsService 查找系统用户
UserDetails userDetails = userDetailsService.loadUserByUsername(telephone);
// 鉴权成功,返回一个拥有鉴权的 AbstractAuthenticationToken
SmsCodeAuthenticationToken authenticationResult = new SmsCodeAuthenticationToken(userDetails, userDetails.getAuthorities());
authenticationResult.setDetails(authenticationToken.getDetails());
return authenticationResult;
}
/**
* supports AuthenticationProvider
*/
@Override
public boolean supports(Class<?> authentication) {
return SmsCodeAuthenticationToken.class.isAssignableFrom(authentication);
}
public UserDetailsService getUserDetailsService() {
return userDetailsService;
}
public void setUserDetailsService(UserDetailsService userDetailsService) {
this.userDetailsService = userDetailsService;
}
}

@ -0,0 +1,63 @@
package com.ruoyi.framework.security;
import org.springframework.security.authentication.AbstractAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.SpringSecurityCoreVersion;
import java.util.Collection;
/**
* @Author
* @Date 2024/7/5 15:56
* @Version 1.0
*/
public class SmsCodeAuthenticationToken extends AbstractAuthenticationToken {
private static final long serialVersionUID = SpringSecurityCoreVersion.SERIAL_VERSION_UID;
/**
*
*/
private final Object principal;
/**
*
*/
public SmsCodeAuthenticationToken(Object principal) {
super(null);
this.principal = principal;
setAuthenticated(false);
}
/**
*
*/
public SmsCodeAuthenticationToken(Object principal, Collection<? extends GrantedAuthority> authorities) {
super(authorities);
this.principal = principal;
super.setAuthenticated(true);
}
@Override
public Object getCredentials() {
return null;
}
@Override
public Object getPrincipal() {
return this.principal;
}
@Override
public void setAuthenticated(boolean isAuthenticated) throws IllegalArgumentException {
if (isAuthenticated) {
throw new IllegalArgumentException(
"Cannot set this token to trusted - use constructor which takes a GrantedAuthority list instead");
}
super.setAuthenticated(false);
}
@Override
public void eraseCredentials() {
super.eraseCredentials();
}
}

@ -1,6 +1,10 @@
package com.ruoyi.framework.web.service;
import javax.annotation.Resource;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.framework.security.SmsCodeAuthenticationToken;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.BadCredentialsException;
@ -28,6 +32,15 @@ import com.ruoyi.framework.manager.factory.AsyncFactory;
import com.ruoyi.framework.security.context.AuthenticationContextHolder;
import com.ruoyi.system.service.ISysConfigService;
import com.ruoyi.system.service.ISysUserService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.HashMap;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
/**
*
@ -52,6 +65,11 @@ public class SysLoginService
@Autowired
private ISysConfigService configService;
/**
*
*
@ -178,4 +196,62 @@ public class SysLoginService
sysUser.setLoginDate(DateUtils.getNowDate());
userService.updateUserProfile(sysUser);
}
/**
*
* @param phoneNumber
* @param code
* @param uuid
*/
public AjaxResult smsLogin(String phoneNumber, String code, String uuid) {
// 手机号码
// String phoneNumber = dto.getPhoneNumber();
// 校验验证码
String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid;
String captcha = redisCache.getCacheObject(verifyKey);
if(captcha == null) {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(phoneNumber, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")));
// 抛出一个验证码过期异常
throw new CaptchaExpireException();
}
if(!captcha.equals(code.trim())){
AsyncManager.me().execute(AsyncFactory.recordLogininfor(phoneNumber, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
// 抛出一个验证码错误的异常
throw new CaptchaException();
}
redisCache.deleteObject(verifyKey);
// 用户验证
Authentication authentication = null;
try {
// 该方法会去调用UserDetailsByPhonenumberServiceImpl.loadUserByUsername
authentication = authenticationManager.authenticate(new SmsCodeAuthenticationToken(phoneNumber));
} catch (Exception e) {
if (e instanceof BadCredentialsException) {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(phoneNumber,
Constants.LOGIN_FAIL, MessageUtils.message("account.not.incorrect")));
throw new UserPasswordNotMatchException();
} else {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(phoneNumber,
Constants.LOGIN_FAIL, e.getMessage()));
throw new ServiceException(e.getMessage());
}
}
// 执行异步任务,记录登录信息
AsyncManager.me().execute(AsyncFactory.recordLogininfor(phoneNumber,
Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
// 获取登录人信息
LoginUser loginUser = (LoginUser) authentication.getPrincipal();
// 修改最近登录IP和登录时间
recordLoginInfo(loginUser.getUserId());
// 生成token
String token = tokenService.createToken(loginUser);
// 返回token给前端
AjaxResult ajax = AjaxResult.success();
ajax.put(Constants.TOKEN, token);
return ajax;
}
}

@ -0,0 +1,55 @@
package com.ruoyi.framework.web.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.enums.UserStatus;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.service.ISysUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
/**
* @Author
* @Date 2024/7/5 14:53
* @Version 1.0
*/
@Service("userDetailsByPhonenumber")
public class UserDetailsByPhonenumberServiceImpl implements UserDetailsService {
private static final Logger log = LoggerFactory.getLogger(UserDetailsByPhonenumberServiceImpl.class);
@Autowired
private ISysUserService userService;
@Autowired
private SysPermissionService permissionService;
@Override
public UserDetails loadUserByUsername(String phoneNumber) throws UsernameNotFoundException {
// 防止漏查角色等所需的信息尽量模仿根据用户名查用户的方法开发ISysUserService.selectUserByUserName(username)
SysUser user = userService.selectUserByPhonenumber(phoneNumber);
if (StringUtils.isNull(user)) {
log.info("登录用户:{} 不存在.", phoneNumber);
throw new ServiceException("登录用户:" + phoneNumber+ " 不存在");
} else if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) {
log.info("登录用户:{} 已被删除.", phoneNumber);
throw new ServiceException("对不起,您的账号:" + phoneNumber+ " 已被删除");
} else if (UserStatus.DISABLE.getCode().equals(user.getStatus())) {
log.info("登录用户:{} 已被停用.", phoneNumber);
throw new ServiceException("对不起,您的账号:" + phoneNumber+ " 已停用");
}
return createLoginUser(user);
}
public UserDetails createLoginUser(SysUser user) {
return new LoginUser(user.getUserId(), user.getDeptId(), user, permissionService.getMenuPermission(user));
// return new LoginUser(user, permissionService.getMenuPermission(user));
}
}

@ -19,7 +19,7 @@ import com.ruoyi.system.service.ISysUserService;
*
* @author ruoyi
*/
@Service
@Service("userDetailsByUsername")
public class UserDetailsServiceImpl implements UserDetailsService
{
private static final Logger log = LoggerFactory.getLogger(UserDetailsServiceImpl.class);

@ -0,0 +1,30 @@
package com.ruoyi.business.enterpriserectification.bo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class TbSafeRuleOneVo {
private Long id;
private String levelIndexOne;
private String levelIndexTwo;
private String levelIndexThree;
private String note;
private Integer levelIndex;
private List<TbSafeRuleTwoVo> tbSafeRuleTwoVoList;
}

@ -0,0 +1,22 @@
package com.ruoyi.business.enterpriserectification.bo;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
public class TbSafeRuleThreeVo {
private Long id;
private String levelIndexOne;
private String levelIndexTwo;
private String levelIndexThree;
private String note;
private Integer levelIndex;
}

@ -0,0 +1,26 @@
package com.ruoyi.business.enterpriserectification.bo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = false)
public class TbSafeRuleTwoVo {
private Long id;
private String levelIndexOne;
private String levelIndexTwo;
private String levelIndexThree;
private String note;
private Integer levelIndex;
private List<TbSafeRuleThreeVo> tbSafeRuleThreeVoList;
}

@ -0,0 +1,98 @@
package com.ruoyi.business.enterpriserectification.bo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.system.until.EntiyUntil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
/**
* @Author
* @Date 2024/7/2 19:21
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="TbSynergism对象", description="整改信息表")
public class TbSynergismParmas extends EntiyUntil {
/**
*
*/
@ApiModelProperty("清单生成时间")
private Date checklistGenerationTime;
/**
*
*/
@ApiModelProperty("整改截止日期")
private Date rectificationDeadline;
/**
*
*/
@Size(max= 50,message="编码长度不能超过50")
@ApiModelProperty("整改状态0:已完成;1:整改中;2:未完成")
@Length(max= 50,message="编码长度不能超过50")
private String rectificationStatus;
/**
*
*/
@Size(max= 255,message="编码长度不能超过255")
@ApiModelProperty("异常类型")
@Length(max= 255,message="编码长度不能超过255")
private String controlDeductionItem;
/**
*
*/
@Size(max= 255,message="编码长度不能超过255")
@ApiModelProperty("要素异常明细")
@Length(max= 255,message="编码长度不能超过255")
private String elementAbnormalDetail;
/**
*
*/
@Size(max= 255,message="编码长度不能超过255")
@ApiModelProperty("整改结果0:已完成;1:整改中;2:未完成")
@Length(max= 255,message="编码长度不能超过255")
private String rectificationResult;
/**
*
*/
@ApiModelProperty("整改日期")
private Date updateTime;
/**
* 0:;1:
*/
@Size(max= -1,message="编码长度不能超过-1")
@ApiModelProperty("0:不活跃;1:活跃")
@Length(max= -1,message="编码长度不能超过-1")
private String isActive;
/**
*
*/
@Size(max= 255,message="编码长度不能超过255")
@ApiModelProperty("整改结果详情")
@Length(max= 255,message="编码长度不能超过255")
private String rectificationResultDefult;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date startTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endTime;
@ApiModelProperty("查询风险开始时间")
private Date riskStartTime;
@ApiModelProperty("查询风险结束时间")
private Date riskEndTime;
}

@ -0,0 +1,240 @@
package com.ruoyi.business.enterpriserectification.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.ruoyi.business.enterpriserectification.bo.TbSafeRuleTwoVo;
import com.ruoyi.business.enterpriserectification.bo.TbSynergismParmas;
import com.ruoyi.business.enterpriserectification.pojo.*;
import com.ruoyi.business.enterpriserectification.service.*;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.enums.RectificationStatusEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
/**
* @Author
* @Date 2024/6/28 19:15
* @Version 1.0
*
*/
@Api(tags = "企业整改")
@RestController
@RequiredArgsConstructor
@RequestMapping("/rectification")
public class TbCompanyRectifictionController extends BaseController {
private final TbSafeCompanyStatisticsScoreDetailService tbSafeCompanyStatisticsScoreDetailService;
private final TbSynergismEnterpriseSupervisionService tbSynergismEnterpriseSupervisionService;
private final TbSafeCompanyStatisticsScoreService tbSafeCompanyStatisticsScoreService;
// private final TbSpecialCountRecordService tbSpecialCountRecordService;
private final TbCompanyInfoService tbCompanyInfoService;
private final TbSafeRuleService tbSafeRuleService;
/**
* @description
* @author
* @param[1] null
* @throws
* @time 2024/6/29 11:40
*
*/
@PostMapping("/list")
@ApiOperation("查询企业整改列表")
@DataSource(value = DataSourceType.SLAVE)
@ApiImplicitParams({
@ApiImplicitParam(name = "pageSize", value = "页数大小"),
@ApiImplicitParam(name = "pageNum", value = "页数")
})
public TableDataInfo riskgovernancelist(TbSynergismParmas tbSynergismParmas) {
startPage();
//填充条件
LambdaQueryWrapper<TbSynergismEnterpriseSupervision> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(TbSynergismEnterpriseSupervision::getEnterpriseName, getLoginUserInfo());
//整改状态
if (tbSynergismParmas.getRectificationStatus() != null) {
wrapper.eq(TbSynergismEnterpriseSupervision::getRectificationStatus, RectificationStatusEnum.getStatusByCode(tbSynergismParmas.getRectificationStatus()));
}
//生成时间区间
if (tbSynergismParmas.getRiskStartTime() != null && tbSynergismParmas.getRiskEndTime() != null ) {
wrapper.between(TbSynergismEnterpriseSupervision::getChecklistGenerationTime, tbSynergismParmas.getRiskStartTime(), tbSynergismParmas.getRiskEndTime());
}
//整改完成区间
if (tbSynergismParmas.getStartTime() != null && tbSynergismParmas.getEndTime() != null ) {
wrapper.between(TbSynergismEnterpriseSupervision::getUpdateTime, tbSynergismParmas.getStartTime(), tbSynergismParmas.getEndTime());
}
//二级异常
if (tbSynergismParmas.getControlDeductionItem() != null) {
wrapper.eq(TbSynergismEnterpriseSupervision::getControlDeductionItem, tbSynergismParmas.getControlDeductionItem());
}
//三级异常(详情)
if (tbSynergismParmas.getElementAbnormalDetail() != null) {
wrapper.eq(TbSynergismEnterpriseSupervision::getElementAbnormalDetail, tbSynergismParmas.getElementAbnormalDetail());
}
List<TbSynergismEnterpriseSupervision> list = tbSynergismEnterpriseSupervisionService.list(wrapper);
list.forEach(s -> {
s.setEndTime(s.getUpdateTime());
});
return getDataTable(list);
}
/**
* @description
* @author
* @param[1] null
* @throws
* @time 2024/6/29 11:51
*
* id
*/
@PostMapping("/updatecompanystatus")
@ApiOperation("企业整改按钮")
@DataSource(value = DataSourceType.SLAVE)
public AjaxResult updatecompanystatus(Long id) {
TbSynergismEnterpriseSupervision serviceById = tbSynergismEnterpriseSupervisionService.getById(id);
serviceById.setRectificationStatus(RectificationStatusEnum.SUCCESS.getStatus());
serviceById.setRectificationResult(RectificationStatusEnum.SUCCESS.getStatus());
serviceById.setUpdateTime(new Date());
tbSynergismEnterpriseSupervisionService.saveOrUpdate(serviceById);
return success();
}
/**
* @description
* @author
* @param[1] null
* @throws
* @time 2024/6/29 11:52
*
*/
@PostMapping("/countrank")
@ApiOperation("平安指数分数以及排名")
@DataSource(value = DataSourceType.SLAVE)
public AjaxResult countrank() {
//获取所有企业的0及指标
// String companyname = getLoginUserInfo();
// TbCompanyInfo companyInfo = tbCompanyInfoService.getOne(new LambdaQueryWrapper<TbCompanyInfo>().eq(TbCompanyInfo::getCompanyName, companyname));
// if (companyInfo == null) {
// // 处理找不到企业信息的情况
// return null;
// }
TbCompanyInfo companyInfo = getLoginUserCompanyInfo();
if (companyInfo == null) {
// 处理找不到企业信息的情况
return null;
}
String now = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM"));
List<TbSafeCompanyStatisticsScore> scores = tbSafeCompanyStatisticsScoreService.list(
new LambdaQueryWrapper<TbSafeCompanyStatisticsScore>()
.eq(TbSafeCompanyStatisticsScore::getStatisticsDate, now)
.eq(TbSafeCompanyStatisticsScore::getScoreType, "month")
);
// 使用Stream API进行排序但注意流本身不直接支持索引
scores.sort(Comparator.comparingDouble(TbSafeCompanyStatisticsScore::getScore).reversed());
OptionalInt optionalRank = IntStream.range(0, scores.size())
.filter(index -> scores.get(index).getCompanyId().equals(companyInfo.getId()))
.findFirst(); // 这将返回第一个匹配的索引(如果存在)
Map<String, Object> resultMap = new HashMap<>();
if (optionalRank.isPresent()) {
resultMap.put("rank", optionalRank.getAsInt() + 1); // 排名从1开始
resultMap.put("score", scores.get(optionalRank.getAsInt()).getScore());
} else {
resultMap.put("rank", "Not Found");
}
return success(resultMap);
}
/**
* @description
* @author
* @param[1] null
* @throws
* @time 2024/6/29 14:11
*
*/
@PostMapping("/countscore")
@ApiOperation("平安指数分数(八个一级指标)")
@DataSource(value = DataSourceType.SLAVE)
public AjaxResult countscore() {
TbCompanyInfo one = getLoginUserCompanyInfo();
if (one == null) {
// 处理找不到企业信息的情况
return null;
}
//根据公司id获取1级指标
String now = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM"));
List<TbSafeCompanyStatisticsScoreDetail> list = tbSafeCompanyStatisticsScoreDetailService.list(new LambdaQueryWrapper<TbSafeCompanyStatisticsScoreDetail>()
.eq(TbSafeCompanyStatisticsScoreDetail::getCompanyId, one.getId())
.eq(TbSafeCompanyStatisticsScoreDetail::getLevelIndex, "1")
.eq(TbSafeCompanyStatisticsScoreDetail::getStatisticsDate, now)
.eq(TbSafeCompanyStatisticsScoreDetail::getScoreType, "month"));
List<TbSafeCompanyStatisticsScoreDetail> collect = list.stream()
.filter(s -> s.getLevelIndexOne() != null && !Objects.equals(s.getLevelIndexOne(), "防疫安全"))
.collect(Collectors.toList());
return success(collect);
}
/**
* @description
* @author
* @param[1] null
* @throws
* @time 2024/6/29 14:14
*
*/
@GetMapping("/errorType")
@ApiOperation("异常类型")
public AjaxResult errorType() {
//根据异常id进行修改状态
List<TbSafeRuleTwoVo> ruleTwo = tbSafeRuleService.getRuleTwo();
return success(ruleTwo);
}
/**
* @description
* @author
* @param[1] null
* @throws
* @time 2024/6/29 11:06
*
*/
public String getLoginUserInfo(){
LoginUser loginUser = SecurityUtils.getLoginUser();
//获取登陆人员所在公司
return loginUser.getUser().getCompanyName();
}
@GetMapping("/getLoginUserInfo")
@ApiOperation("获取公司基本信息")
public TbCompanyInfo getLoginUserCompanyInfo(){
LoginUser loginUser = SecurityUtils.getLoginUser();
//获取登陆人员所在公司
return tbCompanyInfoService.getOne(new LambdaQueryWrapper<TbCompanyInfo>().eq(TbCompanyInfo::getCompanyName, loginUser.getUser().getCompanyName()));
}
}

@ -0,0 +1,18 @@
package com.ruoyi.business.enterpriserectification.mapper;
import com.ruoyi.business.enterpriserectification.pojo.TbCompanyInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author
* @description tb_company_info()Mapper
* @createDate 2024-07-01 21:37:46
* @Entity com.ruoyi.business.enterpriserectification.pojo.TbCompanyInfo
*/
public interface TbCompanyInfoMapper extends BaseMapper<TbCompanyInfo> {
}

@ -0,0 +1,18 @@
package com.ruoyi.business.enterpriserectification.mapper;
import com.ruoyi.business.enterpriserectification.pojo.TbSafeCompanyStatisticsScoreDetail;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author
* @description tb_safe_company_statistics_score_detail()Mapper
* @createDate 2024-07-02 14:06:55
* @Entity com.ruoyi.business.enterpriserectification.pojo.TbSafeCompanyStatisticsScoreDetail
*/
public interface TbSafeCompanyStatisticsScoreDetailMapper extends BaseMapper<TbSafeCompanyStatisticsScoreDetail> {
}

@ -0,0 +1,18 @@
package com.ruoyi.business.enterpriserectification.mapper;
import com.ruoyi.business.enterpriserectification.pojo.TbSafeCompanyStatisticsScore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author
* @description tb_safe_company_statistics_score()Mapper
* @createDate 2024-07-02 14:36:31
* @Entity com.ruoyi.business.enterpriserectification.pojo.TbSafeCompanyStatisticsScore
*/
public interface TbSafeCompanyStatisticsScoreMapper extends BaseMapper<TbSafeCompanyStatisticsScore> {
}

@ -0,0 +1,18 @@
package com.ruoyi.business.enterpriserectification.mapper;
import com.ruoyi.business.enterpriserectification.pojo.TbSafeRule;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author
* @description tb_safe_rule()Mapper
* @createDate 2024-07-02 11:09:54
* @Entity com.ruoyi.business.enterpriserectification.pojo.TbSafeRule
*/
public interface TbSafeRuleMapper extends BaseMapper<TbSafeRule> {
}

@ -0,0 +1,18 @@
package com.ruoyi.business.enterpriserectification.mapper;
import com.ruoyi.business.enterpriserectification.pojo.TbSpecialCountRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author
* @description tb_special_count_record()Mapper
* @createDate 2024-07-01 19:21:53
* @Entity com.ruoyi.business.enterpriserectification.pojo.TbSpecialCountRecord
*/
public interface TbSpecialCountRecordMapper extends BaseMapper<TbSpecialCountRecord> {
}

@ -0,0 +1,18 @@
package com.ruoyi.business.enterpriserectification.mapper;
import com.ruoyi.business.enterpriserectification.pojo.TbSynergismEnterpriseSupervision;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author
* @description tb_synergism_enterprise_supervision()Mapper
* @createDate 2024-07-01 19:21:53
* @Entity com.ruoyi.business.enterpriserectification.pojo.TbSynergismEnterpriseSupervision
*/
public interface TbSynergismEnterpriseSupervisionMapper extends BaseMapper<TbSynergismEnterpriseSupervision> {
}

@ -0,0 +1,97 @@
package com.ruoyi.business.enterpriserectification.pojo;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.system.until.EntiyUntil;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
/**
*
* @TableName tb_company_info
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "tb_company_info")
public class TbCompanyInfo extends EntiyUntil {
/**
*
*/
@ApiModelProperty("主键")
private Long id;
/**
*
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("公司名称")
@Length(max= 100,message="编码长度不能超过100")
private String companyName;
/**
*
*/
@Size(max= -1,message="编码长度不能超过-1")
@ApiModelProperty("公司类型")
@Length(max= -1,message="编码长度不能超过-1")
private String companyType;
/**
*
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("统一社会信用代码")
@Length(max= 100,message="编码长度不能超过100")
private String socialCreditCode;
/**
*
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("企业性质")
@Length(max= 100,message="编码长度不能超过100")
private String companyNature;
/**
*
*/
@ApiModelProperty("成立日期")
private Date establishDate;
/**
*
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("营业期限")
@Length(max= 100,message="编码长度不能超过100")
private String businessTermDate;
/**
*
*/
@Size(max= -1,message="编码长度不能超过-1")
@ApiModelProperty("企业登记注册地")
@Length(max= -1,message="编码长度不能超过-1")
private String registerAddress;
/**
*
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("企业经营状态")
@Length(max= 100,message="编码长度不能超过100")
private String businessStatus;
/**
*
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("企业法定代表人")
@Length(max= 100,message="编码长度不能超过100")
private String legalPerson;
}

@ -0,0 +1,123 @@
package com.ruoyi.business.enterpriserectification.pojo;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.system.until.EntiyUntil;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
/**
*
* @TableName tb_safe_company_statistics_score
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "tb_safe_company_statistics_score")
public class TbSafeCompanyStatisticsScore extends EntiyUntil {
/**
*
*/
@ApiModelProperty("主键")
private Long id;
/**
* id
*/
@ApiModelProperty("企业id")
private Long companyId;
/**
*
*/
@ApiModelProperty("规则项对应积分")
private Double score;
/**
* month season year
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("积分类型 month season year")
@Length(max= 100,message="编码长度不能超过100")
private String scoreType;
/**
* 2023-01 2023-03 2023
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("积分所属时间 2023-01 2023-03 2023")
@Length(max= 100,message="编码长度不能超过100")
private String statisticsDate;
/**
*
*/
@ApiModelProperty("创建时间")
private Date createTime;
/**
*
*/
@ApiModelProperty("创建者")
private Integer createBy;
/**
*
*/
@ApiModelProperty("更新时间")
private Date updateTime;
/**
*
*/
@ApiModelProperty("更新者")
private Integer updateBy;
/**
* 0:,1:
*/
@Size(max= -1,message="编码长度不能超过-1")
@ApiModelProperty("0:不活跃,1:活跃")
@Length(max= -1,message="编码长度不能超过-1")
private String isActive;
/**
* c1
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("扩展字段c1")
@Length(max= 100,message="编码长度不能超过100")
private String c1;
/**
* c2
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("扩展字段c2")
@Length(max= 100,message="编码长度不能超过100")
private String c2;
/**
* c3
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("扩展字段c3")
@Length(max= 100,message="编码长度不能超过100")
private String c3;
/**
* c4
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("扩展字段c4")
@Length(max= 100,message="编码长度不能超过100")
private String c4;
/**
* c5
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("扩展字段c5")
@Length(max= 100,message="编码长度不能超过100")
private String c5;
}

@ -0,0 +1,159 @@
package com.ruoyi.business.enterpriserectification.pojo;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.system.until.EntiyUntil;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
/**
*
* @TableName tb_safe_company_statistics_score_detail
*/
@Data
@EqualsAndHashCode(callSuper = false)
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "tb_safe_company_statistics_score_detail")
public class TbSafeCompanyStatisticsScoreDetail extends EntiyUntil {
/**
*
*/
@ApiModelProperty("主键")
private Long id;
/**
* id,tb_safe_ruleid
*/
@ApiModelProperty("规则id,tb_safe_rule主键id")
private Long safeRuleId;
/**
* id
*/
@ApiModelProperty("企业id")
private Long companyId;
/**
* 0->,1->,2->,3->
*/
@Size(max= -1,message="编码长度不能超过-1")
@ApiModelProperty("指标等级字典0->综合指数算法,1->一级指标,2->二级指标,3->三级指标")
@Length(max= -1,message="编码长度不能超过-1")
private String levelIndex;
/**
*
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("一级指标名称")
@Length(max= 100,message="编码长度不能超过100")
private String levelIndexOne;
/**
*
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("二级指标名称")
@Length(max= 100,message="编码长度不能超过100")
private String levelIndexTwo;
/**
*
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("三级指标名称")
@Length(max= 100,message="编码长度不能超过100")
private String levelIndexThree;
/**
*
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("规则项对应积分")
@Length(max= 100,message="编码长度不能超过100")
private String score;
/**
* month season year
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("积分类型 month season year")
@Length(max= 100,message="编码长度不能超过100")
private String scoreType;
/**
* 2023-01 2023-03 2023
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("积分所属时间 2023-01 2023-03 2023")
@Length(max= 100,message="编码长度不能超过100")
private String statisticsDate;
/**
*
*/
@ApiModelProperty("创建时间")
private Date createTime;
/**
*
*/
@ApiModelProperty("创建者")
private Integer createBy;
/**
*
*/
@ApiModelProperty("更新时间")
private Date updateTime;
/**
*
*/
@ApiModelProperty("更新者")
private Integer updateBy;
/**
* 0:,1:
*/
@Size(max= -1,message="编码长度不能超过-1")
@ApiModelProperty("0:不活跃,1:活跃")
@Length(max= -1,message="编码长度不能超过-1")
private String isActive;
/**
* c1
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("扩展字段c1")
@Length(max= 100,message="编码长度不能超过100")
private String c1;
/**
* c2
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("扩展字段c2")
@Length(max= 100,message="编码长度不能超过100")
private String c2;
/**
* c3
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("扩展字段c3")
@Length(max= 100,message="编码长度不能超过100")
private String c3;
/**
* c4
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("扩展字段c4")
@Length(max= 100,message="编码长度不能超过100")
private String c4;
/**
* c5
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("扩展字段c5")
@Length(max= 100,message="编码长度不能超过100")
private String c5;
}

@ -0,0 +1,146 @@
package com.ruoyi.business.enterpriserectification.pojo;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
/**
*
* @TableName tb_safe_rule
*/
@Data
@EqualsAndHashCode(callSuper = false)
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "tb_safe_rule")
public class TbSafeRule implements Serializable {
/**
*
*/
@ApiModelProperty("主键")
private Long id;
/**
*
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("一级指标名称")
@Length(max= 100,message="编码长度不能超过100")
private String levelIndexOne;
/**
*
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("二级指标名称")
@Length(max= 100,message="编码长度不能超过100")
private String levelIndexTwo;
/**
*
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("三级指标名称")
@Length(max= 100,message="编码长度不能超过100")
private String levelIndexThree;
/**
*
*/
@Size(max= -1,message="编码长度不能超过-1")
@ApiModelProperty("规则备注")
@Length(max= -1,message="编码长度不能超过-1")
private String note;
/**
* 0->,1->,2->,3->
*/
@Size(max= -1,message="编码长度不能超过-1")
@ApiModelProperty("指标等级字典0->综合指数算法,1->一级指标,2->二级指标,3->三级指标")
@Length(max= -1,message="编码长度不能超过-1")
private String levelIndex;
/**
*
*/
@ApiModelProperty("排序字段")
private Integer sortValue;
/**
* 1->,2->
*/
@Size(max= -1,message="编码长度不能超过-1")
@ApiModelProperty("是否是区间页面字典1->是,2->否")
@Length(max= -1,message="编码长度不能超过-1")
private String isRangePage;
/**
*
*/
@ApiModelProperty("创建时间")
private Date createTime;
/**
*
*/
@ApiModelProperty("创建者")
private Integer createBy;
/**
*
*/
@ApiModelProperty("更新时间")
private Date updateTime;
/**
*
*/
@ApiModelProperty("更新者")
private Integer updateBy;
/**
* 0:,1:
*/
@Size(max= -1,message="编码长度不能超过-1")
@ApiModelProperty("0:不活跃,1:活跃")
@Length(max= -1,message="编码长度不能超过-1")
private String isActive;
/**
* c1
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("扩展字段c1")
@Length(max= 100,message="编码长度不能超过100")
private String c1;
/**
* c2
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("扩展字段c2")
@Length(max= 100,message="编码长度不能超过100")
private String c2;
/**
* c3
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("扩展字段c3")
@Length(max= 100,message="编码长度不能超过100")
private String c3;
/**
* c4
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("扩展字段c4")
@Length(max= 100,message="编码长度不能超过100")
private String c4;
/**
* c5
*/
@Size(max= 100,message="编码长度不能超过100")
@ApiModelProperty("扩展字段c5")
@Length(max= 100,message="编码长度不能超过100")
private String c5;
}

@ -0,0 +1,88 @@
package com.ruoyi.business.enterpriserectification.pojo;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.system.until.EntiyUntil;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
/**
*
* @TableName tb_special_count_record
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "tb_special_count_record")
public class TbSpecialCountRecord extends EntiyUntil {
/**
*
*/
@ApiModelProperty("主键")
private Long id;
/**
*
*/
@Size(max= 32,message="编码长度不能超过32")
@ApiModelProperty("公司编号")
@Length(max= 32,message="编码长度不能超过32")
private String companyId;
/**
*
*/
@Size(max= 255,message="编码长度不能超过255")
@ApiModelProperty("公司名称")
@Length(max= 255,message="编码长度不能超过255")
private String companyName;
/**
*
*/
@ApiModelProperty("创建日期")
private Date countTime;
/**
*
*/
@Size(max= 255,message="编码长度不能超过255")
@ApiModelProperty("综合指数")
@Length(max= 255,message="编码长度不能超过255")
private String companyGh;
/**
*
*/
@Size(max= 255,message="编码长度不能超过255")
@ApiModelProperty("综合指数(月)")
@Length(max= 255,message="编码长度不能超过255")
private String companyGhMonth;
/**
*
*/
@Size(max= 255,message="编码长度不能超过255")
@ApiModelProperty("综合指数(季)")
@Length(max= 255,message="编码长度不能超过255")
private String companyGhSeason;
/**
*
*/
@Size(max= 255,message="编码长度不能超过255")
@ApiModelProperty("综合指数(年)")
@Length(max= 255,message="编码长度不能超过255")
private String companyGhYear;
/**
*
*/
@ApiModelProperty("更新时间")
private Date updateTime;
}

@ -0,0 +1,280 @@
package com.ruoyi.business.enterpriserectification.pojo;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.system.until.EntiyUntil;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
/**
*
* @TableName tb_synergism_enterprise_supervision
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "tb_synergism_enterprise_supervision")
public class TbSynergismEnterpriseSupervision extends EntiyUntil {
/**
* ID
*/
@ApiModelProperty("主键ID")
private Long id;
/**
*
*/
@NotBlank(message="[企业名称]不能为空")
@Size(max= 255,message="编码长度不能超过255")
@ApiModelProperty("企业名称")
@Length(max= 255,message="编码长度不能超过255")
private String enterpriseName;
/**
*
*/
@Size(max= 255,message="编码长度不能超过255")
@ApiModelProperty("企业类型")
@Length(max= 255,message="编码长度不能超过255")
private String enterpriseType;
/**
*
*/
@Size(max= 255,message="编码长度不能超过255")
@ApiModelProperty("企业所属街道")
@Length(max= 255,message="编码长度不能超过255")
private String enterpriseStreet;
/**
*
*/
@ApiModelProperty("纳入监管时间")
private Date includedSupervisionTime;
/**
*
*/
@ApiModelProperty("清单生成时间")
private Date checklistGenerationTime;
/**
*
*/
@ApiModelProperty("整改截止日期")
private Date rectificationDeadline;
/**
*
*/
@Size(max= 50,message="编码长度不能超过50")
@ApiModelProperty("整改状态")
@Length(max= 50,message="编码长度不能超过50")
private String rectificationStatus;
/**
*
*/
@Size(max= 255,message="编码长度不能超过255")
@ApiModelProperty("管控扣分项")
@Length(max= 255,message="编码长度不能超过255")
private String controlDeductionItem;
/**
*
*/
@Size(max= 255,message="编码长度不能超过255")
@ApiModelProperty("连续扣分项")
@Length(max= 255,message="编码长度不能超过255")
private String continuousDeductionItem;
/**
*
*/
@ApiModelProperty("纳入监管次数")
private Integer supervisionTimes;
/**
*
*/
@ApiModelProperty("连续纳入监管次数")
private Integer continuousSupervisionTimes;
/**
*
*/
@Size(max= 255,message="编码长度不能超过255")
@ApiModelProperty("要素异常明细")
@Length(max= 255,message="编码长度不能超过255")
private String elementAbnormalDetail;
/**
*
*/
@Size(max= 255,message="编码长度不能超过255")
@ApiModelProperty("整改结果")
@Length(max= 255,message="编码长度不能超过255")
private String rectificationResult;
/**
*
*/
@Size(max= 5,message="编码长度不能超过5")
@ApiModelProperty("申诉核实无需整改")
@Length(max= 5,message="编码长度不能超过5")
private String appealVerificationNotNeeded;
/**
* id
*/
@Size(max= 255,message="编码长度不能超过255")
@ApiModelProperty("超期提醒绑定相应id")
@Length(max= 255,message="编码长度不能超过255")
private String overdueReminder;
/**
* id
*/
@Size(max= 255,message="编码长度不能超过255")
@ApiModelProperty("挂牌督办绑定挂牌id")
@Length(max= 255,message="编码长度不能超过255")
private String listedSupervision;
/**
*
*/
@Size(max= 255,message="编码长度不能超过255")
@ApiModelProperty("各单位分工责任")
@Length(max= 255,message="编码长度不能超过255")
private String unitDivisionResponsibility;
/**
*
*/
@Size(max= 255,message="编码长度不能超过255")
@ApiModelProperty("监管单位")
@Length(max= 255,message="编码长度不能超过255")
private String supervisionUnit;
/**
*
*/
@Size(max= 255,message="编码长度不能超过255")
@ApiModelProperty("处置方式")
@Length(max= 255,message="编码长度不能超过255")
private String disposalMethod;
/**
*
*/
@Size(max= 255,message="编码长度不能超过255")
@ApiModelProperty("处置要求")
@Length(max= 255,message="编码长度不能超过255")
private String disposalRequirement;
/**
*
*/
@Size(max= 255,message="编码长度不能超过255")
@ApiModelProperty("整改要求")
@Length(max= 255,message="编码长度不能超过255")
private String rectificationRequirement;
/**
*
*/
@Size(max= 50,message="编码长度不能超过50")
@ApiModelProperty("紧急程度")
@Length(max= 50,message="编码长度不能超过50")
private String urgencyLevel;
/**
*
*/
@Size(max= 255,message="编码长度不能超过255")
@ApiModelProperty("责任人")
@Length(max= 255,message="编码长度不能超过255")
private String responsiblePerson;
/**
*
*/
@Size(max= -1,message="编码长度不能超过-1")
@ApiModelProperty("备注")
@Length(max= -1,message="编码长度不能超过-1")
private String remarks;
/**
*
*/
@NotNull(message="[创建时间]不能为空")
@ApiModelProperty("创建时间")
private Date createTime;
/**
*
*/
@ApiModelProperty("创建者")
private Integer createBy;
/**
*
*/
@ApiModelProperty("更新时间")
private Date updateTime;
/**
*
*/
@ApiModelProperty("更新者")
private Integer updateBy;
/**
* 0:;1:
*/
@Size(max= -1,message="编码长度不能超过-1")
@ApiModelProperty("0:不活跃;1:活跃")
@Length(max= -1,message="编码长度不能超过-1")
private String isActive;
/**
*
*/
@Size(max= 255,message="编码长度不能超过255")
@ApiModelProperty("是否为重点问题")
@Length(max= 255,message="编码长度不能超过255")
private String isFocus;
/**
* id
*/
@Size(max= 255,message="编码长度不能超过255")
@ApiModelProperty("流程关联id")
@Length(max= 255,message="编码长度不能超过255")
private String definitionId;
/**
*
*/
@Size(max= 255,message="编码长度不能超过255")
@ApiModelProperty("整改结果详情")
@Length(max= 255,message="编码长度不能超过255")
private String rectificationResultDefult;
/**
*
*/
@ApiModelProperty("连续未整改次数")
private Integer rectificationNoNum;
/**
*
*/
@Size(max= 255,message="编码长度不能超过255")
@ApiModelProperty("是否超期整改")
@Length(max= 255,message="编码长度不能超过255")
private String isOverdueReminder;
/**
*
*/
@Size(max= 255,message="编码长度不能超过255")
@ApiModelProperty("是否挂牌督办")
@Length(max= 255,message="编码长度不能超过255")
private String isListedSupervision;
/**
* id
*/
@Size(max= 255,message="编码长度不能超过255")
@ApiModelProperty("异常规则id")
@Length(max= 255,message="编码长度不能超过255")
private String safeRuleId;
@TableField(exist = false)
@ApiModelProperty("整改结束时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endTime;
}

@ -0,0 +1,13 @@
package com.ruoyi.business.enterpriserectification.service;
import com.ruoyi.business.enterpriserectification.pojo.TbCompanyInfo;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author
* @description tb_company_info()Service
* @createDate 2024-07-01 21:37:46
*/
public interface TbCompanyInfoService extends IService<TbCompanyInfo> {
}

@ -0,0 +1,13 @@
package com.ruoyi.business.enterpriserectification.service;
import com.ruoyi.business.enterpriserectification.pojo.TbSafeCompanyStatisticsScoreDetail;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author
* @description tb_safe_company_statistics_score_detail()Service
* @createDate 2024-07-02 14:06:55
*/
public interface TbSafeCompanyStatisticsScoreDetailService extends IService<TbSafeCompanyStatisticsScoreDetail> {
}

@ -0,0 +1,13 @@
package com.ruoyi.business.enterpriserectification.service;
import com.ruoyi.business.enterpriserectification.pojo.TbSafeCompanyStatisticsScore;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author
* @description tb_safe_company_statistics_score()Service
* @createDate 2024-07-02 14:36:31
*/
public interface TbSafeCompanyStatisticsScoreService extends IService<TbSafeCompanyStatisticsScore> {
}

@ -0,0 +1,20 @@
package com.ruoyi.business.enterpriserectification.service;
import com.ruoyi.business.enterpriserectification.bo.TbSafeRuleOneVo;
import com.ruoyi.business.enterpriserectification.bo.TbSafeRuleTwoVo;
import com.ruoyi.business.enterpriserectification.pojo.TbSafeRule;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* @author
* @description tb_safe_rule()Service
* @createDate 2024-07-02 11:09:54
*/
public interface TbSafeRuleService extends IService<TbSafeRule> {
List<TbSafeRuleOneVo> getRuleOne();
List<TbSafeRuleTwoVo> getRuleTwo();
}

@ -0,0 +1,13 @@
package com.ruoyi.business.enterpriserectification.service;
import com.ruoyi.business.enterpriserectification.pojo.TbSpecialCountRecord;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author
* @description tb_special_count_record()Service
* @createDate 2024-07-01 19:21:53
*/
public interface TbSpecialCountRecordService extends IService<TbSpecialCountRecord> {
}

@ -0,0 +1,13 @@
package com.ruoyi.business.enterpriserectification.service;
import com.ruoyi.business.enterpriserectification.pojo.TbSynergismEnterpriseSupervision;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author
* @description tb_synergism_enterprise_supervision()Service
* @createDate 2024-07-01 19:21:53
*/
public interface TbSynergismEnterpriseSupervisionService extends IService<TbSynergismEnterpriseSupervision> {
}

@ -0,0 +1,24 @@
package com.ruoyi.business.enterpriserectification.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.business.enterpriserectification.pojo.TbCompanyInfo;
import com.ruoyi.business.enterpriserectification.service.TbCompanyInfoService;
import com.ruoyi.business.enterpriserectification.mapper.TbCompanyInfoMapper;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.stereotype.Service;
/**
* @author
* @description tb_company_info()Service
* @createDate 2024-07-01 21:37:46
*/
@Service
public class TbCompanyInfoServiceImpl extends ServiceImpl<TbCompanyInfoMapper, TbCompanyInfo>
implements TbCompanyInfoService{
}

@ -0,0 +1,25 @@
package com.ruoyi.business.enterpriserectification.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.business.enterpriserectification.pojo.TbSafeCompanyStatisticsScoreDetail;
import com.ruoyi.business.enterpriserectification.service.TbSafeCompanyStatisticsScoreDetailService;
import com.ruoyi.business.enterpriserectification.mapper.TbSafeCompanyStatisticsScoreDetailMapper;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.stereotype.Service;
/**
* @author
* @description tb_safe_company_statistics_score_detail()Service
* @createDate 2024-07-02 14:06:55
*/
@Service
@DataSource(value = DataSourceType.SLAVE)
public class TbSafeCompanyStatisticsScoreDetailServiceImpl extends ServiceImpl<TbSafeCompanyStatisticsScoreDetailMapper, TbSafeCompanyStatisticsScoreDetail>
implements TbSafeCompanyStatisticsScoreDetailService{
}

@ -0,0 +1,25 @@
package com.ruoyi.business.enterpriserectification.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.business.enterpriserectification.pojo.TbSafeCompanyStatisticsScore;
import com.ruoyi.business.enterpriserectification.service.TbSafeCompanyStatisticsScoreService;
import com.ruoyi.business.enterpriserectification.mapper.TbSafeCompanyStatisticsScoreMapper;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.stereotype.Service;
/**
* @author
* @description tb_safe_company_statistics_score()Service
* @createDate 2024-07-02 14:36:31
*/
@Service
@DataSource(value = DataSourceType.SLAVE)
public class TbSafeCompanyStatisticsScoreServiceImpl extends ServiceImpl<TbSafeCompanyStatisticsScoreMapper, TbSafeCompanyStatisticsScore>
implements TbSafeCompanyStatisticsScoreService{
}

@ -0,0 +1,133 @@
package com.ruoyi.business.enterpriserectification.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.business.enterpriserectification.bo.TbSafeRuleOneVo;
import com.ruoyi.business.enterpriserectification.bo.TbSafeRuleThreeVo;
import com.ruoyi.business.enterpriserectification.bo.TbSafeRuleTwoVo;
import com.ruoyi.business.enterpriserectification.pojo.TbSafeRule;
import com.ruoyi.business.enterpriserectification.service.TbSafeRuleService;
import com.ruoyi.business.enterpriserectification.mapper.TbSafeRuleMapper;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.system.until.NbConstants;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* @author
* @description tb_safe_rule()Service
* @createDate 2024-07-02 11:09:54
*/
@Service
@DataSource(value = DataSourceType.SLAVE)
public class TbSafeRuleServiceImpl extends ServiceImpl<TbSafeRuleMapper, TbSafeRule>
implements TbSafeRuleService{
@Override
public List<TbSafeRuleOneVo> getRuleOne() {
QueryWrapper<TbSafeRule> queryWrapper = Wrappers.query();
//查询出所有规则名表
List<TbSafeRule> tbSafeRuleList = this.list(queryWrapper);
List<TbSafeRuleOneVo> list = new ArrayList<>();
if (null == tbSafeRuleList || tbSafeRuleList.size() == 0) {
return list;
}
for (TbSafeRule tbSafeRule : tbSafeRuleList) {
if (NbConstants.LEVEL_INDEX_ONE == Integer.parseInt(tbSafeRule.getLevelIndex())) {
TbSafeRuleOneVo tbSafeRuleOneVo = new TbSafeRuleOneVo();
tbSafeRuleOneVo.setId(tbSafeRule.getId());
tbSafeRuleOneVo.setLevelIndex(NbConstants.LEVEL_INDEX_ONE);
tbSafeRuleOneVo.setLevelIndexOne(tbSafeRule.getLevelIndexOne());
tbSafeRuleOneVo.setLevelIndexTwo(tbSafeRule.getLevelIndexTwo());
tbSafeRuleOneVo.setLevelIndexThree(tbSafeRule.getLevelIndexThree());
tbSafeRuleOneVo.setNote(tbSafeRule.getNote());
tbSafeRuleOneVo.setTbSafeRuleTwoVoList(null);
list.add(tbSafeRuleOneVo);
}
}
for (TbSafeRuleOneVo tbSafeRuleOneVo : list) {
tbSafeRuleOneVo.setTbSafeRuleTwoVoList(getTbSafeRuleTwoVoList(tbSafeRuleList, tbSafeRuleOneVo));
}
return list;
}
@Override
public List<TbSafeRuleTwoVo> getRuleTwo() {
QueryWrapper<TbSafeRule> queryWrapper = Wrappers.query();
//查询出所有规则名表
List<TbSafeRule> tbSafeRuleList = this.list(queryWrapper);
List<TbSafeRuleTwoVo> list = new ArrayList<>();
if (null == tbSafeRuleList || tbSafeRuleList.size() == 0) {
return list;
}
for (TbSafeRule tbSafeRule : tbSafeRuleList) {
if (NbConstants.LEVEL_INDEX_TWO == Integer.parseInt(tbSafeRule.getLevelIndex())
&& !"防疫安全".equals(tbSafeRule.getLevelIndexOne())) {
TbSafeRuleTwoVo tbSafeRuleTwoVo = new TbSafeRuleTwoVo();
tbSafeRuleTwoVo.setId(tbSafeRule.getId());
tbSafeRuleTwoVo.setLevelIndex(NbConstants.LEVEL_INDEX_TWO);
tbSafeRuleTwoVo.setLevelIndexOne(tbSafeRule.getLevelIndexOne());
tbSafeRuleTwoVo.setLevelIndexTwo(tbSafeRule.getLevelIndexTwo());
tbSafeRuleTwoVo.setLevelIndexThree(tbSafeRule.getLevelIndexThree());
tbSafeRuleTwoVo.setNote(tbSafeRule.getNote());
tbSafeRuleTwoVo.setTbSafeRuleThreeVoList(null);
list.add(tbSafeRuleTwoVo);
}
}
for (TbSafeRuleTwoVo tbSafeRuleTwoVo : list) {
tbSafeRuleTwoVo.setTbSafeRuleThreeVoList(getTbSafeRuleTwoVo(tbSafeRuleList, tbSafeRuleTwoVo));
}
return list;
}
/**
*
*/
private List<TbSafeRuleTwoVo> getTbSafeRuleTwoVoList(List<TbSafeRule> tbSafeRuleList, TbSafeRuleOneVo tbSafeRuleOneVo) {
List<TbSafeRuleTwoVo> tbSafeRuleTwoVoList = new ArrayList<>();
for (TbSafeRule tbSafeRule : tbSafeRuleList) {
if (NbConstants.LEVEL_INDEX_TWO == Integer.parseInt(tbSafeRule.getLevelIndex())
&& tbSafeRuleOneVo.getLevelIndexOne().equals(tbSafeRule.getLevelIndexOne())) {
TbSafeRuleTwoVo tbSafeRuleTwoVo = new TbSafeRuleTwoVo();
tbSafeRuleTwoVo.setId(tbSafeRule.getId());
tbSafeRuleTwoVo.setLevelIndex(NbConstants.LEVEL_INDEX_TWO);
tbSafeRuleTwoVo.setLevelIndexOne(tbSafeRule.getLevelIndexOne());
tbSafeRuleTwoVo.setLevelIndexTwo(tbSafeRule.getLevelIndexTwo());
tbSafeRuleTwoVo.setLevelIndexThree(tbSafeRule.getLevelIndexThree());
tbSafeRuleTwoVo.setTbSafeRuleThreeVoList(getTbSafeRuleTwoVo(tbSafeRuleList, tbSafeRuleTwoVo));
tbSafeRuleTwoVoList.add(tbSafeRuleTwoVo);
}
}
return tbSafeRuleTwoVoList;
}
/**
*
*/
private List<TbSafeRuleThreeVo> getTbSafeRuleTwoVo(List<TbSafeRule> tbSafeRuleList, TbSafeRuleTwoVo tbSafeRuleTwoVo) {
List<TbSafeRuleThreeVo> tbSafeRuleThreeVoList = new ArrayList<>();
for (TbSafeRule tbSafeRule : tbSafeRuleList) {
if (NbConstants.LEVEL_INDEX_THREE == Integer.parseInt(tbSafeRule.getLevelIndex())
&& tbSafeRule.getLevelIndexTwo().equals(tbSafeRuleTwoVo.getLevelIndexTwo())
&& tbSafeRule.getLevelIndexOne().equals(tbSafeRuleTwoVo.getLevelIndexOne())) {
TbSafeRuleThreeVo tbSafeRuleThreeVo = new TbSafeRuleThreeVo();
tbSafeRuleThreeVo.setId(tbSafeRule.getId());
tbSafeRuleThreeVo.setLevelIndex(NbConstants.LEVEL_INDEX_THREE);
tbSafeRuleThreeVo.setLevelIndexOne(tbSafeRule.getLevelIndexOne());
tbSafeRuleThreeVo.setLevelIndexTwo(tbSafeRule.getLevelIndexTwo());
tbSafeRuleThreeVo.setLevelIndexThree(tbSafeRule.getLevelIndexThree());
tbSafeRuleThreeVo.setNote(tbSafeRule.getNote());
tbSafeRuleThreeVoList.add(tbSafeRuleThreeVo);
}
}
return tbSafeRuleThreeVoList;
}
}

@ -0,0 +1,25 @@
package com.ruoyi.business.enterpriserectification.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.business.enterpriserectification.pojo.TbSpecialCountRecord;
import com.ruoyi.business.enterpriserectification.service.TbSpecialCountRecordService;
import com.ruoyi.business.enterpriserectification.mapper.TbSpecialCountRecordMapper;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.stereotype.Service;
/**
* @author
* @description tb_special_count_record()Service
* @createDate 2024-07-01 19:21:53
*/
@Service
@DataSource(value = DataSourceType.SLAVE)
public class TbSpecialCountRecordServiceImpl extends ServiceImpl<TbSpecialCountRecordMapper, TbSpecialCountRecord>
implements TbSpecialCountRecordService{
}

@ -0,0 +1,25 @@
package com.ruoyi.business.enterpriserectification.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.business.enterpriserectification.pojo.TbSynergismEnterpriseSupervision;
import com.ruoyi.business.enterpriserectification.service.TbSynergismEnterpriseSupervisionService;
import com.ruoyi.business.enterpriserectification.mapper.TbSynergismEnterpriseSupervisionMapper;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.stereotype.Service;
/**
* @author
* @description tb_synergism_enterprise_supervision()Service
* @createDate 2024-07-01 19:21:53
*/
@Service
@DataSource(value = DataSourceType.SLAVE)
public class TbSynergismEnterpriseSupervisionServiceImpl extends ServiceImpl<TbSynergismEnterpriseSupervisionMapper, TbSynergismEnterpriseSupervision>
implements TbSynergismEnterpriseSupervisionService{
}

@ -0,0 +1,44 @@
package com.ruoyi.system.enums;
/*
* @User
* @Time 2024/6/29 14:29
*
*/
public enum RectificationStatusEnum {
SUCCESS("0","已完成"),
WAIT("1","整改中"),
FAIL("2","未完成");
private String code;
private String status;
RectificationStatusEnum(){
}
RectificationStatusEnum(String code, String status) {
this.code = code;
this.status = status;
}
public String getCode() {
return code;
}
public String getStatus() {
return status;
}
//根据code码获取status
public static String getStatusByCode(String code) {
for (RectificationStatusEnum statusEnum : RectificationStatusEnum.values()) {
if (statusEnum.getCode().equals(code)) {
return statusEnum.getStatus();
}
}
return FAIL.getStatus();
}
}

@ -0,0 +1,73 @@
package com.ruoyi.system.until;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
/**
* @Author
* @Date 2024/3/5 10:46
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class EntiyUntil implements Serializable {
@TableField(exist = false)
private static final long serialVersionUID = 1L;
/** 搜索值 */
@JsonIgnore
@TableField(exist = false)
@ApiModelProperty(hidden = true)
private String searchValue;
/** 备注 */
@TableField(exist = false)
@ApiModelProperty(hidden = true)
private String remark;
/** 请求参数 */
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@TableField(exist = false)
@ApiModelProperty(hidden = true)
private Map<String, Object> params;
@TableField(exist = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
private Integer pageNum;
@TableField(exist = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
private Integer pageSize;
@TableField(exist = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
private String perType;
@TableField(exist = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
private String message;
public Map<String, Object> getParams()
{
if (params == null)
{
params = new HashMap<>();
}
return params;
}
}

@ -0,0 +1,39 @@
package com.ruoyi.system.until;
/**
*
*/
public class NbConstants {
/**
*
*/
public static final Integer LEVEL_INDEX_ZERO = 0;
public static final Integer LEVEL_INDEX_ONE = 1;
public static final Integer LEVEL_INDEX_TWO = 2;
public static final Integer LEVEL_INDEX_THREE = 3;
public static final String ALARM_RED = "red";
public static final String ALARM_YELLOW = "yellow";
public static final String ALARM_BLUE = "blue";
public static final String ALARM_GREEN = "green";
public static final String SCORE_TYPE_MONTH = "month";
public static final String SCORE_TYPE_SEASON = "season";
public static final String SCORE_TYPE_YEAR = "year";
public static final String CN_YES = "是";
public static final String CN_NO = "否";
/**
*
* 9090
* 757590
* 606075
* 60
*/
public static final String RISK_LEVEL_RED = "red";
public static final String RISK_LEVEL_ORANGE = "orange";
public static final String RISK_LEVEL_YELLOW = "yellow";
public static final String RISK_LEVEL_BLUE = "blue";
}

@ -0,0 +1,70 @@
<?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.ruoyi.business.enterpriserectification.mapper.TbCompanyInfoMapper">
<resultMap id="BaseResultMap" type="com.ruoyi.business.enterpriserectification.pojo.TbCompanyInfo">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="companyName" column="company_name" jdbcType="VARCHAR"/>
<result property="companyType" column="company_type" jdbcType="VARCHAR"/>
<result property="socialCreditCode" column="social_credit_code" jdbcType="VARCHAR"/>
<result property="companyNature" column="company_nature" jdbcType="VARCHAR"/>
<result property="establishDate" column="establish_date" jdbcType="TIMESTAMP"/>
<result property="businessTermDate" column="business_term_date" jdbcType="VARCHAR"/>
<result property="registerAddress" column="register_address" jdbcType="VARCHAR"/>
<result property="businessStatus" column="business_status" jdbcType="VARCHAR"/>
<result property="legalPerson" column="legal_person" jdbcType="VARCHAR"/>
<result property="registerCapital" column="register_capital" jdbcType="VARCHAR"/>
<result property="businessLicenseDate" column="business_license_date" jdbcType="TIMESTAMP"/>
<result property="registerAuthority" column="register_authority" jdbcType="VARCHAR"/>
<result property="emergencyContact" column="emergency_contact" jdbcType="VARCHAR"/>
<result property="emergencyContactPhone" column="emergency_contact_phone" jdbcType="VARCHAR"/>
<result property="companyAddress" column="company_address" jdbcType="VARCHAR"/>
<result property="businessScope" column="business_scope" jdbcType="VARCHAR"/>
<result property="picUrl" column="pic_url" jdbcType="VARCHAR"/>
<result property="longitude" column="longitude" jdbcType="VARCHAR"/>
<result property="latitude" column="latitude" jdbcType="VARCHAR"/>
<result property="provinceCode" column="province_code" jdbcType="VARCHAR"/>
<result property="provinceName" column="province_name" jdbcType="VARCHAR"/>
<result property="cityCode" column="city_code" jdbcType="VARCHAR"/>
<result property="cityName" column="city_name" jdbcType="VARCHAR"/>
<result property="areaCode" column="area_code" jdbcType="VARCHAR"/>
<result property="areaName" column="area_name" jdbcType="VARCHAR"/>
<result property="streetCode" column="street_code" jdbcType="VARCHAR"/>
<result property="streetName" column="street_name" jdbcType="VARCHAR"/>
<result property="blockCode" column="block_code" jdbcType="VARCHAR"/>
<result property="blockName" column="block_name" jdbcType="VARCHAR"/>
<result property="policeDistrict" column="police_district" jdbcType="VARCHAR"/>
<result property="policeDistrictCode" column="police_district_code" jdbcType="VARCHAR"/>
<result property="belongingArea" column="belonging_area" jdbcType="VARCHAR"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="createBy" column="create_by" jdbcType="INTEGER"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="updateBy" column="update_by" jdbcType="INTEGER"/>
<result property="isActive" column="is_active" jdbcType="VARCHAR"/>
<result property="c1" column="c1" jdbcType="VARCHAR"/>
<result property="c2" column="c2" jdbcType="VARCHAR"/>
<result property="c3" column="c3" jdbcType="VARCHAR"/>
<result property="c4" column="c4" jdbcType="VARCHAR"/>
<result property="c5" column="c5" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
id,company_name,company_type,
social_credit_code,company_nature,establish_date,
business_term_date,register_address,business_status,
legal_person,register_capital,business_license_date,
register_authority,emergency_contact,emergency_contact_phone,
company_address,business_scope,pic_url,
longitude,latitude,province_code,
province_name,city_code,city_name,
area_code,area_name,street_code,
street_name,block_code,block_name,
police_district,police_district_code,belonging_area,
create_time,create_by,update_time,
update_by,is_active,c1,
c2,c3,c4,
c5
</sql>
</mapper>

@ -0,0 +1,39 @@
<?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.ruoyi.business.enterpriserectification.mapper.TbSafeCompanyStatisticsScoreDetailMapper">
<resultMap id="BaseResultMap" type="com.ruoyi.business.enterpriserectification.pojo.TbSafeCompanyStatisticsScoreDetail">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="safeRuleId" column="safe_rule_id" jdbcType="BIGINT"/>
<result property="companyId" column="company_id" jdbcType="BIGINT"/>
<result property="levelIndex" column="level_index" jdbcType="VARCHAR"/>
<result property="levelIndexOne" column="level_index_one" jdbcType="VARCHAR"/>
<result property="levelIndexTwo" column="level_index_two" jdbcType="VARCHAR"/>
<result property="levelIndexThree" column="level_index_three" jdbcType="VARCHAR"/>
<result property="score" column="score" jdbcType="VARCHAR"/>
<result property="scoreType" column="score_type" jdbcType="VARCHAR"/>
<result property="statisticsDate" column="statistics_date" jdbcType="VARCHAR"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="createBy" column="create_by" jdbcType="INTEGER"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="updateBy" column="update_by" jdbcType="INTEGER"/>
<result property="isActive" column="is_active" jdbcType="VARCHAR"/>
<result property="c1" column="c1" jdbcType="VARCHAR"/>
<result property="c2" column="c2" jdbcType="VARCHAR"/>
<result property="c3" column="c3" jdbcType="VARCHAR"/>
<result property="c4" column="c4" jdbcType="VARCHAR"/>
<result property="c5" column="c5" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
id,safe_rule_id,company_id,
level_index,level_index_one,level_index_two,
level_index_three,score,score_type,
statistics_date,create_time,create_by,
update_time,update_by,is_active,
c1,c2,c3,
c4,c5
</sql>
</mapper>

@ -0,0 +1,32 @@
<?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.ruoyi.business.enterpriserectification.mapper.TbSafeCompanyStatisticsScoreMapper">
<resultMap id="BaseResultMap" type="com.ruoyi.business.enterpriserectification.pojo.TbSafeCompanyStatisticsScore">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="companyId" column="company_id" jdbcType="BIGINT"/>
<result property="score" column="score" jdbcType="DOUBLE"/>
<result property="scoreType" column="score_type" jdbcType="VARCHAR"/>
<result property="statisticsDate" column="statistics_date" jdbcType="VARCHAR"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="createBy" column="create_by" jdbcType="INTEGER"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="updateBy" column="update_by" jdbcType="INTEGER"/>
<result property="isActive" column="is_active" jdbcType="VARCHAR"/>
<result property="c1" column="c1" jdbcType="VARCHAR"/>
<result property="c2" column="c2" jdbcType="VARCHAR"/>
<result property="c3" column="c3" jdbcType="VARCHAR"/>
<result property="c4" column="c4" jdbcType="VARCHAR"/>
<result property="c5" column="c5" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
id,company_id,score,
score_type,statistics_date,create_time,
create_by,update_time,update_by,
is_active,c1,c2,
c3,c4,c5
</sql>
</mapper>

@ -0,0 +1,36 @@
<?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.ruoyi.business.enterpriserectification.mapper.TbSafeRuleMapper">
<resultMap id="BaseResultMap" type="com.ruoyi.business.enterpriserectification.pojo.TbSafeRule">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="levelIndexOne" column="level_index_one" jdbcType="VARCHAR"/>
<result property="levelIndexTwo" column="level_index_two" jdbcType="VARCHAR"/>
<result property="levelIndexThree" column="level_index_three" jdbcType="VARCHAR"/>
<result property="note" column="note" jdbcType="VARCHAR"/>
<result property="levelIndex" column="level_index" jdbcType="VARCHAR"/>
<result property="sortValue" column="sort_value" jdbcType="INTEGER"/>
<result property="isRangePage" column="is_range_page" jdbcType="VARCHAR"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="createBy" column="create_by" jdbcType="INTEGER"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="updateBy" column="update_by" jdbcType="INTEGER"/>
<result property="isActive" column="is_active" jdbcType="VARCHAR"/>
<result property="c1" column="c1" jdbcType="VARCHAR"/>
<result property="c2" column="c2" jdbcType="VARCHAR"/>
<result property="c3" column="c3" jdbcType="VARCHAR"/>
<result property="c4" column="c4" jdbcType="VARCHAR"/>
<result property="c5" column="c5" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
id,level_index_one,level_index_two,
level_index_three,note,level_index,
sort_value,is_range_page,create_time,
create_by,update_time,update_by,
is_active,c1,c2,
c3,c4,c5
</sql>
</mapper>

@ -0,0 +1,24 @@
<?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.ruoyi.business.enterpriserectification.mapper.TbSpecialCountRecordMapper">
<resultMap id="BaseResultMap" type="com.ruoyi.business.enterpriserectification.pojo.TbSpecialCountRecord">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
<result property="companyName" column="company_name" jdbcType="VARCHAR"/>
<result property="countTime" column="count_time" jdbcType="DATE"/>
<result property="companyGh" column="company_gh" jdbcType="VARCHAR"/>
<result property="companyGhMonth" column="company_gh_month" jdbcType="VARCHAR"/>
<result property="companyGhSeason" column="company_gh_season" jdbcType="VARCHAR"/>
<result property="companyGhYear" column="company_gh_year" jdbcType="VARCHAR"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
id,company_id,company_name,
count_time,company_gh,company_gh_month,
company_gh_season,company_gh_year,update_time
</sql>
</mapper>

@ -0,0 +1,62 @@
<?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.ruoyi.business.enterpriserectification.mapper.TbSynergismEnterpriseSupervisionMapper">
<resultMap id="BaseResultMap" type="com.ruoyi.business.enterpriserectification.pojo.TbSynergismEnterpriseSupervision">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="enterpriseName" column="enterprise_name" jdbcType="VARCHAR"/>
<result property="enterpriseType" column="enterprise_type" jdbcType="VARCHAR"/>
<result property="enterpriseStreet" column="enterprise_street" jdbcType="VARCHAR"/>
<result property="includedSupervisionTime" column="included_supervision_time" jdbcType="DATE"/>
<result property="checklistGenerationTime" column="checklist_generation_time" jdbcType="DATE"/>
<result property="rectificationDeadline" column="rectification_deadline" jdbcType="DATE"/>
<result property="rectificationStatus" column="rectification_status" jdbcType="VARCHAR"/>
<result property="controlDeductionItem" column="control_deduction_item" jdbcType="VARCHAR"/>
<result property="continuousDeductionItem" column="continuous_deduction_item" jdbcType="VARCHAR"/>
<result property="supervisionTimes" column="supervision_times" jdbcType="INTEGER"/>
<result property="continuousSupervisionTimes" column="continuous_supervision_times" jdbcType="INTEGER"/>
<result property="elementAbnormalDetail" column="element_abnormal_detail" jdbcType="VARCHAR"/>
<result property="rectificationResult" column="rectification_result" jdbcType="VARCHAR"/>
<result property="appealVerificationNotNeeded" column="appeal_verification_not_needed" jdbcType="VARCHAR"/>
<result property="overdueReminder" column="overdue_reminder" jdbcType="VARCHAR"/>
<result property="listedSupervision" column="listed_supervision" jdbcType="VARCHAR"/>
<result property="unitDivisionResponsibility" column="unit_division_responsibility" jdbcType="VARCHAR"/>
<result property="supervisionUnit" column="supervision_unit" jdbcType="VARCHAR"/>
<result property="disposalMethod" column="disposal_method" jdbcType="VARCHAR"/>
<result property="disposalRequirement" column="disposal_requirement" jdbcType="VARCHAR"/>
<result property="rectificationRequirement" column="rectification_requirement" jdbcType="VARCHAR"/>
<result property="urgencyLevel" column="urgency_level" jdbcType="VARCHAR"/>
<result property="responsiblePerson" column="responsible_person" jdbcType="VARCHAR"/>
<result property="remarks" column="remarks" jdbcType="VARCHAR"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="createBy" column="create_by" jdbcType="INTEGER"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="updateBy" column="update_by" jdbcType="INTEGER"/>
<result property="isActive" column="is_active" jdbcType="VARCHAR"/>
<result property="isFocus" column="is_focus" jdbcType="VARCHAR"/>
<result property="definitionId" column="definition_id" jdbcType="VARCHAR"/>
<result property="rectificationResultDefult" column="rectification_result_defult" jdbcType="VARCHAR"/>
<result property="rectificationNoNum" column="rectification_no_num" jdbcType="INTEGER"/>
<result property="isOverdueReminder" column="is_overdue_reminder" jdbcType="VARCHAR"/>
<result property="isListedSupervision" column="is_listed_supervision" jdbcType="VARCHAR"/>
<result property="safeRuleId" column="safe_rule_id" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
id,enterprise_name,enterprise_type,
enterprise_street,included_supervision_time,checklist_generation_time,
rectification_deadline,rectification_status,control_deduction_item,
continuous_deduction_item,supervision_times,continuous_supervision_times,
element_abnormal_detail,rectification_result,appeal_verification_not_needed,
overdue_reminder,listed_supervision,unit_division_responsibility,
supervision_unit,disposal_method,disposal_requirement,
rectification_requirement,urgency_level,responsible_person,
remarks,create_time,create_by,
update_time,update_by,is_active,
is_focus,definition_id,rectification_result_defult,
rectification_no_num,is_overdue_reminder,is_listed_supervision,
safe_rule_id
</sql>
</mapper>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save