|
@@ -14,6 +14,7 @@ import com.qmth.sop.common.annotation.OperationLog;
|
|
|
import com.qmth.sop.common.contant.SystemConstant;
|
|
|
import com.qmth.sop.common.enums.LogTypeEnum;
|
|
|
import com.qmth.sop.common.enums.RoleTypeEnum;
|
|
|
+import com.qmth.sop.common.enums.SopRoleTypeEnum;
|
|
|
import com.qmth.sop.common.util.Result;
|
|
|
import com.qmth.sop.common.util.ResultUtil;
|
|
|
import io.swagger.annotations.*;
|
|
@@ -38,53 +39,51 @@ import javax.validation.constraints.Min;
|
|
|
@RestController
|
|
|
@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + SystemConstant.PREFIX_URL_USER_ARCHIVES_ALLOCATION)
|
|
|
public class TBUserArchivesAllocationController {
|
|
|
+
|
|
|
@Resource
|
|
|
private TBUserArchivesAllocationService tbUserArchivesAllocationService;
|
|
|
+
|
|
|
@Resource
|
|
|
private TBUserArchivesService tbUserArchivesService;
|
|
|
|
|
|
@ApiOperation(value = "人员调配管理-分页查询")
|
|
|
@RequestMapping(value = "/page", method = RequestMethod.POST)
|
|
|
- @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = UserArchivesAllocationResult.class)})
|
|
|
+ @ApiResponses({ @ApiResponse(code = 200, message = "查询成功", response = UserArchivesAllocationResult.class) })
|
|
|
@Deprecated
|
|
|
public Result findUserArchivesAllocationPage(@ApiParam(value = "服务单元id") @RequestParam(required = false) String serviceUnitId,
|
|
|
- @ApiParam(value = "省") @RequestParam(required = false) String province,
|
|
|
- @ApiParam(value = "市") @RequestParam(required = false) String city,
|
|
|
- @ApiParam(value = "县") @RequestParam(required = false) String area,
|
|
|
- @ApiParam(value = "客户名称") @RequestParam(required = false) String customName,
|
|
|
- @ApiParam(value = "分配差额") @RequestParam(required = false) Integer gap,
|
|
|
- @ApiParam(value = "大区id") @RequestParam(required = false) Long regionId,
|
|
|
- @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
|
|
|
- @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
|
|
|
-
|
|
|
- return ResultUtil.ok(tbUserArchivesAllocationService.findCrmAllocationPage(SystemConstant.convertIdToLong(serviceUnitId), province, city, area, customName, gap, regionId, pageNumber, pageSize));
|
|
|
+ @ApiParam(value = "省") @RequestParam(required = false) String province, @ApiParam(value = "市") @RequestParam(required = false) String city,
|
|
|
+ @ApiParam(value = "县") @RequestParam(required = false) String area, @ApiParam(value = "客户名称") @RequestParam(required = false) String customName,
|
|
|
+ @ApiParam(value = "分配差额") @RequestParam(required = false) Integer gap, @ApiParam(value = "大区id") @RequestParam(required = false) Long regionId,
|
|
|
+ @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
|
|
|
+ @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
|
|
|
+
|
|
|
+ return ResultUtil.ok(tbUserArchivesAllocationService.findCrmAllocationPage(SystemConstant.convertIdToLong(serviceUnitId),
|
|
|
+ province, city, area, customName, gap, regionId, pageNumber, pageSize));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "人员调配管理-小计查询")
|
|
|
@RequestMapping(value = "/sub_total", method = RequestMethod.POST)
|
|
|
- @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = UserArchivesAllocationSubTotalResult.class)})
|
|
|
+ @ApiResponses({ @ApiResponse(code = 200, message = "查询成功", response = UserArchivesAllocationSubTotalResult.class) })
|
|
|
@Deprecated
|
|
|
public Result findUserArchivesAllocationSubTotal(@ApiParam(value = "服务单元id") @RequestParam(required = false) String serviceUnitId,
|
|
|
- @ApiParam(value = "省") @RequestParam(required = false) String province,
|
|
|
- @ApiParam(value = "市") @RequestParam(required = false) String city,
|
|
|
- @ApiParam(value = "县") @RequestParam(required = false) String area,
|
|
|
- @ApiParam(value = "客户名称") @RequestParam(required = false) String customName,
|
|
|
- @ApiParam(value = "分配差额") @RequestParam(required = false) Integer gap,
|
|
|
- @ApiParam(value = "大区id") @RequestParam(required = false) Long regionId) {
|
|
|
-
|
|
|
- return ResultUtil.ok(tbUserArchivesAllocationService.findCrmAllocationSubTotal(SystemConstant.convertIdToLong(serviceUnitId), province, city, area, customName, gap, regionId));
|
|
|
+ @ApiParam(value = "省") @RequestParam(required = false) String province, @ApiParam(value = "市") @RequestParam(required = false) String city,
|
|
|
+ @ApiParam(value = "县") @RequestParam(required = false) String area, @ApiParam(value = "客户名称") @RequestParam(required = false) String customName,
|
|
|
+ @ApiParam(value = "分配差额") @RequestParam(required = false) Integer gap, @ApiParam(value = "大区id") @RequestParam(required = false) Long regionId) {
|
|
|
+
|
|
|
+ return ResultUtil.ok(tbUserArchivesAllocationService.findCrmAllocationSubTotal(SystemConstant.convertIdToLong(serviceUnitId),
|
|
|
+ province, city, area, customName, gap, regionId));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "人员调配管理-根据派单号查询派单分配信息")
|
|
|
@RequestMapping(value = "/detail_by_crm_no", method = RequestMethod.POST)
|
|
|
- @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = CrmArchivesAllocationResult.class)})
|
|
|
+ @ApiResponses({ @ApiResponse(code = 200, message = "查询成功", response = CrmArchivesAllocationResult.class) })
|
|
|
public Result findDetailByCrmNo(@ApiParam(value = "派单号", required = true) @RequestParam String crmNo) {
|
|
|
return ResultUtil.ok(tbUserArchivesAllocationService.findAllocationByCrmNo(crmNo));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "人员调配管理-调配")
|
|
|
@RequestMapping(value = "/edit", method = RequestMethod.POST)
|
|
|
- @ApiResponses({@ApiResponse(code = 200, message = "更新成功", response = Result.class)})
|
|
|
+ @ApiResponses({ @ApiResponse(code = 200, message = "更新成功", response = Result.class) })
|
|
|
@OperationLog(logType = LogTypeEnum.EDIT)
|
|
|
public Result edit(@Valid @RequestBody UserArchivesAllocationParam userArchivesAllocationParam, BindingResult bindingResult)
|
|
|
throws InterruptedException {
|
|
@@ -97,7 +96,7 @@ public class TBUserArchivesAllocationController {
|
|
|
|
|
|
@ApiOperation(value = "人员调配管理-自动调配")
|
|
|
@RequestMapping(value = "/auto_edit", method = RequestMethod.POST)
|
|
|
- @ApiResponses({@ApiResponse(code = 200, message = "更新成功", response = Result.class)})
|
|
|
+ @ApiResponses({ @ApiResponse(code = 200, message = "更新成功", response = Result.class) })
|
|
|
@OperationLog(logType = LogTypeEnum.EDIT)
|
|
|
public Result autoEdit(@Valid @RequestBody AutoAllocationParam allocationParam, BindingResult bindingResult) {
|
|
|
if (bindingResult.hasErrors()) {
|
|
@@ -109,7 +108,7 @@ public class TBUserArchivesAllocationController {
|
|
|
|
|
|
@ApiOperation(value = "人员调配管理-发布")
|
|
|
@RequestMapping(value = "/publish", method = RequestMethod.POST)
|
|
|
- @ApiResponses({@ApiResponse(code = 200, message = "发布成功", response = Result.class)})
|
|
|
+ @ApiResponses({ @ApiResponse(code = 200, message = "发布成功", response = Result.class) })
|
|
|
@OperationLog(logType = LogTypeEnum.UPDATE)
|
|
|
public Result publishCrmSop(@ApiParam(value = "派单号", required = true) @RequestParam String crmNo) throws Exception {
|
|
|
tbUserArchivesAllocationService.publishSop(crmNo);
|
|
@@ -118,7 +117,7 @@ public class TBUserArchivesAllocationController {
|
|
|
|
|
|
@ApiOperation(value = "人员调配管理-撤销发布")
|
|
|
@RequestMapping(value = "/un_publish", method = RequestMethod.POST)
|
|
|
- @ApiResponses({@ApiResponse(code = 200, message = "作废成功", response = Result.class)})
|
|
|
+ @ApiResponses({ @ApiResponse(code = 200, message = "作废成功", response = Result.class) })
|
|
|
@OperationLog(logType = LogTypeEnum.UPDATE)
|
|
|
public Result unPublishCrmSop(@ApiParam(value = "派单号", required = true) @RequestParam String crmNo) {
|
|
|
tbUserArchivesAllocationService.unPublishSop(crmNo);
|
|
@@ -127,26 +126,34 @@ public class TBUserArchivesAllocationController {
|
|
|
|
|
|
@ApiOperation(value = "人员调配管理-查询空闲工程师")
|
|
|
@RequestMapping(value = "/free_engineer", method = RequestMethod.POST)
|
|
|
- @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = ArchivesSourceResult.class)})
|
|
|
+ @ApiResponses({ @ApiResponse(code = 200, message = "查询成功", response = ArchivesSourceResult.class) })
|
|
|
@Deprecated
|
|
|
- public Result findFreeEngineer(@ApiParam(value = "工程师类型", required = true) @RequestParam RoleTypeEnum roleType,
|
|
|
- @ApiParam(value = "派单号") @RequestParam(required = false) String crmNo) {
|
|
|
+ public Result findFreeEngineer(@ApiParam(value = "工程师类型", required = true) @RequestParam RoleTypeEnum roleType, @ApiParam(value = "派单号") @RequestParam(required = false) String crmNo) {
|
|
|
return ResultUtil.ok(tbUserArchivesService.findFreeEngineerSourceByType(roleType, crmNo));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "人员调配管理-查询空闲区域协调人")
|
|
|
@RequestMapping(value = "/free_coordinator", method = RequestMethod.POST)
|
|
|
- @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = ArchivesSourceResult.class)})
|
|
|
+ @ApiResponses({ @ApiResponse(code = 200, message = "查询成功", response = ArchivesSourceResult.class) })
|
|
|
@Deprecated
|
|
|
- public Result findFreeCoordinator(@ApiParam(value = "服务单元id", required = true) @RequestParam String serviceUnitId,
|
|
|
- @ApiParam(value = "派单号") @RequestParam(required = false) String crmNo) {
|
|
|
- return ResultUtil.ok(tbUserArchivesService.findFreeCoordinatorByServiceId(SystemConstant.convertIdToLong(serviceUnitId), crmNo, false));
|
|
|
+ public Result findFreeCoordinator(@ApiParam(value = "服务单元id", required = true) @RequestParam String serviceUnitId, @ApiParam(value = "派单号") @RequestParam(required = false) String crmNo) {
|
|
|
+ return ResultUtil.ok(tbUserArchivesService.findFreeCoordinatorByServiceId(SystemConstant.convertIdToLong(serviceUnitId),
|
|
|
+ crmNo, false));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "人员调配管理-查询调配信息")
|
|
|
@RequestMapping(value = "/info", method = RequestMethod.POST)
|
|
|
- @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = ArchivesSourceResult.class)})
|
|
|
- public Result findAllocationInfo(@ApiParam(value = "派单详情id", required = true) @RequestParam String crmDetailId){
|
|
|
+ @ApiResponses({ @ApiResponse(code = 200, message = "查询成功", response = ArchivesSourceResult.class) })
|
|
|
+ public Result findAllocationInfo(@ApiParam(value = "派单详情id", required = true) @RequestParam String crmDetailId) {
|
|
|
return ResultUtil.ok(tbUserArchivesAllocationService.findCrmDetailAllocationInfo(SystemConstant.convertIdToLong(crmDetailId)));
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value = "人员调配管理-查询可分配的人员")
|
|
|
+ @RequestMapping(value = "/can_choose", method = RequestMethod.POST)
|
|
|
+ @ApiResponses({ @ApiResponse(code = 200, message = "查询成功", response = ArchivesSourceResult.class) })
|
|
|
+ public Result findCanChoose(@ApiParam(value = "派单详情id", required = true) @RequestParam String crmDetailId,
|
|
|
+ @ApiParam(value = "sop角色身份", required = true) @RequestParam SopRoleTypeEnum sopRoleType) {
|
|
|
+ return ResultUtil.ok(tbUserArchivesAllocationService.findCanChooseArchives(SystemConstant.convertIdToLong(crmDetailId),
|
|
|
+ sopRoleType));
|
|
|
+ }
|
|
|
}
|