提交用户修改

dev-discount
yuanye 4 years ago
parent 50fe314f9f
commit 33a03862df
  1. 17
      hai-bweb/src/main/java/com/bweb/controller/HighUserController.java
  2. 2
      hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java

@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -45,8 +46,8 @@ public class HighUserController {
@RequestParam(value = "name", required = false) String name, @RequestParam(value = "name", required = false) String name,
@RequestParam(value = "phone", required = false) String phone, @RequestParam(value = "phone", required = false) String phone,
@RequestParam(value = "status", required = false) Integer status, @RequestParam(value = "status", required = false) Integer status,
@RequestParam(value = "regTimeStart", required = false) Date regTimeStart, @RequestParam(value = "regTimeStart", required = false) Long regTimeStart,
@RequestParam(value = "regTimeEnd", required = false) Date regTimeEnd, @RequestParam(value = "regTimeEnd", required = false) Long regTimeEnd,
@RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize @RequestParam(name = "pageSize", required = true) Integer pageSize
) { ) {
@ -64,10 +65,10 @@ public class HighUserController {
map.put("status", Integer.toString(status)); map.put("status", Integer.toString(status));
} }
if (regTimeStart != null) { if (regTimeStart != null) {
map.put("regTimeStart", DateUtil.date2String(regTimeStart,DateUtil.ymd_HM)); map.put("regTimeStart", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(regTimeStart));
} }
if (regTimeEnd != null) { if (regTimeEnd != null) {
map.put("regTimeEnd", DateUtil.date2String(regTimeEnd,DateUtil.ymd_HM)); map.put("regTimeEnd", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(regTimeEnd));
} }
PageHelper.startPage(pageNum, pageSize); PageHelper.startPage(pageNum, pageSize);
@ -96,7 +97,7 @@ public class HighUserController {
@RequestMapping(value = "/forbiddenUser", method = RequestMethod.GET) @RequestMapping(value = "/forbiddenUser", method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "禁用账号") @ApiOperation(value = "禁用启用账号")
public ResponseData forbiddenUser(@RequestParam(value = "userId" , required = true) Long userId) { public ResponseData forbiddenUser(@RequestParam(value = "userId" , required = true) Long userId) {
try { try {
@ -107,7 +108,11 @@ public class HighUserController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_USER_ERROR, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_USER_ERROR, "");
} }
highUser.setStatus(0); if (highUser.getStatus() == 1) {
highUser.setStatus(0);
} else {
highUser.setStatus(1);
}
highUserService.updateUser(highUser); highUserService.updateUser(highUser);

@ -28,7 +28,7 @@ public class HighUserServiceImpl implements HighUserService {
HighUserExample.Criteria criteria = example.createCriteria(); HighUserExample.Criteria criteria = example.createCriteria();
if (StringUtils.isNotBlank(map.get("phone"))) { if (StringUtils.isNotBlank(map.get("phone"))) {
criteria.andPhoneEqualTo(map.get("phone")); criteria.andPhoneLike("%" + map.get("phone") + "%");
} }
if (StringUtils.isNotBlank(map.get("name"))) { if (StringUtils.isNotBlank(map.get("name"))) {
criteria.andNameLike("%" + map.get("name") + "%"); criteria.andNameLike("%" + map.get("name") + "%");

Loading…
Cancel
Save