浏览代码

开票资料列表

LiFei 3 年之前
父节点
当前提交
43b0f62fb4

+ 21 - 0
happy-boot-module-flexjob/src/main/java/org/jeecg/modules/saasmanager/controller/HwPlatformCompanyController.java

@@ -19,6 +19,7 @@ import org.jeecg.common.utils.OauthApi;
 import org.jeecg.common.utils.OauthTokenUtils;
 import org.jeecg.modules.platmanager.entity.HwPlatform;
 import org.jeecg.modules.requiremanager.entity.HwRequirement;
+import org.jeecg.modules.saasmanager.entity.HlwCompanyInvoiceInformation;
 import org.jeecg.modules.saasmanager.entity.HwCompanySubcontractor;
 import org.jeecg.modules.saasmanager.entity.HwCompanyUploadContract;
 import org.jeecg.modules.saasmanager.entity.HwPlatformCompany;
@@ -676,4 +677,24 @@ public class HwPlatformCompanyController {
         return Result.ok("文件导入失败!");
     }
 
+    /**
+     * 开票资料列表
+     *
+     * @param hlwCompanyInvoiceInformation
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @GetMapping(value = "/companyInvoiceInfoList")
+    public Result<IPage<?>> companyInvoiceInfoList(HlwCompanyInvoiceInformation hlwCompanyInvoiceInformation,
+                                        @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                        @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                        HttpServletRequest req) {
+        Result<IPage<?>> result = new Result<IPage<?>>();
+        Page<?> pageList = hwPlatformCompanyService.companyInvoiceInfoList(pageNo, pageSize,hlwCompanyInvoiceInformation,req);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
 }

+ 80 - 0
happy-boot-module-flexjob/src/main/java/org/jeecg/modules/saasmanager/entity/HlwCompanyInvoiceInformation.java

@@ -0,0 +1,80 @@
+package org.jeecg.modules.saasmanager.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @Description: hlw_company_invoice_information
+ * @Author: jeecg-boot
+ * @Date:   2022-10-24
+ * @Version: V1.0
+ */
+@Data
+@TableName("hlw_company_invoice_information")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="hlw_company_invoice_information对象", description="hlw_company_invoice_information")
+public class HlwCompanyInvoiceInformation implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**主键*/
+	@TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "主键")
+    private Integer id;
+	/**企业id*/
+	@Excel(name = "企业id", width = 15)
+    @ApiModelProperty(value = "企业id")
+    private Integer companyId;
+	/**发票抬头*/
+	@Excel(name = "发票抬头", width = 15)
+    @ApiModelProperty(value = "发票抬头")
+    private String invoiceTitle;
+	/**纳税人识别号*/
+	@Excel(name = "纳税人识别号", width = 15)
+    @ApiModelProperty(value = "纳税人识别号")
+    private String dutyParagraph;
+	/**开户银行*/
+	@Excel(name = "开户银行", width = 15)
+    @ApiModelProperty(value = "开户银行")
+    private String accountBank;
+	/**开户账号*/
+	@Excel(name = "开户账号", width = 15)
+    @ApiModelProperty(value = "开户账号")
+    private String account;
+	/**地址*/
+	@Excel(name = "地址", width = 15)
+    @ApiModelProperty(value = "地址")
+    private String registerAddress;
+	/**电话*/
+	@Excel(name = "电话", width = 15)
+    @ApiModelProperty(value = "电话")
+    private String registerPhone;
+	/**创建时间*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+	/**创建者*/
+    @ApiModelProperty(value = "创建者")
+    private String createBy;
+	/**更新时间*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+	/**更新者*/
+    @ApiModelProperty(value = "更新者")
+    private String updateBy;
+}

+ 3 - 4
happy-boot-module-flexjob/src/main/java/org/jeecg/modules/saasmanager/service/IHwPlatformCompanyService.java

@@ -3,11 +3,8 @@ package org.jeecg.modules.saasmanager.service;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.jeecg.common.api.vo.Result;
-import org.jeecg.modules.saasmanager.entity.HwCompanySubcontractor;
-import org.jeecg.modules.saasmanager.entity.HwCompanyUploadContract;
-import org.jeecg.modules.saasmanager.entity.HwPlatformCompany;
+import org.jeecg.modules.saasmanager.entity.*;
 import com.baomidou.mybatisplus.extension.service.IService;
-import org.jeecg.modules.saasmanager.entity.HwPlatformCompanyExport;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.List;
@@ -49,4 +46,6 @@ public interface IHwPlatformCompanyService extends IService<HwPlatformCompany> {
     Page<HwPlatformCompany> getPageList(Integer pageNo, Integer pageSize, HwPlatformCompany hwPlatformCompany, HttpServletRequest request);
 
     String companyUploadContract(HwCompanyUploadContract hwCompanyUploadContract);
+
+    Page<?> companyInvoiceInfoList(Integer pageNo, Integer pageSize, HlwCompanyInvoiceInformation hlwCompanyInvoiceInformation, HttpServletRequest req);
 }

+ 42 - 0
happy-boot-module-flexjob/src/main/java/org/jeecg/modules/saasmanager/service/impl/HwPlatformCompanyServiceImpl.java

@@ -19,6 +19,7 @@ import org.jeecg.common.utils.OauthApi;
 import org.jeecg.common.utils.OauthTokenUtils;
 import org.jeecg.modules.platmanager.entity.HwPlatform;
 import org.jeecg.modules.platmanager.service.IHwPlatformService;
+import org.jeecg.modules.saasmanager.entity.HlwCompanyInvoiceInformation;
 import org.jeecg.modules.saasmanager.entity.HwCompanySubcontractor;
 import org.jeecg.modules.saasmanager.entity.HwCompanyUploadContract;
 import org.jeecg.modules.saasmanager.entity.HwPlatformCompany;
@@ -723,4 +724,45 @@ public class HwPlatformCompanyServiceImpl extends ServiceImpl<HwPlatformCompanyM
             throw new JeecgBootException("企业认证失败");
         }
     }
+
+
+    @Override
+    public Page<?> companyInvoiceInfoList(Integer pageNo, Integer pageSize, HlwCompanyInvoiceInformation hlwCompanyInvoiceInformation, HttpServletRequest request) {
+        Page<Map<String, Object>> page = new Page<Map<String, Object>>();
+        //获取请求路由路径
+        String routeUrl = request.getServletPath();
+        //获取当前登录用户
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        List<String> companyCodeList = RoleDataUtils.findCompanyCodeList(sysUser.getUsername(), routeUrl, sysUser.getOrgCode());
+        if (companyCodeList.size() == 0) {
+            page.setRecords(Collections.emptyList());
+            return page;
+        }
+        //慧盈查询开票资料列表列表
+        String accessToken = OauthTokenUtils.getDayAccessToken();
+        String requestUrl = OauthApi.COMPANY_INVOICE_INFO_LIST;
+        Map<String, Object> parameters = new HashMap<>();
+        parameters.put("pageNo", pageNo);
+        parameters.put("pageSize", pageSize);
+        parameters.put("companyCodeList", companyCodeList);
+        //数据加密
+        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<Map<String, Object>> list = (List<Map<String, Object>>) jsonObject1.get("records");
+                log.info("开票资料列表==={}", list);
+                page.setRecords(list);
+                page.setTotal(jsonObject1.getLong("total"));
+            } else {
+                throw new JeecgBootException("查询数据异常");
+            }
+        } else {
+            throw new JeecgBootException("查询数据异常");
+        }
+        return page;
+    }
 }

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

@@ -169,6 +169,9 @@ public interface OauthApi {
     //开票明细列表
     public static final String INVOICE_PAYMENT_LIST = "/oauth/hlwInvoice/paymentList";
 
+    //开票资料列表
+    public static final String COMPANY_INVOICE_INFO_LIST = "/oauth/hlwCompanyInvoiceInfo/list";
+
     //校验能否一起开票
     public static final String INVOICE_CHECK_APPLY = "/oauth/hlwInvoice/checkApply";