Sfoglia il codice sorgente

企业注册 街道审核短信发错给企业的bug修复

huZhiHao 5 anni fa
parent
commit
07d8df7b3e

+ 1 - 1
src/main/java/platform/common/Constant.java

@@ -910,7 +910,7 @@ public final class Constant {
         //产业供地提醒 板块到商务
         public static String INDUSTRIAL_LAND_SUPPLY_COMMERE = "SMS_189027404";
 
-        //商务咨询分发
+        //商务咨询分发S_REGISTER_REMIND
         public static String INDUSTRIAL_LAND_SUPPLY_CONSUL = "SMS_189032857";
 
         //预审结束给党政办

+ 9 - 8
src/main/java/platform/modules/government/service/LogoService.java

@@ -49,7 +49,7 @@ public class LogoService extends BaseService<Logo> {
         for (Logo logo : Logo) {
             List<Attachment> attachments = attachmentService.selectByIdAndBusinessId(Constant.Attachment.LOGO, logo.getId(), null);
             if (null != attachments && attachments.size() > 0) {
-                FileDown fileDown = new FileDown(attachments.get(0).getId(), attachments.get(0).getFile_name(), attachments.get(0).getFile_url(),attachments.get(0).getDownload_uri());
+                FileDown fileDown = new FileDown(attachments.get(0).getId(), attachments.get(0).getFile_name(), attachments.get(0).getFile_url(), attachments.get(0).getDownload_uri());
                 logo.setFileDown(fileDown);
             }
         }
@@ -64,11 +64,11 @@ public class LogoService extends BaseService<Logo> {
         criteria.andEqualTo("is_start", 1);
         example.orderBy("create_time").desc();
         List<Logo> logo = this.selectByExample(example);
-        if (null != logo) {
+        if (null != logo && logo.size() > 0) {
             Logo lo = logo.get(0);
             List<Attachment> attachments = attachmentService.selectByIdAndBusinessId(Constant.Attachment.LOGO, lo.getId(), null);
             if (null != attachments && attachments.size() > 0) {
-                FileDown fileDown = new FileDown(attachments.get(0).getId(), attachments.get(0).getFile_name(), attachments.get(0).getFile_url(),attachments.get(0).getDownload_uri());
+                FileDown fileDown = new FileDown(attachments.get(0).getId(), attachments.get(0).getFile_name(), attachments.get(0).getFile_url(), attachments.get(0).getDownload_uri());
                 lo.setFileDown(fileDown);
             }
             return lo;
@@ -79,7 +79,7 @@ public class LogoService extends BaseService<Logo> {
     public Boolean saveLogo(Logo logo) throws Exception {
         if (this.insertAndGetId(logo) > 0) {
             //更新其他logo
-            if(null!=logo.getIs_start()&&logo.getIs_start()){
+            if (null != logo.getIs_start() && logo.getIs_start()) {
                 logoDao.updateOtherLogo(logo.getId());
             }
             attachmentDao.deleteByBusiness(Constant.Attachment.LOGO, logo.getId());
@@ -94,10 +94,10 @@ public class LogoService extends BaseService<Logo> {
     public Boolean updateLogo(Logo logo) throws Exception {
         if (this.updateSelective(logo) == 1) {
             //更新其他logo
-            if(null!=logo.getIs_start()&&logo.getIs_start()){
+            if (null != logo.getIs_start() && logo.getIs_start()) {
                 logoDao.updateOtherLogo(logo.getId());
             }
-            if(null!=logo.getFileDown().getFile_id()) {
+            if (null != logo.getFileDown().getFile_id()) {
                 attachmentDao.deleteByBusiness(Constant.Attachment.LOGO, logo.getId());
                 attachmentDao.updateAttachment(Constant.Attachment.LOGO, logo.getId(), logo.getFileDown().getFile_id());
             }
@@ -125,7 +125,8 @@ public class LogoService extends BaseService<Logo> {
     public void updateOtherLogo(Integer id) throws Exception {
         logoDao.updateOtherLogo(id);
     }
-    public Integer  countLogo(Integer id) throws Exception {
-       return logoDao.countLogo(id);
+
+    public Integer countLogo(Integer id) throws Exception {
+        return logoDao.countLogo(id);
     }
 }

+ 4 - 4
src/main/java/platform/modules/home/web/HomeRefactorController.java

@@ -527,9 +527,6 @@ public class HomeRefactorController extends BaseController {
             dto.setToken(skyImageApiService.accessToken());
             skyImageApiService.syncUserInfo(dto);
 
-            //新增街道待办
-            addWaitToDo(information);
-
             //发送短信
             Map<String, String> params = new HashMap<>();
             params.put("user", user.getNick_name());
@@ -538,6 +535,9 @@ public class HomeRefactorController extends BaseController {
             String templateParam = JSONObject.toJSONString(params);
             AlibabaSMSUtil.sendSMS(information.getPhone(), templatCode, Constant.SINGNAMW, templateParam);
 
+            //新增街道待办
+            addWaitToDo(information);
+
         } catch (Exception e) {
             e.printStackTrace();
             return ResponseMessage.error("注册失败" + e.getMessage());
@@ -689,7 +689,7 @@ public class HomeRefactorController extends BaseController {
                         String templatCode = Constant.SMS_TemplateCode.S_REGISTER_REMIND;
                         String templateParam = JSONObject.toJSONString(params);
                         try {
-                            AlibabaSMSUtil.sendSMS(information.getPhone(), templatCode, Constant.SINGNAMW, templateParam);
+                            AlibabaSMSUtil.sendSMS(puser.getPhone(), templatCode, Constant.SINGNAMW, templateParam);
                         } catch (ClientException | InterruptedException e) {
                             e.printStackTrace();
                         }