Browse Source

Merge branch 'dev' of chinawu123/wlyy2.0 into dev

chinawu123 2 years ago
parent
commit
772075c430

+ 2 - 1
starter/swagger-starter/src/main/java/com/yihu/jw/SwaggerConfig.java

@ -29,7 +29,7 @@ public class SwaggerConfig {
    final String userAgentJson = "{\"id\":int,\"uid\":string,\"openid\":string,\"token\":string,\"lastUid\":string,\"platform\":int}";
    private List<Parameter> addUseragent() {
        ParameterBuilder tokenPar = new ParameterBuilder();
        List<Parameter> pars = new ArrayList<Parameter>();
        List<Parameter> pars = new ArrayList<>();
        tokenPar.name("userAgent").description(userAgentJson).modelRef(new ModelRef("string")).parameterType("header").required(false).defaultValue("").build();
        pars.add(tokenPar.build());
        return pars;
@ -78,6 +78,7 @@ public class SwaggerConfig {
                        regex("/dump"),
                        regex("/autoconfig"),
                        regex("/info"),
                        regex("/ChildManageController"),
                        regex("/features")))
                .build()
                .apiInfo(privateAPIInfo());

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

@ -44,17 +44,17 @@ public class ChildManageService {
        }
        if (StringUtils.isNotBlank(id)) {
            commonSql = "and id = '"+id+"' ";
            commonSql += "and id = '"+id+"' ";
        }
        if (StringUtils.isNotBlank(title)){
            commonSql = " and title like '%"+title+"%' ";
            commonSql += " and title like '%"+title+"%' ";
        }
        if (StringUtils.isNotBlank(orgCode)){
            commonSql =  " and orgCode = '"+orgCode+"' ";
            commonSql +=  " and org = '"+orgCode+"' ";
        }
        commonSql =  "ORDER BY create_time DESC LIMIT  " + (page - 1) * pageSize + "," + pageSize + "";
        commonSql +=  "ORDER BY create_time DESC LIMIT  " + (page - 1) * pageSize + "," + pageSize + "";
        List<BaseChildManage> baseChildManage = jdbcTemplate.query(sql+commonSql, new BeanPropertyRowMapper<>(BaseChildManage.class));
        Integer total = jdbcTemplate.queryForObject(totalSql + commonSql, Integer.class);
        jsonObject.put("obj",baseChildManage);

+ 4 - 5
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/child/ChildManageController.java

@ -3,13 +3,11 @@ package com.yihu.jw.care.endpoint.child;
import com.yihu.jw.care.service.child.ChildNewsListService;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
 * Created by wsl on 2022/7/20
@ -17,6 +15,7 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/ChildManageController")
@Api(description = "幼儿端接口")
public class ChildManageController extends EnvelopRestEndpoint {
@ -25,7 +24,7 @@ public class ChildManageController extends EnvelopRestEndpoint {
    @ApiOperation(value = "获取列表")
    @GetMapping("/getChildManageList")
    @PostMapping("/getChildManageList")
    public ObjEnvelop getChildManageList(@ApiParam(name = "type" ,value = "类型 1图文辅导,2视频辅导,3喜讯详细",required = true)
                                         @RequestParam(value = "type",required = true)Integer type,
                                         @ApiParam(name = "id" ,value = "id",required = false)

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

@ -30,25 +30,30 @@ public class ChildNewsListService {
        JSONObject jsonObject = new JSONObject();
        String sql = "select * from base_child_manage where  1=1 and status = "+type+" ";
        String totalSql = "select count(id) total  base_child_manage where 1=1 and status = "+type+" ";
        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 commonSql = "";
        String limitSql = "";
        if(page==null){
            page = 1;
        }
        if(pageSize==null){
            pageSize = 10;
        }
        if (StringUtils.isNotBlank(id)) {
            commonSql = "and id = '"+id+"' ";
            commonSql += "and id = '"+id+"' ";
            if (type==2) {
                baseChildManageDao.updateClick(id);
            }
        }else {
            if(page==null){
                page = 1;
            }
            if(pageSize==null){
                pageSize = 10;
            }
            limitSql +=" LIMIT  " + (page - 1) * pageSize + "," + pageSize + "";
        }
        commonSql =  "ORDER BY create_time DESC LIMIT  " + (page - 1) * pageSize + "," + pageSize + "";
        commonSql +=  "ORDER BY create_time DESC "+ limitSql;
        List<BaseChildManage> baseChildManage = jdbcTemplate.query(sql+commonSql, new BeanPropertyRowMapper<>(BaseChildManage.class));
        Integer total = jdbcTemplate.queryForObject(totalSql + commonSql, Integer.class);
        jsonObject.put("obj",baseChildManage);