fix bug 6334
This commit is contained in:
parent
a6422e9aa9
commit
05dc6fa2ce
|
|
@ -34,11 +34,14 @@ public class CookEvaluaDetail extends BaseEntity {
|
|||
@ApiModelProperty(value = "餐品类型(1-菜品,2-套餐,3-商品)")
|
||||
private Long mealType;
|
||||
|
||||
/** 餐品id */
|
||||
@Excel(name = "餐品id")
|
||||
@ApiModelProperty(value = "餐品id")
|
||||
/** 菜品id */
|
||||
@Excel(name = "菜品id")
|
||||
@ApiModelProperty(value = "菜品id")
|
||||
private Long mealId;
|
||||
|
||||
@ApiModelProperty(value = "菜品名称")
|
||||
private String dishesName;
|
||||
|
||||
/** 星级 */
|
||||
@Excel(name = "星级")
|
||||
@ApiModelProperty(value = "星级")
|
||||
|
|
|
|||
|
|
@ -113,16 +113,14 @@ public class CookEvaluaOrderServiceImpl implements ICookEvaluaOrderService {
|
|||
cookEvaluaOrderDTO.setUserId(SecurityUtils.getUserId());
|
||||
}
|
||||
try {
|
||||
int count = cookEvaluaOrderMapper.insertCookEvaluaOrder(cookEvaluaOrderDTO);
|
||||
long evaluaId = cookEvaluaOrderDTO.getEvaluaId();
|
||||
List<String> pictureList = cookEvaluaOrderDTO.getPictureList();
|
||||
for (int i = 0; i < pictureList.size(); i++) {
|
||||
CookEvaluaPicture cookEvaluaPicture = new CookEvaluaPicture();
|
||||
cookEvaluaPicture.setEvaluaId(evaluaId);
|
||||
cookEvaluaPicture.setImgUrl(pictureList.get(i));
|
||||
cookEvaluaPicture.setCreateTime(DateUtils.getNowDate());
|
||||
cookEvaluaPicture.setCreateBy(SecurityUtils.getUsername());
|
||||
cookEvaluaPictureMapper.insertCookEvaluaPicture(cookEvaluaPicture);
|
||||
CookEvaluaOrder evaluaOrder = cookEvaluaOrderMapper.selectCookEvaluaOrderByOrderId(cookEvaluaOrderDTO.getOrderId());
|
||||
int count = 0;
|
||||
long evaluaId = 0;
|
||||
if (Objects.isNull(evaluaOrder)) {
|
||||
count = cookEvaluaOrderMapper.insertCookEvaluaOrder(cookEvaluaOrderDTO);
|
||||
evaluaId = cookEvaluaOrderDTO.getEvaluaId();
|
||||
} else {
|
||||
evaluaId = evaluaOrder.getEvaluaId();
|
||||
}
|
||||
List<CookEvaluaDetail> detailList = cookEvaluaOrderDTO.getDetailList();
|
||||
for (int i = 0; i < detailList.size(); i++) {
|
||||
|
|
@ -132,6 +130,15 @@ public class CookEvaluaOrderServiceImpl implements ICookEvaluaOrderService {
|
|||
cookEvaluaDetail.setCreateBy(SecurityUtils.getUsername());
|
||||
cookEvaluaDetailMapper.insertCookEvaluaDetail(cookEvaluaDetail);
|
||||
}
|
||||
List<String> pictureList = cookEvaluaOrderDTO.getPictureList();
|
||||
for (int i = 0; i < pictureList.size(); i++) {
|
||||
CookEvaluaPicture cookEvaluaPicture = new CookEvaluaPicture();
|
||||
cookEvaluaPicture.setEvaluaId(evaluaId);
|
||||
cookEvaluaPicture.setImgUrl(pictureList.get(i));
|
||||
cookEvaluaPicture.setCreateTime(DateUtils.getNowDate());
|
||||
cookEvaluaPicture.setCreateBy(SecurityUtils.getUsername());
|
||||
cookEvaluaPictureMapper.insertCookEvaluaPicture(cookEvaluaPicture);
|
||||
}
|
||||
cookEvaluaOrderMapper.updateOrderEvaluaStatus(cookEvaluaOrderDTO.getOrderId());
|
||||
return count;
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="evaluaId" column="evalua_id" />
|
||||
<result property="mealType" column="meal_type" />
|
||||
<result property="mealId" column="meal_id" />
|
||||
<result property="dishesName" column="dishes_name" />
|
||||
<result property="starLevel" column="star_level" />
|
||||
<result property="description" column="description" />
|
||||
<result property="evaluaNickName" column="nick_name" />
|
||||
|
|
@ -20,8 +21,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<sql id="selectCookEvaluaDetailVo">
|
||||
select ced.evalua_detail_id, ced.evalua_id, ced.meal_type, ced.meal_id, ced.star_level,
|
||||
ced.description, ced.create_by, ced.create_time, ced.update_by, ced.update_time,
|
||||
su.nick_name
|
||||
su.nick_name, cd.dishes_name
|
||||
from cook_evalua_detail ced
|
||||
left join cook_dishes cd on cd.dishes_id = ced.meal_id
|
||||
left join cook_evalua_order ceo on ceo.evalua_id = ced.evalua_id
|
||||
left join sys_user su on su.user_id = ceo.user_id
|
||||
</sql>
|
||||
|
|
|
|||
Loading…
Reference in New Issue