Merge branch 'master' of http://47.115.223.229:8888/yangjun/sadjv3_java
This commit is contained in:
commit
6f4398d058
|
@ -96,22 +96,22 @@ public class UserMoneyServiceImpl extends ServiceImpl<UserMoneyDao, UserMoney> i
|
|||
// }
|
||||
|
||||
//技师获得打赏
|
||||
UserEntity userEntity = userService.queryByUserId(userId);
|
||||
updateMoney(1, artificerId, money.doubleValue());
|
||||
UserMoney userNowMoney2 = selectUserMoneyByUserId(artificerId);
|
||||
UserEntity userEntity = userService.queryByUserId(artificer.getUserId());
|
||||
updateMoney(1, userEntity.getUserId(), money.doubleValue());
|
||||
UserMoney userNowMoney2 = selectUserMoneyByUserId(userEntity.getUserId());
|
||||
UserMoneyDetails userMoneyDetails2 = new UserMoneyDetails();
|
||||
userMoneyDetails2.setBalance(userNowMoney2.getMoney());
|
||||
userMoneyDetails2.setClassify(8);
|
||||
userMoneyDetails2.setManipulateType(2);
|
||||
userMoneyDetails2.setUserId(artificerId);
|
||||
userMoneyDetails2.setUserId(userEntity.getUserId());
|
||||
userMoneyDetails2.setTitle("用户钱包打赏");
|
||||
userMoneyDetails2.setContent("来自用户“"+userEntity.getUserName()+"”钱包打赏:"+money);
|
||||
userMoneyDetails2.setType(1);
|
||||
userMoneyDetails2.setState(2);
|
||||
userMoneyDetails2.setMoney(money);
|
||||
userMoneyDetails2.setCreateTime(sdf.format(new Date()));
|
||||
userMoneyDetails.setBlRole(2);
|
||||
userMoneyDetails.setBlFlag(1);
|
||||
userMoneyDetails2.setBlRole(2);
|
||||
userMoneyDetails2.setBlFlag(1);
|
||||
userMoneyDetailsDao.insert(userMoneyDetails2);
|
||||
|
||||
return Result.success();
|
||||
|
|
|
@ -220,19 +220,27 @@ public class AppArtificerController {
|
|||
return ordersService.updateOrders(orders);
|
||||
}
|
||||
|
||||
|
||||
@Login
|
||||
@GetMapping("/selectOrdersList")
|
||||
@ApiOperation("查询订单列表")
|
||||
public Result selectOrdersList(@RequestAttribute("userId") Long userId,Integer page,Integer limit,Integer status,String city,
|
||||
String userName,String phone,Long artificerId,Long parentId,String startTime,String endTime,
|
||||
Integer isAdd,String ordersNo,String artificerName,
|
||||
public Result selectOrdersList(Long userId,Integer page,Integer limit,Integer status,String city,
|
||||
String name,String phone,Long artificerId,Long parentId,String startTime,
|
||||
String endTime,Integer isAdd,String ordersNo,String artificerName,
|
||||
String oneUserName,String oneArtificerUserName,
|
||||
String startServeTime,String endServeTime,Integer overTimeOrders,
|
||||
Long shopId,String shopName,Integer warning,String title,String classifyId, Long userPackageId){
|
||||
return ordersService.selectOrdersList(userId, page, limit, status, city, userName, phone, artificerId,
|
||||
parentId, startTime, endTime, isAdd, ordersNo, artificerName, oneUserName, oneArtificerUserName,
|
||||
startServeTime, endServeTime,overTimeOrders,shopId,shopName,warning,title,classifyId, userPackageId);
|
||||
String startServeTime,String endServeTime,Integer overTimeOrders,Long shopId,
|
||||
String shopName,Integer warning,String title,String classifyId, Long userPackageId){
|
||||
return ordersService.selectOrdersList(userId, page, limit, status, city, name, phone,
|
||||
artificerId, parentId, startTime, endTime, isAdd, ordersNo, artificerName,
|
||||
oneUserName, oneArtificerUserName, startServeTime, endServeTime,overTimeOrders,shopId,shopName,warning,title,classifyId, userPackageId);
|
||||
}
|
||||
|
||||
@Login
|
||||
@GetMapping("/selectAppOrdersList")
|
||||
@ApiOperation("查询订单列表")
|
||||
public Result selectAppOrdersList(@RequestAttribute("userId") Long userId,
|
||||
Integer page,Integer limit,
|
||||
Integer status,Long userPackageId){
|
||||
return ordersService.selectAppOrdersList(userId, page, limit, status, userPackageId);
|
||||
}
|
||||
|
||||
@Login
|
||||
|
|
|
@ -26,7 +26,9 @@ public interface OrdersDao extends BaseMapper<Orders> {
|
|||
@Param("endTime") String endTime,@Param("isAdd") Integer isAdd,String ordersNo,String artificerName,
|
||||
String oneUserName,String oneArtificerUserName,
|
||||
String startServeTime,String endServeTime,Integer overTimeOrders,Long shopId,String shopName,Integer warning,
|
||||
String title,String classifyId,Long userPackageId);
|
||||
String title,String classifyId,@Param("userPackageId")Long userPackageId);
|
||||
|
||||
IPage<Orders> selectAppOrdersList(Page<Orders> page,@Param("userId") Long userId,@Param("status") Integer status,@Param("userPackageId") Long userPackageId);
|
||||
|
||||
List<Orders> excelOrdersList(@Param("userId") Long userId,@Param("status") Integer status,
|
||||
@Param("city") String city,@Param("userName") String userName,@Param("phone") String phone,
|
||||
|
@ -52,7 +54,7 @@ public interface OrdersDao extends BaseMapper<Orders> {
|
|||
|
||||
int selectCountOrderByUserId(Long userId,Integer status,String time);
|
||||
|
||||
IPage<Orders> selectTodayOrder(Page<Orders> pages,@Param("artificerId") Long artificerId,@Param("type") Integer type,@Param("startTime") String startTime,@Param("endTime") String endTime);
|
||||
IPage<Orders> selectTodayOrder(Page<Orders> pages,@Param("artificerId") Long artificerId,@Param("type") Integer type,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("minutes") Integer minutes);
|
||||
|
||||
IPage<Orders> selectArtificerOrder(Page<Orders> pages, Long userId, Integer status);
|
||||
|
||||
|
@ -132,4 +134,6 @@ public interface OrdersDao extends BaseMapper<Orders> {
|
|||
List<Orders> getDdczList(Long userId, String startTime, String endTime);
|
||||
|
||||
List<Orders> getZxscList(Long userId, String startTime, String endTime);
|
||||
|
||||
List<Orders> getParentOrders(Long parentId);
|
||||
}
|
|
@ -76,6 +76,18 @@ public class Orders implements Serializable {
|
|||
*/
|
||||
private BigDecimal payMoney;
|
||||
|
||||
/**
|
||||
* 实付总金额
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private BigDecimal payMoneyTotal;
|
||||
|
||||
/**
|
||||
* 技师获取总金额
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private BigDecimal artificerMoneyTotal;
|
||||
|
||||
/**
|
||||
* 服务费用
|
||||
*/
|
||||
|
@ -359,6 +371,10 @@ public class Orders implements Serializable {
|
|||
*/
|
||||
private BigDecimal oldMassageMoney;
|
||||
|
||||
/**
|
||||
* 原技师金额
|
||||
*/
|
||||
private BigDecimal oldArtificerMoney;
|
||||
|
||||
/**
|
||||
* 技师完成服务承诺 多个按照逗号分割
|
||||
|
@ -408,12 +424,23 @@ public class Orders implements Serializable {
|
|||
*/
|
||||
private Integer oldMassageDuration;
|
||||
|
||||
/**
|
||||
* 取消描述
|
||||
*/
|
||||
private String cancelRemark;
|
||||
|
||||
/**
|
||||
* 用户钱包支付技师提成百分比
|
||||
*/
|
||||
private BigDecimal walletRate;
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
private String entryName;
|
||||
@TableField(exist = false)
|
||||
private List<OrdersMassage> ordersMassageList;
|
||||
@TableField(exist = false)
|
||||
private List<OrdersMassage> oldOrdersMassageList;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Artificer artificer;
|
||||
|
@ -489,5 +516,8 @@ public class Orders implements Serializable {
|
|||
@TableField(exist = false)
|
||||
private List<CouponUser> couponUserList;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer isCanSupplement;
|
||||
|
||||
public Orders() {}
|
||||
}
|
||||
|
|
|
@ -35,6 +35,8 @@ public interface OrdersService extends IService<Orders> {
|
|||
String startServeTime,String endServeTime,Integer overTimeOrders,Long shopId,
|
||||
String shopName,Integer warning,String title,String classifyId, Long userPackageId);
|
||||
|
||||
Result selectAppOrdersList(Long userId,Integer page,Integer limit,Integer status,Long userPackageId);
|
||||
|
||||
ExcelData excelOrdersList(Long userId,Integer status,String city,
|
||||
String name,String phone,Long artificerId,Long parentId,String startTime,
|
||||
String endTime,Integer isAdd,String ordersNo,String artificerName,
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -251,7 +251,7 @@ public class UserPackageOrderServiceImpl extends ServiceImpl<UserPackageOrderDao
|
|||
upo.setCouponName(couponUser.getCouponName());
|
||||
upo.setCouponMoney(couponUser.getMoney());
|
||||
baseMapper.insertCoupon(upo);
|
||||
//更新用户代金卷表
|
||||
//更新用户代金券表
|
||||
couponUserService.update(Wrappers.<CouponUser>lambdaUpdate().eq(CouponUser::getId, couponUser.getId()).set(CouponUser::getStatus, 1));
|
||||
}
|
||||
userPackageOrder.setCouponUserList(CouponUserList);
|
||||
|
|
|
@ -95,7 +95,7 @@ public class CouponIssueServiceImpl extends ServiceImpl<CouponIssueDao, CouponIs
|
|||
userMoneyDetails.setManipulateType(2);
|
||||
userMoneyDetails.setMoney(couponIssue.getPrice());
|
||||
userMoneyDetails.setUserId(userId);
|
||||
userMoneyDetails.setTitle("零钱购买优惠券,卷包:"+couponIssue.getCouponIssueName());
|
||||
userMoneyDetails.setTitle("零钱购买优惠券,券包:"+couponIssue.getCouponIssueName());
|
||||
userMoneyDetails.setContent("购买优惠券费用:"+couponIssue.getPrice());
|
||||
userMoneyDetails.setType(2);
|
||||
userMoneyDetails.setCreateTime(createTime);
|
||||
|
|
|
@ -458,6 +458,7 @@ public class AliPayController {
|
|||
o.setType("2");
|
||||
o.setUserId(payDetails.getUserId());
|
||||
o.setArtificerId(payDetails.getArtificerId());
|
||||
o.setOrdersId(payDetails.getMassageOrdersId());
|
||||
o.setCreateTime(DateUtils.format(new Date()));
|
||||
userRechargeDao.insert(o);
|
||||
}
|
||||
|
@ -475,7 +476,7 @@ public class AliPayController {
|
|||
userMoneyDetails.setManipulateType(1);
|
||||
userMoneyDetails.setMoney(BigDecimal.valueOf(payDetails.getMoney()));
|
||||
userMoneyDetails.setUserId(payDetails.getUserId());
|
||||
userMoneyDetails.setTitle("微信购买优惠券,卷包:"+couponIssue.getCouponIssueName());
|
||||
userMoneyDetails.setTitle("微信购买优惠券,券包:"+couponIssue.getCouponIssueName());
|
||||
userMoneyDetails.setContent("购买优惠券费用:"+payDetails.getMoney());
|
||||
userMoneyDetails.setCreateTime(DateUtils.format(new Date()));
|
||||
userMoneyDetails.setBlRole(1);
|
||||
|
@ -599,16 +600,16 @@ public class AliPayController {
|
|||
userMoneyDetails.setBlFlag(2);
|
||||
userMoneyDetailsService.save(userMoneyDetails);
|
||||
//技师流水
|
||||
UserEntity userEntity = userService.queryByUserId(payDetails.getUserId());
|
||||
userMoneyDao.updateMayMoney(1, artificerId, money);
|
||||
UserEntity userEntity = userService.queryByUserId(artificer.getUserId());
|
||||
userMoneyDao.updateMayMoney(1, userEntity.getUserId(), money);
|
||||
//查询技师当前余额
|
||||
UserMoney userNowMoney = userMoneyService.selectUserMoneyByUserId(artificerId);
|
||||
UserMoney userNowMoney = userMoneyService.selectUserMoneyByUserId(userEntity.getUserId());
|
||||
UserMoneyDetails userMoneyDetails2 = new UserMoneyDetails();
|
||||
//插入余额
|
||||
userMoneyDetails2.setBalance(userNowMoney.getMoney());
|
||||
userMoneyDetails2.setManipulateType(2);
|
||||
userMoneyDetails2.setClassify(8);
|
||||
userMoneyDetails2.setUserId(artificerId);
|
||||
userMoneyDetails2.setUserId(userEntity.getUserId());
|
||||
userMoneyDetails2.setTitle("用户支付宝打赏");
|
||||
userMoneyDetails2.setContent("来自用户“"+userEntity.getUserName()+"”支付宝打赏:"+money);
|
||||
userMoneyDetails2.setType(1);
|
||||
|
@ -903,7 +904,7 @@ public class AliPayController {
|
|||
// return payH5(name, generalOrder, payClassify.getPrice().doubleValue(), returnUrl);
|
||||
// }
|
||||
// }
|
||||
public Result payOrderMoney(@RequestAttribute Long userId, Long payClassifyId, Integer type, Long artificerId) {
|
||||
public Result payOrderMoney(@RequestAttribute Long userId, Long payClassifyId, Integer type, Long artificerId, Long ordersId) {
|
||||
//通知页面地址
|
||||
CommonInfo one = commonInfoService.findOne(19);
|
||||
String returnUrl = one.getValue() + "/#/pages/my/index";
|
||||
|
@ -921,6 +922,7 @@ public class AliPayController {
|
|||
payDetails.setType(3);
|
||||
payDetails.setArtificerId(artificerId);
|
||||
payDetails.setRemark(String.valueOf(payClassifyId));
|
||||
payDetails.setMassageOrdersId(ordersId);
|
||||
payDetailsDao.insert(payDetails);
|
||||
payOrderResult(generalOrder);
|
||||
return Result.success();
|
||||
|
@ -1217,6 +1219,7 @@ public class AliPayController {
|
|||
o.setType("2");
|
||||
o.setUserId(payDetails.getUserId());
|
||||
o.setArtificerId(payDetails.getArtificerId());
|
||||
o.setOrdersId(payDetails.getMassageOrdersId());
|
||||
o.setCreateTime(DateUtils.format(new Date()));
|
||||
userRechargeDao.insert(o);
|
||||
}
|
||||
|
@ -1235,7 +1238,7 @@ public class AliPayController {
|
|||
userMoneyDetails.setManipulateType(1);
|
||||
userMoneyDetails.setMoney(BigDecimal.valueOf(payDetails.getMoney()));
|
||||
userMoneyDetails.setUserId(payDetails.getUserId());
|
||||
userMoneyDetails.setTitle("微信购买优惠券,卷包:"+couponIssue.getCouponIssueName());
|
||||
userMoneyDetails.setTitle("微信购买优惠券,券包:"+couponIssue.getCouponIssueName());
|
||||
userMoneyDetails.setContent("购买优惠券费用:"+payDetails.getMoney());
|
||||
userMoneyDetails.setCreateTime(DateUtils.format(new Date()));
|
||||
userMoneyDetails.setBlRole(1);
|
||||
|
@ -1456,7 +1459,7 @@ public class AliPayController {
|
|||
}
|
||||
|
||||
@Login
|
||||
@ApiOperation("支付宝购买卷包")
|
||||
@ApiOperation("支付宝购买券包")
|
||||
@RequestMapping(value = "/payCoupon", method = RequestMethod.POST)
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Result payCoupon(@RequestAttribute Long userId, Integer classify,Long couponIssueId) {
|
||||
|
|
|
@ -37,8 +37,8 @@ public class ApiWeiXinPayController {
|
|||
@Login
|
||||
@ApiOperation("微信充值余额")
|
||||
@PostMapping("/payMoney")
|
||||
public Result payMoney(@RequestAttribute("userId") Long userId,Long payClassifyId,Integer type,Long artificerId,HttpServletRequest request) throws Exception {
|
||||
return wxService.payMoney(userId,payClassifyId,type,artificerId,request);
|
||||
public Result payMoney(@RequestAttribute("userId") Long userId,Long payClassifyId,Integer type,Long artificerId,Long ordersId, HttpServletRequest request) throws Exception {
|
||||
return wxService.payMoney(userId,payClassifyId,type,artificerId,ordersId,request);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@ public class AppPayClassifyController {
|
|||
sb.append(" ");
|
||||
}
|
||||
List<PayClassifyDetail> detailList = payClassifyDetailService.findList(payClassify.getPayClassifyId());
|
||||
payClassify.setDetailList(detailList);
|
||||
for(PayClassifyDetail classifyDetail : detailList){
|
||||
Integer giveNum = classifyDetail.getGiveNum();
|
||||
sb.append(giveNum);
|
||||
|
@ -57,7 +58,7 @@ public class AppPayClassifyController {
|
|||
Coupon coupon = classifyDetail.getCoupon();
|
||||
BigDecimal couponMoney = coupon.getMoney();
|
||||
sb.append(couponMoney);
|
||||
sb.append("元卷");
|
||||
sb.append("元券");
|
||||
sb.append(" ");
|
||||
BigDecimal sumCouponMoney = couponMoney.multiply(new BigDecimal(giveNum));
|
||||
sumMoney = sumMoney.add(sumCouponMoney);
|
||||
|
|
|
@ -76,6 +76,11 @@ public class PayDetails implements Serializable {
|
|||
*/
|
||||
private Long artificerId;
|
||||
|
||||
/**
|
||||
* 服务项目订单ID
|
||||
*/
|
||||
private Long massageOrdersId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String refundContent;
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import java.math.BigDecimal;
|
|||
*/
|
||||
public interface WxService {
|
||||
|
||||
Result payMoney(Long userId, Long payClassifyId, Integer classify, Long artificerId, HttpServletRequest request) throws Exception;
|
||||
Result payMoney(Long userId, Long payClassifyId, Integer classify, Long artificerId, Long ordersId, HttpServletRequest request) throws Exception;
|
||||
|
||||
Result payOrder(Long id, Integer type,HttpServletRequest request) throws Exception;
|
||||
|
||||
|
|
|
@ -136,7 +136,7 @@ public class WxServiceImpl implements WxService {
|
|||
private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
@Override
|
||||
public Result payMoney(Long userId,Long payClassifyId,Integer classify, Long artificerId,HttpServletRequest request) throws Exception {
|
||||
public Result payMoney(Long userId,Long payClassifyId,Integer classify, Long artificerId, Long ordersId,HttpServletRequest request) throws Exception {
|
||||
PayClassify payClassify = payClassifyService.getById(payClassifyId);
|
||||
String generalOrder = getGeneralOrder();
|
||||
PayDetails payDetails = new PayDetails();
|
||||
|
@ -149,6 +149,7 @@ public class WxServiceImpl implements WxService {
|
|||
payDetails.setType(3);
|
||||
payDetails.setArtificerId(artificerId);
|
||||
payDetails.setRemark(String.valueOf(payClassifyId));
|
||||
payDetails.setMassageOrdersId(ordersId);
|
||||
payDetailsDao.insert(payDetails);
|
||||
//用户在服务中充值余额,算技师业绩增加userRecharge表, modify 2024-06-17 by caolei 改到支付成功后技师获取积分
|
||||
//查询用户在服务中的技师的订单id
|
||||
|
@ -931,6 +932,7 @@ public class WxServiceImpl implements WxService {
|
|||
o.setType("2");
|
||||
o.setUserId(payDetails.getUserId());
|
||||
o.setArtificerId(payDetails.getArtificerId());
|
||||
o.setOrdersId(payDetails.getMassageOrdersId());
|
||||
o.setCreateTime(DateUtils.format(new Date()));
|
||||
userRechargeDao.insert(o);
|
||||
}
|
||||
|
@ -948,7 +950,7 @@ public class WxServiceImpl implements WxService {
|
|||
userMoneyDetails.setManipulateType(1);
|
||||
userMoneyDetails.setMoney(BigDecimal.valueOf(payDetails.getMoney()));
|
||||
userMoneyDetails.setUserId(payDetails.getUserId());
|
||||
userMoneyDetails.setTitle("微信购买优惠券,卷包:"+couponIssue.getCouponIssueName());
|
||||
userMoneyDetails.setTitle("微信购买优惠券,券包:"+couponIssue.getCouponIssueName());
|
||||
userMoneyDetails.setContent("购买优惠券费用:"+payDetails.getMoney());
|
||||
userMoneyDetails.setCreateTime(DateUtils.format(new Date()));
|
||||
userMoneyDetails.setBlRole(1);
|
||||
|
@ -1072,16 +1074,16 @@ public class WxServiceImpl implements WxService {
|
|||
userMoneyDetails.setBlFlag(2);
|
||||
userMoneyDetailsService.save(userMoneyDetails);
|
||||
//技师流水
|
||||
UserEntity userEntity = userService.queryByUserId(payDetails.getUserId());
|
||||
userMoneyDao.updateMayMoney(1, artificerId, money);
|
||||
UserEntity userEntity = userService.queryByUserId(artificer.getUserId());
|
||||
userMoneyDao.updateMayMoney(1, userEntity.getUserId(), money);
|
||||
//查询技师当前余额
|
||||
UserMoney userNowMoney = userMoneyService.selectUserMoneyByUserId(artificerId);
|
||||
UserMoney userNowMoney = userMoneyService.selectUserMoneyByUserId(userEntity.getUserId());
|
||||
UserMoneyDetails userMoneyDetails2 = new UserMoneyDetails();
|
||||
//插入余额
|
||||
userMoneyDetails2.setBalance(userNowMoney.getMoney());
|
||||
userMoneyDetails2.setManipulateType(2);
|
||||
userMoneyDetails2.setClassify(8);
|
||||
userMoneyDetails2.setUserId(artificerId);
|
||||
userMoneyDetails2.setUserId(userEntity.getUserId());
|
||||
userMoneyDetails2.setTitle("用户微信打赏");
|
||||
userMoneyDetails2.setContent("来自用户“"+userEntity.getUserName()+"”微信打赏:"+money);
|
||||
userMoneyDetails2.setType(1);
|
||||
|
|
|
@ -373,6 +373,82 @@
|
|||
order by o.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectAppOrdersList" resultType="com.sqx.modules.artificer.entity.Orders">
|
||||
select o1.*,
|
||||
(case when o1.status = 4
|
||||
then o1.pay_money + ifnull(o1.add_money,0)
|
||||
else o1.pay_money + ifnull(o1.add_money,0) + ifnull(o2.pay_money,0) + ifnull(o2.add_money,0)
|
||||
end) as pay_money_total,
|
||||
(case when o1.status = 4
|
||||
then o1.artificer_money + ifnull(o1.add_artificer_money,0)
|
||||
else o1.artificer_money + ifnull(o1.add_artificer_money,0) + ifnull(o2.artificer_money,0) + ifnull(o2.add_artificer_money,0)
|
||||
end) as artificer_money_total,
|
||||
a.artificer_name as artificerName,a.artificer_img as artificerImg,
|
||||
a.user_id as artificerUserId,c.consortia_name as shopName,c.address as shopAddress,
|
||||
c.phone as shopPhone
|
||||
from orders o1
|
||||
left join orders o2 on o1.old_orders_id = o2.orders_id and o2.status != 4
|
||||
left join artificer a on a.artificer_id=o1.artificer_id
|
||||
left join tb_user u on u.user_id=o1.user_id
|
||||
left join consortia c on c.consortia_id=o1.consortia_id
|
||||
where o1.old_orders_id is not null
|
||||
and o1.status != 11
|
||||
<if test="userPackageId!=null">
|
||||
and o1.user_package_id = #{userPackageId}
|
||||
</if>
|
||||
<if test="userId!=null">
|
||||
and o1.user_id=#{userId}
|
||||
</if>
|
||||
<if test="status!=null and status!=0 and status!=-1 and status!=2">
|
||||
and o1.status=#{status}
|
||||
</if>
|
||||
<if test="status!=null and status==2">
|
||||
and o1.status in (2,9)
|
||||
</if>
|
||||
union all
|
||||
select o1.*,
|
||||
(o1.pay_money + ifnull(o1.add_money,0)) as pay_money_total,
|
||||
(o1.artificer_money + ifnull(o1.add_artificer_money,0)) as artificer_money_total,
|
||||
a.artificer_name as artificerName,a.artificer_img as artificerImg,
|
||||
a.user_id as artificerUserId,c.consortia_name as shopName,c.address as shopAddress,
|
||||
c.phone as shopPhone
|
||||
from orders o1
|
||||
left join artificer a on a.artificer_id=o1.artificer_id
|
||||
left join tb_user u on u.user_id=o1.user_id
|
||||
left join consortia c on c.consortia_id=o1.consortia_id
|
||||
where o1.parent_id = 0
|
||||
and o1.status != 11
|
||||
and o1.orders_id not in (
|
||||
select orders_id from orders
|
||||
where old_orders_id is not null
|
||||
<if test="userPackageId!=null">
|
||||
and o1.user_package_id = #{userPackageId}
|
||||
</if>
|
||||
<if test="userId!=null">
|
||||
and o1.user_id=#{userId}
|
||||
</if>
|
||||
<if test="status!=null and status!=0 and status!=-1 and status!=2">
|
||||
and o1.status=#{status}
|
||||
</if>
|
||||
<if test="status!=null and status==2">
|
||||
and o1.status in (2,9)
|
||||
</if>
|
||||
)
|
||||
<if test="userPackageId!=null">
|
||||
and o1.user_package_id = #{userPackageId}
|
||||
</if>
|
||||
<if test="userId!=null">
|
||||
and o1.user_id=#{userId}
|
||||
</if>
|
||||
<if test="status!=null and status!=0 and status!=-1 and status!=2">
|
||||
and o1.status=#{status}
|
||||
</if>
|
||||
<if test="status!=null and status==2">
|
||||
and o1.status in (2,9)
|
||||
</if>
|
||||
order by serve_time desc
|
||||
</select>
|
||||
|
||||
<select id="excelOrdersList" resultType="com.sqx.modules.artificer.entity.Orders">
|
||||
select o.*,a.artificer_name as artificerName,a.artificer_img as artificerImg,
|
||||
a.user_id as artificerUserId,c.consortia_name as shopName,c.address as shopAddress,
|
||||
|
@ -580,13 +656,21 @@
|
|||
</select>
|
||||
|
||||
<select id="selectTodayOrder" resultType="com.sqx.modules.artificer.entity.Orders">
|
||||
select o.*,m.title,m.massage_img as massageImg from orders o
|
||||
select o.*,m.title,m.massage_img as massageImg,
|
||||
now() > DATE_ADD(STR_TO_DATE(o.serve_time, '%Y-%m-%d %H:%i'), INTERVAL #{minutes} MINUTE) as is_can_supplement,
|
||||
(case when o.status = 4
|
||||
then o.artificer_money + ifnull(o.add_artificer_money,0)
|
||||
else o.artificer_money + ifnull(o.add_artificer_money,0) + ifnull(o2.artificer_money,0) + ifnull(o2.add_artificer_money,0)
|
||||
end) as artificer_money_total
|
||||
from orders o
|
||||
left join orders o2 on o.old_orders_id = o2.orders_id and o2.status != 4
|
||||
left join orders_massage om on om.orders_id=o.orders_id
|
||||
left join massage_type m on m.massage_type_id=om.massage_id
|
||||
where o.artificer_id = #{artificerId} and o.parent_id = 0
|
||||
where o.artificer_id = #{artificerId}
|
||||
and o.old_orders_id is not null
|
||||
and o.status != 11
|
||||
<if test="type==1">
|
||||
and date_format(o.serve_time,'%Y-%m-%d') = date_format(now(),'%Y-%m-%d') and o.status in (2,3,5,6,7,8,9)
|
||||
|
||||
</if>
|
||||
<if test="type==2">
|
||||
and o.status=2
|
||||
|
@ -618,7 +702,88 @@
|
|||
<if test="type==5">
|
||||
and date_format(o.serve_time,'%Y-%m-%d') = date_format(now(),'%Y-%m-%d') and o.status=2
|
||||
</if>
|
||||
order by o.serve_time desc
|
||||
|
||||
union all
|
||||
select o.*,m.title,m.massage_img as massageImg,
|
||||
now() > DATE_ADD(STR_TO_DATE(o.serve_time, '%Y-%m-%d %H:%i'), INTERVAL #{minutes} MINUTE) as is_can_supplement,
|
||||
o.artificer_money + ifnull(o.add_artificer_money,0) as artificer_money_total
|
||||
from orders o
|
||||
left join orders_massage om on om.orders_id=o.orders_id
|
||||
left join massage_type m on m.massage_type_id=om.massage_id
|
||||
where o.artificer_id = #{artificerId}
|
||||
and o.parent_id = 0
|
||||
and o.status != 11
|
||||
and o.orders_id not in (
|
||||
select orders_id from orders
|
||||
where old_orders_id is not null
|
||||
<if test="type==1">
|
||||
and date_format(serve_time,'%Y-%m-%d') = date_format(now(),'%Y-%m-%d') and status in (2,3,5,6,7,8,9)
|
||||
</if>
|
||||
<if test="type==2">
|
||||
and status=2
|
||||
<if test="startTime!=null and startTime!=''">
|
||||
and date_format(serve_time,'%Y-%m-%d') >= date_format(#{startTime},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="endTime!=null and endTime!=''">
|
||||
and date_format(serve_time,'%Y-%m-%d') <= date_format(#{endTime},'%Y-%m-%d')
|
||||
</if>
|
||||
</if>
|
||||
<if test="type==3">
|
||||
and status in (3,5)
|
||||
<if test="startTime!=null and startTime!=''">
|
||||
and date_format(serve_time,'%Y-%m-%d') >= date_format(#{startTime},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="endTime!=null and endTime!=''">
|
||||
and date_format(serve_time,'%Y-%m-%d') <= date_format(#{endTime},'%Y-%m-%d')
|
||||
</if>
|
||||
</if>
|
||||
<if test="type==4">
|
||||
and status in (2,3,4,5,6,7,8)
|
||||
<if test="startTime!=null and startTime!=''">
|
||||
and date_format(serve_time,'%Y-%m-%d') >= date_format(#{startTime},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="endTime!=null and endTime!=''">
|
||||
and date_format(serve_time,'%Y-%m-%d') <= date_format(#{endTime},'%Y-%m-%d')
|
||||
</if>
|
||||
</if>
|
||||
<if test="type==5">
|
||||
and date_format(serve_time,'%Y-%m-%d') = date_format(now(),'%Y-%m-%d') and status=2
|
||||
</if>
|
||||
)
|
||||
<if test="type==1">
|
||||
and date_format(o.serve_time,'%Y-%m-%d') = date_format(now(),'%Y-%m-%d') and o.status in (2,3,5,6,7,8,9)
|
||||
</if>
|
||||
<if test="type==2">
|
||||
and o.status=2
|
||||
<if test="startTime!=null and startTime!=''">
|
||||
and date_format(o.serve_time,'%Y-%m-%d') >= date_format(#{startTime},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="endTime!=null and endTime!=''">
|
||||
and date_format(o.serve_time,'%Y-%m-%d') <= date_format(#{endTime},'%Y-%m-%d')
|
||||
</if>
|
||||
</if>
|
||||
<if test="type==3">
|
||||
and o.status in (3,5)
|
||||
<if test="startTime!=null and startTime!=''">
|
||||
and date_format(o.serve_time,'%Y-%m-%d') >= date_format(#{startTime},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="endTime!=null and endTime!=''">
|
||||
and date_format(o.serve_time,'%Y-%m-%d') <= date_format(#{endTime},'%Y-%m-%d')
|
||||
</if>
|
||||
</if>
|
||||
<if test="type==4">
|
||||
and o.status in (2,3,4,5,6,7,8)
|
||||
<if test="startTime!=null and startTime!=''">
|
||||
and date_format(o.serve_time,'%Y-%m-%d') >= date_format(#{startTime},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="endTime!=null and endTime!=''">
|
||||
and date_format(o.serve_time,'%Y-%m-%d') <= date_format(#{endTime},'%Y-%m-%d')
|
||||
</if>
|
||||
</if>
|
||||
<if test="type==5">
|
||||
and date_format(o.serve_time,'%Y-%m-%d') = date_format(now(),'%Y-%m-%d') and o.status=2
|
||||
</if>
|
||||
order by serve_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectArtificerOrder" resultType="com.sqx.modules.artificer.entity.Orders">
|
||||
|
@ -1075,6 +1240,12 @@
|
|||
GROUP BY DATE_FORMAT(create_time,'%Y-%m-%d')
|
||||
</select>
|
||||
|
||||
<select id="getParentOrders" resultType="com.sqx.modules.artificer.entity.Orders">
|
||||
select o.*
|
||||
from orders o
|
||||
where parent_id = #{parentId}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue