diff --git a/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/generate/core/controller/CoreController.java b/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/generate/core/controller/CoreController.java index 293034cf..b6f07fd6 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/generate/core/controller/CoreController.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/generate/core/controller/CoreController.java @@ -47,13 +47,13 @@ public class CoreController extends DefaultController { public JsonResultEntity generateVoucher(@RequestBody CreateVoucherVO createVoucherVO) { try { - String billCodes = createVoucherVO.getBillCode(); + String billCodes = createVoucherVO.getBill_code(); String[] split = billCodes.split(","); Set set = new LinkedHashSet<>(Arrays.asList(split)); String[] uniqueArray = set.toArray(new String[0]); for (String s : uniqueArray) { - createVoucherVO.setBillCode(s); + createVoucherVO.setBill_code(s); coreService.generateVoucher(createVoucherVO); } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/generate/core/service/impl/ICoreServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/generate/core/service/impl/ICoreServiceImpl.java index 2f3a9eaa..f618b916 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/generate/core/service/impl/ICoreServiceImpl.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/generate/core/service/impl/ICoreServiceImpl.java @@ -174,7 +174,7 @@ public class ICoreServiceImpl implements ICoreService { String date = null; try { Assert.notNull(createVoucherVO.getMdmId(), "生成凭证时,主数据id不能为空"); - Assert.notNull(createVoucherVO.getBillCode(), "生成凭证时,单据编号不能为空"); + Assert.notNull(createVoucherVO.getBill_code(), "生成凭证时,单据编号不能为空"); MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); mdmModuleDbEntity.setDbType("1"); @@ -198,7 +198,7 @@ public class ICoreServiceImpl implements ICoreService { MdmDBQueryVO mdmDBQueryVO = new MdmDBQueryVO(); mdmDBQueryVO.setTablename(mdmModuleDb.getDbName()); mdmDBQueryVO.setProp6("bill_code"); - mdmDBQueryVO.setPropValue6(createVoucherVO.getBillCode()); + mdmDBQueryVO.setPropValue6(createVoucherVO.getBill_code()); List> dataMapList = mdmDBQueryVODAO.queryMdmDb(mdmDBQueryVO); //获取汇总规则 @@ -226,7 +226,7 @@ public class ICoreServiceImpl implements ICoreService { Map, List>> groupedResultDate = dataMapList.stream().collect(Collectors.groupingBy(grouperDate)); Set> dateList = groupedResultDate.keySet(); if (dateList.size() == 0 || dateList.size() > 1) { - Assert.state(false, "该单据日期查询失败,为查询到单据日期或单据日期不唯一,请检查单据信息->mdmId:{},bill_code:{}。", createVoucherVO.getMdmId(), createVoucherVO.getBillCode()); + Assert.state(false, "该单据日期查询失败,为查询到单据日期或单据日期不唯一,请检查单据信息->mdmId:{},bill_code:{}。", createVoucherVO.getMdmId(), createVoucherVO.getBill_code()); } String ts = dateList.iterator().next().get(0).toString(); date = ts.substring(0, 10); @@ -545,7 +545,7 @@ public class ICoreServiceImpl implements ICoreService { //记录日志 - saveLog("Y",createVoucherVO.getBillCode(),null,createVoucherVO.getMdmId(),voucher); + saveLog("Y",createVoucherVO.getBill_code(),null,createVoucherVO.getMdmId(),voucher); } else {//按类型生成不同的凭证 //根据凭证类型分组 账簿主键+凭证类别+模板id Map> collectTempType = @@ -798,7 +798,7 @@ public class ICoreServiceImpl implements ICoreService { vouche.setDetails(details); voucher.add(vouche); //记录日志 - saveLog("Y",createVoucherVO.getBillCode(),null,createVoucherVO.getMdmId(),voucher); + saveLog("Y",createVoucherVO.getBill_code(),null,createVoucherVO.getMdmId(),voucher); } @@ -810,7 +810,7 @@ public class ICoreServiceImpl implements ICoreService { //记录日志 AePushVoucherLogEntity aePushVoucherLogEntity = new AePushVoucherLogEntity(); aePushVoucherLogEntity.setMdmId(createVoucherVO.getMdmId()); - aePushVoucherLogEntity.setBillCode(createVoucherVO.getBillCode()); + aePushVoucherLogEntity.setBill_code(createVoucherVO.getBill_code()); aePushVoucherLogEntity.setBillStatus("N"); aePushVoucherLogEntity.setBillDate(date); aePushVoucherLogEntity.setPushRes(e.getMessage()); @@ -1969,7 +1969,7 @@ public class ICoreServiceImpl implements ICoreService { System.out.println(voucher.getDetails()); AePushVoucherLogEntity voucherLogEntity = new AePushVoucherLogEntity(); voucherLogEntity.setMdmId(mdmId);//业务id - voucherLogEntity.setBillCode(billCode);//单据号 + voucherLogEntity.setBill_code(billCode);//单据号 voucherLogEntity.setTemplateTypeId(null);//凭证类别id voucherLogEntity.setBillStatus(status);//推送状态 voucherLogEntity.setBillDate(voucher.getPrepareddate());//单据日期 diff --git a/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/generate/core/vo/CreateVoucherVO.java b/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/generate/core/vo/CreateVoucherVO.java index 434c1084..988affa9 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/generate/core/vo/CreateVoucherVO.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/generate/core/vo/CreateVoucherVO.java @@ -18,7 +18,7 @@ public class CreateVoucherVO extends BaseEntity { /** * 单据编码 */ - private String billCode; + private String bill_code; private String timeStart; private String timeEnd; /** diff --git a/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/push/controller/PushLogController.java b/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/push/controller/PushLogController.java index 79dbd9c6..c1ef1579 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/push/controller/PushLogController.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/push/controller/PushLogController.java @@ -32,34 +32,34 @@ public class PushLogController extends DefaultController { private IAePushVoucherLogService aePushVoucherLogService; - /** - * 查询单据,根据状态 - * 以mdm为准,查询所有单据,过滤日志表 - */ - @RequestMapping(value = "/queryBill", method = RequestMethod.POST) - public JsonResultEntity queryBill(@RequestBody AePushVoucherLogEntity entity) { - try { - List voucherLogEntityList = aePushVoucherLogService.queryBill(entity); - return getSuccessMessageEntity("请求成功", voucherLogEntityList); - } catch (Exception e) { - e.printStackTrace(); - return getFailureMessageEntity(e.getMessage()); - } - } - - /** - * 查询明细 - */ - @RequestMapping(value = "/queryDetailsByBillCode", method = RequestMethod.POST) - public JsonResultEntity queryDetailsByBillCode(@RequestBody AePushVoucherLogEntity entity) { - try { - List voucherLogDetails = aePushVoucherLogService.queryDetailsByBillCode(entity); - return getSuccessMessageEntity("请求成功", voucherLogDetails); - } catch (Exception e) { - e.printStackTrace(); - return getFailureMessageEntity(e.getMessage()); - } - } +// /** +// * 查询单据,根据状态 +// * 以mdm为准,查询所有单据,过滤日志表 +// */ +// @RequestMapping(value = "/queryBill", method = RequestMethod.POST) +// public JsonResultEntity queryBill(@RequestBody AePushVoucherLogEntity entity) { +// try { +// List voucherLogEntityList = aePushVoucherLogService.queryBill(entity); +// return getSuccessMessageEntity("请求成功", voucherLogEntityList); +// } catch (Exception e) { +// e.printStackTrace(); +// return getFailureMessageEntity(e.getMessage()); +// } +// } +// +// /** +// * 查询明细 +// */ +// @RequestMapping(value = "/queryDetailsByBillCode", method = RequestMethod.POST) +// public JsonResultEntity queryDetailsByBillCode(@RequestBody AePushVoucherLogEntity entity) { +// try { +// List voucherLogDetails = aePushVoucherLogService.queryDetailsByBillCode(entity); +// return getSuccessMessageEntity("请求成功", voucherLogDetails); +// } catch (Exception e) { +// e.printStackTrace(); +// return getFailureMessageEntity(e.getMessage()); +// } +// } //查需所有单据,带条件:mdmId,单据日期,项目编码,单据编号,生成状态 @RequestMapping(value = "/queryBillPaged", method = RequestMethod.POST) @@ -85,5 +85,19 @@ public class PushLogController extends DefaultController { } } + //查询分录信息。根据mdmId+billcode-->在查明细 + @RequestMapping(value = "/queryDetailsByBillCodeAndMdmId", method = RequestMethod.POST) + public JsonResultEntity queryDetailsByBillCodeAndMdmId(@RequestBody AePushVoucherLogEntity entity) { + try { + Assert.notNull(entity.getMdmId(), "mdmId不能为空"); + Assert.notNull(entity.getBill_code(), "bill_code不能为空"); + List Details = aePushVoucherLogService.queryDetailsByBillCodeAndMdmId(entity); + return getSuccessMessageEntity("请求成功", Details); + } catch (Exception e) { + e.printStackTrace(); + return getFailureMessageEntity(e.getMessage()); + } + } + } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/push/dao/impl/AePushVoucherLogDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/push/dao/impl/AePushVoucherLogDaoImpl.java index 52cf68a6..6e442b67 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/push/dao/impl/AePushVoucherLogDaoImpl.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/push/dao/impl/AePushVoucherLogDaoImpl.java @@ -26,11 +26,11 @@ public class AePushVoucherLogDaoImpl extends MybatisGenericDao query = this.query(aePushVoucherLogEntity1); if (query == null || query.size() == 0) { AePushVoucherLogEntity save = this.save(aePushVoucherLogEntity); diff --git a/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/push/entity/AePushVoucherLogDetailsEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/push/entity/AePushVoucherLogDetailsEntity.java index 3542cc6c..aa8b93a2 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/push/entity/AePushVoucherLogDetailsEntity.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/push/entity/AePushVoucherLogDetailsEntity.java @@ -9,7 +9,40 @@ import com.hzya.frame.web.entity.BaseEntity; * @since 2025-07-25 09:52:37 */ public class AePushVoucherLogDetailsEntity extends BaseEntity { - + + + //表头补充 + /** + * 凭证日期 + */ + private String billDate; + /** + * 账簿主键 + */ + private String pkGlorgbook; + /** + * 账簿编码 + */ + private String glOrgbookCode; + /** + * 账簿名称 + */ + private String glOrgbookName; + /** + * 凭证类别id + */ + private String voucherTypeId; + /** + * 凭证类别名称 + */ + private String voucherTypeName; + /** + * 凭证号 + */ + private String voucherNo; + + + /** 凭证日志主表id */ private Long voucherId; /** 摘要 */ @@ -249,5 +282,93 @@ public class AePushVoucherLogDetailsEntity extends BaseEntity { this.modifyUser = modifyUser; } + + public String getBillDate() { + return billDate; + } + + public void setBillDate(String billDate) { + this.billDate = billDate; + } + + public String getPkGlorgbook() { + return pkGlorgbook; + } + + public void setPkGlorgbook(String pkGlorgbook) { + this.pkGlorgbook = pkGlorgbook; + } + + public String getGlOrgbookCode() { + return glOrgbookCode; + } + + public void setGlOrgbookCode(String glOrgbookCode) { + this.glOrgbookCode = glOrgbookCode; + } + + public String getGlOrgbookName() { + return glOrgbookName; + } + + public void setGlOrgbookName(String glOrgbookName) { + this.glOrgbookName = glOrgbookName; + } + + public String getVoucherTypeId() { + return voucherTypeId; + } + + public void setVoucherTypeId(String voucherTypeId) { + this.voucherTypeId = voucherTypeId; + } + + public String getVoucherTypeName() { + return voucherTypeName; + } + + public void setVoucherTypeName(String voucherTypeName) { + this.voucherTypeName = voucherTypeName; + } + + public String getVoucherNo() { + return voucherNo; + } + + public void setVoucherNo(String voucherNo) { + this.voucherNo = voucherNo; + } + + public String getjYbSum() { + return jYbSum; + } + + public void setjYbSum(String jYbSum) { + this.jYbSum = jYbSum; + } + + public String getjBbSum() { + return jBbSum; + } + + public void setjBbSum(String jBbSum) { + this.jBbSum = jBbSum; + } + + public String getdYbSum() { + return dYbSum; + } + + public void setdYbSum(String dYbSum) { + this.dYbSum = dYbSum; + } + + public String getdBbSum() { + return dBbSum; + } + + public void setdBbSum(String dBbSum) { + this.dBbSum = dBbSum; + } } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/push/entity/AePushVoucherLogEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/push/entity/AePushVoucherLogEntity.java index e4fe75a0..dc243c3b 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/push/entity/AePushVoucherLogEntity.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/push/entity/AePushVoucherLogEntity.java @@ -20,7 +20,7 @@ public class AePushVoucherLogEntity extends BaseEntity { /** * 单据号 */ - private String billCode; + private String bill_code; /** * 凭证模板类型id */ @@ -123,12 +123,12 @@ public class AePushVoucherLogEntity extends BaseEntity { this.mdmId = mdmId; } - public String getBillCode() { - return billCode; + public String getBill_code() { + return bill_code; } - public void setBillCode(String billCode) { - this.billCode = billCode; + public void setBill_code(String bill_code) { + this.bill_code = bill_code; } public String getTemplateTypeId() { diff --git a/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/push/entity/AePushVoucherLogEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/push/entity/AePushVoucherLogEntity.xml index 5152df0d..a4dfcf5b 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/push/entity/AePushVoucherLogEntity.xml +++ b/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/push/entity/AePushVoucherLogEntity.xml @@ -6,7 +6,7 @@ type="com.hzya.frame.voucher.ae.push.entity.AePushVoucherLogEntity"> - + @@ -89,7 +89,7 @@ and id = #{id} and mdm_id = #{mdmId} - and bill_code = #{billCode} + and bill_code = #{bill_code} and template_type_id = #{templateTypeId} and template_type_name = #{templateTypeName} @@ -136,7 +136,7 @@ and id = #{id} and mdm_id = #{mdmId} - and bill_code = #{billCode} + and bill_code = #{bill_code} and template_type_id = #{templateTypeId} and template_type_name = #{templateTypeName} @@ -185,7 +185,7 @@ and id like concat('%',#{id},'%') and mdm_id like concat('%',#{mdmId},'%') - and bill_code like concat('%',#{billCode},'%') + and bill_code like concat('%',#{bill_code},'%') and template_type_id like concat('%',#{templateTypeId},'%') @@ -246,7 +246,7 @@ or id = #{id} or mdm_id = #{mdmId} - or bill_code = #{billCode} + or bill_code = #{bill_code} or template_type_id = #{templateTypeId} or template_type_name = #{templateTypeName} @@ -292,7 +292,7 @@ id , mdm_id , - bill_code , + bill_code , template_type_id , template_type_name , bill_date , @@ -334,7 +334,7 @@ #{id} , #{mdmId} , - #{billCode} , + #{bill_code} , #{templateTypeId} , #{templateTypeName} , #{billDate} , @@ -382,7 +382,7 @@ def7, def8, def9, def10, create_time, create_user, modify_time, modify_user, sts, sts) values - (#{entity.mdmId},#{entity.billCode},#{entity.templateTypeId},#{entity.templateTypeName},#{entity.billDate},#{entity.billStatus},#{entity.pkGlorgbook},#{entity.glOrgbookCode},#{entity.glOrgbookName},#{entity.voucherTypeId},#{entity.voucherTypeName},#{entity.voucherNo},#{entity.abstractStr},#{entity.jYbSum},#{entity.jBbSum},#{entity.dYbSum},#{entity.dBbSum},#{entity.pushData},#{entity.pushInfo},#{entity.pushRes},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10},#{entity.create_time},#{entity.createUser},#{entity.modify_time},#{entity.modifyUser},#{entity.sts}, + (#{entity.mdmId},#{entity.bill_code},#{entity.templateTypeId},#{entity.templateTypeName},#{entity.billDate},#{entity.billStatus},#{entity.pkGlorgbook},#{entity.glOrgbookCode},#{entity.glOrgbookName},#{entity.voucherTypeId},#{entity.voucherTypeName},#{entity.voucherNo},#{entity.abstractStr},#{entity.jYbSum},#{entity.jBbSum},#{entity.dYbSum},#{entity.dBbSum},#{entity.pushData},#{entity.pushInfo},#{entity.pushRes},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10},#{entity.create_time},#{entity.createUser},#{entity.modify_time},#{entity.modifyUser},#{entity.sts}, 'Y') @@ -394,7 +394,7 @@ def7, def8, def9, def10, create_time, create_user, modify_time, modify_user, sts) values - (#{entity.mdmId},#{entity.billCode},#{entity.templateTypeId},#{entity.templateTypeName},#{entity.billDate},#{entity.billStatus},#{entity.pkGlorgbook},#{entity.glOrgbookCode},#{entity.glOrgbookName},#{entity.voucherTypeId},#{entity.voucherTypeName},#{entity.voucherNo},#{entity.abstractStr},#{entity.jYbSum},#{entity.jBbSum},#{entity.dYbSum},#{entity.dBbSum},#{entity.pushData},#{entity.pushInfo},#{entity.pushRes},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10},#{entity.create_time},#{entity.createUser},#{entity.modify_time},#{entity.modifyUser},#{entity.sts}) + (#{entity.mdmId},#{entity.bill_code},#{entity.templateTypeId},#{entity.templateTypeName},#{entity.billDate},#{entity.billStatus},#{entity.pkGlorgbook},#{entity.glOrgbookCode},#{entity.glOrgbookName},#{entity.voucherTypeId},#{entity.voucherTypeName},#{entity.voucherNo},#{entity.abstractStr},#{entity.jYbSum},#{entity.jBbSum},#{entity.dYbSum},#{entity.dBbSum},#{entity.pushData},#{entity.pushInfo},#{entity.pushRes},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10},#{entity.create_time},#{entity.createUser},#{entity.modify_time},#{entity.modifyUser},#{entity.sts}) on duplicate key update mdm_id = values(mdm_id), @@ -438,7 +438,7 @@ update ae_push_voucher_log set mdm_id = #{mdmId}, - bill_code = #{billCode}, + bill_code = #{bill_code}, template_type_id = #{templateTypeId}, template_type_name = #{templateTypeName}, @@ -491,7 +491,7 @@ and id = #{id} and mdm_id = #{mdmId} - and bill_code = #{billCode} + and bill_code = #{bill_code} and template_type_id = #{templateTypeId} and template_type_name = #{templateTypeName} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/push/service/IAePushVoucherLogService.java b/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/push/service/IAePushVoucherLogService.java index 2667f932..17ad8675 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/push/service/IAePushVoucherLogService.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/push/service/IAePushVoucherLogService.java @@ -17,13 +17,15 @@ import java.util.Map; * @since 2025-07-17 16:35:30 */ public interface IAePushVoucherLogService extends IBaseService{ - List queryBill(AePushVoucherLogEntity entity); - - List queryDetailsByBillCode(AePushVoucherLogEntity entity); - - AePushVoucherLogEntity saveOrUpdateBymdmIdAndBillCodeAndTypeId(AePushVoucherLogEntity aePushVoucherLogEntity); +// List queryBill(AePushVoucherLogEntity entity); +// +// List queryDetailsByBillCode(AePushVoucherLogEntity entity); +// +// AePushVoucherLogEntity saveOrUpdateBymdmIdAndBillCodeAndTypeId(AePushVoucherLogEntity aePushVoucherLogEntity); PageInfo queryBillPaged(CreateVoucherVO vo); MdmViewVo queryBillFileds(CreateVoucherVO vo); + + List queryDetailsByBillCodeAndMdmId(AePushVoucherLogEntity entity); } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/push/service/impl/AePushVoucherLogServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/push/service/impl/AePushVoucherLogServiceImpl.java index b2c5ac7e..c6d67b4b 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/push/service/impl/AePushVoucherLogServiceImpl.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/voucher/ae/push/service/impl/AePushVoucherLogServiceImpl.java @@ -161,137 +161,137 @@ public class AePushVoucherLogServiceImpl extends BaseService queryBill(AePushVoucherLogEntity entity) { - Assert.notNull(entity.getMdmId(), "mdmId不能为空"); - - CreateVoucherVO createVoucherVO = new CreateVoucherVO(); - createVoucherVO.setMdmId(entity.getMdmId()); - if (entity.getTimeStart() != null && !"".equals(entity.getTimeStart())) { - createVoucherVO.setTimeStart(entity.getTimeStart()); - } - if (entity.getTimeEnd() != null && !"".equals(entity.getTimeEnd())) { - createVoucherVO.setTimeEnd(entity.getTimeEnd()); - } - - List> mapList = coreService.queryDataByMdmId(createVoucherVO);//已被去重 - - List allList = transData(entity.getMdmId(), mapList); - AePushVoucherLogEntity aePushVoucherLogEntity1 = new AePushVoucherLogEntity(); - aePushVoucherLogEntity1.setMdmId(entity.getMdmId()); - List pushData = aePushVoucherLogDao.query(aePushVoucherLogEntity1); - - for (AePushVoucherLogEntity allEntity : allList) { - for (AePushVoucherLogEntity pushEntity : pushData) { - if (allEntity.getBillCode().equals(pushEntity.getBillCode())) { - allEntity.setBillStatus("Y"); - allEntity.setPushInfo(pushEntity.getPushInfo()); - break; - } else { - allEntity.setBillStatus("N"); +// @Override +// public List queryBill(AePushVoucherLogEntity entity) { +// Assert.notNull(entity.getMdmId(), "mdmId不能为空"); +// +// CreateVoucherVO createVoucherVO = new CreateVoucherVO(); +// createVoucherVO.setMdmId(entity.getMdmId()); +// if (entity.getTimeStart() != null && !"".equals(entity.getTimeStart())) { +// createVoucherVO.setTimeStart(entity.getTimeStart()); +// } +// if (entity.getTimeEnd() != null && !"".equals(entity.getTimeEnd())) { +// createVoucherVO.setTimeEnd(entity.getTimeEnd()); +// } +// +// List> mapList = coreService.queryDataByMdmId(createVoucherVO);//已被去重 +// +// List allList = transData(entity.getMdmId(), mapList); +// AePushVoucherLogEntity aePushVoucherLogEntity1 = new AePushVoucherLogEntity(); +// aePushVoucherLogEntity1.setMdmId(entity.getMdmId()); +// List pushData = aePushVoucherLogDao.query(aePushVoucherLogEntity1); +// +// for (AePushVoucherLogEntity allEntity : allList) { +// for (AePushVoucherLogEntity pushEntity : pushData) { +// if (allEntity.getBillCode().equals(pushEntity.getBillCode())) { +// allEntity.setBillStatus("Y"); // allEntity.setPushInfo(pushEntity.getPushInfo()); - } - } - - } - - List resList = new ArrayList<>(); - - String billCode = entity.getBillCode(); - String status = entity.getBillStatus(); - if("".equals(status)){ - status=null; - } - - //单据号 - if (billCode != null && status == null) { - for (AePushVoucherLogEntity aePushVoucherLogEntity : allList) { - if (aePushVoucherLogEntity.getBillCode().contains(billCode)) { - resList.add(aePushVoucherLogEntity); - } - } - if (entity.getBillStatus() != null && !"".equals(entity.getBillStatus())) { - List statusList = new ArrayList<>(); - for (AePushVoucherLogEntity aePushVoucherLogEntity : resList) { - if (status.equals(aePushVoucherLogEntity.getBillStatus())) { - statusList.add(aePushVoucherLogEntity); - } - } - - for (AePushVoucherLogEntity aePushVoucherLogEntity : statusList) { - queryByBillCodeAndStatueY(aePushVoucherLogEntity); - } - queryTempType(statusList); - return statusList; - } - - for (AePushVoucherLogEntity aePushVoucherLogEntity : resList) { - queryByBillCodeAndStatueY(aePushVoucherLogEntity); - } - - - queryTempType(resList); - return resList; - - } - //状态 - if (billCode == null && status != null) { - if (entity.getBillStatus() != null && !"".equals(entity.getBillStatus())) { - List statusList = new ArrayList<>(); - for (AePushVoucherLogEntity aePushVoucherLogEntity : allList) { - if (status.equals(aePushVoucherLogEntity.getBillStatus())) { - statusList.add(aePushVoucherLogEntity); - } - } - - for (AePushVoucherLogEntity aePushVoucherLogEntity : statusList) { - queryByBillCodeAndStatueY(aePushVoucherLogEntity); - } - queryTempType(statusList); - return statusList; - } - - for (AePushVoucherLogEntity aePushVoucherLogEntity : allList) { - queryByBillCodeAndStatueY(aePushVoucherLogEntity); - } - - - queryTempType(allList); - return allList; - - } - //单据号+状态 - if (billCode != null && status != null) { - for (AePushVoucherLogEntity aePushVoucherLogEntity : allList) { - if (aePushVoucherLogEntity.getBillCode().contains(billCode)) { - resList.add(aePushVoucherLogEntity); - } - } - - if (entity.getBillStatus() != null && !"".equals(entity.getBillStatus())) { - List statusList = new ArrayList<>(); - for (AePushVoucherLogEntity aePushVoucherLogEntity : resList) { - if (status.equals(aePushVoucherLogEntity.getBillStatus())) { - statusList.add(aePushVoucherLogEntity); - } - } - for (AePushVoucherLogEntity aePushVoucherLogEntity : statusList) { - queryByBillCodeAndStatueY(aePushVoucherLogEntity); - } - queryTempType(statusList); - return statusList; - } - } - - - for (AePushVoucherLogEntity aePushVoucherLogEntity : allList) { - queryByBillCodeAndStatueY(aePushVoucherLogEntity); - } - - queryTempType(allList); - return allList; - } - +// break; +// } else { +// allEntity.setBillStatus("N"); +//// allEntity.setPushInfo(pushEntity.getPushInfo()); +// } +// } +// +// } +// +// List resList = new ArrayList<>(); +// +// String billCode = entity.getBillCode(); +// String status = entity.getBillStatus(); +// if("".equals(status)){ +// status=null; +// } +// +// //单据号 +// if (billCode != null && status == null) { +// for (AePushVoucherLogEntity aePushVoucherLogEntity : allList) { +// if (aePushVoucherLogEntity.getBillCode().contains(billCode)) { +// resList.add(aePushVoucherLogEntity); +// } +// } +// if (entity.getBillStatus() != null && !"".equals(entity.getBillStatus())) { +// List statusList = new ArrayList<>(); +// for (AePushVoucherLogEntity aePushVoucherLogEntity : resList) { +// if (status.equals(aePushVoucherLogEntity.getBillStatus())) { +// statusList.add(aePushVoucherLogEntity); +// } +// } +// +// for (AePushVoucherLogEntity aePushVoucherLogEntity : statusList) { +// queryByBillCodeAndStatueY(aePushVoucherLogEntity); +// } +// queryTempType(statusList); +// return statusList; +// } +// +// for (AePushVoucherLogEntity aePushVoucherLogEntity : resList) { +// queryByBillCodeAndStatueY(aePushVoucherLogEntity); +// } +// +// +// queryTempType(resList); +// return resList; +// +// } +// //状态 +// if (billCode == null && status != null) { +// if (entity.getBillStatus() != null && !"".equals(entity.getBillStatus())) { +// List statusList = new ArrayList<>(); +// for (AePushVoucherLogEntity aePushVoucherLogEntity : allList) { +// if (status.equals(aePushVoucherLogEntity.getBillStatus())) { +// statusList.add(aePushVoucherLogEntity); +// } +// } +// +// for (AePushVoucherLogEntity aePushVoucherLogEntity : statusList) { +// queryByBillCodeAndStatueY(aePushVoucherLogEntity); +// } +// queryTempType(statusList); +// return statusList; +// } +// +// for (AePushVoucherLogEntity aePushVoucherLogEntity : allList) { +// queryByBillCodeAndStatueY(aePushVoucherLogEntity); +// } +// +// +// queryTempType(allList); +// return allList; +// +// } +// //单据号+状态 +// if (billCode != null && status != null) { +// for (AePushVoucherLogEntity aePushVoucherLogEntity : allList) { +// if (aePushVoucherLogEntity.getBillCode().contains(billCode)) { +// resList.add(aePushVoucherLogEntity); +// } +// } +// +// if (entity.getBillStatus() != null && !"".equals(entity.getBillStatus())) { +// List statusList = new ArrayList<>(); +// for (AePushVoucherLogEntity aePushVoucherLogEntity : resList) { +// if (status.equals(aePushVoucherLogEntity.getBillStatus())) { +// statusList.add(aePushVoucherLogEntity); +// } +// } +// for (AePushVoucherLogEntity aePushVoucherLogEntity : statusList) { +// queryByBillCodeAndStatueY(aePushVoucherLogEntity); +// } +// queryTempType(statusList); +// return statusList; +// } +// } +// +// +// for (AePushVoucherLogEntity aePushVoucherLogEntity : allList) { +// queryByBillCodeAndStatueY(aePushVoucherLogEntity); +// } +// +// queryTempType(allList); +// return allList; +// } +// //查需所有单据,带条件:mdmId,单据日期,项目编码project_id,单据编号,生成状态billstatus @Override public PageInfo queryBillPaged(CreateVoucherVO vo) { @@ -336,7 +336,7 @@ public class AePushVoucherLogServiceImpl extends BaseService queryDetailsByBillCode(AePushVoucherLogEntity entity) { - Assert.notNull(entity.getId(), "id不能为空"); -// Assert.notNull(entity.getMdmId(), "mdmId不能为空"); -// Assert.notNull(entity.getBillCode(), "billCode不能为空"); - - //分录信息 - AePushVoucherLogDetailsEntity aePushVoucherLogDetailsEntity = new AePushVoucherLogDetailsEntity(); - aePushVoucherLogDetailsEntity.setVoucherId(Long.valueOf(entity.getId())); - List voucherLogDetailsEntityList = voucherLogDetailsDao.query(aePushVoucherLogDetailsEntity); - - return voucherLogDetailsEntityList; - } - - - /** - * bill_code单据编码 - * bill_date单据日期 - */ - public List transData(String mdmId, List> mapList) { - List all = new ArrayList<>(); - for (Map stringObjectMap : mapList) { - if (stringObjectMap != null) { - AePushVoucherLogEntity aePushVoucherLogEntity = new AePushVoucherLogEntity(); - aePushVoucherLogEntity.setBillCode(stringObjectMap.get("bill_code").toString()); - aePushVoucherLogEntity.setBillDate(stringObjectMap.get("bill_date").toString().substring(0, 10)); - all.add(aePushVoucherLogEntity); - } - } - List sortedList = all.stream() - .sorted(Comparator.comparing(AePushVoucherLogEntity::getBillDate).reversed()) - .collect(Collectors.toList()); - return sortedList; - } - - public void queryByBillCodeAndStatueY(AePushVoucherLogEntity aePushVoucherLogEntity) { - if ("Y".equals(aePushVoucherLogEntity.getBillStatus())) { - AePushVoucherLogEntity aePushVoucherLogEntity1 = new AePushVoucherLogEntity(); - aePushVoucherLogEntity1.setMdmId(aePushVoucherLogEntity.getMdmId()); - aePushVoucherLogEntity1.setBillCode(aePushVoucherLogEntity.getBillCode()); - List query = aePushVoucherLogDao.query(aePushVoucherLogEntity1); - if (query.size() != 0) { - BeanUtils.copyProperties(query.get(0), aePushVoucherLogEntity); + public List queryDetailsByBillCodeAndMdmId(AePushVoucherLogEntity entity) { + List details=new ArrayList<>(); + List query = aePushVoucherLogDao.query(entity); + for (AePushVoucherLogEntity aePushVoucherLogEntity : query) { + AePushVoucherLogDetailsEntity logDetailsEntity = new AePushVoucherLogDetailsEntity(); + logDetailsEntity.setVoucherId(Long.valueOf(aePushVoucherLogEntity.getId())); + List logDetails = voucherLogDetailsDao.query(logDetailsEntity); + details.addAll(logDetails); + for (AePushVoucherLogDetailsEntity logDetail : logDetails) { + logDetail.setBillDate(aePushVoucherLogEntity.getBillDate()); + logDetail.setPkGlorgbook(aePushVoucherLogEntity.getPkGlorgbook()); + logDetail.setGlOrgbookCode(aePushVoucherLogEntity.getGlOrgbookCode()); + logDetail.setGlOrgbookName(aePushVoucherLogEntity.getGlOrgbookName()); + logDetail.setVoucherTypeId(aePushVoucherLogEntity.getVoucherTypeId()); + logDetail.setVoucherTypeName(aePushVoucherLogEntity.getVoucherTypeName()); + logDetail.setVoucherNo(aePushVoucherLogEntity.getVoucherNo()); } } + return details; } - /** - * 根据单据编码查询,是否生成了多张凭证 - */ - public void queryTempType(List voucherLogEntityList) { - for (AePushVoucherLogEntity aePushVoucherLogEntity : voucherLogEntityList) { - AePushVoucherLogEntity aePushVoucherLogEntity1 = new AePushVoucherLogEntity(); - aePushVoucherLogEntity1.setBillCode(aePushVoucherLogEntity.getBillCode()); - List query = aePushVoucherLogDao.query(aePushVoucherLogEntity1); - aePushVoucherLogEntity.setLogList(query); - } - } +// @Override +// public List queryDetailsByBillCode(AePushVoucherLogEntity entity) { +// Assert.notNull(entity.getId(), "id不能为空"); +//// Assert.notNull(entity.getMdmId(), "mdmId不能为空"); +//// Assert.notNull(entity.getBillCode(), "billCode不能为空"); +// +// //分录信息 +// AePushVoucherLogDetailsEntity aePushVoucherLogDetailsEntity = new AePushVoucherLogDetailsEntity(); +// aePushVoucherLogDetailsEntity.setVoucherId(Long.valueOf(entity.getId())); +// List voucherLogDetailsEntityList = voucherLogDetailsDao.query(aePushVoucherLogDetailsEntity); +// +// return voucherLogDetailsEntityList; +// } - /** - * 根据mdmId,bill_code,typeId新增或修改日志 - * 没数据则新增,有数据判断Y/N - * N->N/Y 更新 - * Y->N/Y 返回null - */ - @Override - public AePushVoucherLogEntity saveOrUpdateBymdmIdAndBillCodeAndTypeId(AePushVoucherLogEntity aePushVoucherLogEntity) { - Assert.notNull(aePushVoucherLogEntity.getMdmId(), "根据mdmId,bill_code,typeId新增或修改日志时,mdmId不能为空"); - Assert.notNull(aePushVoucherLogEntity.getBillCode(), "根据mdmId,bill_code,billCode新增或修改日志时,mdmId不能为空"); - Assert.notNull(aePushVoucherLogEntity.getBillStatus(), "根据mdmId,bill_code,billStatus新增或修改日志时,mdmId不能为空"); - AePushVoucherLogEntity aePushVoucherLogEntity1 = new AePushVoucherLogEntity(); - aePushVoucherLogEntity1.setMdmId(aePushVoucherLogEntity.getMdmId()); - aePushVoucherLogEntity1.setBillCode(aePushVoucherLogEntity.getBillCode()); - List query = aePushVoucherLogDao.query(aePushVoucherLogEntity1); - if (query == null || query.size() == 0) { - AePushVoucherLogEntity save = aePushVoucherLogDao.save(aePushVoucherLogEntity); - return save; - } else { - aePushVoucherLogDao.update(aePushVoucherLogEntity); - return aePushVoucherLogEntity; - } - } +// /** +// * bill_code单据编码 +// * bill_date单据日期 +// */ +// public List transData(String mdmId, List> mapList) { +// List all = new ArrayList<>(); +// for (Map stringObjectMap : mapList) { +// if (stringObjectMap != null) { +// AePushVoucherLogEntity aePushVoucherLogEntity = new AePushVoucherLogEntity(); +// aePushVoucherLogEntity.setBillCode(stringObjectMap.get("bill_code").toString()); +// aePushVoucherLogEntity.setBillDate(stringObjectMap.get("bill_date").toString().substring(0, 10)); +// all.add(aePushVoucherLogEntity); +// } +// } +// List sortedList = all.stream() +// .sorted(Comparator.comparing(AePushVoucherLogEntity::getBillDate).reversed()) +// .collect(Collectors.toList()); +// return sortedList; +// } +// +// public void queryByBillCodeAndStatueY(AePushVoucherLogEntity aePushVoucherLogEntity) { +// if ("Y".equals(aePushVoucherLogEntity.getBillStatus())) { +// AePushVoucherLogEntity aePushVoucherLogEntity1 = new AePushVoucherLogEntity(); +// aePushVoucherLogEntity1.setMdmId(aePushVoucherLogEntity.getMdmId()); +// aePushVoucherLogEntity1.setBillCode(aePushVoucherLogEntity.getBillCode()); +// List query = aePushVoucherLogDao.query(aePushVoucherLogEntity1); +// if (query.size() != 0) { +// BeanUtils.copyProperties(query.get(0), aePushVoucherLogEntity); +// } +// } +// } +// +// +// /** +// * 根据单据编码查询,是否生成了多张凭证 +// */ +// public void queryTempType(List voucherLogEntityList) { +// for (AePushVoucherLogEntity aePushVoucherLogEntity : voucherLogEntityList) { +// AePushVoucherLogEntity aePushVoucherLogEntity1 = new AePushVoucherLogEntity(); +// aePushVoucherLogEntity1.setBillCode(aePushVoucherLogEntity.getBillCode()); +// List query = aePushVoucherLogDao.query(aePushVoucherLogEntity1); +// aePushVoucherLogEntity.setLogList(query); +// } +// } +// +// +// /** +// * 根据mdmId,bill_code,typeId新增或修改日志 +// * 没数据则新增,有数据判断Y/N +// * N->N/Y 更新 +// * Y->N/Y 返回null +// */ +// @Override +// public AePushVoucherLogEntity saveOrUpdateBymdmIdAndBillCodeAndTypeId(AePushVoucherLogEntity aePushVoucherLogEntity) { +// Assert.notNull(aePushVoucherLogEntity.getMdmId(), "根据mdmId,bill_code,typeId新增或修改日志时,mdmId不能为空"); +// Assert.notNull(aePushVoucherLogEntity.getBillCode(), "根据mdmId,bill_code,billCode新增或修改日志时,mdmId不能为空"); +// Assert.notNull(aePushVoucherLogEntity.getBillStatus(), "根据mdmId,bill_code,billStatus新增或修改日志时,mdmId不能为空"); +// AePushVoucherLogEntity aePushVoucherLogEntity1 = new AePushVoucherLogEntity(); +// aePushVoucherLogEntity1.setMdmId(aePushVoucherLogEntity.getMdmId()); +// aePushVoucherLogEntity1.setBillCode(aePushVoucherLogEntity.getBillCode()); +// List query = aePushVoucherLogDao.query(aePushVoucherLogEntity1); +// if (query == null || query.size() == 0) { +// AePushVoucherLogEntity save = aePushVoucherLogDao.save(aePushVoucherLogEntity); +// return save; +// } else { +// aePushVoucherLogDao.update(aePushVoucherLogEntity); +// return aePushVoucherLogEntity; +// } +// } private List getFiledByType(String viewType, List mdmModuleViewDetailEntities, List mdmModuleDbEntityList, List mdmModuleDbFiledsEntityList, List mdmModuleDbFiledsRuleEntityList) { List mdmViewFiledVos = new ArrayList<>(); for (int i = 0; i < mdmModuleDbEntityList.size(); i++) {