代码规范修改

This commit is contained in:
1539530615@qq.com 2024-01-30 14:10:58 +08:00
parent 8bf9558fc5
commit bd6e623737
17 changed files with 100 additions and 34 deletions

View File

@ -16,47 +16,57 @@ import java.util.Date;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class MaLabelBind { public class MaLabelBind {
//机具ID /**
* 机具ID
*/
@Excel(name = "机具ID") @Excel(name = "机具ID")
@ApiModelProperty(value = "种类id") @ApiModelProperty(value = "种类id")
private Long maId; private Long maId;
/**
//标签编号 * 标签编号
*/
@Excel(name = "标签编号") @Excel(name = "标签编号")
@ApiModelProperty(value = "种类id") @ApiModelProperty(value = "种类id")
private String labelCode; private String labelCode;
/**
//类型ID * 类型ID
*/
@Excel(name = "类型ID") @Excel(name = "类型ID")
@ApiModelProperty(value = "种类id") @ApiModelProperty(value = "种类id")
private Long typeId; private Long typeId;
/**
//绑定时间 * 绑定时间
*/
@Excel(name = "绑定时间") @Excel(name = "绑定时间")
@ApiModelProperty(value = "种类id") @ApiModelProperty(value = "种类id")
private Date bindTime; private Date bindTime;
/**
//绑定人 * 绑定人
*/
@Excel(name = "绑定人") @Excel(name = "绑定人")
@ApiModelProperty(value = "种类id") @ApiModelProperty(value = "种类id")
private String binder; private String binder;
/**
//是否绑定(0 , 1 ) * 是否绑定(0 , 1 )
*/
@Excel(name = "是否绑定") @Excel(name = "是否绑定")
@ApiModelProperty(value = "种类id") @ApiModelProperty(value = "种类id")
private String isBind; private String isBind;
/**
//标签类型(数据字典) * 标签类型(数据字典)
*/
@Excel(name = "标签类型(数据字典)") @Excel(name = "标签类型(数据字典)")
@ApiModelProperty(value = "种类id") @ApiModelProperty(value = "种类id")
private Integer labelType; private Integer labelType;
/**
//数据所属组织 * 数据所属组织
*/
@Excel(name = "数据所属组织") @Excel(name = "数据所属组织")
@ApiModelProperty(value = "种类id") @ApiModelProperty(value = "种类id")
private String companyId; private String companyId;
/**
//数据所属组织 * 0已解绑 1已绑定
*/
@Excel(name = "0已解绑 1已绑定") @Excel(name = "0已解绑 1已绑定")
@ApiModelProperty(value = "0已解绑 1已绑定") @ApiModelProperty(value = "0已解绑 1已绑定")
private String status; private String status;

View File

@ -6,6 +6,11 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
/**
*
* @author Dingjie
* @date
*/
@ApiModel(value="com.bonus.sgzb.base.api.domain.MaMachine") @ApiModel(value="com.bonus.sgzb.base.api.domain.MaMachine")
@Data @Data
public class MaMachine extends BaseEntity { public class MaMachine extends BaseEntity {

View File

@ -5,7 +5,11 @@ import com.bonus.sgzb.common.core.web.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
/**
*
* @author gmhao
* @date
*/
@Data @Data
public class MaMachineLabel extends BaseEntity public class MaMachineLabel extends BaseEntity
{ {

View File

@ -14,6 +14,11 @@ import java.util.List;
/** /**
* 工机具类型管理实体类 * 工机具类型管理实体类
*/ */
/**
*
* @author rsyao
* @date
*/
@Data @Data
public class MaType extends BaseEntity { public class MaType extends BaseEntity {

View File

@ -21,10 +21,10 @@ public interface RemoteLogService
{ {
/** /**
* 保存系统日志 * 保存系统日志
* * @param sysOperLog 保存系统日志
* @param sysOperLog 日志实体
* @param source 请求来源 * @param source 请求来源
* @return 结果 * @return 结果
* @throws Exception
*/ */
@PostMapping("/operlog") @PostMapping("/operlog")
public R<Boolean> saveLog(@RequestBody SysOperLog sysOperLog, @RequestHeader(SecurityConstants.FROM_SOURCE) String source) throws Exception; public R<Boolean> saveLog(@RequestBody SysOperLog sysOperLog, @RequestHeader(SecurityConstants.FROM_SOURCE) String source) throws Exception;

View File

@ -41,18 +41,26 @@ public interface RemoteUserService
/** /**
* 发送短信 * 发送短信
* @param phone
* @return
*/ */
@PostMapping("/sms/codeLogin") @PostMapping("/sms/codeLogin")
public R<Boolean> sendCode(@RequestParam("phone") String phone); public R<Boolean> sendCode(@RequestParam("phone") String phone);
/** /**
* 验证码校验 * 验证码校验
* @param phone
* @param code
* @return
*/ */
@PostMapping("/sms/checkCode") @PostMapping("/sms/checkCode")
public R<Boolean> checkCode(@RequestParam("phone") String phone, @RequestParam("code") String code); public R<Boolean> checkCode(@RequestParam("phone") String phone, @RequestParam("code") String code);
/** /**
* 验证码校验 * 验证码校验
* @param phone
* @param msg
* @return
*/ */
@PostMapping("/sms/send") @PostMapping("/sms/send")
public Boolean send(@RequestParam("phone") String phone, @RequestParam("msg") String msg); public Boolean send(@RequestParam("phone") String phone, @RequestParam("msg") String msg);

View File

@ -41,7 +41,11 @@ public class TokenController {
@Resource @Resource
private RemoteUserService remoteUserService; private RemoteUserService remoteUserService;
//web端登录 /**
* web端登录
* @param form
* @return
*/
@PostMapping("login") @PostMapping("login")
public R<?> login(@RequestBody LoginBody form) { public R<?> login(@RequestBody LoginBody form) {
// 用户登录 // 用户登录
@ -56,7 +60,12 @@ public class TokenController {
} }
} }
//App端登录
/**
* App端登录
* @param form
* @return
*/
@PostMapping("loginApp") @PostMapping("loginApp")
public R<?> loginApp(@RequestBody LoginBody form) { public R<?> loginApp(@RequestBody LoginBody form) {
// 用户登录 // 用户登录

View File

@ -147,11 +147,12 @@ public class SysLoginService
} }
public boolean checkCode(String phone, String code) { public boolean checkCode(String phone, String code) {
String a = "_";
String redisCode = redisService.getCacheObject("code_" + phone); String redisCode = redisService.getCacheObject("code_" + phone);
if (StringUtils.isEmpty(redisCode)) { if (StringUtils.isEmpty(redisCode)) {
throw new ServiceException("验证码失效", 403); throw new ServiceException("验证码失效", 403);
} }
if (!StringUtils.equals(redisCode.split("_")[0], code)) { if (!StringUtils.equals(redisCode.split(a)[0], code)) {
throw new ServiceException("验证码错误", 401); throw new ServiceException("验证码错误", 401);
} else { } else {
redisService.deleteObject("code_" + phone); redisService.deleteObject("code_" + phone);

View File

@ -15,7 +15,9 @@ public class KaptchaTextCreator extends DefaultTextCreator
@Override @Override
public String getText() public String getText()
{ {
Integer result = 0; Integer result = 0;
int i = 2;
Random random = new Random(); Random random = new Random();
int x = random.nextInt(10); int x = random.nextInt(10);
int y = random.nextInt(10); int y = random.nextInt(10);
@ -45,7 +47,7 @@ public class KaptchaTextCreator extends DefaultTextCreator
suChinese.append(CNUMBERS[y]); suChinese.append(CNUMBERS[y]);
} }
} }
else if (randomoperands == 2) else if (randomoperands == i)
{ {
if (x >= y) if (x >= y)
{ {

View File

@ -31,7 +31,9 @@ public class AuthFilter implements GlobalFilter, Ordered
{ {
private static final Logger log = LoggerFactory.getLogger(AuthFilter.class); private static final Logger log = LoggerFactory.getLogger(AuthFilter.class);
// 排除过滤的 uri 地址nacos自行添加 /**
* 排除过滤的 uri 地址nacos自行添加
*/
@Autowired @Autowired
private IgnoreWhiteProperties ignoreWhite; private IgnoreWhiteProperties ignoreWhite;

View File

@ -35,7 +35,9 @@ import reactor.core.publisher.Mono;
@ConditionalOnProperty(value = "security.xss.enabled", havingValue = "true") @ConditionalOnProperty(value = "security.xss.enabled", havingValue = "true")
public class XssFilter implements GlobalFilter, Ordered public class XssFilter implements GlobalFilter, Ordered
{ {
// 跨站脚本的 xss 配置nacos自行添加 /**
* 跨站脚本的 xss 配置nacos自行添加
*/
@Autowired @Autowired
private XssProperties xss; private XssProperties xss;

View File

@ -13,7 +13,11 @@ import springfox.documentation.swagger.web.SecurityConfigurationBuilder;
import springfox.documentation.swagger.web.SwaggerResourcesProvider; import springfox.documentation.swagger.web.SwaggerResourcesProvider;
import springfox.documentation.swagger.web.UiConfiguration; import springfox.documentation.swagger.web.UiConfiguration;
import springfox.documentation.swagger.web.UiConfigurationBuilder; import springfox.documentation.swagger.web.UiConfigurationBuilder;
/**
*
* @author bonus
* @date
*/
@RestController @RestController
@RequestMapping("/swagger-resources") @RequestMapping("/swagger-resources")
public class SwaggerHandler public class SwaggerHandler

View File

@ -13,11 +13,17 @@ public interface ValidateCodeService
{ {
/** /**
* 生成验证码 * 生成验证码
* @return
* @throws IOException
* @throws CaptchaException
*/ */
public AjaxResult createCaptcha() throws IOException, CaptchaException; public AjaxResult createCaptcha() throws IOException, CaptchaException;
/** /**
* 校验验证码 * 校验验证码
* @param key
* @param value
* @throws CaptchaException
*/ */
public void checkCaptcha(String key, String value) throws CaptchaException; public void checkCaptcha(String key, String value) throws CaptchaException;
} }

View File

@ -47,6 +47,8 @@ public class ValidateCodeServiceImpl implements ValidateCodeService
@Override @Override
public AjaxResult createCaptcha() throws IOException, CaptchaException public AjaxResult createCaptcha() throws IOException, CaptchaException
{ {
String math = "math";
String charStr = "char";
AjaxResult ajax = AjaxResult.success(); AjaxResult ajax = AjaxResult.success();
boolean captchaEnabled = captchaProperties.getEnabled(); boolean captchaEnabled = captchaProperties.getEnabled();
ajax.put("captchaEnabled", captchaEnabled); ajax.put("captchaEnabled", captchaEnabled);
@ -64,14 +66,14 @@ public class ValidateCodeServiceImpl implements ValidateCodeService
String captchaType = captchaProperties.getType(); String captchaType = captchaProperties.getType();
// 生成验证码 // 生成验证码
if ("math".equals(captchaType)) if (math.equals(captchaType))
{ {
String capText = captchaProducerMath.createText(); String capText = captchaProducerMath.createText();
capStr = capText.substring(0, capText.lastIndexOf("@")); capStr = capText.substring(0, capText.lastIndexOf("@"));
code = capText.substring(capText.lastIndexOf("@") + 1); code = capText.substring(capText.lastIndexOf("@") + 1);
image = captchaProducerMath.createImage(capStr); image = captchaProducerMath.createImage(capStr);
} }
else if ("char".equals(captchaType)) else if (charStr.equals(captchaType))
{ {
capStr = code = captchaProducer.createText(); capStr = code = captchaProducer.createText();
image = captchaProducer.createImage(capStr); image = captchaProducer.createImage(capStr);

View File

@ -20,6 +20,7 @@ public interface BackApplyAppMapper {
*/ */
List<BmAgreementInfo> getbackPro(BmAgreementInfo record); List<BmAgreementInfo> getbackPro(BmAgreementInfo record);
int insertTask(TmTask task); int insertTask(TmTask task);
List<BackApplyInfo> getbackList(BackApplyInfo record); List<BackApplyInfo> getbackList(BackApplyInfo record);

View File

@ -16,5 +16,10 @@ public interface SysNoticeService {
*/ */
List<SysNotice> getList(String keyword); List<SysNotice> getList(String keyword);
/**
* 根据ID获取通知公告内容
* @param noticeId
* @return
*/
SysNotice getById(Long noticeId); SysNotice getById(Long noticeId);
} }

View File

@ -28,8 +28,8 @@ public class SysSmsServiceImpl implements ISysSmsService {
@Resource @Resource
private RedisService redisService; private RedisService redisService;
// 短信url // 短信URL
private static final String url = "http://api.ktsms.cn/sms_token?ddtkey=bonus&secretkey=KtyBns@Admin2023!"; private static final String URL = "http://api.ktsms.cn/sms_token?ddtkey=bonus&secretkey=KtyBns@Admin2023!";
@Override @Override
public AjaxResult sendSms(String phone, String msg) { public AjaxResult sendSms(String phone, String msg) {
@ -61,8 +61,8 @@ public class SysSmsServiceImpl implements ISysSmsService {
} }
// 发送短信 // 发送短信
try { try {
// String url = "http://106.ihuyi.common/webservice/sms.php?method=Submit"; // String URL = "http://106.ihuyi.common/webservice/sms.php?method=Submit";
String content = url + "&mobile=" + phone + "&content=【智慧仓储】" + msg + ""; String content = URL + "&mobile=" + phone + "&content=【智慧仓储】" + msg + "";
String body = HttpRequest.post(content).execute(false).body(); String body = HttpRequest.post(content).execute(false).body();
System.out.println("发送手机号码:" + phone + ",内容:" + msg + ",返回结果:" + body); System.out.println("发送手机号码:" + phone + ",内容:" + msg + ",返回结果:" + body);
if (body == null || !body.contains("ok")) { if (body == null || !body.contains("ok")) {
@ -92,7 +92,7 @@ public class SysSmsServiceImpl implements ISysSmsService {
} }
// 发送短信 // 发送短信
try { try {
String content = url + "&mobile=" + phone + "&content=【智慧仓储】您正在进行短信验证,验证码:" + code + "请在5分钟内完成验证。"; String content = URL + "&mobile=" + phone + "&content=【智慧仓储】您正在进行短信验证,验证码:" + code + "请在5分钟内完成验证。";
String body = HttpRequest.post(content).execute(false).body(); String body = HttpRequest.post(content).execute(false).body();
System.out.println("发送短信:" + phone + ",验证码:" + code + ",返回结果:" + body); System.out.println("发送短信:" + phone + ",验证码:" + code + ",返回结果:" + body);
if (body == null || !body.contains("ok")) { if (body == null || !body.contains("ok")) {