Procházet zdrojové kódy

健康之道分页bug

zdm před 6 roky
rodič
revize
224c45a1c7

+ 6 - 6
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/controller/LoginController.java

@ -62,18 +62,18 @@ public class LoginController extends EnvelopRestEndpoint {
    @PostMapping("/mobile/login")
    @ApiOperation(value = "【普通用户】-手机登录注册")
    public ObjEnvelop mobileLogin(
    public ObjEnvelop<User> mobileLogin(
            HttpServletRequest request,
            @ApiParam(name = "clientId", value = "应用id", required = true)@RequestParam(required = true, name = "clientId") String clientId,
            @ApiParam(name = "username", value = "账号", required = true)@RequestParam(required = true, name = "username") String username,
            @ApiParam(name = "captcha", value = "短信验证码", required = true)@RequestParam(required = true, name = "captcha") String captcha) throws ManageException, ParseException {
        if (wlyyRedisVerifyCodeService.verification(clientId, username, captcha)) {
            User user = loginService.phoneLogin(request,username);
            ObjEnvelop envelop = new ObjEnvelop();
            envelop.setStatus(200);
            envelop.setMessage("登录成功");
            envelop.setObj(user);
            return envelop;
//            ObjEnvelop envelop = new ObjEnvelop();
//            envelop.setStatus(200);
//            envelop.setMessage("登录成功");
//            envelop.setObj(user);
            return success(user);
        } else {
            return ObjEnvelop.getError("验证码错误");

+ 2 - 2
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/controller/dict/SystemDictController.java

@ -47,8 +47,8 @@ public class SystemDictController extends EnvelopRestEndpoint {
            @ApiParam(name = "page", value = "页码", defaultValue = "1")
            @RequestParam(value = "page", required = false) Integer page) throws Exception {
        List<SystemDict> systemDictList = dictService.search(fields, filters, sorts, page, size);
        Long count = (long) (null == systemDictList ? 0 : systemDictList.size());
        return success(systemDictList, count.intValue(), page, size);
        int count = (int)dictService.getCount(filters);
        return success(systemDictList, count, page, size);
    }
    @ApiOperation(value = "创建字典")

+ 21 - 19
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/controller/dict/SystemDictEntryController.java

@ -14,6 +14,7 @@ import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import java.io.IOException;
import java.util.*;
@ -45,19 +46,20 @@ public class SystemDictEntryController extends EnvelopRestEndpoint {
            @RequestParam(value = "size", required = false) Integer size,
            @ApiParam(name = "page", value = "页码", defaultValue = "1")
            @RequestParam(value = "page", required = false) Integer page) throws Exception {
        List<SystemDictEntry> systemDictEntryList = systemDictEntryService.search(fields,filters,sorts,page,size);
        return success(systemDictEntryList,(null==systemDictEntryList)?0:systemDictEntryList.size(),page, size);
        List<SystemDictEntry> systemDictEntryList = systemDictEntryService.search(fields, filters, sorts, page, size);
        int count = (int) systemDictEntryService.getCount(filters);
        return success(systemDictEntryList, count, page, size);
    }
    @ApiOperation(value = "创建字典项")
    @PostMapping(value = HealthyHouseMapping.HealthyHouse.SystemDictEntry.CREATE)
    public ObjEnvelop<SystemDictEntry> createDictEntry (
    public ObjEnvelop<SystemDictEntry> createDictEntry(
            @ApiParam(name = "entryJson", value = "字典项JSON结构")
            @RequestParam(value = "entryJson") String entryJson) throws IOException{
            @RequestParam(value = "entryJson") String entryJson) throws IOException {
        SystemDictEntry entry = toEntity(entryJson, SystemDictEntry.class);
        SystemDict systemDict = dictService.retrieve(entry.getDictId());
        if (systemDict == null) {
            return  failed("所属字典不存在!",ObjEnvelop.class);
            return failed("所属字典不存在!", ObjEnvelop.class);
        }
        int nextSort = systemDictEntryService.getNextSN(entry.getDictId());
        entry.setSort(nextSort);
@ -72,7 +74,7 @@ public class SystemDictEntryController extends EnvelopRestEndpoint {
            @ApiParam(name = "dictId", value = "字典ID", required = true)
            @RequestParam(value = "dictId") String dictId,
            @ApiParam(name = "code", value = "字典项代码", required = true)
            @RequestParam(value = "code") String code) throws Exception{
            @RequestParam(value = "code") String code) throws Exception {
        SystemDictEntry systemDictEntry = systemDictEntryService.getDictEntry(dictId, code);
        return success(systemDictEntry);
    }
@ -83,46 +85,46 @@ public class SystemDictEntryController extends EnvelopRestEndpoint {
            @ApiParam(name = "dictId", value = "字典ID")
            @RequestParam(value = "dictId") String dictId,
            @ApiParam(name = "code", value = "字典项编码")
            @RequestParam(value = "code") String code) throws Exception{
            @RequestParam(value = "code") String code) throws Exception {
        systemDictEntryService.deleteDictEntry(dictId, code);
        return success("success");
    }
    @ApiOperation(value = "修改字典项")
    @PutMapping(value =HealthyHouseMapping.HealthyHouse.SystemDictEntry.UPDATE)
    @PutMapping(value = HealthyHouseMapping.HealthyHouse.SystemDictEntry.UPDATE)
    public ObjEnvelop<SystemDictEntry> updateDictEntry(
            @ApiParam(name = "entryJson", value = "字典项JSON结构")
            @RequestParam(value = "entryJson") String entryJson) throws IOException {
        SystemDictEntry entry = toEntity(entryJson, SystemDictEntry.class);
        SystemDictEntry temp = systemDictEntryService.retrieve(new DictEntryKey(entry.getCode(), entry.getDictId()));
        if (null == temp) {
            failed("字典项不存在!",ObjEnvelop.class);
            failed("字典项不存在!", ObjEnvelop.class);
        }
        entry.setUpdateTime(new Date());
        systemDictEntryService.saveDictEntry(entry);
        return success(entry);
    }
    @GetMapping(value =HealthyHouseMapping.HealthyHouse.SystemDictEntry.ISEXISTSDICTENTRYBYDICTIDANDCODE)
    @GetMapping(value = HealthyHouseMapping.HealthyHouse.SystemDictEntry.ISEXISTSDICTENTRYBYDICTIDANDCODE)
    @ApiOperation(value = "根据dictId和code判断提交的字典项是否已经存在")
    public boolean isDictEntryCodeExists(
            @ApiParam(name = "dictId", value = "字典id", defaultValue = "")
            @RequestParam(value = "dictId",required = true) String dictId,
            @RequestParam(value = "dictId", required = true) String dictId,
            @ApiParam(name = "code", value = "字典项编码", defaultValue = "")
            @RequestParam(value = "code") String code){
            @RequestParam(value = "code") String code) {
        return systemDictEntryService.isDictContainEntry(dictId, code);
    }
    @GetMapping(value =HealthyHouseMapping.HealthyHouse.SystemDictEntry.GETDICTENTRYBYDICTIDANDNAME)
    @GetMapping(value = HealthyHouseMapping.HealthyHouse.SystemDictEntry.GETDICTENTRYBYDICTIDANDNAME)
    @ApiOperation(value = "根据dictId和name判断提交的字典项是否已经存在")
    public boolean isDictEntryNameExists(
            @ApiParam(name = "dictId", value = "字典id", defaultValue = "")
            @RequestParam(value = "dictId",required = true) String dictId,
            @RequestParam(value = "dictId", required = true) String dictId,
            @ApiParam(name = "name", value = "字典项名称")
            @RequestParam(value = "name") String name){
        List<SystemDictEntry> systemDictEntryPage= systemDictEntryService.findByDictIdAndValueLike(dictId, name);
        if(null!=systemDictEntryPage&&systemDictEntryPage.size()>0){
            return  true;
            @RequestParam(value = "name") String name) {
        List<SystemDictEntry> systemDictEntryPage = systemDictEntryService.findByDictIdAndValueLike(dictId, name);
        if (null != systemDictEntryPage && systemDictEntryPage.size() > 0) {
            return true;
        }
        return false;
    }
@ -131,7 +133,7 @@ public class SystemDictEntryController extends EnvelopRestEndpoint {
    @ApiOperation(value = "根据dictId获取所有字典项")
    public ListEnvelop GetSystemDictEntryListByDictId(
            @ApiParam(name = "dictId", value = "字典id")
            @RequestParam(value = "dictId") String dictId) throws Exception{
            @RequestParam(value = "dictId") String dictId) throws Exception {
        List<SystemDictEntry> cardList = systemDictEntryService.getDictEntryCodeAndValueByDictId(dictId);
        return success(cardList);
    }

+ 2 - 4
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/controller/facilities/FacilitiesController.java

@ -1,6 +1,5 @@
package com.yihu.jw.healthyhouse.controller.facilities;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.yihu.jw.exception.business.ManageException;
import com.yihu.jw.healthyhouse.model.facility.Facility;
import com.yihu.jw.healthyhouse.model.facility.FacilityServer;
@ -24,10 +23,8 @@ import org.springframework.http.MediaType;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import java.io.File;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import com.yihu.jw.restmodel.web.Envelop;
@ -69,7 +66,8 @@ public class FacilitiesController extends EnvelopRestEndpoint {
            @ApiParam(name = "page", value = "页码", defaultValue = "1")
            @RequestParam(value = "page", required = false) Integer page) throws Exception {
        List<Facility> facilityList = facilityService.search(fields, filters, sorts, page, size);
        return success(facilityList, (null == facilityList) ? 0 : facilityList.size(), page, size);
        int count = (int)facilityService.getCount(filters);
        return success(facilityList, count, page, size);
    }
    @ApiOperation(value = "创建设施,包含设施与服务的关联关系")

+ 2 - 1
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/controller/facilities/FacilitiesServerController.java

@ -46,7 +46,8 @@ public class FacilitiesServerController extends EnvelopRestEndpoint {
            @ApiParam(name = "page", value = "页码", defaultValue = "1")
            @RequestParam(value = "page", required = false) Integer page) throws Exception {
        List<FacilityServer> facilityServerList = facilityServerService.search(fields, filters, sorts, page, size);
        return success(facilityServerList, (null==facilityServerList)?0:facilityServerList.size(), page, size);
        int count = (int)facilityServerService.getCount(filters);
        return success(facilityServerList,count, page, size);
    }
    @ApiOperation(value = "创建设施服务")

+ 2 - 1
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/controller/user/AppealController.java

@ -46,7 +46,8 @@ public class AppealController extends EnvelopRestEndpoint {
            @ApiParam(name = "page", value = "页码", defaultValue = "1")
            @RequestParam(value = "page", required = false) Integer page) throws Exception {
        List<Appeal> appealList = AppealService.search(fields, filters, sorts, page, size);
        return success(appealList, (null == appealList) ? 0 : appealList.size(), page, size);
        int count = (int)AppealService.getCount(filters);
        return success(appealList, count, page, size);
    }
    @ApiOperation(value = "创建/更新(id存在)账号申诉")

+ 4 - 2
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/controller/user/FacilityUsedRecordController.java

@ -67,7 +67,8 @@ public class FacilityUsedRecordController extends EnvelopRestEndpoint {
            @ApiParam(name = "page", value = "页码", defaultValue = "1")
            @RequestParam(value = "page", required = false) Integer page) throws Exception {
        List<FacilityUsedRecord> facilityUsedRecordList = facilityUsedRecordService.search(fields, filters, sorts, page, size);
        return success(facilityUsedRecordList, (null == facilityUsedRecordList) ? 0 : facilityUsedRecordList.size(), page, size);
        int count = (int)facilityUsedRecordService.getCount(filters);
        return success(facilityUsedRecordList, count, page, size);
    }
    @ApiOperation(value = "创建/更新(id存在)用户使用导航记录")
@ -210,7 +211,8 @@ public class FacilityUsedRecordController extends EnvelopRestEndpoint {
                record.setNavigationServiceEvaluationFlag("已评价");
            }
        }
        return success(facilityUsedRecordList, (null == facilityUsedRecordList) ? 0 : facilityUsedRecordList.size(), page, size);
        int count = (int)facilityUsedRecordService.getCount(filters);
        return success(facilityUsedRecordList, count, page, size);
    }
}

+ 2 - 1
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/controller/user/FeedBackController.java

@ -53,7 +53,8 @@ public class FeedBackController extends EnvelopRestEndpoint {
            @ApiParam(name = "page", value = "页码", defaultValue = "1")
            @RequestParam(value = "page", required = false) Integer page) throws Exception {
        List<FeedBack> feedBackList = feedBackService.search(fields, filters, sorts, page, size);
        return success(feedBackList, (null == feedBackList) ? 0 : feedBackList.size(), page, size);
        int count = (int)feedBackService.getCount(filters);
        return success(feedBackList,count, page, size);
    }
    @ApiOperation(value = "创建/更新(id存在)意见反馈")

+ 2 - 1
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/controller/user/NavigationServiceEvaluationController.java

@ -46,7 +46,8 @@ public class NavigationServiceEvaluationController extends EnvelopRestEndpoint {
            @ApiParam(name = "page", value = "页码", defaultValue = "1")
            @RequestParam(value = "page", required = false) Integer page) throws Exception {
        List<NavigationServiceEvaluation> navigationServiceEvaluationList = navigationServiceEvaluationService.search(fields, filters, sorts, page, size);
        return success(navigationServiceEvaluationList, (null == navigationServiceEvaluationList) ? 0 : navigationServiceEvaluationList.size(), page, size);
        int count = (int)navigationServiceEvaluationService.getCount(filters);
        return success(navigationServiceEvaluationList,count, page, size);
    }
    @ApiOperation(value = "创建/更新(id存在)服务评价")

+ 2 - 1
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/controller/user/UserController.java

@ -64,7 +64,8 @@ public class UserController  extends EnvelopRestEndpoint {
            @RequestParam(value = "page", required = false) Integer page ) throws ManageException, ParseException {
        List<User> userList = userService.search(fields, filters, sorts, page, size);
        return success(userList, userList == null ? 0 : userList.size(), page, size);
        int count = (int)userService.getCount(filters);
        return success(userList,count, page, size);
    }

+ 13 - 13
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/model/user/User.java

@ -24,10 +24,10 @@ public class User extends UuidIdentityEntityWithOperator {
    private String name;
    @Column(name = "password", nullable = false)
    private String password;
    @Column(name = "gender" )
    @Column(name = "gender")
    private String gender;
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    @Column(name = "birthday" )
    @Column(name = "birthday")
    private Date birthday;
    @Column(name = "id_card_no", nullable = false)
    private String idCardNo;
@ -255,29 +255,29 @@ public class User extends UuidIdentityEntityWithOperator {
    }
    @Transient
    public String getAddress(){
        String address ="";
        if (this.getCityName()!=null) {
    public String getAddress() {
        String address = "";
        if (this.getCityName() != null) {
            address += this.getCityName();
        }
        if (this.getAreaName()!=null) {
        if (this.getAreaName() != null) {
            address += this.getAreaName();
        }
        if (this.getStreet() !=null ){
        if (this.getStreet() != null) {
            address += this.getStreet();
        }
        return address;
    }
    @Transient
    public String getGenderValue(){
        String genderValue ="";
    public String getGenderValue() {
        String genderValue = "";
        if (this.getGender().equals("male")) {
            genderValue="男";
        if (null != this.getGender() && this.getGender().equals("male")) {
            genderValue = "男";
        }
        if (this.getGender().equals("female")) {
            genderValue="女";
        if (null != this.getGender() && this.getGender().equals("female")) {
            genderValue = "女";
        }
        return genderValue;
    }