New file |
| | |
| | | package com.panzhihua.applets_backstage.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsOrderVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 商业街订单表(McsOrder)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2022-01-04 16:10:07 |
| | | */ |
| | | @Api(tags = {"商业街订单API"}) |
| | | @RestController |
| | | @RequestMapping("mcsOrder") |
| | | public class McsOrderApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "分页查询订单",response = McsOrderVO.class) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | return communityService.selectAllMscOrder(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation(value = "通过主键查询单条数据",response = McsOrderVO.class) |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Long id) { |
| | | return communityService.selectOneMscOrder(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param mcsOrderVO 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @ApiOperation("新增数据") |
| | | @PostMapping |
| | | public R insert(@RequestBody McsOrderVO mcsOrderVO) { |
| | | return communityService.insertMscOrder(mcsOrderVO); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param mcsOrderVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @ApiOperation("修改订单") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody McsOrderVO mcsOrderVO) { |
| | | return communityService.updateMscOrder(mcsOrderVO); |
| | | } |
| | | |
| | | /** |
| | | * 微信支付 |
| | | * @param mcsOrderVO |
| | | * @return |
| | | */ |
| | | @ApiOperation("微信支付") |
| | | @PostMapping("/wxPay") |
| | | public R wxPay(@RequestBody McsOrderVO mcsOrderVO){ |
| | | return communityService.wxPayMscOrder(mcsOrderVO); |
| | | } |
| | | |
| | | /** |
| | | * 发送提醒短信 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation("发送提醒短信") |
| | | @GetMapping("/sendContent") |
| | | public R sendContent(@RequestParam("id") Long id){ |
| | | return communityService.sendContentMcsOrder(id); |
| | | } |
| | | |
| | | /** |
| | | *微信支付回调 |
| | | * @param mcsOrderVO |
| | | * @return |
| | | */ |
| | | @ApiOperation("微信支付回调") |
| | | @PostMapping("/notify") |
| | | public R notify(@RequestBody McsOrderVO mcsOrderVO){ |
| | | return communityService.notifyMcsOrder(mcsOrderVO); |
| | | } |
| | | |
| | | } |
| | |
| | | private Integer paramId2; |
| | | @ApiModelProperty("社区id") |
| | | private Long communityId; |
| | | @ApiModelProperty("商家id") |
| | | private Long merchantId; |
| | | } |
| | |
| | | package com.panzhihua.common.model.vos.community.microCommercialStreet; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | @Data |
| | | @ApiModel("商业街订单表") |
| | |
| | | * 订单编号 |
| | | */ |
| | | @ApiModelProperty(value = "订单编号") |
| | | private Long orderNo; |
| | | private String orderNo; |
| | | |
| | | /** |
| | | * 支付配置id |
| | |
| | | * 支付金额 |
| | | */ |
| | | @ApiModelProperty(value = "支付金额") |
| | | private Double money; |
| | | private BigDecimal money; |
| | | |
| | | /** |
| | | * 支付时间 |
| | | */ |
| | | @ApiModelProperty(value = "支付时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date payTime; |
| | | |
| | | /** |
| | |
| | | * 支付流水号 |
| | | */ |
| | | @ApiModelProperty(value = "支付流水号") |
| | | private Long payNo; |
| | | private String payNo; |
| | | |
| | | /** |
| | | * 用户id |
| | |
| | | */ |
| | | @ApiModelProperty("商家账号") |
| | | private String merchantAccount; |
| | | @ApiModelProperty("创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createTime; |
| | | @ApiModelProperty("交易类型 MWEB-->h5支付 NATIVE-->pc端支付 JSAPI-->小程序支付") |
| | | private String tradeType; |
| | | |
| | | @ApiModelProperty("openid") |
| | | private String openId; |
| | | } |
| | |
| | | private final static String URL = "https://106.ihuyi.com/webservice/sms.php?method=Submit"; |
| | | private final static String ACCOUNT="C87595580"; |
| | | private final static String PASSWORD="b66d918a598ad126b85b13e82a38e165"; |
| | | private final static String CONTENT="您有一笔订单还未付款,超时未付款订单将自动取消。"; |
| | | public int sendCode(String mobile,String code){ |
| | | try { |
| | | String requestUrl=URL+"&account="+ACCOUNT+"&password="+PayUtil.MD5(PASSWORD)+"&mobile="+mobile+"&content="+"您的验证码是:"+code+"。请不要把验证码泄露给其他人。"; |
| | |
| | | return 0; |
| | | } |
| | | |
| | | public int sendContent(String mobile,String content){ |
| | | public int sendContent(String mobile){ |
| | | try { |
| | | String requestUrl=URL+"&account="+ACCOUNT+"&password="+PayUtil.MD5(PASSWORD)+"&mobile="+mobile+"&content="+content; |
| | | String requestUrl=URL+"&account="+ACCOUNT+"&password="+PayUtil.MD5(PASSWORD)+"&mobile="+mobile+"&content="+CONTENT; |
| | | String res=HttpClientUtil.httpGet(requestUrl, null,null); |
| | | JSONObject jsonObject=XML.toJSONObject(res); |
| | | if(jsonObject.get("SubmitResult")!=null){ |
| | |
| | | parameters.put("paySign", sign); |
| | | return parameters; |
| | | } |
| | | public static String h5pay(String appid, String mchId, String payKey, String notifyUrl, String body, |
| | | String openid, String outTradeNo, BigDecimal money, String tradeType) { |
| | | String nonceStr = PayUtil.makeUUID(32); |
| | | SortedMap<Object, Object> params = new TreeMap<>(); |
| | | params.put("appid", appid); |
| | | params.put("body", body); |
| | | params.put("mch_id", mchId); |
| | | params.put("nonce_str", nonceStr); |
| | | params.put("notify_url", notifyUrl); |
| | | params.put("openid", openid); |
| | | params.put("out_trade_no", outTradeNo);// 商品订单号 |
| | | params.put("spbill_create_ip", PayUtil.getLocalIp());// 服务部署的ip |
| | | params.put("total_fee", PayUtil.moneyToIntegerStr(money));// 费用的参数转型 |
| | | params.put("trade_type", tradeType);// 对接类型 |
| | | params.put("sign", PayUtil.createSign(PayCpmstant.DEFAULT_ENCODING, params, payKey));// MD5签名 |
| | | // 转换成xml |
| | | String xmlData = PayUtil.getRequestXml(params); |
| | | // 请求微信后台,获取支付id |
| | | String resXml = HttpClientUtil.httpsRequest(PayCpmstant.UNIFIEDORDER_URL, xmlData); |
| | | log.info("请求微信支付返回参数:" + resXml); |
| | | |
| | | org.json.JSONObject resultData = XML.toJSONObject(resXml); |
| | | JSONObject data = JSON.parseObject(resultData.get("xml").toString()); |
| | | JSONObject result = new JSONObject(); |
| | | |
| | | if (data.get("return_msg").equals(PayCpmstant.RETURN_MSG) |
| | | && data.get("return_code").equals(PayCpmstant.RETURN_CODE)) { |
| | | // 将微信统一下单成功的参数拼接再签名 |
| | | // 统一下单返回prepay_id |
| | | if(tradeType.equals("JSAPI")) { |
| | | String prepayId = "prepay_id=" + data.getString("prepay_id"); |
| | | // 时间戳 |
| | | Long timeStamp = System.currentTimeMillis() / 1000; |
| | | // 封装需要签名的字段 |
| | | SortedMap<Object, Object> payParams = new TreeMap<>(); |
| | | payParams.put("appId", appid); |
| | | payParams.put("nonceStr", nonceStr); |
| | | payParams.put("package", prepayId); |
| | | payParams.put("signType", PayCpmstant.SIGN_TYPE); |
| | | payParams.put("timeStamp", timeStamp); |
| | | // 将参数以及签名计算完成封装返回给前端 |
| | | result.put("timeStamp", timeStamp); |
| | | result.put("nonceStr", nonceStr); |
| | | result.put("package", prepayId); |
| | | result.put("signType", PayCpmstant.SIGN_TYPE); |
| | | result.put("paySign", PayUtil.createSign(PayCpmstant.DEFAULT_ENCODING, payParams, payKey)); |
| | | } |
| | | else if(tradeType.equals("NATIVE")){ |
| | | result.put("codeUrl",data.getString("code_url")); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | return result.toJSONString(); |
| | | } |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsOrderVO; |
| | | import com.panzhihua.common.utlis.SmsUtil; |
| | | import com.panzhihua.service_community.entity.McsOrder; |
| | | import com.panzhihua.service_community.service.McsOrderService; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | return R.ok(this.mcsOrderService.updateById(mcsOrder)); |
| | | } |
| | | |
| | | /** |
| | | * 微信支付 |
| | | * @param mcsOrderVO |
| | | * @return |
| | | */ |
| | | @PostMapping("/wxPay") |
| | | public R wxPay(@RequestBody McsOrderVO mcsOrderVO){ |
| | | return this.mcsOrderService.wxPay(mcsOrderVO); |
| | | } |
| | | |
| | | /** |
| | | * 发送提醒短信 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/sendContent") |
| | | public R sendContent(@RequestParam("id") Long id){ |
| | | return this.mcsOrderService.sendContent(id); |
| | | } |
| | | |
| | | /** |
| | | *微信支付回调 |
| | | * @param mcsOrderVO |
| | | * @return |
| | | */ |
| | | @PostMapping("/notify") |
| | | public R notify(@RequestBody McsOrderVO mcsOrderVO){ |
| | | return this.mcsOrderService.notify(mcsOrderVO); |
| | | } |
| | | |
| | | } |
| | |
| | | public static final String Order_ROUTING_KEY="order.key"; |
| | | public static final String Order_EXCHANGE="order.exchange"; |
| | | |
| | | public static final String McsOrder_QUEUE="mcsOrder.queue"; |
| | | public static final String McsOrder_ROUTING_KEY="mcsOrder.key"; |
| | | public static final String McsOrder_EXCHANGE="mcsOrder.exchange"; |
| | | |
| | | |
| | | @Bean |
| | |
| | | } |
| | | |
| | | @Bean |
| | | public Queue mcsOrderQueue(){ |
| | | return new Queue(McsOrder_QUEUE,true,false,false,null); |
| | | } |
| | | |
| | | @Bean |
| | | public Exchange mcsOrderExchange(){ |
| | | Map<String, Object> arguments = new HashMap<>(); |
| | | arguments.put("x-delayed-type", ExchangeTypes.DIRECT); |
| | | return new CustomExchange(McsOrder_EXCHANGE,"x-delayed-message",true,false,arguments); |
| | | } |
| | | |
| | | @Bean |
| | | public Binding mcsOrderBinding(){ |
| | | return BindingBuilder.bind(mcsOrderQueue()).to(mcsOrderExchange()).with(McsOrder_ROUTING_KEY).noargs(); |
| | | } |
| | | |
| | | @Bean |
| | | public Queue orderQueue(){ |
| | | return new Queue(Order_QUEUE,true,false,false,null); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | McsOrderVO detail(Long id); |
| | | |
| | | /** |
| | | * 订单id查询电话 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | String selectPhone(Long id); |
| | | } |
| | |
| | | package com.panzhihua.service_community.entity; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | |
| | | * 订单编号 |
| | | */ |
| | | @ApiModelProperty(value = "订单编号") |
| | | private Long orderNo; |
| | | private String orderNo; |
| | | |
| | | /** |
| | | * 支付配置id |
| | |
| | | * 支付金额 |
| | | */ |
| | | @ApiModelProperty(value = "支付金额") |
| | | private Double money; |
| | | private BigDecimal money; |
| | | |
| | | /** |
| | | * 支付时间 |
| | |
| | | * 支付流水号 |
| | | */ |
| | | @ApiModelProperty(value = "支付流水号") |
| | | private Long payNo; |
| | | private String payNo; |
| | | |
| | | /** |
| | | * 用户id |
| | |
| | | @ApiModelProperty(value = "用户id") |
| | | private Long userId; |
| | | |
| | | private Date createTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.message; |
| | | |
| | | import com.panzhihua.service_community.dao.McsOrderDao; |
| | | import com.panzhihua.service_community.entity.McsOrder; |
| | | import org.springframework.amqp.rabbit.annotation.RabbitListener; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @author zzj |
| | | */ |
| | | @Component |
| | | public class McsOrderMessage { |
| | | public static final String DELAYED_QUEUE="mcsOrder.queue"; |
| | | @Resource |
| | | private McsOrderDao mcsOrderDao; |
| | | @RabbitListener(queues=DELAYED_QUEUE) |
| | | public void cancelOrder(McsOrder mcsOrder){ |
| | | McsOrder nowOrder=mcsOrderDao.selectById(mcsOrder.getId()); |
| | | if(nowOrder.getStatus()==0){ |
| | | mcsOrder.setStatus(2); |
| | | mcsOrderDao.updateById(mcsOrder); |
| | | } |
| | | } |
| | | } |
| | |
| | | */ |
| | | R insert(McsOrderVO mcsOrderVO); |
| | | |
| | | /** |
| | | * 详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | R detail(Long id); |
| | | |
| | | /** |
| | | * 支付 |
| | | * @param mcsOrderVO |
| | | * @return |
| | | */ |
| | | R wxPay(McsOrderVO mcsOrderVO); |
| | | |
| | | /** |
| | | *订单id查询手机号 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | R sendContent(Long id); |
| | | |
| | | /** |
| | | *微信支付回调 |
| | | * @param mcsOrderVO |
| | | * @return |
| | | */ |
| | | R notify(McsOrderVO mcsOrderVO); |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsOrderVO; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.SmsUtil; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.common.utlis.WxPayUtils; |
| | | import com.panzhihua.service_community.entity.McsOrder; |
| | | import com.panzhihua.service_community.dao.McsOrderDao; |
| | | import com.panzhihua.service_community.service.McsOrderService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.amqp.rabbit.core.RabbitTemplate; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 商业街订单表(McsOrder)表服务实现类 |
| | |
| | | @Slf4j |
| | | @Service |
| | | public class McsOrderServiceImpl extends ServiceImpl<McsOrderDao, McsOrder> implements McsOrderService { |
| | | |
| | | @Value("${min.app.isTest}") |
| | | private Boolean isTest; |
| | | @Value("${min.app.appid}") |
| | | private String appid; |
| | | @Value("${min.app.payKey}") |
| | | private String payKey; |
| | | @Value("${min.app.mchId}") |
| | | private String mchId; |
| | | //@Value("${min.app.notifyUrl}") |
| | | private String notifyUrl="www.baidu.com"; |
| | | @Resource |
| | | private RabbitTemplate rabbitTemplate; |
| | | @Override |
| | | public R pageList(CommonPage commonPage) { |
| | | return R.ok(this.baseMapper.pageList(new Page(commonPage.getPage(),commonPage.getSize()),commonPage)); |
| | |
| | | |
| | | @Override |
| | | public R insert(McsOrderVO mcsOrderVO) { |
| | | return null; |
| | | McsOrder mcsOrder=new McsOrder(); |
| | | BeanUtils.copyProperties(mcsOrderVO,mcsOrder); |
| | | mcsOrder.setStatus(0); |
| | | mcsOrder.setCreateTime(new Date()); |
| | | mcsOrder.setOrderNo(DateUtils.getCurrentDateStr()); |
| | | this.baseMapper.insert(mcsOrder); |
| | | rabbitTemplate.convertAndSend("mcsOrder.exchange", "mcsOrder.key", mcsOrder, message -> { |
| | | message.getMessageProperties().setHeader("x-delay", 1000 * 1800); |
| | | return message; |
| | | }); |
| | | return R.ok(mcsOrder); |
| | | } |
| | | |
| | | @Override |
| | | public R detail(Long id) { |
| | | return R.ok(this.baseMapper.detail(id)); |
| | | } |
| | | |
| | | @Override |
| | | public R wxPay(McsOrderVO mcsOrderVO) { |
| | | McsOrder mcsOrder=this.baseMapper.selectById(mcsOrderVO.getId()); |
| | | if(mcsOrder!=null&&mcsOrder.getStatus()==0){ |
| | | try { |
| | | BigDecimal money = mcsOrder.getMoney(); |
| | | if (isTest) { |
| | | money = BigDecimal.valueOf(0.01); |
| | | } |
| | | // 调用wx支付 |
| | | String result= WxPayUtils.h5pay(appid, mchId, payKey, notifyUrl, "点亮支付", mcsOrderVO.getOpenId(), |
| | | mcsOrderVO.getOrderNo().toString(), money,mcsOrderVO.getTradeType()); |
| | | return R.ok(result); |
| | | } catch (Exception e) { |
| | | log.error("调用微信支付异常,异常原因:" + e.getMessage()); |
| | | } |
| | | } |
| | | return R.fail("订单状态异常"); |
| | | } |
| | | |
| | | @Override |
| | | public R sendContent(Long id) { |
| | | String phone=this.baseMapper.selectPhone(id); |
| | | if(StringUtils.isNotEmpty(phone)){ |
| | | SmsUtil smsUtil=new SmsUtil(); |
| | | int result=smsUtil.sendContent(phone); |
| | | if(result>0){ |
| | | return R.ok(); |
| | | } |
| | | } |
| | | return R.fail("短信发送异常"); |
| | | } |
| | | |
| | | @Override |
| | | public R notify(McsOrderVO mcsOrderVO) { |
| | | McsOrder mcsOrder=new McsOrder(); |
| | | BeanUtils.copyProperties(mcsOrderVO,mcsOrder); |
| | | return R.ok(this.baseMapper.updateById(mcsOrder)); |
| | | } |
| | | } |
| | |
| | | <if test="commonPage.userId !=null"> |
| | | and t.user_id = #{commonPage.userId} |
| | | </if> |
| | | <if test="commonPage.merchantId !=null"> |
| | | and t.merchant_id = #{commonPage.merchantId} |
| | | </if> |
| | | </where> |
| | | order by t.create_time desc |
| | | </select> |
| | |
| | | where t.id =#{id} |
| | | </select> |
| | | |
| | | <select id="selectPhone" > |
| | | select t1.phone from mcs_order t on t.merchant_id = t1.id where t.id=#{id} |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | package com.panzhihua.shop_backstage.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsOrderVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 商业街订单表(McsOrder)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2022-01-04 16:10:07 |
| | | */ |
| | | @Api(tags = {"商业街订单API"}) |
| | | @RestController |
| | | @RequestMapping("mcsOrder") |
| | | public class McsOrderApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "分页查询订单",response = McsOrderVO.class) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | return communityService.selectAllMscOrder(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation(value = "通过主键查询单条数据",response = McsOrderVO.class) |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Long id) { |
| | | return communityService.selectOneMscOrder(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param mcsOrderVO 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @ApiOperation("新增数据") |
| | | @PostMapping |
| | | public R insert(@RequestBody McsOrderVO mcsOrderVO) { |
| | | return communityService.insertMscOrder(mcsOrderVO); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param mcsOrderVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @ApiOperation("修改订单") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody McsOrderVO mcsOrderVO) { |
| | | return communityService.updateMscOrder(mcsOrderVO); |
| | | } |
| | | |
| | | /** |
| | | * 微信支付 |
| | | * @param mcsOrderVO |
| | | * @return |
| | | */ |
| | | @ApiOperation("微信支付") |
| | | @PostMapping("/wxPay") |
| | | public R wxPay(@RequestBody McsOrderVO mcsOrderVO){ |
| | | return communityService.wxPayMscOrder(mcsOrderVO); |
| | | } |
| | | |
| | | /** |
| | | * 发送提醒短信 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation("发送提醒短信") |
| | | @GetMapping("/sendContent") |
| | | public R sendContent(@RequestParam("id") Long id){ |
| | | return communityService.sendContentMcsOrder(id); |
| | | } |
| | | |
| | | /** |
| | | *微信支付回调 |
| | | * @param mcsOrderVO |
| | | * @return |
| | | */ |
| | | @ApiOperation("微信支付回调") |
| | | @PostMapping("/notify") |
| | | public R notify(@RequestBody McsOrderVO mcsOrderVO){ |
| | | return communityService.notifyMcsOrder(mcsOrderVO); |
| | | } |
| | | |
| | | } |