java110 лет назад: 4
Родитель
Сommit
3ba9add615

+ 104 - 31
java110-generator/src/main/resources/web/template_1.json

@@ -1,61 +1,134 @@
 {
-  "templateName":"保证金对象",
-  "templateCode":"accountBondObj",
-  "templateKey":"bobjId",
-  "templateKeyName":"保证金对象ID",
-  "searchCode": "bobjId",
-  "searchName": "保证金对象ID",
-  "directories": "acct",
+  "templateName":"短信配置",
+  "templateCode":"smsConfig",
+  "templateKey":"smsId",
+  "templateKeyName":"短信编号",
+  "searchCode": "smsId",
+  "searchName": "短信编号",
+  "directories": "property",
   "conditions": [
+    {
+      "name": "活动标题",
+      "inputType": "input",
+      "code": "title",
+      "whereCondition": "equal"
+    }
   ],
   "columns":[
     {
-      "code":"bondId",
-      "cnCode":"保证金",
-      "desc":"必填,请填写保证金",
+      "code":"smsType",
+      "cnCode":"短信商",
+      "desc":"必填,请填写短信商",
       "required":true,
       "hasDefaultValue":false,
-      "inputType":"input",
+      "inputType": "select",
+      "selectValue":"ALI,TECENT",
+      "selectValueName":"阿里,腾讯",
       "limit":"maxin",
       "limitParam":"1,20",
-      "limitErrInfo":"保证金名称超长了",
+      "limitErrInfo":"短信商超长了",
       "show": true
     },
     {
-      "code": "objId",
-      "cnCode":"保证金对象ID",
-      "desc":"必填,请填写保证金对象ID",
+      "code": "smsBusi",
+      "cnCode":"短信业务",
+      "desc":"必填,请填写短信业务",
       "required":true,
       "hasDefaultValue":false,
-      "inputType": "input",
+      "inputType": "select",
+      "selectValue":"1001,2002",
+      "selectValueName":"欠费催缴,工单通知",
       "limit":"num",
       "limitParam":"",
-      "limitErrInfo":"保证金金额格式有误",
+      "limitErrInfo":"短信业务格式有误",
       "show": true
     },
     {
-      "code": "receivableAmount",
-      "cnCode":"应收金额",
-      "desc":"必填,请填写应收金额",
-      "required":false,
+      "code": "templateCode",
+      "cnCode":"短信模板",
+      "desc":"必填,请填写短信模板",
+      "required":true,
       "hasDefaultValue":false,
       "inputType": "input",
-      "limit":"num",
-      "limitParam":"",
-      "limitErrInfo":"不是有效数字格式",
+      "limit":"maxLength",
+      "limitParam":"64",
+      "limitErrInfo":"短信模板超过64位",
       "show": true
     },
     {
-      "code": "receivedAmount",
-      "cnCode":"实收金额",
-      "desc":"必填,请填写实收金额",
-      "required":false,
+      "code": "signName",
+      "cnCode":"短信签名",
+      "desc":"必填,请填写短信签名",
+      "required":true,
       "hasDefaultValue":false,
       "inputType": "input",
-      "limit":"num",
-      "limitParam":"",
-      "limitErrInfo":"不是有效数字格式",
+      "limit":"maxLength",
+      "limitParam":"128",
+      "limitErrInfo":"短信签名超过128位",
+      "show": true
+    },
+    {
+      "code": "accessSecret",
+      "cnCode":"短信秘钥",
+      "desc":"必填,请填写短信秘钥",
+      "required":true,
+      "hasDefaultValue":false,
+      "inputType": "input",
+      "limit":"maxLength",
+      "limitParam":"128",
+      "limitErrInfo":"短信秘钥超过128位",
       "show": true
+    },
+    {
+      "code": "accessKeyId",
+      "cnCode":"访问KEY",
+      "desc":"必填,请填写访问KEY",
+      "required":true,
+      "hasDefaultValue":false,
+      "inputType": "input",
+      "limit":"maxLength",
+      "limitParam":"128",
+      "limitErrInfo":"访问KEY超过128位",
+      "show": true
+    },
+    {
+      "code": "region",
+      "cnCode":"区域",
+      "desc":"必填,请填写区域",
+      "required":true,
+      "hasDefaultValue":false,
+      "inputType": "input",
+      "limit":"maxLength",
+      "limitParam":"64",
+      "limitErrInfo":"区域超过64位",
+      "show": true
+    },
+    {
+      "code": "logSwitch",
+      "cnCode":"日志",
+      "desc":"必填,请填写日志",
+      "required":true,
+      "hasDefaultValue":false,
+      "inputType": "select",
+      "selectValue":"ON,OFF",
+      "selectValueName":"记录,不记录",
+      "limit":"maxLength",
+      "limitParam":"20",
+      "limitErrInfo":"日志格式有误",
+      "show": true
+    },
+    {
+      "code":"remark",
+      "cnCode":"备注",
+      "desc":"可填,请填写备注",
+      "required":false,
+      "hasDefaultValue":false,
+      "defaultValue":"",
+      "inputType":"input",
+      "limit":"maxLength",
+      "limitParam":"200",
+      "limitErrInfo":"备注内容不能超过200",
+      "show": false
     }
   ]
 }

+ 4 - 6
service-common/src/main/java/com/java110/common/api/SmsConfigApi.java

@@ -11,11 +11,7 @@ import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 
 @RestController
@@ -41,7 +37,8 @@ public class SmsConfigApi {
      * @path /app/smsConfig/saveSmsConfig
      */
     @RequestMapping(value = "/saveSmsConfig", method = RequestMethod.POST)
-    public ResponseEntity<String> saveSmsConfig(@RequestBody JSONObject reqJson) {
+    public ResponseEntity<String> saveSmsConfig(@RequestHeader(value = "store-id") String storeId,
+                                                @RequestBody JSONObject reqJson) {
 
         Assert.hasKeyAndValue(reqJson, "objId", "请求报文中未包含objId");
         Assert.hasKeyAndValue(reqJson, "smsType", "请求报文中未包含smsType");
@@ -55,6 +52,7 @@ public class SmsConfigApi {
 
 
         SmsConfigPo smsConfigPo = BeanConvertUtil.covertBean(reqJson, SmsConfigPo.class);
+        smsConfigPo.setStoreId(storeId);
         return saveSmsConfigBMOImpl.save(smsConfigPo);
     }
 

+ 12 - 0
service-common/src/main/java/com/java110/common/bmo/smsConfig/impl/SaveSmsConfigBMOImpl.java

@@ -3,6 +3,7 @@ package com.java110.common.bmo.smsConfig.impl;
 import com.java110.common.bmo.smsConfig.ISaveSmsConfigBMO;
 import com.java110.core.annotation.Java110Transactional;
 import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.dto.smsConfig.SmsConfigDto;
 import com.java110.intf.common.ISmsConfigInnerServiceSMO;
 import com.java110.po.smsConfig.SmsConfigPo;
 import com.java110.vo.ResultVo;
@@ -10,12 +11,15 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 @Service("saveSmsConfigBMOImpl")
 public class SaveSmsConfigBMOImpl implements ISaveSmsConfigBMO {
 
     @Autowired
     private ISmsConfigInnerServiceSMO smsConfigInnerServiceSMOImpl;
 
+
     /**
      * 添加小区信息
      *
@@ -25,6 +29,14 @@ public class SaveSmsConfigBMOImpl implements ISaveSmsConfigBMO {
     @Java110Transactional
     public ResponseEntity<String> save(SmsConfigPo smsConfigPo) {
 
+        //判断是否重复配置
+        SmsConfigDto smsConfigDto = new SmsConfigDto();
+        smsConfigDto.setObjId(smsConfigPo.getObjId());
+        smsConfigDto.setSmsBusi(smsConfigPo.getSmsBusi());
+        List<SmsConfigDto> smsConfigDtos = smsConfigInnerServiceSMOImpl.querySmsConfigs(smsConfigDto);
+        if (smsConfigDtos != null && smsConfigDtos.size() > 0) {
+            throw new IllegalArgumentException("已经配置 请勿重复配置");
+        }
         smsConfigPo.setSmsId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_smsId));
         int flag = smsConfigInnerServiceSMOImpl.saveSmsConfig(smsConfigPo);