This commit is contained in:
张乐
2020-08-21 18:23:26 +08:00
parent a02bd7eeda
commit c9c6b2becd
11 changed files with 80 additions and 14 deletions

View File

@@ -177,6 +177,11 @@ json渲染表单以及是否需要编辑数据回填的功能以下为例
## 后台账号 demo 密码 crmeb.com 请大家不要随意改密码!
#### 请大家不要随意改密码!请大家不要随意改密码!请大家不要随意改密码!
请关注我们
![输入图片说明](https://images.gitee.com/uploads/images/2020/0821/181709_88924490_2012975.png "屏幕截图.png")
## 参与开发
请参阅 [CRMEB](https://github.com/crmeb/crmeb_java)。

0
admin/tree.text Normal file
View File

View File

@@ -354,6 +354,7 @@ public class OrderServiceImpl implements OrderService {
storeOrderStatusService.createLog(existStoreOrder.getId(), Constants.ORDER_LOG_REFUND_APPLY,"用户申请退款原因:" + request.getRefund_reason_wap_explain());
existStoreOrder.setRefundStatus(1);
existStoreOrder.setStatus(-1);
existStoreOrder.setRefundReasonTime(DateUtil.nowDateTime());
existStoreOrder.setRefundReasonWap(request.getText());
existStoreOrder.setRefundReasonWapExplain(request.getRefund_reason_wap_explain());
@@ -367,7 +368,7 @@ public class OrderServiceImpl implements OrderService {
boolean codeResult = smsService.pushCodeToList(currentUser.getPhone(),1, smsInfo);
if(!codeResult) throw new CrmebException("短信加入发送队列失败");
redisUtil.lPush(Constants.ORDER_TASK_REDIS_KEY_AFTER_REFUND_BY_USER, existStoreOrder.getId());
// redisUtil.lPush(Constants.ORDER_TASK_REDIS_KEY_AFTER_REFUND_BY_USER, existStoreOrder.getId());
return true;
}

View File

@@ -222,7 +222,6 @@ public class OrderPayServiceImpl extends PayService implements OrderPayService {
//增加经验、积分
updateFounds();
}
/**

View File

@@ -65,7 +65,7 @@ public class StoreProductReplyController {
@RequestMapping(value = "/save", method = RequestMethod.POST)
public CommonResult<String> save(
@RequestBody @Validated StoreProductReplyAddRequest request){
if(storeProductReplyService.create(request)){
if(storeProductReplyService.virtualCreate(request)){
return CommonResult.success();
}else{
return CommonResult.failed();

View File

@@ -55,4 +55,10 @@ public class StoreProductReplyAddRequest implements Serializable {
@ApiModelProperty(value = "评论图片", required = true)
private String pics;
@ApiModelProperty(value = "评论人头像 [虚拟评论参数]")
private String avatar;
@ApiModelProperty(value = "评论人昵称 [虚拟评论参数]")
private String nickname;
}

View File

@@ -23,6 +23,13 @@ public interface StoreProductReplyService extends IService<StoreProductReply> {
boolean create(StoreProductReplyAddRequest request);
/**
* 添加虚拟评论
* @param request 评论参数
* @return 评论结果
*/
boolean virtualCreate(StoreProductReplyAddRequest request);
/**
* 查询是否已经回复
* @param unique

View File

@@ -228,12 +228,6 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderDao, StoreOrder
if(null != storeOrder.getPayTime()){
lqw.eq(StoreOrder::getPayTime, storeOrder.getPayTime());
}
if(null != storeOrder.getPaid()){
lqw.eq(StoreOrder::getPaid, storeOrder.getPaid());
}
// if(null != storeOrder.getStatus()){
// lqw.eq(StoreOrder::getStatus, storeOrder.getStatus());
// }
if(null != storeOrder.getStoreId()){
lqw.eq(StoreOrder::getStoreId, storeOrder.getStoreId());
}
@@ -851,7 +845,8 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderDao, StoreOrder
public boolean refundRefuse(Integer id, String reason) {
StoreOrder storeOrder = getInfoException(id);
storeOrder.setRefundReason(reason);
storeOrder.setRefundStatus(4);
storeOrder.setRefundStatus(0);
storeOrder.setStatus(1);
updateById(storeOrder);
storeOrderStatusService.createLog(storeOrder.getId(), Constants.ORDER_LOG_REFUND_REFUSE, Constants.ORDER_LOG_MESSAGE_REFUND_REFUSE.replace("{reason}", reason));
@@ -1321,7 +1316,7 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderDao, StoreOrder
break;
case Constants.ORDER_STATUS_H5_REFUND: // 退款
queryWrapper.eq(StoreOrder::getPaid, true);
queryWrapper.gt(StoreOrder::getRefundStatus, 0); //大于0
queryWrapper.in(StoreOrder::getRefundStatus, "1,2"); //大于0
break;
}
queryWrapper.eq(StoreOrder::getIsDel, false);
@@ -1532,6 +1527,29 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderDao, StoreOrder
map.put("value", Constants.ORDER_STATUS_STR_REFUNDED);
}
if(storeOrder.getPaid()
&& storeOrder.getStatus() == 0
&& !storeOrder.getIsDel()
&& !storeOrder.getIsSystemDel()){
map.put("key", Constants.ORDER_STATUS_NOT_SHIPPED);
map.put("value", Constants.ORDER_STATUS_STR_NOT_SHIPPED);
}
if(storeOrder.getPaid()
&& storeOrder.getStatus() == 1
&& !storeOrder.getIsDel()
&& !storeOrder.getIsSystemDel()){
map.put("key", Constants.ORDER_STATUS_SPIKE);
map.put("value", Constants.ORDER_STATUS_STR_SPIKE);
}
if(storeOrder.getPaid()
&& storeOrder.getStatus() == 2
&& !storeOrder.getIsDel()
&& !storeOrder.getIsSystemDel()){
map.put("key", Constants.ORDER_STATUS_COMPLETE);
map.put("value", Constants.ORDER_STATUS_STR_TAKE);
}
if(storeOrder.getIsDel() || storeOrder.getIsSystemDel()){

View File

@@ -213,6 +213,26 @@ public class StoreProductReplyServiceImpl extends ServiceImpl<StoreProductReplyD
}
}
/**
* 添加虚拟评论
* @param request 评论参数
* @return 评论结果
*/
@Override
public boolean virtualCreate(StoreProductReplyAddRequest request) {
StoreProductReply storeProductReply = new StoreProductReply();
BeanUtils.copyProperties(request, storeProductReply);
if(StringUtils.isNotBlank(request.getPics())){
String pics = request.getPics()
.replace("[","")
.replace("]","")
.replace("\"","");
storeProductReply.setPics(systemAttachmentService.clearPrefix(ArrayUtils.toString(pics)));
}
storeProductReply.setUnique(CrmebUtil.randomCount(11111,9999)+"");
return save(storeProductReply);
}
/**
* 订单是否已回复
* @param unique 订单id

View File

@@ -309,10 +309,20 @@ public class StoreProductServiceImpl extends ServiceImpl<StoreProductDao, StoreP
boolean attrAddResult = attrService.save(singleAttr);
if (!attrAddResult) throw new CrmebException("新增属性名失败");
StoreProductAttrValue singleAttrValue = new StoreProductAttrValue();
BigDecimal commissionL1= BigDecimal.ZERO;
BigDecimal commissionL2= BigDecimal.ZERO;
if(storeProductRequest.getAttrValue().size()>0){
commissionL1 = null != storeProductRequest.getAttrValue().get(0).getBrokerage() ?
storeProductRequest.getAttrValue().get(0).getBrokerage():BigDecimal.ZERO;
commissionL2 = null != storeProductRequest.getAttrValue().get(0).getBrokerageTwo() ?
storeProductRequest.getAttrValue().get(0).getBrokerageTwo():BigDecimal.ZERO;
}
singleAttrValue.setProductId(storeProduct.getId()).setStock(storeProduct.getStock()).setSuk("默认")
.setSales(storeProduct.getSales()).setPrice(storeProduct.getPrice())
.setImage(systemAttachmentService.clearPrefix(storeProduct.getImage()))
.setCost(storeProduct.getCost()).setBarCode(storeProduct.getBarCode()).setOtPrice(storeProduct.getOtPrice());
.setCost(storeProduct.getCost()).setBarCode(storeProduct.getBarCode())
.setOtPrice(storeProduct.getOtPrice()).setBrokerage(commissionL1).setBrokerageTwo(commissionL2);
boolean saveOrUpdateResult = storeProductAttrValueService.save(singleAttrValue);
if(!saveOrUpdateResult) throw new CrmebException("新增属性详情失败");
}

View File

@@ -169,7 +169,7 @@ public class OrderUtils {
status = new OrderAgainItemVo(1,"未发货","商家未发货,请耐心等待");
}else if(storeOrder.getStatus() == 1){ // 待收货处理
// 待收货
if(storeOrder.getDeliveryType().equals(Constants.ORDER_STATUS_STR_SPIKE_KEY)){ // 送货
if(null != storeOrder.getDeliveryType() && storeOrder.getDeliveryType().equals(Constants.ORDER_STATUS_STR_SPIKE_KEY)){ // 送货
StoreOrderStatus storeOrderStatus = new StoreOrderStatus();
storeOrderStatus.setOid(storeOrder.getId());
storeOrderStatus.setChangeType(Constants.ORDER_LOG_DELIVERY);
@@ -178,7 +178,7 @@ public class OrderUtils {
String DateStr = DateUtil.dateToStr(sOrderStatusResults.get(sOrderStatusResults.size()-1).getCreateTime(), Constants.DATE_FORMAT);
status = new OrderAgainItemVo(2,"待收货",DateStr+"服务商已送货");
}
}else if(storeOrder.getDeliveryType().equals(Constants.ORDER_LOG_EXPRESS)) {
}else if(null != storeOrder.getDeliveryType() && storeOrder.getDeliveryType().equals(Constants.ORDER_LOG_EXPRESS)) {
StoreOrderStatus storeOrderStatus = new StoreOrderStatus();
storeOrderStatus.setOid(storeOrder.getId());
storeOrderStatus.setChangeType(Constants.ORDER_LOG_EXPRESS);