1、生成凭证优化单据查询接口。
This commit is contained in:
parent
64843c4624
commit
41f3aecf89
|
@ -8,6 +8,8 @@ import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
|
|||
import com.hzya.frame.mdm.mdmModule.service.IMdmModuleService;
|
||||
import com.hzya.frame.mdm.mdmModuleDb.dao.IMdmModuleDbDao;
|
||||
import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity;
|
||||
import com.hzya.frame.plugin.gm.SubjectAssBalancePlugin;
|
||||
import com.hzya.frame.plugin.gm.entity.MdmGmSubjectBalanceEntity;
|
||||
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.vo.*;
|
||||
|
@ -49,6 +51,9 @@ public class BdController extends DefaultController {
|
|||
@Autowired
|
||||
private IMdmDbFiledVODAO mdmDbFiledVODAO;
|
||||
|
||||
@Autowired
|
||||
private SubjectAssBalancePlugin subjectAssBalancePlugin;
|
||||
|
||||
/**
|
||||
* 查询所有公司
|
||||
*/
|
||||
|
@ -367,6 +372,48 @@ public class BdController extends DefaultController {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 科目辅助核算余额全量
|
||||
*/
|
||||
@RequestMapping(value = "/queryBalanceAll", method = RequestMethod.POST)
|
||||
public JsonResultEntity queryBalanceAll (@RequestBody MdmGmSubjectBalanceEntity entity) {
|
||||
try {
|
||||
subjectAssBalancePlugin.start();
|
||||
return getSuccessMessageEntity("请求成功",null);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return getFailureMessageEntity(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 科目辅助核算余额查询
|
||||
*/
|
||||
@RequestMapping(value = "/queryBalanceBySubjectCodeAndPkCorp", method = RequestMethod.POST)
|
||||
public JsonResultEntity queryBalanceBySubjectCodeAndPkCorp (@RequestBody MdmGmSubjectBalanceEntity entity) {
|
||||
try {
|
||||
List<MdmGmSubjectBalanceEntity> list = subjectAssBalancePlugin.start(entity);
|
||||
return getSuccessMessageEntity("请求成功", list);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return getFailureMessageEntity(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空科目辅助核算余额
|
||||
*/
|
||||
@RequestMapping(value = "/deleteBalanceBySubjectCodeAndPkCorp", method = RequestMethod.POST)
|
||||
public JsonResultEntity deleteBalanceBySubjectCodeAndPkCorp (@RequestBody MdmGmSubjectBalanceEntity entity) {
|
||||
try {
|
||||
List<MdmGmSubjectBalanceEntity> list = subjectAssBalancePlugin.delete();
|
||||
return getSuccessMessageEntity("请求成功", list);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return getFailureMessageEntity(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// /**
|
||||
// *
|
||||
|
|
|
@ -16,6 +16,7 @@ public interface IMdmDBQueryVODAO extends IBaseDao<MdmDBQueryVO, String> {
|
|||
*/
|
||||
List<Map<String, Object>> queryMdmDb(MdmDBQueryVO u8CQueryVO);
|
||||
List<Map<String, Object>> queryDataByMdmIdGroupBy(MdmDBQueryVO mdmDBQueryVO);
|
||||
List<Map<String, Object>> queryDataByMdmId(MdmDBQueryVO mdmDBQueryVO);
|
||||
List<CashFlowVO> queryCashflowVO(CashFlowVO cashFlowVO);
|
||||
List<GlSubrelationVO> queryGlsubrelationVO(GlSubrelationVO glSubrelationVO);
|
||||
List<BdBdinfoEntity> queryBdBdinfoList(BdBdinfoEntity entity);
|
||||
|
|
|
@ -24,6 +24,12 @@ 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.queryDataByMdmIdGroupBy", u8CQueryVO);
|
||||
return maps;
|
||||
}
|
||||
@Override
|
||||
public List<Map<String, Object>> queryDataByMdmId(MdmDBQueryVO u8CQueryVO) {
|
||||
List<Map<String, Object>> maps = (List<Map<String, Object>>) selectList("com.hzya.frame.voucher.ae.comf.bd.dao.impl.MdmDBQueryVODAOImpl.queryDataByMdmId", u8CQueryVO);
|
||||
return maps;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
|
|
|
@ -32,4 +32,5 @@ public class MdmDBQueryVO extends BaseEntity {
|
|||
private String propValue10;
|
||||
|
||||
private String pkentityorg;
|
||||
private String billstatus;
|
||||
}
|
||||
|
|
|
@ -70,6 +70,28 @@
|
|||
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 生成日志界面使用的查需数据 -->
|
||||
<select id="queryDataByMdmId" parameterType="com.hzya.frame.voucher.ae.comf.bd.entity.vo.MdmDBQueryVO" resultType="map">
|
||||
select
|
||||
*
|
||||
from
|
||||
${tablename}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
1=1
|
||||
<if test="pkentityorg !=null and pkentityorg != null">and pk_corp= #{pkentityorg}</if>
|
||||
<if test="prop3 !=null and propValue3 != null">and ${prop3}>=#{propValue3}</if>
|
||||
<if test="prop4 !=null and propValue4 != null">and ${prop4}<=#{propValue4}</if>
|
||||
<if test="prop5 !=null and propValue5 != null">and ${prop5} like concat('%', #{propValue5},'%')</if>
|
||||
<if test="prop6 !=null and propValue6 != null">and ${prop6}=#{propValue6}</if>
|
||||
<if test="prop7 !=null and propValue7 != null">and ${prop7}=#{propValue7}</if>
|
||||
<if test="prop8 !=null and propValue8 != null">and ${prop8}=#{propValue8}</if>
|
||||
<if test="prop9 !=null and propValue9 != null">and ${prop9}=#{propValue9}</if>
|
||||
<if test="prop10 !=null and propValue10 != null">and ${prop10}=#{propValue10}</if>
|
||||
<if test="billstatus !=null and billstatus != ''">and billstatus = #{billstatus}</if>
|
||||
</trim>
|
||||
</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,
|
||||
|
|
|
@ -44,7 +44,13 @@ public class CoreController extends DefaultController {
|
|||
@RequestMapping(value = "/generate", method = RequestMethod.POST)
|
||||
public JsonResultEntity generateVoucher(@RequestBody CreateVoucherVO createVoucherVO) {
|
||||
try {
|
||||
coreService.generateVoucher(createVoucherVO);
|
||||
|
||||
String billCodes = createVoucherVO.getBillCode();
|
||||
String[] split = billCodes.split(",");
|
||||
for (String s : split) {
|
||||
createVoucherVO.setBillCode(s);
|
||||
coreService.generateVoucher(createVoucherVO);
|
||||
}
|
||||
|
||||
return getSuccessMessageEntity("生成成功");
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -231,6 +231,12 @@ public class ICoreServiceImpl implements ICoreService {
|
|||
String ts = dateList.iterator().next().get(0).toString();
|
||||
date = ts.substring(0, 10);
|
||||
|
||||
//是否指定日期
|
||||
String targetDate = createVoucherVO.getTargetDate();
|
||||
if(targetDate!=null&&!"".equals(targetDate)){
|
||||
date = targetDate;
|
||||
}
|
||||
|
||||
//根据mdmId获取凭证模板
|
||||
AeConfVoucherTemplateEntity aeConfVoucherTemplateEntity = new AeConfVoucherTemplateEntity();
|
||||
aeConfVoucherTemplateEntity.setMdmId(createVoucherVO.getMdmId());
|
||||
|
@ -808,7 +814,7 @@ public class ICoreServiceImpl implements ICoreService {
|
|||
aePushVoucherLogEntity.setBillStatus("N");
|
||||
aePushVoucherLogEntity.setBillDate(date);
|
||||
aePushVoucherLogEntity.setPushRes(e.getMessage());
|
||||
aePushVoucherLogDao.saveOrUpdateBymdmIdAndBillCodeAndTypeId(aePushVoucherLogEntity);
|
||||
// aePushVoucherLogDao.saveOrUpdateBymdmIdAndBillCodeAndTypeId(aePushVoucherLogEntity);
|
||||
Assert.state(false, "生成凭证过程报错,报错信息:{}", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.hzya.frame.voucher.ae.generate.core.vo;
|
||||
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
@ -9,7 +10,7 @@ import java.io.Serializable;
|
|||
* 生成凭证参数
|
||||
*/
|
||||
@Data
|
||||
public class CreateVoucherVO implements Serializable {
|
||||
public class CreateVoucherVO extends BaseEntity {
|
||||
/**
|
||||
* 主数据id
|
||||
*/
|
||||
|
@ -24,4 +25,15 @@ public class CreateVoucherVO implements Serializable {
|
|||
* 0 未生成 1 已生成 2 生成失败
|
||||
*/
|
||||
private String status;
|
||||
private String billstatus;
|
||||
|
||||
private String targetDate;
|
||||
/**
|
||||
* 项目编码
|
||||
*/
|
||||
private String projectId;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.hzya.frame.voucher.ae.push.controller;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.hzya.frame.voucher.ae.generate.core.service.ICoreService;
|
||||
import com.hzya.frame.voucher.ae.generate.core.vo.CreateVoucherVO;
|
||||
import com.hzya.frame.voucher.ae.push.entity.AePushVoucherLogDetailsEntity;
|
||||
|
@ -60,4 +61,17 @@ public class PushLogController extends DefaultController {
|
|||
}
|
||||
}
|
||||
|
||||
//查需所有单据,带条件:mdmId,单据日期,项目编码,单据编号,生成状态
|
||||
@RequestMapping(value = "/queryBillPaged", method = RequestMethod.POST)
|
||||
public JsonResultEntity queryBillPaged(@RequestBody CreateVoucherVO vo) {
|
||||
try {
|
||||
PageInfo pageInfo = aePushVoucherLogService.queryBillPaged(vo);
|
||||
return getSuccessMessageEntity("请求成功",pageInfo);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
return getFailureMessageEntity(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
package com.hzya.frame.voucher.ae.push.service;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.hzya.frame.voucher.ae.generate.core.vo.CreateVoucherVO;
|
||||
import com.hzya.frame.voucher.ae.push.entity.AePushVoucherLogDetailsEntity;
|
||||
import com.hzya.frame.voucher.ae.push.entity.AePushVoucherLogEntity;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* (AePushVoucherLog)表服务接口
|
||||
|
@ -18,4 +21,6 @@ public interface IAePushVoucherLogService extends IBaseService<AePushVoucherLogE
|
|||
List<AePushVoucherLogDetailsEntity> queryDetailsByBillCode(AePushVoucherLogEntity entity);
|
||||
|
||||
AePushVoucherLogEntity saveOrUpdateBymdmIdAndBillCodeAndTypeId(AePushVoucherLogEntity aePushVoucherLogEntity);
|
||||
|
||||
PageInfo queryBillPaged(CreateVoucherVO vo);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,16 @@
|
|||
package com.hzya.frame.voucher.ae.push.service.impl;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao;
|
||||
import com.hzya.frame.mdm.mdmModuleDb.dao.IMdmModuleDbDao;
|
||||
import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleDbFileds.dao.IMdmModuleDbFiledsDao;
|
||||
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.dao.IMdmModuleDbFiledsRuleDao;
|
||||
import com.hzya.frame.voucher.ae.comf.bd.dao.IMdmDBQueryVODAO;
|
||||
import com.hzya.frame.voucher.ae.comf.bd.dao.IMdmDbFiledVODAO;
|
||||
import com.hzya.frame.voucher.ae.comf.bd.entity.vo.MdmDBQueryVO;
|
||||
import com.hzya.frame.voucher.ae.comf.bd.entity.vo.MdmDbFiledVO;
|
||||
import com.hzya.frame.voucher.ae.generate.core.service.ICoreService;
|
||||
import com.hzya.frame.voucher.ae.generate.core.vo.CreateVoucherVO;
|
||||
|
@ -46,6 +55,16 @@ public class AePushVoucherLogServiceImpl extends BaseService<AePushVoucherLogEnt
|
|||
private IMdmDbFiledVODAO mdmDbFiledVODAO;
|
||||
@Autowired
|
||||
private IAePushVoucherLogDetailsDao voucherLogDetailsDao;
|
||||
@Autowired
|
||||
private IMdmDBQueryVODAO mdmDBQueryVODAO;
|
||||
@Autowired
|
||||
private IMdmModuleDao mdmModuleDao;
|
||||
@Autowired
|
||||
private IMdmModuleDbDao mdmModuleDbDao;
|
||||
@Autowired
|
||||
private IMdmModuleDbFiledsDao mdmModuleDbFiledsDao;
|
||||
@Autowired
|
||||
private IMdmModuleDbFiledsRuleDao mdmModuleDbFiledsRuleDao;
|
||||
|
||||
|
||||
// @Override
|
||||
|
@ -256,6 +275,59 @@ public class AePushVoucherLogServiceImpl extends BaseService<AePushVoucherLogEnt
|
|||
return allList;
|
||||
}
|
||||
|
||||
//查需所有单据,带条件:mdmId,单据日期,项目编码project_id,单据编号,生成状态billstatus
|
||||
@Override
|
||||
public PageInfo queryBillPaged(CreateVoucherVO vo) {
|
||||
Assert.notNull(vo.getMdmId(), "mdmId不能为空");
|
||||
String mdmId = vo.getMdmId();
|
||||
|
||||
//获取四个字段
|
||||
MdmDbFiledVO mdmDbFiledVO = new MdmDbFiledVO();
|
||||
mdmDbFiledVO.setMdmId(mdmId);
|
||||
List<MdmDbFiledVO> mdmDbFiledVOList = mdmDbFiledVODAO.queryMdmDbFiledVO(mdmDbFiledVO);
|
||||
if(mdmDbFiledVOList.size()==0){
|
||||
Assert.state(false,"根据mdmId:{},查询关键字段失败",mdmId);
|
||||
}
|
||||
String codefieldname = mdmDbFiledVOList.get(0).getCodefieldname();
|
||||
String datefieldname = mdmDbFiledVOList.get(0).getDatefieldname();
|
||||
|
||||
|
||||
//根据mdmId查询表名
|
||||
MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity();
|
||||
mdmModuleDbEntity.setMdmId(mdmId);
|
||||
mdmModuleDbEntity.setDbType("1");
|
||||
List<MdmModuleDbEntity> mdmModuleDbEntityList = mdmModuleDbDao.query(mdmModuleDbEntity);
|
||||
if(mdmModuleDbEntityList.size()==0){
|
||||
Assert.state(false,"mdmId不存在");
|
||||
}
|
||||
MdmModuleDbEntity mdmModuleDb = mdmModuleDbEntityList.get(0);
|
||||
|
||||
String timeStart = vo.getTimeStart();
|
||||
String timeEnd = vo.getTimeEnd();
|
||||
|
||||
MdmDBQueryVO mdmDBQueryVO = new MdmDBQueryVO();
|
||||
mdmDBQueryVO.setTablename(mdmModuleDb.getDbName());
|
||||
mdmDBQueryVO.setPageNum(vo.getPageNum());
|
||||
mdmDBQueryVO.setPageSize(vo.getPageSize());
|
||||
mdmDBQueryVO.setProp3(datefieldname);
|
||||
mdmDBQueryVO.setPropValue3(timeStart+" 00:00:00");
|
||||
mdmDBQueryVO.setProp4(datefieldname);
|
||||
mdmDBQueryVO.setPropValue4(timeEnd+" 00:00:00");
|
||||
mdmDBQueryVO.setProp5(codefieldname);
|
||||
mdmDBQueryVO.setPropValue5(vo.getBillCode());
|
||||
|
||||
mdmDBQueryVO.setProp6("project_code");
|
||||
mdmDBQueryVO.setPropValue6(vo.getProjectId());
|
||||
|
||||
mdmDBQueryVO.setBillstatus(vo.getBillstatus());
|
||||
PageHelper.startPage(mdmDBQueryVO.getPageNum(), mdmDBQueryVO.getPageSize());
|
||||
List<Map<String, Object>> maps = mdmDBQueryVODAO.queryDataByMdmId(mdmDBQueryVO);
|
||||
PageInfo pageInfo = new PageInfo(maps);
|
||||
return pageInfo;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<AePushVoucherLogDetailsEntity> queryDetailsByBillCode(AePushVoucherLogEntity entity) {
|
||||
Assert.notNull(entity.getId(), "id不能为空");
|
||||
|
@ -342,4 +414,6 @@ public class AePushVoucherLogServiceImpl extends BaseService<AePushVoucherLogEnt
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
package com.hzya.frame.voucher.constant;
|
||||
|
||||
/**
|
||||
* Created by zydd on 2025-06-06 09:38
|
||||
*/
|
||||
public class ProfilesActiveConstant {
|
||||
public static final String LETS_PROD_DATE_SOURCE = "lets-prod";
|
||||
|
||||
public static final String LETS_PROFILES_ACTIVE = "prod";
|
||||
}
|
Loading…
Reference in New Issue