1、查询分录明细字段优化

This commit is contained in:
zhengyf 2025-08-07 14:41:46 +08:00
parent b88a373432
commit 5ce6dcc407
10 changed files with 429 additions and 270 deletions

View File

@ -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<String> 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);
}

View File

@ -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<Map<String, Object>> dataMapList = mdmDBQueryVODAO.queryMdmDb(mdmDBQueryVO);
//获取汇总规则
@ -226,7 +226,7 @@ public class ICoreServiceImpl implements ICoreService {
Map<List<Object>, List<Map<String, Object>>> groupedResultDate = dataMapList.stream().collect(Collectors.groupingBy(grouperDate));
Set<List<Object>> 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<String, List<AeConfVoucherTemplateEntity>> 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());//单据日期

View File

@ -18,7 +18,7 @@ public class CreateVoucherVO extends BaseEntity {
/**
* 单据编码
*/
private String billCode;
private String bill_code;
private String timeStart;
private String timeEnd;
/**

View File

@ -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<AePushVoucherLogEntity> 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<AePushVoucherLogDetailsEntity> 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<AePushVoucherLogEntity> 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<AePushVoucherLogDetailsEntity> 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<AePushVoucherLogDetailsEntity> Details = aePushVoucherLogService.queryDetailsByBillCodeAndMdmId(entity);
return getSuccessMessageEntity("请求成功", Details);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity(e.getMessage());
}
}
}

View File

@ -26,11 +26,11 @@ public class AePushVoucherLogDaoImpl extends MybatisGenericDao<AePushVoucherLogE
@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.getBill_code(), "根据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());
aePushVoucherLogEntity1.setBill_code(aePushVoucherLogEntity.getBill_code());
List<AePushVoucherLogEntity> query = this.query(aePushVoucherLogEntity1);
if (query == null || query.size() == 0) {
AePushVoucherLogEntity save = this.save(aePushVoucherLogEntity);

View File

@ -10,6 +10,39 @@ import com.hzya.frame.web.entity.BaseEntity;
*/
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;
}
}

View File

@ -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() {

View File

@ -6,7 +6,7 @@
type="com.hzya.frame.voucher.ae.push.entity.AePushVoucherLogEntity">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="mdmId" column="mdm_id" jdbcType="VARCHAR"/>
<result property="billCode" column="bill_code" jdbcType="VARCHAR"/>
<result property="bill_code" column="bill_code" jdbcType="VARCHAR"/>
<result property="templateTypeId" column="template_type_id" jdbcType="VARCHAR"/>
<result property="templateTypeName" column="template_type_name" jdbcType="VARCHAR"/>
<result property="billDate" column="bill_date" jdbcType="VARCHAR"/>
@ -89,7 +89,7 @@
<trim prefix="where" prefixOverrides="and">
<if test="id != null">and id = #{id}</if>
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
<if test="billCode != null and billCode != ''">and bill_code = #{billCode}</if>
<if test="bill_code != null and bill_code != ''">and bill_code = #{bill_code}</if>
<if test="templateTypeId != null and templateTypeId != ''">and template_type_id = #{templateTypeId}</if>
<if test="templateTypeName != null and templateTypeName != ''">and template_type_name =
#{templateTypeName}
@ -136,7 +136,7 @@
<trim prefix="where" prefixOverrides="and">
<if test="id != null">and id = #{id}</if>
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
<if test="billCode != null and billCode != ''">and bill_code = #{billCode}</if>
<if test="bill_code != null and bill_code != ''">and bill_code = #{bill_code}</if>
<if test="templateTypeId != null and templateTypeId != ''">and template_type_id = #{templateTypeId}</if>
<if test="templateTypeName != null and templateTypeName != ''">and template_type_name =
#{templateTypeName}
@ -185,7 +185,7 @@
<trim prefix="where" prefixOverrides="and">
<if test="id != null">and id like concat('%',#{id},'%')</if>
<if test="mdmId != null and mdmId != ''">and mdm_id like concat('%',#{mdmId},'%')</if>
<if test="billCode != null and billCode != ''">and bill_code like concat('%',#{billCode},'%')</if>
<if test="bill_code != null and bill_code != ''">and bill_code like concat('%',#{bill_code},'%')</if>
<if test="templateTypeId != null and templateTypeId != ''">and template_type_id like
concat('%',#{templateTypeId},'%')
</if>
@ -246,7 +246,7 @@
<trim prefix="where" prefixOverrides="and">
<if test="id != null">or id = #{id}</if>
<if test="mdmId != null and mdmId != ''">or mdm_id = #{mdmId}</if>
<if test="billCode != null and billCode != ''">or bill_code = #{billCode}</if>
<if test="bill_code != null and bill_code != ''">or bill_code = #{bill_code}</if>
<if test="templateTypeId != null and templateTypeId != ''">or template_type_id = #{templateTypeId}</if>
<if test="templateTypeName != null and templateTypeName != ''">or template_type_name = #{templateTypeName}
</if>
@ -292,7 +292,7 @@
<trim suffix="" suffixOverrides=",">
<if test="id != null">id ,</if>
<if test="mdmId != null and mdmId != ''">mdm_id ,</if>
<if test="billCode != null and billCode != ''">bill_code ,</if>
<if test="bill_code != null and bill_code != ''">bill_code ,</if>
<if test="templateTypeId != null and templateTypeId != ''">template_type_id ,</if>
<if test="templateTypeName != null and templateTypeName != ''">template_type_name ,</if>
<if test="billDate != null">bill_date ,</if>
@ -334,7 +334,7 @@
<trim suffix="" suffixOverrides=",">
<if test="id != null">#{id} ,</if>
<if test="mdmId != null and mdmId != ''">#{mdmId} ,</if>
<if test="billCode != null and billCode != ''">#{billCode} ,</if>
<if test="bill_code != null and bill_code != ''">#{bill_code} ,</if>
<if test="templateTypeId != null and templateTypeId != ''">#{templateTypeId} ,</if>
<if test="templateTypeName != null and templateTypeName != ''">#{templateTypeName} ,</if>
<if test="billDate != null">#{billDate} ,</if>
@ -382,7 +382,7 @@
def7, def8, def9, def10, create_time, create_user, modify_time, modify_user, sts, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{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')
</foreach>
</insert>
@ -394,7 +394,7 @@
def7, def8, def9, def10, create_time, create_user, modify_time, modify_user, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{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})
</foreach>
on duplicate key update
mdm_id = values(mdm_id),
@ -438,7 +438,7 @@
update ae_push_voucher_log set
<trim suffix="" suffixOverrides=",">
<if test="mdmId != null and mdmId != ''">mdm_id = #{mdmId},</if>
<if test="billCode != null and billCode != ''">bill_code = #{billCode},</if>
<if test="bill_code != null and bill_code != ''">bill_code = #{bill_code},</if>
<if test="templateTypeId != null and templateTypeId != ''">template_type_id = #{templateTypeId},</if>
<if test="templateTypeName != null and templateTypeName != ''">template_type_name = #{templateTypeName},
</if>
@ -491,7 +491,7 @@
<trim prefix="where" prefixOverrides="and">
<if test="id != null">and id = #{id}</if>
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
<if test="billCode != null and billCode != ''">and bill_code = #{billCode}</if>
<if test="bill_code != null and bill_code != ''">and bill_code = #{bill_code}</if>
<if test="templateTypeId != null and templateTypeId != ''">and template_type_id = #{templateTypeId}</if>
<if test="templateTypeName != null and templateTypeName != ''">and template_type_name =
#{templateTypeName}

View File

@ -17,13 +17,15 @@ import java.util.Map;
* @since 2025-07-17 16:35:30
*/
public interface IAePushVoucherLogService extends IBaseService<AePushVoucherLogEntity, String>{
List<AePushVoucherLogEntity> queryBill(AePushVoucherLogEntity entity);
List<AePushVoucherLogDetailsEntity> queryDetailsByBillCode(AePushVoucherLogEntity entity);
AePushVoucherLogEntity saveOrUpdateBymdmIdAndBillCodeAndTypeId(AePushVoucherLogEntity aePushVoucherLogEntity);
// List<AePushVoucherLogEntity> queryBill(AePushVoucherLogEntity entity);
//
// List<AePushVoucherLogDetailsEntity> queryDetailsByBillCode(AePushVoucherLogEntity entity);
//
// AePushVoucherLogEntity saveOrUpdateBymdmIdAndBillCodeAndTypeId(AePushVoucherLogEntity aePushVoucherLogEntity);
PageInfo queryBillPaged(CreateVoucherVO vo);
MdmViewVo queryBillFileds(CreateVoucherVO vo);
List<AePushVoucherLogDetailsEntity> queryDetailsByBillCodeAndMdmId(AePushVoucherLogEntity entity);
}

View File

@ -161,137 +161,137 @@ public class AePushVoucherLogServiceImpl extends BaseService<AePushVoucherLogEnt
// }
@Override
public List<AePushVoucherLogEntity> 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<Map<String, Object>> mapList = coreService.queryDataByMdmId(createVoucherVO);//已被去重
List<AePushVoucherLogEntity> allList = transData(entity.getMdmId(), mapList);
AePushVoucherLogEntity aePushVoucherLogEntity1 = new AePushVoucherLogEntity();
aePushVoucherLogEntity1.setMdmId(entity.getMdmId());
List<AePushVoucherLogEntity> 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<AePushVoucherLogEntity> 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<Map<String, Object>> mapList = coreService.queryDataByMdmId(createVoucherVO);//已被去重
//
// List<AePushVoucherLogEntity> allList = transData(entity.getMdmId(), mapList);
// AePushVoucherLogEntity aePushVoucherLogEntity1 = new AePushVoucherLogEntity();
// aePushVoucherLogEntity1.setMdmId(entity.getMdmId());
// List<AePushVoucherLogEntity> 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<AePushVoucherLogEntity> 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<AePushVoucherLogEntity> 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<AePushVoucherLogEntity> 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<AePushVoucherLogEntity> 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<AePushVoucherLogEntity> 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<AePushVoucherLogEntity> 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<AePushVoucherLogEntity> 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<AePushVoucherLogEntity> 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<AePushVoucherLogEnt
}
mdmDBQueryVO.setProp5(codefieldname);
mdmDBQueryVO.setPropValue5(vo.getBillCode());
mdmDBQueryVO.setPropValue5(vo.getBill_code());
mdmDBQueryVO.setProp6("project_code");
mdmDBQueryVO.setPropValue6(vo.getProjectId());
@ -417,91 +417,113 @@ public class AePushVoucherLogServiceImpl extends BaseService<AePushVoucherLogEnt
}
@Override
public List<AePushVoucherLogDetailsEntity> 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<AePushVoucherLogDetailsEntity> voucherLogDetailsEntityList = voucherLogDetailsDao.query(aePushVoucherLogDetailsEntity);
return voucherLogDetailsEntityList;
}
/**
* bill_code单据编码
* bill_date单据日期
*/
public List<AePushVoucherLogEntity> transData(String mdmId, List<Map<String, Object>> mapList) {
List<AePushVoucherLogEntity> all = new ArrayList<>();
for (Map<String, Object> 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<AePushVoucherLogEntity> 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<AePushVoucherLogEntity> query = aePushVoucherLogDao.query(aePushVoucherLogEntity1);
if (query.size() != 0) {
BeanUtils.copyProperties(query.get(0), aePushVoucherLogEntity);
public List<AePushVoucherLogDetailsEntity> queryDetailsByBillCodeAndMdmId(AePushVoucherLogEntity entity) {
List<AePushVoucherLogDetailsEntity> details=new ArrayList<>();
List<AePushVoucherLogEntity> query = aePushVoucherLogDao.query(entity);
for (AePushVoucherLogEntity aePushVoucherLogEntity : query) {
AePushVoucherLogDetailsEntity logDetailsEntity = new AePushVoucherLogDetailsEntity();
logDetailsEntity.setVoucherId(Long.valueOf(aePushVoucherLogEntity.getId()));
List<AePushVoucherLogDetailsEntity> 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<AePushVoucherLogEntity> voucherLogEntityList) {
for (AePushVoucherLogEntity aePushVoucherLogEntity : voucherLogEntityList) {
AePushVoucherLogEntity aePushVoucherLogEntity1 = new AePushVoucherLogEntity();
aePushVoucherLogEntity1.setBillCode(aePushVoucherLogEntity.getBillCode());
List<AePushVoucherLogEntity> query = aePushVoucherLogDao.query(aePushVoucherLogEntity1);
aePushVoucherLogEntity.setLogList(query);
}
}
// @Override
// public List<AePushVoucherLogDetailsEntity> 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<AePushVoucherLogDetailsEntity> 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<AePushVoucherLogEntity> 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<AePushVoucherLogEntity> transData(String mdmId, List<Map<String, Object>> mapList) {
// List<AePushVoucherLogEntity> all = new ArrayList<>();
// for (Map<String, Object> 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<AePushVoucherLogEntity> 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<AePushVoucherLogEntity> query = aePushVoucherLogDao.query(aePushVoucherLogEntity1);
// if (query.size() != 0) {
// BeanUtils.copyProperties(query.get(0), aePushVoucherLogEntity);
// }
// }
// }
//
//
// /**
// * 根据单据编码查询是否生成了多张凭证
// */
// public void queryTempType(List<AePushVoucherLogEntity> voucherLogEntityList) {
// for (AePushVoucherLogEntity aePushVoucherLogEntity : voucherLogEntityList) {
// AePushVoucherLogEntity aePushVoucherLogEntity1 = new AePushVoucherLogEntity();
// aePushVoucherLogEntity1.setBillCode(aePushVoucherLogEntity.getBillCode());
// List<AePushVoucherLogEntity> 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<AePushVoucherLogEntity> 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<MdmViewFiledVo> getFiledByType(String viewType, List<MdmModuleViewDetailEntity> mdmModuleViewDetailEntities, List<MdmModuleDbEntity> mdmModuleDbEntityList, List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntityList, List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRuleEntityList) {
List<MdmViewFiledVo> mdmViewFiledVos = new ArrayList<>();
for (int i = 0; i < mdmModuleDbEntityList.size(); i++) {