Ver Fonte

添加了账户信息

wxf há 2 anos atrás
pai
commit
3e2334705f
34 ficheiros alterados com 808 adições e 14 exclusões
  1. 28 0
      hx-account/pom.xml
  2. 0 0
      hx-account/src/main/java/com/fjhx/account/a-json/AccountManagementApi.json
  3. 0 0
      hx-account/src/main/java/com/fjhx/account/a-json/AccountRemainderApi.json
  4. 73 0
      hx-account/src/main/java/com/fjhx/account/controller/account/AccountManagementController.java
  5. 68 0
      hx-account/src/main/java/com/fjhx/account/controller/account/AccountRemainderController.java
  6. 22 0
      hx-account/src/main/java/com/fjhx/account/entity/account/dto/AccountManagementDto.java
  7. 27 0
      hx-account/src/main/java/com/fjhx/account/entity/account/dto/AccountManagementSelectDto.java
  8. 17 0
      hx-account/src/main/java/com/fjhx/account/entity/account/dto/AccountRemainderDto.java
  9. 17 0
      hx-account/src/main/java/com/fjhx/account/entity/account/dto/AccountRemainderSelectDto.java
  10. 47 0
      hx-account/src/main/java/com/fjhx/account/entity/account/po/AccountManagement.java
  11. 38 0
      hx-account/src/main/java/com/fjhx/account/entity/account/po/AccountRemainder.java
  12. 17 0
      hx-account/src/main/java/com/fjhx/account/entity/account/vo/AccountManagementVo.java
  13. 17 0
      hx-account/src/main/java/com/fjhx/account/entity/account/vo/AccountRemainderVo.java
  14. 27 0
      hx-account/src/main/java/com/fjhx/account/mapper/account/AccountManagementMapper.java
  15. 26 0
      hx-account/src/main/java/com/fjhx/account/mapper/account/AccountRemainderMapper.java
  16. 46 0
      hx-account/src/main/java/com/fjhx/account/service/account/AccountManagementService.java
  17. 46 0
      hx-account/src/main/java/com/fjhx/account/service/account/AccountRemainderService.java
  18. 118 0
      hx-account/src/main/java/com/fjhx/account/service/account/impl/AccountManagementServiceImpl.java
  19. 57 0
      hx-account/src/main/java/com/fjhx/account/service/account/impl/AccountRemainderServiceImpl.java
  20. 20 0
      hx-account/src/main/resources/mapper/account/AccountManagementMapper.xml
  21. 18 0
      hx-account/src/main/resources/mapper/account/AccountRemainderMapper.xml
  22. 5 0
      hx-admin/pom.xml
  23. 5 0
      hx-admin/src/main/resources/application-dev.yml
  24. 10 0
      hx-admin/src/main/resources/application-prod.yml
  25. 5 0
      hx-admin/src/main/resources/application-test.yml
  26. 2 0
      hx-common/src/main/java/com/fjhx/common/constant/SourceConstant.java
  27. 1 2
      hx-customer/pom.xml
  28. 1 1
      hx-customer/src/main/java/com/fjhx/customer/controller/customer/CustomerController.java
  29. 2 2
      hx-customer/src/main/java/com/fjhx/customer/entity/customer/po/Customer.java
  30. 16 2
      hx-customer/src/main/java/com/fjhx/customer/entity/customer/vo/CustomerVo.java
  31. 1 1
      hx-customer/src/main/java/com/fjhx/customer/service/customer/CustomerService.java
  32. 23 4
      hx-customer/src/main/java/com/fjhx/customer/service/customer/impl/CustomerServiceImpl.java
  33. 2 2
      hx-customer/src/main/resources/mapper/customer/CustomerMapper.xml
  34. 6 0
      pom.xml

+ 28 - 0
hx-account/pom.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>com.fjhx</groupId>
+        <artifactId>bytesailing</artifactId>
+        <version>1.0</version>
+    </parent>
+
+    <artifactId>hx-account</artifactId>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.fjhx</groupId>
+            <artifactId>hx-base</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.fjhx</groupId>
+            <artifactId>hx-common</artifactId>
+        </dependency>
+
+    </dependencies>
+
+</project>

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
hx-account/src/main/java/com/fjhx/account/a-json/AccountManagementApi.json


Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
hx-account/src/main/java/com/fjhx/account/a-json/AccountRemainderApi.json


+ 73 - 0
hx-account/src/main/java/com/fjhx/account/controller/account/AccountManagementController.java

@@ -0,0 +1,73 @@
+package com.fjhx.account.controller.account;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.fjhx.account.entity.account.po.AccountManagement;
+import com.fjhx.common.constant.SourceConstant;
+import org.checkerframework.checker.units.qual.A;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.account.entity.account.vo.AccountManagementVo;
+import com.fjhx.account.entity.account.dto.AccountManagementSelectDto;
+import com.fjhx.account.entity.account.dto.AccountManagementDto;
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import com.fjhx.account.service.account.AccountManagementService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+
+/**
+ * <p>
+ * 账户-管理表 前端控制器
+ * </p>
+ *
+ * @author
+ * @since 2023-04-06
+ */
+@DS(SourceConstant.ACCOUNT)
+@RestController
+@RequestMapping("/accountManagement")
+public class AccountManagementController {
+
+    @Autowired
+    private AccountManagementService accountManagementService;
+
+    /**
+     * 账户-管理表分页
+     */
+    @PostMapping("/page")
+    public Page<AccountManagementVo> page(@RequestBody AccountManagementSelectDto dto) {
+        return accountManagementService.getPage(dto);
+    }
+
+    /**
+     * 账户-管理表明细
+     */
+    @PostMapping("/detail")
+    public AccountManagementDto detail(@RequestBody BaseSelectDto dto) {
+        return accountManagementService.detail(dto.getId());
+    }
+
+    /**
+     * 账户-管理表新增
+     */
+    @PostMapping("/add")
+    public void add(@RequestBody AccountManagementDto accountManagementDto) {
+        accountManagementService.add(accountManagementDto);
+    }
+
+    /**
+     * 账户-管理表编辑
+     */
+    @PostMapping("/edit")
+    public void edit(@RequestBody AccountManagementDto accountManagementDto) {
+        accountManagementService.edit(accountManagementDto);
+    }
+
+    /**
+     * 账户-管理表删除
+     */
+    @PostMapping("/delete")
+    public void delete(@RequestBody BaseSelectDto dto) {
+        accountManagementService.delete(dto.getId());
+    }
+
+}

+ 68 - 0
hx-account/src/main/java/com/fjhx/account/controller/account/AccountRemainderController.java

@@ -0,0 +1,68 @@
+package com.fjhx.account.controller.account;
+
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.account.entity.account.vo.AccountRemainderVo;
+import com.fjhx.account.entity.account.dto.AccountRemainderSelectDto;
+import com.fjhx.account.entity.account.dto.AccountRemainderDto;
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import com.fjhx.account.service.account.AccountRemainderService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+
+/**
+ * <p>
+ * 账户-余额表 前端控制器
+ * </p>
+ *
+ * @author 
+ * @since 2023-04-06
+ */
+@RestController
+@RequestMapping("/accountRemainder")
+public class AccountRemainderController {
+
+    @Autowired
+    private AccountRemainderService accountRemainderService;
+
+    /**
+     * 账户-余额表分页
+     */
+    @PostMapping("/page")
+    public Page<AccountRemainderVo> page(@RequestBody AccountRemainderSelectDto dto) {
+        return accountRemainderService.getPage(dto);
+    }
+
+    /**
+     * 账户-余额表明细
+     */
+    @PostMapping("/detail")
+    public AccountRemainderVo detail(@RequestBody BaseSelectDto dto) {
+        return accountRemainderService.detail(dto.getId());
+    }
+
+    /**
+     * 账户-余额表新增
+     */
+    @PostMapping("/add")
+    public void add(@RequestBody AccountRemainderDto accountRemainderDto) {
+        accountRemainderService.add(accountRemainderDto);
+    }
+
+    /**
+     * 账户-余额表编辑
+     */
+    @PostMapping("/edit")
+    public void edit(@RequestBody AccountRemainderDto accountRemainderDto) {
+        accountRemainderService.edit(accountRemainderDto);
+    }
+
+    /**
+     * 账户-余额表删除
+     */
+    @PostMapping("/delete")
+    public void delete(@RequestBody BaseSelectDto dto) {
+        accountRemainderService.delete(dto.getId());
+    }
+
+}

+ 22 - 0
hx-account/src/main/java/com/fjhx/account/entity/account/dto/AccountManagementDto.java

@@ -0,0 +1,22 @@
+package com.fjhx.account.entity.account.dto;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fjhx.account.entity.account.po.AccountManagement;
+import com.fjhx.account.entity.account.po.AccountRemainder;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * 账户-管理表新增编辑入参实体
+ *
+ * @author
+ * @since 2023-04-06
+ */
+@Getter
+@Setter
+public class AccountManagementDto extends AccountManagement {
+    @TableField(exist = false)
+    private List<AccountRemainder> accountRemainderList;
+}

+ 27 - 0
hx-account/src/main/java/com/fjhx/account/entity/account/dto/AccountManagementSelectDto.java

@@ -0,0 +1,27 @@
+package com.fjhx.account.entity.account.dto;
+
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 账户-管理表列表查询入参实体
+ *
+ * @author
+ * @since 2023-04-06
+ */
+@Getter
+@Setter
+public class AccountManagementSelectDto extends BaseSelectDto {
+
+
+    /**
+     * 账户名
+     */
+    private String name;
+
+    /**
+     * 开户银行
+     */
+    private String openingBank;
+}

+ 17 - 0
hx-account/src/main/java/com/fjhx/account/entity/account/dto/AccountRemainderDto.java

@@ -0,0 +1,17 @@
+package com.fjhx.account.entity.account.dto;
+
+import com.fjhx.account.entity.account.po.AccountRemainder;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 账户-余额表新增编辑入参实体
+ *
+ * @author 
+ * @since 2023-04-06
+ */
+@Getter
+@Setter
+public class AccountRemainderDto extends AccountRemainder {
+
+}

+ 17 - 0
hx-account/src/main/java/com/fjhx/account/entity/account/dto/AccountRemainderSelectDto.java

@@ -0,0 +1,17 @@
+package com.fjhx.account.entity.account.dto;
+
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 账户-余额表列表查询入参实体
+ *
+ * @author 
+ * @since 2023-04-06
+ */
+@Getter
+@Setter
+public class AccountRemainderSelectDto extends BaseSelectDto {
+
+}

+ 47 - 0
hx-account/src/main/java/com/fjhx/account/entity/account/po/AccountManagement.java

@@ -0,0 +1,47 @@
+package com.fjhx.account.entity.account.po;
+
+import com.ruoyi.common.core.domain.BasePo;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 账户-管理表
+ * </p>
+ *
+ * @author 
+ * @since 2023-04-06
+ */
+@Getter
+@Setter
+@TableName("account_management")
+public class AccountManagement extends BasePo {
+
+    /**
+     * 账户别名
+     */
+    private String alias;
+
+    /**
+     * 账户名
+     */
+    private String name;
+
+    /**
+     * 开户银行
+     */
+    private String openingBank;
+
+    /**
+     * 开户账号
+     */
+    private String accountOpening;
+
+    /**
+     * 联行号
+     */
+    private String interbankNumber;
+
+}

+ 38 - 0
hx-account/src/main/java/com/fjhx/account/entity/account/po/AccountRemainder.java

@@ -0,0 +1,38 @@
+package com.fjhx.account.entity.account.po;
+
+import com.ruoyi.common.core.domain.BasePo;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.math.BigDecimal;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 账户-余额表
+ * </p>
+ *
+ * @author
+ * @since 2023-04-06
+ */
+@Getter
+@Setter
+@TableName("account_remainder")
+public class AccountRemainder extends BasePo {
+
+    /**
+     * 账户管理表ID
+     */
+    private Long accountManagementId;
+
+    /**
+     * 币种(字典account_currency)
+     */
+    private String currency;
+
+    /**
+     * 余额
+     */
+    private BigDecimal remainder;
+
+}

+ 17 - 0
hx-account/src/main/java/com/fjhx/account/entity/account/vo/AccountManagementVo.java

@@ -0,0 +1,17 @@
+package com.fjhx.account.entity.account.vo;
+
+import com.fjhx.account.entity.account.po.AccountManagement;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 账户-管理表列表查询返回值实体
+ *
+ * @author 
+ * @since 2023-04-06
+ */
+@Getter
+@Setter
+public class AccountManagementVo extends AccountManagement {
+
+}

+ 17 - 0
hx-account/src/main/java/com/fjhx/account/entity/account/vo/AccountRemainderVo.java

@@ -0,0 +1,17 @@
+package com.fjhx.account.entity.account.vo;
+
+import com.fjhx.account.entity.account.po.AccountRemainder;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 账户-余额表列表查询返回值实体
+ *
+ * @author 
+ * @since 2023-04-06
+ */
+@Getter
+@Setter
+public class AccountRemainderVo extends AccountRemainder {
+
+}

+ 27 - 0
hx-account/src/main/java/com/fjhx/account/mapper/account/AccountManagementMapper.java

@@ -0,0 +1,27 @@
+package com.fjhx.account.mapper.account;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.fjhx.account.entity.account.po.AccountManagement;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.account.entity.account.vo.AccountManagementVo;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import org.apache.ibatis.annotations.Param;
+
+
+/**
+ * <p>
+ * 账户-管理表 Mapper 接口
+ * </p>
+ *
+ * @author
+ * @since 2023-04-06
+ */
+public interface AccountManagementMapper extends BaseMapper<AccountManagement> {
+
+    /**
+     * 账户-管理表分页
+     */
+    Page<AccountManagementVo> getPage(@Param("page") Page<Object> page, @Param("ew")LambdaQueryWrapper<AccountManagement> wrapper);
+
+}

+ 26 - 0
hx-account/src/main/java/com/fjhx/account/mapper/account/AccountRemainderMapper.java

@@ -0,0 +1,26 @@
+package com.fjhx.account.mapper.account;
+
+import com.fjhx.account.entity.account.po.AccountRemainder;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.account.entity.account.vo.AccountRemainderVo;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import org.apache.ibatis.annotations.Param;
+
+
+/**
+ * <p>
+ * 账户-余额表 Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2023-04-06
+ */
+public interface AccountRemainderMapper extends BaseMapper<AccountRemainder> {
+
+    /**
+     * 账户-余额表分页
+     */
+    Page<AccountRemainderVo> getPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<AccountRemainder> wrapper);
+
+}

+ 46 - 0
hx-account/src/main/java/com/fjhx/account/service/account/AccountManagementService.java

@@ -0,0 +1,46 @@
+package com.fjhx.account.service.account;
+
+import com.fjhx.account.entity.account.po.AccountManagement;
+import com.ruoyi.common.core.service.BaseService;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.account.entity.account.vo.AccountManagementVo;
+import com.fjhx.account.entity.account.dto.AccountManagementSelectDto;
+import com.fjhx.account.entity.account.dto.AccountManagementDto;
+
+
+/**
+ * <p>
+ * 账户-管理表 服务类
+ * </p>
+ *
+ * @author
+ * @since 2023-04-06
+ */
+public interface AccountManagementService extends BaseService<AccountManagement> {
+
+    /**
+     * 账户-管理表分页
+     */
+    Page<AccountManagementVo> getPage(AccountManagementSelectDto dto);
+
+    /**
+     * 账户-管理表明细
+     */
+    AccountManagementDto detail(Long id);
+
+    /**
+     * 账户-管理表新增
+     */
+    void add(AccountManagementDto accountManagementDto);
+
+    /**
+     * 账户-管理表编辑
+     */
+    void edit(AccountManagementDto accountManagementDto);
+
+    /**
+     * 账户-管理表删除
+     */
+    void delete(Long id);
+
+}

+ 46 - 0
hx-account/src/main/java/com/fjhx/account/service/account/AccountRemainderService.java

@@ -0,0 +1,46 @@
+package com.fjhx.account.service.account;
+
+import com.fjhx.account.entity.account.po.AccountRemainder;
+import com.ruoyi.common.core.service.BaseService;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.account.entity.account.vo.AccountRemainderVo;
+import com.fjhx.account.entity.account.dto.AccountRemainderSelectDto;
+import com.fjhx.account.entity.account.dto.AccountRemainderDto;
+
+
+/**
+ * <p>
+ * 账户-余额表 服务类
+ * </p>
+ *
+ * @author 
+ * @since 2023-04-06
+ */
+public interface AccountRemainderService extends BaseService<AccountRemainder> {
+
+    /**
+     * 账户-余额表分页
+     */
+    Page<AccountRemainderVo> getPage(AccountRemainderSelectDto dto);
+
+    /**
+     * 账户-余额表明细
+     */
+    AccountRemainderVo detail(Long id);
+
+    /**
+     * 账户-余额表新增
+     */
+    void add(AccountRemainderDto accountRemainderDto);
+
+    /**
+     * 账户-余额表编辑
+     */
+    void edit(AccountRemainderDto accountRemainderDto);
+
+    /**
+     * 账户-余额表删除
+     */
+    void delete(Long id);
+
+}

+ 118 - 0
hx-account/src/main/java/com/fjhx/account/service/account/impl/AccountManagementServiceImpl.java

@@ -0,0 +1,118 @@
+package com.fjhx.account.service.account.impl;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.fjhx.account.entity.account.po.AccountManagement;
+import com.fjhx.account.entity.account.po.AccountRemainder;
+import com.fjhx.account.mapper.account.AccountManagementMapper;
+import com.fjhx.account.service.account.AccountManagementService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fjhx.account.service.account.AccountRemainderService;
+import com.ruoyi.common.utils.StringUtils;
+import org.apache.poi.util.StringUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.account.entity.account.vo.AccountManagementVo;
+import com.fjhx.account.entity.account.dto.AccountManagementSelectDto;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import com.fjhx.account.entity.account.dto.AccountManagementDto;
+import cn.hutool.core.bean.BeanUtil;
+
+import java.util.List;
+
+
+/**
+ * <p>
+ * 账户-管理表 服务实现类
+ * </p>
+ *
+ * @author
+ * @since 2023-04-06
+ */
+@Service
+public class AccountManagementServiceImpl extends ServiceImpl<AccountManagementMapper, AccountManagement> implements AccountManagementService {
+    @Autowired
+    private AccountRemainderService accountRemainderService;
+
+    /**
+     * 账户-管理表分页
+     */
+    @Override
+    public Page<AccountManagementVo> getPage(AccountManagementSelectDto dto) {
+        LambdaQueryWrapper<AccountManagement> wrapper = Wrappers.<AccountManagement>lambdaQuery();
+        //根据关键字查询(查询的字段有账户别名、账户名称、账号)
+        if (StringUtils.isNotEmpty(dto.getName())){
+            wrapper.like(AccountManagement::getName,dto.getName());
+            wrapper.like(AccountManagement::getAlias,dto.getName());
+            wrapper.like(AccountManagement::getAccountOpening,dto.getName());
+        }
+        //根据开户银行查询
+        wrapper.eq(ObjectUtil.isNotEmpty(dto.getOpeningBank()),AccountManagement::getOpeningBank,dto.getOpeningBank());
+        Page<AccountManagementVo> page = baseMapper.getPage(dto.getPage(), wrapper);
+        return page;
+    }
+
+    /**
+     * 账户-管理表明细
+     */
+    @Override
+    public AccountManagementDto detail(Long id) {
+        //查询账户管理表的明细
+        AccountManagement AccountManagement = this.getById(id);
+        AccountManagementDto result = BeanUtil.toBean(AccountManagement, AccountManagementDto.class);
+        //查询账户余额表的信息
+        List<AccountRemainder> accountRemainderList = accountRemainderService.list(Wrappers.<AccountRemainder>lambdaQuery()
+                .eq(AccountRemainder::getAccountManagementId, id));
+        result.setAccountRemainderList(accountRemainderList);
+        return result;
+    }
+
+    /**
+     * 账户-管理表新增
+     */
+    @Override
+    public void add(AccountManagementDto accountManagementDto) {
+        //添加账户管理表的信息
+        this.save(accountManagementDto);
+        saveAccountRemainder(accountManagementDto);
+    }
+
+    /**
+     * 账户-管理表编辑
+     */
+    @Override
+    public void edit(AccountManagementDto accountManagementDto) {
+        this.updateById(accountManagementDto);
+        //删除账户-余额表的信息
+        accountRemainderService.remove(Wrappers.<AccountRemainder>lambdaQuery()
+                .eq(AccountRemainder::getAccountManagementId,accountManagementDto.getId()));
+        //添加账户余额表的信息
+        saveAccountRemainder(accountManagementDto);
+    }
+
+    /**
+     * 账户-管理表删除
+     */
+    @Override
+    public void delete(Long id) {
+        //删除账户-管理表的信息
+        this.removeById(id);
+        //删除账户-余额表的信息
+        accountRemainderService.remove(Wrappers.<AccountRemainder>lambdaQuery()
+                .eq(AccountRemainder::getAccountManagementId,id));
+    }
+
+
+    /**
+     * 添加账户-余额表的信息
+     */
+    private void saveAccountRemainder(AccountManagementDto accountManagementDto){
+        List<AccountRemainder> accountRemainderList = accountManagementDto.getAccountRemainderList();
+        accountRemainderList.forEach(accountRemainder -> {
+            accountRemainder.setAccountManagementId(accountManagementDto.getId());
+        });
+        accountRemainderService.saveBatch(accountRemainderList);
+    }
+}

+ 57 - 0
hx-account/src/main/java/com/fjhx/account/service/account/impl/AccountRemainderServiceImpl.java

@@ -0,0 +1,57 @@
+package com.fjhx.account.service.account.impl;
+
+import com.fjhx.account.entity.account.po.AccountRemainder;
+import com.fjhx.account.mapper.account.AccountRemainderMapper;
+import com.fjhx.account.service.account.AccountRemainderService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.account.entity.account.vo.AccountRemainderVo;
+import com.fjhx.account.entity.account.dto.AccountRemainderSelectDto;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import com.fjhx.account.entity.account.dto.AccountRemainderDto;
+import cn.hutool.core.bean.BeanUtil;
+
+
+/**
+ * <p>
+ * 账户-余额表 服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2023-04-06
+ */
+@Service
+public class AccountRemainderServiceImpl extends ServiceImpl<AccountRemainderMapper, AccountRemainder> implements AccountRemainderService {
+
+    @Override
+    public Page<AccountRemainderVo> getPage(AccountRemainderSelectDto dto) {
+        IWrapper<AccountRemainder> wrapper = getWrapper();
+        wrapper.orderByDesc("ar", AccountRemainder::getId);
+        Page<AccountRemainderVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
+        return page;
+    }
+
+    @Override
+    public AccountRemainderVo detail(Long id) {
+        AccountRemainder AccountRemainder = this.getById(id);
+        AccountRemainderVo result = BeanUtil.toBean(AccountRemainder, AccountRemainderVo.class);
+        return result;
+    }
+
+    @Override
+    public void add(AccountRemainderDto accountRemainderDto) {
+        this.save(accountRemainderDto);
+    }
+
+    @Override
+    public void edit(AccountRemainderDto accountRemainderDto) {
+        this.updateById(accountRemainderDto);
+    }
+
+    @Override
+    public void delete(Long id) {
+        this.removeById(id);
+    }
+
+}

+ 20 - 0
hx-account/src/main/resources/mapper/account/AccountManagementMapper.xml

@@ -0,0 +1,20 @@
+<?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="com.fjhx.account.mapper.account.AccountManagementMapper">
+    <select id="getPage" resultType="com.fjhx.account.entity.account.vo.AccountManagementVo">
+        select
+            am.id,
+            am.alias,
+            am.name,
+            am.opening_bank,
+            am.account_opening,
+            am.interbank_number,
+            am.create_user,
+            am.create_time,
+            am.update_user,
+            am.update_time
+        from account_management am
+            ${ew.customSqlSegment}
+    </select>
+
+</mapper>

+ 18 - 0
hx-account/src/main/resources/mapper/account/AccountRemainderMapper.xml

@@ -0,0 +1,18 @@
+<?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="com.fjhx.account.mapper.account.AccountRemainderMapper">
+    <select id="getPage" resultType="com.fjhx.account.entity.account.vo.AccountRemainderVo">
+        select
+            ar.id,
+            ar.account_management_id,
+            ar.currency,
+            ar.remainder,
+            ar.create_user,
+            ar.create_time,
+            ar.update_user,
+            ar.update_time
+        from account_remainder ar
+            ${ew.customSqlSegment}
+    </select>
+
+</mapper>

+ 5 - 0
hx-admin/pom.xml

@@ -59,6 +59,11 @@
             <artifactId>hx-purchase</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>com.fjhx</groupId>
+            <artifactId>hx-account</artifactId>
+        </dependency>
+
     </dependencies>
 
     <build>

+ 5 - 0
hx-admin/src/main/resources/application-dev.yml

@@ -43,6 +43,11 @@ spring:
                     username: fjhx2012mysql
                     password: 3PN-Mzn#vnP&q6d
 
+                account:
+                    url: jdbc:mysql://36.134.91.96:17330/bytesailing_account?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai
+                    username: fjhx2012mysql
+                    password: 3PN-Mzn#vnP&q6d
+
     # redis 配置
     redis:
         # 地址

+ 10 - 0
hx-admin/src/main/resources/application-prod.yml

@@ -35,6 +35,16 @@ spring:
                     username: fjhx2012mysql
                     password: IzJshF_dk9NNFpNm_IK
 
+                customer:
+                    url: jdbc:mysql://36.134.91.96:17330/bytesailing_customer?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai
+                    username: fjhx2012mysql
+                    password: 3PN-Mzn#vnP&q6d
+
+                account:
+                    url: jdbc:mysql://36.134.91.96:17330/bytesailing_account?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai
+                    username: fjhx2012mysql
+                    password: 3PN-Mzn#vnP&q6d
+
     # redis 配置
     redis:
         # 地址

+ 5 - 0
hx-admin/src/main/resources/application-test.yml

@@ -40,6 +40,11 @@ spring:
                     username: fjhx2012mysql
                     password: 3PN-Mzn#vnP&q6d
 
+                account:
+                    url: jdbc:mysql://36.134.91.96:17330/bytesailing_account?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai
+                    username: fjhx2012mysql
+                    password: 3PN-Mzn#vnP&q6d
+
     # redis 配置
     redis:
         # 地址

+ 2 - 0
hx-common/src/main/java/com/fjhx/common/constant/SourceConstant.java

@@ -19,4 +19,6 @@ public interface SourceConstant {
     String PURCHASE = "purchase";
 
     String BASE = "base";
+    String ACCOUNT = "account";
+
 }

+ 1 - 2
hx-customer/pom.xml

@@ -13,7 +13,6 @@
     <artifactId>hx-customer</artifactId>
 
     <dependencies>
-
         <dependency>
             <groupId>com.fjhx</groupId>
             <artifactId>hx-base</artifactId>
@@ -26,4 +25,4 @@
 
     </dependencies>
 
-</project>
+</project>

+ 1 - 1
hx-customer/src/main/java/com/fjhx/customer/controller/customer/CustomerController.java

@@ -50,7 +50,7 @@ public class CustomerController {
      * 客户表明细
      */
     @PostMapping("/detail")
-    public CustomerDto detail(@RequestBody BaseSelectDto dto) {
+    public CustomerVo detail(@RequestBody BaseSelectDto dto) {
         return customerService.detail(dto.getId());
     }
 

+ 2 - 2
hx-customer/src/main/java/com/fjhx/customer/entity/customer/po/Customer.java

@@ -35,9 +35,9 @@ public class Customer extends BasePo {
     private String countryId;
 
     /**
-     * 州/区名称
+     * 省份ID
      */
-    private String stateName;
+    private String provinceId;
 
     /**
      * 城市id

+ 16 - 2
hx-customer/src/main/java/com/fjhx/customer/entity/customer/vo/CustomerVo.java

@@ -1,17 +1,31 @@
 package com.fjhx.customer.entity.customer.vo;
 
+import com.fjhx.area.service.ISetAreaName;
 import com.fjhx.customer.entity.customer.po.Customer;
+import com.fjhx.customer.entity.customer.po.CustomerUser;
 import lombok.Getter;
 import lombok.Setter;
 
+import java.util.List;
+
 /**
  * 客户表列表查询返回值实体
  *
- * @author 
+ * @author
  * @since 2023-04-04
  */
 @Getter
 @Setter
-public class CustomerVo extends Customer {
+public class CustomerVo extends Customer implements ISetAreaName {
+
+
+    private String countryName;
+
+    private String provinceName;
+
+    private String cityName;
+
+    private List<CustomerUser> customerUserList;
+
 
 }

+ 1 - 1
hx-customer/src/main/java/com/fjhx/customer/service/customer/CustomerService.java

@@ -28,7 +28,7 @@ public interface CustomerService extends BaseService<Customer> {
     /**
      * 客户表明细
      */
-    CustomerDto detail(Long id);
+    CustomerVo detail(Long id);
 
     /**
      * 客户表新增

+ 23 - 4
hx-customer/src/main/java/com/fjhx/customer/service/customer/impl/CustomerServiceImpl.java

@@ -1,8 +1,10 @@
 package com.fjhx.customer.service.customer.impl;
 
+import cn.hutool.core.util.ArrayUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.fjhx.area.utils.AreaUtil;
 import com.fjhx.customer.entity.customer.dto.CustomerUserDto;
 import com.fjhx.customer.entity.customer.po.Customer;
 import com.fjhx.customer.entity.customer.po.CustomerUser;
@@ -11,6 +13,7 @@ import com.fjhx.customer.service.customer.CustomerService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fjhx.customer.service.customer.CustomerUserService;
 import com.fjhx.customer.utils.code.CodeEnum;
+import com.obs.services.internal.ServiceException;
 import com.ruoyi.common.utils.SecurityUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -20,7 +23,9 @@ import com.fjhx.customer.entity.customer.dto.CustomerSelectDto;
 import com.ruoyi.common.utils.wrapper.IWrapper;
 import com.fjhx.customer.entity.customer.dto.CustomerDto;
 import cn.hutool.core.bean.BeanUtil;
+import org.springframework.transaction.annotation.Transactional;
 
+import java.rmi.ServerException;
 import java.security.Security;
 import java.util.List;
 
@@ -59,6 +64,10 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
         }
         wrapper.orderByDesc(Customer::getCreateTime);
         Page<CustomerVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
+
+        //复制城市信息
+        List<CustomerVo> records = page.getRecords();
+        AreaUtil.setAreaName(records);
         return page;
     }
 
@@ -68,14 +77,18 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
      * @return
      */
     @Override
-    public CustomerDto detail(Long id) {
+    public CustomerVo detail(Long id) {
         //查询客户表的信息
         Customer Customer = this.getById(id);
-        CustomerDto result = BeanUtil.toBean(Customer, CustomerDto.class);
+        CustomerVo result = BeanUtil.toBean(Customer, CustomerVo.class);
+        if (ObjectUtil.isEmpty(result)){
+            throw new ServiceException("没有找到该用户信息");
+        }
         //查询客户-联系人表的信息
         List<CustomerUser> customerUserList = customerUserService.list(Wrappers.<CustomerUser>lambdaQuery()
                 .eq(CustomerUser::getCustomerId, result.getId()));
         result.setCustomerUserList(customerUserList);
+        AreaUtil.setAreaName(result);
         return result;
     }
 
@@ -84,6 +97,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
      * @param customerDto
      */
     @Override
+    @Transactional(rollbackFor = {Exception.class})
     public void add(CustomerDto customerDto) {
         customerDto.setCode(CodeEnum.CUSTOMER.getCode());
         this.save(customerDto);
@@ -95,13 +109,14 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
      * 修改客户表的数据
      * @param customerDto
      */
+    @Transactional(rollbackFor = {Exception.class})
     @Override
     public void edit(CustomerDto customerDto) {
         //修改客户表的信息
         this.updateById(customerDto);
         //删除客户-用户表的信息
         customerUserService.remove(Wrappers.<CustomerUser>lambdaQuery().eq(CustomerUser::getCustomerId,customerDto.getId()));
-        //添加户-联系人表的信息
+        //添加户-联系人表的信息
         saveCustomerUse(customerDto);
     }
 
@@ -110,6 +125,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
      * @param
      */
     @Override
+    @Transactional(rollbackFor = {Exception.class})
     public void delete(Long id) {
         //删除客户表的数据
         this.removeById(id);
@@ -128,7 +144,10 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
         //添加权限(自己看自己)
         wrapper.eq(Customer::getUserId, SecurityUtils.getUserId());
         wrapper.orderByDesc(Customer::getCreateTime);
-        Page<CustomerVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
+        Page<CustomerVo> page =baseMapper.getPage(dto.getPage(), wrapper);
+        //复制城市信息
+        List<CustomerVo> records = page.getRecords();
+        AreaUtil.setAreaName(records);
         return page;
     }
 

+ 2 - 2
hx-customer/src/main/resources/mapper/customer/CustomerMapper.xml

@@ -7,7 +7,7 @@
             c.customer_code,
             c.code,
             c.country_id,
-            c.state_name,
+            c.province_id,
             c.city_id,
             c.address,
             c.zip_code,
@@ -29,7 +29,7 @@
             c.customer_code,
             c.code,
             c.country_id,
-            c.state_name,
+            c.province_id,
             c.city_id,
             c.address,
             c.zip_code,

+ 6 - 0
pom.xml

@@ -119,6 +119,12 @@
                 <artifactId>hx-purchase</artifactId>
                 <version>${hx.version}</version>
             </dependency>
+
+            <dependency>
+                <groupId>com.fjhx</groupId>
+                <artifactId>hx-account</artifactId>
+                <version>${hx.version}</version>
+            </dependency>
         </dependencies>
     </dependencyManagement>
 

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff