Browse Source

新增系统消息

master
HY 3 months ago
parent
commit
40b4ac3483
3 changed files with 64 additions and 8 deletions
  1. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelleaselog/mapper/xml/HotelLeaseLogMapper.xml
  2. +4
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelorder/entity/HotelOrder.java
  3. +59
    -7
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/xcx/order/service/impl/OrderServiceImpl.java

+ 1
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelleaselog/mapper/xml/HotelLeaseLogMapper.xml View File

@ -8,7 +8,7 @@
(IFNULL(IFNULL(DATEDIFF(NOW(), a.start_time),0)*(SELECT `value` FROM hotel_conf WHERE `name` = 'depositPrice' )*a.num,0)) zujin, (IFNULL(IFNULL(DATEDIFF(NOW(), a.start_time),0)*(SELECT `value` FROM hotel_conf WHERE `name` = 'depositPrice' )*a.num,0)) zujin,
(a.num*(SELECT price FROM hotel_category WHERE id = a.category_id)) wash_price, (a.num*(SELECT price FROM hotel_category WHERE id = a.category_id)) wash_price,
(SELECT price FROM hotel_category WHERE id = a.category_id) wash_unit_price, (SELECT price FROM hotel_category WHERE id = a.category_id) wash_unit_price,
(select id from hotel_order where lease_id = a.id and status in (4,5,6,16)) is_wash
(select id from hotel_order where id in (select order_id from hotel_order_detail where hotel_order_detail.lease_id = a.id) and status in (4,5,6,16,20,21,22,23)) is_wash
FROM hotel_lease_log a WHERE a.del_flag = 0 AND a.user_id = #{userId} FROM hotel_lease_log a WHERE a.del_flag = 0 AND a.user_id = #{userId}
<if test="leaseFlag != null"> <if test="leaseFlag != null">
AND lease_flag = #{leaseFlag} AND lease_flag = #{leaseFlag}


+ 4
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelorder/entity/HotelOrder.java View File

@ -201,5 +201,9 @@ public class HotelOrder implements Serializable {
/**水洗店佣金*/ /**水洗店佣金*/
@TableField(exist = false) @TableField(exist = false)
private BigDecimal shopCoin; private BigDecimal shopCoin;
/**物流名称*/
private String logisticsNameTwo;
/**物流单号*/
private String logisticsCodeTwo;
} }

+ 59
- 7
jeecg-boot-module-system/src/main/java/org/jeecg/modules/xcx/order/service/impl/OrderServiceImpl.java View File

@ -12,8 +12,10 @@ import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult;
import io.swagger.models.auth.In; import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.api.dto.message.MessageDTO;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.api.ISysBaseAPI;
import org.jeecg.common.system.util.DateUtils2; import org.jeecg.common.system.util.DateUtils2;
import org.jeecg.common.util.RedisUtil; import org.jeecg.common.util.RedisUtil;
import org.jeecg.common.util.SpringContextUtils; import org.jeecg.common.util.SpringContextUtils;
@ -50,6 +52,9 @@ import org.jeecg.modules.hotelorderlog.service.IHotelOrderLogService;
import org.jeecg.modules.hotelshop.entity.HotelShop; import org.jeecg.modules.hotelshop.entity.HotelShop;
import org.jeecg.modules.hotelshop.service.IHotelShopService; import org.jeecg.modules.hotelshop.service.IHotelShopService;
import org.jeecg.modules.pay.MpWxPayService; import org.jeecg.modules.pay.MpWxPayService;
import org.jeecg.modules.system.entity.SysUserRole;
import org.jeecg.modules.system.service.ISysUserRoleService;
import org.jeecg.modules.system.service.ISysUserService;
import org.jeecg.modules.xcx.order.req.*; import org.jeecg.modules.xcx.order.req.*;
import org.jeecg.modules.xcx.order.service.IOrderService; import org.jeecg.modules.xcx.order.service.IOrderService;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
@ -61,6 +66,7 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -109,6 +115,12 @@ public class OrderServiceImpl implements IOrderService {
private IHotelCouponLogService hotelCouponLogService; private IHotelCouponLogService hotelCouponLogService;
@Resource @Resource
private IHotelOrderDetailService hotelOrderDetailService; private IHotelOrderDetailService hotelOrderDetailService;
@Resource
private ISysBaseAPI sysBaseAPI;
@Resource
private ISysUserRoleService sysUserRoleService;
@Resource
private ISysUserService sysUserService;
@ -2449,6 +2461,19 @@ public class OrderServiceImpl implements IOrderService {
hotelBalanceLogService.save(hotelBalanceLog); hotelBalanceLogService.save(hotelBalanceLog);
} }
if(hotelOrder.getType() == 0){
List<SysUserRole> sysUserRoles = sysUserRoleService.lambdaQuery()
.eq(SysUserRole::getRoleId, hotelConfService.getConf("messageId"))
.list();
List<String> collect = sysUserRoles.stream().map(SysUserRole::getUserId).collect(Collectors.toList());
MessageDTO messageDTO = new MessageDTO();
messageDTO.setTitle("租赁订单");
messageDTO.setToUser(collect.toString());
messageDTO.setFromUser("");
messageDTO.setContent("您有新的租赁订单");
sysBaseAPI.sendSysAnnouncement(messageDTO);
}
//不再通知该结果 //不再通知该结果
@ -2584,7 +2609,17 @@ public class OrderServiceImpl implements IOrderService {
hotelLeaseLogService.updateById(hotelLeaseLog1); hotelLeaseLogService.updateById(hotelLeaseLog1);
} }
List<SysUserRole> sysUserRoles = sysUserRoleService.lambdaQuery()
.eq(SysUserRole::getRoleId, hotelConfService.getConf("messageId"))
.list();
List<String> collect = sysUserRoles.stream().map(SysUserRole::getUserId).collect(Collectors.toList());
MessageDTO messageDTO = new MessageDTO();
messageDTO.setTitle(applyRefundOrderReq.getType() == 0?"退货订单":"换货订单");
messageDTO.setToUser(collect.toString());
messageDTO.setFromUser("");
messageDTO.setContent("您有新的"+(applyRefundOrderReq.getType() == 0?"退货订单":"换货订单"));
sysBaseAPI.sendSysAnnouncement(messageDTO);
return Result.OK(); return Result.OK();
@ -2858,9 +2893,9 @@ public class OrderServiceImpl implements IOrderService {
hotelOrderService.updateById(hotelOrder1); hotelOrderService.updateById(hotelOrder1);
}else if(hotelOrder.getType() == 1){ }else if(hotelOrder.getType() == 1){
if(!StringUtils.equals(hotelOrder.getShopId(),hanHaiMember.getId())){
throw new JeecgBootException("数据订单错误");
}
// if(!StringUtils.equals(hotelOrder.getShopId(),hanHaiMember.getId())){
// throw new JeecgBootException("数据订单错误");
// }
HotelShop hotelShop = hotelShopService.lambdaQuery() HotelShop hotelShop = hotelShopService.lambdaQuery()
.eq(HotelShop::getDelFlag, 0) .eq(HotelShop::getDelFlag, 0)
.eq(HotelShop::getUserId, hotelOrder.getShopId()) .eq(HotelShop::getUserId, hotelOrder.getShopId())
@ -3162,6 +3197,18 @@ public class OrderServiceImpl implements IOrderService {
hotelOrderDetail1.setId(hotelOrderDetail.getId()); hotelOrderDetail1.setId(hotelOrderDetail.getId());
hotelOrderDetail1.setStatus(1); hotelOrderDetail1.setStatus(1);
hotelOrderDetailService.updateById(hotelOrderDetail1); hotelOrderDetailService.updateById(hotelOrderDetail1);
List<SysUserRole> sysUserRoles = sysUserRoleService.lambdaQuery()
.eq(SysUserRole::getRoleId, hotelConfService.getConf("messageId"))
.list();
List<String> collect = sysUserRoles.stream().map(SysUserRole::getUserId).collect(Collectors.toList());
MessageDTO messageDTO = new MessageDTO();
messageDTO.setTitle("换货订单");
messageDTO.setToUser(collect.toString());
messageDTO.setFromUser("");
messageDTO.setContent("您有新的换货订单");
sysBaseAPI.sendSysAnnouncement(messageDTO);
} }
@ -3371,18 +3418,23 @@ public class OrderServiceImpl implements IOrderService {
} }
HotelOrder hotelOrder1 = new HotelOrder(); HotelOrder hotelOrder1 = new HotelOrder();
hotelOrder1.setId(hotelOrder.getId()); hotelOrder1.setId(hotelOrder.getId());
hotelOrder1.setLogisticsName(sendLogisticsReq.getLogisticsName());
hotelOrder1.setLogisticsCode(sendLogisticsReq.getLogisticsCode());
switch (hotelOrder.getType()){ switch (hotelOrder.getType()){
case 1: case 1:
if(hotelOrder.getStatus() == 4){
if(hotelOrder.getStatus() == 20){
hotelOrder1.setLogisticsName(sendLogisticsReq.getLogisticsName());
hotelOrder1.setLogisticsCode(sendLogisticsReq.getLogisticsCode());
hotelOrder1.setStatus(21); hotelOrder1.setStatus(21);
}else if(hotelOrder.getStatus() == 6){
}else if(hotelOrder.getStatus() == 22){
hotelOrder1.setLogisticsNameTwo(sendLogisticsReq.getLogisticsName());
hotelOrder1.setLogisticsCodeTwo(sendLogisticsReq.getLogisticsCode());
hotelOrder1.setStatus(23); hotelOrder1.setStatus(23);
} }
break; break;
case 2: case 2:
hotelOrder1.setLogisticsName(sendLogisticsReq.getLogisticsName());
hotelOrder1.setLogisticsCode(sendLogisticsReq.getLogisticsCode());
hotelOrder1.setStatus(9); hotelOrder1.setStatus(9);
break; break;
} }


Loading…
Cancel
Save