diff --git a/yudao-framework/yudao-spring-boot-starter-biz-ip/src/test/java/cn/iocoder/yudao/framework/ip/core/utils/AreaUtilsTest.java b/yudao-framework/yudao-spring-boot-starter-biz-ip/src/test/java/cn/iocoder/yudao/framework/ip/core/utils/AreaUtilsTest.java index 8f5646b337..cc23819c49 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-ip/src/test/java/cn/iocoder/yudao/framework/ip/core/utils/AreaUtilsTest.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-ip/src/test/java/cn/iocoder/yudao/framework/ip/core/utils/AreaUtilsTest.java @@ -28,7 +28,7 @@ public class AreaUtilsTest { @Test public void testFormat() { - assertEquals(AreaUtils.format(110105), "北京 北京市 朝阳区"); + assertEquals(AreaUtils.format(110105), "北京市 北京市 朝阳区"); assertEquals(AreaUtils.format(1), "中国"); assertEquals(AreaUtils.format(2), "蒙古"); } diff --git a/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/purchase/ErpPurchaseInServiceImpl.java b/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/purchase/ErpPurchaseInServiceImpl.java index 58f4952081..a0017aed64 100644 --- a/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/purchase/ErpPurchaseInServiceImpl.java +++ b/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/purchase/ErpPurchaseInServiceImpl.java @@ -140,7 +140,7 @@ public class ErpPurchaseInServiceImpl implements ErpPurchaseInService { purchaseIn.setDiscountPercent(BigDecimal.ZERO); } purchaseIn.setDiscountPrice(MoneyUtils.priceMultiplyPercent(purchaseIn.getTotalPrice(), purchaseIn.getDiscountPercent())); - purchaseIn.setTotalPrice(purchaseIn.getTotalPrice().subtract(purchaseIn.getDiscountPrice().add(purchaseIn.getOtherPrice()))); + purchaseIn.setTotalPrice(purchaseIn.getTotalPrice().subtract(purchaseIn.getDiscountPrice()).add(purchaseIn.getOtherPrice())); } private void updatePurchaseOrderInCount(Long orderId) { @@ -305,4 +305,4 @@ public class ErpPurchaseInServiceImpl implements ErpPurchaseInService { return purchaseInItemMapper.selectListByInIds(inIds); } -} \ No newline at end of file +} diff --git a/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/purchase/ErpPurchaseReturnServiceImpl.java b/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/purchase/ErpPurchaseReturnServiceImpl.java index 6648825b32..00527cb997 100644 --- a/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/purchase/ErpPurchaseReturnServiceImpl.java +++ b/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/purchase/ErpPurchaseReturnServiceImpl.java @@ -136,7 +136,7 @@ public class ErpPurchaseReturnServiceImpl implements ErpPurchaseReturnService { purchaseReturn.setDiscountPercent(BigDecimal.ZERO); } purchaseReturn.setDiscountPrice(MoneyUtils.priceMultiplyPercent(purchaseReturn.getTotalPrice(), purchaseReturn.getDiscountPercent())); - purchaseReturn.setTotalPrice(purchaseReturn.getTotalPrice().subtract(purchaseReturn.getDiscountPrice().add(purchaseReturn.getOtherPrice()))); + purchaseReturn.setTotalPrice(purchaseReturn.getTotalPrice().subtract(purchaseReturn.getDiscountPrice()).add(purchaseReturn.getOtherPrice())); } private void updatePurchaseOrderReturnCount(Long orderId) { @@ -301,4 +301,4 @@ public class ErpPurchaseReturnServiceImpl implements ErpPurchaseReturnService { return purchaseReturnItemMapper.selectListByReturnIds(returnIds); } -} \ No newline at end of file +} diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/respVO.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/respVO.vm index 54c16671d6..24c3519451 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/respVO.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/respVO.vm @@ -4,7 +4,6 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.util.*; ## 处理 BigDecimal 字段的引入 -import java.util.*; #foreach ($column in $columns) #if (${column.javaType} == "BigDecimal") import java.math.BigDecimal; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/mapper_sub.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/mapper_sub.vm index e5589e99df..6ccaea79ea 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/mapper_sub.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/mapper_sub.vm @@ -29,6 +29,12 @@ public interface ${subTable.className}Mapper extends BaseMapperX<${subTable.clas .orderByDesc(${subTable.className}DO::getId));## 大多数情况下,id 倒序 } +## 主表与子表是一对一时 + #if (!$subTable.subJoinMany) + default ${subTable.className}DO selectBy${SubJoinColumnName}(${subJoinColumn.javaType} ${subJoinColumn.javaField}) { + return selectOne(${subTable.className}DO::get${SubJoinColumnName}, ${subJoinColumn.javaField}); + } + #end ## 情况二:非 MASTER_ERP 时,需要列表查询子表 #else @@ -48,4 +54,4 @@ public interface ${subTable.className}Mapper extends BaseMapperX<${subTable.clas return delete(${subTable.className}DO::get${SubJoinColumnName}, ${subJoinColumn.javaField}); } -} \ No newline at end of file +} diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/oauth2/OAuth2GrantTypeEnum.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/oauth2/OAuth2GrantTypeEnum.java index 80ce4610bc..0b09fe5b02 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/oauth2/OAuth2GrantTypeEnum.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/oauth2/OAuth2GrantTypeEnum.java @@ -22,7 +22,7 @@ public enum OAuth2GrantTypeEnum { private final String grantType; - public static OAuth2GrantTypeEnum getByGranType(String grantType) { + public static OAuth2GrantTypeEnum getByGrantType(String grantType) { return ArrayUtil.firstMatch(o -> o.getGrantType().equals(grantType), values()); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2OpenController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2OpenController.java index 429f9c98c1..0b6675c0ff 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2OpenController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2OpenController.java @@ -105,7 +105,7 @@ public class OAuth2OpenController { @RequestParam(value = "refresh_token", required = false) String refreshToken) { // 刷新模式 List scopes = OAuth2Utils.buildScopes(scope); // 1.1 校验授权类型 - OAuth2GrantTypeEnum grantTypeEnum = OAuth2GrantTypeEnum.getByGranType(grantType); + OAuth2GrantTypeEnum grantTypeEnum = OAuth2GrantTypeEnum.getByGrantType(grantType); if (grantTypeEnum == null) { throw exception0(BAD_REQUEST.getCode(), StrUtil.format("未知授权类型({})", grantType)); }