wuxw лет назад: 2
Родитель
Сommit
2acb5e4dc2

+ 10 - 1
java110-db/src/main/resources/mapper/report/BaseDataStatisticsServiceDaoImplMapper.xml

@@ -458,7 +458,16 @@
         group by DATE_FORMAT(t.create_time,'%Y-%m-%d')
     </select>
 
-
+    <select id="getCommunityContractAnalysis" parameterType="Map" resultType="Map">
+        select DATE_FORMAT(t.create_time,'%Y-%m-%d') createTime,count(1) countValue
+        from contract t
+        where 1=1
+        and t.status_cd = '0'
+        and t.create_time &gt; #{startTime}
+        and t.create_time &lt; #{endTime}
+        and t.community_id = #{communityId}
+        group by DATE_FORMAT(t.create_time,'%Y-%m-%d')
+    </select>
 
 
 </mapper>

+ 3 - 0
java110-interface/src/main/java/com/java110/intf/report/IBaseDataStatisticsInnerServiceSMO.java

@@ -93,4 +93,7 @@ public interface IBaseDataStatisticsInnerServiceSMO {
 
     @RequestMapping(value = "/getCommunityPersonInAnalysis", method = RequestMethod.POST)
     List<Map> getCommunityPersonInAnalysis(@RequestBody Map info);
+
+    @RequestMapping(value = "/getCommunityContractAnalysis", method = RequestMethod.POST)
+    List<Map> getCommunityContractAnalysis(@RequestBody Map info);
 }

+ 4 - 0
service-report/src/main/java/com/java110/report/cmd/admin/GetCommunityOperationalAnalysisCmd.java

@@ -107,6 +107,10 @@ public class GetCommunityOperationalAnalysisCmd extends Cmd {
         personInData = fillDate(personInData, startTime, endTime);
         data.put("personInData", personInData);
 
+        //todo 查询起草合同数
+        List<Map> contractData = baseDataStatisticsInnerServiceSMOImpl.getCommunityContractAnalysis(reqJson);
+        contractData = fillDate(contractData, startTime, endTime);
+        data.put("contractData", contractData);
         context.setResponseEntity(ResultVo.createResponseEntity(data));
 
     }

+ 2 - 0
service-report/src/main/java/com/java110/report/dao/IBaseDataStatisticsServiceDao.java

@@ -69,4 +69,6 @@ public interface IBaseDataStatisticsServiceDao {
     List<Map> getCommunityCarInAnalysis(Map info);
 
     List<Map> getCommunityPersonInAnalysis(Map info);
+
+    List<Map> getCommunityContractAnalysis(Map info);
 }

+ 6 - 0
service-report/src/main/java/com/java110/report/dao/impl/BaseDataStatisticsServiceDaoImpl.java

@@ -134,4 +134,10 @@ public class BaseDataStatisticsServiceDaoImpl extends BaseServiceDao implements
         List<Map> infos = sqlSessionTemplate.selectList("baseDataStatisticsServiceDaoImpl.getCommunityPersonInAnalysis", info);
         return infos;
     }
+
+    @Override
+    public List<Map> getCommunityContractAnalysis(Map info) {
+        List<Map> infos = sqlSessionTemplate.selectList("baseDataStatisticsServiceDaoImpl.getCommunityContractAnalysis", info);
+        return infos;
+    }
 }

+ 6 - 0
service-report/src/main/java/com/java110/report/smo/impl/BaseDataStatisticsInnerServiceSMOImpl.java

@@ -156,4 +156,10 @@ public class BaseDataStatisticsInnerServiceSMOImpl extends BaseServiceSMO implem
         List<Map> infos = baseDataStatisticsServiceDaoImpl.getCommunityPersonInAnalysis(info);
         return infos;
     }
+
+    @Override
+    public List<Map> getCommunityContractAnalysis(@RequestBody Map info) {
+        List<Map> infos = baseDataStatisticsServiceDaoImpl.getCommunityContractAnalysis(info);
+        return infos;
+    }
 }

+ 39 - 37
service-user/src/main/java/com/java110/user/cmd/user/UserSendSmsCmd.java

@@ -52,30 +52,6 @@ public class UserSendSmsCmd extends Cmd {
             throw new IllegalArgumentException("手机号格式错误");
         }
 
-        String requestId = DistributedLock.getLockUUID();
-        String key = this.getClass().getSimpleName() + reqJson.getString("tel");
-        try {
-            DistributedLock.waitGetDistributedLock(key, requestId);
-            //校验是否有有效的验证码
-            String smsCode = CommonCache.getValue(reqJson.getString("tel") + SendSmsFactory.VALIDATE_CODE);
-
-            if (!StringUtil.isEmpty(smsCode) && smsCode.contains("-")) {
-                long oldTime = Long.parseLong(smsCode.substring(smsCode.indexOf("-") + 1, smsCode.length()));
-                long nowTime = new Date().getTime();
-                if (nowTime - oldTime < 1000 * 60 * 2) {
-                    throw new IllegalArgumentException("请不要重复发送验证码");
-                }
-            }
-        } finally {
-            //清理事务信息
-            DistributedLock.releaseDistributedLock(key, requestId);
-        }
-
-    }
-
-    @Override
-    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
-        String tel = reqJson.getString("tel");
         String captchaType = reqJson.getString("captchaType");
         if (!StringUtil.isEmpty(captchaType) && "ownerBinding".equals(captchaType)) {
             OwnerDto ownerDto = new OwnerDto();
@@ -95,20 +71,46 @@ public class UserSendSmsCmd extends Cmd {
             List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwnerMembers(ownerDto);
             Assert.listOnlyOne(ownerDtos, "填写业主信息错误,请确认,预留业主姓名、手机号" + idCardErrorMsg + "信息是否正确!");
         }
-        //校验是否传了 分页信息
-        String msgCode = SendSmsFactory.generateMessageCode(6);
-        SmsDto smsDto = new SmsDto();
-        smsDto.setTel(tel);
-        smsDto.setCode(msgCode);
-        if ("ON".equals(MappingCache.getValue(MappingConstant.SMS_DOMAIN, SendSmsFactory.SMS_SEND_SWITCH))) {
-            smsDto = smsInnerServiceSMOImpl.send(smsDto);
-        } else {
-            CommonCache.setValue(smsDto.getTel() + SendSmsFactory.VALIDATE_CODE, smsDto.getCode().toLowerCase() + "-" + new Date().getTime(), CommonCache.defaultExpireTime);
-            smsDto.setSuccess(true);
-            smsDto.setMsg("您的验证码为" + msgCode);
+    }
+
+    @Override
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
+
+        String requestId = DistributedLock.getLockUUID();
+        String key = this.getClass().getSimpleName() + reqJson.getString("tel");
+        try {
+            DistributedLock.waitGetDistributedLock(key, requestId);
+            //校验是否有有效的验证码
+            String smsCode = CommonCache.getValue(reqJson.getString("tel") + SendSmsFactory.VALIDATE_CODE);
+
+            if (!StringUtil.isEmpty(smsCode) && smsCode.contains("-")) {
+                long oldTime = Long.parseLong(smsCode.substring(smsCode.indexOf("-") + 1, smsCode.length()));
+                long nowTime = new Date().getTime();
+                if (nowTime - oldTime < 1000 * 60 * 2) {
+                    throw new IllegalArgumentException("请不要重复发送验证码");
+                }
+            }
+
+            String tel = reqJson.getString("tel");
+            //校验是否传了 分页信息
+            String msgCode = SendSmsFactory.generateMessageCode(6);
+            SmsDto smsDto = new SmsDto();
+            smsDto.setTel(tel);
+            smsDto.setCode(msgCode);
+            if ("ON".equals(MappingCache.getValue(MappingConstant.SMS_DOMAIN, SendSmsFactory.SMS_SEND_SWITCH))) {
+                smsDto = smsInnerServiceSMOImpl.send(smsDto);
+            } else {
+                CommonCache.setValue(smsDto.getTel() + SendSmsFactory.VALIDATE_CODE, smsDto.getCode().toLowerCase() + "-" + new Date().getTime(), CommonCache.defaultExpireTime);
+                smsDto.setSuccess(true);
+                smsDto.setMsg("您的验证码为" + msgCode);
+            }
+
+            ResponseEntity<String> sendMessageResult = new ResponseEntity<String>(smsDto.getMsg(), smsDto.isSuccess() ? HttpStatus.OK : HttpStatus.BAD_REQUEST);
+            context.setResponseEntity(sendMessageResult);
+        } finally {
+            //清理事务信息
+            DistributedLock.releaseDistributedLock(key, requestId);
         }
-        ResponseEntity<String> sendMessageResult = new ResponseEntity<String>(smsDto.getMsg(), smsDto.isSuccess() ? HttpStatus.OK : HttpStatus.BAD_REQUEST);
-        context.setResponseEntity(sendMessageResult);
 
     }
 }