|
|
@ -2,6 +2,7 @@ package com.qs.serve.modules.goods.controller; |
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.qs.serve.common.model.annotation.SysLog; |
|
|
|
import com.qs.serve.common.model.dto.PageVo; |
|
|
|
import com.qs.serve.common.model.dto.R; |
|
|
@ -77,6 +78,8 @@ public class GoodsFeedbackController { |
|
|
|
SimpleKeyValue<String> current = roots.computeIfAbsent(parts[0], k -> { |
|
|
|
SimpleKeyValue<String> root = new SimpleKeyValue<String>(); |
|
|
|
root.setValue( k ); |
|
|
|
root.setLabel( k ); |
|
|
|
root.setParentId("0"); |
|
|
|
return root; |
|
|
|
}); |
|
|
|
for (int i = 1; i < parts.length; i++) { |
|
|
@ -87,7 +90,7 @@ public class GoodsFeedbackController { |
|
|
|
} |
|
|
|
|
|
|
|
public SimpleKeyValue<String> findOrCreateChild(SimpleKeyValue<String> parent, String[] values,int idx) { |
|
|
|
String finalValue = parent.getValue() + values[idx]; |
|
|
|
String finalValue = values[idx]; |
|
|
|
for (SimpleKeyValue<String> child : parent.getChildList()) { |
|
|
|
if (child.getValue().equals(finalValue)) { |
|
|
|
return child; |
|
|
@ -95,6 +98,8 @@ public class GoodsFeedbackController { |
|
|
|
} |
|
|
|
SimpleKeyValue newChild = new SimpleKeyValue(); |
|
|
|
newChild.setValue(finalValue); |
|
|
|
newChild.setLabel(finalValue); |
|
|
|
newChild.setParentId(parent.getValue()); |
|
|
|
parent.addChild(newChild); |
|
|
|
return newChild; |
|
|
|
} |
|
|
@ -105,9 +110,9 @@ public class GoodsFeedbackController { |
|
|
|
* @param param |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@GetMapping("/pageMy") |
|
|
|
public R<PageVo<GoodsFeedbackVo>> getPageMy(GoodsFeedbackQuery param){ |
|
|
|
PageUtil.startPage(); |
|
|
|
@PostMapping("/pageMy") |
|
|
|
public R<PageVo<GoodsFeedbackVo>> getPageMy(@RequestBody GoodsFeedbackQuery param){ |
|
|
|
PageHelper.startPage(param.getPageNum(),param.getPageSize()); |
|
|
|
param.setSelectUserIds(Arrays.asList(AuthContextUtils.getSysUserId())); |
|
|
|
List<GoodsFeedbackVo> list = goodsFeedbackService.selectListVo(param); |
|
|
|
return R.byPageHelperList(list); |
|
|
@ -118,12 +123,12 @@ public class GoodsFeedbackController { |
|
|
|
* @param param |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@GetMapping("/pageMyAndChild") |
|
|
|
public R<PageVo<GoodsFeedbackVo>> getPageMyAndChild(GoodsFeedbackQuery param){ |
|
|
|
@PostMapping("/pageMyAndChild") |
|
|
|
public R<PageVo<GoodsFeedbackVo>> getPageMyAndChild(@RequestBody GoodsFeedbackQuery param){ |
|
|
|
String userId = AuthContextUtils.getSysUserId(); |
|
|
|
List<String> userIds = postUserService.listByChildIds(userId); |
|
|
|
userIds.add(userId); |
|
|
|
PageUtil.startPage(); |
|
|
|
PageHelper.startPage(param.getPageNum(),param.getPageSize()); |
|
|
|
param.setSelectUserIds(userIds); |
|
|
|
List<GoodsFeedbackVo> list = goodsFeedbackService.selectListVo(param); |
|
|
|
return R.byPageHelperList(list); |
|
|
@ -135,9 +140,9 @@ public class GoodsFeedbackController { |
|
|
|
* @param param |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@GetMapping("/page") |
|
|
|
public R<PageVo<GoodsFeedbackVo>> getPage(GoodsFeedbackQuery param){ |
|
|
|
PageUtil.startPage(); |
|
|
|
@PostMapping("/page") |
|
|
|
public R<PageVo<GoodsFeedbackVo>> getPage(@RequestBody GoodsFeedbackQuery param){ |
|
|
|
PageHelper.startPage(param.getPageNum(),param.getPageSize()); |
|
|
|
List<GoodsFeedbackVo> list = goodsFeedbackService.selectListVo(param); |
|
|
|
return R.byPageHelperList(list); |
|
|
|
} |
|
|
@ -202,9 +207,8 @@ public class GoodsFeedbackController { |
|
|
|
@SysLog(module = SystemModule.GOODS, title = "问题反馈", biz = BizType.INSERT) |
|
|
|
public R<?> check(@RequestBody @Valid GoodsFeedbackCheckBo param){ |
|
|
|
GoodsFeedback feedback = goodsFeedbackService.getById(param.getId()); |
|
|
|
feedback.setGoodsCheckRemark(param.getRemark()); |
|
|
|
feedback.setGoodsCheckRemark(param.getGoodsCheckRemark()); |
|
|
|
feedback.setGoodsCheckTime(LocalDateTime.now()); |
|
|
|
feedback.setGoodsCheckerId(AuthContextUtils.getSysUserId()); |
|
|
|
SysUser sysUser = sysUserService.getById(AuthContextUtils.getSysUserId()); |
|
|
|
feedback.setGoodsCheckerId(sysUser.getId()); |
|
|
|
feedback.setGoodsChecker(sysUser.getName()); |
|
|
|