魏熙美 6 jaren geleden
bovenliggende
commit
2f0e35728a
20 gewijzigde bestanden met toevoegingen van 1021 en 4 verwijderingen
  1. 91
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/aop/LogAOP.java
  2. 26
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/common/perproties/DaSuProperties.java
  3. 44
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/common/perproties/FuShiProperties.java
  4. 83
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/common/sign/DaSuSign.java
  5. 40
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/config/FuShiConfig.java
  6. 95
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/FSController.java
  7. 29
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java
  8. 12
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserVerifyController.java
  9. 32
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/log/LogAnnotation.java
  10. 43
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/log/LogEnums.java
  11. 101
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/log/LogFactory.java
  12. 46
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/log/LogFileManager.java
  13. 63
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/IFuShiService.java
  14. 12
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITaUserService.java
  15. 8
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/TaUserVerifyServicel.java
  16. 126
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/FuShiServiceImpl.java
  17. 49
    2
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java
  18. 88
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserVerifyServicelmpl.java
  19. 32
    2
      CODE/smart-community/app-api/src/main/resources/application.yml
  20. 1
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/feign/TaUserFeignService.java

+ 91
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/aop/LogAOP.java Bestand weergeven

@@ -0,0 +1,91 @@
1
+package com.community.huiju.aop;
2
+
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.community.commom.fushi.error.FuShiException;
5
+import com.community.huiju.log.LogAnnotation;
6
+import com.community.huiju.log.LogEnums;
7
+import com.community.huiju.log.LogFactory;
8
+import com.community.huiju.log.LogFileManager;
9
+import lombok.extern.slf4j.Slf4j;
10
+import org.aspectj.lang.JoinPoint;
11
+import org.aspectj.lang.ProceedingJoinPoint;
12
+import org.aspectj.lang.Signature;
13
+import org.aspectj.lang.annotation.AfterThrowing;
14
+import org.aspectj.lang.annotation.Around;
15
+import org.aspectj.lang.annotation.Aspect;
16
+import org.aspectj.lang.annotation.Pointcut;
17
+import org.aspectj.lang.reflect.MethodSignature;
18
+import org.springframework.stereotype.Component;
19
+
20
+import java.lang.reflect.Method;
21
+
22
+@Aspect
23
+@Component
24
+@Slf4j
25
+public class LogAOP {
26
+
27
+    @Pointcut("@annotation(com.community.huiju.log.LogAnnotation)")
28
+    public void pointLog() {
29
+
30
+    }
31
+
32
+    @Around("pointLog()")
33
+    public Object logAround(ProceedingJoinPoint point) throws Throwable {
34
+
35
+        // 获取切面的点的实例
36
+        Object target = point.getTarget();
37
+        // 获取反射对象
38
+        Class<?> zClass = target.getClass();
39
+        // 获取切面点
40
+        Signature signature = point.getSignature();
41
+
42
+        // 判断日志注解是否用在方法上
43
+        if (!(signature instanceof MethodSignature)) {
44
+            throw new RuntimeException("该注解只允许在方法上使用!");
45
+        }
46
+
47
+        // 方法名称
48
+        String methodName = signature.getName();
49
+        // 获取方法参数类型
50
+        Class<?>[] parameterTypes = ((MethodSignature) signature).getMethod().getParameterTypes();
51
+
52
+        // 通过方法名称和方法参数类型
53
+        // 获取当前正在执行切面的方法
54
+        Method method = zClass.getMethod(methodName, parameterTypes);
55
+
56
+        // 所有方法输入参数
57
+        Object[] args = point.getArgs();
58
+        // 执行方法的返回值
59
+        Object result = null;
60
+        if (null != method && method.isAnnotationPresent(LogAnnotation.class)) {
61
+
62
+            // 获取这个注解
63
+            LogAnnotation logAnnotation = method.getAnnotation(LogAnnotation.class);
64
+            // 大苏操作
65
+            if (logAnnotation.record() && logAnnotation.value() == LogEnums.DA_SU) {
66
+                String alias = "".equals(logAnnotation.alias()) ? "未设置别名" : logAnnotation.alias();
67
+                    log.info("AOP拦截----大苏操作----执行方法:{},方法别名:{}, 请求参数:{}", methodName, alias,args);
68
+                    // 方法返回值
69
+                    result = point.proceed();
70
+                    log.info("AOP拦截----大苏操作----执行方法:{},方法别名:{},请求参数:{},返回结果:{}", methodName, alias,args, result);
71
+
72
+                    String strPararmeter = String.format( "AOP拦截----大苏操作----执行方法:%s,方法别名:%s,请求参数:%s", methodName, alias,JSONObject.toJSONString(args));
73
+                    String strReturn = String.format("AOP拦截----大苏操作----执行方法:%s,方法别名:%s, 请求参数:%s,返回结果:%s", methodName, alias ,JSONObject.toJSONString(args), JSONObject.toJSONString(result));
74
+
75
+                    LogFileManager.getInstance().executeLog(LogFactory.parametersAndReturn(strPararmeter, strReturn));
76
+
77
+            }
78
+
79
+        }
80
+
81
+        return result;
82
+    }
83
+
84
+    @AfterThrowing(value = "pointLog()", throwing = "cause")
85
+    public void doException(JoinPoint joinPoint, Throwable cause) {
86
+        if (null != cause) {
87
+            throw new FuShiException(cause.getMessage());
88
+        }
89
+    }
90
+
91
+}

+ 26
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/common/perproties/DaSuProperties.java Bestand weergeven

@@ -0,0 +1,26 @@
1
+package com.community.huiju.common.perproties;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Data;
5
+import lombok.NoArgsConstructor;
6
+import org.springframework.boot.context.properties.ConfigurationProperties;
7
+import org.springframework.stereotype.Component;
8
+
9
+/**
10
+ * 提供给 大苏 的 appid 和 appsecret
11
+ * @author weiximei
12
+ */
13
+@Component
14
+@ConfigurationProperties(prefix = "da-su")
15
+@Data
16
+@AllArgsConstructor
17
+@NoArgsConstructor
18
+public class DaSuProperties {
19
+
20
+    private String appid;
21
+
22
+    private String appSecret;
23
+
24
+    private String communityId;
25
+
26
+}

+ 44
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/common/perproties/FuShiProperties.java Bestand weergeven

@@ -0,0 +1,44 @@
1
+package com.community.huiju.common.perproties;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Data;
5
+import lombok.NoArgsConstructor;
6
+import org.springframework.boot.context.properties.ConfigurationProperties;
7
+import org.springframework.stereotype.Component;
8
+
9
+/**
10
+ * 富士配置类
11
+ * @author weiximei
12
+ */
13
+@AllArgsConstructor
14
+@NoArgsConstructor
15
+@Data
16
+@Component
17
+@ConfigurationProperties(prefix = "fu-shi")
18
+public class FuShiProperties {
19
+
20
+    /**
21
+     * 富士云 请求地址
22
+     */
23
+    private String url;
24
+
25
+    /**
26
+     * 富士云 appid
27
+     */
28
+    private String appid;
29
+
30
+    /**
31
+     * 富士云 appSecret
32
+     */
33
+    private String appSecret;
34
+
35
+    /**
36
+     * 富士云 私钥 privateKey
37
+     */
38
+    private String privateKey;
39
+
40
+    /**
41
+     * 停车场编码
42
+     */
43
+    private String parkingCode;
44
+}

+ 83
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/common/sign/DaSuSign.java Bestand weergeven

@@ -0,0 +1,83 @@
1
+package com.community.huiju.common.sign;
2
+
3
+import com.google.common.collect.Maps;
4
+import lombok.extern.slf4j.Slf4j;
5
+import org.apache.commons.codec.digest.DigestUtils;
6
+import org.apache.commons.lang3.StringUtils;
7
+
8
+import java.io.UnsupportedEncodingException;
9
+import java.util.Map;
10
+import java.util.Set;
11
+import java.util.TreeMap;
12
+
13
+/**
14
+ * 大苏签名校验
15
+ */
16
+@Slf4j
17
+public class DaSuSign {
18
+
19
+    /**
20
+     * 校验签名是否相等
21
+     * @param val_1
22
+     * @param val_2
23
+     * @return true 相等  false 不相等
24
+     */
25
+    public static boolean isMD5Sign(String val_1, String val_2) {
26
+        return StringUtils.equals(val_1, val_2);
27
+    }
28
+
29
+    /**
30
+     *
31
+     * 创建签名
32
+     *
33
+     * @param appid
34
+     * @param appSecret
35
+     * @param datetime 时间戳
36
+     * @param encrypt 加密方式(目前就 MD5)
37
+     * @param communityId 小区id
38
+     * @return
39
+     */
40
+    public static String createSign(String appid, String appSecret, String datetime, String encrypt, String communityId, String phone){
41
+        TreeMap<String ,Object> treeMap = Maps.newTreeMap();
42
+        treeMap.put("appid", appid);
43
+        treeMap.put("datetime", datetime);
44
+        treeMap.put("encrypt", encrypt);
45
+        treeMap.put("communityid", communityId);
46
+        treeMap.put("phone", phone);
47
+
48
+        String sign = "";
49
+
50
+        StringBuilder sb = new StringBuilder();
51
+        Set<Map.Entry<String, Object>> entries = treeMap.entrySet();
52
+        entries.forEach(e-> {
53
+            sb.append(e.getKey());
54
+            sb.append("=");
55
+            sb.append(e.getValue());
56
+            sb.append("&");
57
+        });
58
+
59
+        sign = sb.toString();
60
+        sign = sign.substring(0, sign.lastIndexOf("&"));
61
+
62
+        log.info("签名之前参数: {}" , sign);
63
+
64
+        try {
65
+            String str = new String(sign.getBytes("UTF-8"), "UTF-8");
66
+            sign = DigestUtils.md5Hex( str + appSecret);
67
+        } catch (UnsupportedEncodingException e) {
68
+            e.printStackTrace();
69
+        }
70
+
71
+        log.info("签名: {}" , sign);
72
+
73
+        return sign;
74
+    }
75
+
76
+    public static void main(String[] args) {
77
+
78
+        Long timeMillis = System.currentTimeMillis();
79
+        System.out.println(timeMillis);
80
+        String sign = createSign("dssdw2576sd997", "fgexhd855sf4", timeMillis + "", "md5", "101", "15850791953");
81
+    }
82
+
83
+}

+ 40
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/config/FuShiConfig.java Bestand weergeven

@@ -0,0 +1,40 @@
1
+package com.community.huiju.config;
2
+
3
+import com.community.commom.fushi.FuShiHttpClient;
4
+import com.community.commom.fushi.FuShiRequestAPI;
5
+import com.community.huiju.common.perproties.FuShiProperties;
6
+import org.springframework.beans.factory.annotation.Autowired;
7
+import org.springframework.context.annotation.Bean;
8
+import org.springframework.context.annotation.Configuration;
9
+
10
+/**
11
+ * 富士配置类
12
+ * @author weiximei
13
+ */
14
+@Configuration
15
+public class FuShiConfig {
16
+
17
+    @Autowired
18
+    private FuShiProperties fuShiProperties;
19
+
20
+
21
+    /**
22
+     * 初始化富士HTTP客户端
23
+     * @return FuShiHttpClient
24
+     */
25
+    @Bean
26
+    public FuShiHttpClient fuShiHttpClient() {
27
+        return new FuShiHttpClient(fuShiProperties.getUrl(), fuShiProperties.getAppid(), fuShiProperties.getAppSecret(), fuShiProperties.getPrivateKey());
28
+    }
29
+
30
+    /**
31
+     * 初始化富士请求 API
32
+     * @param fuShiHttpClient
33
+     * @return
34
+     */
35
+    @Bean
36
+    public FuShiRequestAPI fuShiRequestAPI(FuShiHttpClient fuShiHttpClient) {
37
+        return new FuShiRequestAPI(fuShiHttpClient);
38
+    }
39
+
40
+}

+ 95
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/FSController.java Bestand weergeven

@@ -0,0 +1,95 @@
1
+package com.community.huiju.controller;
2
+
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.community.commom.mode.ResponseBean;
5
+import com.community.huiju.service.IFuShiService;
6
+import io.swagger.annotations.Api;
7
+import io.swagger.annotations.ApiImplicitParam;
8
+import io.swagger.annotations.ApiImplicitParams;
9
+import io.swagger.annotations.ApiOperation;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+import org.springframework.cloud.context.config.annotation.RefreshScope;
12
+import org.springframework.web.bind.annotation.*;
13
+
14
+@RestController
15
+@RefreshScope
16
+@RequestMapping("/")
17
+@Api(value = "车辆操作API", description = "车辆操作API")
18
+public class FSController extends BaseController {
19
+
20
+    @Autowired
21
+    private IFuShiService iFuShiService;
22
+
23
+    @RequestMapping(value = "/car/getParkInfoByCarNo/{carNo}", method = RequestMethod.GET)
24
+    @ApiOperation(value = "获取停车信息(通过车牌号)", notes = "获取停车信息(通过车牌号)")
25
+    @ApiImplicitParams({
26
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "path", name = "carNo", value = "车牌号")
27
+    })
28
+    public ResponseBean getParkInfoByCarNo(@PathVariable("carNo") String carNo) {
29
+        ResponseBean responseBean = new ResponseBean();
30
+        responseBean = iFuShiService.getParkInfoByCarNo(carNo);
31
+        return responseBean;
32
+    }
33
+
34
+    @RequestMapping(value = "/car/apiThirdPartyMonthCardPay", method = RequestMethod.POST)
35
+    @ApiOperation(value = "月卡续费", notes = "月卡续费")
36
+    @ApiImplicitParams({
37
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "body", name = "parameter", value = "Phone手机号;RenewDayType续费日期类型( 3:年 2:月 1:日, 选入对应的数字);" +
38
+                    "RenewDay续费日期数目;" +
39
+                    "PayStyle交易方式(中文描述),例如:微信、 支付宝、 银联;" +
40
+                    "CarNo车牌号;" +
41
+                    "CardNo停车卡号;" +
42
+                    "RechargeAmt充值续费金额;")
43
+    })
44
+    public ResponseBean apiThirdPartyMonthCardPay(@RequestBody String parameter) {
45
+        ResponseBean responseBean = new ResponseBean();
46
+        JSONObject jsonObject = JSONObject.parseObject(parameter);
47
+        responseBean = iFuShiService.apiThirdPartyMonthCardPay(jsonObject.getString("Phone"),
48
+                jsonObject.getString("RenewDayType"),
49
+                jsonObject.getString("RenewDay"),
50
+                jsonObject.getString("PayStyle"),
51
+                jsonObject.getString("CarNo"),
52
+                jsonObject.getString("CardNo"),
53
+                jsonObject.getString("RechargeAmt"));
54
+        return responseBean;
55
+    }
56
+
57
+    @RequestMapping(value = "/car/apiThirdPartyTemporaryCardPay", method = RequestMethod.POST)
58
+    @ApiOperation(value = "第三方临时卡上发缴费", notes = "第三方临时卡上发缴费")
59
+    @ApiImplicitParams({
60
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "body", name = "parameter", value = "Amount应缴金额(单位元);" +
61
+                    "ActualAmount实缴金额(单位元);" +
62
+                    "DeductionAmount抵扣金额(单位元);" +
63
+                    "Reason抵扣原因;" +
64
+                    "PayStyle交易方式(汉字描述),例如:微信、支付宝、银联;" +
65
+                    "CarNo车牌号;" +
66
+                    "CardNo停车卡号;" +
67
+                    "CouponList使用的优惠券列表")
68
+    })
69
+    public ResponseBean apiThirdPartyTemporaryCardPay(@RequestBody String parameter) {
70
+        ResponseBean responseBean = new ResponseBean();
71
+        JSONObject jsonObject = JSONObject.parseObject(parameter);
72
+        responseBean = iFuShiService.apiThirdPartyTemporaryCardPay(jsonObject.getString("Amount"),
73
+                jsonObject.getString("ActualAmount"),
74
+                jsonObject.getString("DeductionAmount"),
75
+                jsonObject.getString("Reason"),
76
+                jsonObject.getString("PayStyle"),
77
+                jsonObject.getString("CarNo"),
78
+                jsonObject.getString("CardNo"),
79
+                jsonObject.getString("CouponList"));
80
+        return responseBean;
81
+    }
82
+
83
+
84
+    @RequestMapping(value = "/car/apiGetOfflineFee/{carNoOrCardNo}", method = RequestMethod.GET)
85
+    @ApiOperation(value = "获取线下算费结果", notes = "获取线下算费结果")
86
+    @ApiImplicitParams({
87
+        @ApiImplicitParam(paramType = "path", dataTypeClass = String.class, name = "carNoOrCardNo" , value = "车牌号码或卡号")
88
+    })
89
+    public ResponseBean apiGetOfflineFee(@PathVariable("carNoOrCardNo") String carNoOrCardNo) {
90
+        ResponseBean responseBean = new ResponseBean();
91
+        responseBean = iFuShiService.apiGetOfflineFee(carNoOrCardNo);
92
+        return responseBean;
93
+    }
94
+
95
+}

+ 29
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java Bestand weergeven

@@ -296,4 +296,33 @@ public class UserController extends BaseController {
296 296
         return responseBean;
297 297
     }
298 298
 
299
+    @ApiOperation(value = "获取令牌", notes = "获取令牌")
300
+    @ApiImplicitParams({
301
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "appid", value = "提供的appid"),
302
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "datetime", value = "时间戳"),
303
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "encrypt", value = "encrypt加密方式(目前值为md5)"),
304
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "phone", value = "手机号"),
305
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "communityId", value = "提供的小区编号"),
306
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "sign", value = "生成的签名"),
307
+    })
308
+    @RequestMapping(value = "/user/token", method = RequestMethod.GET)
309
+    public ResponseBean daSuToken(@RequestParam("appid") String appid,
310
+                                  @RequestParam("datetime") String datetime,
311
+                                  @RequestParam("encrypt") String encrypt,
312
+                                  @RequestParam("phone") String phone,
313
+                                  @RequestParam("communityId") String communityId,
314
+                                  @RequestParam("sign") String sign,
315
+                                  HttpSession session){
316
+        ResponseBean responseBean = new ResponseBean();
317
+        responseBean = iTaUserService.daSuToken(appid, datetime, encrypt, communityId, phone, sign, session);
318
+        Object object = responseBean.getData();
319
+        if (null != object) {
320
+            TaUserVO userVO = (TaUserVO) responseBean.getData();
321
+            if (userVO != null) {
322
+                setUserElement(userVO, session);
323
+            }
324
+        }
325
+        return responseBean;
326
+    }
327
+
299 328
 }

+ 12
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserVerifyController.java Bestand weergeven

@@ -104,4 +104,16 @@ public class UserVerifyController extends BaseController {
104 104
         return responseBean;
105 105
     }
106 106
 
107
+
108
+    @RequestMapping(value = "/user_verify/add", method = RequestMethod.POST)
109
+    @ApiOperation(value = "添加一个审核的房产 大苏", notes = "添加一个审核的房产 大苏")
110
+    @ApiImplicitParams({
111
+            @ApiImplicitParam(paramType = "body", dataTypeClass = String.class, name = "parameter", value = "userId用户编号;communityId小区编号;roleName角色名称;phaseId期;buildingId楼栋;unitId单元;levelId楼层;roomNoId户号")
112
+    })
113
+    public ResponseBean addDaSuUserVerify(@RequestBody String parameter, HttpSession session) {
114
+        ResponseBean responseBean = new ResponseBean();
115
+        responseBean = taUserVerifyServicel.addDaSuUserVerify(parameter);
116
+        return responseBean;
117
+    }
118
+
107 119
 }

+ 32
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/log/LogAnnotation.java Bestand weergeven

@@ -0,0 +1,32 @@
1
+package com.community.huiju.log;
2
+
3
+import java.lang.annotation.*;
4
+
5
+/**
6
+ * 日志注解
7
+ * @author weiximei
8
+ */
9
+@Retention(RetentionPolicy.RUNTIME) // 在运行时使用
10
+@Target({ ElementType.METHOD }) // 在方法上使用
11
+@Documented
12
+public @interface LogAnnotation {
13
+
14
+    /**
15
+     * 日志类型
16
+     * @return
17
+     */
18
+    LogEnums value() default LogEnums.NOT;
19
+
20
+    /**
21
+     * 是否记录
22
+     * @return
23
+     */
24
+    boolean record() default true;
25
+
26
+    /**
27
+     * 别名, 作为注释用
28
+     * @return
29
+     */
30
+    String alias() default "";
31
+
32
+}

+ 43
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/log/LogEnums.java Bestand weergeven

@@ -0,0 +1,43 @@
1
+package com.community.huiju.log;
2
+
3
+/**
4
+ * 日志类型
5
+ *
6
+ * @author weiximei
7
+ */
8
+public enum LogEnums {
9
+
10
+    NOT(8000, "无类型"),
11
+
12
+    DA_SU(8001, "大苏")
13
+
14
+    ;
15
+
16
+    private Integer code;
17
+
18
+    private String value;
19
+
20
+
21
+    LogEnums(Integer code, String value) {
22
+        this.code = code;
23
+        this.value = value;
24
+    }
25
+
26
+    public Integer getCode() {
27
+        return code;
28
+    }
29
+
30
+    public void setCode(Integer code) {
31
+        this.code = code;
32
+    }
33
+
34
+    public String getValue() {
35
+        return value;
36
+    }
37
+
38
+    public void setValue(String value) {
39
+        this.value = value;
40
+    }
41
+
42
+
43
+}

+ 101
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/log/LogFactory.java Bestand weergeven

@@ -0,0 +1,101 @@
1
+package com.community.huiju.log;
2
+
3
+import java.io.File;
4
+import java.io.RandomAccessFile;
5
+import java.nio.ByteBuffer;
6
+import java.nio.channels.FileChannel;
7
+import java.nio.channels.FileLock;
8
+import java.time.LocalDate;
9
+import java.time.LocalDateTime;
10
+import java.time.format.DateTimeFormatter;
11
+import java.util.TimerTask;
12
+
13
+/**
14
+ * 日志工厂
15
+ * @author weiximei
16
+ */
17
+public class LogFactory {
18
+
19
+    public static File getFile() {
20
+        LocalDate localDate = LocalDate.now();
21
+        String pathMkdir = "";
22
+
23
+        String os = System.getProperty("os.name");
24
+        if(os.toLowerCase().startsWith("win")){
25
+            pathMkdir = "E:" + File.separator + "log" + File.separator + "app-log" + File.separator + localDate.getYear() + "-" + localDate.getMonthValue() + "-" + localDate.getDayOfMonth();
26
+        } else {
27
+            pathMkdir = "/home/fxf/smart-community" + File.separator + "log" + File.separator + "app-log" + File.separator + localDate.getYear() + "-" + localDate.getMonthValue() + "-" + localDate.getDayOfMonth();
28
+        }
29
+
30
+        File file = new File(pathMkdir);
31
+        if (!file.exists()) {
32
+            file.mkdirs();
33
+        }
34
+        file = new File(pathMkdir + File.separator + "app-log.log");
35
+
36
+        return file;
37
+    }
38
+
39
+    /**
40
+     * 记录请求参数和返回值
41
+     * @param parameters
42
+     * @param returnValue
43
+     * @return
44
+     */
45
+    public static TimerTask parametersAndReturn(String parameters, String returnValue){
46
+        return new TimerTask() {
47
+            @Override
48
+            public void run() {
49
+
50
+                RandomAccessFile accessFile = null;
51
+                FileChannel fileChannel = null;
52
+                FileLock fileLock = null;
53
+                try {
54
+                    // 获取这个文件的读和写的权限
55
+                    accessFile = new RandomAccessFile(getFile(), "rw");
56
+                    // 文件通道
57
+                    fileChannel = accessFile.getChannel();
58
+                    fileLock = null;
59
+                    while (true) {
60
+                        try {
61
+                            // 获取锁,如果失败,继续尝试
62
+                            fileLock = fileChannel.tryLock();
63
+                            break;
64
+                        } catch (Exception e) {
65
+                            Thread.sleep(100);
66
+                        }
67
+                    }
68
+
69
+                    // 获取当前这个文件的大小
70
+                    long length = accessFile.length();
71
+                    // 设置写入的指针, 设置到这个文件的末尾
72
+                    accessFile.seek(length);
73
+                    // 开始写入文件
74
+                    LocalDateTime localDateTime = LocalDateTime.now();
75
+                    DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd hh:mm:ss");
76
+                    String str = dateTimeFormatter.format(localDateTime) + " === " + Thread.currentThread().getName() + "  : " + parameters + "\n";
77
+                    fileChannel.write(ByteBuffer.wrap(str.getBytes()));
78
+                    str = dateTimeFormatter.format(localDateTime) + " === " + Thread.currentThread().getName() + "  : " + returnValue + "\n";
79
+                    fileChannel.write(ByteBuffer.wrap(str.getBytes()));
80
+
81
+                } catch (Exception e) {
82
+                    e.printStackTrace();
83
+                } finally {
84
+                    if (fileLock != null && fileChannel != null && accessFile != null) {
85
+                        // 释放锁
86
+                        try {
87
+                            fileLock.release();
88
+                            fileChannel.close();
89
+                            accessFile.close();
90
+                        } catch (Exception e) {
91
+                            e.printStackTrace();
92
+                        }
93
+                    }
94
+                }
95
+
96
+
97
+            }
98
+        };
99
+    }
100
+
101
+}

+ 46
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/log/LogFileManager.java Bestand weergeven

@@ -0,0 +1,46 @@
1
+package com.community.huiju.log;
2
+
3
+import java.util.TimerTask;
4
+import java.util.concurrent.ScheduledThreadPoolExecutor;
5
+
6
+/**
7
+ * 日志文件记录
8
+ * @author weiximei
9
+ */
10
+public class LogFileManager {
11
+
12
+    // 记录日志的线程池
13
+    private ScheduledThreadPoolExecutor scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(10);
14
+
15
+    private LogFileManager() {}
16
+
17
+    public static LogFileManager getInstance() {
18
+        return LogSingleton.INSTANCE.getInstance();
19
+    }
20
+
21
+    /**
22
+     * 记录日志
23
+     * @param timerTask 任务
24
+     */
25
+    public void executeLog(TimerTask timerTask){
26
+        // 日志记录
27
+        scheduledThreadPoolExecutor.execute(timerTask);
28
+    }
29
+
30
+    /**
31
+     * 枚举
32
+     */
33
+    private static enum LogSingleton {
34
+        INSTANCE;
35
+
36
+        private LogFileManager logFileManager;
37
+        private LogSingleton() {
38
+            logFileManager = new LogFileManager();
39
+        }
40
+
41
+        public LogFileManager getInstance() {
42
+            return logFileManager;
43
+        }
44
+
45
+    }
46
+}

+ 63
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/IFuShiService.java Bestand weergeven

@@ -0,0 +1,63 @@
1
+package com.community.huiju.service;
2
+
3
+import com.community.commom.mode.ResponseBean;
4
+
5
+/**
6
+ * 富士 业务接口
7
+ */
8
+public interface IFuShiService {
9
+
10
+    /**
11
+     * 获取停车信息(通过车牌号)
12
+     *
13
+     * @param carNo
14
+     * @return
15
+     */
16
+    ResponseBean getParkInfoByCarNo(String carNo);
17
+
18
+    /**
19
+     * 第三方月卡上发续费
20
+     * @param Phone 车主手机号
21
+     * @param RenewDayType 续费日期类型: 3:年; 2:月; 1:日;
22
+     * @param RenewDay 续费日期数目
23
+     * @param PayStyle 交易方式(中文描述),例如:微信、 支付宝、 银联
24
+     * @param CarNo 车牌号
25
+     * @param CardNo 停车卡号
26
+     * @param RechargeAmt 充值续费金额
27
+     * @return
28
+     */
29
+    ResponseBean apiThirdPartyMonthCardPay(String Phone, String RenewDayType, String RenewDay, String PayStyle, String CarNo, String CardNo, String RechargeAmt);
30
+
31
+
32
+    /**
33
+     * 第三方临时卡上发缴费
34
+     * @param Amount 应缴金额(单位元)
35
+     * @param ActualAmount 实缴金额(单位元)
36
+     * @param DeductionAmount 抵扣金额(单位元)
37
+     * @param Reason 抵扣原因
38
+     * @param PayStyle 交易方式(汉字描述),例如:微信、支付宝、银联
39
+     * @param CarNo 车牌号
40
+     * @param CardNo 停车卡号
41
+     * @param CouponList 使用的优惠券列表(JSON字符串)
42
+     *               MerchantName: 商户名称
43
+     *               CouponType: 优惠券优惠类型1全免2减免金额3减免时长4减免百分比
44
+     *               CouponValue: 对应优惠券类型的值 金额/时间/折扣
45
+     *               CouponCode: 优惠券编码
46
+     *               FavorableType: 优惠券类型1 纸质券 2 电子券 3 活动券
47
+     *               UseStatus:标识优惠券是线上或线下使用的状态 1只在线上使用 2只在线下使用 3线上线下都可以使用
48
+     *               IsAuto: 是否自动使用优惠券1是2否
49
+     *               EndTime: 截至时间
50
+     *               CouponDescribe: 优惠券描述
51
+     *               CouponName: 优惠券名称
52
+     *
53
+     * @return
54
+     */
55
+    ResponseBean apiThirdPartyTemporaryCardPay(String Amount, String ActualAmount, String DeductionAmount, String Reason, String PayStyle, String CarNo, String CardNo, String CouponList);
56
+
57
+    /**
58
+     * 获取线下算费结果
59
+     * @param CarNoOrCardNo 车牌号码或卡号
60
+     * @return
61
+     */
62
+    ResponseBean apiGetOfflineFee(String CarNoOrCardNo);
63
+}

+ 12
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITaUserService.java Bestand weergeven

@@ -191,4 +191,16 @@ public interface ITaUserService {
191 191
      * @return
192 192
      */
193 193
     ResponseBean deleteTenantAndRelation(UserElement userElement, Integer userVerifyId);
194
+
195
+    /**
196
+     * 大苏 token生成
197
+     * @param appid
198
+     * @param datetime 时间戳
199
+     * @param encrypt 加密方式(默认MD5)
200
+     * @param communityId 小区
201
+     * @param phone 手机号
202
+     * @param sign 传过来的签名
203
+     * @return
204
+     */
205
+    ResponseBean daSuToken(String appid, String datetime, String encrypt, String communityId, String phone,String sign, HttpSession session);
194 206
 }

+ 8
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/TaUserVerifyServicel.java Bestand weergeven

@@ -54,4 +54,12 @@ public interface TaUserVerifyServicel {
54 54
      */
55 55
     ResponseBean verifyUser(UserElement userElement, Integer userVerifyId, String userVerifyStatus, String remark);
56 56
 
57
+    /**
58
+     * 添加 一个审核房产
59
+     * @param parameter
60
+     * @return
61
+     */
62
+    ResponseBean addDaSuUserVerify(String parameter);
63
+
64
+
57 65
 }

+ 126
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/FuShiServiceImpl.java Bestand weergeven

@@ -0,0 +1,126 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.community.commom.fushi.FuShiRequestAPI;
5
+import com.community.commom.mode.ResponseBean;
6
+import com.community.commom.uuid.IdGen;
7
+import com.community.huiju.common.perproties.FuShiProperties;
8
+import com.community.huiju.log.LogAnnotation;
9
+import com.community.huiju.log.LogEnums;
10
+import com.community.huiju.service.IFuShiService;
11
+import com.google.common.collect.Maps;
12
+import lombok.extern.slf4j.Slf4j;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.stereotype.Service;
15
+
16
+import java.time.LocalDateTime;
17
+import java.time.format.DateTimeFormatter;
18
+import java.util.Map;
19
+
20
+/**
21
+ * 富士业务实现
22
+ * @author weiximei
23
+ */
24
+@Slf4j
25
+@Service
26
+public class FuShiServiceImpl implements IFuShiService {
27
+
28
+    @Autowired
29
+    private FuShiRequestAPI fuShiRequestAPI;
30
+
31
+    @Autowired
32
+    private FuShiProperties fuShiProperties;
33
+
34
+    private IdGen idGen = IdGen.get();
35
+
36
+    /**
37
+     * 获取 富士 json 值
38
+     * @param jsonString
39
+     * @return
40
+     */
41
+    private Map<String,Object> getFuShiInfo(String jsonString) {
42
+        JSONObject jsonObject = JSONObject.parseObject(jsonString);
43
+        Map<String, Object> map = Maps.newHashMap();
44
+        map.put("JsonParam", jsonObject.getJSONObject("JsonParam").getInnerMap());
45
+        map.put("Redirect", jsonObject.getString("Redirect"));
46
+        map.put("DataType", jsonObject.getInteger("DataType"));
47
+        return map;
48
+    }
49
+
50
+    @LogAnnotation(value = LogEnums.DA_SU, alias = "获取停车信息(通过车牌号)")
51
+    @Override
52
+    public ResponseBean getParkInfoByCarNo(String carNo) {
53
+        ResponseBean responseBean = new ResponseBean();
54
+        String parkInfo = fuShiRequestAPI.getParkInfoByCarNo(fuShiProperties.getParkingCode(), carNo);
55
+        Map<String, Object> fuShiInfo = getFuShiInfo(parkInfo);
56
+        responseBean.addSuccess(fuShiInfo);
57
+        return responseBean;
58
+    }
59
+
60
+    @LogAnnotation(value = LogEnums.DA_SU, alias = "第三方月卡上发续费")
61
+    @Override
62
+    public ResponseBean apiThirdPartyMonthCardPay(String Phone, String RenewDayType, String RenewDay, String PayStyle, String CarNo, String CardNo,String RechargeAmt) {
63
+        ResponseBean responseBean = new ResponseBean();
64
+        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd hh:mm:ss");
65
+        // 交易编码
66
+        String dealNo = idGen.nextId() + "";
67
+        // 第三方交易日期
68
+        String dateTime = dateTimeFormatter.format(LocalDateTime.now());
69
+        // 富士云请求
70
+        String partyMonthCardPay = fuShiRequestAPI.apiThirdPartyMonthCardPay(RenewDayType, RenewDay, dealNo, PayStyle, CarNo, fuShiProperties.getParkingCode(), CardNo, RechargeAmt, dateTime);
71
+        String tradeNo = JSONObject.parseObject(partyMonthCardPay).getString("TradeNo");
72
+        Map<String, Object> map = Maps.newHashMap();
73
+        map.put("TradeNo", tradeNo);
74
+        responseBean.addSuccess(map);
75
+        return responseBean;
76
+    }
77
+
78
+    /**
79
+     * 第三方临时卡上发缴费
80
+     * @param Amount 应缴金额(单位元)
81
+     * @param ActualAmount 实缴金额(单位元)
82
+     * @param DeductionAmount 抵扣金额(单位元)
83
+     * @param Reason 抵扣原因
84
+     * @param PayStyle 交易方式(汉字描述),例如:微信、支付宝、银联
85
+     * @param CarNo 车牌号
86
+     * @param CardNo 停车卡号
87
+     * @param CouponList 使用的优惠券列表(JSON字符串)
88
+     *               MerchantName: 商户名称
89
+     *               CouponType: 优惠券优惠类型1全免2减免金额3减免时长4减免百分比
90
+     *               CouponValue: 对应优惠券类型的值 金额/时间/折扣
91
+     *               CouponCode: 优惠券编码
92
+     *               FavorableType: 优惠券类型1 纸质券 2 电子券 3 活动券
93
+     *               UseStatus:标识优惠券是线上或线下使用的状态 1只在线上使用 2只在线下使用 3线上线下都可以使用
94
+     *               IsAuto: 是否自动使用优惠券1是2否
95
+     *               EndTime: 截至时间
96
+     *               CouponDescribe: 优惠券描述
97
+     *               CouponName: 优惠券名称
98
+     *
99
+     * @return
100
+     */
101
+    @LogAnnotation(value = LogEnums.DA_SU, alias = "第三方临时卡上发缴费")
102
+    @Override
103
+    public ResponseBean apiThirdPartyTemporaryCardPay(String Amount, String ActualAmount, String DeductionAmount, String Reason, String PayStyle, String CarNo, String CardNo, String CouponList) {
104
+        ResponseBean responseBean = new ResponseBean();
105
+        // 交易编号
106
+        String dealNo = idGen.nextId() + "";
107
+        String apiThirdPartyTemporaryCardPay = fuShiRequestAPI.apiThirdPartyTemporaryCardPay(Amount, ActualAmount, DeductionAmount, Reason, dealNo, PayStyle, CarNo, fuShiProperties.getParkingCode(), CardNo, "", CouponList);
108
+        String tradeNo = JSONObject.parseObject(apiThirdPartyTemporaryCardPay).getString("TradeNo");
109
+        Map<String, Object> map = Maps.newHashMap();
110
+        map.put("TradeNo", tradeNo);
111
+        responseBean.addSuccess(map);
112
+        return responseBean;
113
+    }
114
+
115
+    @LogAnnotation(value = LogEnums.DA_SU, alias = "获取线下算费结果")
116
+    @Override
117
+    public ResponseBean apiGetOfflineFee(String CarNoOrCardNo) {
118
+        ResponseBean responseBean = new ResponseBean();
119
+        String apiGetOfflineFee = fuShiRequestAPI.apiGetOfflineFee(fuShiProperties.getParkingCode(), CarNoOrCardNo);
120
+        String result = JSONObject.parseObject(apiGetOfflineFee).getString("Result");
121
+        Map<String, Object> map = Maps.newHashMap();
122
+        map.put("Result", result);
123
+        responseBean.addSuccess(map);
124
+        return responseBean;
125
+    }
126
+}

+ 49
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java Bestand weergeven

@@ -13,7 +13,9 @@ import com.community.huiju.common.code.ICode;
13 13
 import com.community.huiju.common.code.cache.AppkeyCache;
14 14
 import com.community.commom.hk.HKConstant;
15 15
 import com.community.commom.hk.HKOpenApi;
16
+import com.community.huiju.common.perproties.DaSuProperties;
16 17
 import com.community.huiju.common.perproties.LoginCodePerproties;
18
+import com.community.huiju.common.sign.DaSuSign;
17 19
 import com.community.huiju.common.welcome.OkHttpRequestUtils;
18 20
 import com.community.huiju.common.welcome.WelcomeProperties;
19 21
 import com.community.huiju.dao.*;
@@ -47,8 +49,7 @@ import javax.servlet.http.HttpSession;
47 49
 import java.io.IOException;
48 50
 import java.text.ParseException;
49 51
 import java.text.SimpleDateFormat;
50
-import java.time.LocalDate;
51
-import java.time.LocalDateTime;
52
+import java.time.*;
52 53
 import java.time.format.DateTimeFormatter;
53 54
 import java.util.*;
54 55
 import java.util.logging.SimpleFormatter;
@@ -106,6 +107,9 @@ public class TaUserServiceImpl implements ITaUserService {
106 107
     @Autowired
107 108
     private IHKService ihkService;
108 109
 
110
+    @Autowired
111
+    private DaSuProperties daSuProperties;
112
+
109 113
     /**
110 114
      * 期
111 115
      */
@@ -1118,4 +1122,47 @@ public class TaUserServiceImpl implements ITaUserService {
1118 1122
         responseBean.addSuccess("操作成功!");
1119 1123
         return responseBean;
1120 1124
     }
1125
+
1126
+    @Override
1127
+    public ResponseBean daSuToken(String appid, String datetime, String encrypt, String communityId, String phone, String sign, HttpSession session) {
1128
+        ResponseBean responseBean = new ResponseBean();
1129
+
1130
+        LocalDateTime currrenDate = LocalDateTime.now();
1131
+        LocalDateTime parameDate = Instant.ofEpochMilli(Long.parseLong(datetime)).atZone(ZoneId.systemDefault()).toLocalDateTime();
1132
+
1133
+        long minutes = Duration.between(parameDate, currrenDate).toMinutes();
1134
+        if (minutes > 10) {
1135
+            responseBean.addError("签名已过期!");
1136
+            return responseBean;
1137
+        }
1138
+
1139
+
1140
+        // server 端签名
1141
+        String serverSign = DaSuSign.createSign(daSuProperties.getAppid(), daSuProperties.getAppSecret(), datetime, encrypt, communityId, phone);
1142
+        boolean isMd5Sign = DaSuSign.isMD5Sign(serverSign, sign);
1143
+        if (!isMd5Sign) {
1144
+            responseBean.addError("签名错误!");
1145
+            return responseBean;
1146
+        }
1147
+
1148
+        if (!daSuProperties.getCommunityId().equals(communityId)) {
1149
+            responseBean.addError("小区不正确!");
1150
+            return responseBean;
1151
+        }
1152
+
1153
+        if (!daSuProperties.getAppid().equals(appid)) {
1154
+            responseBean.addError("appid 不正确!");
1155
+            return responseBean;
1156
+        }
1157
+
1158
+        TaUser currentUser = hasUserPhone(phone);
1159
+        if (null == currentUser) {
1160
+            responseBean.addError("未注册,请先注册!请先调用用户添加接口");
1161
+            return responseBean;
1162
+        }
1163
+
1164
+        // 检验登录房产
1165
+        checkLogin(responseBean, currentUser, session);
1166
+        return responseBean;
1167
+    }
1121 1168
 }

+ 88
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserVerifyServicelmpl.java Bestand weergeven

@@ -385,4 +385,92 @@ public class TaUserVerifyServicelmpl implements TaUserVerifyServicel {
385 385
         return tpBuildingOwnerInfo;
386 386
     }
387 387
 
388
+
389
+    @Override
390
+    @Transactional(rollbackFor = Exception.class)
391
+    public ResponseBean addDaSuUserVerify(String parameter) {
392
+        ResponseBean responseBean = new ResponseBean();
393
+
394
+        JSONObject jsonObject = JSONObject.parseObject(parameter);
395
+        TaUserVerify taUserVerify = jsonObject.toJavaObject(TaUserVerify.class);
396
+
397
+        // 通过 角色名称 查询出角色的id
398
+        String roleName = jsonObject.getString("roleName");
399
+        TaSysRole sysRole = taSysRoleMapper.selectByRoleName(roleName);
400
+        if (null == sysRole) {
401
+            responseBean.addError("非法角色!");
402
+            return responseBean;
403
+        }
404
+
405
+        // 如果申请的是户主
406
+        if (sysRole.getId().intValue() == 1) {
407
+            // 校验是否有审核通过的业主
408
+            TaUserVerify hasUserVerify = taUserVerifyMapper.selectCommunityAndAddressAndRoleId(taUserVerify.getCommunityId(), taUserVerify.getPhaseId(), taUserVerify.getBuildingId(), taUserVerify.getUnitId(), taUserVerify.getLevelId(), taUserVerify.getRoomNoId());
409
+            if (null != hasUserVerify) {
410
+                responseBean.addError("此房产已存在户主!");
411
+                return responseBean;
412
+            }
413
+        }
414
+
415
+
416
+        // 校验该用户是否已经提交了一个当前房产的审核, 包含 待审核和已审核通过
417
+        List<TaUserVerify> userVerifyList = taUserVerifyMapper.selectCommunityAndAddressAndNotVerifyStatus2(taUserVerify.getUserId(), taUserVerify.getCommunityId(),
418
+                taUserVerify.getPhaseId(), taUserVerify.getBuildingId(), taUserVerify.getUnitId(),
419
+                taUserVerify.getLevelId(), taUserVerify.getRoomNoId());
420
+        if (null != userVerifyList && userVerifyList.size() > 0) {
421
+            responseBean.addError("您已添加了这个房产!");
422
+            return responseBean;
423
+        }
424
+
425
+
426
+        // 查询 期/栋/单元/楼层/户号 -> 设置 相应 id 和 name
427
+        TpPhase phase = tpPhaseMapper.selectByPrimaryKey(taUserVerify.getPhaseId());
428
+        TpBuilding building = tpBuildingMapper.selectByPrimaryKey(taUserVerify.getBuildingId());
429
+        TpUnit unit = tpUnitMapper.selectByPrimaryKey(taUserVerify.getUnitId());
430
+        TpLevel level = tpLevelMapper.selectByPrimaryKey(taUserVerify.getLevelId());
431
+        TpRoomNo roomNo = tpRoomNoMapper.selectByPrimaryKey(taUserVerify.getRoomNoId());
432
+
433
+
434
+        taUserVerify.setRoleId(sysRole.getId());
435
+        taUserVerify.setUserId(taUserVerify.getUserId());
436
+        taUserVerify.setCreateDate(new Date());
437
+        taUserVerify.setPhaseName(phase.getName());
438
+        taUserVerify.setBuildingName(building.getName());
439
+        taUserVerify.setUnitName(unit.getName());
440
+        taUserVerify.setLevelName(level.getName());
441
+        taUserVerify.setRoomNoName(roomNo.getName());
442
+        taUserVerify.setVerifyStatus("1");
443
+
444
+        int rows = taUserVerifyMapper.insertSelective(taUserVerify);
445
+        if (rows <= 0) {
446
+            responseBean.addError("操作失败!");
447
+            return responseBean;
448
+        }
449
+
450
+        // 获取这个被审核的用户
451
+        TaUser user = taUserMapper.selectByPrimaryKey(taUserVerify.getUserId());
452
+        if (null == user) {
453
+            throw new WisdomException("用户不存在!");
454
+        }
455
+
456
+        UserElement userElement = new UserElement();
457
+        userElement.setPhaseId(taUserVerify.getPhaseId());
458
+        userElement.setBuildingId(taUserVerify.getBuildingId());
459
+        userElement.setUnitId(taUserVerify.getUnitId());
460
+        userElement.setLevelId(taUserVerify.getLevelId());
461
+        userElement.setRoomNoId(taUserVerify.getRoomNoId());
462
+        userElement.setCommunityId(taUserVerify.getCommunityId());
463
+
464
+        // 往楼栋资料库插入数据
465
+        // 校验楼栋信息表
466
+        TpBuildingOwnerInfo selectBuild = getBuildingInfo(userElement, user.getLoginName());
467
+        if (null == selectBuild) {
468
+            // 插入楼栋信息数据
469
+            insertTpBuildingOwnerInfo(userElement, user, null, taUserVerify.getId());
470
+        }
471
+
472
+        responseBean.addSuccess(taUserVerify);
473
+        return responseBean;
474
+    }
475
+
388 476
 }

+ 32
- 2
CODE/smart-community/app-api/src/main/resources/application.yml Bestand weergeven

@@ -52,5 +52,35 @@ weixin:
52 52
 
53 53
 # 支付回调
54 54
 pay-notify:
55
-  wx-notify: http://ycapi.jcjyhn.com/app-api/wxNotify
56
-  ali-notify: http://ycapi.jcjyhn.com/app-api/aliPayNotify
55
+  wx-notify: http://106.14.20.193:8086/app-api/wxNotify
56
+  ali-notify: http://106.14.20.193:8086/app-api/aliPayNotify
57
+#  wx-notify: http://ycapi.jcjyhn.com/app-api/wxNotify
58
+#  ali-notify: http://ycapi.jcjyhn.com/app-api/aliPayNotify
59
+
60
+# 大苏
61
+da-su:
62
+  appid: dssdw2576sd997
63
+  app-secret: fgexhd855sf4
64
+  community-id: 101
65
+
66
+# 富士E7+云平台
67
+fu-shi:
68
+  url: http://api.mops.fujica.com.cn/v2/Api
69
+  appid: fujica_a354fedcb214c86b
70
+  app-secret: 0a0897e0bf154169833f709d6693fe84
71
+  private-key: MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAL8wJdXId6Pa6l/O
72
+    d6a+vE0z0RgujUTR2KxRZiRhEWpc4JSi1uyQPS2RS+CleByllAXkgPYCxhxelt6Y
73
+    wtFb3nuUVrQboesUrxv7DuGoRnbOeakMC2Cb83AanQlEC/erXspsTx9x9lecygAt
74
+    yOsEPv6nb8VHu8tTEEhFJIyWSTQBAgMBAAECgYA07AH9HGGptKZd4MwUFwYOpMJD
75
+    XFd0blX41QteFJR6ib0Mx8qQbxjQLUEArS0DWP4RZ4AfGQN3xOMkOMrsou6BcVjR
76
+    oVXvlKate4tIRQy3ay77dabM8LQFNg8uuigD7EWeGh9s4V1E5Jfuw8Y8zfmBKBbz
77
+    Id/Mm7bafgbfd4jCtQJBAPn0ik8Iv3pkJ90V60eQG4l6sVGAaskM0GWzyENpecLP
78
+    6UA7oYmAaqIx9vsY0UyiF4XctgxpMvqG6pM/U0y8LacCQQDDz8h7nhUWF0ZUH1IS
79
+    H+Qj3sUWR3hHel/WCjGPPKWO5iQUTfwVY9+L54IDIanAjisc40ueO3zK573zzlBE
80
+    /VYXAkEA61Qmm356+DovpeErILc2ldsj8r3ay+r6kaYQGBfIAXhJ/KWn0pNK0eYE
81
+    yCd3dpTtXKSN6WVqD6DSXUuzm31X5QJAEDMqlP+ZIwC98su8kH9O8qDFkXhMPS2k
82
+    rCKfwwfzcoUbywpApsxifEKlAPlR//pDGtq7MNYfFvJhRsB056BF9QJBAKHlCCnt
83
+    gtzRlhQxwYRg0th4uoJ99BT03+WM94Kepu6zfh3OmKLvPk2gW30TKSeYC5xmursq
84
+    xGP2TC4KxH2tAn0=
85
+  parking-code: 19000100250504 # 停车场编码
86
+

+ 1
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/feign/TaUserFeignService.java Bestand weergeven

@@ -38,4 +38,5 @@ public interface TaUserFeignService {
38 38
     ResponseBean downloadAuthorityByDeviceUuids();
39 39
 
40 40
 
41
+
41 42
 }