From 3619269ee409e4c64c1a360319211efe25afc2e3 Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Mon, 12 Aug 2024 13:11:46 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sgzb-ui/src/views/repairTest/repair/dialogOneForm.vue | 5 +++-- sgzb-ui/vue.config.js | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/sgzb-ui/src/views/repairTest/repair/dialogOneForm.vue b/sgzb-ui/src/views/repairTest/repair/dialogOneForm.vue index c729966..6bf246d 100644 --- a/sgzb-ui/src/views/repairTest/repair/dialogOneForm.vue +++ b/sgzb-ui/src/views/repairTest/repair/dialogOneForm.vue @@ -100,7 +100,7 @@ --> - - + + > + + - -
- + +
+
+ Date: Mon, 12 Aug 2024 18:25:11 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E5=90=88=E5=B9=B6=E9=85=8D=E4=BB=B6?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/service/impl/ExcelServiceImpl.java | 53 +++++-------------- 1 file changed, 13 insertions(+), 40 deletions(-) diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/base/service/impl/ExcelServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/base/service/impl/ExcelServiceImpl.java index af0e5fb..e2fae7d 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/base/service/impl/ExcelServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/base/service/impl/ExcelServiceImpl.java @@ -161,74 +161,47 @@ public class ExcelServiceImpl implements ExcelService { } } - private void printLevel3Relation(Map>> level3Relation) { for (Map.Entry>> firstLevel : level3Relation.entrySet()) { - boolean outExist = true; System.out.println("level_1: " + firstLevel.getKey()); - //TODO, sql查询:是否有此名字 + parentId=0, select * from ma_part_type where name=? and parent_id=0; MaPartType maPartType_level1 = excelMapper.selectMa(firstLevel.getKey(),0); - //TODO, 以上返回 maPartType_level1 if (Objects.nonNull(maPartType_level1)) { - loopInner(firstLevel, outExist,maPartType_level1.getPaId()); + loopInner(firstLevel, maPartType_level1.getPaId()); } else { - //TODO, insert firstLevel, get id MaPartType maPartType = new MaPartType(); maPartType.setPaName(firstLevel.getKey()); maPartType.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString()); maPartType.setParentId(0L); maPartType.setLevel("1"); excelMapper.insertPaName(maPartType);//如果第一层在数据库中查询不到则插入数据,并且读取到parent_id - outExist = outExist && false; - loopInner(firstLevel, outExist, maPartType.getPaId()); + loopInner(firstLevel, maPartType.getPaId()); } } } - private void loopInner(Map.Entry>> firstLevel, boolean outExist, long firstLevelId) { + private void loopInner(Map.Entry>> firstLevel, long firstLevelId) { for (Map.Entry> secondLevel : firstLevel.getValue().entrySet()) { System.out.println("\tlevel_2: " + secondLevel.getKey()); - //TODO, sql查询:是否有此名字 + parentId=firstLevelId, select * from ma_part_type where name=? and parent_id = firstLevelId; MaPartType maPartType_level2 = excelMapper.selectMa(secondLevel.getKey(),firstLevelId); - //TODO, 以上返回 maPartType_level2 if (Objects.nonNull(maPartType_level2)) { - looplevel3(secondLevel, outExist, maPartType_level2.getPaId()); + looplevel3(secondLevel, maPartType_level2.getPaId()); } else { - //TODO, insert firstLevel, get id - if (!outExist) { - MaPartType maPartType = new MaPartType(); - maPartType.setPaName(secondLevel.getKey()); - maPartType.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString()); - maPartType.setParentId(firstLevelId); - maPartType.setLevel("2"); - excelMapper.insertPaName(maPartType);//如果第一层在数据库中查询不到则插入数据,并且读取到parent_id - outExist = outExist && false; - looplevel3(secondLevel, outExist, maPartType.getPaId()); - } + MaPartType maPartType = new MaPartType(); + maPartType.setPaName(secondLevel.getKey()); + maPartType.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString()); + maPartType.setParentId(firstLevelId); + maPartType.setLevel("2"); + excelMapper.insertPaName(maPartType);//如果第一层在数据库中查询不到则插入数据,并且读取到parent_id + looplevel3(secondLevel, maPartType.getPaId()); } } } - private void looplevel3(Map.Entry> secondLevel, boolean outExist, long secondLevelId) { + private void looplevel3(Map.Entry> secondLevel, long secondLevelId) { for (MapType thirdLevel : secondLevel.getValue()) { System.out.println("\t\tlevel_3: " + thirdLevel); - //TODO, sql查询:是否有此名字 + parentId=secondLevelId, select * from ma_part_type where name=? and parent_id = secondLevelId; MaPartType maPartType_level3 = excelMapper.selectMa(thirdLevel.getPaName(),secondLevelId); - //TODO, 以上返回 maPartType_level3 - if (Objects.nonNull(maPartType_level3)) { - if (!outExist) { - //TODO insert - MaPartType maPartType = new MaPartType(); - maPartType.setPaName(thirdLevel.getPaName()); - maPartType.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString()); - maPartType.setUnitId(thirdLevel.getUnitId()); - maPartType.setBuyPrice(thirdLevel.getBuyPrice()); - maPartType.setParentId(secondLevelId); - maPartType.setLevel("3"); - excelMapper.insertPaName(maPartType);//如果第一层在数据库中查询不到则插入数据,并且读取到parent_id - } - } else { - //TODO insert + if (Objects.isNull(maPartType_level3)) { MaPartType maPartType = new MaPartType(); maPartType.setPaName(thirdLevel.getPaName()); maPartType.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString()); From c0fd7885dc1d5bde003898c81f021decfb94f99d Mon Sep 17 00:00:00 2001 From: "liang.chao" <1360241448@qq.com> Date: Tue, 13 Aug 2024 10:12:37 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E7=9F=AD=E4=BF=A1=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SysSmsServiceImpl.java | 37 +++++++++++++------ 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysSmsServiceImpl.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysSmsServiceImpl.java index afe1cd0..ea15c92 100644 --- a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysSmsServiceImpl.java +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysSmsServiceImpl.java @@ -8,7 +8,9 @@ import com.bonus.sgzb.common.core.exception.ServiceException; import com.bonus.sgzb.common.core.utils.GlobalConstants; import com.bonus.sgzb.common.core.web.domain.AjaxResult; import com.bonus.sgzb.common.redis.service.RedisService; +import com.bonus.sgzb.system.api.domain.SysUser; import com.bonus.sgzb.system.config.TencentSmsConfig; +import com.bonus.sgzb.system.mapper.SysUserMapper; import com.bonus.sgzb.system.service.ISysSmsService; import com.tencentcloudapi.common.Credential; import com.tencentcloudapi.common.exception.TencentCloudSDKException; @@ -43,6 +45,8 @@ public class SysSmsServiceImpl implements ISysSmsService { @Resource private RedisService redisService; + @Resource + private SysUserMapper sysUserMapper; @Resource private TencentSmsConfig tencentSmsConfig; @@ -55,6 +59,7 @@ public class SysSmsServiceImpl implements ISysSmsService { /** * 验收通知短信 + * * @param phone 手机号 * @param msg 内容 * @return @@ -74,11 +79,12 @@ public class SysSmsServiceImpl implements ISysSmsService { } catch (Exception e) { return AjaxResult.error("发送失败:" + e.getMessage()); }*/ - return sendMsgByPhone( phone, msg); + return sendMsgByPhone(phone, msg); } /** * 登录短信验证码 + * * @param phone 手机号 * @return */ @@ -96,12 +102,13 @@ public class SysSmsServiceImpl implements ISysSmsService { } catch (Exception e) { return AjaxResult.error("发送失败:" + e.getMessage()); }*/ - return sendCodeByPhone(phone,null); + return sendCodeByPhone(phone, null); } /** * 发送消息msg到手机 + * * @param phone 手机号码 * @return AjaxResult对象 */ @@ -128,6 +135,7 @@ public class SysSmsServiceImpl implements ISysSmsService { /** * 发送验证码到手机 + * * @param phone 手机号码 * @return AjaxResult对象 */ @@ -136,6 +144,11 @@ public class SysSmsServiceImpl implements ISysSmsService { if (phone == null || phone.length() != UserConstants.PHONE_DEFAULT_LENGTH_LOGIN) { return AjaxResult.error("手机号格式错误,请输入11位数字号码"); } + // 校验是否存在该手机号 + SysUser sysUser = sysUserMapper.checkPhoneUnique(phone); + if (sysUser == null){ + return AjaxResult.error("该手机号未绑定用户,请重新确认"); + } String code = getSixBitCode(); // 校验验证码 if (code.length() != UserConstants.CODE_MIN_LENGTH_LOGIN) { @@ -151,7 +164,8 @@ public class SysSmsServiceImpl implements ISysSmsService { } // 存储验证码至Redis中,键值为:code_15588886157 , 有效期5,时间颗粒度为MINUTES:分钟 redisService.setCacheObject("code_" + phone, code, 5L, TimeUnit.MINUTES); - return success("手机号:" + phone + ",用户登录验证码:" + code + ",返回结果:" + body); +// return success("手机号:" + phone + ",用户登录验证码:" + code + ",返回结果:" + body); + return success("验证码发送成功",body); } catch (Exception e) { return AjaxResult.error("发送失败:" + e.getMessage()); } @@ -195,15 +209,16 @@ public class SysSmsServiceImpl implements ISysSmsService { /** * 腾讯sms短信 + * * @param mobilePhone * @param templateId * @param args * @return * @throws Exception */ - public String sendMessageNew(String mobilePhone,String templateId, String... args) throws Exception { + public String sendMessageNew(String mobilePhone, String templateId, String... args) throws Exception { - try{ + try { // 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey,此处还需注意密钥对的保密 Credential cred = new Credential(tencentSmsConfig.getAccessKeyId(), tencentSmsConfig.getAccessKeySecret()); // 实例化一个http选项,可选的,没有特殊需求可以跳过 @@ -227,7 +242,7 @@ public class SysSmsServiceImpl implements ISysSmsService { phoneNumberSet1[i] = "+86" + phoneNumberSet1[i]; } req.setPhoneNumberSet(phoneNumberSet1);//发送的手机号 - if(null != args && args.length > 0 && Arrays.stream(args) + if (null != args && args.length > 0 && Arrays.stream(args) .noneMatch(s -> s == null || s.trim().isEmpty())) { String[] templateParamSet1 = args;//模板的参数 req.setTemplateParamSet(templateParamSet1);//发送验证码 @@ -239,19 +254,19 @@ public class SysSmsServiceImpl implements ISysSmsService { log.info("腾讯云平台短信发送响应结果:{}", JSONObject.toJSONString(resp)); SendStatus[] sendStatusSet = resp.getSendStatusSet(); List sendStatuses = Arrays.asList(sendStatusSet); - if (CollectionUtils.isNotEmpty(sendStatuses)){ + if (CollectionUtils.isNotEmpty(sendStatuses)) { for (SendStatus sendStatus : sendStatuses) { - if (!"OK".equalsIgnoreCase(sendStatus.getCode())){ - throw new ServiceException(sendStatus.getMessage(),Integer.valueOf(sendStatus.getCode())); + if (!"OK".equalsIgnoreCase(sendStatus.getCode())) { + throw new ServiceException(sendStatus.getMessage(), Integer.valueOf(sendStatus.getCode())); } } } - return resp.getRequestId(); + return resp.getRequestId(); } catch (TencentCloudSDKException e) { e.printStackTrace(); log.error("短信发送失败:{}", e.getMessage()); - throw new ServiceException(e.getMessage(),Integer.valueOf(e.getErrorCode())); + throw new ServiceException(e.getMessage(), Integer.valueOf(e.getErrorCode())); } } } From ce2396aafccdf1e20ff10b52cf17378fb688484f Mon Sep 17 00:00:00 2001 From: "liang.chao" <1360241448@qq.com> Date: Tue, 13 Aug 2024 10:27:54 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E7=9F=AD=E4=BF=A1=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bonus/sgzb/system/service/impl/SysSmsServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysSmsServiceImpl.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysSmsServiceImpl.java index ea15c92..8e2b157 100644 --- a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysSmsServiceImpl.java +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysSmsServiceImpl.java @@ -146,7 +146,7 @@ public class SysSmsServiceImpl implements ISysSmsService { } // 校验是否存在该手机号 SysUser sysUser = sysUserMapper.checkPhoneUnique(phone); - if (sysUser == null){ + if (sysUser == null) { return AjaxResult.error("该手机号未绑定用户,请重新确认"); } String code = getSixBitCode(); @@ -165,7 +165,7 @@ public class SysSmsServiceImpl implements ISysSmsService { // 存储验证码至Redis中,键值为:code_15588886157 , 有效期5,时间颗粒度为MINUTES:分钟 redisService.setCacheObject("code_" + phone, code, 5L, TimeUnit.MINUTES); // return success("手机号:" + phone + ",用户登录验证码:" + code + ",返回结果:" + body); - return success("验证码发送成功",body); + return success("验证码发送成功:" + body); } catch (Exception e) { return AjaxResult.error("发送失败:" + e.getMessage()); } From d2098dab1bcd42d6e73c829bb8baacbad7aee947 Mon Sep 17 00:00:00 2001 From: "liang.chao" <1360241448@qq.com> Date: Tue, 13 Aug 2024 10:33:38 +0800 Subject: [PATCH 6/8] fix bug --- .../service/impl/SysSmsServiceImpl.java | 37 +++++++++++----- .../picking/apply/component/AddPicking1.vue | 5 +-- .../views/repairTest/repair/dialogOneForm.vue | 5 ++- .../toolsAcceptance/component/codingTools.vue | 3 +- .../toolsAcceptance/component/home.vue | 1 - .../toolsAcceptance/component/queryTools.vue | 1 + .../newPurchase/toolsAcceptance/index.vue | 1 + .../warehousing/newParts/index.vue | 44 +++++++++---------- .../warehousing/newTools/index.vue | 2 + sgzb-ui/vue.config.js | 4 +- 10 files changed, 60 insertions(+), 43 deletions(-) diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysSmsServiceImpl.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysSmsServiceImpl.java index afe1cd0..8e2b157 100644 --- a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysSmsServiceImpl.java +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysSmsServiceImpl.java @@ -8,7 +8,9 @@ import com.bonus.sgzb.common.core.exception.ServiceException; import com.bonus.sgzb.common.core.utils.GlobalConstants; import com.bonus.sgzb.common.core.web.domain.AjaxResult; import com.bonus.sgzb.common.redis.service.RedisService; +import com.bonus.sgzb.system.api.domain.SysUser; import com.bonus.sgzb.system.config.TencentSmsConfig; +import com.bonus.sgzb.system.mapper.SysUserMapper; import com.bonus.sgzb.system.service.ISysSmsService; import com.tencentcloudapi.common.Credential; import com.tencentcloudapi.common.exception.TencentCloudSDKException; @@ -43,6 +45,8 @@ public class SysSmsServiceImpl implements ISysSmsService { @Resource private RedisService redisService; + @Resource + private SysUserMapper sysUserMapper; @Resource private TencentSmsConfig tencentSmsConfig; @@ -55,6 +59,7 @@ public class SysSmsServiceImpl implements ISysSmsService { /** * 验收通知短信 + * * @param phone 手机号 * @param msg 内容 * @return @@ -74,11 +79,12 @@ public class SysSmsServiceImpl implements ISysSmsService { } catch (Exception e) { return AjaxResult.error("发送失败:" + e.getMessage()); }*/ - return sendMsgByPhone( phone, msg); + return sendMsgByPhone(phone, msg); } /** * 登录短信验证码 + * * @param phone 手机号 * @return */ @@ -96,12 +102,13 @@ public class SysSmsServiceImpl implements ISysSmsService { } catch (Exception e) { return AjaxResult.error("发送失败:" + e.getMessage()); }*/ - return sendCodeByPhone(phone,null); + return sendCodeByPhone(phone, null); } /** * 发送消息msg到手机 + * * @param phone 手机号码 * @return AjaxResult对象 */ @@ -128,6 +135,7 @@ public class SysSmsServiceImpl implements ISysSmsService { /** * 发送验证码到手机 + * * @param phone 手机号码 * @return AjaxResult对象 */ @@ -136,6 +144,11 @@ public class SysSmsServiceImpl implements ISysSmsService { if (phone == null || phone.length() != UserConstants.PHONE_DEFAULT_LENGTH_LOGIN) { return AjaxResult.error("手机号格式错误,请输入11位数字号码"); } + // 校验是否存在该手机号 + SysUser sysUser = sysUserMapper.checkPhoneUnique(phone); + if (sysUser == null) { + return AjaxResult.error("该手机号未绑定用户,请重新确认"); + } String code = getSixBitCode(); // 校验验证码 if (code.length() != UserConstants.CODE_MIN_LENGTH_LOGIN) { @@ -151,7 +164,8 @@ public class SysSmsServiceImpl implements ISysSmsService { } // 存储验证码至Redis中,键值为:code_15588886157 , 有效期5,时间颗粒度为MINUTES:分钟 redisService.setCacheObject("code_" + phone, code, 5L, TimeUnit.MINUTES); - return success("手机号:" + phone + ",用户登录验证码:" + code + ",返回结果:" + body); +// return success("手机号:" + phone + ",用户登录验证码:" + code + ",返回结果:" + body); + return success("验证码发送成功:" + body); } catch (Exception e) { return AjaxResult.error("发送失败:" + e.getMessage()); } @@ -195,15 +209,16 @@ public class SysSmsServiceImpl implements ISysSmsService { /** * 腾讯sms短信 + * * @param mobilePhone * @param templateId * @param args * @return * @throws Exception */ - public String sendMessageNew(String mobilePhone,String templateId, String... args) throws Exception { + public String sendMessageNew(String mobilePhone, String templateId, String... args) throws Exception { - try{ + try { // 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey,此处还需注意密钥对的保密 Credential cred = new Credential(tencentSmsConfig.getAccessKeyId(), tencentSmsConfig.getAccessKeySecret()); // 实例化一个http选项,可选的,没有特殊需求可以跳过 @@ -227,7 +242,7 @@ public class SysSmsServiceImpl implements ISysSmsService { phoneNumberSet1[i] = "+86" + phoneNumberSet1[i]; } req.setPhoneNumberSet(phoneNumberSet1);//发送的手机号 - if(null != args && args.length > 0 && Arrays.stream(args) + if (null != args && args.length > 0 && Arrays.stream(args) .noneMatch(s -> s == null || s.trim().isEmpty())) { String[] templateParamSet1 = args;//模板的参数 req.setTemplateParamSet(templateParamSet1);//发送验证码 @@ -239,19 +254,19 @@ public class SysSmsServiceImpl implements ISysSmsService { log.info("腾讯云平台短信发送响应结果:{}", JSONObject.toJSONString(resp)); SendStatus[] sendStatusSet = resp.getSendStatusSet(); List sendStatuses = Arrays.asList(sendStatusSet); - if (CollectionUtils.isNotEmpty(sendStatuses)){ + if (CollectionUtils.isNotEmpty(sendStatuses)) { for (SendStatus sendStatus : sendStatuses) { - if (!"OK".equalsIgnoreCase(sendStatus.getCode())){ - throw new ServiceException(sendStatus.getMessage(),Integer.valueOf(sendStatus.getCode())); + if (!"OK".equalsIgnoreCase(sendStatus.getCode())) { + throw new ServiceException(sendStatus.getMessage(), Integer.valueOf(sendStatus.getCode())); } } } - return resp.getRequestId(); + return resp.getRequestId(); } catch (TencentCloudSDKException e) { e.printStackTrace(); log.error("短信发送失败:{}", e.getMessage()); - throw new ServiceException(e.getMessage(),Integer.valueOf(e.getErrorCode())); + throw new ServiceException(e.getMessage(), Integer.valueOf(e.getErrorCode())); } } } diff --git a/sgzb-ui/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue b/sgzb-ui/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue index 72fcba5..fe95a43 100644 --- a/sgzb-ui/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue +++ b/sgzb-ui/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue @@ -598,7 +598,7 @@ export default { this.queryParams.examineStatusId = '32' } this.queryParams.unitId = data.unitId - this.queryParams.costBearingParty = data?.costBearingParty + this.queryParams.costBearingParty = data.costBearingParty this.queryParams.proId = data.proId this.queryParams.leaseApplyInfo.phone = data.leaseApplyInfoList[0].phone @@ -633,7 +633,7 @@ export default { } this.queryParams.unitId = data.unitId this.queryParams.proId = data.proId - this.queryParams.costBearingParty = data?.costBearingParty + this.queryParams.costBearingParty = data.costBearingParty this.queryParams.leaseApplyInfo.phone = data.leaseApplyInfoList[0].phone this.queryParams.leaseApplyInfo.leasePerson = @@ -889,4 +889,3 @@ export default { }, } - diff --git a/sgzb-ui/src/views/repairTest/repair/dialogOneForm.vue b/sgzb-ui/src/views/repairTest/repair/dialogOneForm.vue index c729966..6bf246d 100644 --- a/sgzb-ui/src/views/repairTest/repair/dialogOneForm.vue +++ b/sgzb-ui/src/views/repairTest/repair/dialogOneForm.vue @@ -100,7 +100,7 @@ --> - - + + > + + - -
- + +
+
+ Date: Tue, 13 Aug 2024 10:37:46 +0800 Subject: [PATCH 7/8] Revert "fix bug" This reverts commit d2098dab1bcd42d6e73c829bb8baacbad7aee947. --- .../service/impl/SysSmsServiceImpl.java | 37 +++++----------- .../picking/apply/component/AddPicking1.vue | 5 ++- .../views/repairTest/repair/dialogOneForm.vue | 5 +-- .../toolsAcceptance/component/codingTools.vue | 3 +- .../toolsAcceptance/component/home.vue | 1 + .../toolsAcceptance/component/queryTools.vue | 1 - .../newPurchase/toolsAcceptance/index.vue | 1 - .../warehousing/newParts/index.vue | 44 ++++++++++--------- .../warehousing/newTools/index.vue | 2 - sgzb-ui/vue.config.js | 4 +- 10 files changed, 43 insertions(+), 60 deletions(-) diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysSmsServiceImpl.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysSmsServiceImpl.java index 8e2b157..afe1cd0 100644 --- a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysSmsServiceImpl.java +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysSmsServiceImpl.java @@ -8,9 +8,7 @@ import com.bonus.sgzb.common.core.exception.ServiceException; import com.bonus.sgzb.common.core.utils.GlobalConstants; import com.bonus.sgzb.common.core.web.domain.AjaxResult; import com.bonus.sgzb.common.redis.service.RedisService; -import com.bonus.sgzb.system.api.domain.SysUser; import com.bonus.sgzb.system.config.TencentSmsConfig; -import com.bonus.sgzb.system.mapper.SysUserMapper; import com.bonus.sgzb.system.service.ISysSmsService; import com.tencentcloudapi.common.Credential; import com.tencentcloudapi.common.exception.TencentCloudSDKException; @@ -45,8 +43,6 @@ public class SysSmsServiceImpl implements ISysSmsService { @Resource private RedisService redisService; - @Resource - private SysUserMapper sysUserMapper; @Resource private TencentSmsConfig tencentSmsConfig; @@ -59,7 +55,6 @@ public class SysSmsServiceImpl implements ISysSmsService { /** * 验收通知短信 - * * @param phone 手机号 * @param msg 内容 * @return @@ -79,12 +74,11 @@ public class SysSmsServiceImpl implements ISysSmsService { } catch (Exception e) { return AjaxResult.error("发送失败:" + e.getMessage()); }*/ - return sendMsgByPhone(phone, msg); + return sendMsgByPhone( phone, msg); } /** * 登录短信验证码 - * * @param phone 手机号 * @return */ @@ -102,13 +96,12 @@ public class SysSmsServiceImpl implements ISysSmsService { } catch (Exception e) { return AjaxResult.error("发送失败:" + e.getMessage()); }*/ - return sendCodeByPhone(phone, null); + return sendCodeByPhone(phone,null); } /** * 发送消息msg到手机 - * * @param phone 手机号码 * @return AjaxResult对象 */ @@ -135,7 +128,6 @@ public class SysSmsServiceImpl implements ISysSmsService { /** * 发送验证码到手机 - * * @param phone 手机号码 * @return AjaxResult对象 */ @@ -144,11 +136,6 @@ public class SysSmsServiceImpl implements ISysSmsService { if (phone == null || phone.length() != UserConstants.PHONE_DEFAULT_LENGTH_LOGIN) { return AjaxResult.error("手机号格式错误,请输入11位数字号码"); } - // 校验是否存在该手机号 - SysUser sysUser = sysUserMapper.checkPhoneUnique(phone); - if (sysUser == null) { - return AjaxResult.error("该手机号未绑定用户,请重新确认"); - } String code = getSixBitCode(); // 校验验证码 if (code.length() != UserConstants.CODE_MIN_LENGTH_LOGIN) { @@ -164,8 +151,7 @@ public class SysSmsServiceImpl implements ISysSmsService { } // 存储验证码至Redis中,键值为:code_15588886157 , 有效期5,时间颗粒度为MINUTES:分钟 redisService.setCacheObject("code_" + phone, code, 5L, TimeUnit.MINUTES); -// return success("手机号:" + phone + ",用户登录验证码:" + code + ",返回结果:" + body); - return success("验证码发送成功:" + body); + return success("手机号:" + phone + ",用户登录验证码:" + code + ",返回结果:" + body); } catch (Exception e) { return AjaxResult.error("发送失败:" + e.getMessage()); } @@ -209,16 +195,15 @@ public class SysSmsServiceImpl implements ISysSmsService { /** * 腾讯sms短信 - * * @param mobilePhone * @param templateId * @param args * @return * @throws Exception */ - public String sendMessageNew(String mobilePhone, String templateId, String... args) throws Exception { + public String sendMessageNew(String mobilePhone,String templateId, String... args) throws Exception { - try { + try{ // 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey,此处还需注意密钥对的保密 Credential cred = new Credential(tencentSmsConfig.getAccessKeyId(), tencentSmsConfig.getAccessKeySecret()); // 实例化一个http选项,可选的,没有特殊需求可以跳过 @@ -242,7 +227,7 @@ public class SysSmsServiceImpl implements ISysSmsService { phoneNumberSet1[i] = "+86" + phoneNumberSet1[i]; } req.setPhoneNumberSet(phoneNumberSet1);//发送的手机号 - if (null != args && args.length > 0 && Arrays.stream(args) + if(null != args && args.length > 0 && Arrays.stream(args) .noneMatch(s -> s == null || s.trim().isEmpty())) { String[] templateParamSet1 = args;//模板的参数 req.setTemplateParamSet(templateParamSet1);//发送验证码 @@ -254,19 +239,19 @@ public class SysSmsServiceImpl implements ISysSmsService { log.info("腾讯云平台短信发送响应结果:{}", JSONObject.toJSONString(resp)); SendStatus[] sendStatusSet = resp.getSendStatusSet(); List sendStatuses = Arrays.asList(sendStatusSet); - if (CollectionUtils.isNotEmpty(sendStatuses)) { + if (CollectionUtils.isNotEmpty(sendStatuses)){ for (SendStatus sendStatus : sendStatuses) { - if (!"OK".equalsIgnoreCase(sendStatus.getCode())) { - throw new ServiceException(sendStatus.getMessage(), Integer.valueOf(sendStatus.getCode())); + if (!"OK".equalsIgnoreCase(sendStatus.getCode())){ + throw new ServiceException(sendStatus.getMessage(),Integer.valueOf(sendStatus.getCode())); } } } - return resp.getRequestId(); + return resp.getRequestId(); } catch (TencentCloudSDKException e) { e.printStackTrace(); log.error("短信发送失败:{}", e.getMessage()); - throw new ServiceException(e.getMessage(), Integer.valueOf(e.getErrorCode())); + throw new ServiceException(e.getMessage(),Integer.valueOf(e.getErrorCode())); } } } diff --git a/sgzb-ui/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue b/sgzb-ui/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue index fe95a43..72fcba5 100644 --- a/sgzb-ui/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue +++ b/sgzb-ui/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue @@ -598,7 +598,7 @@ export default { this.queryParams.examineStatusId = '32' } this.queryParams.unitId = data.unitId - this.queryParams.costBearingParty = data.costBearingParty + this.queryParams.costBearingParty = data?.costBearingParty this.queryParams.proId = data.proId this.queryParams.leaseApplyInfo.phone = data.leaseApplyInfoList[0].phone @@ -633,7 +633,7 @@ export default { } this.queryParams.unitId = data.unitId this.queryParams.proId = data.proId - this.queryParams.costBearingParty = data.costBearingParty + this.queryParams.costBearingParty = data?.costBearingParty this.queryParams.leaseApplyInfo.phone = data.leaseApplyInfoList[0].phone this.queryParams.leaseApplyInfo.leasePerson = @@ -889,3 +889,4 @@ export default { }, } + diff --git a/sgzb-ui/src/views/repairTest/repair/dialogOneForm.vue b/sgzb-ui/src/views/repairTest/repair/dialogOneForm.vue index 6bf246d..c729966 100644 --- a/sgzb-ui/src/views/repairTest/repair/dialogOneForm.vue +++ b/sgzb-ui/src/views/repairTest/repair/dialogOneForm.vue @@ -100,7 +100,7 @@ --> - - + - - + noChildrenText="没有数据了" + noOptionsText="没有数据" + noResultsText="没有搜索结果" + /> - -
- + +
+
+ Date: Tue, 13 Aug 2024 10:44:27 +0800 Subject: [PATCH 8/8] fix bug --- .../service/impl/SysSmsServiceImpl.java | 37 +++++++++++++------ 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysSmsServiceImpl.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysSmsServiceImpl.java index afe1cd0..8e2b157 100644 --- a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysSmsServiceImpl.java +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysSmsServiceImpl.java @@ -8,7 +8,9 @@ import com.bonus.sgzb.common.core.exception.ServiceException; import com.bonus.sgzb.common.core.utils.GlobalConstants; import com.bonus.sgzb.common.core.web.domain.AjaxResult; import com.bonus.sgzb.common.redis.service.RedisService; +import com.bonus.sgzb.system.api.domain.SysUser; import com.bonus.sgzb.system.config.TencentSmsConfig; +import com.bonus.sgzb.system.mapper.SysUserMapper; import com.bonus.sgzb.system.service.ISysSmsService; import com.tencentcloudapi.common.Credential; import com.tencentcloudapi.common.exception.TencentCloudSDKException; @@ -43,6 +45,8 @@ public class SysSmsServiceImpl implements ISysSmsService { @Resource private RedisService redisService; + @Resource + private SysUserMapper sysUserMapper; @Resource private TencentSmsConfig tencentSmsConfig; @@ -55,6 +59,7 @@ public class SysSmsServiceImpl implements ISysSmsService { /** * 验收通知短信 + * * @param phone 手机号 * @param msg 内容 * @return @@ -74,11 +79,12 @@ public class SysSmsServiceImpl implements ISysSmsService { } catch (Exception e) { return AjaxResult.error("发送失败:" + e.getMessage()); }*/ - return sendMsgByPhone( phone, msg); + return sendMsgByPhone(phone, msg); } /** * 登录短信验证码 + * * @param phone 手机号 * @return */ @@ -96,12 +102,13 @@ public class SysSmsServiceImpl implements ISysSmsService { } catch (Exception e) { return AjaxResult.error("发送失败:" + e.getMessage()); }*/ - return sendCodeByPhone(phone,null); + return sendCodeByPhone(phone, null); } /** * 发送消息msg到手机 + * * @param phone 手机号码 * @return AjaxResult对象 */ @@ -128,6 +135,7 @@ public class SysSmsServiceImpl implements ISysSmsService { /** * 发送验证码到手机 + * * @param phone 手机号码 * @return AjaxResult对象 */ @@ -136,6 +144,11 @@ public class SysSmsServiceImpl implements ISysSmsService { if (phone == null || phone.length() != UserConstants.PHONE_DEFAULT_LENGTH_LOGIN) { return AjaxResult.error("手机号格式错误,请输入11位数字号码"); } + // 校验是否存在该手机号 + SysUser sysUser = sysUserMapper.checkPhoneUnique(phone); + if (sysUser == null) { + return AjaxResult.error("该手机号未绑定用户,请重新确认"); + } String code = getSixBitCode(); // 校验验证码 if (code.length() != UserConstants.CODE_MIN_LENGTH_LOGIN) { @@ -151,7 +164,8 @@ public class SysSmsServiceImpl implements ISysSmsService { } // 存储验证码至Redis中,键值为:code_15588886157 , 有效期5,时间颗粒度为MINUTES:分钟 redisService.setCacheObject("code_" + phone, code, 5L, TimeUnit.MINUTES); - return success("手机号:" + phone + ",用户登录验证码:" + code + ",返回结果:" + body); +// return success("手机号:" + phone + ",用户登录验证码:" + code + ",返回结果:" + body); + return success("验证码发送成功:" + body); } catch (Exception e) { return AjaxResult.error("发送失败:" + e.getMessage()); } @@ -195,15 +209,16 @@ public class SysSmsServiceImpl implements ISysSmsService { /** * 腾讯sms短信 + * * @param mobilePhone * @param templateId * @param args * @return * @throws Exception */ - public String sendMessageNew(String mobilePhone,String templateId, String... args) throws Exception { + public String sendMessageNew(String mobilePhone, String templateId, String... args) throws Exception { - try{ + try { // 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey,此处还需注意密钥对的保密 Credential cred = new Credential(tencentSmsConfig.getAccessKeyId(), tencentSmsConfig.getAccessKeySecret()); // 实例化一个http选项,可选的,没有特殊需求可以跳过 @@ -227,7 +242,7 @@ public class SysSmsServiceImpl implements ISysSmsService { phoneNumberSet1[i] = "+86" + phoneNumberSet1[i]; } req.setPhoneNumberSet(phoneNumberSet1);//发送的手机号 - if(null != args && args.length > 0 && Arrays.stream(args) + if (null != args && args.length > 0 && Arrays.stream(args) .noneMatch(s -> s == null || s.trim().isEmpty())) { String[] templateParamSet1 = args;//模板的参数 req.setTemplateParamSet(templateParamSet1);//发送验证码 @@ -239,19 +254,19 @@ public class SysSmsServiceImpl implements ISysSmsService { log.info("腾讯云平台短信发送响应结果:{}", JSONObject.toJSONString(resp)); SendStatus[] sendStatusSet = resp.getSendStatusSet(); List sendStatuses = Arrays.asList(sendStatusSet); - if (CollectionUtils.isNotEmpty(sendStatuses)){ + if (CollectionUtils.isNotEmpty(sendStatuses)) { for (SendStatus sendStatus : sendStatuses) { - if (!"OK".equalsIgnoreCase(sendStatus.getCode())){ - throw new ServiceException(sendStatus.getMessage(),Integer.valueOf(sendStatus.getCode())); + if (!"OK".equalsIgnoreCase(sendStatus.getCode())) { + throw new ServiceException(sendStatus.getMessage(), Integer.valueOf(sendStatus.getCode())); } } } - return resp.getRequestId(); + return resp.getRequestId(); } catch (TencentCloudSDKException e) { e.printStackTrace(); log.error("短信发送失败:{}", e.getMessage()); - throw new ServiceException(e.getMessage(),Integer.valueOf(e.getErrorCode())); + throw new ServiceException(e.getMessage(), Integer.valueOf(e.getErrorCode())); } } }