1、修改科目查询接口,新增辅助核算
This commit is contained in:
parent
06edad895d
commit
8e3e84f1b0
|
@ -18,9 +18,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
import java.util.stream.Collectors;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by zydd on 2025-06-04 15:04
|
* Created by zydd on 2025-06-04 15:04
|
||||||
|
@ -132,6 +131,23 @@ public class BdController extends DefaultController {
|
||||||
try {
|
try {
|
||||||
Assert.notNull(entity.getPkGlorgbook(), "查询科目表时,账簿id不允许为空");
|
Assert.notNull(entity.getPkGlorgbook(), "查询科目表时,账簿id不允许为空");
|
||||||
List<AeConfBdAccsubjEntity> all = aeConfBdAccsubjDao.query(entity);
|
List<AeConfBdAccsubjEntity> all = aeConfBdAccsubjDao.query(entity);
|
||||||
|
//辅助核算
|
||||||
|
for (AeConfBdAccsubjEntity aeConfBdAccsubjEntity : all) {
|
||||||
|
List<AeConfBdAccsubjEntity> assists = aeConfBdAccsubjDao.queryAssist(aeConfBdAccsubjEntity);
|
||||||
|
List<String> codes = Optional.ofNullable(assists).orElse(Collections.emptyList()).stream()
|
||||||
|
.map(AeConfBdAccsubjEntity::getBdcode)
|
||||||
|
.filter(s -> s != null && !s.isEmpty())
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<String> names = Optional.ofNullable(assists).orElse(Collections.emptyList()).stream()
|
||||||
|
.map(AeConfBdAccsubjEntity::getBdname)
|
||||||
|
.filter(s -> s != null && !s.isEmpty())
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
aeConfBdAccsubjEntity.setAssistCodes(codes);
|
||||||
|
aeConfBdAccsubjEntity.setAssistNames(names);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
List<AccsubjTreeNode> tree = AccsubjTreeBuilder.buildTree(all);
|
List<AccsubjTreeNode> tree = AccsubjTreeBuilder.buildTree(all);
|
||||||
return getSuccessMessageEntity("请求成功", tree);
|
return getSuccessMessageEntity("请求成功", tree);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
package com.hzya.frame.voucher.ae.comf.bd.dao;
|
package com.hzya.frame.voucher.ae.comf.bd.dao;
|
||||||
|
|
||||||
import com.hzya.frame.voucher.ae.comf.bd.entity.AeConfBdAccsubjEntity;
|
import com.hzya.frame.voucher.ae.comf.bd.entity.AeConfBdAccsubjEntity;
|
||||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会计事项(accounting_event)-配置-数据配置-科目表(ae_conf_bd_accsubj: table)表数据库访问层
|
* 会计事项(accounting_event)-配置-数据配置-科目表(ae_conf_bd_accsubj: table)表数据库访问层
|
||||||
|
@ -11,5 +13,7 @@ import com.hzya.frame.basedao.dao.IBaseDao;
|
||||||
*/
|
*/
|
||||||
public interface IAeConfBdAccsubjDao extends IBaseDao<AeConfBdAccsubjEntity, String> {
|
public interface IAeConfBdAccsubjDao extends IBaseDao<AeConfBdAccsubjEntity, String> {
|
||||||
|
|
||||||
|
public List<AeConfBdAccsubjEntity> queryAssist(AeConfBdAccsubjEntity entity);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,9 @@ import com.hzya.frame.voucher.ae.comf.bd.entity.AeConfBdAccsubjEntity;
|
||||||
import com.hzya.frame.voucher.ae.comf.bd.dao.IAeConfBdAccsubjDao;
|
import com.hzya.frame.voucher.ae.comf.bd.dao.IAeConfBdAccsubjDao;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会计事项(accounting_event)-配置-数据配置-科目表(AeConfBdAccsubj)表数据库访问层
|
* 会计事项(accounting_event)-配置-数据配置-科目表(AeConfBdAccsubj)表数据库访问层
|
||||||
*
|
*
|
||||||
|
@ -11,7 +14,12 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||||
* @since 2025-06-05 17:20:09
|
* @since 2025-06-05 17:20:09
|
||||||
*/
|
*/
|
||||||
@Repository
|
@Repository
|
||||||
public class AeConfBdAccsubjDaoImpl extends MybatisGenericDao<AeConfBdAccsubjEntity, String> implements IAeConfBdAccsubjDao{
|
public class AeConfBdAccsubjDaoImpl extends MybatisGenericDao<AeConfBdAccsubjEntity, String> implements IAeConfBdAccsubjDao {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AeConfBdAccsubjEntity> queryAssist(AeConfBdAccsubjEntity entity) {
|
||||||
|
List<AeConfBdAccsubjEntity> objects = (List<AeConfBdAccsubjEntity>) selectList("com.hzya.frame.voucher.ae.comf.bd.dao.impl.AeConfBdAccsubjDaoImpl.queryAssist", entity);
|
||||||
|
return objects;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
package com.hzya.frame.voucher.ae.comf.bd.entity;
|
package com.hzya.frame.voucher.ae.comf.bd.entity;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import com.hzya.frame.voucher.ae.comf.bd.entity.vo.BdBdinfoEntity;
|
||||||
import com.hzya.frame.web.entity.BaseEntity;
|
import com.hzya.frame.web.entity.BaseEntity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
@ -14,6 +16,8 @@ import lombok.Data;
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class AeConfBdAccsubjEntity extends BaseEntity {
|
public class AeConfBdAccsubjEntity extends BaseEntity {
|
||||||
|
private String bdcode;
|
||||||
|
private String bdname;
|
||||||
private String dispname;
|
private String dispname;
|
||||||
private Long dr;
|
private Long dr;
|
||||||
private String endflag;
|
private String endflag;
|
||||||
|
@ -26,5 +30,7 @@ public class AeConfBdAccsubjEntity extends BaseEntity {
|
||||||
private Long subjlev;
|
private Long subjlev;
|
||||||
private String subjname;
|
private String subjname;
|
||||||
private Date ts;
|
private Date ts;
|
||||||
|
private List<String> assistCodes;
|
||||||
|
private List<String> assistNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -120,6 +120,33 @@
|
||||||
</trim>
|
</trim>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="queryAssist" parameterType="com.hzya.frame.voucher.ae.comf.bd.entity.AeConfBdAccsubjEntity" resultType="com.hzya.frame.voucher.ae.comf.bd.entity.AeConfBdAccsubjEntity">
|
||||||
|
SELECT
|
||||||
|
acc.id as id,
|
||||||
|
acc.pk_accsubj as pk_accsubj,
|
||||||
|
acc.subjcode as subjcode,
|
||||||
|
acc.subjname as subjname,
|
||||||
|
acc.subjlev as subjlev,
|
||||||
|
acc.dispname as dispname,
|
||||||
|
info.bdcode as bdcode,
|
||||||
|
info.bdname as bdname,
|
||||||
|
acc.endflag as endflag,
|
||||||
|
acc.pk_corp as pk_corp,
|
||||||
|
acc.pk_glorgbook as pk_glorgbook,
|
||||||
|
acc.sealflag as sealflag,
|
||||||
|
acc.stoped as stoped,
|
||||||
|
acc.dr as dr,
|
||||||
|
acc.ts as ts
|
||||||
|
from
|
||||||
|
mdm_bd_accsubj acc
|
||||||
|
LEFT OUTER JOIN mdm_bd_subjass ass ON acc.pk_accsubj=ass.pk_accsubj
|
||||||
|
LEFT OUTER JOIN mdm_bd_bdinfo info ON ass.pk_bdinfo=info.pk_bdinfo
|
||||||
|
where
|
||||||
|
acc.pk_accsubj=#{pkAccsubj}
|
||||||
|
and acc.pk_glorgbook=#{pkGlorgbook}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue