Merge branch 'company_server' of https://gitee.com/doc_wei01/skyeye into company_server

This commit is contained in:
luluyuyu 2024-12-02 15:59:19 +08:00
commit 3c19934813
7 changed files with 92 additions and 20 deletions

View file

@ -10,6 +10,7 @@ import com.skyeye.annotation.api.ApiModel;
import com.skyeye.annotation.api.ApiModelProperty;
import com.skyeye.annotation.unique.UniqueField;
import com.skyeye.common.entity.features.BaseGeneralInfo;
import com.skyeye.common.enumeration.EnableEnum;
import lombok.Data;
/**
@ -31,7 +32,7 @@ public class PayApp extends BaseGeneralInfo {
private String appKey;
@TableField("enabled")
@ApiModelProperty(value = "状态,参考#EnableEnum", required = "required")
@ApiModelProperty(value = "状态", required = "required", enumClass = EnableEnum.class)
private Integer enabled;
@TableField("order_notify_url")

View file

@ -38,7 +38,7 @@ public class SubjectController {
* @param inputObject 入参以及用户信息等获取对象
* @param outputObject 出参以及提示信息的返回值对象
*/
@ApiOperation(id = "querySubjectList", value = "获取科目列表--管理端使用", method = "POST", allUse = "1")
@ApiOperation(id = "querySubjectList", value = "获取科目列表--管理端使用", method = "POST", allUse = "2")
@ApiImplicitParams(classBean = CommonPageInfo.class)
@RequestMapping("/post/SubjectController/querySubjectList")
public void querySubjectList(InputObject inputObject, OutputObject outputObject) {
@ -51,11 +51,11 @@ public class SubjectController {
* @param inputObject 入参以及用户信息等获取对象
* @param outputObject 出参以及提示信息的返回值对象
*/
@ApiOperation(id = "writeSubject", value = "新增/编辑科目信息", method = "POST", allUse = "1")
@ApiOperation(id = "writeSubject", value = "新增/编辑科目信息", method = "POST", allUse = "2")
@ApiImplicitParams(classBean = Subject.class)
@RequestMapping("/post/SubjectController/writeSubject")
public void writeSubject(InputObject inputObject, OutputObject outputObject) {
subjectService.saveOrUpdateEntity(inputObject, outputObject);
subjectService.saveOrUpdateEntity(inputObject, outputObject);
}
/**
@ -64,7 +64,7 @@ public class SubjectController {
* @param inputObject 入参以及用户信息等获取对象
* @param outputObject 出参以及提示信息的返回值对象
*/
@ApiOperation(id = "deleteSubjectById", value = "根据ID删除科目信息", method = "DELETE", allUse = "1")
@ApiOperation(id = "deleteSubjectById", value = "根据ID删除科目信息", method = "DELETE", allUse = "2")
@ApiImplicitParams({
@ApiImplicitParam(id = "id", name = "id", value = "主键id", required = "required")})
@RequestMapping("/post/SubjectController/deleteSubjectById")

View file

@ -82,6 +82,19 @@ public class OrderCommentController {
@ApiImplicitParams(classBean = CommonPageInfo.class)
@RequestMapping("/post/OrderCommentController/queryOrderCommentPageList")
public void queryOrderCommentPageList(InputObject inputObject, OutputObject outputObject) {
orderCommentService.queryPageList(inputObject, outputObject);
orderCommentService.queryOrderCommentPageList(inputObject, outputObject);
}
/**
* 分页查询商品订单评价信息PC
*
* @param inputObject 入参以及用户信息等获取对象
* @param outputObject 出参以及提示信息的返回值对象
*/
@ApiOperation(id = "queryOrderCommentPageListPC", value = "分页查询商品订单评价信息PC", method = "POST", allUse = "2")
@ApiImplicitParams(classBean = CommonPageInfo.class)
@RequestMapping("/post/OrderCommentController/queryOrderCommentPageListPC")
public void queryOrderCommentPageListPC(InputObject inputObject, OutputObject outputObject) {
orderCommentService.queryPageList(inputObject,outputObject);
}
}

View file

@ -52,6 +52,14 @@ public class OrderComment extends OperatorUserInfo {
@Property(value = "商品信息")
private Map<String, Object> materialMation;
@TableField(value = "store_id")
@ApiModelProperty(value = "店铺id")
private String storeId;
@TableField(exist = false)
@Property(value = "门店信息")
private Map<String, Object> storeMation;
@TableField(value = "order_id")
@ApiModelProperty(value = "订单id", required = "required")
private String orderId;
@ -65,9 +73,13 @@ public class OrderComment extends OperatorUserInfo {
private Integer type;
@TableField(value = "start")
@ApiModelProperty(value = "星级(1-5)",required = "required")
@ApiModelProperty(value = "星级(1-5)")
private Integer start;
@TableField(value = "is_comment")
@ApiModelProperty(value = "是否评价,1:是,0:否,参考#WhetherEnum")
private Integer isComment;
@TableField(value = "context")
@ApiModelProperty(value = "评价内容", required = "required")
private String context;

View file

@ -18,4 +18,5 @@ import com.skyeye.order.entity.OrderComment;
* 注意本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的
*/
public interface OrderCommentService extends SkyeyeBusinessService<OrderComment> {
void queryOrderCommentPageList(InputObject inputObject, OutputObject outputObject);
}

View file

@ -8,14 +8,20 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.skyeye.annotation.service.SkyeyeService;
import com.skyeye.base.business.service.impl.SkyeyeBusinessServiceImpl;
import com.skyeye.common.constans.CommonConstants;
import com.skyeye.common.entity.search.CommonPageInfo;
import com.skyeye.common.enumeration.WhetherEnum;
import com.skyeye.common.object.InputObject;
import com.skyeye.common.object.OutputObject;
import com.skyeye.common.util.mybatisplus.MybatisPlusUtil;
import com.skyeye.erp.service.IMaterialNormsService;
import com.skyeye.erp.service.IMaterialService;
import com.skyeye.eve.service.IAuthUserService;
import com.skyeye.exception.CustomException;
import com.skyeye.order.dao.OrderCommentDao;
import com.skyeye.order.entity.OrderComment;
@ -55,6 +61,9 @@ public class OrderCommentServiceImpl extends SkyeyeBusinessServiceImpl<OrderComm
@Autowired
private OrderItemService orderItemService;
@Autowired
private IAuthUserService iAuthUserService;
@Override
public void validatorEntity(OrderComment orderComment) {
if (orderComment.getType() == OrderCommentType.MERCHANT.getKey()) {
@ -74,14 +83,28 @@ public class OrderCommentServiceImpl extends SkyeyeBusinessServiceImpl<OrderComm
}
}
@Override
public void createPrepose(OrderComment entity) {
if (entity.getType() == OrderCommentType.CUSTOMERFiRST.getKey() ||
entity.getType() == OrderCommentType.CUSTOMERLATER.getKey()) {
entity.setIsComment(WhetherEnum.DISABLE_USING.getKey());
}
}
@Override
public void createPostpose(OrderComment orderComment, String userId) {
List<OrderItem> orderItemList = orderItemService.queryListByStateAndOrderId(orderComment.getOrderId(), WhetherEnum.DISABLE_USING.getKey());
if (CollectionUtil.isNotEmpty(orderItemList)) {
if (CollectionUtil.isNotEmpty(orderItemList)) {// 总订单的评价状态修改
orderService.updateCommonState(orderComment.getOrderId(), ShopOrderCommentState.PORTION.getKey());
} else {
orderService.updateCommonState(orderComment.getOrderId(), ShopOrderCommentState.FINISHED.getKey());
}
if (orderComment.getType() == OrderCommentType.MERCHANT.getKey()) {// 商家回复时修改客户评价状态为已评价
UpdateWrapper<OrderComment> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq(CommonConstants.ID, orderComment.getParentId());
updateWrapper.set(MybatisPlusUtil.toColumns(OrderComment::getIsComment), WhetherEnum.ENABLE_USING.getKey());
update(updateWrapper);
}
}
@Override
@ -95,10 +118,11 @@ public class OrderCommentServiceImpl extends SkyeyeBusinessServiceImpl<OrderComm
return orderComment;
}
protected List<Map<String, Object>> queryPageDataList(InputObject inputObject) {
public List<Map<String, Object>> queryPageDataList(InputObject inputObject) {
List<Map<String, Object>> mapList = super.queryPageDataList(inputObject);
iMaterialService.setMationForMap(mapList, "materialId", "materialMation");
iMaterialNormsService.setMationForMap(mapList, "normsId", "normsMation");
iAuthUserService.setMationForMap(mapList, "createId", "createMation");
return mapList;
}
@ -106,8 +130,28 @@ public class OrderCommentServiceImpl extends SkyeyeBusinessServiceImpl<OrderComm
public QueryWrapper<OrderComment> getQueryWrapper(CommonPageInfo commonPageInfo) {
String typeId = commonPageInfo.getTypeId();
QueryWrapper<OrderComment> queryWrapper = super.getQueryWrapper(commonPageInfo);
queryWrapper.eq(MybatisPlusUtil.toColumns(OrderComment::getCreateId), typeId)
.or().eq(MybatisPlusUtil.toColumns(OrderComment::getMaterialId), typeId);
queryWrapper.and(wrap -> {
wrap.eq(MybatisPlusUtil.toColumns(OrderComment::getType), OrderCommentType.CUSTOMERFiRST.getKey())
.or().eq(MybatisPlusUtil.toColumns(OrderComment::getType), OrderCommentType.CUSTOMERLATER.getKey());
});
if (StrUtil.isNotEmpty(typeId)) {
queryWrapper.eq(MybatisPlusUtil.toColumns(OrderComment::getStoreId), typeId);
}
return queryWrapper;
}
@Override
public void queryOrderCommentPageList(InputObject inputObject, OutputObject outputObject) {
CommonPageInfo commonPageInfo = inputObject.getParams(CommonPageInfo.class);
String typeId = commonPageInfo.getTypeId();
Page pages = PageHelper.startPage(commonPageInfo.getPage(), commonPageInfo.getLimit());
QueryWrapper<OrderComment> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(MybatisPlusUtil.toColumns(OrderComment::getCreateId), typeId)
.or().eq(MybatisPlusUtil.toColumns(OrderComment::getMaterialId), typeId);
List<Map<String, Object>> mapList = listMaps(queryWrapper);
iMaterialService.setMationForMap(mapList, "materialId", "materialMation");
iMaterialNormsService.setMationForMap(mapList, "normsId", "normsMation");
outputObject.setBeans(mapList);
outputObject.settotal(pages.getTotal());
}
}

View file

@ -425,17 +425,18 @@ public class OrderServiceImpl extends SkyeyeBusinessServiceImpl<OrderDao, Order>
throw new CustomException("订单不存在");
}
// 可取消的订单状态未提交(0)已提交(1)待支付(2)待发货(5)
if (one.getState() == ShopOrderState.UNSUBMIT.getKey() ||
one.getState() == ShopOrderState.SUBMIT.getKey() ||
one.getState() == ShopOrderState.UNPAID.getKey() ||
one.getState() == ShopOrderState.UNDELIVERED.getKey()) {
if (Objects.equals(one.getState(), ShopOrderState.UNSUBMIT.getKey()) ||
Objects.equals(one.getState(), ShopOrderState.SUBMIT.getKey()) ||
Objects.equals(one.getState(), ShopOrderState.UNPAID.getKey()) ||
Objects.equals(one.getState(), ShopOrderState.UNDELIVERED.getKey())) {
updateWrapper.set(MybatisPlusUtil.toColumns(Order::getState), ShopOrderState.CANCELED.getKey());
updateWrapper.set(MybatisPlusUtil.toColumns(Order::getCancelType), params.get("cancelType"));
updateWrapper.set(MybatisPlusUtil.toColumns(Order::getCancelTime), DateUtil.getTimeAndToString());
update(updateWrapper);
refreshCache(params.get("id").toString());
} else {
throw new CustomException("订单不可取消");
}
updateWrapper.set(MybatisPlusUtil.toColumns(Order::getState), ShopOrderState.CANCELED.getKey());
updateWrapper.set(MybatisPlusUtil.toColumns(Order::getCancelType), params.get("cancelType"));
updateWrapper.set(MybatisPlusUtil.toColumns(Order::getCancelTime), DateUtil.getTimeAndToString());
update(updateWrapper);
refreshCache(params.get("id").toString());
}
@Override