| @@ -253,14 +253,14 @@ public class WxOrderController extends BaseController { | |||||
| data.put("pay_expire_seconds",14*60); | data.put("pay_expire_seconds",14*60); | ||||
| data.put("order_entry_schema",wxOrderService.getOrderEntrySchema(order.getMainOrderId())); | data.put("order_entry_schema",wxOrderService.getOrderEntrySchema(order.getMainOrderId())); | ||||
| // List<Map<String,String>> order_goods_info = new ArrayList<>(); | |||||
| // for (CreateOrderCallback.Good good:createOrderCallback.getGoods()) { | |||||
| // Map<String,String> map_info = new HashMap<>(); | |||||
| // map_info.put("goods_id",good.getGoodsId()); | |||||
| // map_info.put("merchant_uid","71070743816369953633"); | |||||
| // order_goods_info.add(map_info); | |||||
| // } | |||||
| // data.put("order_goods_info",order_goods_info); | |||||
| List<Map<String,String>> order_goods_info = new ArrayList<>(); | |||||
| for (CreateOrderCallback.Good good:createOrderCallback.getGoods()) { | |||||
| Map<String,String> map_info = new HashMap<>(); | |||||
| map_info.put("goods_id",good.getGoodsId()); | |||||
| map_info.put("merchant_uid","71228500084451433283"); | |||||
| order_goods_info.add(map_info); | |||||
| } | |||||
| data.put("order_goods_info",order_goods_info); | |||||
| @@ -194,38 +194,38 @@ public class TtPayController extends BaseController { | |||||
| } | } | ||||
| } | } | ||||
| }else if("refund".equals(type)){//退款回调 | }else if("refund".equals(type)){//退款回调 | ||||
| String cp_refundno,status; | |||||
| Integer refund_amount; | |||||
| if(is2_0){ | |||||
| cp_refundno = (String) pMap.get("out_refund_no"); | |||||
| status = (String) pMap.get("status"); | |||||
| refund_amount = (Integer) pMap.get("refund_total_amount"); | |||||
| }else{ | |||||
| cp_refundno = (String) pMap.get("cp_refundno"); | |||||
| status = (String) pMap.get("status"); | |||||
| refund_amount = (Integer) pMap.get("refund_amount"); | |||||
| } | |||||
| Map<String,String> map = new HashMap<>(); | |||||
| map.put("appid",appid); | |||||
| map.put("cp_refundno",cp_refundno); | |||||
| map.put("status",status); | |||||
| map.put("refund_amount",refund_amount.toString()); | |||||
| // wxRefundOrderService.notify(map, EnumPayWay.PAY_WAY_TT); | |||||
| String jsonMsg = JSON.toJSONString(map); | |||||
| FmInsideNotifyRefundSuccessMsg refundSuccessMsg = new FmInsideNotifyRefundSuccessMsg(); | |||||
| refundSuccessMsg.setMsgType(EnumMsgRecordType.INSIDE_NOTIFY_REFUND_SUCCESS.getCode()); | |||||
| refundSuccessMsg.setDelayTimeLevel(3); | |||||
| refundSuccessMsg.setPayWay(EnumPayWay.PAY_WAY_TT.getCode()); | |||||
| refundSuccessMsg.setJsonMsg(jsonMsg); | |||||
| // response = wxRefundOrderService.notify(paramMap, EnumPayWay.PAY_WAY_WEAPP); | |||||
| mqBaseProducer.sendMessage(refundSuccessMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||||
| resultMap.put("err_no",0); | |||||
| resultMap.put("err_tips","success"); | |||||
| // String cp_refundno,status; | |||||
| // Integer refund_amount; | |||||
| // if(is2_0){ | |||||
| // cp_refundno = (String) pMap.get("out_refund_no"); | |||||
| // status = (String) pMap.get("status"); | |||||
| // refund_amount = (Integer) pMap.get("refund_total_amount"); | |||||
| // }else{ | |||||
| // cp_refundno = (String) pMap.get("cp_refundno"); | |||||
| // status = (String) pMap.get("status"); | |||||
| // refund_amount = (Integer) pMap.get("refund_amount"); | |||||
| // } | |||||
| // | |||||
| // Map<String,String> map = new HashMap<>(); | |||||
| // map.put("appid",appid); | |||||
| // map.put("cp_refundno",cp_refundno); | |||||
| // map.put("status",status); | |||||
| // map.put("refund_amount",refund_amount.toString()); | |||||
| //// wxRefundOrderService.notify(map, EnumPayWay.PAY_WAY_TT); | |||||
| // | |||||
| // String jsonMsg = JSON.toJSONString(map); | |||||
| // | |||||
| // FmInsideNotifyRefundSuccessMsg refundSuccessMsg = new FmInsideNotifyRefundSuccessMsg(); | |||||
| // refundSuccessMsg.setMsgType(EnumMsgRecordType.INSIDE_NOTIFY_REFUND_SUCCESS.getCode()); | |||||
| // refundSuccessMsg.setDelayTimeLevel(3); | |||||
| // refundSuccessMsg.setPayWay(EnumPayWay.PAY_WAY_TT.getCode()); | |||||
| // refundSuccessMsg.setJsonMsg(jsonMsg); | |||||
| // | |||||
| // // response = wxRefundOrderService.notify(paramMap, EnumPayWay.PAY_WAY_WEAPP); | |||||
| // mqBaseProducer.sendMessage(refundSuccessMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||||
| // | |||||
| // resultMap.put("err_no",0); | |||||
| // resultMap.put("err_tips","success"); | |||||
| }else if("settle".equals(type)){ | }else if("settle".equals(type)){ | ||||
| } | } | ||||
| @@ -76,12 +76,12 @@ public class WxMsgCallbackController extends BaseController { | |||||
| logger.debug("[" + getIpAddr() + "] WxMsgCallbackController::receivemsgAliyun"); | logger.debug("[" + getIpAddr() + "] WxMsgCallbackController::receivemsgAliyun"); | ||||
| logger.info(param.toString()); | logger.info(param.toString()); | ||||
| try { | try { | ||||
| if(param != null && param.size() > 0){ | |||||
| for (Map<String, String> p:param) { | |||||
| //解析param数据插入数据库中 | |||||
| wxMsgCallbackService.receivemsgAliyun(p); | |||||
| } | |||||
| } | |||||
| // if(param != null && param.size() > 0){ | |||||
| // for (Map<String, String> p:param) { | |||||
| // //解析param数据插入数据库中 | |||||
| // wxMsgCallbackService.receivemsgAliyun(p); | |||||
| // } | |||||
| // } | |||||
| }catch(Exception e){ | }catch(Exception e){ | ||||
| logger.error("aliyun 短信回调ERROR",e); | logger.error("aliyun 短信回调ERROR",e); | ||||
| @@ -130,17 +130,17 @@ public class WxPayController extends BaseController { | |||||
| try { | try { | ||||
| xml = IOUtils.toString(request.getInputStream(), Charset.forName("UTF-8")); | xml = IOUtils.toString(request.getInputStream(), Charset.forName("UTF-8")); | ||||
| logger.info(xml); | logger.info(xml); | ||||
| paramMap = WxPayment.xmlToMap(xml); | |||||
| String jsonMsg = JSON.toJSONString(paramMap); | |||||
| FmInsideNotifyRefundSuccessMsg refundSuccessMsg = new FmInsideNotifyRefundSuccessMsg(); | |||||
| refundSuccessMsg.setMsgType(EnumMsgRecordType.INSIDE_NOTIFY_REFUND_SUCCESS.getCode()); | |||||
| refundSuccessMsg.setDelayTimeLevel(3); | |||||
| refundSuccessMsg.setPayWay(EnumPayWay.PAY_WAY_WECHAT.getCode()); | |||||
| refundSuccessMsg.setJsonMsg(jsonMsg); | |||||
| // response = wxRefundOrderService.notify(paramMap, EnumPayWay.PAY_WAY_WEAPP); | |||||
| mqBaseProducer.sendMessage(refundSuccessMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||||
| // paramMap = WxPayment.xmlToMap(xml); | |||||
| // String jsonMsg = JSON.toJSONString(paramMap); | |||||
| // | |||||
| // FmInsideNotifyRefundSuccessMsg refundSuccessMsg = new FmInsideNotifyRefundSuccessMsg(); | |||||
| // refundSuccessMsg.setMsgType(EnumMsgRecordType.INSIDE_NOTIFY_REFUND_SUCCESS.getCode()); | |||||
| // refundSuccessMsg.setDelayTimeLevel(3); | |||||
| // refundSuccessMsg.setPayWay(EnumPayWay.PAY_WAY_WECHAT.getCode()); | |||||
| // refundSuccessMsg.setJsonMsg(jsonMsg); | |||||
| // | |||||
| // // response = wxRefundOrderService.notify(paramMap, EnumPayWay.PAY_WAY_WEAPP); | |||||
| // mqBaseProducer.sendMessage(refundSuccessMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||||
| logger.info("refund wxpay, notify success, req : " + xml + ", resp: " + response.toString()); | logger.info("refund wxpay, notify success, req : " + xml + ", resp: " + response.toString()); | ||||
| return response; | return response; | ||||
| @@ -1,12 +1,19 @@ | |||||
| package com.iformall.schedule; | package com.iformall.schedule; | ||||
| import com.alibaba.fastjson.JSON; | |||||
| import com.alibaba.fastjson.JSONObject; | import com.alibaba.fastjson.JSONObject; | ||||
| import com.iformall.domain.po.WxMsgCallback; | |||||
| import com.iformall.domain.po.WxMsgConfig; | import com.iformall.domain.po.WxMsgConfig; | ||||
| import com.iformall.domain.po.WxMsgModel; | import com.iformall.domain.po.WxMsgModel; | ||||
| import com.iformall.enums.EnumMsgModelStatus; | import com.iformall.enums.EnumMsgModelStatus; | ||||
| import com.iformall.enums.EnumMsgSendStatus; | |||||
| import com.iformall.mapper.WxMsgCallbackMapper; | |||||
| import com.iformall.mapper.WxMsgConfigMapper; | import com.iformall.mapper.WxMsgConfigMapper; | ||||
| import com.iformall.mapper.WxMsgModelMapper; | import com.iformall.mapper.WxMsgModelMapper; | ||||
| import com.iformall.service.WxMsgCallbackService; | |||||
| import com.iformall.sms.EnumSMSChannel; | |||||
| import com.iformall.sms.SMSFactory; | import com.iformall.sms.SMSFactory; | ||||
| import com.iformall.utils.DateUtils; | |||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| @@ -15,6 +22,7 @@ import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.scheduling.annotation.Scheduled; | import org.springframework.scheduling.annotation.Scheduled; | ||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| import java.util.Date; | |||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.Map; | import java.util.Map; | ||||
| @@ -26,7 +34,13 @@ public class WxMsgModelSchedule { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Autowired | @Autowired | ||||
| WxMsgModelMapper WxMsgModelMapper; | |||||
| WxMsgModelMapper wxMsgModelMapper; | |||||
| @Autowired | |||||
| WxMsgCallbackMapper wxMsgCallbackMapper; | |||||
| @Autowired | |||||
| WxMsgCallbackService wxMsgCallbackService; | |||||
| @Autowired | @Autowired | ||||
| WxMsgConfigMapper wxMsgConfigMapper; | WxMsgConfigMapper wxMsgConfigMapper; | ||||
| @@ -36,7 +50,7 @@ public class WxMsgModelSchedule { | |||||
| public void querySmsTemplate() { | public void querySmsTemplate() { | ||||
| WxMsgModel msgModel = new WxMsgModel(); | WxMsgModel msgModel = new WxMsgModel(); | ||||
| msgModel.setStatus(EnumMsgModelStatus.AUDITING.getCode()); | msgModel.setStatus(EnumMsgModelStatus.AUDITING.getCode()); | ||||
| List<WxMsgModel> aliYunList = WxMsgModelMapper.findAliYunList(msgModel); | |||||
| List<WxMsgModel> aliYunList = wxMsgModelMapper.findAliYunList(msgModel); | |||||
| if(!aliYunList.isEmpty()){ | if(!aliYunList.isEmpty()){ | ||||
| Map<String, List<WxMsgModel>> collect = aliYunList.stream().collect(groupingBy(WxMsgModel::getTenantId)); | Map<String, List<WxMsgModel>> collect = aliYunList.stream().collect(groupingBy(WxMsgModel::getTenantId)); | ||||
| for (String tenantId:collect.keySet()) { | for (String tenantId:collect.keySet()) { | ||||
| @@ -62,7 +76,7 @@ public class WxMsgModelSchedule { | |||||
| updModel.setStatus(templateStatus.intValue() == 1?EnumMsgModelStatus.SUCCESS.getCode():EnumMsgModelStatus.FAIL.getCode()); | updModel.setStatus(templateStatus.intValue() == 1?EnumMsgModelStatus.SUCCESS.getCode():EnumMsgModelStatus.FAIL.getCode()); | ||||
| updModel.setReason(reason); | updModel.setReason(reason); | ||||
| updModel.setModelCode(templateCode); | updModel.setModelCode(templateCode); | ||||
| WxMsgModelMapper.updateByCode(updModel); | |||||
| wxMsgModelMapper.updateByCode(updModel); | |||||
| } | } | ||||
| } | } | ||||
| }catch (Exception e){ | }catch (Exception e){ | ||||
| @@ -74,9 +88,46 @@ public class WxMsgModelSchedule { | |||||
| } | } | ||||
| } | } | ||||
| } | |||||
| @Async | |||||
| @Scheduled(cron = "0 */30 * * * ?") // | |||||
| public void querySendDetails() { | |||||
| WxMsgCallback msgCallback = new WxMsgCallback(); | |||||
| msgCallback.setStatus(EnumMsgSendStatus.MSG_SENDING.getCode()); | |||||
| String before5dayStr = DateUtils.getTimeBefore(4, new Date()); | |||||
| Date before5day = DateUtils.stringToDate(before5dayStr); | |||||
| msgCallback.setCreateStartTime(before5day);//近5天的短信 | |||||
| List<WxMsgCallback> list = wxMsgCallbackMapper.findList(msgCallback); | |||||
| if(!list.isEmpty()){ | |||||
| Map<String, List<WxMsgCallback>> collect = list.stream().collect(groupingBy(WxMsgCallback::getTenantId)); | |||||
| for (String tenantId:collect.keySet()) { | |||||
| WxMsgConfig wxMsgConfig = new WxMsgConfig(); | |||||
| wxMsgConfig.setTenantId(tenantId); | |||||
| List<WxMsgConfig> wxMsgConfigs = wxMsgConfigMapper.findList(wxMsgConfig); | |||||
| if (wxMsgConfigs.size() == 0){ | |||||
| logger.error("您还未接入短信运营商,请联系平台管理员"); | |||||
| }else{ | |||||
| wxMsgConfig = wxMsgConfigs.get(0); | |||||
| List<WxMsgCallback> wxMsgCallbacks = collect.get(tenantId); | |||||
| for (WxMsgCallback callback:wxMsgCallbacks) { | |||||
| try{ | |||||
| String result = SMSFactory.querySendDetails(wxMsgConfig,callback.getPhone(),callback.getBatchNo(),callback.getCreatetime()); | |||||
| if(StringUtils.isNotBlank(result)){ | |||||
| Map<String,String> map = JSON.parseObject(result, Map.class); | |||||
| String smsChannel = map.get("smsChannel"); | |||||
| if(EnumSMSChannel.ALIYUN.name().equals(smsChannel)){ | |||||
| wxMsgCallbackService.receivemsgAliyun(map); | |||||
| } | |||||
| } | |||||
| }catch (Exception e){ | |||||
| logger.error("查询模板审核状态失败"+e.getMessage()); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,5 +1,6 @@ | |||||
| package com.iformall.domain.po; | package com.iformall.domain.po; | ||||
| import com.baomidou.mybatisplus.annotation.TableField; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import lombok.Data; | import lombok.Data; | ||||
| @@ -47,4 +48,7 @@ public class WxMsgCallback extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "业务ID", name = "businessId") | @io.swagger.annotations.ApiModelProperty(value = "业务ID", name = "businessId") | ||||
| private Long businessId; | private Long businessId; | ||||
| @TableField(exist = false) | |||||
| private Date createStartTime; | |||||
| } | } | ||||
| @@ -1,10 +1,13 @@ | |||||
| package com.iformall.domain.po; | package com.iformall.domain.po; | ||||
| import com.alibaba.fastjson.JSON; | |||||
| import com.baomidou.mybatisplus.annotation.TableField; | import com.baomidou.mybatisplus.annotation.TableField; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.douyin.pay.orderQuery.QueryMerchantResult; | |||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | import lombok.EqualsAndHashCode; | ||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import java.util.Date; | import java.util.Date; | ||||
| @@ -59,6 +62,39 @@ public class WxProfitSharingReceiver extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "0,不使用 1,使用", name = "isUse") | @io.swagger.annotations.ApiModelProperty(value = "0,不使用 1,使用", name = "isUse") | ||||
| private Integer isUse; | private Integer isUse; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "进件状态", name = "ttImportStatus") | |||||
| private String ttImportStatus; | |||||
| @TableField(exist = false) | |||||
| private Integer wxImportStatus; | |||||
| @TableField(exist = false) | |||||
| private Integer alipayImportStatus; | |||||
| @TableField(exist = false) | |||||
| private Integer hzImportStatus; | |||||
| private QueryMerchantResult getMerchantResult(){ | |||||
| QueryMerchantResult queryMerchantResult = null; | |||||
| try{ | |||||
| if(StringUtils.isNotBlank(this.ttImportStatus)) { | |||||
| queryMerchantResult = JSON.parseObject(this.ttImportStatus, QueryMerchantResult.class); | |||||
| } | |||||
| }catch(Exception e){} | |||||
| if(queryMerchantResult == null){ | |||||
| queryMerchantResult = new QueryMerchantResult(); | |||||
| } | |||||
| return queryMerchantResult; | |||||
| } | |||||
| public Integer getWxImportStatus(){ | |||||
| return getMerchantResult().getWx(); | |||||
| } | |||||
| public Integer getAlipayImportStatus(){ | |||||
| return getMerchantResult().getAlipay(); | |||||
| } | |||||
| public Integer getHzImportStatus(){ | |||||
| return getMerchantResult().getHz(); | |||||
| } | |||||
| @io.swagger.annotations.ApiModelProperty(value = "进件页面", name = "ttImportUrl") | @io.swagger.annotations.ApiModelProperty(value = "进件页面", name = "ttImportUrl") | ||||
| private String ttImportUrl; | private String ttImportUrl; | ||||
| @@ -295,6 +295,7 @@ public class DouYinPayHelper { | |||||
| QueryMerchantResult result = new QueryMerchantResult(); | QueryMerchantResult result = new QueryMerchantResult(); | ||||
| result.setWx(jsonObject.getInteger("wx")); | result.setWx(jsonObject.getInteger("wx")); | ||||
| result.setAlipay(jsonObject.getInteger("alipay")); | result.setAlipay(jsonObject.getInteger("alipay")); | ||||
| result.setHz(jsonObject.getInteger("hz")); | |||||
| return result; | return result; | ||||
| }else { | }else { | ||||
| log.error("queryMerchantStatus reponse error. request: "+JSON.toJSONString(map)+" response:"+response); | log.error("queryMerchantStatus reponse error. request: "+JSON.toJSONString(map)+" response:"+response); | ||||
| @@ -7,4 +7,6 @@ public class QueryMerchantResult { | |||||
| private Integer wx;//微信渠道进件状态,0-未进件、1-进件成功、2-进件失败、3-审核中、4-冻结中 | private Integer wx;//微信渠道进件状态,0-未进件、1-进件成功、2-进件失败、3-审核中、4-冻结中 | ||||
| private Integer alipay;//支付宝渠道进件状态,0-未进件、1-进件成功、2-进件失败、3-审核中 | private Integer alipay;//支付宝渠道进件状态,0-未进件、1-进件成功、2-进件失败、3-审核中 | ||||
| private Integer hz;//抖音支付(合众)渠道进件状态,0-未进件、1-进件成功、2-进件失败、3-审核中 | |||||
| } | } | ||||
| @@ -401,16 +401,21 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| wxRentContract.setMerchantId(id); | wxRentContract.setMerchantId(id); | ||||
| long countRentContract = wxRentContractMapper.selectList(new QueryWrapper<>(wxRentContract)).parallelStream(). | long countRentContract = wxRentContractMapper.selectList(new QueryWrapper<>(wxRentContract)).parallelStream(). | ||||
| filter(c -> EnumRentContractStatus.getValidStatus().contains(c.getStatus())).count(); | filter(c -> EnumRentContractStatus.getValidStatus().contains(c.getStatus())).count(); | ||||
| if(countRentContract > 0){ | |||||
| throw new MallinkException(ErrorCode.SHOP_CONTRACT_HAS_CONNECT.getCode(),"存在租赁合同"); | |||||
| } | |||||
| //是否有物业合同 | //是否有物业合同 | ||||
| WxPropertyContract wxPropertyContract = new WxPropertyContract(); | WxPropertyContract wxPropertyContract = new WxPropertyContract(); | ||||
| wxPropertyContract.setMerchantId(id); | wxPropertyContract.setMerchantId(id); | ||||
| long countPropertyContract = wxPropertyContractMapper.selectList(new QueryWrapper<>(wxPropertyContract)).parallelStream(). | long countPropertyContract = wxPropertyContractMapper.selectList(new QueryWrapper<>(wxPropertyContract)).parallelStream(). | ||||
| filter(c -> EnumRentContractStatus.getValidStatus().contains(c.getStatus())).count(); | filter(c -> EnumRentContractStatus.getValidStatus().contains(c.getStatus())).count(); | ||||
| //商户状态停用-没有租赁合同和物业合同才允许停用 | //商户状态停用-没有租赁合同和物业合同才允许停用 | ||||
| if (countRentContract == 0 || countPropertyContract == 0){ | |||||
| wxMerchant.setStatus(EnumMerchantStatus.NOT_VALID.getCode()); | |||||
| wxMerchantMapper.updateById(wxMerchant); | |||||
| // if (countRentContract == 0 || countPropertyContract == 0){ | |||||
| // wxMerchant.setStatus(EnumMerchantStatus.NOT_VALID.getCode()); | |||||
| // wxMerchantMapper.updateById(wxMerchant); | |||||
| // } | |||||
| if(countPropertyContract > 0){ | |||||
| throw new MallinkException(ErrorCode.SHOP_CONTRACT_HAS_CONNECT.getCode(),"存在物业合同"); | |||||
| } | } | ||||
| //解绑商铺-没有租赁合同或物业合同才可以 | //解绑商铺-没有租赁合同或物业合同才可以 | ||||
| if (countRentContract == 0 || countPropertyContract == 0) { | if (countRentContract == 0 || countPropertyContract == 0) { | ||||
| @@ -416,6 +416,7 @@ public class WxRefundAdapterService implements RefundPayAdapterService{ | |||||
| record.getTransactionId(), record.getPayOrderNo(), String.valueOf(record.getId()), | record.getTransactionId(), record.getPayOrderNo(), String.valueOf(record.getId()), | ||||
| record.getRefundId(), payAccount.getApiKey()); | record.getRefundId(), payAccount.getApiKey()); | ||||
| String response = WxPay.orderRefundQuery(paramMap); | String response = WxPay.orderRefundQuery(paramMap); | ||||
| log.info("微信退款订单:" + record.toString() + ", response: " + response.toString()); | |||||
| Map<String, String> returnMap = WxPayment.xmlToMap(response); | Map<String, String> returnMap = WxPayment.xmlToMap(response); | ||||
| String return_code = returnMap.get("return_code"); | String return_code = returnMap.get("return_code"); | ||||
| if("SUCCESS".equals(return_code)){ | if("SUCCESS".equals(return_code)){ | ||||
| @@ -460,6 +461,7 @@ public class WxRefundAdapterService implements RefundPayAdapterService{ | |||||
| appInfo.getParentAppId(), appInfo.getAppId(), payAccount.getMchId(), payAccount.getSubMchId(), | appInfo.getParentAppId(), appInfo.getAppId(), payAccount.getMchId(), payAccount.getSubMchId(), | ||||
| record.getTransactionId(), record.getPayOrderNo(), String.valueOf(record.getId()), record.getRefundId(), payAccount.getApiKey()); | record.getTransactionId(), record.getPayOrderNo(), String.valueOf(record.getId()), record.getRefundId(), payAccount.getApiKey()); | ||||
| String response = WxPay.orderRefundQuery(paramMap); | String response = WxPay.orderRefundQuery(paramMap); | ||||
| log.info("微信退款订单:" + record.toString() + ", response: " + response.toString()); | |||||
| Map<String, String> returnMap = WxPayment.xmlToMap(response); | Map<String, String> returnMap = WxPayment.xmlToMap(response); | ||||
| String return_code = returnMap.get("return_code"); | String return_code = returnMap.get("return_code"); | ||||
| if("SUCCESS".equals(return_code)){ | if("SUCCESS".equals(return_code)){ | ||||
| @@ -1,5 +1,7 @@ | |||||
| package com.iformall.sms; | package com.iformall.sms; | ||||
| import java.util.Date; | |||||
| public interface SMSExcutor { | public interface SMSExcutor { | ||||
| String sendMsg(String secret, String bid, String publickey,String phone, String signature, | String sendMsg(String secret, String bid, String publickey,String phone, String signature, | ||||
| @@ -12,4 +14,6 @@ public interface SMSExcutor { | |||||
| String querySmsTemplate(String templateCode); | String querySmsTemplate(String templateCode); | ||||
| String querySendDetail(String phone, String bizId, Date sendDate); | |||||
| } | } | ||||
| @@ -8,6 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| import javax.annotation.PostConstruct; | import javax.annotation.PostConstruct; | ||||
| import java.util.Date; | |||||
| @Component | @Component | ||||
| public class SMSFactory { | public class SMSFactory { | ||||
| @@ -68,4 +69,8 @@ public class SMSFactory { | |||||
| return getSendExcutor(wxMsgConfig).querySmsTemplate(templateCode); | return getSendExcutor(wxMsgConfig).querySmsTemplate(templateCode); | ||||
| } | } | ||||
| public static String querySendDetails(WxMsgConfig wxMsgConfig, String phone, String bizId, Date sendDate) { | |||||
| return getSendExcutor(wxMsgConfig).querySendDetail(phone, bizId, sendDate); | |||||
| } | |||||
| } | } | ||||
| @@ -8,15 +8,20 @@ import com.aliyuncs.dysmsapi.model.v20170525.*; | |||||
| import com.aliyuncs.exceptions.ClientException; | import com.aliyuncs.exceptions.ClientException; | ||||
| import com.aliyuncs.profile.DefaultProfile; | import com.aliyuncs.profile.DefaultProfile; | ||||
| import com.aliyuncs.profile.IClientProfile; | import com.aliyuncs.profile.IClientProfile; | ||||
| import com.iformall.sms.EnumSMSChannel; | |||||
| import com.iformall.sms.SMSExcutor; | import com.iformall.sms.SMSExcutor; | ||||
| import com.iformall.sms.SMSResult; | import com.iformall.sms.SMSResult; | ||||
| import com.iformall.sms.aliyun.bean.*; | import com.iformall.sms.aliyun.bean.*; | ||||
| import com.iformall.utils.DateUtils; | |||||
| import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| import java.text.SimpleDateFormat; | import java.text.SimpleDateFormat; | ||||
| import java.util.Date; | |||||
| import java.util.HashMap; | |||||
| import java.util.Map; | |||||
| @Component | @Component | ||||
| @Slf4j | @Slf4j | ||||
| @@ -79,6 +84,41 @@ public class AliyunSMS implements SMSExcutor { | |||||
| return null; | return null; | ||||
| } | } | ||||
| @Override | |||||
| public String querySendDetail(String phone, String bizId, Date sendDate) { | |||||
| Query query = new Query(); | |||||
| query.setPhoneNumber(phone); | |||||
| query.setBizId(bizId); | |||||
| query.setSendDate(sendDate); | |||||
| query.setPageSize(10L); | |||||
| query.setCurrentPage(1L); | |||||
| QuerySendDetailsResponse querySendDetailsResponse = this.querySendDetails(query); | |||||
| //获取返回结果 | |||||
| if(querySendDetailsResponse.getCode() != null && querySendDetailsResponse.getCode().equals("OK") | |||||
| && querySendDetailsResponse.getSmsSendDetailDTOs() != null | |||||
| && !querySendDetailsResponse.getSmsSendDetailDTOs().isEmpty()){ | |||||
| QuerySendDetailsResponse.SmsSendDetailDTO smsSendDetailDTO = querySendDetailsResponse.getSmsSendDetailDTOs().get(0); | |||||
| long sendStatus = smsSendDetailDTO.getSendStatus().longValue(); | |||||
| String outId = smsSendDetailDTO.getOutId(); | |||||
| String errCode = smsSendDetailDTO.getErrCode(); | |||||
| Map<String, String> map = new HashMap<>(); | |||||
| map.put("smsChannel", EnumSMSChannel.ALIYUN.name()); | |||||
| if(sendStatus == 2l){//1:等待回执。2:发送失败。3:发送成功。 | |||||
| map.put("success","false"); | |||||
| }else if(sendStatus == 3l){ | |||||
| map.put("success","true"); | |||||
| }else{ | |||||
| return null; | |||||
| } | |||||
| map.put("biz_id",bizId); | |||||
| map.put("out_id",outId); | |||||
| map.put("err_msg",errCode); | |||||
| return JSON.toJSONString(map); | |||||
| } | |||||
| return null; | |||||
| } | |||||
| /** | /** | ||||
| * 发送短信 | * 发送短信 | ||||
| * @param sms | * @param sms | ||||
| @@ -12,10 +12,7 @@ import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| import java.util.HashMap; | |||||
| import java.util.Map; | |||||
| import java.util.Set; | |||||
| import java.util.TreeMap; | |||||
| import java.util.*; | |||||
| @Component | @Component | ||||
| public class WiwideUtil implements SMSExcutor { | public class WiwideUtil implements SMSExcutor { | ||||
| @@ -41,6 +38,11 @@ public class WiwideUtil implements SMSExcutor { | |||||
| return null; | return null; | ||||
| } | } | ||||
| @Override | |||||
| public String querySendDetail(String phone, String bizId, Date sendDate) { | |||||
| return null; | |||||
| } | |||||
| public static String addTemplate(String secret, String bid, String publickey, String signature, String content, String notifyUrl, String verifysms) { | public static String addTemplate(String secret, String bid, String publickey, String signature, String content, String notifyUrl, String verifysms) { | ||||
| //请求api数据排序 | //请求api数据排序 | ||||
| TreeMap<String, String> message = new TreeMap<>(); | TreeMap<String, String> message = new TreeMap<>(); | ||||
| @@ -77,7 +77,10 @@ | |||||
| <if test=" null != createtime "> | <if test=" null != createtime "> | ||||
| and `createtime` = #{createtime} | and `createtime` = #{createtime} | ||||
| </if> | |||||
| </if> | |||||
| <if test="createStartTime != null"> | |||||
| AND `createtime` >= #{createStartTime} | |||||
| </if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | ||||
| @@ -18,13 +18,14 @@ | |||||
| <result column="status" jdbcType="INTEGER" property="status" /> | <result column="status" jdbcType="INTEGER" property="status" /> | ||||
| <result column="parameter" jdbcType="VARCHAR" property="parameter" /> | <result column="parameter" jdbcType="VARCHAR" property="parameter" /> | ||||
| <result column="tt_import_status" jdbcType="VARCHAR" property="ttImportStatus" /> | |||||
| <result column="tt_import_url" jdbcType="VARCHAR" property="ttImportUrl" /> | <result column="tt_import_url" jdbcType="VARCHAR" property="ttImportUrl" /> | ||||
| <result column="tt_balance_url" jdbcType="VARCHAR" property="ttBalanceUrl" /> | <result column="tt_balance_url" jdbcType="VARCHAR" property="ttBalanceUrl" /> | ||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`parent_tenant_id`,`merchant_id`,`receiver_type`,`receiver_account`,`receiver_comments`,`create_time`,`update_time`,`sharing_type`,`bank_no`,`true_name`,`bank_code`,`status`,`parameter`,`is_use` | `id`,`tenant_id`,`parent_tenant_id`,`merchant_id`,`receiver_type`,`receiver_account`,`receiver_comments`,`create_time`,`update_time`,`sharing_type`,`bank_no`,`true_name`,`bank_code`,`status`,`parameter`,`is_use` | ||||
| ,`tt_import_url`,`tt_balance_url` | |||||
| ,`tt_import_status`,`tt_import_url`,`tt_balance_url` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -101,6 +102,15 @@ | |||||
| and `is_use` = #{isUse} | and `is_use` = #{isUse} | ||||
| </if> | </if> | ||||
| <if test=" null != wxImportStatus"> | |||||
| and `tt_import_status` -> '$.wx' = #{wxImportStatus} | |||||
| </if> | |||||
| <if test=" null != alipayImportStatus"> | |||||
| and `tt_import_status` -> '$.alipay' = #{alipayImportStatus} | |||||
| </if> | |||||
| <if test=" null != hzImportStatus"> | |||||
| and `tt_import_status` -> '$.hz' = #{hzImportStatus} | |||||
| </if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||