Bläddra i källkod

付款模块-付款申请详情接口开发,api接口调整

ZhangWenQiang 5 år sedan
förälder
incheckning
62b4bc3b9d

+ 3 - 3
happy-boot-module-powerjob/src/main/java/org/jeecg/modules/hlgpayment/controller/HlgPaymentDetailController.java

@@ -68,9 +68,9 @@ public class HlgPaymentDetailController {
                                                          @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                          HttpServletRequest req) {
         Result<IPage<HlgPaymentDetail>> result = new Result<IPage<HlgPaymentDetail>>();
-        QueryWrapper<HlgPaymentDetail> queryWrapper = QueryGenerator.initQueryWrapperForRule(hlgPaymentDetail, req.getParameterMap());
-        Page<HlgPaymentDetail> page = new Page<HlgPaymentDetail>(pageNo, pageSize);
-        Page<HlgPaymentDetail> pageList = hlgPaymentDetailService.pageList(page, hlgPaymentDetail, queryWrapper);
+//        QueryWrapper<HlgPaymentDetail> queryWrapper = QueryGenerator.initQueryWrapperForRule(hlgPaymentDetail, req.getParameterMap());
+//        Page<HlgPaymentDetail> page = new Page<HlgPaymentDetail>(pageNo, pageSize);
+        Page<HlgPaymentDetail> pageList = hlgPaymentDetailService.pageListApi(pageNo, pageSize, hlgPaymentDetail, req);
         result.setSuccess(true);
         result.setResult(pageList);
         return result;

+ 39 - 36
happy-boot-module-powerjob/src/main/java/org/jeecg/modules/hlgpayment/service/IHlgPaymentDetailService.java

@@ -1,36 +1,39 @@
-package org.jeecg.modules.hlgpayment.service;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import org.jeecg.modules.hlgpayment.entity.HlgPayment;
-import org.jeecg.modules.hlgpayment.entity.HlgPaymentDetail;
-import com.baomidou.mybatisplus.extension.service.IService;
-import org.jeecg.modules.hlgpayment.entity.HlgPaymentDetailStatistics;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * @Description: 付款明细表
- * @Author: jeecg-boot
- * @Date:   2020-02-27
- * @Version: V1.0
- */
-public interface IHlgPaymentDetailService extends IService<HlgPaymentDetail> {
-
-    Page<HlgPaymentDetail> pageList(Page<HlgPaymentDetail> page, HlgPaymentDetail hlgPaymentDetail, QueryWrapper<HlgPaymentDetail> queryWrapper);
-
-    List<HlgPaymentDetail> findMonthListByUserId(HlgPaymentDetail hlgPaymentDetail);
-
-    int getCountAll(String paymentId);
-
-    int getCountSuccess(String paymentId);
-
-    List<HlgPaymentDetailStatistics> pageOutList( HlgPaymentDetailStatistics hlgPaymentDetailStatistics, QueryWrapper<HlgPaymentDetailStatistics> queryWrapper) ;
-
-    List<HlgPaymentDetailStatistics> getPaymentDetailStatisticsList(HlgPaymentDetailStatistics hlgPaymentDetailStatistics,QueryWrapper<HlgPaymentDetailStatistics> queryWrapper);
-
-    List<HlgPaymentDetail> findHlgPaymentDetailListByPaymentId(Integer id);
-
-    void deleteByLogic(HlgPayment hlgPayment);
-}
+package org.jeecg.modules.hlgpayment.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.jeecg.modules.hlgpayment.entity.HlgPayment;
+import org.jeecg.modules.hlgpayment.entity.HlgPaymentDetail;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.hlgpayment.entity.HlgPaymentDetailStatistics;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 付款明细表
+ * @Author: jeecg-boot
+ * @Date:   2020-02-27
+ * @Version: V1.0
+ */
+public interface IHlgPaymentDetailService extends IService<HlgPaymentDetail> {
+
+    Page<HlgPaymentDetail> pageList(Page<HlgPaymentDetail> page, HlgPaymentDetail hlgPaymentDetail, QueryWrapper<HlgPaymentDetail> queryWrapper);
+
+    List<HlgPaymentDetail> findMonthListByUserId(HlgPaymentDetail hlgPaymentDetail);
+
+    int getCountAll(String paymentId);
+
+    int getCountSuccess(String paymentId);
+
+    List<HlgPaymentDetailStatistics> pageOutList( HlgPaymentDetailStatistics hlgPaymentDetailStatistics, QueryWrapper<HlgPaymentDetailStatistics> queryWrapper) ;
+
+    List<HlgPaymentDetailStatistics> getPaymentDetailStatisticsList(HlgPaymentDetailStatistics hlgPaymentDetailStatistics,QueryWrapper<HlgPaymentDetailStatistics> queryWrapper);
+
+    List<HlgPaymentDetail> findHlgPaymentDetailListByPaymentId(Integer id);
+
+    void deleteByLogic(HlgPayment hlgPayment);
+
+    Page<HlgPaymentDetail> pageListApi(Integer pageNo, Integer pageSize, HlgPaymentDetail hlgPaymentDetail, HttpServletRequest req);
+}

+ 181 - 126
happy-boot-module-powerjob/src/main/java/org/jeecg/modules/hlgpayment/service/impl/HlgPaymentDetailServiceImpl.java

@@ -1,126 +1,181 @@
-package org.jeecg.modules.hlgpayment.service.impl;
-
-import com.baomidou.dynamic.datasource.annotation.DS;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.google.common.collect.Lists;
-import org.jeecg.modules.hlgpayment.entity.HlgPayment;
-import org.jeecg.modules.hlgpayment.entity.HlgPaymentDetail;
-import org.jeecg.modules.hlgpayment.entity.HlgPaymentDetailStatistics;
-import org.jeecg.modules.hlgpayment.mapper.HlgPaymentDetailMapper;
-import org.jeecg.modules.hlgpayment.service.IHlgPaymentDetailService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.cglib.beans.BeanMap;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.stereotype.Service;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-
-import java.util.Comparator;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-/**
- * @Description: 付款明细表
- * @Author: jeecg-boot
- * @Date: 2020-02-27
- * @Version: V1.0
- */
-@Service
-public class HlgPaymentDetailServiceImpl extends ServiceImpl<HlgPaymentDetailMapper, HlgPaymentDetail> implements IHlgPaymentDetailService {
-
-    @Override
-    public Page<HlgPaymentDetail> pageList(Page<HlgPaymentDetail> pageList, HlgPaymentDetail hlgPaymentDetail, QueryWrapper<HlgPaymentDetail> queryWrapper) {
-        return pageList.setRecords(baseMapper.findList(pageList, hlgPaymentDetail, queryWrapper));
-    }
-
-    @Override
-    public List<HlgPaymentDetail> findMonthListByUserId(HlgPaymentDetail hlgPaymentDetail) {
-        return baseMapper.findMonthListByUserId(hlgPaymentDetail);
-    }
-
-    /**
-     * 获取该paymentId下所有明细数量
-     *
-     * @param paymentId
-     * @return
-     */
-    @Override
-    public int getCountAll(String paymentId) {
-        return baseMapper.getCountAll(paymentId);
-    }
-
-    /**
-     * 获取该paymnetId下所有付款成功的明细数量
-     *
-     * @param paymentId
-     * @return
-     */
-    @Override
-    public int getCountSuccess(String paymentId) {
-        return baseMapper.getCountSuccess(paymentId);
-    }
-
-    @Override
-    public List<HlgPaymentDetailStatistics> pageOutList( HlgPaymentDetailStatistics hlgPaymentDetailStatistics, QueryWrapper<HlgPaymentDetailStatistics> queryWrapper)  {
-        List<HlgPaymentDetailStatistics> list = baseMapper.findHlgPaymentDetailStatisticsList(hlgPaymentDetailStatistics, queryWrapper);
-        return list;
-    }
-
-    @Override
-    @DS("multi-datasource1")
-    public List<HlgPaymentDetailStatistics> getPaymentDetailStatisticsList(HlgPaymentDetailStatistics hlgPaymentDetailStatistics,QueryWrapper<HlgPaymentDetailStatistics> queryWrapper) {
-        List<HlgPaymentDetailStatistics> list = baseMapper.getPaymentDetailStatisticsList(hlgPaymentDetailStatistics, queryWrapper);
-        return list;
-    }
-
-    /**
-     * 将List<Map<String,Object>>转换为List<T>
-     * @param maps
-     * @param clazz
-     * @return
-     * @throws InstantiationException
-     * @throws IllegalAccessException
-     */
-    public static <T> List<T> mapsToObjects(List<Map<String, Object>> maps,Class<T> clazz) throws InstantiationException, IllegalAccessException {
-        List<T> list = Lists.newArrayList();
-        if (maps != null && maps.size() > 0) {
-            Map<String, Object> map = null;
-            T bean = null;
-            for (int i = 0,size = maps.size(); i < size; i++) {
-                map = maps.get(i);
-                bean = clazz.newInstance();
-                mapToBean(map, bean);
-                list.add(bean);
-            }
-        }
-        return list;
-    }
-
-    /**
-     * 将map装换为javabean对象
-     * @param map
-     * @param bean
-     * @return
-     */
-    public static <T> T mapToBean(Map<String, Object> map,T bean) {
-        BeanMap beanMap = BeanMap.create(bean);
-        beanMap.putAll(map);
-        return bean;
-    }
-
-    @Override
-    public List<HlgPaymentDetail> findHlgPaymentDetailListByPaymentId(Integer id) {
-        return baseMapper.findHlgPaymentDetailListByPaymentId(id);
-    }
-
-    /**
-     * 逻辑删除付款单下的所有明细
-     * @param hlgPayment
-     */
-    @Override
-    public void deleteByLogic(HlgPayment hlgPayment) {
-        baseMapper.deleteByLogic(hlgPayment);
-    }
-}
+package org.jeecg.modules.hlgpayment.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.google.common.collect.Lists;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.exception.JeecgBootException;
+import org.jeecg.common.utils.CryptTool;
+import org.jeecg.common.utils.HttpsContants;
+import org.jeecg.common.utils.OauthApi;
+import org.jeecg.common.utils.OauthTokenUtils;
+import org.jeecg.modules.hlgpayment.entity.HlgPayment;
+import org.jeecg.modules.hlgpayment.entity.HlgPaymentDetail;
+import org.jeecg.modules.hlgpayment.entity.HlgPaymentDetailStatistics;
+import org.jeecg.modules.hlgpayment.mapper.HlgPaymentDetailMapper;
+import org.jeecg.modules.hlgpayment.service.IHlgPaymentDetailService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cglib.beans.BeanMap;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @Description: 付款明细表
+ * @Author: jeecg-boot
+ * @Date: 2020-02-27
+ * @Version: V1.0
+ */
+@Slf4j
+@Service
+public class HlgPaymentDetailServiceImpl extends ServiceImpl<HlgPaymentDetailMapper, HlgPaymentDetail> implements IHlgPaymentDetailService {
+
+    @Override
+    public Page<HlgPaymentDetail> pageList(Page<HlgPaymentDetail> pageList, HlgPaymentDetail hlgPaymentDetail, QueryWrapper<HlgPaymentDetail> queryWrapper) {
+        return pageList.setRecords(baseMapper.findList(pageList, hlgPaymentDetail, queryWrapper));
+    }
+
+    @Override
+    public List<HlgPaymentDetail> findMonthListByUserId(HlgPaymentDetail hlgPaymentDetail) {
+        return baseMapper.findMonthListByUserId(hlgPaymentDetail);
+    }
+
+    /**
+     * 获取该paymentId下所有明细数量
+     *
+     * @param paymentId
+     * @return
+     */
+    @Override
+    public int getCountAll(String paymentId) {
+        return baseMapper.getCountAll(paymentId);
+    }
+
+    /**
+     * 获取该paymnetId下所有付款成功的明细数量
+     *
+     * @param paymentId
+     * @return
+     */
+    @Override
+    public int getCountSuccess(String paymentId) {
+        return baseMapper.getCountSuccess(paymentId);
+    }
+
+    @Override
+    public List<HlgPaymentDetailStatistics> pageOutList(HlgPaymentDetailStatistics hlgPaymentDetailStatistics, QueryWrapper<HlgPaymentDetailStatistics> queryWrapper) {
+        List<HlgPaymentDetailStatistics> list = baseMapper.findHlgPaymentDetailStatisticsList(hlgPaymentDetailStatistics, queryWrapper);
+        return list;
+    }
+
+    @Override
+    @DS("multi-datasource1")
+    public List<HlgPaymentDetailStatistics> getPaymentDetailStatisticsList(HlgPaymentDetailStatistics hlgPaymentDetailStatistics, QueryWrapper<HlgPaymentDetailStatistics> queryWrapper) {
+        List<HlgPaymentDetailStatistics> list = baseMapper.getPaymentDetailStatisticsList(hlgPaymentDetailStatistics, queryWrapper);
+        return list;
+    }
+
+    /**
+     * 将List<Map<String,Object>>转换为List<T>
+     *
+     * @param maps
+     * @param clazz
+     * @return
+     * @throws InstantiationException
+     * @throws IllegalAccessException
+     */
+    public static <T> List<T> mapsToObjects(List<Map<String, Object>> maps, Class<T> clazz) throws InstantiationException, IllegalAccessException {
+        List<T> list = Lists.newArrayList();
+        if (maps != null && maps.size() > 0) {
+            Map<String, Object> map = null;
+            T bean = null;
+            for (int i = 0, size = maps.size(); i < size; i++) {
+                map = maps.get(i);
+                bean = clazz.newInstance();
+                mapToBean(map, bean);
+                list.add(bean);
+            }
+        }
+        return list;
+    }
+
+    /**
+     * 将map装换为javabean对象
+     *
+     * @param map
+     * @param bean
+     * @return
+     */
+    public static <T> T mapToBean(Map<String, Object> map, T bean) {
+        BeanMap beanMap = BeanMap.create(bean);
+        beanMap.putAll(map);
+        return bean;
+    }
+
+    @Override
+    public List<HlgPaymentDetail> findHlgPaymentDetailListByPaymentId(Integer id) {
+        return baseMapper.findHlgPaymentDetailListByPaymentId(id);
+    }
+
+    /**
+     * 逻辑删除付款单下的所有明细
+     *
+     * @param hlgPayment
+     */
+    @Override
+    public void deleteByLogic(HlgPayment hlgPayment) {
+        baseMapper.deleteByLogic(hlgPayment);
+    }
+
+    /**
+     * 慧灵工-慧盈
+     * 付款申请详情列表
+     *
+     * @param pageNo
+     * @param pageSize
+     * @param hlgPaymentDetail
+     * @param req
+     * @return
+     */
+    @Override
+    public Page<HlgPaymentDetail> pageListApi(Integer pageNo, Integer pageSize, HlgPaymentDetail hlgPaymentDetail, HttpServletRequest req) {
+        Page<HlgPaymentDetail> page = new Page<>();
+        //付款申请详情列表信息
+        String accessToken = OauthTokenUtils.getDayAccessToken();
+        String requestUrl = OauthApi.paymentDetailList;
+        Map<String, Object> parameters = new HashMap<>();
+        parameters.put("pageNo", pageNo);
+        parameters.put("pageSize", pageSize);
+        parameters.put("paymentId", hlgPaymentDetail.getPaymentId());
+        parameters.put("status", hlgPaymentDetail.getStatus());
+        //数据加密
+        String biz_content = CryptTool.encode(JSONObject.toJSONString(parameters));
+        JSONObject jsonObject = OauthTokenUtils.doRequest(requestUrl, HttpsContants.POST, biz_content, accessToken);
+        log.info("付款申请详情列表===={}", jsonObject);
+        if (jsonObject != null) {
+            if (jsonObject.getBoolean(HttpsContants.SUCCESS_FLAG)) {
+                log.info("付款申请详情列表成功===={}", jsonObject);
+                JSONObject jsonObject1 = jsonObject.getJSONObject("result");
+                List<HlgPaymentDetail> list = (List<HlgPaymentDetail>) jsonObject1.get("records");
+                log.info("付款申请详情列表数组==={}", list);
+                page.setRecords(list);
+                page.setTotal(jsonObject1.getLong("total"));
+            } else {
+                throw new JeecgBootException("查询数据异常");
+            }
+        } else {
+            throw new JeecgBootException("查询数据异常");
+        }
+        return page;
+    }
+}

+ 1 - 0
happy-boot-module-powerjob/src/main/java/org/jeecg/modules/hlgpayment/service/impl/HlgPaymentServiceImpl.java

@@ -1379,6 +1379,7 @@ public class HlgPaymentServiceImpl extends ServiceImpl<HlgPaymentMapper, HlgPaym
         parameters.put("companyCodeList", companyCodeList);
         parameters.put("paymentCode", hlgPayment.getPaymentCode());
         parameters.put("companyName", hlgPayment.getCompanyName());
+        parameters.put("status", hlgPayment.getStatus());
         //数据加密
         String biz_content = CryptTool.encode(JSONObject.toJSONString(parameters));
         JSONObject jsonObject = OauthTokenUtils.doRequest(requestUrl, HttpsContants.POST, biz_content, accessToken);

+ 1 - 4
happy-boot-module-settlement/src/main/java/org/jeecg/common/utils/OauthApi.java

@@ -67,7 +67,7 @@ public interface OauthApi {
     public static final String paymentList = "/oauth/hlwPayment/list";
 
     //付款明细-列表
-    public static final String paymentDetailList = "/oauth/hlwPaymentDetail/list";
+    public static final String paymentDetailList = "/oauth/hlwPayment/detailList";
 
     //我的账户-服务商账户明细
     public static final String companyAccountDetailList = "/oauth/hlwCompanyAccountDetail/list";
@@ -87,7 +87,4 @@ public interface OauthApi {
     //用户-上传承揽合同
     public static final String orderUploadUserContract = "/oauth/hlwOrder/uploadUserContract";
 
-
-    //是否存在业务数据(即是否存在企业服务商)
-    public static final String isExistenceDate = "/oauth/hlwcompany/isExistenceCompanyDate";
 }