1. fix bugs

topo_dev
xueqingkun 9 months ago
parent a3ce43c26c
commit 44987b4178

@ -6,7 +6,7 @@ import com.supervision.police.dto.DictionaryByTypeParam;
import com.supervision.police.service.ComDictionaryService; import com.supervision.police.service.ComDictionaryService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -21,10 +21,10 @@ import org.springframework.web.bind.annotation.*;
@RestController @RestController
@RequestMapping("/comDictionary") @RequestMapping("/comDictionary")
@Api(tags = "字典表接口") @Api(tags = "字典表接口")
@RequiredArgsConstructor
public class ComDictionaryController { public class ComDictionaryController {
@Autowired private final ComDictionaryService dictionaryService;
private ComDictionaryService dictionaryService;
@GetMapping @GetMapping
@ApiOperation(value = "查询字典", httpMethod = "GET") @ApiOperation(value = "查询字典", httpMethod = "GET")

@ -9,6 +9,7 @@ import com.supervision.police.dto.ModelCaseDTO;
import com.supervision.police.service.ModelCaseService; import com.supervision.police.service.ModelCaseService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -19,10 +20,10 @@ import java.util.List;
@RestController @RestController
@Slf4j @Slf4j
@RequestMapping("/modelCase") @RequestMapping("/modelCase")
@RequiredArgsConstructor
public class ModelCaseController { public class ModelCaseController {
@Autowired private final ModelCaseService modelCaseService;
private ModelCaseService modelCaseService;
/** /**
* *

@ -112,6 +112,7 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
.set(SystemUser::getUserName, userInfoReqVo.getUserName()) .set(SystemUser::getUserName, userInfoReqVo.getUserName())
.set(SystemUser::getAccount, userInfoReqVo.getAccount()) .set(SystemUser::getAccount, userInfoReqVo.getAccount())
.set(SystemUser::getPhoneNum, userInfoReqVo.getPhoneNum()) .set(SystemUser::getPhoneNum, userInfoReqVo.getPhoneNum())
.set(StrUtil.isNotEmpty(userInfoReqVo.getPassword()),SystemUser::getUserPd, UserUtil.signPassword(userInfoReqVo.getPassword()))
.set(Objects.nonNull(userInfoReqVo.getStatus()),SystemUser::getStatus, userInfoReqVo.getStatus()) .set(Objects.nonNull(userInfoReqVo.getStatus()),SystemUser::getStatus, userInfoReqVo.getStatus())
.set(SystemUser::getRemark, userInfoReqVo.getRemark()) .set(SystemUser::getRemark, userInfoReqVo.getRemark())
.eq(SystemUser::getId, userInfoReqVo.getId()) .eq(SystemUser::getId, userInfoReqVo.getId())
@ -174,17 +175,17 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
@Override @Override
public boolean changePassWord(String account, String password) { public boolean changePassWord(String account, String password) {
Assert.notEmpty(account, "账号不能为空"); UserInfoDTO user = UserUtil.getUser();
Assert.notEmpty(password, "密码不能为空"); Assert.notEmpty(password, "密码不能为空");
Long count = super.lambdaQuery().eq(SystemUser::getAccount, account).count(); Long count = super.lambdaQuery().eq(SystemUser::getId, user.getId()).count();
if (count == 0){ if (count == 0){
log.info("账号:{}不存在", account); log.info("账号:{}不存在", account);
return false; return false;
} }
return super.lambdaUpdate().set(SystemUser::getUserPd, UserUtil.signPassword(password)) return super.lambdaUpdate().set(SystemUser::getUserPd, UserUtil.signPassword(password))
.eq(SystemUser::getAccount, account).update(); .eq(SystemUser::getId, user.getId()).update();
} }
} }

Loading…
Cancel
Save