Commit 6d3c274f by caiyt

完善需求功能及修复bug

parent b0288c32
......@@ -4,13 +4,17 @@ import com.soss.common.core.controller.BaseController;
import com.soss.common.core.domain.AjaxResult;
import com.soss.common.core.domain.model.LoginUser;
import com.soss.common.core.page.TableDataInfo;
import com.soss.common.exception.ServiceException;
import com.soss.common.utils.StringUtils;
import com.soss.common.utils.spring.SpringUtils;
import com.soss.framework.web.service.TokenService;
import com.soss.system.domain.Customer;
import com.soss.system.domain.Order;
import com.soss.system.domain.vo.customer.CustomerQueryVo;
import com.soss.system.domain.vo.customer.CustomerResultVo;
import com.soss.system.service.ICustomerService;
import com.soss.system.service.impl.CustomerServiceImpl;
import io.jsonwebtoken.lang.Assert;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
......@@ -18,6 +22,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Objects;
/**
* 用户信息Controller
......@@ -36,11 +41,52 @@ public class CustomerController extends BaseController
@GetMapping("/allow")
public AjaxResult allow(HttpServletRequest request,String allow){
public AjaxResult allow(HttpServletRequest request, String allow) {
TokenService bean = SpringUtils.getBean(TokenService.class);
LoginUser loginUser = bean.getLoginUser(request);
return AjaxResult.success(SpringUtils.getBean(CustomerServiceImpl.class).allow(loginUser.getOpenId(),allow));
return AjaxResult.success(SpringUtils.getBean(CustomerServiceImpl.class).allow(loginUser.getOpenId(), allow));
}
@GetMapping("/detail")
@ApiOperation("查询用户详细信息")
public AjaxResult updateCust(HttpServletRequest request) {
LoginUser loginUser = tokenService.getLoginUser(request);
if (loginUser == null) {
throw new ServiceException("请先登录");
}
Customer customer = customerService.selectCustById(loginUser.getOpenId());
return AjaxResult.success(customer);
}
@PostMapping("/update/base")
@ApiOperation("修改用户基本信息:昵称和性别")
public AjaxResult updateCust(HttpServletRequest request, @RequestBody Customer customer) {
custPmsCheck(request, customer.getId());
Assert.isTrue(!StringUtils.isEmpty(customer.getUserName()), "昵称未传递");
Assert.isTrue(customer.getUserName().length() <= 7, "昵称最多七个字");
Assert.notNull(customer.getSex(), "性别还未传递");
Assert.isNull(customer.getBirthday(), "该方法不支持修改生日");
customerService.updateCustomer(customer);
return AjaxResult.success();
}
@PostMapping("/update/birth")
@ApiOperation("修改用户生日")
public AjaxResult updateCustBirth(HttpServletRequest request, @RequestBody Customer customer) {
custPmsCheck(request, customer.getId());
Assert.notNull(customer.getBirthday(), "生日还未传递");
customerService.updateCustBirthday(customer);
return AjaxResult.success();
}
private void custPmsCheck(HttpServletRequest request, String custId) {
Assert.isTrue(!StringUtils.isEmpty(custId), "用户id未传递");
LoginUser loginUser = tokenService.getLoginUser(request);
if (loginUser == null) {
throw new ServiceException("请先登录");
}
Assert.isTrue(Objects.equals(custId, loginUser.getOpenId()), "不能修改他人信息");
}
/**
......@@ -48,8 +94,7 @@ public class CustomerController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('system:customer:list')")
@GetMapping("/list")
public TableDataInfo list(CustomerQueryVo customerQueryVo)
{
public TableDataInfo list(CustomerQueryVo customerQueryVo) {
startPage();
List<CustomerResultVo> list = customerService.selectCustomerList(customerQueryVo);
return getDataTable(list);
......
......@@ -83,12 +83,16 @@ public class OrderController extends BaseController {
return AjaxResult.error("未授权地理位置不允许下单");
}
if (order.getSendMsgFlag1() == null || order.getSendMsgFlag2() == null || order.getSendMsgFlag3() == null) {
return AjaxResult.error("授权发送消息权限未传递");
}
AjaxResult result = check(order);
if (HttpStatus.SUCCESS != (int) result.get(result.CODE_TAG)) {
return result;
}
try {
orderService.checkBusinessTime(order.getShopId());
orderService.checkShopInfo(order);
if (order.getCouponId() != null) {
List<CouponVo> couponVos = couponUserService.listCustAvailableCoupon(loginUser.getOpenId(), order.getCouponId());
if (CollectionUtils.isEmpty(couponVos)) {
......@@ -131,7 +135,7 @@ public class OrderController extends BaseController {
Order order = orderService.selectOrderById(orderId);
order.setOrderNo(orderService.getOrderNo(order.getSource()));
orderService.updateOrder(order);
int amount = order.getAmount().movePointRight(2).intValue();
int amount = order.getPaidAmount().movePointRight(2).intValue();
Map payInfo = weixinService.pay(request, "hooloo", order.getOrderNo(), order.getUserId(), amount);
if (payInfo != null) {
return AjaxResult.success(payInfo);
......
......@@ -6,6 +6,7 @@ import com.soss.common.core.domain.AjaxResult;
import com.soss.common.core.domain.model.LoginUser;
import com.soss.common.core.page.TableDataInfo;
import com.soss.common.enums.BusinessType;
import com.soss.common.enums.RefundState;
import com.soss.framework.web.service.TokenService;
import com.soss.framework.web.service.WeixinServiceImpl;
import com.soss.system.domain.Order;
......@@ -13,6 +14,7 @@ import com.soss.system.domain.OrderRefund;
import com.soss.system.domain.vo.OrderQuery;
import com.soss.system.service.IOrderRefundService;
import com.soss.system.service.impl.OrderServiceImpl;
import io.jsonwebtoken.lang.Assert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
......@@ -66,27 +68,28 @@ public class OrderRefundController extends BaseController
*/
@Log(title = "订单退款", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(HttpServletRequest request, @RequestBody OrderRefund orderRefund)
{
public AjaxResult add(HttpServletRequest request, @RequestBody OrderRefund orderRefund) {
Assert.notNull(orderRefund.getRefundAmount(), "退款金额还未传递");
Assert.notEmpty(orderRefund.getOrderDetailIds(), "退款订单明细ID还未传递");
LoginUser loginUser = tokenService.getLoginUser(request);
orderRefund.setCreateUserName(loginUser.getUsername());
AjaxResult ajaxResult = orderRefundService.insertOrderRefund(orderRefund);
Object obejct = ajaxResult.get(AjaxResult.DATA_TAG);
if(obejct!=null && obejct instanceof OrderRefund){
if (obejct instanceof OrderRefund) {
OrderRefund orderRefund1 = (OrderRefund) obejct;
if("0".equals(orderRefund1.getState())){
if (RefundState.PENDING.getState().equals(orderRefund1.getState())) {
int totalFee = orderRefund1.getTotalFee().movePointRight(2).intValue();
int refundAmount = orderRefund1.getRefundAmount().movePointRight(2).intValue();
weixinService.refund(orderRefund1.getOrderNo(),orderRefund1.getRefundNo(),totalFee,refundAmount);
orderRefund1.setState("1");
weixinService.refund(orderRefund1.getOrderNo(), orderRefund1.getRefundNo(), totalFee, refundAmount);
orderRefund1.setState(RefundState.REFUNDING.getState());
orderRefundService.updateOrderRefund(orderRefund1);
}
}
return ajaxResult;
}
@PostMapping("/refund")
public void refund(){
Order order = orderService.selectOrderById("98");
......
......@@ -4,9 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.soss.common.constant.Constants;
import com.soss.common.core.domain.AjaxResult;
import com.soss.framework.web.service.WeixinServiceImpl;
import com.soss.system.mapper.OrderMapper;
import com.soss.system.service.impl.AppServiceImpl;
import com.soss.system.service.impl.OrderServiceImpl;
import com.soss.system.service.impl.OrderTakingServiceImpl;
import com.soss.system.utils.SendSmsUtil;
import lombok.extern.slf4j.Slf4j;
......@@ -28,10 +26,6 @@ public class WeixinController {
private AppServiceImpl appService;
@Autowired
private OrderTakingServiceImpl orderTakingService;
@Autowired
private OrderMapper orderMapper;
@Autowired
private OrderServiceImpl orderService;
//这个就是那个使用传code进来的接口
@PostMapping("/login")
......
......@@ -47,7 +47,7 @@ public class CouponCategoryController extends BaseController {
* 更新优惠券类别
*/
@PreAuthorize("@ss.hasPermi('coupon:category:update')")
@Log(title = "更新优惠券类别", businessType = BusinessType.INSERT)
@Log(title = "更新优惠券类别", businessType = BusinessType.UPDATE)
@PostMapping("update")
@ApiOperation("更新优惠券类别")
public AjaxResult update(@RequestBody CouponCategory couponCategory) {
......@@ -59,7 +59,6 @@ public class CouponCategoryController extends BaseController {
* 查询优惠券类别列表
*/
@PreAuthorize("@ss.hasPermi('coupon:category:list')")
@Log(title = "查询优惠券类别列表", businessType = BusinessType.INSERT)
@PostMapping
@ApiOperation("查询优惠券类别列表")
public TableDataInfo listCouponCategory(@RequestBody CouponCategory couponCategory) {
......@@ -72,7 +71,7 @@ public class CouponCategoryController extends BaseController {
* 上架优惠券类别状态
*/
@PreAuthorize("@ss.hasPermi('coupon:category:online')")
@Log(title = "上架优惠券类别", businessType = BusinessType.INSERT)
@Log(title = "上架优惠券类别", businessType = BusinessType.UPDATE)
@GetMapping("/online/{id}")
@ApiOperation("上架优惠券类别状态")
public AjaxResult switchState(@PathVariable Integer id) {
......@@ -84,7 +83,7 @@ public class CouponCategoryController extends BaseController {
* 下架优惠券类别状态
*/
@PreAuthorize("@ss.hasPermi('coupon:category:offline')")
@Log(title = "下架优惠券类别", businessType = BusinessType.INSERT)
@Log(title = "下架优惠券类别", businessType = BusinessType.UPDATE)
@GetMapping("/offline/{id}")
@ApiOperation("下架优惠券类别状态")
public AjaxResult offlineCouponCategory(@PathVariable Integer id) {
......@@ -96,7 +95,7 @@ public class CouponCategoryController extends BaseController {
* 删除优惠券类别状态
*/
@PreAuthorize("@ss.hasPermi('coupon:category:delete')")
@Log(title = "删除优惠券类别", businessType = BusinessType.INSERT)
@Log(title = "删除优惠券类别", businessType = BusinessType.DELETE)
@DeleteMapping("/{id}")
@ApiOperation("删除优惠券类别状态")
public AjaxResult deleteCouponCategory(@PathVariable Integer id) {
......
......@@ -8,9 +8,11 @@ import com.soss.common.core.page.TableDataInfo;
import com.soss.common.enums.BusinessType;
import com.soss.common.enums.CouponUserState;
import com.soss.common.enums.CouponUserType;
import com.soss.common.enums.MessageType;
import com.soss.system.domain.CouponUser;
import com.soss.system.domain.vo.CouponUserVo;
import com.soss.system.service.ICouponUserService;
import com.soss.system.service.IWechatMessageService;
import io.jsonwebtoken.lang.Assert;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -37,6 +39,8 @@ import java.util.List;
public class CouponUserController extends BaseController {
@Autowired
private ICouponUserService couponUserService;
@Autowired
private IWechatMessageService wechatMessageService;
/**
* 赠送优惠券
......@@ -49,6 +53,7 @@ public class CouponUserController extends BaseController {
Assert.notNull(couponUser.getCustId(), "用户ID未传递");
Assert.notNull(couponUser.getCouponId(), "优惠券ID未传递");
couponUserService.giveUserCoupon(couponUser.getCustId(), couponUser.getCouponId());
wechatMessageService.insertWechatMessage(couponUser.getCustId(), 0L, MessageType.COUPON.getType(), "HOOLOO券到账通知,收到新的HOOLOO券啦,快来领取吧");
return AjaxResult.success();
}
......
......@@ -82,12 +82,12 @@ weixin:
secret: da8a0b08436dd3ce560be429f14e768a
mchid: 1625511257
key: WcCsQZXavaPXQEKuTGJlGOkzzTPxTPsr
notify-url: https://hooloo-api.gdatac.com/weixin/native/notify
notify-url: https://hooloo-dev-api.gdatac.com/weixin/native/notify
trade-type: JSAPI
url: https://api.mch.weixin.qq.com/pay/unifiedorder
query-url: https://api.mch.weixin.qq.com/pay/orderquery
cert-path: classpath:apiclient_cert.p12
refund-url: https://hooloo-api.gdatac.com/weixin/refundNotify
refund-url: https://hooloo-dev-api.gdatac.com/weixin/refundNotify
templateId: Fu_CPIXa0cnJ4EDdVKqFQ4T3qTxBqv8vXMU7-sQgerg
pagePath: orderSubPackage/pages/orderInfo/index?orderId=
program: trial
......
package com.soss.common.enums;
/**
* 机器状态枚举类
*/
public enum MachineState {
INIT(0, "初始状态"),
TO_BE_INIT(1, "待初始化"),
TO_BE_BIND(2, "待绑定店铺"),
TO_BE_TEST(3, "待运营测试"),
RUNNING(4, "运行中"),
STANDBY(5, "待机中"),
SHUTDOWN(6, "关闭"),
OPERATING(7, "运维中"),
RETURN_FACTORY(8, "返厂");
private Integer state;
private String desc;
MachineState(Integer state, String desc) {
this.state = state;
this.desc = desc;
}
public Integer getState() {
return state;
}
public static String getDesc(Integer state) {
for (MachineState machineState : MachineState.values()) {
if (machineState.state.equals(state)) {
return machineState.desc;
}
}
return null;
}
}
package com.soss.common.enums;
/**
* 消息发送状态枚举类
*/
public enum MessageState {
TO_BE_SEND(0, "待发送"),
SENDING(1, "发送中"),
SUCCESS(2, "成功"),
FAILURE(3, "失败");
private Integer state;
private String desc;
MessageState(Integer state, String desc) {
this.state = state;
this.desc = desc;
}
public Integer getState() {
return state;
}
public static String getDesc(Integer state) {
for (MessageState messageState : MessageState.values()) {
if (messageState.state.equals(state)) {
return messageState.desc;
}
}
return null;
}
}
package com.soss.common.enums;
/**
* 消息类型枚举类
*/
public enum MessageType {
ORDER(1, "取餐消息"),
BONUS(2, "积分消息"),
COUPON(3, "优惠券消息");
private Integer type;
private String desc;
MessageType(Integer type, String desc) {
this.type = type;
this.desc = desc;
}
public Integer getType() {
return type;
}
public static String getDesc(Integer state) {
for (MessageType messageType : MessageType.values()) {
if (messageType.type.equals(state)) {
return messageType.desc;
}
}
return null;
}
}
package com.soss.common.enums;
/**
* 退款状态枚举类
*/
public enum RefundState {
PENDING(0, "待退款"),
REFUNDING(1, "退款中"),
SUCCESS(2, "退款成功"),
FAILURE(3, "退款失败");
private Integer state;
private String desc;
RefundState(Integer state, String desc) {
this.state = state;
this.desc = desc;
}
public Integer getState() {
return state;
}
public static String getDesc(Integer state) {
for (RefundState refundState : RefundState.values()) {
if (refundState.state.equals(state)) {
return refundState.desc;
}
}
return null;
}
}
package com.soss.framework.web.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONPath;
import com.github.binarywang.wxpay.bean.notify.WxPayNotifyResponse;
import com.github.binarywang.wxpay.bean.notify.WxPayRefundNotifyResult;
......@@ -13,13 +11,11 @@ import com.github.binarywang.wxpay.bean.result.WxPayRefundResult;
import com.github.binarywang.wxpay.bean.result.WxPayUnifiedOrderResult;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.github.binarywang.wxpay.service.WxPayService;
import com.github.wxpay.sdk.WXPayUtil;
import com.soss.common.core.domain.entity.SysUser;
import com.soss.common.core.domain.model.LoginUser;
import com.soss.common.enums.RefundState;
import com.soss.common.exception.ServiceException;
import com.soss.common.utils.QRCodeUtil;
import com.soss.common.utils.StringUtils;
import com.soss.common.utils.ip.IpUtils;
import com.soss.common.utils.sign.Base64;
......@@ -27,8 +23,7 @@ import com.soss.system.constants.OrderStatusConstant;
import com.soss.system.domain.*;
import com.soss.system.jiguang.impl.JiGuangPushServiceImpl;
import com.soss.system.mapper.CustomerMapper;
import com.soss.system.mapper.OrderMapper;
import com.soss.system.mapper.OrderDetailMapper;
import com.soss.system.mapper.OrderRefundMapper;
import com.soss.system.mapper.ShopMapper;
import com.soss.system.service.IWechatMessageService;
......@@ -37,25 +32,19 @@ import com.soss.system.service.impl.MachineApiServiceImpl;
import com.soss.system.service.impl.OrderOperationLogServiceImpl;
import com.soss.system.service.impl.OrderServiceImpl;
import com.soss.system.weixin.entity.OrderInfo;
import com.soss.system.weixin.entity.QueryReturnInfo;
import com.soss.system.weixin.util.RandomStringGenerator;
import com.soss.system.weixin.util.SendMessageUtils;
import com.soss.system.weixin.util.Signature;
import com.thoughtworks.xstream.XStream;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.core.io.support.ResourcePatternResolver;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.web.JsonPath;
import org.springframework.stereotype.Service;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.client.RestTemplate;
import javax.annotation.PostConstruct;
......@@ -63,10 +52,12 @@ import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import javax.servlet.http.HttpServletRequest;
import java.io.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.math.BigDecimal;
import java.net.InetAddress;
import java.nio.charset.StandardCharsets;
import java.security.spec.AlgorithmParameterSpec;
import java.text.DecimalFormat;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.ReentrantLock;
......@@ -81,7 +72,7 @@ public class WeixinServiceImpl {
@Autowired
private RestTemplate restTemplate;
@Autowired
private StringRedisTemplate redisTemplate;
private OrderDetailMapper orderDetailMapper;
@Autowired
private CustomerMapper customerMapper;
@Autowired
......@@ -137,21 +128,25 @@ public class WeixinServiceImpl {
public String getSessionKeyOrOpenId(String code) {
String url = "https://api.weixin.qq.com/sns/jscode2session?appid={0}&secret={1}&js_code={2}&grant_type=authorization_code";
String replaceUrl = url.replace("{0}", appid).replace("{1}", secret).replace("{2}", code);
String res = restTemplate.getForObject(replaceUrl,String.class);
log.info("微信返回的信息为:【{}】",res);
String res = restTemplate.getForObject(replaceUrl, String.class);
log.info("微信返回的信息为:【{}】", res);
return res;
}
@PostConstruct
public void getData(){
try{
File file = new File(jsonPath);
public void getData() {
try {
/*File file = new File(jsonPath);
BufferedReader bufferedReader = new BufferedReader(new FileReader(file));
StringBuilder builder = new StringBuilder();
String line = null;
while ((line=bufferedReader.readLine())!=null){
builder.append(line);
}
areaData = builder.toString();
areaData = builder.toString();*/
ClassPathResource resource = new ClassPathResource("province.json");
byte[] bdata = FileCopyUtils.copyToByteArray(resource.getInputStream());
areaData = new String(bdata, StandardCharsets.UTF_8);
}catch (Exception e){
log.error("",e);
}
......@@ -359,9 +354,6 @@ public class WeixinServiceImpl {
log.error("微信支付发生异常",e);
throw new ServiceException("微信支付异常");
}
}
......@@ -493,23 +485,25 @@ public class WeixinServiceImpl {
OrderRefund orderRefund = new OrderRefund();
orderRefund.setRefundNo(outRefundNo);
List<OrderRefund> orderRefunds = orderRefundMapper.selectOrderRefundList(orderRefund);
if(orderRefunds.isEmpty()){
log.error("找不到该退款订单:【{}】",outRefundNo);
if (orderRefunds.isEmpty()) {
log.error("找不到该退款订单:【{}】", outRefundNo);
return WxPayNotifyResponse.fail("退款失败");
}
OrderRefund orderRefund1 = orderRefunds.get(0);
Order order = orderService.selectById(orderRefund1.getOrderId());
if("1".equals(orderRefund1.getState())){
orderRefund1.setState("2");
if (RefundState.REFUNDING.getState().equals(orderRefund1.getState())) {
orderRefund1.setState(RefundState.SUCCESS.getState());
orderRefundMapper.updateOrderRefund(orderRefund1);
OrderOperationLog orderOperationLog = new OrderOperationLog();
orderOperationLog.setOrderId(orderRefund1.getOrderId());
order.setState(OrderStatusConstant.refund);
if(orderRefund1.getRefundAmount().compareTo(order.getAmount())<0){
BigDecimal refundedAmount = orderRefundMapper.sumOrderRefundAmount(order.getId());
if (refundedAmount == null || refundedAmount.compareTo(order.getPaidAmount()) < 0) {
order.setState(OrderStatusConstant.PartialRefund);
}
orderRefund1.setOrder(order);
orderService.updateOrder(order);
orderDetailMapper.updateRefundState(orderRefund1.getId(), new Date());
orderOperationLogService.insertOrderOperationLog(orderRefund1);
return WxPayNotifyResponse.success("退款成功!");
}
......@@ -525,20 +519,20 @@ public class WeixinServiceImpl {
// */
// return WxPayNotifyResponse.success("退款成功!");
// }
}else{
} else {
WxPayRefundNotifyResult.ReqInfo reqInfo = wxPayRefundNotifyResult.getReqInfo();
String outRefundNo = reqInfo.getOutRefundNo();
OrderRefund orderRefund = new OrderRefund();
orderRefund.setRefundNo(outRefundNo);
List<OrderRefund> orderRefunds = orderRefundMapper.selectOrderRefundList(orderRefund);
if(orderRefunds.isEmpty()){
log.error("找不到该退款订单:【{}】",outRefundNo);
if (orderRefunds.isEmpty()) {
log.error("找不到该退款订单:【{}】", outRefundNo);
return WxPayNotifyResponse.fail("退款失败");
}
OrderRefund orderRefund1 = orderRefunds.get(0);
Order order = orderService.selectById(orderRefund1.getOrderId());
if("1".equals(orderRefund1.getState())){
orderRefund1.setState("3");
if (RefundState.REFUNDING.getState().equals(orderRefund1.getState())) {
orderRefund1.setState(RefundState.FAILURE.getState());
orderRefundMapper.updateOrderRefund(orderRefund1);
OrderOperationLog orderOperationLog = new OrderOperationLog();
orderOperationLog.setOrderId(orderRefund1.getOrderId());
......
package com.soss.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.soss.common.annotation.Excel;
import com.soss.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
......@@ -14,6 +16,7 @@ import java.util.List;
* @author zxq
* @date 2022-05-01
*/
@Data
public class Customer extends BaseEntity
{
private static final long serialVersionUID = 1L;
......@@ -25,103 +28,37 @@ public class Customer extends BaseEntity
@Excel(name = "用户名称")
private String userName;
/** 手机号 */
/**
* 手机号
*/
@Excel(name = "手机号")
private String phone;
/** 头像图地址 */
/**
* 头像图地址
*/
@Excel(name = "头像图地址")
private String headSculpturePath;
/** 用户来源 */
@Excel(name = "用户来源")
private String soucre;
@ApiModelProperty("性别")
private Boolean sex;
public String getAllow() {
return allow;
}
@ApiModelProperty("生日")
private Date birthday;
public void setAllow(String allow) {
this.allow = allow;
}
/**
* 用户来源
*/
@Excel(name = "用户来源")
private String soucre;
private List<Order> cancelOrder;
private String allow;
public List<Order> getCancelOrder() {
return cancelOrder;
}
public void setCancelOrder(List<Order> cancelOrder) {
this.cancelOrder = cancelOrder;
}
public List<Order> getRefundOrder() {
return refundOrder;
}
public void setRefundOrder(List<Order> refundOrder) {
this.refundOrder = refundOrder;
}
public List<Order> getNormalOrder() {
return normalOrder;
}
public void setNormalOrder(List<Order> normalOrder) {
this.normalOrder = normalOrder;
}
private List<Order> refundOrder ;
private List<Order> refundOrder;
private List<Order> normalOrder;
public void setId(String id)
{
this.id = id;
}
public String getId()
{
return id;
}
public void setUserName(String userName)
{
this.userName = userName;
}
public String getUserName()
{
return userName;
}
public void setPhone(String phone)
{
this.phone = phone;
}
public String getPhone()
{
return phone;
}
public void setHeadSculpturePath(String headSculpturePath)
{
this.headSculpturePath = headSculpturePath;
}
public String getHeadSculpturePath()
{
return headSculpturePath;
}
public void setSoucre(String soucre)
{
this.soucre = soucre;
}
public String getSoucre()
{
return soucre;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
package com.soss.system.domain;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.soss.common.annotation.Excel;
import com.soss.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
import java.util.List;
/**
* 商品分类对象 goods_category
......@@ -15,26 +17,37 @@ import com.soss.common.core.domain.BaseEntity;
* @author zxq
* @date 2022-04-28
*/
public class GoodsCategory extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
@Data
public class GoodsCategory extends BaseEntity {
/**
* 主键
*/
private String id;
/** 分类名称 */
/**
* 分类名称
*/
@Excel(name = "分类名称")
private String name;
/** 分类备注 */
@ApiModelProperty("图标地址")
private String icon;
/**
* 分类备注
*/
@Excel(name = "分类备注")
private String remarks;
/** 排序小的在前 */
/**
* 排序小的在前
*/
@Excel(name = "排序小的在前")
private String turn;
/** 状态 1 正常 2 停用 */
/**
* 状态 1 正常 2 停用
*/
@Excel(name = "状态 1 正常 2 停用")
private String state;
......@@ -42,13 +55,6 @@ public class GoodsCategory extends BaseEntity
@Excel(name = "0 正常 1 删除")
private String isDeleted;
public Integer getGoodsCount() {
return goodsCount;
}
public void setGoodsCount(Integer goodsCount) {
this.goodsCount = goodsCount;
}
/**商品数量**/
private Integer goodsCount;
......@@ -62,102 +68,12 @@ public class GoodsCategory extends BaseEntity
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date updatedAt;
public List<Goods> getGoodsList() {
return goodsList;
}
public void setGoodsList(List<Goods> goodsList) {
this.goodsList = goodsList;
}
/** 商品分类编码 */
@Excel(name = "商品分类编码")
private String code;
private List<Goods> goodsList;
public void setId(String id)
{
this.id = id;
}
public String getId()
{
return id;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
public String getRemarks()
{
return remarks;
}
public void setTurn(String turn)
{
this.turn = turn;
}
public String getTurn()
{
return turn;
}
public void setState(String state)
{
this.state = state;
}
public String getState()
{
return state;
}
public void setIsDeleted(String isDeleted)
{
this.isDeleted = isDeleted;
}
public String getIsDeleted()
{
return isDeleted;
}
public void setCreatedAt(Date createdAt)
{
this.createdAt = createdAt;
}
public Date getCreatedAt()
{
return createdAt;
}
public void setUpdatedAt(Date updatedAt)
{
this.updatedAt = updatedAt;
}
public Date getUpdatedAt()
{
return updatedAt;
}
public void setCode(String code)
{
this.code = code;
}
public String getCode()
{
return code;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
......@@ -127,6 +127,15 @@ public class Order implements Serializable {
@Excel(name = "订单状态 0 未支付取消 1 未支付 2 已支付 3 待制作 4 支付制作中 5 制作完成未取 6 取餐中 7 取餐完成 8 支付后制作前取消 9 制作中取消 10 制作完成取消 11 已退款 12 部分退款 50 其他人工干预状态")
private String state;
@ApiModelProperty("用户授权发送消息1:0-未授权 1-授权")
private Boolean sendMsgFlag1;
@ApiModelProperty("用户授权发送消息2:0-未授权 1-授权")
private Boolean sendMsgFlag2;
@ApiModelProperty("用户授权发送消息3:0-未授权 1-授权")
private Boolean sendMsgFlag3;
/**
* 创建时间
*/
......
......@@ -2,6 +2,7 @@ package com.soss.system.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.soss.common.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
......@@ -110,30 +111,38 @@ public class OrderDetail implements Serializable {
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date createdAt;
/** 更新时间 */
@ApiModelProperty("退款记录ID")
private Long refundId;
@ApiModelProperty("退款时间")
private Date refundTime;
/**
* 更新时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date updatedAt;
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("orderId", getOrderId())
.append("goodsId", getGoodsId())
.append("goodsName", getGoodsName())
.append("machineId", getMachineId())
.append("num", getNum())
.append("viewAmount", getViewAmount())
.append("amountShould", getAmountShould())
.append("couponAmount", getCouponAmount())
.append("realAmount", getRealAmount())
.append("specRuleDetail", getSpecRuleDetail())
.append("specRuleIds", getSpecRuleIds())
.append("skuId", getSkuId())
.append("goodsCategory", getGoodsCategory())
.append("createdAt", getCreatedAt())
.append("updatedAt", getUpdatedAt())
.toString();
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("orderId", getOrderId())
.append("goodsId", getGoodsId())
.append("goodsName", getGoodsName())
.append("machineId", getMachineId())
.append("num", getNum())
.append("viewAmount", getViewAmount())
.append("amountShould", getAmountShould())
.append("couponAmount", getCouponAmount())
.append("realAmount", getRealAmount())
.append("specRuleDetail", getSpecRuleDetail())
.append("specRuleIds", getSpecRuleIds())
.append("skuId", getSkuId())
.append("goodsCategory", getGoodsCategory())
.append("createdAt", getCreatedAt())
.append("updatedAt", getUpdatedAt())
.toString();
}
}
package com.soss.system.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.soss.common.annotation.Excel;
import com.soss.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 订单退款对象 order_refund
......@@ -14,12 +18,13 @@ import com.soss.common.core.domain.BaseEntity;
* @author zxq
* @date 2022-04-28
*/
@Data
public class OrderRefund extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private String id;
private Long id;
/** 订单ID */
@Excel(name = "订单ID")
......@@ -31,147 +36,47 @@ public class OrderRefund extends BaseEntity
/** 订单退款状态 0 默认 1 退款中 2 退款成功 3 退款失败 */
@Excel(name = "订单退款状态 0 默认 1 退款中 2 退款成功 3 退款失败")
private String state;
private Integer state;
/** 退款原因等描述 */
@Excel(name = "退款原因等描述")
private String desc;
/** 创建时间 */
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createdAt;
private String createUserName;
public String getCreateUserName() {
return createUserName;
}
public void setCreateUserName(String createUserName) {
this.createUserName = createUserName;
}
/** 更新时间 */
/**
* 更新时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date updatedAt;
private Order order;
private String refundNo;
public String getRefundNo() {
return refundNo;
}
public void setRefundNo(String refundNo) {
this.refundNo = refundNo;
}
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
private String orderNo;
public BigDecimal getTotalFee() {
return totalFee;
}
public void setTotalFee(BigDecimal totalFee) {
this.totalFee = totalFee;
}
private BigDecimal totalFee;
public Order getOrder() {
return order;
}
public void setOrder(Order order) {
this.order = order;
}
public void setId(String id)
{
this.id = id;
}
public String getId()
{
return id;
}
public void setOrderId(String orderId)
{
this.orderId = orderId;
}
public String getOrderId()
{
return orderId;
}
public void setRefundAmount(BigDecimal refundAmount)
{
this.refundAmount = refundAmount;
}
public BigDecimal getRefundAmount()
{
return refundAmount;
}
public void setState(String state)
{
this.state = state;
}
public String getState()
{
return state;
}
public void setDesc(String desc)
{
this.desc = desc;
}
public String getDesc()
{
return desc;
}
public void setCreatedAt(Date createdAt)
{
this.createdAt = createdAt;
}
public Date getCreatedAt()
{
return createdAt;
}
public void setUpdatedAt(Date updatedAt)
{
this.updatedAt = updatedAt;
}
public Date getUpdatedAt()
{
return updatedAt;
}
@ApiModelProperty("退款明细id集合")
private List<Long> orderDetailIds;
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("orderId", getOrderId())
.append("refundAmount", getRefundAmount())
.append("state", getState())
.append("desc", getDesc())
.append("createdAt", getCreatedAt())
.append("updatedAt", getUpdatedAt())
.toString();
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("orderId", getOrderId())
.append("refundAmount", getRefundAmount())
.append("state", getState())
.append("desc", getDesc())
.append("createdAt", getCreatedAt())
.append("updatedAt", getUpdatedAt())
.toString();
}
}
......@@ -3,6 +3,7 @@ package com.soss.system.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.soss.common.annotation.Excel;
import com.soss.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
......@@ -40,35 +41,54 @@ public class Shop extends BaseEntity
@Excel(name = "店铺位置纬度")
private String lat;
/** 店铺备注 */
/**
* 店铺备注
*/
@Excel(name = "店铺备注")
private String remarks;
/** 店铺开始营业时间 */
/**
* 店铺开始营业时间
*/
@Excel(name = "店铺开始营业时间")
private String startTime;
/** 店铺结束营业时间 */
/**
* 店铺结束营业时间
*/
@Excel(name = "店铺结束营业时间")
private String endTime;
/** 店铺地址 */
/**
* 店铺地址
*/
@Excel(name = "店铺地址")
private String address;
/** $column.columnComment */
/**
* $column.columnComment
*/
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String province;
/** $column.columnComment */
/**
* $column.columnComment
*/
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String city;
/** $column.columnComment */
/**
* $column.columnComment
*/
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String zone;
/** 店铺状态 1 正常 2 暂停营业 3 关闭 */
@ApiModelProperty("最远下单距离,单位:km")
private Double distanceLimit;
/**
* 店铺状态 1 正常 2 暂停营业 3 关闭
*/
@Excel(name = "店铺状态 1 正常 2 暂停营业 3 关闭")
private Integer state;
......@@ -78,19 +98,25 @@ public class Shop extends BaseEntity
private String machieStatus;
/** 创建时间 */
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date createdAt;
/** 更新时间 */
/**
* 更新时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date updatedAt;
private String machineCode;
/** 是否默认 0否1是 */
/**
* 是否默认 0否1是
*/
@Excel(name = "是否默认 0否1是")
private Long isDefault;
......
package com.soss.system.domain;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.soss.common.annotation.Excel;
import com.soss.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
import java.util.List;
/**
* 规格对象 spec
......@@ -15,10 +17,9 @@ import com.soss.common.core.domain.BaseEntity;
* @author zxq
* @date 2022-04-28
*/
@Data
public class Spec extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private long id;
......@@ -42,137 +43,46 @@ public class Spec extends BaseEntity
@Excel(name = "是否必须原料 1 否 2 是")
private int isNeccessary;
/** 创建时间 */
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date createdAt;
/** 更新时间 */
/**
* 更新时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date updatedAt;
/** 规格编码 */
/**
* 规格编码
*/
@Excel(name = "规格编码")
private String code;
@Override
public String getRemark() {
return remark;
}
@Override
public void setRemark(String remark) {
this.remark = remark;
}
@ApiModelProperty("规格备注")
private String remark;
private List<SpecRule> specRules;
@ApiModelProperty("原料备注")
private String materialRemark;
public List<SpecRule> getSpecRules() {
return specRules;
}
public void setSpecRules(List<SpecRule> specRules) {
this.specRules = specRules;
}
public void setId(long id)
{
this.id = id;
}
public long getId()
{
return id;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setState(int state)
{
this.state = state;
}
public int getState()
{
return state;
}
public void setIsShow(Long isShow)
{
this.isShow = isShow;
}
public Long getIsShow()
{
return isShow;
}
public void setIsDeleted(int isDeleted)
{
this.isDeleted = isDeleted;
}
public int getIsDeleted()
{
return isDeleted;
}
public void setIsNeccessary(int isNeccessary)
{
this.isNeccessary = isNeccessary;
}
public int getIsNeccessary()
{
return isNeccessary;
}
public void setCreatedAt(Date createdAt)
{
this.createdAt = createdAt;
}
public Date getCreatedAt()
{
return createdAt;
}
public void setUpdatedAt(Date updatedAt)
{
this.updatedAt = updatedAt;
}
public Date getUpdatedAt()
{
return updatedAt;
}
public void setCode(String code)
{
this.code = code;
}
public String getCode()
{
return code;
}
private List<SpecRule> specRules;
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("name", getName())
.append("state", getState())
.append("isShow", getIsShow())
.append("isDeleted", getIsDeleted())
.append("isNeccessary", getIsNeccessary())
.append("createdAt", getCreatedAt())
.append("updatedAt", getUpdatedAt())
.append("code", getCode())
.toString();
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("name", getName())
.append("state", getState())
.append("isShow", getIsShow())
.append("isDeleted", getIsDeleted())
.append("isNeccessary", getIsNeccessary())
.append("createdAt", getCreatedAt())
.append("updatedAt", getUpdatedAt())
.append("code", getCode())
.toString();
}
}
package com.soss.system.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.soss.common.annotation.Excel;
import com.soss.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* 小程序信息发送对象 wechat_message
*
*
* @author zxq
* @date 2022-04-28
*/
public class WechatMessage extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
@Data
public class WechatMessage extends BaseEntity {
/**
* 主键
*/
private String id;
/** 用户ID */
/**
* 用户ID
*/
@Excel(name = "用户ID")
private String userId;
/** 推送ID */
/**
* 推送ID
*/
@Excel(name = "推送ID")
private String msgId;
/** 消息内容 */
/**
* 消息内容
*/
@Excel(name = "消息内容")
private String message;
/** 目标跳转url */
@ApiModelProperty("跳转目标ID")
private Long targetId;
/**
* 目标跳转url
*/
@Excel(name = "目标跳转url")
private String targetUrl;
/** 消息发送状态 0 待发送 1 发送中 2 成功 3 失败 */
@Excel(name = "消息发送状态 0 待发送 1 发送中 2 成功 3 失败")
private String state;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
/**
* 消息发送状态 0 待发送 1 发送中 2 成功 3 失败
*/
@ApiModelProperty("消息发送状态 0 待发送 1 发送中 2 成功 3 失败")
private Integer state;
private String title;
/** 消息类型 1 取餐消息 2 积分消息 等 */
@Excel(name = "消息类型 1 取餐消息 2 积分消息 等")
private String type;
/**
* 消息类型 1 取餐消息 2 积分消息 等
*/
@ApiModelProperty("消息类型 1 取餐消息 2 积分消息 3-优惠券消息 等")
private Integer type;
/** 消息阅读状态 1 未读 2 已读 */
/**
* 消息阅读状态 1 未读 2 已读
*/
@Excel(name = "消息阅读状态 1 未读 2 已读")
private String isRead;
/** 0 未删除 1 已删除 */
/**
* 0 未删除 1 已删除
*/
@Excel(name = "0 未删除 1 已删除")
private String isDeleted;
/** 创建时间 */
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date createdAt;
/** 更新时间 */
/**
* 更新时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date updatedAt;
public void setId(String id)
{
this.id = id;
}
public String getId()
{
return id;
}
public void setUserId(String userId)
{
this.userId = userId;
}
public String getUserId()
{
return userId;
}
public void setMsgId(String msgId)
{
this.msgId = msgId;
}
public String getMsgId()
{
return msgId;
}
public void setMessage(String message)
{
this.message = message;
}
public String getMessage()
{
return message;
}
public void setTargetUrl(String targetUrl)
{
this.targetUrl = targetUrl;
}
public String getTargetUrl()
{
return targetUrl;
}
public void setState(String state)
{
this.state = state;
}
public String getState()
{
return state;
}
public void setType(String type)
{
this.type = type;
}
public String getType()
{
return type;
}
public void setIsRead(String isRead)
{
this.isRead = isRead;
}
public String getIsRead()
{
return isRead;
}
public void setIsDeleted(String isDeleted)
{
this.isDeleted = isDeleted;
}
public String getIsDeleted()
{
return isDeleted;
}
public void setCreatedAt(Date createdAt)
{
this.createdAt = createdAt;
}
public Date getCreatedAt()
{
return createdAt;
}
public void setUpdatedAt(Date updatedAt)
{
this.updatedAt = updatedAt;
}
public Date getUpdatedAt()
{
return updatedAt;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("userId", getUserId())
.append("msgId", getMsgId())
.append("message", getMessage())
.append("targetUrl", getTargetUrl())
.append("state", getState())
.append("type", getType())
.append("isRead", getIsRead())
.append("isDeleted", getIsDeleted())
.append("createdAt", getCreatedAt())
.append("updatedAt", getUpdatedAt())
.toString();
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("userId", getUserId())
.append("msgId", getMsgId())
.append("message", getMessage())
.append("targetUrl", getTargetUrl())
.append("state", getState())
.append("type", getType())
.append("isRead", getIsRead())
.append("isDeleted", getIsDeleted())
.append("createdAt", getCreatedAt())
.append("updatedAt", getUpdatedAt())
.toString();
}
}
package com.soss.system.domain.vo.orderTaking;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class CategoryVo implements Serializable {
private Long id;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List<GoodsVo> getGoods() {
return goods;
}
public void setGoods(List<GoodsVo> goods) {
this.goods = goods;
}
private String name;
@ApiModelProperty("图标地址")
private String icon;
private List<GoodsVo> goods;
}
package com.soss.system.mapper;
import java.util.List;
import com.soss.system.domain.OrderDetail;
import java.util.Date;
import java.util.List;
/**
* 订单详情Mapper接口
*
*
* @author zxq
* @date 2022-04-28
*/
public interface OrderDetailMapper
{
public interface OrderDetailMapper {
/**
* 查询订单详情
*
*
* @param id 订单详情主键
* @return 订单详情
*/
public OrderDetail selectOrderDetailById(String id);
/**
* 根据明细id集合查询明细列表
*
* @param ids
* @return
*/
List<OrderDetail> listDetailByIds(List<Long> ids);
/**
* 查询订单详情列表
*
*
* @param orderDetail 订单详情
* @return 订单详情集合
*/
......@@ -53,9 +62,13 @@ public interface OrderDetailMapper
/**
* 批量删除订单详情
*
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteOrderDetailByIds(String[] ids);
void bindRefund(Long refundId, List<Long> ids);
void updateRefundState(Long refundId, Date refundTime);
}
package com.soss.system.mapper;
import java.util.List;
import com.soss.system.domain.OrderRefund;
import com.soss.system.domain.vo.OrderQuery;
import java.math.BigDecimal;
import java.util.List;
/**
* 订单退款Mapper接口
*
*
* @author zxq
* @date 2022-04-28
*/
public interface OrderRefundMapper
{
public interface OrderRefundMapper {
/**
* 查询订单退款
*
*
* @param id 订单退款主键
* @return 订单退款
*/
......@@ -22,7 +23,7 @@ public interface OrderRefundMapper
/**
* 查询订单退款列表
*
*
* @param orderRefund 订单退款
* @return 订单退款集合
*/
......@@ -30,7 +31,7 @@ public interface OrderRefundMapper
/**
* 新增订单退款
*
*
* @param orderRefund 订单退款
* @return 结果
*/
......@@ -38,7 +39,7 @@ public interface OrderRefundMapper
/**
* 修改订单退款
*
*
* @param orderRefund 订单退款
* @return 结果
*/
......@@ -46,7 +47,7 @@ public interface OrderRefundMapper
/**
* 删除订单退款
*
*
* @param id 订单退款主键
* @return 结果
*/
......@@ -54,11 +55,16 @@ public interface OrderRefundMapper
/**
* 批量删除订单退款
*
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteOrderRefundByIds(String[] ids);
List<OrderRefund> selectList(OrderQuery orderQuery);
/**
* 获取订单已成功退款的总额
*/
BigDecimal sumOrderRefundAmount(Long orderId);
}
......@@ -13,12 +13,12 @@ public class CouponSchedule {
@Autowired
private CouponUserMapper couponUserMapper;
@Scheduled(cron = "0 0 0 * * ?")
@Scheduled(cron = "0/1 * * * * ?")
private void expireCoupon() {
couponMapper.expireCoupon();
}
@Scheduled(cron = "0 0 0 * * ?")
@Scheduled(cron = "0/1 * * * * ?")
private void expireCouponUser() {
couponUserMapper.expireCouponUser();
}
......
......@@ -16,6 +16,8 @@ import com.soss.system.domain.vo.customer.CustomerResultVo;
*/
public interface ICustomerService
{
Customer selectCustById(String custId);
/**
* 查询用户信息
*
......@@ -49,6 +51,8 @@ public interface ICustomerService
*/
public int updateCustomer(Customer customer);
void updateCustBirthday(Customer customer);
/**
* 批量删除用户信息
*
......
......@@ -41,7 +41,7 @@ public interface IOrderService
*/
public AjaxResult insertOrder(LoginUser request, Order order);
void checkBusinessTime(Long shopId);
void checkShopInfo(Order order);
/**
* 修改订单
......
package com.soss.system.service;
import java.util.List;
import com.soss.system.domain.WechatMessage;
import java.util.List;
/**
* 小程序信息发送Service接口
*
......@@ -37,11 +38,10 @@ public interface IWechatMessageService
/**
* 新增小程序信息发送
*
* @param wechatMessage 小程序信息发送
* @return 结果
*/
public int insertWechatMessage(String openId, String message);
public int insertWechatMessage(String openId, Long targetId, String message);
int insertWechatMessage(String openId, Long targetId, Integer messageType, String message);
/**
* 修改小程序信息发送
......
......@@ -51,14 +51,11 @@ public class AppServiceImpl {
DecimalFormat df = new DecimalFormat("######0.0");
distance = df.format(s/1000);
return distance+"km";
}else if (s>=10000){
Double aDouble = s/10000;
Double aDouble = s / 1000;
return aDouble.intValue()+"km";
}else{
Double aDouble =s;
return aDouble.intValue()+"m";
}
}
......
......@@ -85,7 +85,7 @@ public class CouponCategoryServiceImpl implements ICouponCategoryService {
public List<CouponCategory> listCouponCategory(CouponCategory couponCategory) {
List<CouponCategory> couponCategories = couponCategoryMapper.listCouponCategory(couponCategory);
Map<Integer, Long> countMap;
if (CollectionUtils.isEmpty(couponCategories)) {
if (!CollectionUtils.isEmpty(couponCategories)) {
List<Integer> categoryIds = couponCategories.stream().map(CouponCategory::getId).collect(Collectors.toList());
List<CouponCategory> couponCategoryCountList = couponMapper.getCouponCategoryTypeStat(categoryIds);
countMap = couponCategoryCountList.stream().collect(Collectors.toMap(CouponCategory::getId, CouponCategory::getCouponCnt));
......@@ -127,6 +127,7 @@ public class CouponCategoryServiceImpl implements ICouponCategoryService {
CouponCategory online = new CouponCategory(id, CouponState.OFFLINE.getState());
int updateCnt = couponCategoryMapper.updateCouponCategory(online);
Coupon coupon = new Coupon();
coupon.setCategoryId(id);
List<Coupon> coupons = couponMapper.listCoupon(coupon);
long unOfflineCnt = coupons.stream().filter(c -> c.getState().equals(CouponState.DEFAULT.getState())
|| c.getState().equals(CouponState.ONLINE.getState())).count();
......
......@@ -111,7 +111,6 @@ public class CouponServiceImpl implements ICouponService {
if (CouponCategoryType.DEDUCTION.getType().equals(couponCategory.getType())) {
Assert.notNull(couponPo.getPriceDiscount(), "满减价还未设置");
Assert.notNull(couponPo.getPriceLimit(), "价格门槛还未设置");
Assert.notNull(couponPo.getDaysLimit(), "用户可领取次数还未设置");
ruleName = "立减" + couponPo.getPriceDiscount() + "元";
if (couponPo.getPriceLimit().compareTo(BigDecimal.ZERO) == 0) {
ruleDesc = "无门槛";
......@@ -134,10 +133,7 @@ public class CouponServiceImpl implements ICouponService {
ruleDesc = "满" + couponPo.getPriceLimit() + "元";
}
}
Assert.notNull(couponPo.getDaysLimit(), "用户可领取次数限制还未设置");
Assert.isTrue(couponPo.getDaysLimit() == 0
|| (couponPo.getDaysLimit() > 0 && couponPo.getUserLimit() != null && couponPo.getUserLimit() > 0),
"用户可领取次数限制还未设置完全");
Assert.notNull(couponPo.getUserLimit(), "用户可领取次数限制还未设置");
Assert.notNull(couponPo.getUseStartTime(), "优惠券的绝对有效时间还未设置");
Assert.notNull(couponPo.getUseEndTime(), "优惠券的绝对有效时间还未设置");
if (couponPo.getReceivableTime() != null && couponPo.getReceivableTime().isAfter(couponPo.getUseStartTime())) {
......
package com.soss.system.service.impl;
import com.soss.common.exception.ServiceException;
import com.soss.common.utils.DateUtils;
import com.soss.system.constants.OrderStatusConstant;
import com.soss.system.domain.Customer;
......@@ -33,6 +34,11 @@ public class CustomerServiceImpl implements ICustomerService
@Autowired
private ShopMapper shopMapper;
@Override
public Customer selectCustById(String custId) {
return customerMapper.selectCustomerById(custId);
}
/**
* 查询用户信息
*
......@@ -60,9 +66,6 @@ public class CustomerServiceImpl implements ICustomerService
order1.setShop(shopMapper.selectShopById(order1.getShopId()));
}
return orders;
}
/**
......@@ -94,25 +97,32 @@ public class CustomerServiceImpl implements ICustomerService
/**
* 修改用户信息
*
*
* @param customer 用户信息
* @return 结果
*/
@Override
public int updateCustomer(Customer customer)
{
public int updateCustomer(Customer customer) {
return customerMapper.updateCustomer(customer);
}
@Override
public void updateCustBirthday(Customer customer) {
Customer cust = customerMapper.selectCustomerById(customer.getId());
if (cust.getBirthday() != null) {
throw new ServiceException("生日只能修改一次");
}
customerMapper.updateCustomer(customer);
}
/**
* 批量删除用户信息
*
*
* @param ids 需要删除的用户信息主键
* @return 结果
*/
@Override
public int deleteCustomerByIds(Long[] ids)
{
public int deleteCustomerByIds(Long[] ids) {
return customerMapper.deleteCustomerByIds(ids);
}
......
......@@ -227,7 +227,7 @@ public class GoodsServiceImpl implements IGoodsService
public int updateGoods(Goods goods) {
Goods goodsOri = goodsMapper.selectGoodsById(goods.getId());
int i = goodsMapper.updateGoods(goods);
if (Objects.equals(goodsOri.getSpec(), goods.getSpec())) {
if (StringUtils.isEmpty(goods.getSpec()) || Objects.equals(goodsOri.getSpec(), goods.getSpec())) {
return i;
}
/*if(StringUtils.isNotEmpty(goods.getSpec())){
......
package com.soss.system.service.impl;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import com.alibaba.fastjson.JSONObject;
import com.soss.common.core.domain.AjaxResult;
import com.soss.common.enums.RefundState;
import com.soss.common.exception.ServiceException;
import com.soss.common.utils.GenerateCode;
import com.soss.common.utils.StringUtils;
import com.soss.system.constants.OrderStatusConstant;
import com.soss.system.domain.Order;
import com.soss.system.domain.OrderDetail;
import com.soss.system.domain.OrderRefund;
import com.soss.system.domain.OrderSnapshot;
import com.soss.system.domain.vo.OrderQuery;
import com.soss.system.jiguang.impl.JiGuangPushServiceImpl;
import com.soss.system.mapper.OrderMapper;
import com.soss.system.mapper.OrderDetailMapper;
import com.soss.system.mapper.OrderRefundMapper;
import com.soss.system.mapper.OrderSnapshotMapper;
import com.soss.system.service.IOrderRefundService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.soss.system.mapper.OrderRefundMapper;
import com.soss.system.domain.OrderRefund;
import com.soss.system.service.IOrderRefundService;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* 订单退款Service业务层处理
......@@ -30,6 +34,7 @@ import com.soss.system.service.IOrderRefundService;
* @date 2022-04-28
*/
@Service
@Slf4j
public class OrderRefundServiceImpl implements IOrderRefundService
{
@Autowired
......@@ -40,11 +45,7 @@ public class OrderRefundServiceImpl implements IOrderRefundService
@Autowired
private OrderSnapshotMapper orderSnapshotMapper;
@Autowired
private MachineApiServiceImpl machineApiService;
@Autowired
private JiGuangPushServiceImpl jiGuangPushService;
@Autowired
private OrderOperationLogServiceImpl orderOperationLogService;
private OrderDetailMapper orderDetailMapper;
/**
* 查询订单退款
......@@ -98,34 +99,46 @@ public class OrderRefundServiceImpl implements IOrderRefundService
if(order ==null ){
return AjaxResult.error("找不到该订单");
}
// 制作中、制作完成、聚餐中、已完成
String state = order.getState();
// 制作中、制作完成、取餐中、已完成、待取超时、退款失败
List<String> status = Arrays.asList(OrderStatusConstant.production,OrderStatusConstant.productionCompleted,OrderStatusConstant.Taking,OrderStatusConstant.completed,OrderStatusConstant.timeout,OrderStatusConstant.refundFailed);
if(OrderStatusConstant.Paid.equals(state)){
if (OrderStatusConstant.Paid.equals(state)) {
//orderRefund.setRefundAmount(order.getAmount());
// 4 支付制作中 5 制作完成未取 6 取餐中 7 取餐完成
}else if(status.contains(state)){
// 4 支付制作中 5 制作完成未取 6 取餐中 7 取餐完成
} else if (status.contains(state)) {
String desc = orderRefund.getDesc();
if(StringUtils.isEmpty(desc)){
if (StringUtils.isEmpty(desc)) {
return AjaxResult.error("请联系客服进行退款");
}
}else{
} else {
return AjaxResult.error("该订单状态不允许退款");
}
List<OrderDetail> orderDetails = orderDetailMapper.listDetailByIds(orderRefund.getOrderDetailIds());
List<String> illegalGoodNames = orderDetails.stream().filter(orderDetail -> orderDetail.getRefundTime() != null).map(OrderDetail::getGoodsName).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(illegalGoodNames)) {
return AjaxResult.error("商品" + illegalGoodNames + "已退过款");
}
BigDecimal orderDetailAmount = orderDetails.stream().map(OrderDetail::getRealAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
if (orderDetailAmount.compareTo(orderRefund.getRefundAmount()) != 0) {
log.warn("退款金额[{}]与商品明细总额[{}]不符", orderRefund.getRefundAmount(), orderDetailAmount);
return AjaxResult.error("退款金额与商品明细总额不符");
}
orderRefund.setCreatedAt(new Date());
orderRefund.setUpdatedAt(new Date());
orderRefund.setState("0");
orderRefund.setState(RefundState.PENDING.getState());
orderRefund.setOrderNo(order.getOrderNo());
orderRefund.setRefundNo(GenerateCode.getCode("R","%09d"));
orderRefund.setTotalFee(order.getAmount());
orderRefund.setRefundNo(GenerateCode.getCode("R", "%09d"));
orderRefund.setTotalFee(orderDetailAmount);
orderRefund.setOrderNo(order.getOrderNo());
if(StringUtils.isEmpty(orderRefund.getCreateUserName())){
if (StringUtils.isEmpty(orderRefund.getCreateUserName())) {
orderRefund.setCreateUserName(order.getUserName());
}
int i = orderRefundMapper.insertOrderRefund(orderRefund);
orderRefundMapper.insertOrderRefund(orderRefund);
order.setState(OrderStatusConstant.refunding);
orderService.updateOrder(order);
orderDetailMapper.bindRefund(orderRefund.getId(), orderRefund.getOrderDetailIds());
orderRefund.setOrder(order);
return AjaxResult.success(orderRefund);
}
......
......@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.soss.common.core.domain.AjaxResult;
import com.soss.common.core.domain.model.LoginUser;
import com.soss.common.enums.MachineState;
import com.soss.common.exception.ServiceException;
import com.soss.common.utils.StringUtils;
import com.soss.common.utils.spring.SpringUtils;
......@@ -19,6 +20,7 @@ import com.soss.system.mapper.*;
import com.soss.system.service.IOrderService;
import com.soss.system.utils.SendSmsUtil;
import com.soss.system.weixin.util.SendMessageUtils;
import org.apache.commons.lang3.BooleanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.support.atomic.RedisAtomicInteger;
......@@ -139,7 +141,7 @@ public class OrderServiceImpl implements IOrderService {
List<Machine> machines = machineMapper.selectMachineList(machine);
if (machines != null && !machines.isEmpty()) {
Machine machine1 = machines.get(0);
if (!"1".equals(machine1.getState())) {
if (!MachineState.RUNNING.getState().equals(machine1.getState())) {
return AjaxResult.error("机器暂时不可用");
}
machineId = machine1.getId();
......@@ -178,8 +180,8 @@ public class OrderServiceImpl implements IOrderService {
}
@Override
public void checkBusinessTime(Long shopId) {
Shop shop = shopMapper.selectShopById(shopId);
public void checkShopInfo(Order order) {
Shop shop = shopMapper.selectShopById(order.getShopId());
String startTime = shop.getStartTime();
String endTime = shop.getEndTime();
String[] split = startTime.split(":");
......@@ -194,6 +196,12 @@ public class OrderServiceImpl implements IOrderService {
if (startBusiness.getTimeInMillis() > l || endBusiness.getTimeInMillis() < l) {
throw new ServiceException("当前时间本店休息中,暂停点单~");
}
if (shop.getDistanceLimit() != null && shop.getDistanceLimit() > 0) {
double distance = AppServiceImpl.GetRealDistance(order.getLng().doubleValue(), order.getLat().doubleValue(), Double.parseDouble(shop.getLng()), Double.parseDouble(shop.getLat()));
if (distance > shop.getDistanceLimit() * 1000) {
throw new ServiceException("超过店铺下单的距离范围");
}
}
}
/**
......@@ -263,9 +271,9 @@ public class OrderServiceImpl implements IOrderService {
order.setFinishTime(new Date());
orderOperationLogService.insertOrderOperationLog(order);
jiGuangPushService.pushOrderState(order);
sendMessageUtils.sendWxMsg(order);
if (BooleanUtils.isTrue(order.getSendMsgFlag3())) {
sendMessageUtils.sendWxMsg(order);
}
}
/**
......@@ -318,13 +326,14 @@ public class OrderServiceImpl implements IOrderService {
private void productionCompletedState(Order order) {
orderOperationLogService.insertOrderOperationLog(order);
jiGuangPushService.pushOrderState(order);
wechatMessageService.insertWechatMessage(order.getUserId(), "制作完成,您的订单已经制作完成,现在可以去取餐啦!");
sendMessageUtils.sendWxMsg(order);
wechatMessageService.insertWechatMessage(order.getUserId(), order.getId(), "制作完成,您的订单已经制作完成,现在可以去取餐啦!");
if (BooleanUtils.isTrue(order.getSendMsgFlag2())) {
sendMessageUtils.sendWxMsg(order);
}
Customer customer = customerMapper.selectCustomerById(order.getUserId());
if (!"1".equals(customer.getAllow())) {
sendSmsUtil.sendSms(order.getUserPhone(), "SMS_243650242", null);
}
}
/**
......@@ -339,9 +348,10 @@ public class OrderServiceImpl implements IOrderService {
private void productionState(Order order) {
orderOperationLogService.insertOrderOperationLog(order);
jiGuangPushService.pushOrderState(order);
wechatMessageService.insertWechatMessage(order.getUserId(), "制作提醒,您的订单已经开始制作,马上就能享受美味了!");
sendMessageUtils.sendWxMsg(order);
wechatMessageService.insertWechatMessage(order.getUserId(), order.getId(), "制作提醒,您的订单已经开始制作,马上就能享受美味了!");
if (BooleanUtils.isTrue(order.getSendMsgFlag2())) {
sendMessageUtils.sendWxMsg(order);
}
}
/**
......@@ -359,8 +369,10 @@ public class OrderServiceImpl implements IOrderService {
machineApiService.updateOrder(order);
//极光推送
jiGuangPushService.pushOrderState(order);
wechatMessageService.insertWechatMessage(order.getUserId(), "下单成功,您已经下单成功了~");
sendMessageUtils.sendWxMsg(order);
wechatMessageService.insertWechatMessage(order.getUserId(), order.getId(), "下单成功,您已经下单成功了~");
if (BooleanUtils.isTrue(order.getSendMsgFlag1())) {
sendMessageUtils.sendWxMsg(order);
}
}
/**
......@@ -402,7 +414,7 @@ public class OrderServiceImpl implements IOrderService {
for (OrderDetail orderDetail : orderDetails) {
ShopGoodsSku shopGoodsSku = new ShopGoodsSku();
shopGoodsSku.setSkuId(orderDetail.getSkuId());
shopGoodsSku.setShopId(Long.valueOf(order.getShopId()));
shopGoodsSku.setShopId(order.getShopId());
shopGoodsSku.setIsDeleted("0");
List<ShopGoodsSku> shopGoodsSkus = shopGoodsSkuMapper.selectShopGoodsSkuList(shopGoodsSku);
if (shopGoodsSkus == null || shopGoodsSkus.isEmpty()) {
......
......@@ -137,6 +137,7 @@ public class OrderTakingServiceImpl {
CategoryVo categoryVo = new CategoryVo();
categoryVo.setId(Long.parseLong(category.getId()));
categoryVo.setName(category.getName());
categoryVo.setIcon(category.getIcon());
List<Goods> goodsList = shopGoodsMapper.selectShopCategoryGoodsByCategoryId(shopId, category.getId());
List<GoodsVo> goodsVoList = new ArrayList<>();
categoryVo.setGoods(goodsVoList);
......
......@@ -3,6 +3,7 @@ package com.soss.system.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.soss.common.core.domain.AjaxResult;
import com.soss.common.enums.MachineState;
import com.soss.common.enums.ShopState;
import com.soss.common.exception.ServiceException;
import com.soss.common.utils.StringUtils;
......@@ -100,7 +101,7 @@ public class ShopServiceImpl implements IShopService
if (!Objects.equals(shop.getState(), ShopState.CLOSE.getState())) {
throw new ServiceException("需暂停营业状态才可以开始测试");
}
this.updateShop(new Shop(shopId, ShopState.TESTING.getState()));
shopMapper.updateShop(new Shop(shopId, ShopState.TESTING.getState()));
}
@Override
......@@ -109,24 +110,24 @@ public class ShopServiceImpl implements IShopService
if (CollectionUtils.isEmpty(machines)) {
throw new ServiceException("需绑定机器后才可完成测试");
}
// 完成测试后的校验 todo 逻辑待定
long unFinishTestMachineCount = machines.stream().filter(machine -> !machine.getState().equals(1)).count();
// 完成测试后的校验
long unFinishTestMachineCount = machines.stream().filter(machine -> !machine.getState().equals(MachineState.RUNNING.getState())
&& !Objects.equals(machine.getState(), MachineState.STANDBY.getState())).count();
if (unFinishTestMachineCount > 0) {
throw new ServiceException("需机器完成运营测试后才可完成测试");
}
Shop shop = new Shop(shopId, ShopState.CLOSE.getState());
this.updateShop(shop);
shopMapper.updateShop(shop);
}
@Override
public void open(Long shopId) {
Shop shop = shopMapper.selectShopById(shopId);
Assert.notNull(shop, "未查询到匹配的店铺信息[id=" + shopId + "]");
// 判断店铺绑定机器是否输入组件属性对应经验值 todo
/*if () {
throw new ServiceException("店铺绑定机器还未输入组件属性对应经验值");
}*/
this.updateShop(new Shop(shopId, ShopState.OPEN.getState()));
if (!Objects.equals(shop.getState(), ShopState.CLOSE.getState())) {
throw new ServiceException("店铺暂停营业状态下才能正常营业");
}
shopMapper.updateShop(new Shop(shopId, ShopState.OPEN.getState()));
}
/**
......
package com.soss.system.service.impl;
import java.util.Date;
import java.util.List;
import com.soss.common.enums.MessageState;
import com.soss.common.enums.MessageType;
import com.soss.system.domain.WechatMessage;
import com.soss.system.mapper.WechatMessageMapper;
import com.soss.system.service.IWechatMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.soss.system.mapper.WechatMessageMapper;
import com.soss.system.domain.WechatMessage;
import java.util.Date;
import java.util.List;
/**
* 小程序信息发送Service业务层处理
......@@ -53,27 +55,32 @@ public class WechatMessageServiceImpl implements IWechatMessageService
/**
* 新增小程序信息发送
*
*
* @param wechatMessage 小程序信息发送
* @return 结果
*/
@Override
public int insertWechatMessage(WechatMessage wechatMessage)
{
public int insertWechatMessage(WechatMessage wechatMessage) {
return wechatMessageMapper.insertWechatMessage(wechatMessage);
}
@Override
public int insertWechatMessage(String openId, String message) {
public int insertWechatMessage(String openId, Long targetId, String message) {
return insertWechatMessage(openId, targetId, MessageType.ORDER.getType(), message);
}
@Override
public int insertWechatMessage(String openId, Long targetId, Integer messageType, String message) {
WechatMessage wechatMessage = new WechatMessage();
wechatMessage.setMessage(message);
wechatMessage.setTargetId(targetId);
wechatMessage.setCreatedAt(new Date());
wechatMessage.setState("0");
wechatMessage.setState(MessageState.TO_BE_SEND.getState());
wechatMessage.setIsRead("1");
wechatMessage.setType("1");
wechatMessage.setType(messageType);
wechatMessage.setUserId(openId);
wechatMessage.setUpdatedAt(new Date());
return wechatMessageMapper.insertWechatMessage(wechatMessage);
return wechatMessageMapper.insertWechatMessage(wechatMessage);
}
/**
......
......@@ -18,12 +18,13 @@
<select id="selectCouponById" resultMap="BaseResultMap">
select *
from coupon
where id = #{id}
where id = #{id} and state != ${@com.soss.common.enums.CouponState @DELETE.getState}
</select>
<select id="listCoupon" parameterType="com.soss.system.domain.Coupon" resultMap="BaseResultMap">
select * from coupon
<where>
state != ${@com.soss.common.enums.CouponState @DELETE.getState}
<if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
<if test="categoryId != null">and category_id = #{categoryId}</if>
<if test="state != null">and state = #{state}</if>
......@@ -34,6 +35,7 @@
<select id="getCouponCategoryTypeStat" resultType="com.soss.system.domain.CouponCategory">
select category_id id, count(*) couponCnt from coupon where category_id in
<foreach collection="categoryIds" item="categoryId" open="(" close=")" separator=",">#{categoryId}</foreach>
and state != ${@com.soss.common.enums.CouponState @DELETE.getState}
group by category_id
</select>
......@@ -89,6 +91,6 @@
update coupon c
left join coupon_rule cr on c.rule_id = cr.id
set c.state = ${@com.soss.common.enums.CouponState @EXPIRED.getState}
where cr.use_end_time &lt; now()
where cr.use_end_time &lt; now() and c.state = ${@com.soss.common.enums.CouponState @ONLINE.getState}
</update>
</mapper>
......@@ -59,7 +59,7 @@
useStartTime, cu.expired_time useEndTime, cc.`desc` categoryDesc, cr.category_ids categoryIdStr, cr.goods_ids
goodsIdStr, cr.province provinceStr, cr.city cityStr, cr.area areaStr, cr.shop_ids shopIdStr,
cr.week_limit weekLimitStr, cr.price_discount priceDiscount, c.id couponId, cr.price_limit priceLimit,
cr.order_limit orderLimit
cr.order_limit orderLimit, cu.state
</sql>
<sql id="selectCustAvailableCoupon">
......@@ -159,6 +159,6 @@
<update id="expireCouponUser">
update coupon_user
set state = ${@com.soss.common.enums.CouponUserState @EXPIRED.getState}
where expired_time &lt; now()
where expired_time &lt; now() and state = ${@com.soss.common.enums.CouponUserState @EFFECTIVE.getState}
</update>
</mapper>
......@@ -5,16 +5,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="com.soss.system.mapper.CustomerMapper">
<resultMap type="Customer" id="CustomerResult">
<result property="id" column="id" />
<result property="userName" column="user_name" />
<result property="phone" column="phone" />
<result property="createTime" column="create_time" />
<result property="headSculpturePath" column="head_sculpture_path" />
<result property="soucre" column="soucre" />
<result property="id" column="id"/>
<result property="userName" column="user_name"/>
<result property="phone" column="phone"/>
<result property="createTime" column="create_time"/>
<result property="headSculpturePath" column="head_sculpture_path"/>
<result property="sex" column="sex"/>
<result property="birthday" column="birthday"/>
<result property="soucre" column="soucre"/>
</resultMap>
<sql id="selectCustomerVo">
select id, user_name, phone, create_time, head_sculpture_path, soucre from customer
select id, user_name, phone, create_time, head_sculpture_path, sex, birthday, soucre from customer
</sql>
<select id="selectCustomerList" parameterType="Customer" resultMap="CustomerResult">
......@@ -40,16 +42,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="phone != null">phone,</if>
<if test="createTime != null">create_time,</if>
<if test="headSculpturePath != null">head_sculpture_path,</if>
<if test="sex != null">sex,</if>
<if test="birthday != null">birthday,</if>
<if test="soucre != null">soucre,</if>
</trim>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="userName != null">#{userName},</if>
<if test="phone != null">#{phone},</if>
<if test="createTime != null">#{createTime},</if>
<if test="headSculpturePath != null">#{headSculpturePath},</if>
<if test="sex != null">#{sex},</if>
<if test="birthday != null">#{birthday},</if>
<if test="soucre != null">#{soucre},</if>
</trim>
</trim>
</insert>
<update id="updateCustomer" parameterType="Customer">
......@@ -58,6 +64,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userName != null">user_name = #{userName},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="headSculpturePath != null">head_sculpture_path = #{headSculpturePath},</if>
<if test="sex != null">sex = #{sex},</if>
<if test="birthday != null">birthday = #{birthday},</if>
<if test="soucre != null">soucre = #{soucre},</if>
<if test="allow != null">allow = #{soucre},</if>
</trim>
......
......@@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="GoodsCategory" id="GoodsCategoryResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="icon" column="icon"/>
<result property="remarks" column="remarks" />
<result property="turn" column="turn" />
<result property="state" column="state" />
......@@ -17,7 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectGoodsCategoryVo">
select id, name, remarks, turn, state, is_deleted, created_at, updated_at, code from goods_category
select id, name, icon, remarks, turn, state, is_deleted, created_at, updated_at, code from goods_category
</sql>
<select id="selectGoodsCategoryList" parameterType="GoodsCategory" resultMap="GoodsCategoryResult">
......@@ -50,6 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into goods_category
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">name,</if>
<if test="icon != null and icon != ''">icon,</if>
<if test="remarks != null">remarks,</if>
<if test="turn != null and turn != ''">turn,</if>
<if test="state != null and state != ''">state,</if>
......@@ -60,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">#{name},</if>
<if test="icon != null and icon != ''">#{icon},</if>
<if test="remarks != null">#{remarks},</if>
<if test="turn != null and turn != ''">#{turn},</if>
<if test="state != null and state != ''">#{state},</if>
......@@ -74,6 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update goods_category
<trim prefix="SET" suffixOverrides=",">
<if test="name != null and name != ''">name = #{name},</if>
<if test="icon != null and icon != ''">icon = #{icon},</if>
<if test="remarks != null">remarks = #{remarks},</if>
<if test="turn != null and turn != ''">turn = #{turn},</if>
<if test="state != null and state != ''">state = #{state},</if>
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.soss.system.mapper.OrderDetailMapper">
<resultMap type="OrderDetail" id="OrderDetailResult">
<result property="id" column="id" />
<result property="orderId" column="order_id" />
<result property="goodsId" column="goods_id" />
<result property="goodsName" column="goods_name" />
<result property="machineId" column="machine_id" />
<result property="num" column="num" />
<result property="viewAmount" column="view_amount" />
<result property="amountShould" column="amount_should" />
<result property="couponAmount" column="coupon_amount" />
<result property="realAmount" column="real_amount" />
<result property="specRuleDetail" column="spec_rule_detail" />
<result property="specRuleIds" column="spec_rule_ids" />
<result property="skuId" column="sku_id" />
<result property="goodsCategory" column="goods_category" />
<result property="createdAt" column="created_at" />
<result property="updatedAt" column="updated_at" />
<result property="id" column="id"/>
<result property="orderId" column="order_id"/>
<result property="goodsId" column="goods_id"/>
<result property="goodsName" column="goods_name"/>
<result property="machineId" column="machine_id"/>
<result property="num" column="num"/>
<result property="viewAmount" column="view_amount"/>
<result property="amountShould" column="amount_should"/>
<result property="couponAmount" column="coupon_amount"/>
<result property="realAmount" column="real_amount"/>
<result property="specRuleDetail" column="spec_rule_detail"/>
<result property="specRuleIds" column="spec_rule_ids"/>
<result property="skuId" column="sku_id"/>
<result property="goodsCategory" column="goods_category"/>
<result property="createdAt" column="created_at"/>
<result property="refundId" column="refund_id"/>
<result property="refundTime" column="refund_time"/>
<result property="updatedAt" column="updated_at"/>
</resultMap>
<sql id="selectOrderDetailVo">
select id, order_id, goods_id, goods_name, machine_id, num, view_amount, amount_should, coupon_amount, real_amount, spec_rule_detail, spec_rule_ids, sku_id, goods_category, created_at, updated_at from order_detail
select * from order_detail
</sql>
<select id="selectOrderDetailList" parameterType="OrderDetail" resultMap="OrderDetailResult">
<include refid="selectOrderDetailVo"/>
<where>
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
<if test="goodsId != null and goodsId != ''"> and goods_id = #{goodsId}</if>
<if test="goodsName != null and goodsName != ''"> and goods_name like concat('%', #{goodsName}, '%')</if>
<if test="machineId != null and machineId != ''"> and machine_id = #{machineId}</if>
<if test="num != null and num != ''"> and num = #{num}</if>
<if test="viewAmount != null "> and view_amount = #{viewAmount}</if>
<if test="amountShould != null "> and amount_should = #{amountShould}</if>
<if test="couponAmount != null "> and coupon_amount = #{couponAmount}</if>
<if test="realAmount != null "> and real_amount = #{realAmount}</if>
<if test="specRuleDetail != null and specRuleDetail != ''"> and spec_rule_detail = #{specRuleDetail}</if>
<if test="specRuleIds != null and specRuleIds != ''"> and spec_rule_ids = #{specRuleIds}</if>
<if test="skuId != null and skuId != ''"> and sku_id = #{skuId}</if>
<if test="goodsCategory != null and goodsCategory != ''"> and goods_category = #{goodsCategory}</if>
<if test="createdAt != null "> and created_at = #{createdAt}</if>
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if>
<where>
<if test="orderId != null and orderId != ''">and order_id = #{orderId}</if>
<if test="goodsId != null and goodsId != ''">and goods_id = #{goodsId}</if>
<if test="goodsName != null and goodsName != ''">and goods_name like concat('%', #{goodsName}, '%')</if>
<if test="machineId != null and machineId != ''">and machine_id = #{machineId}</if>
<if test="num != null and num != ''">and num = #{num}</if>
<if test="viewAmount != null ">and view_amount = #{viewAmount}</if>
<if test="amountShould != null ">and amount_should = #{amountShould}</if>
<if test="couponAmount != null ">and coupon_amount = #{couponAmount}</if>
<if test="realAmount != null ">and real_amount = #{realAmount}</if>
<if test="specRuleDetail != null and specRuleDetail != ''">and spec_rule_detail = #{specRuleDetail}</if>
<if test="specRuleIds != null and specRuleIds != ''">and spec_rule_ids = #{specRuleIds}</if>
<if test="skuId != null and skuId != ''">and sku_id = #{skuId}</if>
<if test="goodsCategory != null and goodsCategory != ''">and goods_category = #{goodsCategory}</if>
<if test="createdAt != null ">and created_at = #{createdAt}</if>
<if test="refundId != null ">and refund_id = #{refundId}</if>
<if test="refundTime != null ">and refund_time = #{refundTime}</if>
<if test="updatedAt != null ">and updated_at = #{updatedAt}</if>
</where>
</select>
<select id="listDetailByIds" resultMap="OrderDetailResult">
<include refid="selectOrderDetailVo"/>
where id in
<foreach collection="ids" item="id" separator="," open="(" close=")">#{id}</foreach>
</select>
<select id="selectOrderDetailById" parameterType="String" resultMap="OrderDetailResult">
<include refid="selectOrderDetailVo"/>
where id = #{id}
</select>
<insert id="insertOrderDetail" parameterType="OrderDetail" useGeneratedKeys="true" keyProperty="id">
insert into order_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
......@@ -70,8 +80,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="skuId != null and skuId != ''">sku_id,</if>
<if test="goodsCategory != null">goods_category,</if>
<if test="createdAt != null">created_at,</if>
<if test="refundId != null">refund_id,</if>
<if test="refundTime != null">refund_time,</if>
<if test="updatedAt != null">updated_at,</if>
</trim>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderId != null and orderId != ''">#{orderId},</if>
<if test="goodsId != null and goodsId != ''">#{goodsId},</if>
......@@ -87,8 +99,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="skuId != null and skuId != ''">#{skuId},</if>
<if test="goodsCategory != null">#{goodsCategory},</if>
<if test="createdAt != null">#{createdAt},</if>
<if test="refundId != null">#{refundId},</if>
<if test="refundTime != null">#{refundTime},</if>
<if test="updatedAt != null">#{updatedAt},</if>
</trim>
</trim>
</insert>
<update id="updateOrderDetail" parameterType="OrderDetail">
......@@ -107,6 +121,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="specRuleIds != null and specRuleIds != ''">spec_rule_ids = #{specRuleIds},</if>
<if test="skuId != null and skuId != ''">sku_id = #{skuId},</if>
<if test="goodsCategory != null">goods_category = #{goodsCategory},</if>
<if test="refundId != null">refund_id = #{refundId},</if>
<if test="refundTime != null">refund_time = #{refundTime},</if>
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
</trim>
where id = #{id}
......@@ -117,9 +133,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteOrderDetailByIds" parameterType="String">
delete from order_detail where id in
delete from order_detail where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="bindRefund">
update order_detail set refund_id = #{refundId} where id in
<foreach collection="ids" item="id" separator="," open="(" close=")">#{id}</foreach>
</update>
<update id="updateRefundState">
update order_detail set
<choose>
<when test="refundTime != null">refund_time = #{refundTime}</when>
<otherwise>refund_id = null, refund_time = null</otherwise>
</choose>
where refund_id = #{refundId}
</update>
</mapper>
\ No newline at end of file
......@@ -5,54 +5,64 @@
<mapper namespace="com.soss.system.mapper.OrderMapper">
<resultMap type="Order" id="OrderResult">
<result property="id" column="id" />
<result property="orderNo" column="order_no" />
<result property="orderNum" column="order_num" />
<result property="userId" column="user_id" />
<result property="userName" column="user_name" />
<result property="userPhone" column="user_phone" />
<result property="payTime" column="pay_time" />
<result property="finishTime" column="finish_time" />
<result property="amount" column="amount" />
<result property="couponId" column="coupon_id" />
<result property="couponAmount" column="coupon_amount" />
<result property="paidAmount" column="paid_amount" />
<result property="goodsNum" column="goods_num" />
<result property="pickCode" column="pick_code" />
<result property="shopId" column="shop_id" />
<result property="machineId" column="machine_id" />
<result property="source" column="source" />
<result property="state" column="state" />
<result property="createdAt" column="created_at" />
<result property="updatedAt" column="updated_at" />
<result property="id" column="id"/>
<result property="orderNo" column="order_no"/>
<result property="orderNum" column="order_num"/>
<result property="userId" column="user_id"/>
<result property="userName" column="user_name"/>
<result property="userPhone" column="user_phone"/>
<result property="payTime" column="pay_time"/>
<result property="finishTime" column="finish_time"/>
<result property="amount" column="amount"/>
<result property="couponId" column="coupon_id"/>
<result property="couponAmount" column="coupon_amount"/>
<result property="paidAmount" column="paid_amount"/>
<result property="goodsNum" column="goods_num"/>
<result property="pickCode" column="pick_code"/>
<result property="shopId" column="shop_id"/>
<result property="machineId" column="machine_id"/>
<result property="lng" column="lng"/>
<result property="lat" column="lat"/>
<result property="source" column="source"/>
<result property="state" column="state"/>
<result property="sendMsgFlag1" column="send_msg_flag1"/>
<result property="sendMsgFlag2" column="send_msg_flag2"/>
<result property="sendMsgFlag3" column="send_msg_flag3"/>
<result property="createdAt" column="created_at"/>
<result property="updatedAt" column="updated_at"/>
</resultMap>
<sql id="selectOrderVo">
select id, order_no, order_num, user_id, user_name, user_phone, pay_time, finish_time, amount, coupon_id, coupon_amount, paid_amount, goods_num, pick_code, shop_id, machine_id, source, state, created_at, updated_at from `order`
select * from `order`
</sql>
<select id="selectOrderList" parameterType="Order" resultMap="OrderResult">
<include refid="selectOrderVo"/>
<where>
<if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>
<if test="orderNum != null and orderNum != ''"> and order_num = #{orderNum}</if>
<if test="userId != null and userId != ''"> and user_id = #{userId}</if>
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
<if test="userPhone != null and userPhone != ''"> and user_phone = #{userPhone}</if>
<if test="payTime != null "> and pay_time = #{payTime}</if>
<if test="finishTime != null "> and finish_time = #{finishTime}</if>
<if test="amount != null "> and amount = #{amount}</if>
<if test="couponId != null "> and coupon_id = #{couponId}</if>
<if test="couponAmount != null "> and coupon_amount = #{couponAmount}</if>
<if test="paidAmount != null "> and paid_amount = #{paidAmount}</if>
<if test="goodsNum != null and goodsNum != ''"> and goods_num = #{goodsNum}</if>
<if test="pickCode != null and pickCode != ''"> and pick_code = #{pickCode}</if>
<if test="shopId != null and shopId != ''"> and shop_id = #{shopId}</if>
<if test="machineId != null and machineId != ''"> and machine_id = #{machineId}</if>
<if test="source != null and source != ''"> and source = #{source}</if>
<if test="state != null and state != ''"> and state = #{state}</if>
<if test="createdAt != null "> and created_at = #{createdAt}</if>
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if>
<if test="orderNo != null and orderNo != ''">and order_no = #{orderNo}</if>
<if test="orderNum != null and orderNum != ''">and order_num = #{orderNum}</if>
<if test="userId != null and userId != ''">and user_id = #{userId}</if>
<if test="userName != null and userName != ''">and user_name like concat('%', #{userName}, '%')</if>
<if test="userPhone != null and userPhone != ''">and user_phone = #{userPhone}</if>
<if test="payTime != null ">and pay_time = #{payTime}</if>
<if test="finishTime != null ">and finish_time = #{finishTime}</if>
<if test="amount != null ">and amount = #{amount}</if>
<if test="couponId != null ">and coupon_id = #{couponId}</if>
<if test="couponAmount != null ">and coupon_amount = #{couponAmount}</if>
<if test="paidAmount != null ">and paid_amount = #{paidAmount}</if>
<if test="goodsNum != null and goodsNum != ''">and goods_num = #{goodsNum}</if>
<if test="pickCode != null and pickCode != ''">and pick_code = #{pickCode}</if>
<if test="shopId != null and shopId != ''">and shop_id = #{shopId}</if>
<if test="machineId != null and machineId != ''">and machine_id = #{machineId}</if>
<if test="lng != null">and lng = #{lng}</if>
<if test="lat != null">and lat = #{lat}</if>
<if test="source != null and source != ''">and source = #{source}</if>
<if test="state != null and state != ''">and state = #{state}</if>
<if test="sendMsgFlag1 != null">and send_msg_flag1 = #{sendMsgFlag1}</if>
<if test="sendMsgFlag2 != null">and send_msg_flag2 = #{sendMsgFlag2}</if>
<if test="sendMsgFlag3 != null">and send_msg_flag3 = #{sendMsgFlag3}</if>
<if test="createdAt != null ">and created_at = #{createdAt}</if>
<if test="updatedAt != null ">and updated_at = #{updatedAt}</if>
</where>
</select>
......@@ -80,11 +90,16 @@
<if test="pickCode != null and pickCode != ''">pick_code,</if>
<if test="shopId != null and shopId != ''">shop_id,</if>
<if test="machineId != null and machineId != ''">machine_id,</if>
<if test="lng != null">lng,</if>
<if test="lat != null">lat,</if>
<if test="source != null and source != ''">source,</if>
<if test="state != null and state != ''">state,</if>
<if test="sendMsgFlag1 != null">send_msg_flag1,</if>
<if test="sendMsgFlag2 != null">send_msg_flag2,</if>
<if test="sendMsgFlag3 != null">send_msg_flag3,</if>
<if test="createdAt != null">created_at,</if>
<if test="updatedAt != null">updated_at,</if>
</trim>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderNo != null and orderNo != ''">#{orderNo},</if>
<if test="orderNum != null and orderNum != ''">#{orderNum},</if>
......@@ -103,9 +118,12 @@
<if test="machineId != null and machineId != ''">#{machineId},</if>
<if test="source != null and source != ''">#{source},</if>
<if test="state != null and state != ''">#{state},</if>
<if test="sendMsgFlag1 != null">#{sendMsgFlag1},</if>
<if test="sendMsgFlag2 != null">#{sendMsgFlag2},</if>
<if test="sendMsgFlag3 != null">#{sendMsgFlag3},</if>
<if test="createdAt != null">#{createdAt},</if>
<if test="updatedAt != null">#{updatedAt},</if>
</trim>
</trim>
</insert>
<update id="updateOrder" parameterType="Order">
......@@ -126,8 +144,13 @@
<if test="pickCode != null and pickCode != ''">pick_code = #{pickCode},</if>
<if test="shopId != null and shopId != ''">shop_id = #{shopId},</if>
<if test="machineId != null and machineId != ''">machine_id = #{machineId},</if>
<if test="lng != null">lng = #{lng},</if>
<if test="lat != null">lat = #{lat},</if>
<if test="source != null and source != ''">source = #{source},</if>
<if test="state != null and state != ''">state = #{state},</if>
<if test="sendMsgFlag1 != null">send_msg_flag1 = #{sendMsgFlag1},</if>
<if test="sendMsgFlag2 != null">send_msg_flag2 = #{sendMsgFlag2},</if>
<if test="sendMsgFlag3 != null">send_msg_flag3 = #{sendMsgFlag3},</if>
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
</trim>
where id = #{id}
......
......@@ -119,12 +119,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<![CDATA[ and o.pay_time >= #{payAtStart}]]>
</if>
<if test="payAtEnd!=null and payAtEnd != ''">
<![CDATA[ and o.pay_time <= #{payAtEnd}]]>
</if>
<if test="payAtEnd!=null and payAtEnd != ''">
<![CDATA[ and o.pay_time <= #{payAtEnd}]]>
</if>
order by or2.created_at desc
</select>
order by or2.created_at desc
<select id="sumOrderRefundAmount" resultType="java.math.BigDecimal">
select sum(refund_amount) from order_refund where order_id = #{orderId}
and state = ${@com.soss.common.enums.RefundState @SUCCESS.getState}
</select>
</mapper>
\ No newline at end of file
......@@ -17,6 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="province" column="province" />
<result property="city" column="city" />
<result property="zone" column="zone"/>
<result property="distanceLimit" column="distance_limit"/>
<result property="state" column="state"/>
<result property="createdAt" column="created_at"/>
<result property="updatedAt" column="updated_at"/>
......@@ -24,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectShopVo">
select id, name, code, lng, lat, remarks, start_time, end_time, address, province, city, zone, state, created_at, updated_at, is_default from shop
select id, name, code, lng, lat, remarks, start_time, end_time, address, province, city, zone, distance_limit, state, created_at, updated_at, is_default from shop
</sql>
<select id="selectAllShop" resultMap="ShopResult">
......@@ -77,6 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="province != null and province != ''">province,</if>
<if test="city != null and city != ''">city,</if>
<if test="zone != null">zone,</if>
<if test="distanceLimit != null">distance_limit,</if>
<if test="state != null">state,</if>
<if test="createdAt != null">created_at,</if>
<if test="updatedAt != null">updated_at,</if>
......@@ -94,6 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="province != null and province != ''">#{province},</if>
<if test="city != null and city != ''">#{city},</if>
<if test="zone != null">#{zone},</if>
<if test="distanceLimit != null">#{distanceLimit},</if>
<if test="state != null">#{state},</if>
<if test="createdAt != null">#{createdAt},</if>
<if test="updatedAt != null">#{updatedAt},</if>
......@@ -115,6 +118,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="province != null and province != ''">province = #{province},</if>
<if test="city != null and city != ''">city = #{city},</if>
<if test="zone != null">zone = #{zone},</if>
<if test="distanceLimit != null">distance_limit = #{distanceLimit},</if>
<if test="state != null">state = #{state},</if>
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
<if test="isDefault != null">is_default = #{isDefault},</if>
......
......@@ -15,10 +15,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updatedAt" column="updated_at" />
<result property="code" column="code" />
<result property="remark" column="remark" />
<result property="materialRemark" column="material_remark"/>
</resultMap>
<sql id="selectSpecVo">
select id, name, state, is_show, is_deleted, is_neccessary, created_at, updated_at, code,remark from spec
select * from spec
</sql>
<select id="selectSpecList" parameterType="Spec" resultMap="SpecResult">
......@@ -54,6 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updatedAt != null">updated_at,</if>
<if test="code != null">code,</if>
<if test="remark != null">remark,</if>
<if test="materialRemark != null">material_remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">#{name},</if>
......@@ -65,6 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updatedAt != null">#{updatedAt},</if>
<if test="code != null">#{code},</if>
<if test="remark != null">#{remark},</if>
<if test="materialRemark != null">#{materialRemark},</if>
</trim>
</insert>
......@@ -79,6 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
<if test="code != null">code = #{code},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="materialRemark != null">material_remark = #{materialRemark},</if>
</trim>
where id = #{id}
</update>
......
......@@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="userId" column="user_id" />
<result property="msgId" column="msg_id" />
<result property="message" column="message" />
<result property="targetId" column="target_id"/>
<result property="targetUrl" column="target_url" />
<result property="state" column="state" />
<result property="type" column="type" />
......@@ -19,7 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectWechatMessageVo">
select id, user_id, msg_id, message, target_url, state, type, is_read, is_deleted, created_at, updated_at from wechat_message
select * from wechat_message
</sql>
<select id="selectWechatMessageList" parameterType="WechatMessage" resultMap="WechatMessageResult">
......@@ -28,9 +29,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userId != null "> and user_id = #{userId}</if>
<if test="msgId != null and msgId != ''"> and msg_id = #{msgId}</if>
<if test="message != null and message != ''"> and message = #{message}</if>
<if test="targetId != null">and target_id = #{targetId}</if>
<if test="targetUrl != null and targetUrl != ''"> and target_url = #{targetUrl}</if>
<if test="state != null and state != ''"> and state = #{state}</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="type != null"> and type = #{type}</if>
<if test="isRead != null and isRead != ''"> and is_read = #{isRead}</if>
<if test="isDeleted != null and isDeleted != ''"> and is_deleted = #{isDeleted}</if>
<if test="createdAt != null "> and created_at = #{createdAt}</if>
......@@ -50,9 +52,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userId != null">user_id,</if>
<if test="msgId != null and msgId != ''">msg_id,</if>
<if test="message != null and message != ''">message,</if>
<if test="targetId != null">target_id,</if>
<if test="targetUrl != null and targetUrl != ''">target_url,</if>
<if test="state != null and state != ''">state,</if>
<if test="type != null and type != ''">type,</if>
<if test="type != null">type,</if>
<if test="isRead != null and isRead != ''">is_read,</if>
<if test="isDeleted != null and isDeleted != ''">is_deleted,</if>
<if test="createdAt != null">created_at,</if>
......@@ -62,9 +65,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userId != null">#{userId},</if>
<if test="msgId != null and msgId != ''">#{msgId},</if>
<if test="message != null and message != ''">#{message},</if>
<if test="targetId != null">#{targetId},</if>
<if test="targetUrl != null and targetUrl != ''">#{targetUrl},</if>
<if test="state != null and state != ''">#{state},</if>
<if test="type != null and type != ''">#{type},</if>
<if test="type != null">#{type},</if>
<if test="isRead != null and isRead != ''">#{isRead},</if>
<if test="isDeleted != null and isDeleted != ''">#{isDeleted},</if>
<if test="createdAt != null">#{createdAt},</if>
......@@ -78,9 +82,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userId != null">user_id = #{userId},</if>
<if test="msgId != null and msgId != ''">msg_id = #{msgId},</if>
<if test="message != null and message != ''">message = #{message},</if>
<if test="targetId != null">target_id = #{targetId},</if>
<if test="targetUrl != null and targetUrl != ''">target_url = #{targetUrl},</if>
<if test="state != null and state != ''">state = #{state},</if>
<if test="type != null and type != ''">type = #{type},</if>
<if test="type != null">type = #{type},</if>
<if test="isRead != null and isRead != ''">is_read = #{isRead},</if>
<if test="isDeleted != null and isDeleted != ''">is_deleted = #{isDeleted},</if>
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment