|
@@ -1,20 +1,3 @@
|
|
-/*
|
|
|
|
- * Copyright (c) 2018-2025, hnqz All rights reserved.
|
|
|
|
- *
|
|
|
|
- * Redistribution and use in source and binary forms, with or without
|
|
|
|
- * modification, are permitted provided that the following conditions are met:
|
|
|
|
- *
|
|
|
|
- * Redistributions of source code must retain the above copyright notice,
|
|
|
|
- * this list of conditions and the following disclaimer.
|
|
|
|
- * Redistributions in binary form must reproduce the above copyright
|
|
|
|
- * notice, this list of conditions and the following disclaimer in the
|
|
|
|
- * documentation and/or other materials provided with the distribution.
|
|
|
|
- * Neither the name of the pig4cloud.com developer nor the names of its
|
|
|
|
- * contributors may be used to endorse or promote products derived from
|
|
|
|
- * this software without specific prior written permission.
|
|
|
|
- * Author: hnqz
|
|
|
|
- */
|
|
|
|
-
|
|
|
|
package com.qunzhixinxi.hnqz.admin.controller;
|
|
package com.qunzhixinxi.hnqz.admin.controller;
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
@@ -53,35 +36,32 @@ import java.util.stream.Collectors;
|
|
/**
|
|
/**
|
|
* 积分包状态
|
|
* 积分包状态
|
|
*
|
|
*
|
|
- * @author pigx code generator
|
|
|
|
* @date 2020-07-17 23:32:01
|
|
* @date 2020-07-17 23:32:01
|
|
*/
|
|
*/
|
|
@RestController
|
|
@RestController
|
|
@AllArgsConstructor
|
|
@AllArgsConstructor
|
|
-@RequestMapping("/wmscorepackagestatus" )
|
|
|
|
-@Api(value = "wmscorepackagestatus", tags = "积分包状态管理")
|
|
|
|
|
|
+@RequestMapping("/wmscorepackagestatus")
|
|
public class WmScorePackageStatusController {
|
|
public class WmScorePackageStatusController {
|
|
|
|
|
|
- private final WmScorePackageStatusService wmScorePackageStatusService;
|
|
|
|
|
|
+ private final WmScorePackageStatusService wmScorePackageStatusService;
|
|
private final WmScorePackageService wmScorePackageService;
|
|
private final WmScorePackageService wmScorePackageService;
|
|
private final WmTeamService wmTeamService;
|
|
private final WmTeamService wmTeamService;
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 分页查询
|
|
|
|
- * @param page 分页对象
|
|
|
|
- * @param wmScorePackageStatus 积分包状态
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- @ApiOperation(value = "分页查询", notes = "分页查询")
|
|
|
|
- @GetMapping("/page" )
|
|
|
|
- public R getWmScorePackageStatusPage(Page page, WmScorePackageStatus wmScorePackageStatus) {
|
|
|
|
- OrderItem orderItem=new OrderItem();
|
|
|
|
|
|
+ * 分页查询
|
|
|
|
+ *
|
|
|
|
+ * @param page 分页对象
|
|
|
|
+ * @param wmScorePackageStatus 积分包状态
|
|
|
|
+ * @return 领包记录分页
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/page")
|
|
|
|
+ public R<?> getWmScorePackageStatusPage(Page page, WmScorePackageStatus wmScorePackageStatus) {
|
|
|
|
+ OrderItem orderItem = new OrderItem();
|
|
orderItem.setColumn("create_time");
|
|
orderItem.setColumn("create_time");
|
|
orderItem.setAsc(false);
|
|
orderItem.setAsc(false);
|
|
page.addOrder(orderItem);
|
|
page.addOrder(orderItem);
|
|
Integer userId = SecurityUtils.getUser().getId();
|
|
Integer userId = SecurityUtils.getUser().getId();
|
|
Integer deptId = SecurityUtils.getUser().getDeptId();
|
|
Integer deptId = SecurityUtils.getUser().getDeptId();
|
|
-// wmScorePackageStatus.setUserId(String.valueOf(userId));
|
|
|
|
wmScorePackageStatus.setDeptId(String.valueOf(deptId));
|
|
wmScorePackageStatus.setDeptId(String.valueOf(deptId));
|
|
// 判断当前用户是否配置了团队负责人
|
|
// 判断当前用户是否配置了团队负责人
|
|
List<WmTeam> teamList = wmTeamService.list(Wrappers.<WmTeam>lambdaQuery()
|
|
List<WmTeam> teamList = wmTeamService.list(Wrappers.<WmTeam>lambdaQuery()
|
|
@@ -94,86 +74,90 @@ public class WmScorePackageStatusController {
|
|
List<String> teamIdList = teamList.stream().map(wmTeam -> String.valueOf(wmTeam.getId())).collect(Collectors.toList());
|
|
List<String> teamIdList = teamList.stream().map(wmTeam -> String.valueOf(wmTeam.getId())).collect(Collectors.toList());
|
|
wmScorePackageStatus.setTeamIdList(teamIdList);
|
|
wmScorePackageStatus.setTeamIdList(teamIdList);
|
|
}
|
|
}
|
|
- return R.ok(wmScorePackageStatusService.getWmScorePackageStatusPage(page, wmScorePackageStatus));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 通过id查询积分包状态
|
|
|
|
- * @param id id
|
|
|
|
- * @return R
|
|
|
|
- */
|
|
|
|
- @ApiOperation(value = "通过id查询", notes = "通过id查询")
|
|
|
|
- @GetMapping("/{id}" )
|
|
|
|
- public R getById(@PathVariable("id" ) Integer id) {
|
|
|
|
- return R.ok(wmScorePackageStatusService.getById(id));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 新增积分包状态
|
|
|
|
- * @param wmScorePackageStatus 积分包状态
|
|
|
|
- * @return R
|
|
|
|
- */
|
|
|
|
- @ApiOperation(value = "新增积分包状态", notes = "新增积分包状态")
|
|
|
|
- @SysLog("新增积分包状态" )
|
|
|
|
- @PostMapping
|
|
|
|
- public R save(@RequestBody WmScorePackageStatus wmScorePackageStatus) {
|
|
|
|
|
|
+ return R.ok(wmScorePackageStatusService.getWmScorePackageStatusPage(page, wmScorePackageStatus));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 通过id查询积分包状态
|
|
|
|
+ *
|
|
|
|
+ * @param id id
|
|
|
|
+ * @return R
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation(value = "通过id查询", notes = "通过id查询")
|
|
|
|
+ @GetMapping("/{id}")
|
|
|
|
+ public R getById(@PathVariable("id") Integer id) {
|
|
|
|
+ return R.ok(wmScorePackageStatusService.getById(id));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 新增积分包状态
|
|
|
|
+ *
|
|
|
|
+ * @param wmScorePackageStatus 积分包状态
|
|
|
|
+ * @return R
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation(value = "新增积分包状态", notes = "新增积分包状态")
|
|
|
|
+ @SysLog("新增积分包状态")
|
|
|
|
+ @PostMapping
|
|
|
|
+ public R save(@RequestBody WmScorePackageStatus wmScorePackageStatus) {
|
|
wmScorePackageStatus.setCreateTime(LocalDateTime.now());
|
|
wmScorePackageStatus.setCreateTime(LocalDateTime.now());
|
|
- return R.ok(wmScorePackageStatusService.save(wmScorePackageStatus));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 修改积分包状态
|
|
|
|
- * @param wmScorePackageStatus 积分包状态
|
|
|
|
- * @return R
|
|
|
|
- */
|
|
|
|
- @ApiOperation(value = "修改积分包状态", notes = "修改积分包状态")
|
|
|
|
- @SysLog("修改积分包状态" )
|
|
|
|
- @PutMapping
|
|
|
|
- public R updateById(@RequestBody WmScorePackageStatus wmScorePackageStatus) {
|
|
|
|
- boolean answer=wmScorePackageStatusService.updateById(wmScorePackageStatus);
|
|
|
|
- if(answer)
|
|
|
|
- {
|
|
|
|
- WmScorePackage wmScorePackage=wmScorePackageService.getById(wmScorePackageStatus.getPackageId());
|
|
|
|
- if("2".equals(wmScorePackageStatus.getStatus())) {
|
|
|
|
- wmScorePackage.setZbId(wmScorePackageStatus.getUserId());
|
|
|
|
- wmScorePackage.setPackageStatus("2");
|
|
|
|
- wmScorePackage.setUpdateTime(LocalDateTime.now());
|
|
|
|
- wmScorePackage.setReceiveDate(LocalDateTime.now());
|
|
|
|
- wmScorePackage.setIsConduct("1");
|
|
|
|
- }else{
|
|
|
|
- wmScorePackage.setPackageStatus(null);
|
|
|
|
- wmScorePackage.setIsConduct(null);
|
|
|
|
- }
|
|
|
|
- wmScorePackageService.updateById(wmScorePackage);
|
|
|
|
|
|
+ return R.ok(wmScorePackageStatusService.save(wmScorePackageStatus));
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 修改积分包状态
|
|
|
|
+ *
|
|
|
|
+ * @param wmScorePackageStatus 积分包状态
|
|
|
|
+ * @return R
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation(value = "修改积分包状态", notes = "修改积分包状态")
|
|
|
|
+ @SysLog("修改积分包状态")
|
|
|
|
+ @PutMapping
|
|
|
|
+ public R updateById(@RequestBody WmScorePackageStatus wmScorePackageStatus) {
|
|
|
|
+ boolean answer = wmScorePackageStatusService.updateById(wmScorePackageStatus);
|
|
|
|
+ if (answer) {
|
|
|
|
+ WmScorePackage wmScorePackage = wmScorePackageService.getById(wmScorePackageStatus.getPackageId());
|
|
|
|
+ if ("2".equals(wmScorePackageStatus.getStatus())) {
|
|
|
|
+ wmScorePackage.setZbId(wmScorePackageStatus.getUserId());
|
|
|
|
+ wmScorePackage.setPackageStatus("2");
|
|
|
|
+ wmScorePackage.setUpdateTime(LocalDateTime.now());
|
|
|
|
+ wmScorePackage.setReceiveDate(LocalDateTime.now());
|
|
|
|
+ wmScorePackage.setIsConduct("1");
|
|
|
|
+ } else {
|
|
|
|
+ wmScorePackage.setPackageStatus(null);
|
|
|
|
+ wmScorePackage.setIsConduct(null);
|
|
}
|
|
}
|
|
- return R.ok();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 通过id删除积分包状态
|
|
|
|
- * @param id id
|
|
|
|
- * @return R
|
|
|
|
- */
|
|
|
|
- @ApiOperation(value = "通过id删除积分包状态", notes = "通过id删除积分包状态")
|
|
|
|
- @SysLog("通过id删除积分包状态" )
|
|
|
|
- @DeleteMapping("/{id}" )
|
|
|
|
- public R removeById(@PathVariable Integer id) {
|
|
|
|
- return R.ok(wmScorePackageStatusService.removeById(id));
|
|
|
|
- }
|
|
|
|
|
|
+ wmScorePackageService.updateById(wmScorePackage);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ return R.ok();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 通过id删除积分包状态
|
|
|
|
+ *
|
|
|
|
+ * @param id id
|
|
|
|
+ * @return R
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation(value = "通过id删除积分包状态", notes = "通过id删除积分包状态")
|
|
|
|
+ @SysLog("通过id删除积分包状态")
|
|
|
|
+ @DeleteMapping("/{id}")
|
|
|
|
+ public R removeById(@PathVariable Integer id) {
|
|
|
|
+ return R.ok(wmScorePackageStatusService.removeById(id));
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* 接单审核--分页查询
|
|
* 接单审核--分页查询
|
|
- * @param page 分页对象
|
|
|
|
|
|
+ *
|
|
|
|
+ * @param page 分页对象
|
|
* @param wmScorePackageStatus 积分包状态
|
|
* @param wmScorePackageStatus 积分包状态
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@ApiOperation(value = "分页查询", notes = "分页查询")
|
|
@ApiOperation(value = "分页查询", notes = "分页查询")
|
|
- @GetMapping("/getPage" )
|
|
|
|
- public R getPage(Page page, WmScorePackageStatus wmScorePackageStatus){
|
|
|
|
- if(StringUtil.isEmpty(wmScorePackageStatus.getPackageId())){
|
|
|
|
|
|
+ @GetMapping("/getPage")
|
|
|
|
+ public R getPage(Page page, WmScorePackageStatus wmScorePackageStatus) {
|
|
|
|
+ if (StringUtil.isEmpty(wmScorePackageStatus.getPackageId())) {
|
|
return R.failed("未查询到积分包id");
|
|
return R.failed("未查询到积分包id");
|
|
}
|
|
}
|
|
return wmScorePackageStatusService.getPage(page, wmScorePackageStatus);
|
|
return wmScorePackageStatusService.getPage(page, wmScorePackageStatus);
|
|
@@ -181,30 +165,32 @@ public class WmScorePackageStatusController {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 接单审核--同意
|
|
* 接单审核--同意
|
|
|
|
+ *
|
|
* @param wmScorePackageStatus
|
|
* @param wmScorePackageStatus
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@PostMapping("/approvalStatus")
|
|
@PostMapping("/approvalStatus")
|
|
- public R approvalStatus(@RequestBody WmScorePackageStatus wmScorePackageStatus){
|
|
|
|
- if(wmScorePackageStatus.getId()==null){
|
|
|
|
|
|
+ public R approvalStatus(@RequestBody WmScorePackageStatus wmScorePackageStatus) {
|
|
|
|
+ if (wmScorePackageStatus.getId() == null) {
|
|
return R.failed("缺少参数ID");
|
|
return R.failed("缺少参数ID");
|
|
}
|
|
}
|
|
- if(StringUtil.isEmpty(wmScorePackageStatus.getStatus())){
|
|
|
|
|
|
+ if (StringUtil.isEmpty(wmScorePackageStatus.getStatus())) {
|
|
return R.failed("缺少参数:审批意见");
|
|
return R.failed("缺少参数:审批意见");
|
|
}
|
|
}
|
|
- return wmScorePackageStatusService.approvalStatus( wmScorePackageStatus);
|
|
|
|
|
|
+ return wmScorePackageStatusService.approvalStatus(wmScorePackageStatus);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 批量接单审核
|
|
* 批量接单审核
|
|
|
|
+ *
|
|
* @param statusBatch 批量审批信息
|
|
* @param statusBatch 批量审批信息
|
|
*/
|
|
*/
|
|
@PutMapping("/approvalStatus/batch")
|
|
@PutMapping("/approvalStatus/batch")
|
|
- public R approvalStatusBatch(@RequestBody WmScorePackageStatusBatch statusBatch){
|
|
|
|
- if(StrUtil.isEmpty(statusBatch.getBatchIds())){
|
|
|
|
|
|
+ public R approvalStatusBatch(@RequestBody WmScorePackageStatusBatch statusBatch) {
|
|
|
|
+ if (StrUtil.isEmpty(statusBatch.getBatchIds())) {
|
|
return R.failed("缺少参数ID");
|
|
return R.failed("缺少参数ID");
|
|
}
|
|
}
|
|
- if(statusBatch.getStatus() == null){
|
|
|
|
|
|
+ if (statusBatch.getStatus() == null) {
|
|
return R.failed("缺少参数:审批意见");
|
|
return R.failed("缺少参数:审批意见");
|
|
}
|
|
}
|
|
return R.ok(wmScorePackageStatusService.approvalStatusBatch(statusBatch));
|
|
return R.ok(wmScorePackageStatusService.approvalStatusBatch(statusBatch));
|
|
@@ -212,11 +198,12 @@ public class WmScorePackageStatusController {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取批量审核的校验信息
|
|
* 获取批量审核的校验信息
|
|
|
|
+ *
|
|
* @param ids
|
|
* @param ids
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@GetMapping(value = "/approvalStatus/checkout")
|
|
@GetMapping(value = "/approvalStatus/checkout")
|
|
- public R approvalStatusCheckout(@RequestParam(value = "ids") String ids){
|
|
|
|
|
|
+ public R approvalStatusCheckout(@RequestParam(value = "ids") String ids) {
|
|
|
|
|
|
// 获取id
|
|
// 获取id
|
|
List<String> idList = StrUtil.split(ids, StrUtil.COMMA);
|
|
List<String> idList = StrUtil.split(ids, StrUtil.COMMA);
|
|
@@ -249,7 +236,7 @@ public class WmScorePackageStatusController {
|
|
|
|
|
|
int operation = 0;
|
|
int operation = 0;
|
|
int remain = 0;
|
|
int remain = 0;
|
|
- for (Map.Entry<String,List<WmScorePackageStatus>>entry : map.entrySet()){
|
|
|
|
|
|
+ for (Map.Entry<String, List<WmScorePackageStatus>> entry : map.entrySet()) {
|
|
|
|
|
|
String packageId = entry.getKey();
|
|
String packageId = entry.getKey();
|
|
Set<Integer> tempIds = entry.getValue().stream().mapToInt(WmScorePackageStatus::getId).boxed().collect(Collectors.toSet());
|
|
Set<Integer> tempIds = entry.getValue().stream().mapToInt(WmScorePackageStatus::getId).boxed().collect(Collectors.toSet());
|
|
@@ -257,7 +244,7 @@ public class WmScorePackageStatusController {
|
|
tempIds.retainAll(idSet);
|
|
tempIds.retainAll(idSet);
|
|
Integer userNum = userNumMap.get(packageId) == null ? 1 : userNumMap.get(packageId);
|
|
Integer userNum = userNumMap.get(packageId) == null ? 1 : userNumMap.get(packageId);
|
|
|
|
|
|
- if (entry.getValue().size() <= userNum){
|
|
|
|
|
|
+ if (entry.getValue().size() <= userNum) {
|
|
|
|
|
|
operation += tempIds.size();
|
|
operation += tempIds.size();
|
|
|
|
|
|
@@ -269,7 +256,7 @@ public class WmScorePackageStatusController {
|
|
|
|
|
|
Map<String, Integer> result = new HashMap<>(2);
|
|
Map<String, Integer> result = new HashMap<>(2);
|
|
result.put("operation", operation);
|
|
result.put("operation", operation);
|
|
- result.put("remain",remain);
|
|
|
|
|
|
+ result.put("remain", remain);
|
|
|
|
|
|
return R.ok(result);
|
|
return R.ok(result);
|
|
|
|
|
|
@@ -279,14 +266,14 @@ public class WmScorePackageStatusController {
|
|
* 终止接单--区分全部收回,和部分收回
|
|
* 终止接单--区分全部收回,和部分收回
|
|
*
|
|
*
|
|
* @param wmScorePackageStatus 终止接单
|
|
* @param wmScorePackageStatus 终止接单
|
|
- * enableType 1全部收回,2部分收回
|
|
|
|
|
|
+ * enableType 1全部收回,2部分收回
|
|
* @return R
|
|
* @return R
|
|
*/
|
|
*/
|
|
@ApiOperation(value = "终止接单", notes = "终止接单")
|
|
@ApiOperation(value = "终止接单", notes = "终止接单")
|
|
- @SysLog("终止接单" )
|
|
|
|
|
|
+ @SysLog("终止接单")
|
|
@GetMapping("updateZZ")
|
|
@GetMapping("updateZZ")
|
|
- public R updateZZ( WmScorePackageStatus wmScorePackageStatus) {
|
|
|
|
- if(StringUtil.isEmpty(wmScorePackageStatus.getId()+"")){
|
|
|
|
|
|
+ public R updateZZ(WmScorePackageStatus wmScorePackageStatus) {
|
|
|
|
+ if (StringUtil.isEmpty(wmScorePackageStatus.getId() + "")) {
|
|
return R.failed("缺少参数");
|
|
return R.failed("缺少参数");
|
|
}
|
|
}
|
|
return wmScorePackageStatusService.updateZZ(wmScorePackageStatus);
|
|
return wmScorePackageStatusService.updateZZ(wmScorePackageStatus);
|