1、新增现金流量项目、科目对应表查询接口

This commit is contained in:
zhengyf 2025-06-17 10:42:56 +08:00
parent 202db9a448
commit 926c2f0bda
6 changed files with 183 additions and 4 deletions

View File

@ -6,9 +6,7 @@ import com.github.pagehelper.PageInfo;
import com.hzya.frame.mdm.mdmModule.service.IMdmModuleService; import com.hzya.frame.mdm.mdmModule.service.IMdmModuleService;
import com.hzya.frame.voucher.ae.comf.bd.dao.*; import com.hzya.frame.voucher.ae.comf.bd.dao.*;
import com.hzya.frame.voucher.ae.comf.bd.entity.*; import com.hzya.frame.voucher.ae.comf.bd.entity.*;
import com.hzya.frame.voucher.ae.comf.bd.entity.vo.MdmDbFiledVO; import com.hzya.frame.voucher.ae.comf.bd.entity.vo.*;
import com.hzya.frame.voucher.ae.comf.bd.entity.vo.OrgBookVO;
import com.hzya.frame.voucher.ae.comf.bd.entity.vo.MdmDBQueryVO;
import com.hzya.frame.voucher.ae.comf.bd.utils.AccsubjTreeBuilder; import com.hzya.frame.voucher.ae.comf.bd.utils.AccsubjTreeBuilder;
import com.hzya.frame.web.action.DefaultController; import com.hzya.frame.web.action.DefaultController;
import com.hzya.frame.web.entity.JsonResultEntity; import com.hzya.frame.web.entity.JsonResultEntity;
@ -45,7 +43,6 @@ public class BdController extends DefaultController {
@Autowired @Autowired
private IMdmDbFiledVODAO mdmDbFiledVODAO; private IMdmDbFiledVODAO mdmDbFiledVODAO;
/** /**
* 查询所有公司 * 查询所有公司
*/ */
@ -198,6 +195,34 @@ public class BdController extends DefaultController {
return getFailureMessageEntity(e.getMessage()); return getFailureMessageEntity(e.getMessage());
} }
} }
/**
* 查询现金流映射表
*/
@RequestMapping(value = "/queryCashFlowMap", method = RequestMethod.POST)
public JsonResultEntity queryCashFlowMap(@RequestBody CashFlowVO entity) {
try {
List<CashFlowVO> cashFlowVOS = mdmDBQueryVODAO.queryCashflowVO(entity);
return getSuccessMessageEntity("请求成功", cashFlowVOS);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
/**
* 查询科目对应表
*/
@RequestMapping(value = "/queryGlsubrelation", method = RequestMethod.POST)
public JsonResultEntity queryGlsubrelation(@RequestBody GlSubrelationVO entity) {
try {
List<GlSubrelationVO> glSubrelationVOS = mdmDBQueryVODAO.queryGlsubrelationVO(entity);
return getSuccessMessageEntity("请求成功", glSubrelationVOS);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
} }

View File

@ -1,6 +1,8 @@
package com.hzya.frame.voucher.ae.comf.bd.dao; package com.hzya.frame.voucher.ae.comf.bd.dao;
import com.hzya.frame.basedao.dao.IBaseDao; import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.voucher.ae.comf.bd.entity.vo.CashFlowVO;
import com.hzya.frame.voucher.ae.comf.bd.entity.vo.GlSubrelationVO;
import com.hzya.frame.voucher.ae.comf.bd.entity.vo.MdmDBQueryVO; import com.hzya.frame.voucher.ae.comf.bd.entity.vo.MdmDBQueryVO;
import java.util.List; import java.util.List;
@ -11,4 +13,6 @@ import java.util.Map;
*/ */
public interface IMdmDBQueryVODAO extends IBaseDao<MdmDBQueryVO, String> { public interface IMdmDBQueryVODAO extends IBaseDao<MdmDBQueryVO, String> {
List<Map<String, Object>> queryMdmDb(MdmDBQueryVO u8CQueryVO); List<Map<String, Object>> queryMdmDb(MdmDBQueryVO u8CQueryVO);
List<CashFlowVO> queryCashflowVO(CashFlowVO cashFlowVO);
List<GlSubrelationVO> queryGlsubrelationVO(GlSubrelationVO glSubrelationVO);
} }

View File

@ -1,7 +1,10 @@
package com.hzya.frame.voucher.ae.comf.bd.dao.impl; package com.hzya.frame.voucher.ae.comf.bd.dao.impl;
import cn.hutool.core.lang.Assert;
import com.hzya.frame.basedao.dao.MybatisGenericDao; import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.voucher.ae.comf.bd.dao.IMdmDBQueryVODAO; import com.hzya.frame.voucher.ae.comf.bd.dao.IMdmDBQueryVODAO;
import com.hzya.frame.voucher.ae.comf.bd.entity.vo.CashFlowVO;
import com.hzya.frame.voucher.ae.comf.bd.entity.vo.GlSubrelationVO;
import com.hzya.frame.voucher.ae.comf.bd.entity.vo.MdmDBQueryVO; import com.hzya.frame.voucher.ae.comf.bd.entity.vo.MdmDBQueryVO;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@ -18,4 +21,19 @@ public class MdmDBQueryVODAOImpl extends MybatisGenericDao<MdmDBQueryVO, String>
List<Map<String, Object>> maps = (List<Map<String, Object>>) selectList("com.hzya.frame.voucher.ae.comf.bd.dao.impl.MdmDBQueryVODAOImpl.queryMdmDb", u8CQueryVO); List<Map<String, Object>> maps = (List<Map<String, Object>>) selectList("com.hzya.frame.voucher.ae.comf.bd.dao.impl.MdmDBQueryVODAOImpl.queryMdmDb", u8CQueryVO);
return maps; return maps;
} }
@Override
public List<CashFlowVO> queryCashflowVO(CashFlowVO cashFlowVO) {
List<CashFlowVO> cashFlowVOS =(List<CashFlowVO>) selectList("com.hzya.frame.voucher.ae.comf.bd.dao.impl.MdmDBQueryVODAOImpl.queryCashflowVO", cashFlowVO);
return cashFlowVOS;
}
@Override
public List<GlSubrelationVO> queryGlsubrelationVO(GlSubrelationVO glSubrelationVO) {
Assert.notNull(glSubrelationVO.getPkGlorgbook(),"查询科目对应表时,账簿主键不能为空");
Assert.notNull(glSubrelationVO.getPkCashflow(),"查询科目对应表时,现金流项目主键不能为空");
List<GlSubrelationVO> glSubrelationVOS =(List<GlSubrelationVO>) selectList("com.hzya.frame.voucher.ae.comf.bd.dao.impl.MdmDBQueryVODAOImpl.queryGlsubrelationVO", glSubrelationVO);
return glSubrelationVOS;
}
} }

View File

@ -0,0 +1,23 @@
package com.hzya.frame.voucher.ae.comf.bd.entity.vo;
import com.hzya.frame.web.entity.BaseEntity;
import lombok.Data;
import java.util.Date;
/**
* Created by zydd on 2025-06-16 14:32
* 现金流映射表
*/
@Data
public class CashFlowVO extends BaseEntity {
private String pkCashflow;//现金流量项目主键
private String pkCorp;//
private String cfitemcode;//现金流量项目编码
private String cfitemname;//现金流量项目名称
private String fathernode;//上级项目
private String cftype;//现金流量项目类型
private String itemflag;//是否主表项目
}

View File

@ -0,0 +1,55 @@
package com.hzya.frame.voucher.ae.comf.bd.entity.vo;
import lombok.Data;
import java.util.Date;
/**
* Created by zydd on 2025-06-16 16:45
* 现金流映射明细表-科目对应表
*/
@Data
public class GlSubrelationVO {
/** 账簿主键 */
private String pkGlorgbook;
/** 现金流量表项主键 */
private String pk_cashflow;
/** 现金流主键 */
private String pkCashflow;
/** 现金流编码 */
private String cfitemcode;
/** 现金流名称 */
private String cfitemname;
/** 科目对应表主键 */
private String pkSubrelation;
/** 借方科目主键 */
private String pkDebitsubject;
/** 借方科目编码 */
private String jsubjcode;
/** 借方科目名称 */
private String jsubjname;
/** 借方辅助核算 */
private String dfreevalueid;
/** 借方默认 */
private String isdd;
/** 贷方科目主键 */
private String pkCreditsubject;
/** 贷方科目编码 */
private String dsubjcode;
/** 贷方科目名称 */
private String dsubjname;
/** 贷方辅助核算 */
private String cfreevalueid;
/** 贷方默认*/
private String iscd;
private String dr;
private String memo;
private Date ts;
}

View File

@ -27,5 +27,59 @@
</trim> </trim>
</select> </select>
<select id="queryCashflowVO" parameterType="com.hzya.frame.voucher.ae.comf.bd.entity.vo.CashFlowVO" resultType="com.hzya.frame.voucher.ae.comf.bd.entity.vo.CashFlowVO">
SELECT
pk_cashflow AS pkCashflow,
pk_corp AS pkCorp,
cfitemcode AS cfitemcode,
cfitemname AS cfitemname,
fathernode AS fathernode,
cftype AS cftype,
itemflag AS itemflag
FROM
mdm_bd_cashflow
WHERE
1 = 1
AND mdm_bd_cashflow.pk_cashflow NOT IN ( SELECT DISTINCT fathernode FROM mdm_bd_cashflow WHERE fathernode IS NOT NULL )
ORDER BY
cfitemcode
</select>
<select id="queryGlsubrelationVO" parameterType="com.hzya.frame.voucher.ae.comf.bd.entity.vo.GlSubrelationVO" resultType="com.hzya.frame.voucher.ae.comf.bd.entity.vo.GlSubrelationVO">
SELECT
cashflow.pk_cashflow AS pkCashflow,
subrelation.pk_glorgbook AS pkGlorgbook,
cashflow.cfitemcode AS cfitemcode,
cashflow.cfitemname AS cfitemname,
subrelation.pk_subrelation AS pkSubrelation,
subrelation.pk_debitsubject AS pkCebitsubject,
accsubjj.subjcode AS jsubjcode,
accsubjj.dispname AS jdispname,
subrelation.dfreevalueid AS dfreevalueid,
subrelation.isdd AS isdd,
subrelation.pk_creditsubject AS pkCreditsubject,
accsubjd.subjcode AS dsubjcode,
accsubjd.dispname AS ddispname,
subrelation.cfreevalueid AS cfreevalueid,
subrelation.iscd AS iscd,
subrelation.dr AS dr,
subrelation.ts AS ts,
subrelation.memo AS memo
FROM
mdm_bd_cashflow cashflow
LEFT JOIN mdm_bd_gl_subrelation subrelation ON subrelation.pk_cashflow=cashflow.pk_cashflow
LEFT JOIN mdm_bd_accsubj accsubjj ON subrelation.pk_debitsubject=accsubjj.pk_accsubj
LEFT JOIN mdm_bd_accsubj accsubjd ON subrelation.pk_creditsubject=accsubjd.pk_accsubj
WHERE
1=1
<if test="pkCashflow != null and pkCashflow != ''">AND subrelation.pk_cashflow = #{pkCashflow}</if>
<if test="pkGlorgbook != null and pkGlorgbook != ''">AND subrelation.pk_glorgbook = #{pkGlorgbook}</if>
ORDER BY
cashflow.cfitemcode ASC
</select>
</mapper> </mapper>