沟通补正BUG修改

This commit is contained in:
1215525055@qq.com 2025-06-05 12:16:44 +08:00
parent c903ca5e35
commit 56a26f9c0e
5 changed files with 71 additions and 30 deletions

11
pom.xml
View File

@ -20,6 +20,17 @@
<druid.version>1.1.9</druid.version>
</properties>
<dependencies>
<!-- 确保使用一致的 Swagger2 依赖 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>3.0.0</version> <!-- 或稳定版本 -->
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>

View File

@ -13,10 +13,12 @@ import cn.com.tenlion.aishop.pojo.dtos.correction.CorrectionDTO;
import cn.com.tenlion.aishop.pojo.vos.correction.CorrectionVO;
import cn.com.tenlion.aishop.service.correction.ICorrectionService;
import io.swagger.annotations.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -64,6 +66,7 @@ public class CorrectionController extends DefaultBaseController {
return new SuccessResult();
}
/*
@ApiOperation(value = "修改沟通", notes = "修改沟通接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "correctionId", value = "沟通ID", paramType = "path")
@ -75,6 +78,7 @@ public class CorrectionController extends DefaultBaseController {
correctionService.update(correctionId, correctionVO);
return new SuccessResult();
}
*/
@ApiOperation(value = "沟通详情", notes = "沟通详情接口")
@ApiImplicitParams({
@ -82,7 +86,7 @@ public class CorrectionController extends DefaultBaseController {
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("get/{correctionId}")
public CorrectionDTO get(@PathVariable("correctionId") String correctionId) {
public CorrectionDTO get(@PathVariable("correctionId") String correctionId) {
return correctionService.get(correctionId);
}
@ -125,7 +129,7 @@ public class CorrectionController extends DefaultBaseController {
Map<String, Object> params = requestParams();
params.put("correctionType", "2");
params.put("correctionParentId", "0");
params.put("userId", securityComponent.getCurrentUser().getUserId());
// params.put("userId", securityComponent.getCurrentUser().getUserId());
page.setParams(params);
return correctionService.listPage(page);
}
@ -147,7 +151,7 @@ public class CorrectionController extends DefaultBaseController {
Map<String, Object> params = requestParams();
params.put("correctionType", "1");
params.put("correctionParentId", "0");
params.put("userId", securityComponent.getCurrentUser().getUserId());
// params.put("userId", securityComponent.getCurrentUser().getUserId());
page.setParams(params);
return correctionService.listPage(page);
}

View File

@ -105,6 +105,10 @@ public interface ICorrectionService {
*/
CorrectionDTO get(Map<String, Object> params);
CorrectionDTO get(String type, String correctionId);
Integer getWaitUpload(String type, String orderId);
/**
* 沟通详情
*

View File

@ -375,6 +375,48 @@ public class CorrectionServiceImpl extends DefaultBaseService implements ICorrec
return correctionDao.get(params);
}
@Override
public CorrectionDTO get(String type, String correctionId) {
Map<String, Object> params = super.getHashMap(2);
params.put("correctionId", correctionId);
CorrectionDTO dto = get(params);
Map<String, Object> params1 = new HashMap<>();
if(type.equals("2")) {
params1.put("correctionParentId", dto.getCorrectionId());
params1.put("orderId", dto.getOrderId());
params1.put("correctionType", "2");
String id = getDataId(params1);
dto.setBuyId(id);
}
if(type.equals("1")) {
params1.put("correctionParentId", dto.getCorrectionId());
params1.put("orderId", dto.getOrderId());
params1.put("correctionType", "1");
String id = getDataId(params1);
dto.setSellId(id);
}
return dto;
}
@Override
public Integer getWaitUpload(String type, String orderId) {
Map<String, Object> params = super.getHashMap(2);
params.put("correctionType", type);
params.put("correctionParentId", "0");
params.put("orderId", orderId);
List<CorrectionDTO> dtos = list(params);
Integer count = 0;
for(CorrectionDTO dto : dtos) {
if(type.equals("2") && !StringUtils.isEmpty(dto.getBuyId())) {
count ++;
}
if(type.equals("1") && !StringUtils.isEmpty(dto.getSellId())) {
count ++;
}
}
return dtos.size() - count;
}
@Override
public CorrectionDTO get(String correctionId) {
Map<String, Object> params = super.getHashMap(2);

View File

@ -265,35 +265,11 @@ public class OrderServiceImpl extends DefaultBaseService implements IOrderServic
* 查询需要补正的数量
*/
if("3,4,5,6".contains(dto.getOrderStatus())) {
// 查询待补正的信息内容
Integer count = 0;
if(userId.equals(dto.getSellUserId())) {
// 卖家
query.put("correctionType", "1");
query.put("correctionParentId", "0");
int count1 = iCorrectionService.count(query);
query.put("correctionType", "1");
query.put("createUserId", dto.getSellUserId());
query.put("correctionParentId", null);
query.put("notBuZheng", "notBuZheng");
int count2 = iCorrectionService.count(query);
count = count1 - count2;
dto.setWaitCorrectionCount(iCorrectionService.getWaitUpload("1", dto.getOrderId()));
}else if(userId.equals(dto.getBuyUserId())){
query.put("correctionType", "2");
query.put("correctionParentId", "0");
int count1 = iCorrectionService.count(query);
query.put("correctionType", "2");
query.put("createUserId", dto.getBuyUserId());
query.put("correctionParentId", null);
query.put("notBuZheng", "notBuZheng");
int count2 = iCorrectionService.count(query);
count = count1 - count2;
dto.setWaitCorrectionCount(iCorrectionService.getWaitUpload("2", dto.getOrderId()));
}
dto.setWaitCorrectionCount(count);
}
}
return list;
@ -409,12 +385,16 @@ public class OrderServiceImpl extends DefaultBaseService implements IOrderServic
goodsLogVO.setGoodslogContent("订单号:" + orderDTO.getOrderNumber());
iGoodslogService.save(goodsLogVO);
if(orderDTO.getOrderStatus().equals("2")) {
String msg = "取消订单《" + simpleDTO.getGoodsName() + "》退款";
if(orderDTO.getSellUserId().equals(securityComponent.getCurrentUser().getUserId())) {
msg = "卖家取消订单《" + simpleDTO.getGoodsName() + "》退款";
}
// 已付款,进行退款
PayVO payVO = new PayVO();
payVO.setOrderId(orderId);
payVO.setUserId(orderDTO.getBuyUserId());
payVO.setAccountMoney(PayUtil.buiderMoney(orderDTO.getPayMoney()));
payVO.setDescription("购买退款." + simpleDTO.getGoodsName());
payVO.setDescription(msg);
remoteService.savePayInShop(payVO);
}
}