|
@@ -45,10 +45,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* @Created by: zhulei
|
|
@@ -552,7 +549,7 @@ public class NewPlatformApi {
|
|
|
// }
|
|
|
@ApiOperation(value = "平台端组织机构新增-企业")
|
|
|
@RequestMapping(value = "/organizationSave", method = RequestMethod.POST)
|
|
|
- public CommonResult<String> organizationSave(@RequestBody @Validated Organization request) {
|
|
|
+ public CommonResult<String> organizationSave(@RequestBody Organization request) {
|
|
|
SystemAdmin systemAdmin = SecurityUtil.getLoginUserVo().getUser();
|
|
|
organizationService.saveOrganization(request, systemAdmin);
|
|
|
return CommonResult.success("操作成功");
|
|
@@ -560,22 +557,46 @@ public class NewPlatformApi {
|
|
|
|
|
|
@ApiOperation(value = "平台端组织机构新增-部门")
|
|
|
@RequestMapping(value = "/departmentSave", method = RequestMethod.POST)
|
|
|
- public CommonResult<String> departmentSave(@RequestBody @Validated OrganizationDepartment request) {
|
|
|
+ public CommonResult<String> departmentSave(@RequestParam(value = "id") String id,
|
|
|
+ @RequestParam(value = "name") String name) {
|
|
|
+ OrganizationDepartment request = new OrganizationDepartment();
|
|
|
SystemAdmin systemAdmin = SecurityUtil.getLoginUserVo().getUser();
|
|
|
- organizationService.saveDepartment(request, systemAdmin);
|
|
|
+ request.setId(UUID.randomUUID().toString().replace("-", ""));
|
|
|
+ request.setCreateTime(new Date());
|
|
|
+ request.setUpdateTime(new Date());
|
|
|
+ request.setName(name);
|
|
|
+ request.setCreateBy(systemAdmin.getRealName());
|
|
|
+ request.setUpdateBy(systemAdmin.getRealName());
|
|
|
+ request.setOrganizationId(id);
|
|
|
+ organizationDepartmentService.save(request);
|
|
|
return CommonResult.success("操作成功");
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "平台端组织机构新增-用户")
|
|
|
@RequestMapping(value = "/userSave", method = RequestMethod.POST)
|
|
|
- public CommonResult<String> userSave(@RequestBody @Validated OrganizationDepartmentUser request) {
|
|
|
+
|
|
|
+ public CommonResult<String> userSave(@RequestParam(value = "organizationId") String organizationId,
|
|
|
+ @RequestParam(value = "id") String departmentId,
|
|
|
+ @RequestParam(value = "name") String name,
|
|
|
+ @RequestParam(value = "uid" ,required = false) String uid,
|
|
|
+ @RequestParam(value = "phone") String phone
|
|
|
+ ) {
|
|
|
+ OrganizationDepartmentUser request = new OrganizationDepartmentUser();
|
|
|
SystemAdmin systemAdmin = SecurityUtil.getLoginUserVo().getUser();
|
|
|
- organizationService.saveUser(request, systemAdmin);
|
|
|
+ request.setId(UUID.randomUUID().toString().replace("-", ""));
|
|
|
+ request.setCreateTime(new Date());
|
|
|
+ request.setUpdateTime(new Date());
|
|
|
+ request.setName(name);
|
|
|
+ request.setUserId(uid);
|
|
|
+ request.setPhone(phone);
|
|
|
+ request.setCreateBy(systemAdmin.getRealName());
|
|
|
+ request.setUpdateBy(systemAdmin.getRealName());
|
|
|
+ request.setDepartmentId(departmentId);
|
|
|
+ request.setOrganizationId(organizationId);
|
|
|
return CommonResult.success("操作成功");
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
@ApiOperation(value = "平台端组织机构编辑")
|
|
|
@RequestMapping(value = "/organizationEdit", method = RequestMethod.POST)
|
|
|
public CommonResult<String> organizationEdit(@RequestBody @Validated OrganizationVO request) {
|
|
@@ -600,48 +621,62 @@ public class NewPlatformApi {
|
|
|
|
|
|
@ApiOperation(value = "平台端企业列表")
|
|
|
@RequestMapping(value = "/otganizatonList", method = RequestMethod.GET)
|
|
|
- public CommonResult<CommonPage<Organization>> otganizatonList(@Validated PageParamRequest pageParamRequest) {
|
|
|
+ public CommonResult<?> otganizatonList() {
|
|
|
|
|
|
LambdaQueryWrapper<Organization> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
|
- Page<Organization> page = PageHelper.startPage(pageParamRequest.getPage(), pageParamRequest.getLimit());
|
|
|
+// Page<Organization> page = PageHelper.startPage(pageParamRequest.getPage(), pageParamRequest.getLimit());
|
|
|
List<Organization> list = organizationService.list(queryWrapper);
|
|
|
- return CommonResult.success(CommonPage.restPage(CommonPage.copyPageInfo(page, list)));
|
|
|
+ return CommonResult.success(list);
|
|
|
}
|
|
|
|
|
|
|
|
|
- @ApiOperation(value = "平台端部门分页列表")
|
|
|
+ @ApiOperation(value = "平台端部门列表")
|
|
|
@RequestMapping(value = "/otganizatonDepartmentList", method = RequestMethod.GET)
|
|
|
- public CommonResult<CommonPage<OrganizationDepartment>> otganizatonDepartmentList(@RequestParam(name = "id", required = true) String id,
|
|
|
- @Validated PageParamRequest pageParamRequest) {
|
|
|
+ public CommonResult<?> otganizatonDepartmentList(@RequestParam(name = "id", required = true) String id
|
|
|
+ ) {
|
|
|
LambdaQueryWrapper<OrganizationDepartment> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(OrganizationDepartment::getOrganizationId, id);
|
|
|
- Page<OrganizationDepartment> page = PageHelper.startPage(pageParamRequest.getPage(), pageParamRequest.getLimit());
|
|
|
+// Page<OrganizationDepartment> page = PageHelper.startPage(pageParamRequest.getPage(), pageParamRequest.getLimit());
|
|
|
List<OrganizationDepartment> list = organizationDepartmentService.list(queryWrapper);
|
|
|
- return CommonResult.success(CommonPage.restPage(CommonPage.copyPageInfo(page, list)));
|
|
|
+ return CommonResult.success(list);
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "平台端用户分页列表")
|
|
|
+ @ApiOperation(value = "平台端用户列表")
|
|
|
@RequestMapping(value = "/otganizatonDepartmentUserList", method = RequestMethod.GET)
|
|
|
- public CommonResult<CommonPage<OrganizationDepartmentUser>> otganizatonDepartmentlist(@RequestParam(name = "id", required = true) String id,
|
|
|
- @Validated PageParamRequest pageParamRequest) {
|
|
|
+ public CommonResult<?> otganizatonDepartmentlist(@RequestParam(name = "id", required = true) String id) {
|
|
|
LambdaQueryWrapper<OrganizationDepartmentUser> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(OrganizationDepartmentUser::getDepartmentId, id);
|
|
|
- Page<OrganizationDepartmentUser> page = PageHelper.startPage(pageParamRequest.getPage(), pageParamRequest.getLimit());
|
|
|
+// Page<OrganizationDepartmentUser> page = PageHelper.startPage(pageParamRequest.getPage(), pageParamRequest.getLimit());
|
|
|
List<OrganizationDepartmentUser> list = organizationDepartmentUserService.list(queryWrapper);
|
|
|
- return CommonResult.success(CommonPage.restPage(CommonPage.copyPageInfo(page, list)));
|
|
|
+ return CommonResult.success(list);
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
@ApiOperation(value = "配置是否查看全部订单")
|
|
|
@RequestMapping(value = "/isAllOrders", method = RequestMethod.GET)
|
|
|
public CommonResult<?> isAllOrders(@RequestParam(name = "id", required = true) String id) {
|
|
|
User user = userService.getById(id);
|
|
|
- if (null==user.getIsAllOrders()||2==user.getIsAllOrders()){
|
|
|
+ if (null == user.getIsAllOrders() || 2 == user.getIsAllOrders()) {
|
|
|
user.setIsAllOrders(1);
|
|
|
- }
|
|
|
- else if (1==user.getIsAllOrders()){
|
|
|
+ } else if (1 == user.getIsAllOrders()) {
|
|
|
user.setIsAllOrders(2);
|
|
|
}
|
|
|
userService.updateById(user);
|
|
|
return CommonResult.success("操作成功");
|
|
|
}
|
|
|
+
|
|
|
+// @ApiOperation(value = "企业关联用户")
|
|
|
+// @RequestMapping(value = "/associationUser", method = RequestMethod.GET)
|
|
|
+// public CommonResult<?> associationUser(@RequestParam(name = "id", required = true) String id,
|
|
|
+// @Validated PageParamRequest pageParamRequest) {
|
|
|
+// LambdaQueryWrapper<OrganizationDepartmentUser> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+// queryWrapper.eq(OrganizationDepartmentUser::getDepartmentId, id);
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+// Page<OrganizationDepartmentUser> page = PageHelper.startPage(pageParamRequest.getPage(), pageParamRequest.getLimit());
|
|
|
+// return CommonResult.success(CommonPage.restPage(CommonPage.copyPageInfo(page, list)));
|
|
|
+//
|
|
|
+// }
|
|
|
}
|