Prechádzať zdrojové kódy

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

 Conflicts:
	common/common-entity/sql记录
liubing 2 rokov pred
rodič
commit
a6bd0398c9

+ 17 - 0
common/common-entity/sql记录

@ -1983,3 +1983,20 @@ CREATE TABLE `base_daily_report_detail` (
	PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- 2022-07-20 wsl
CREATE TABLE `base_child_manage` (
  `id` varchar(50) NOT NULL,
  `type` int(2) DEFAULT NULL COMMENT '类型1图文辅导,2视频辅导,3喜讯详细 ',
  `org_name` varchar(50) DEFAULT NULL COMMENT '机构名字',
  `org` varchar(50) DEFAULT NULL COMMENT '机构',
  `title` varchar(50) DEFAULT NULL COMMENT '标题',
  `url` text COMMENT 'url/文章内容',
  `img` varchar(255) DEFAULT NULL COMMENT '封面图片',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `del` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1可用,0禁用',
  `click` int(5) DEFAULT '0' COMMENT '视频点击播放量',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='幼儿管理\r\n';

+ 36 - 1
server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyIotLoginEndpoint.java

@ -3,6 +3,7 @@ package com.yihu.jw.security.oauth2.provider.endpoint;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.patient.util.ConstantUtils;
import com.yihu.jw.restmodel.ResultStatus;
import com.yihu.jw.security.exception.ImgCaptchaException;
import com.yihu.jw.security.model.Captcha;
import com.yihu.jw.security.model.Oauth2Envelop;
import com.yihu.jw.security.oauth2.core.redis.WlyyRedisVerifyCodeService;
@ -13,6 +14,7 @@ import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@ -47,6 +49,8 @@ public class WlyyIotLoginEndpoint {
    private IotSMSService iotSMSService;
    @Autowired
    private UserService userService;
    @Autowired
    private StringRedisTemplate redisTemplate;
    @RequestMapping(value = "/oauth/sendIotCaptcha", method = RequestMethod.GET)
    @ApiOperation("发送短信验证码")
@ -59,6 +63,15 @@ public class WlyyIotLoginEndpoint {
        if (StringUtils.isEmpty(mobile)) {
            throw new InvalidRequestException("username");
        }
        //图形验证码验证
        String key = parameters.get("key");
        String text = parameters.get("text");
        if(!verifyCaptcha(key,text)){
            throw new ImgCaptchaException("图形验证码错误!");
        }
        //验证请求间隔超时,防止频繁获取验证码
        if (!wlyyRedisVerifyCodeService.isIntervalTimeout(client_id, mobile)) {
            throw new IllegalAccessException("SMS request frequency is too fast");
@ -82,6 +95,19 @@ public class WlyyIotLoginEndpoint {
        throw new IllegalStateException("验证码发送失败!result:"+ result);
    }
    public boolean verifyCaptcha(String key,String text){
        boolean pass = false;
        if(StringUtils.isEmpty(key)||StringUtils.isEmpty(text)){
            return false;
        }
        String captcha = redisTemplate.opsForValue().get(key);
        if (org.apache.commons.lang3.StringUtils.isNotBlank(captcha)&& captcha.equals(text.toLowerCase())){
            pass = true;
            redisTemplate.delete(key);
        }
        return pass;
    }
    @RequestMapping(value = "/oauth/captchaAndRegister", method = RequestMethod.POST)
    @ApiOperation("验证短信验证码并注册")
    public ResponseEntity<Oauth2Envelop> captchaCheck(@RequestParam Map<String, String> parameters) throws Exception {
@ -98,6 +124,15 @@ public class WlyyIotLoginEndpoint {
        if (StringUtils.isEmpty(captcha)) {
            throw new InvalidRequestException("captcha");
        }
        //图形验证码验证
        String key = parameters.get("key");
        String text = parameters.get("text");
        if(!verifyCaptcha(key,text)){
            throw new ImgCaptchaException("图形验证码错误!");
        }
        Oauth2Envelop<Boolean> oauth2Envelop;
        //判断当前手机号是否注册过
        Boolean b = userService.isRegisterUserName(mobile);
@ -112,7 +147,7 @@ public class WlyyIotLoginEndpoint {
                    oauth2Envelop = new Oauth2Envelop<>(jsonObject.getString("msg"), ResultStatus.INVALID_GRANT, false);
                }
            } else {
                oauth2Envelop = new Oauth2Envelop<>("验证码错误", ResultStatus.INVALID_GRANT, false);
                oauth2Envelop = new Oauth2Envelop<>("短信验证码错误", ResultStatus.INVALID_GRANT, false);
            }
        }
        HttpHeaders headers = new HttpHeaders();

+ 8 - 7
svr/svr-base/src/main/java/com/yihu/jw/base/service/ManageMessagePush/ManageSystemPushMessageService.java

@ -169,25 +169,26 @@ public class ManageSystemPushMessageService {
        String sql = "SELECT * FROM base_pushrecord_log where 1=1 ";
        String countSql = "Select  count(id) from base_pushrecord_log where 1=1 ";
        String filite = " ";
        String filiteSql = " ";
        String orderSql = " ";
        if(null!=messageType){
            filite +=" and message_type ='"+messageType+"' ";
            filiteSql +=" and message_type ='"+messageType+"' ";
        }
        if (null!=status) {
            filite +=" and status = '"+status+"'";
            filiteSql +=" and status = '"+status+"'";
        }
        if (StringUtils.isNotBlank(name)){
            filite +=" and  send_object like '%"+name+"%'";
            filiteSql +=" and  send_object like '%"+name+"%'";
        }
        sql += " ORDER BY send_time DESC  LIMIT  " + (page - 1) * pageSize + "," + pageSize + "";
        orderSql = " ORDER BY send_time DESC LIMIT  " + (page - 1) * pageSize + "," + pageSize + "";
        List<BasePushRecordLogEntity> entityList = jdbcTemplate.query(sql + filite, new BeanPropertyRowMapper<>(BasePushRecordLogEntity.class));
        List<BasePushRecordLogEntity> entityList = jdbcTemplate.query(sql + filiteSql + orderSql, new BeanPropertyRowMapper<>(BasePushRecordLogEntity.class));
        result.put("obj",entityList);
        Integer count = jdbcTemplate.queryForObject(countSql + filite, Integer.class);
        Integer count = jdbcTemplate.queryForObject(countSql + filiteSql, Integer.class);
        result.put("count",count);

+ 4 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/child/ChildManageService.java

@ -70,6 +70,10 @@ public class ChildManageService {
        if (baseChildManage.getCreateTime()==null) {
            baseChildManage.setCreateTime(new Date());
        }
        if (baseChildManage.getType()==2&&baseChildManage.getClick()==null) {
            baseChildManage.setClick(0);
        }
        baseChildManageDao.save(baseChildManage);
    }

+ 4 - 4
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/child/ChildNewsListService.java

@ -30,8 +30,8 @@ public class ChildNewsListService {
        JSONObject jsonObject = new JSONObject();
        String sql = "select * from base_child_manage where  1=1 and type = "+type+" ";
        String totalSql = "select count(id) total from  base_child_manage where 1=1 and type = "+type+" ";
        String sql = "select * from base_child_manage where  1=1 and del = 1  and type = "+type+" ";
        String totalSql = "select count(id) total from  base_child_manage where 1=1 and  del =1 and type = "+type+" ";
        String commonSql = "";
        String limitSql = "";
@ -52,9 +52,9 @@ public class ChildNewsListService {
            limitSql +=" LIMIT  " + (page - 1) * pageSize + "," + pageSize + "";
        }
        commonSql +=  "ORDER BY create_time DESC "+ limitSql;
        commonSql +=  "ORDER BY create_time DESC ";
        List<BaseChildManage> baseChildManage = jdbcTemplate.query(sql+commonSql, new BeanPropertyRowMapper<>(BaseChildManage.class));
        List<BaseChildManage> baseChildManage = jdbcTemplate.query(sql+commonSql+limitSql, new BeanPropertyRowMapper<>(BaseChildManage.class));
        Integer total = jdbcTemplate.queryForObject(totalSql + commonSql, Integer.class);
        jsonObject.put("obj",baseChildManage);
        jsonObject.put("total",total);