| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.concurrent.atomic.AtomicBoolean; |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import cn.binarywang.wx.miniapp.api.WxMaSecCheckService; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.panzhihua.applets.config.MinioUtil; |
| | | import com.panzhihua.applets.config.WxMaConfiguration; |
| | | import com.panzhihua.applets.umf.UmfPayUtil; |
| | | import com.panzhihua.applets.unionpay.*; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.constants.FtpConstants; |
| | | import com.panzhihua.common.constants.UserConstants; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.bracelet.BraceletEarlyWarningDO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.Base64File; |
| | | import com.panzhihua.common.model.vos.community.WeatherVO; |
| | | import com.panzhihua.common.model.vos.user.UserPhoneVO; |
| | | import com.panzhihua.common.service.bracelet.CommunityBraceletService; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import net.coobird.thumbnailator.Thumbnails; |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.apache.commons.lang3.RandomUtils; |
| | |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.panzhihua.applets.config.WxMaConfiguration; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.constants.FtpConstants; |
| | | import com.panzhihua.common.constants.UserConstants; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.WeatherVO; |
| | | import com.panzhihua.common.model.vos.user.UserPhoneVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import cn.binarywang.wx.miniapp.api.WxMaSecCheckService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.concurrent.atomic.AtomicBoolean; |
| | | |
| | | import static com.panzhihua.common.utlis.FileTypeUploadUtils.assertAllowed; |
| | | import static com.panzhihua.common.utlis.PayUtil.makeUUID; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | private WxMaConfiguration wxMaConfiguration; |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @Resource |
| | | private CommunityBraceletService communityBraceletService; |
| | | @Resource |
| | | private MinioUtil minioUtil; |
| | | @Resource |
| | |
| | | @GetMapping(value = "getSafety") |
| | | public R getSafety() |
| | | { |
| | | return R.ok("http://pzh.axhpx.com/Wechat/"); |
| | | return R.ok("https://pzh.axhpx.com/Wechat/"); |
| | | } |
| | | |
| | | |
| | |
| | | Map map=umfPayUtil.pay(orderid, DateUtils.getCurrentDateString(),openid,amount); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | @ApiOperation("无水洗车下单接口") |
| | | @GetMapping("/wsPay") |
| | | public R wsPay(@RequestParam("orderid") String orderid,@RequestParam("openid")String openid,@RequestParam("amount")String amount){ |
| | | Map map=umfPayUtil.pay2(orderid, DateUtils.getCurrentDateString(),openid,amount); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @ApiOperation("uu洗车银联下单接口") |
| | | @GetMapping("/uuUnionpayPay") |
| | | public R uuUnionpayPay(@RequestParam("amount")String amount, |
| | | @RequestParam("productId")String productId, |
| | | @RequestParam("openId")String openId){ |
| | | |
| | | LocalDateTime time=DateUtils.getCurrentDate(); |
| | | String merOrderId= UnionpayContent.TOP4+time.format(DateUtils.format_ymdhms_yyyyMMddmmHHssSSS)+makeUUID(7); |
| | | String map= UnifiedOrder.sendOrder(amount,"uu洗车下单",productId,openId,time,merOrderId); |
| | | communityService.add(productId,merOrderId,amount); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | @ApiOperation("无水洗车银联下单接口") |
| | | @GetMapping("/wsUnionpayPay") |
| | | public R wsUnionpayPay(@RequestParam("amount")String amount, |
| | | @RequestParam("productId")String productId, |
| | | @RequestParam("openId")String openId){ |
| | | LocalDateTime time=DateUtils.getCurrentDate(); |
| | | String merOrderId= UnionpayContent.TOP4+time.format(DateUtils.format_ymdhms_yyyyMMddmmHHssSSS)+makeUUID(7); |
| | | String map= UnifiedOrder.sendOrder(amount,"无水洗车下单",productId,openId,time,merOrderId); |
| | | communityService.add(productId,merOrderId,amount); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | @ApiOperation("uu洗车银联退款接口") |
| | | @GetMapping("/uuUnionpayRefund") |
| | | public R uuUnionpayRefundPay(@RequestParam("refundAmount")String refundAmount, |
| | | @RequestParam("refundOrderId")String refundOrderId){ |
| | | String map= Refund.sendOrder(refundAmount,refundOrderId); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | @ApiOperation("无水洗车银联退款接口") |
| | | @GetMapping("/wsUnionpayRefund") |
| | | public R wsUnionpayRefundPay(@RequestParam("refundAmount")String refundAmount, |
| | | @RequestParam("refundOrderId")String refundOrderId){ |
| | | String map= Refund.sendOrder(refundAmount,refundOrderId); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("银联支付查询接口") |
| | | @GetMapping("/unionpayQuery") |
| | | public R unionpayRefundPay(@RequestParam("merOrderId")String merOrderId){ |
| | | String map= Query.query(merOrderId); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | @ApiOperation("银联退款查询接口") |
| | | @GetMapping("/unionpayRefundQuery") |
| | | public R unionpayRefundQuery(@RequestParam("merOrderId")String merOrderId){ |
| | | String map= RefundQuery.refundQuery(merOrderId); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取预警数据 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @ApiOperation("微信手环人员处理工单列表") |
| | | @GetMapping("bracelet/getEarlyWarningList") |
| | | public R getList(@RequestParam("pageNum") Integer pageNum, |
| | | @RequestParam("pageSize") Integer pageSize, |
| | | @RequestParam("communityId") String communityId, |
| | | @RequestParam("disposeUserId") String disposeUserId, |
| | | @RequestParam("type") String type) |
| | | { |
| | | return communityBraceletService.getList(pageNum,pageSize,communityId,"",disposeUserId,type,"",""); |
| | | } |
| | | |
| | | /** |
| | | * 微信处理接口 |
| | | * @param braceletEarlyWarningDO |
| | | * @return |
| | | */ |
| | | @PostMapping("bracelet/WXdispose") |
| | | public R WXdispose(@RequestBody BraceletEarlyWarningDO braceletEarlyWarningDO) |
| | | { |
| | | if(StringUtils.isEmpty(braceletEarlyWarningDO.getDisposeText())) |
| | | { |
| | | return R.fail("处理内容不能为空"); |
| | | } |
| | | braceletEarlyWarningDO.setDisposeType("2"); |
| | | return communityBraceletService.WXdispose(braceletEarlyWarningDO); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |