Your Name лет назад: 2
Родитель
Сommit
d373860bc1

+ 83 - 0
java110-bean/src/main/java/com/java110/dto/onlinePayRefund/OnlinePayRefundDto.java

@@ -0,0 +1,83 @@
+package com.java110.dto.onlinePayRefund;
+
+import com.java110.dto.PageDto;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @ClassName FloorDto
+ * @Description 线上退费数据层封装
+ * @Author wuxw
+ * @Date 2019/4/24 8:52
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+public class OnlinePayRefundDto extends PageDto implements Serializable {
+
+    private String refundFee;
+private String busiId;
+private String payId;
+private String state;
+private String message;
+private String refundId;
+
+
+    private Date createTime;
+
+    private String statusCd = "0";
+
+
+    public String getRefundFee() {
+        return refundFee;
+    }
+public void setRefundFee(String refundFee) {
+        this.refundFee = refundFee;
+    }
+public String getBusiId() {
+        return busiId;
+    }
+public void setBusiId(String busiId) {
+        this.busiId = busiId;
+    }
+public String getPayId() {
+        return payId;
+    }
+public void setPayId(String payId) {
+        this.payId = payId;
+    }
+public String getState() {
+        return state;
+    }
+public void setState(String state) {
+        this.state = state;
+    }
+public String getMessage() {
+        return message;
+    }
+public void setMessage(String message) {
+        this.message = message;
+    }
+public String getRefundId() {
+        return refundId;
+    }
+public void setRefundId(String refundId) {
+        this.refundId = refundId;
+    }
+
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getStatusCd() {
+        return statusCd;
+    }
+
+    public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+}

+ 96 - 0
java110-bean/src/main/java/com/java110/po/onlinePayRefund/OnlinePayRefundPo.java

@@ -0,0 +1,96 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.po.onlinePayRefund;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 类表述: Po 数据模型实体对象 基本保持与数据库模型一直 用于 增加修改删除 等时的数据载体
+ * add by 吴学文 at 2023-09-08 15:36:44 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+public class OnlinePayRefundPo implements Serializable {
+
+    private String refundFee;
+    private String busiId;
+    private String statusCd = "0";
+    private String payId;
+    private String state;
+    private String message;
+    private String refundId;
+
+    public String getRefundFee() {
+        return refundFee;
+    }
+
+    public void setRefundFee(String refundFee) {
+        this.refundFee = refundFee;
+    }
+
+    public String getBusiId() {
+        return busiId;
+    }
+
+    public void setBusiId(String busiId) {
+        this.busiId = busiId;
+    }
+
+    public String getStatusCd() {
+        return statusCd;
+    }
+
+    public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+
+    public String getPayId() {
+        return payId;
+    }
+
+    public void setPayId(String payId) {
+        this.payId = payId;
+    }
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+    public void setMessage(String message) {
+        this.message = message;
+    }
+
+    public String getRefundId() {
+        return refundId;
+    }
+
+    public void setRefundId(String refundId) {
+        this.refundId = refundId;
+    }
+
+
+}

+ 111 - 0
java110-db/src/main/resources/mapper/acct/OnlinePayRefundV1ServiceDaoImplMapper.xml

@@ -0,0 +1,111 @@
+<?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">
+<mapper namespace="onlinePayRefundV1ServiceDaoImpl">
+
+
+    <!-- 保存线上退费信息 add by wuxw 2018-07-03 -->
+    <insert id="saveOnlinePayRefundInfo" parameterType="Map">
+        insert into online_pay_refund(
+        refund_fee,busi_id,pay_id,state,message,refund_id
+        ) values (
+        #{refundFee},#{busiId},#{payId},#{state},#{message},#{refundId}
+        )
+    </insert>
+
+
+    <!-- 查询线上退费信息 add by wuxw 2018-07-03 -->
+    <select id="getOnlinePayRefundInfo" parameterType="Map" resultType="Map">
+        select t.refund_fee,t.refund_fee refundFee,t.busi_id,t.busi_id busiId,t.status_cd,t.status_cd
+        statusCd,t.pay_id,t.pay_id payId,t.state,t.message,t.refund_id,t.refund_id refundId
+        from online_pay_refund t
+        where 1 =1
+        <if test="refundFee !=null and refundFee != ''">
+            and t.refund_fee= #{refundFee}
+        </if>
+        <if test="busiId !=null and busiId != ''">
+            and t.busi_id= #{busiId}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="payId !=null and payId != ''">
+            and t.pay_id= #{payId}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
+        <if test="message !=null and message != ''">
+            and t.message= #{message}
+        </if>
+        <if test="refundId !=null and refundId != ''">
+            and t.refund_id= #{refundId}
+        </if>
+        order by t.create_time desc
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
+
+    </select>
+
+
+    <!-- 修改线上退费信息 add by wuxw 2018-07-03 -->
+    <update id="updateOnlinePayRefundInfo" parameterType="Map">
+        update online_pay_refund t set t.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,t.b_id = #{newBId}
+        </if>
+        <if test="refundFee !=null and refundFee != ''">
+            , t.refund_fee= #{refundFee}
+        </if>
+        <if test="busiId !=null and busiId != ''">
+            , t.busi_id= #{busiId}
+        </if>
+        <if test="payId !=null and payId != ''">
+            , t.pay_id= #{payId}
+        </if>
+        <if test="state !=null and state != ''">
+            , t.state= #{state}
+        </if>
+        <if test="message !=null and message != ''">
+            , t.message= #{message}
+        </if>
+        where 1=1
+        <if test="refundId !=null and refundId != ''">
+            and t.refund_id= #{refundId}
+        </if>
+
+    </update>
+
+    <!-- 查询线上退费数量 add by wuxw 2018-07-03 -->
+    <select id="queryOnlinePayRefundsCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from online_pay_refund t
+        where 1 =1
+        <if test="refundFee !=null and refundFee != ''">
+            and t.refund_fee= #{refundFee}
+        </if>
+        <if test="busiId !=null and busiId != ''">
+            and t.busi_id= #{busiId}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="payId !=null and payId != ''">
+            and t.pay_id= #{payId}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
+        <if test="message !=null and message != ''">
+            and t.message= #{message}
+        </if>
+        <if test="refundId !=null and refundId != ''">
+            and t.refund_id= #{refundId}
+        </if>
+
+
+    </select>
+
+</mapper>

+ 68 - 0
java110-interface/src/main/java/com/java110/intf/acct/IOnlinePayRefundV1InnerServiceSMO.java

@@ -0,0 +1,68 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.intf.acct;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.dto.onlinePayRefund.OnlinePayRefundDto;
+import com.java110.po.onlinePayRefund.OnlinePayRefundPo;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import java.util.List;
+
+/**
+ * 类表述: 服务之前调用的接口类,不对外提供接口能力 只用于接口建调用
+ * add by 吴学文 at 2023-09-08 15:36:44 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@FeignClient(name = "acct-service", configuration = {FeignConfiguration.class})
+@RequestMapping("/onlinePayRefundV1Api")
+public interface IOnlinePayRefundV1InnerServiceSMO {
+
+
+    @RequestMapping(value = "/saveOnlinePayRefund", method = RequestMethod.POST)
+    public int saveOnlinePayRefund(@RequestBody  OnlinePayRefundPo onlinePayRefundPo);
+
+    @RequestMapping(value = "/updateOnlinePayRefund", method = RequestMethod.POST)
+    public int updateOnlinePayRefund(@RequestBody  OnlinePayRefundPo onlinePayRefundPo);
+
+    @RequestMapping(value = "/deleteOnlinePayRefund", method = RequestMethod.POST)
+    public int deleteOnlinePayRefund(@RequestBody  OnlinePayRefundPo onlinePayRefundPo);
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param onlinePayRefundDto 数据对象分享
+     * @return OnlinePayRefundDto 对象数据
+     */
+    @RequestMapping(value = "/queryOnlinePayRefunds", method = RequestMethod.POST)
+    List<OnlinePayRefundDto> queryOnlinePayRefunds(@RequestBody OnlinePayRefundDto onlinePayRefundDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param onlinePayRefundDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryOnlinePayRefundsCount", method = RequestMethod.POST)
+    int queryOnlinePayRefundsCount(@RequestBody OnlinePayRefundDto onlinePayRefundDto);
+}

+ 73 - 0
service-acct/src/main/java/com/java110/acct/dao/IOnlinePayRefundV1ServiceDao.java

@@ -0,0 +1,73 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.acct.dao;
+
+
+import com.java110.utils.exception.DAOException;
+
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 类表述:
+ * add by 吴学文 at 2023-09-08 15:36:44 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+public interface IOnlinePayRefundV1ServiceDao {
+
+
+    /**
+     * 保存 线上退费信息
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    int saveOnlinePayRefundInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询线上退费信息(instance过程)
+     * 根据bId 查询线上退费信息
+     * @param info bId 信息
+     * @return 线上退费信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getOnlinePayRefundInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改线上退费信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    int updateOnlinePayRefundInfo(Map info) throws DAOException;
+
+
+    /**
+     * 查询线上退费总数
+     *
+     * @param info 线上退费信息
+     * @return 线上退费数量
+     */
+    int queryOnlinePayRefundsCount(Map info);
+
+}

+ 112 - 0
service-acct/src/main/java/com/java110/acct/dao/impl/OnlinePayRefundV1ServiceDaoImpl.java

@@ -0,0 +1,112 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.acct.dao.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.exception.DAOException;
+import com.java110.utils.util.DateUtil;
+import com.java110.core.base.dao.BaseServiceDao;
+import com.java110.acct.dao.IOnlinePayRefundV1ServiceDao;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 类表述:
+ * add by 吴学文 at 2023-09-08 15:36:44 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Service("onlinePayRefundV1ServiceDaoImpl")
+public class OnlinePayRefundV1ServiceDaoImpl extends BaseServiceDao implements IOnlinePayRefundV1ServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(OnlinePayRefundV1ServiceDaoImpl.class);
+
+
+
+
+
+    /**
+     * 保存线上退费信息 到 instance
+     * @param info   bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int saveOnlinePayRefundInfo(Map info) throws DAOException {
+        logger.debug("保存 saveOnlinePayRefundInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("onlinePayRefundV1ServiceDaoImpl.saveOnlinePayRefundInfo",info);
+
+        return saveFlag;
+    }
+
+
+    /**
+     * 查询线上退费信息(instance)
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getOnlinePayRefundInfo(Map info) throws DAOException {
+        logger.debug("查询 getOnlinePayRefundInfo 入参 info : {}",info);
+
+        List<Map> businessOnlinePayRefundInfos = sqlSessionTemplate.selectList("onlinePayRefundV1ServiceDaoImpl.getOnlinePayRefundInfo",info);
+
+        return businessOnlinePayRefundInfos;
+    }
+
+
+    /**
+     * 修改线上退费信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int updateOnlinePayRefundInfo(Map info) throws DAOException {
+        logger.debug("修改 updateOnlinePayRefundInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("onlinePayRefundV1ServiceDaoImpl.updateOnlinePayRefundInfo",info);
+
+        return saveFlag;
+    }
+
+     /**
+     * 查询线上退费数量
+     * @param info 线上退费信息
+     * @return 线上退费数量
+     */
+    @Override
+    public int queryOnlinePayRefundsCount(Map info) {
+        logger.debug("查询 queryOnlinePayRefundsCount 入参 info : {}",info);
+
+        List<Map> businessOnlinePayRefundInfos = sqlSessionTemplate.selectList("onlinePayRefundV1ServiceDaoImpl.queryOnlinePayRefundsCount", info);
+        if (businessOnlinePayRefundInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessOnlinePayRefundInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 89 - 0
service-acct/src/main/java/com/java110/acct/smo/impl/OnlinePayRefundV1InnerServiceSMOImpl.java

@@ -0,0 +1,89 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.acct.smo.impl;
+
+
+import com.java110.acct.dao.IOnlinePayRefundV1ServiceDao;
+import com.java110.intf.acct.IOnlinePayRefundV1InnerServiceSMO;
+import com.java110.dto.onlinePayRefund.OnlinePayRefundDto;
+import com.java110.po.onlinePayRefund.OnlinePayRefundPo;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.dto.user.UserDto;
+import com.java110.dto.PageDto;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 类表述: 服务之前调用的接口实现类,不对外提供接口能力 只用于接口建调用
+ * add by 吴学文 at 2023-09-08 15:36:44 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@RestController
+public class OnlinePayRefundV1InnerServiceSMOImpl extends BaseServiceSMO implements IOnlinePayRefundV1InnerServiceSMO {
+
+    @Autowired
+    private IOnlinePayRefundV1ServiceDao onlinePayRefundV1ServiceDaoImpl;
+
+
+    @Override
+    public int saveOnlinePayRefund(@RequestBody  OnlinePayRefundPo onlinePayRefundPo) {
+        int saveFlag = onlinePayRefundV1ServiceDaoImpl.saveOnlinePayRefundInfo(BeanConvertUtil.beanCovertMap(onlinePayRefundPo));
+        return saveFlag;
+    }
+
+     @Override
+    public int updateOnlinePayRefund(@RequestBody  OnlinePayRefundPo onlinePayRefundPo) {
+        int saveFlag = onlinePayRefundV1ServiceDaoImpl.updateOnlinePayRefundInfo(BeanConvertUtil.beanCovertMap(onlinePayRefundPo));
+        return saveFlag;
+    }
+
+     @Override
+    public int deleteOnlinePayRefund(@RequestBody  OnlinePayRefundPo onlinePayRefundPo) {
+       onlinePayRefundPo.setStatusCd("1");
+       int saveFlag = onlinePayRefundV1ServiceDaoImpl.updateOnlinePayRefundInfo(BeanConvertUtil.beanCovertMap(onlinePayRefundPo));
+       return saveFlag;
+    }
+
+    @Override
+    public List<OnlinePayRefundDto> queryOnlinePayRefunds(@RequestBody  OnlinePayRefundDto onlinePayRefundDto) {
+
+        //校验是否传了 分页信息
+
+        int page = onlinePayRefundDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            onlinePayRefundDto.setPage((page - 1) * onlinePayRefundDto.getRow());
+        }
+
+        List<OnlinePayRefundDto> onlinePayRefunds = BeanConvertUtil.covertBeanList(onlinePayRefundV1ServiceDaoImpl.getOnlinePayRefundInfo(BeanConvertUtil.beanCovertMap(onlinePayRefundDto)), OnlinePayRefundDto.class);
+
+        return onlinePayRefunds;
+    }
+
+
+    @Override
+    public int queryOnlinePayRefundsCount(@RequestBody OnlinePayRefundDto onlinePayRefundDto) {
+        return onlinePayRefundV1ServiceDaoImpl.queryOnlinePayRefundsCount(BeanConvertUtil.beanCovertMap(onlinePayRefundDto));    }
+
+}

+ 16 - 0
service-fee/src/main/java/com/java110/fee/cmd/returnPayFee/UpdateReturnPayFeeCmd.java

@@ -41,6 +41,7 @@ import com.java110.dto.payFee.ReturnPayFeeDto;
 import com.java110.dto.user.UserDto;
 import com.java110.intf.acct.IAccountDetailInnerServiceSMO;
 import com.java110.intf.acct.IAccountInnerServiceSMO;
+import com.java110.intf.acct.IOnlinePayRefundV1InnerServiceSMO;
 import com.java110.intf.acct.IOnlinePayV1InnerServiceSMO;
 import com.java110.intf.community.IRoomInnerServiceSMO;
 import com.java110.intf.fee.*;
@@ -54,6 +55,7 @@ import com.java110.po.fee.PayFeeDetailPo;
 import com.java110.po.fee.PayFeePo;
 import com.java110.po.fee.FeeReceiptPo;
 import com.java110.po.fee.FeeReceiptDetailPo;
+import com.java110.po.onlinePayRefund.OnlinePayRefundPo;
 import com.java110.po.wechat.OnlinePayPo;
 import com.java110.po.payFee.PayFeeDetailDiscountPo;
 import com.java110.po.payFee.ReturnPayFeePo;
@@ -153,6 +155,9 @@ public class UpdateReturnPayFeeCmd extends Cmd {
     @Autowired
     private IUserV1InnerServiceSMO userV1InnerServiceSMOImpl;
 
+    @Autowired
+    private IOnlinePayRefundV1InnerServiceSMO onlinePayRefundV1InnerServiceSMOImpl;
+
 
     private static final String SPEC_RATE = "89002020980015"; //赠送月份
 
@@ -614,5 +619,16 @@ public class UpdateReturnPayFeeCmd extends Cmd {
         onlinePayPo.setState(OnlinePayDto.STATE_WT);
         onlinePayPo.setRefundFee(feeDetailDto.getReceivedAmount());
         onlinePayV1InnerServiceSMOImpl.updateOnlinePay(onlinePayPo);
+
+        //todo 保存 退费明细
+
+        OnlinePayRefundPo onlinePayRefundPo = new OnlinePayRefundPo();
+        onlinePayRefundPo.setPayId(onlinePayDtos.get(0).getPayId());
+        onlinePayRefundPo.setRefundId(GenerateCodeFactory.getGeneratorId("11"));
+        onlinePayRefundPo.setState(OnlinePayDto.STATE_WT);
+        onlinePayRefundPo.setMessage("待退费");
+        onlinePayRefundPo.setBusiId(feeDetailDto.getDetailId());
+        onlinePayRefundPo.setRefundFee(feeDetailDto.getReceivedAmount());
+        onlinePayRefundV1InnerServiceSMOImpl.saveOnlinePayRefund(onlinePayRefundPo);
     }
 }

+ 40 - 6
service-job/src/main/java/com/java110/job/adapt/returnMoney/bbg/ReturnPayFeeBbgMoneyAdapt.java

@@ -4,15 +4,19 @@ import com.alibaba.fastjson.JSONObject;
 import com.java110.core.client.FtpUploadTemplate;
 import com.java110.core.client.OssUploadTemplate;
 import com.java110.core.factory.CommunitySettingFactory;
+import com.java110.core.factory.GenerateCodeFactory;
 import com.java110.core.log.LoggerFactory;
 import com.java110.dto.file.FileDto;
+import com.java110.dto.onlinePayRefund.OnlinePayRefundDto;
 import com.java110.dto.wechat.OnlinePayDto;
 import com.java110.dto.system.Business;
+import com.java110.intf.acct.IOnlinePayRefundV1InnerServiceSMO;
 import com.java110.intf.acct.IOnlinePayV1InnerServiceSMO;
 import com.java110.intf.fee.IReturnPayFeeInnerServiceSMO;
 import com.java110.intf.order.IOrderInnerServiceSMO;
 import com.java110.intf.store.ISmallWechatV1InnerServiceSMO;
 import com.java110.job.adapt.DatabusAdaptImpl;
+import com.java110.po.onlinePayRefund.OnlinePayRefundPo;
 import com.java110.po.wechat.OnlinePayPo;
 import com.java110.utils.cache.MappingCache;
 import com.java110.utils.constant.MappingConstant;
@@ -79,6 +83,9 @@ public class ReturnPayFeeBbgMoneyAdapt extends DatabusAdaptImpl {
     @Autowired
     private OssUploadTemplate ossUploadTemplate;
 
+    @Autowired
+    private IOnlinePayRefundV1InnerServiceSMO onlinePayRefundV1InnerServiceSMOImpl;
+
     @Override
     public void execute(Business business, List<Business> businesses) {
         JSONObject data = business.getData();
@@ -109,11 +116,22 @@ public class ReturnPayFeeBbgMoneyAdapt extends DatabusAdaptImpl {
 
         String mchtNo_SM4 = CommunitySettingFactory.getValue(communityId, "mchtNo_SM4");
 
+        // todo 查询退费明细
+        OnlinePayRefundDto onlinePayRefundDto = new OnlinePayRefundDto();
+        onlinePayRefundDto.setPayId(onlinePayDtos.get(0).getPayId());
+        onlinePayRefundDto.setState(OnlinePayDto.STATE_WT);
+        List<OnlinePayRefundDto> onlinePayRefundDtos = onlinePayRefundV1InnerServiceSMOImpl.queryOnlinePayRefunds(onlinePayRefundDto);
+        String tranNo = GenerateCodeFactory.getGeneratorId("11");
+        if(onlinePayRefundDtos != null && onlinePayRefundDtos.size() >0){
+            tranNo = onlinePayRefundDtos.get(0).getRefundId();
+        }
+
+
         Map<String, Object> params = new HashMap<>();
         params.put("version", VERSION);// 版本号 1.0
         params.put("mcht_no", mchtNo_SM4);// 收款商户编号
-        params.put("tran_no", onlinePayDtos.get(0).getOrderId());// 商户流水
-        params.put("org_txn_no", onlinePayDtos.get(0).getTransactionId());// 原平台流水
+        params.put("tran_no", tranNo);// 商户流水
+        params.put("org_tran_no", onlinePayDtos.get(0).getTransactionId());// 原平台流水
         params.put("device_ip", "172.0.0.1");// 设备发起交易IP
         params.put("amt", onlinePayDtos.get(0).getRefundFee());// 交易金额
         params.put("ware_name", onlinePayDtos.get(0).getPayName());// 摘要备注
@@ -125,19 +143,35 @@ public class ReturnPayFeeBbgMoneyAdapt extends DatabusAdaptImpl {
         if (!"0000".equals(paramOut.getString("return_code"))
                 || !"SUCCESS".equals(paramOut.getString("status"))
                 || !"SUCCESS".equals(paramOut.getString("deal_status"))) {
-            doUpdateOnlinePay(onlinePayDtos.get(0).getOrderId(), OnlinePayDto.STATE_FT, "退款失败" + paramOut.getString("return_message"));
+            doUpdateOnlinePay(onlinePayDtos.get(0).getPayId(), OnlinePayDto.STATE_FT, "退款失败" + paramOut.getString("return_message"));
             return;
         }
-        doUpdateOnlinePay(onlinePayDtos.get(0).getOrderId(), OnlinePayDto.STATE_CT, "退款完成");
+        doUpdateOnlinePay(onlinePayDtos.get(0).getPayId(), OnlinePayDto.STATE_CT, "退款完成");
 
     }
 
-    private void doUpdateOnlinePay(String orderId, String state, String message) {
+    private void doUpdateOnlinePay(String payId, String state, String message) {
         OnlinePayPo onlinePayPo = new OnlinePayPo();
         onlinePayPo.setMessage(message.length() > 1000 ? message.substring(0, 1000) : message);
-        onlinePayPo.setOrderId(orderId);
+        onlinePayPo.setPayId(payId);
         onlinePayPo.setState(state);
         onlinePayV1InnerServiceSMOImpl.updateOnlinePay(onlinePayPo);
+
+        // todo 查询退费明细
+        OnlinePayRefundDto onlinePayRefundDto = new OnlinePayRefundDto();
+        onlinePayRefundDto.setPayId(payId);
+        onlinePayRefundDto.setState(OnlinePayDto.STATE_WT);
+        List<OnlinePayRefundDto> onlinePayRefundDtos = onlinePayRefundV1InnerServiceSMOImpl.queryOnlinePayRefunds(onlinePayRefundDto);
+
+        if(onlinePayRefundDtos == null || onlinePayRefundDtos.size() < 1){
+            return;
+        }
+
+        OnlinePayRefundPo onlinePayRefundPo = new OnlinePayRefundPo();
+        onlinePayRefundPo.setRefundId(onlinePayRefundDtos.get(0).getRefundId());
+        onlinePayRefundPo.setMessage(message.length() > 1000 ? message.substring(0, 1000) : message);
+        onlinePayRefundPo.setState(state);
+        onlinePayRefundV1InnerServiceSMOImpl.updateOnlinePayRefund(onlinePayRefundPo);
     }
 
     private byte[] getPkcs12(String fileName) {

+ 42 - 5
service-job/src/main/java/com/java110/job/adapt/returnMoney/wechat/ReturnPayFeeMoneyAdapt.java

@@ -3,16 +3,20 @@ package com.java110.job.adapt.returnMoney.wechat;
 import com.alibaba.fastjson.JSONObject;
 import com.java110.core.client.FtpUploadTemplate;
 import com.java110.core.client.OssUploadTemplate;
+import com.java110.core.factory.GenerateCodeFactory;
 import com.java110.core.log.LoggerFactory;
 import com.java110.dto.file.FileDto;
+import com.java110.dto.onlinePayRefund.OnlinePayRefundDto;
 import com.java110.dto.wechat.OnlinePayDto;
 import com.java110.dto.wechat.SmallWeChatDto;
 import com.java110.dto.system.Business;
+import com.java110.intf.acct.IOnlinePayRefundV1InnerServiceSMO;
 import com.java110.intf.acct.IOnlinePayV1InnerServiceSMO;
 import com.java110.intf.fee.IReturnPayFeeInnerServiceSMO;
 import com.java110.intf.order.IOrderInnerServiceSMO;
 import com.java110.intf.store.ISmallWechatV1InnerServiceSMO;
 import com.java110.job.adapt.DatabusAdaptImpl;
+import com.java110.po.onlinePayRefund.OnlinePayRefundPo;
 import com.java110.po.wechat.OnlinePayPo;
 import com.java110.utils.cache.MappingCache;
 import com.java110.utils.constant.MappingConstant;
@@ -86,6 +90,9 @@ public class ReturnPayFeeMoneyAdapt extends DatabusAdaptImpl {
     @Autowired
     private OssUploadTemplate ossUploadTemplate;
 
+    @Autowired
+    private IOnlinePayRefundV1InnerServiceSMO onlinePayRefundV1InnerServiceSMOImpl;
+
     @Override
     public void execute(Business business, List<Business> businesses) {
         JSONObject data = business.getData();
@@ -141,9 +148,21 @@ public class ReturnPayFeeMoneyAdapt extends DatabusAdaptImpl {
             parameters.put("mch_id", mchPassword);//商户号
             parameters.put("sub_mch_id", onlinePayDtos.get(0).getMchId());//商户号
         }
+
+        // todo 查询退费明细
+        OnlinePayRefundDto onlinePayRefundDto = new OnlinePayRefundDto();
+        onlinePayRefundDto.setPayId(onlinePayDtos.get(0).getPayId());
+        onlinePayRefundDto.setState(OnlinePayDto.STATE_WT);
+        List<OnlinePayRefundDto> onlinePayRefundDtos = onlinePayRefundV1InnerServiceSMOImpl.queryOnlinePayRefunds(onlinePayRefundDto);
+        String tranNo = GenerateCodeFactory.getGeneratorId("11");
+        if(onlinePayRefundDtos != null && onlinePayRefundDtos.size() >0){
+            tranNo = onlinePayRefundDtos.get(0).getRefundId();
+        }
+
+
         parameters.put("nonce_str", PayUtil.makeUUID(32));//随机数
         parameters.put("out_trade_no", onlinePayDtos.get(0).getOrderId());//商户订单号
-        parameters.put("out_refund_no", onlinePayDtos.get(0).getPayId());//我们自己设定的退款申请号,约束为UK
+        parameters.put("out_refund_no", tranNo);//我们自己设定的退款申请号,约束为UK
         parameters.put("total_fee", PayUtil.moneyToIntegerStr(Double.parseDouble(onlinePayDtos.get(0).getTotalFee())));//订单金额 单位为分!!!这里稍微注意一下
         parameters.put("refund_fee", PayUtil.moneyToIntegerStr(Double.parseDouble(onlinePayDtos.get(0).getRefundFee())));//退款金额 单位为分!!!
         parameters.put("sign", PayUtil.createSign(parameters, payPassword));
@@ -184,18 +203,36 @@ public class ReturnPayFeeMoneyAdapt extends DatabusAdaptImpl {
         }
         Map<String, String> resMap = PayUtil.xmlStrToMap(jsonStr);
         if ("SUCCESS".equals(resMap.get("return_code")) && "SUCCESS".equals(resMap.get("result_code"))) {
-            doUpdateOnlinePay(onlinePayDtos.get(0).getOrderId(), OnlinePayDto.STATE_CT, "退款完成");
+            doUpdateOnlinePay(onlinePayDtos.get(0).getPayId(), OnlinePayDto.STATE_CT, "退款完成");
         } else {
-            doUpdateOnlinePay(onlinePayDtos.get(0).getOrderId(), OnlinePayDto.STATE_FT, resMap.get("return_msg"));
+            doUpdateOnlinePay(onlinePayDtos.get(0).getPayId(), OnlinePayDto.STATE_FT, resMap.get("return_msg"));
         }
     }
 
-    private void doUpdateOnlinePay(String orderId, String state, String message) {
+
+
+    private void doUpdateOnlinePay(String payId, String state, String message) {
         OnlinePayPo onlinePayPo = new OnlinePayPo();
         onlinePayPo.setMessage(message.length() > 1000 ? message.substring(0, 1000) : message);
-        onlinePayPo.setOrderId(orderId);
+        onlinePayPo.setPayId(payId);
         onlinePayPo.setState(state);
         onlinePayV1InnerServiceSMOImpl.updateOnlinePay(onlinePayPo);
+
+        // todo 查询退费明细
+        OnlinePayRefundDto onlinePayRefundDto = new OnlinePayRefundDto();
+        onlinePayRefundDto.setPayId(payId);
+        onlinePayRefundDto.setState(OnlinePayDto.STATE_WT);
+        List<OnlinePayRefundDto> onlinePayRefundDtos = onlinePayRefundV1InnerServiceSMOImpl.queryOnlinePayRefunds(onlinePayRefundDto);
+
+        if(onlinePayRefundDtos == null || onlinePayRefundDtos.size() < 1){
+            return;
+        }
+
+        OnlinePayRefundPo onlinePayRefundPo = new OnlinePayRefundPo();
+        onlinePayRefundPo.setRefundId(onlinePayRefundDtos.get(0).getRefundId());
+        onlinePayRefundPo.setMessage(message.length() > 1000 ? message.substring(0, 1000) : message);
+        onlinePayRefundPo.setState(state);
+        onlinePayRefundV1InnerServiceSMOImpl.updateOnlinePayRefund(onlinePayRefundPo);
     }
 
     private byte[] getPkcs12(String fileName) {