From f156183ad4ec3a713c4de9cfb417fe2151897f8e Mon Sep 17 00:00:00 2001 From: chenqp <965586934@qq.com> Date: Sun, 27 Aug 2023 23:31:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=8A=A5=E9=94=80=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E5=8A=9F=E8=83=BD=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../expenseclaim/ExpenseClaimController.java | 3 -- .../expenseclaim/ExpenseClaimServiceImpl.java | 22 ++++++-- .../admin/expenseclaim/vo/IdentifyReqVO.java | 17 ++++++ .../admin/expenseclaim/vo/IdentifyResqVO.java | 52 +++++++++++++++++++ .../admin/feemanage/vo/FeeManageBaseVO.java | 2 +- .../admin/invoice/InvoiceController.java | 9 +++- .../bs/dal/dataobject/invoice/InvoiceDO.java | 4 ++ .../service/feemanage/FeeManageService.java | 2 + .../feemanage/FeeManageServiceImpl.java | 42 ++++++++++++--- .../bs/service/invoice/InvoiceService.java | 4 ++ .../service/invoice/InvoiceServiceImpl.java | 21 ++++++++ .../module/bs/utils/BaiduOcrConstant.java | 9 ++-- .../module/bs/utils/BaiduOcrHandler.java | 50 +++++++++++++++++- .../system/api/permission/PermissionApi.java | 2 +- .../api/permission/PermissionApiImpl.java | 4 ++ 15 files changed, 221 insertions(+), 22 deletions(-) create mode 100644 yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/expenseclaim/vo/IdentifyReqVO.java create mode 100644 yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/expenseclaim/vo/IdentifyResqVO.java diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/expenseclaim/ExpenseClaimController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/expenseclaim/ExpenseClaimController.java index 43bac865..82504a8e 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/expenseclaim/ExpenseClaimController.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/expenseclaim/ExpenseClaimController.java @@ -12,8 +12,6 @@ import cn.iocoder.yudao.module.bpm.service.expenseclaimtrip.ExpenseClaimTripServ import cn.iocoder.yudao.module.bpm.service.task.BpmTaskService; import cn.iocoder.yudao.module.bs.controller.admin.expenseclaim.vo.*; import cn.iocoder.yudao.module.bs.convert.expenseclaim.ExpenseClaimConvert; -import cn.iocoder.yudao.module.bs.dal.dataobject.expenseapply.ExpenseApplyDO; -import cn.iocoder.yudao.module.bs.dal.dataobject.expenseapplytrip.ExpenseApplyTripDO; import cn.iocoder.yudao.module.bs.dal.dataobject.expenseclaim.ExpenseClaimDO; import cn.iocoder.yudao.module.bs.dal.dataobject.expenseclaimdetail.ExpenseClaimDetailDO; import cn.iocoder.yudao.module.bs.dal.dataobject.expenseclaimtrip.ExpenseClaimTripDO; @@ -152,5 +150,4 @@ public class ExpenseClaimController { List datas = ExpenseClaimConvert.INSTANCE.convertList02(list); ExcelUtils.write(response, "报销单.xls", "数据", ExpenseClaimExcelVO.class, datas); } - } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/expenseclaim/ExpenseClaimServiceImpl.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/expenseclaim/ExpenseClaimServiceImpl.java index 282d35ee..39fa9e4c 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/expenseclaim/ExpenseClaimServiceImpl.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/expenseclaim/ExpenseClaimServiceImpl.java @@ -21,6 +21,7 @@ import cn.iocoder.yudao.module.bs.enums.BillTypeEnum; import cn.iocoder.yudao.module.bs.enums.ExpenseApplyStatusEnum; import cn.iocoder.yudao.module.bs.enums.ExpenseClaimSettleStatusEnum; import cn.iocoder.yudao.module.bs.service.budget.BudgetService; +import cn.iocoder.yudao.module.bs.service.feemanage.FeeManageService; import cn.iocoder.yudao.module.system.api.dept.DeptApi; import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO; import cn.iocoder.yudao.module.system.api.user.AdminUserApi; @@ -67,6 +68,9 @@ public class ExpenseClaimServiceImpl extends MPJBaseServiceImpl dataValidAndSetFileName(ExpenseClaimCreateReqVO createReqVO, ExpenseClaimDO expenseClaim) { boolean isAdd = createReqVO.getId() == null; - + LoginUser loginUser = getLoginUser(); + expenseClaim.setUserId(loginUser.getId()); + AdminUserRespDTO user = adminUserApi.getUser(loginUser.getId()); + expenseClaim.setDeptId(user.getDeptId()); if (expenseClaim.getBillType().equals(BillTypeEnum.CLBX.getValue())) { List expenseApplyTrips = createReqVO.getExpenseClaimTrips(); // if (CollUtil.isEmpty(expenseApplyTrips)) { @@ -138,16 +145,25 @@ public class ExpenseClaimServiceImpl extends MPJBaseServiceImpl details = trip.getExpenseClaimDetails(); if (CollUtil.isNotEmpty(details)) { + int bb = 1; for (ExpenseClaimDetailCreateReqVO detail : details) { + //校验是否超出费控设置 + BigDecimal setAmount = feeManageService.findByClaim(detail.getFeeType(),loginUser.getId(),expenseClaim.getCostDeptId(),trip.getDestinationLocation()); + if (setAmount != null && detail.getAmount().compareTo(setAmount) >0) { + return CommonResult.error("第" + aa + "条行程" + ",第" + bb + "条费用明细超出费控设置金额,费控设置金额为:" + setAmount.stripTrailingZeros().toPlainString()); + } tripAmount = tripAmount.add(detail.getAmount()); + bb = bb + 1; } } trip.setAmount(tripAmount); amount = amount.add(tripAmount); + aa = aa +1; } expenseClaim.setAmount(amount); } else { @@ -169,10 +185,6 @@ public class ExpenseClaimServiceImpl extends MPJBaseServiceImpl datas = InvoiceConvert.INSTANCE.convertList02(list); ExcelUtils.write(response, "我的发票.xls", "数据", InvoiceExcelVO.class, datas); } - + @PostMapping("/identify") + @Operation(summary = "发票识别") + @PreAuthorize("@ss.hasPermission('bs:expense-claim:query')") + public CommonResult identify(@Valid @RequestBody IdentifyReqVO billIdReqVO) throws Exception { + return invoiceService.identify(billIdReqVO); + } } diff --git a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/dal/dataobject/invoice/InvoiceDO.java b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/dal/dataobject/invoice/InvoiceDO.java index 6ee973c0..98f4229b 100644 --- a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/dal/dataobject/invoice/InvoiceDO.java +++ b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/dal/dataobject/invoice/InvoiceDO.java @@ -31,6 +31,10 @@ public class InvoiceDO extends TenantBaseDO { */ @TableId private Long id; + /** + * 发票种类 + */ + private String type; /** * 附件 */ diff --git a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/feemanage/FeeManageService.java b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/feemanage/FeeManageService.java index ff75d2bc..c82adf00 100644 --- a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/feemanage/FeeManageService.java +++ b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/feemanage/FeeManageService.java @@ -9,6 +9,7 @@ import cn.iocoder.yudao.module.bs.dal.dataobject.feemanage.FeeManageDO; import com.github.yulichang.base.MPJBaseService; import javax.validation.Valid; +import java.math.BigDecimal; import java.util.Collection; import java.util.List; @@ -73,4 +74,5 @@ public interface FeeManageService extends MPJBaseService { */ List getFeeManageList(FeeManageExportReqVO exportReqVO); + BigDecimal findByClaim(String feeType, Long id, Long costDeptId, String destinationLocation); } diff --git a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/feemanage/FeeManageServiceImpl.java b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/feemanage/FeeManageServiceImpl.java index bf8c80b1..d4afd412 100644 --- a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/feemanage/FeeManageServiceImpl.java +++ b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/feemanage/FeeManageServiceImpl.java @@ -1,5 +1,7 @@ package cn.iocoder.yudao.module.bs.service.feemanage; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.NumberUtil; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.module.bs.controller.admin.feemanage.vo.FeeManageCreateReqVO; @@ -9,13 +11,17 @@ import cn.iocoder.yudao.module.bs.controller.admin.feemanage.vo.FeeManageUpdateR import cn.iocoder.yudao.module.bs.convert.feemanage.FeeManageConvert; import cn.iocoder.yudao.module.bs.dal.dataobject.feemanage.FeeManageDO; import cn.iocoder.yudao.module.bs.dal.mysql.feemanage.FeeManageMapper; +import cn.iocoder.yudao.module.system.api.permission.PermissionApi; import com.github.yulichang.base.MPJBaseServiceImpl; +import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; import javax.annotation.Resource; +import java.math.BigDecimal; import java.util.Collection; import java.util.List; +import java.util.Set; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.module.bs.enums.ErrorCodeConstants.FEE_MANAGE_NOT_EXISTS; @@ -31,7 +37,9 @@ public class FeeManageServiceImpl extends MPJBaseServiceImpl query = new LambdaQueryWrapperX<>(); - query.eq(FeeManageDO::getDeptId, feeManage.getDeptId()); - query.eq(FeeManageDO::getFeeType, feeManage.getFeeType()); - query.apply("FIND_IN_SET({0}, role_ids) > 0",roleId); - query.apply("FIND_IN_SET({0}, area) > 0",area); + LambdaQueryWrapperX query = getFeeManageByUniq(roleId, area, feeManage.getDeptId(), feeManage.getFeeType()); if (feeManage.getId() != null) { query.ne(FeeManageDO::getId, feeManage.getId()); } @@ -61,6 +65,15 @@ public class FeeManageServiceImpl extends MPJBaseServiceImpl getFeeManageByUniq(Long roleId, String area, Long deptId, String feeType) { + LambdaQueryWrapperX query = new LambdaQueryWrapperX<>(); + query.eq(FeeManageDO::getDeptId, deptId); + query.eq(FeeManageDO::getFeeType, feeType); + query.apply("JSON_CONTAINS(role_ids, JSON_ARRAY({0}))", roleId); + query.apply("JSON_CONTAINS(area, JSON_ARRAY({0}))", area); + return query; + } + @Override public void updateFeeManage(FeeManageUpdateReqVO updateReqVO) { // 校验存在 @@ -105,4 +118,21 @@ public class FeeManageServiceImpl extends MPJBaseServiceImpl roleIds = permissionApi.getUserRoleIdListByUserId(userId); + BigDecimal amount = null; + for (Long roleId : roleIds) { + LambdaQueryWrapperX queryWrapperX = getFeeManageByUniq(roleId, destinationLocation, costDeptId, feeType); + FeeManageDO feeManageDO = getOne(queryWrapperX); + if (feeManageDO !=null) { + if (amount == null) { + amount = BigDecimal.ZERO; + } + //如果用户多角色且正好配置了的话取更大的配置 + amount = NumberUtil.max(feeManageDO.getAmount(), amount); + } + } + return amount; + } } diff --git a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/invoice/InvoiceService.java b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/invoice/InvoiceService.java index 2f33c2ae..fbf1bfce 100644 --- a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/invoice/InvoiceService.java +++ b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/invoice/InvoiceService.java @@ -1,6 +1,8 @@ package cn.iocoder.yudao.module.bs.service.invoice; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.bs.controller.admin.expenseclaim.vo.IdentifyReqVO; import cn.iocoder.yudao.module.bs.controller.admin.invoice.vo.InvoiceCreateReqVO; import cn.iocoder.yudao.module.bs.controller.admin.invoice.vo.InvoiceExportReqVO; import cn.iocoder.yudao.module.bs.controller.admin.invoice.vo.InvoicePageReqVO; @@ -8,6 +10,7 @@ import cn.iocoder.yudao.module.bs.controller.admin.invoice.vo.InvoiceUpdateReqVO import cn.iocoder.yudao.module.bs.dal.dataobject.invoice.InvoiceDO; import javax.validation.Valid; +import java.io.UnsupportedEncodingException; import java.util.Collection; import java.util.List; @@ -72,4 +75,5 @@ public interface InvoiceService { */ List getInvoiceList(InvoiceExportReqVO exportReqVO); + CommonResult identify(IdentifyReqVO billIdReqVO) throws Exception; } diff --git a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/invoice/InvoiceServiceImpl.java b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/invoice/InvoiceServiceImpl.java index e6d5618a..e4385b40 100644 --- a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/invoice/InvoiceServiceImpl.java +++ b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/invoice/InvoiceServiceImpl.java @@ -1,6 +1,11 @@ package cn.iocoder.yudao.module.bs.service.invoice; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import cn.hutool.http.HttpUtil; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.bs.controller.admin.expenseclaim.vo.IdentifyReqVO; import cn.iocoder.yudao.module.bs.controller.admin.invoice.vo.InvoiceCreateReqVO; import cn.iocoder.yudao.module.bs.controller.admin.invoice.vo.InvoiceExportReqVO; import cn.iocoder.yudao.module.bs.controller.admin.invoice.vo.InvoicePageReqVO; @@ -8,12 +13,17 @@ import cn.iocoder.yudao.module.bs.controller.admin.invoice.vo.InvoiceUpdateReqVO import cn.iocoder.yudao.module.bs.convert.invoice.InvoiceConvert; import cn.iocoder.yudao.module.bs.dal.dataobject.invoice.InvoiceDO; import cn.iocoder.yudao.module.bs.dal.mysql.invoice.InvoiceMapper; +import cn.iocoder.yudao.module.bs.utils.BaiduOcrConstant; +import cn.iocoder.yudao.module.bs.utils.BaiduOcrHandler; +import cn.iocoder.yudao.module.bs.utils.Base64Util; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.module.bs.enums.ErrorCodeConstants.INVOICE_NOT_EXISTS; import javax.annotation.Resource; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; import java.util.Collection; import java.util.List; @@ -81,4 +91,15 @@ public class InvoiceServiceImpl implements InvoiceService { return invoiceMapper.selectList(exportReqVO); } + @Override + public CommonResult identify(IdentifyReqVO identifyReqVO) throws Exception { + String url = identifyReqVO.getUrl(); + HttpRequest get = HttpUtil.createGet(url); +// String base64 = byteArrayToBase64(get.execute().bodyBytes()); + String encode = Base64Util.encode(get.execute().bodyBytes()); + encode= URLEncoder.encode(encode, BaiduOcrConstant.CHARSET); + boolean isPdf = StrUtil.endWith(url, ".pdf"); + BaiduOcrHandler.invoice(encode,isPdf); + return CommonResult.success(); + } } diff --git a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/utils/BaiduOcrConstant.java b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/utils/BaiduOcrConstant.java index c34353d7..f0d6084b 100644 --- a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/utils/BaiduOcrConstant.java +++ b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/utils/BaiduOcrConstant.java @@ -14,13 +14,13 @@ public interface BaiduOcrConstant { * 需配置 * 百度智能云注册的应用程序API Key */ - String CLIENT_ID = "YLQSdO65OZjARM8A8ZN62O11"; + String CLIENT_ID = "Aqp2823OP5H5lS7O94UvqXFb"; /** * 需配置 * 百度智能云注册的应用程序Secret Key */ - String CLIENT_SECRET = "4fU8odNqBDqNk5W3BS0PDrdk20TGV9sO"; + String CLIENT_SECRET = "qN9e4sSVCAcEWdwH3mUV8GMcWg3ujIvr"; /** * 身份证正面识别OCR接口地址 @@ -41,5 +41,8 @@ public interface BaiduOcrConstant { * OCR accessToken获取接口地址 */ String ACCESS_TOKEN_URL = "https://aip.baidubce.com/oauth/2.0/token"; - + /** + * 智能财务票据识别接口 + */ + String INVOICEURL = "https://aip.baidubce.com/rest/2.0/ocr/v1/multiple_invoice"; } \ No newline at end of file diff --git a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/utils/BaiduOcrHandler.java b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/utils/BaiduOcrHandler.java index c44bee92..425f424b 100644 --- a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/utils/BaiduOcrHandler.java +++ b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/utils/BaiduOcrHandler.java @@ -1,7 +1,9 @@ package cn.iocoder.yudao.module.bs.utils; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.date.DateUtil; +import cn.iocoder.yudao.module.bs.controller.admin.expenseclaim.vo.IdentifyResqVO; import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baidu.aip.auth.DevAuth; import com.baidu.aip.util.AipClientConfiguration; @@ -15,7 +17,6 @@ import java.net.URLEncoder; import java.util.Map; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; -import static cn.iocoder.yudao.module.bs.enums.ErrorCodeConstants.SUPPLIER_COMPANY_NOT_EXISTS; import static cn.iocoder.yudao.module.bs.enums.ErrorCodeConstants.SUPPLIER_COMPANY_NOT_EXISTS_Ai; /** @@ -287,4 +288,49 @@ public class BaiduOcrHandler { return config; } + public static IdentifyResqVO invoice(String baseStr, boolean isPdf) throws Exception { + String accessToken = getAccessToken(); + if (StringUtils.isEmpty(accessToken)) { + throw new RuntimeException("获取token失败"); + } + String image = "image"; + if (isPdf) { + image = "pdf_file"; + } + String param = "verify_parameter=false&" + image + "=" +baseStr; + String jsonStr = HttpUtil.post(BaiduOcrConstant.INVOICEURL, accessToken, param); + JSONObject jsonObject = JSON.parseObject(jsonStr); + // log.info("营业执照OCR识别结果=>{}", jsonObject); + if (!jsonObject.containsKey("words_result")) { + log.error(baseStr+",发票识别失败"+jsonObject.toString()); + throw exception("发票识别失败"); + } +// JSONObject wordsResult = jsonObject.getJSONObject("words_result"); +// JSONObject result = wordsResult.getJSONObject("result"); +// IdentifyResqVO identifyResqVO = new IdentifyResqVO(); +// identifyResqVO.setType(wordsResult.getString("type")); +// if (CollUtil.isNotEmpty(result.getJSONArray("invoice_type"))) { +// identifyResqVO.setInvoiceType(result.getJSONArray("invoice_type").getJSONObject(0).getString("word")); +// } +// if (CollUtil.isNotEmpty(result.getJSONArray("invoice_code"))) { +// identifyResqVO.setInvoiceCode(result.getJSONArray("invoice_code").getJSONObject(0).getString("word")); +// } +// if (CollUtil.isNotEmpty(result.getJSONArray("invoice_num"))) { +// identifyResqVO.setInvoiceNum(result.getJSONArray("invoice_num").getJSONObject(0).getString("word")); +// } +// String invoiceDateStr = result.getJSONArray("invoice_date").getJSONObject(0).getString("word"); +// identifyResqVO.setInvoiceDate(DateUtil.parse(invoiceDateStr).toLocalDateTime()); +//// identifyResqVO.setSeller(); +// if (CollUtil.isNotEmpty(result.getJSONArray("total_tax"))) { +// identifyResqVO.setTaxAmount(result.getJSONArray("total_tax").getJSONObject(0).getBigDecimal("word")); +// } +// identifyResqVO.setTotalAmount(result.getJSONArray("total_amount").getJSONObject(0).getBigDecimal("word")); +//// identifyResqVO.setExcludingTaxAmount(); + + + System.out.println(jsonObject.toString()); + + return null; + } + } diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/PermissionApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/PermissionApi.java index ea16fe4e..1e15a270 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/PermissionApi.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/PermissionApi.java @@ -45,5 +45,5 @@ public interface PermissionApi { * @return 部门数据权限 */ DeptDataPermissionRespDTO getDeptDataPermission(Long userId); - + public Set getUserRoleIdListByUserId(Long userId); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/permission/PermissionApiImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/permission/PermissionApiImpl.java index 52e30ea0..a9dfcac0 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/permission/PermissionApiImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/permission/PermissionApiImpl.java @@ -39,4 +39,8 @@ public class PermissionApiImpl implements PermissionApi { return permissionService.getDeptDataPermission(userId); } + @Override + public Set getUserRoleIdListByUserId(Long userId) { + return permissionService.getUserRoleIdListByUserId(userId); + } }