12.9修改
This commit is contained in:
+100
@@ -0,0 +1,100 @@
|
||||
package com.linke.finance.application.server.receivingAccount;
|
||||
|
||||
import com.linke.finance.domain.receivingAccount.entity.ReceivingAccount;
|
||||
import com.linke.finance.domain.receivingAccount.repository.persistence.ReceivingAccountRepository;
|
||||
import com.linke.finance.domain.receivingAccount.repository.po.ReceivingAccountPO;
|
||||
import com.linke.finance.domain.receivingAccount.repository.todo.ReceivingAccountDO;
|
||||
import com.mhd.common.core.utils.bean.BeanUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 收款账户ApplicationService
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-12-06
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class ReceivingAccountApplicationService {
|
||||
|
||||
@Resource
|
||||
private ReceivingAccountRepository receivingAccountRepository;
|
||||
|
||||
/**
|
||||
* 查询收款账户列表
|
||||
*
|
||||
* @param receivingAccountDO 查询条件
|
||||
* @return 收款账户列表
|
||||
*/
|
||||
public List<ReceivingAccountPO> queryList(ReceivingAccountDO receivingAccountDO) {
|
||||
log.info("查询收款账户列表,查询条件:{}", receivingAccountDO);
|
||||
return receivingAccountRepository.queryList(receivingAccountDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增收款账户
|
||||
*
|
||||
* @param receivingAccountDTO 收款账户DTO
|
||||
* @return 是否成功
|
||||
*/
|
||||
public Boolean insert(ReceivingAccountDO receivingAccountDTO) {
|
||||
log.info("新增收款账户,参数:{}", receivingAccountDTO);
|
||||
ReceivingAccount receivingAccount = new ReceivingAccount();
|
||||
BeanUtils.copyProperties(receivingAccountDTO, receivingAccount);
|
||||
receivingAccount.setDelFlag(1); // 1-正常
|
||||
receivingAccount.setCreateTime(new Date());
|
||||
receivingAccount.setUpdateTime(new Date());
|
||||
int result = receivingAccountRepository.insert(receivingAccount);
|
||||
return result > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增收款账户(先删除所有,再新增)
|
||||
*
|
||||
* @param receivingAccountDTOList 收款账户DTO列表
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Transactional
|
||||
public Boolean batchInsert(List<ReceivingAccountDO> receivingAccountDTOList) {
|
||||
log.info("批量新增收款账户,数量:{}", receivingAccountDTOList.size());
|
||||
|
||||
// 先删除所有现有数据
|
||||
int deleteCount = receivingAccountRepository.deleteAll();
|
||||
log.info("已删除现有收款账户数量:{}", deleteCount);
|
||||
|
||||
List<ReceivingAccount> receivingAccountList = new ArrayList<>();
|
||||
Date now = new Date();
|
||||
|
||||
for (ReceivingAccountDO dto : receivingAccountDTOList) {
|
||||
ReceivingAccount receivingAccount = new ReceivingAccount();
|
||||
BeanUtils.copyProperties(dto, receivingAccount);
|
||||
receivingAccount.setDelFlag(1); // 1-正常
|
||||
receivingAccount.setCreateTime(now);
|
||||
receivingAccount.setUpdateTime(now);
|
||||
receivingAccountList.add(receivingAccount);
|
||||
}
|
||||
|
||||
int result = receivingAccountRepository.batchInsert(receivingAccountList);
|
||||
log.info("新增收款账户数量:{}", result);
|
||||
return result > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID删除收款账户
|
||||
*
|
||||
* @param id 主键ID
|
||||
* @return 是否成功
|
||||
*/
|
||||
public Boolean deleteById(Long id) {
|
||||
log.info("删除收款账户,ID:{}", id);
|
||||
int result = receivingAccountRepository.deleteById(id);
|
||||
return result > 0;
|
||||
}
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package com.linke.finance.domain.receivingAccount.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.mhd.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 收款账户实体类
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-12-06
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("receiving_account")
|
||||
public class ReceivingAccount extends BaseEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/** 账户名称 */
|
||||
private String accountName;
|
||||
|
||||
/** 账户信息 */
|
||||
private String accountInformation;
|
||||
|
||||
/** 删除标记:1-正常,2-已删除 */
|
||||
private Integer delFlag;
|
||||
}
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
package com.linke.finance.domain.receivingAccount.repository.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.linke.finance.domain.receivingAccount.entity.ReceivingAccount;
|
||||
import com.linke.finance.domain.receivingAccount.repository.po.ReceivingAccountPO;
|
||||
import com.linke.finance.domain.receivingAccount.repository.todo.ReceivingAccountDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 收款账户Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-12-06
|
||||
*/
|
||||
public interface ReceivingAccountMapper extends BaseMapper<ReceivingAccount> {
|
||||
|
||||
/**
|
||||
* 查询收款账户列表
|
||||
*
|
||||
* @param receivingAccountDO 查询条件
|
||||
* @return 收款账户列表
|
||||
*/
|
||||
List<ReceivingAccountPO> queryList(ReceivingAccountDO receivingAccountDO);
|
||||
|
||||
/**
|
||||
* 新增收款账户
|
||||
*
|
||||
* @param receivingAccount 收款账户
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(ReceivingAccount receivingAccount);
|
||||
|
||||
/**
|
||||
* 批量新增收款账户
|
||||
*
|
||||
* @param receivingAccountList 收款账户列表
|
||||
* @return 影响行数
|
||||
*/
|
||||
int batchInsert(List<ReceivingAccount> receivingAccountList);
|
||||
|
||||
/**
|
||||
* 删除所有收款账户
|
||||
*
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteAll();
|
||||
|
||||
/**
|
||||
* 根据ID删除收款账户
|
||||
*
|
||||
* @param id 主键ID
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteById(Long id);
|
||||
}
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
package com.linke.finance.domain.receivingAccount.repository.persistence;
|
||||
|
||||
import com.linke.finance.domain.receivingAccount.entity.ReceivingAccount;
|
||||
import com.linke.finance.domain.receivingAccount.repository.mapper.ReceivingAccountMapper;
|
||||
import com.linke.finance.domain.receivingAccount.repository.po.ReceivingAccountPO;
|
||||
import com.linke.finance.domain.receivingAccount.repository.todo.ReceivingAccountDO;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 收款账户Repository
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-12-06
|
||||
*/
|
||||
@Repository
|
||||
public class ReceivingAccountRepository {
|
||||
|
||||
@Resource
|
||||
private ReceivingAccountMapper receivingAccountMapper;
|
||||
|
||||
/**
|
||||
* 查询收款账户列表
|
||||
*
|
||||
* @param receivingAccountDO 查询条件
|
||||
* @return 收款账户列表
|
||||
*/
|
||||
public List<ReceivingAccountPO> queryList(ReceivingAccountDO receivingAccountDO) {
|
||||
return receivingAccountMapper.queryList(receivingAccountDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增收款账户
|
||||
*
|
||||
* @param receivingAccount 收款账户
|
||||
* @return 影响行数
|
||||
*/
|
||||
public int insert(ReceivingAccount receivingAccount) {
|
||||
return receivingAccountMapper.insert(receivingAccount);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增收款账户
|
||||
*
|
||||
* @param receivingAccountList 收款账户列表
|
||||
* @return 影响行数
|
||||
*/
|
||||
public int batchInsert(List<ReceivingAccount> receivingAccountList) {
|
||||
return receivingAccountMapper.batchInsert(receivingAccountList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除所有收款账户
|
||||
*
|
||||
* @return 影响行数
|
||||
*/
|
||||
public int deleteAll() {
|
||||
return receivingAccountMapper.deleteAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID删除收款账户
|
||||
*
|
||||
* @param id 主键ID
|
||||
* @return 影响行数
|
||||
*/
|
||||
public int deleteById(Long id) {
|
||||
return receivingAccountMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
package com.linke.finance.domain.receivingAccount.repository.po;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 收款账户响应对象
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-12-06
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "收款账户对象", description = "收款账户响应对象")
|
||||
public class ReceivingAccountPO extends BaseVOEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("账户名称")
|
||||
@Excel(name = "账户名称")
|
||||
private String accountName;
|
||||
|
||||
@ApiModelProperty("账户信息")
|
||||
@Excel(name = "账户信息")
|
||||
private String accountInformation;
|
||||
|
||||
@ApiModelProperty("删除标记:1-正常,2-已删除")
|
||||
private Integer delFlag;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.linke.finance.domain.receivingAccount.repository.todo;
|
||||
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 收款账户查询对象
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-12-06
|
||||
*/
|
||||
@Data
|
||||
public class ReceivingAccountDO extends BaseVOEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("账户名称")
|
||||
private String accountName;
|
||||
|
||||
@ApiModelProperty("账户信息")
|
||||
private String accountInformation;
|
||||
|
||||
@ApiModelProperty("删除标记:1-正常,2-已删除")
|
||||
private Integer delFlag;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.linke.finance.interfaces.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 收款账户DTO
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-12-06
|
||||
*/
|
||||
@Data
|
||||
public class ReceivingAccountDTO {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("账户名称")
|
||||
private String accountName;
|
||||
|
||||
@ApiModelProperty("账户信息")
|
||||
private String accountInformation;
|
||||
|
||||
@ApiModelProperty("删除标记:1-正常,2-已删除")
|
||||
private Integer delFlag;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date updateTime;
|
||||
}
|
||||
Reference in New Issue
Block a user