|
|
|
@ -44,6 +44,7 @@ public class BasicBussinessTypeServiceImpl implements IBasicBussinessTypeService
|
|
|
|
|
public boolean insertBussinessType(BasicBussinessTypeEntity bussinessTypeEntity) {
|
|
|
|
|
//设置创建时间和更新时间数据
|
|
|
|
|
setUpdateInfo(bussinessTypeEntity);
|
|
|
|
|
setSupplementOrderType(bussinessTypeEntity);
|
|
|
|
|
return basicBussinessTypeDao.insert(bussinessTypeEntity) != 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -51,23 +52,44 @@ public class BasicBussinessTypeServiceImpl implements IBasicBussinessTypeService
|
|
|
|
|
public boolean updateBussinessType(BasicBussinessTypeEntity basicBussinessTypeEntity) {
|
|
|
|
|
//设置更新时间等数据
|
|
|
|
|
setUpdateInfo(basicBussinessTypeEntity);
|
|
|
|
|
//更新时处理补单类型逻辑
|
|
|
|
|
if (StrUtil.isBlank(basicBussinessTypeEntity.getSupplementOrderType())) {
|
|
|
|
|
//查询当前单据类型完整数据
|
|
|
|
|
BasicBussinessTypeEntity currentBusType = findByAction(basicBussinessTypeEntity.getAction());
|
|
|
|
|
//查询补单类型的数据
|
|
|
|
|
BasicBussinessTypeEntity supplementType = findByAction(currentBusType.getSupplementOrderType());
|
|
|
|
|
if (null != supplementType) {
|
|
|
|
|
supplementType.setSupplementOrderType("");
|
|
|
|
|
basicBussinessTypeDao.updateById(supplementType);
|
|
|
|
|
setSupplementOrderType(basicBussinessTypeEntity);
|
|
|
|
|
return basicBussinessTypeDao.updateById(basicBussinessTypeEntity) != 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 处理平衡补单单据类型逻辑
|
|
|
|
|
*
|
|
|
|
|
* @param basicBussinessTypeEntity
|
|
|
|
|
*/
|
|
|
|
|
private void setSupplementOrderType(BasicBussinessTypeEntity basicBussinessTypeEntity) {
|
|
|
|
|
if (null == basicBussinessTypeEntity.getId()) {
|
|
|
|
|
//处理添加新单据类型时的平衡补单逻辑
|
|
|
|
|
if (StrUtil.isNotBlank(basicBussinessTypeEntity.getSupplementOrderType())) {
|
|
|
|
|
//查询平衡补单的单据类型数据是否存在
|
|
|
|
|
BasicBussinessTypeEntity supplementType = findByAction(basicBussinessTypeEntity.getSupplementOrderType());
|
|
|
|
|
if (null != supplementType) {
|
|
|
|
|
supplementType.setSupplementOrderType(basicBussinessTypeEntity.getAction());
|
|
|
|
|
basicBussinessTypeDao.updateById(supplementType);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
//补单类型不为空,查询出补单类型数据,将对向单据设置为当前单据类型的编码
|
|
|
|
|
BasicBussinessTypeEntity supplementType = findByAction(basicBussinessTypeEntity.getSupplementOrderType());
|
|
|
|
|
supplementType.setSupplementOrderType(basicBussinessTypeEntity.getAction());
|
|
|
|
|
basicBussinessTypeDao.updateById(supplementType);
|
|
|
|
|
//更新时处理补单类型逻辑
|
|
|
|
|
if (StrUtil.isBlank(basicBussinessTypeEntity.getSupplementOrderType())) {
|
|
|
|
|
//查询当前单据类型完整数据
|
|
|
|
|
BasicBussinessTypeEntity currentBusType = findByAction(basicBussinessTypeEntity.getAction());
|
|
|
|
|
//查询补单类型的数据
|
|
|
|
|
BasicBussinessTypeEntity supplementType = findByAction(currentBusType.getSupplementOrderType());
|
|
|
|
|
if (null != supplementType) {
|
|
|
|
|
supplementType.setSupplementOrderType("");
|
|
|
|
|
basicBussinessTypeDao.updateById(supplementType);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
//补单类型不为空,查询出补单类型数据,将对向单据设置为当前单据类型的编码
|
|
|
|
|
BasicBussinessTypeEntity supplementType = findByAction(basicBussinessTypeEntity.getSupplementOrderType());
|
|
|
|
|
supplementType.setSupplementOrderType(basicBussinessTypeEntity.getAction());
|
|
|
|
|
basicBussinessTypeDao.updateById(supplementType);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return basicBussinessTypeDao.updateById(basicBussinessTypeEntity) != 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -110,12 +132,7 @@ public class BasicBussinessTypeServiceImpl implements IBasicBussinessTypeService
|
|
|
|
|
} else {
|
|
|
|
|
mainAction = ConstantType.TYPE_OUT;
|
|
|
|
|
}
|
|
|
|
|
QueryWrapper<BasicBussinessTypeEntity> query = new QueryWrapper<>();
|
|
|
|
|
query.select("name", "action")
|
|
|
|
|
.eq("mainAction", mainAction)
|
|
|
|
|
.eq("corpType", 1)
|
|
|
|
|
.isNull("supplementOrderType").or().eq("supplementOrderType", "");
|
|
|
|
|
return basicBussinessTypeDao.selectList(query);
|
|
|
|
|
return basicBussinessTypeDao.selectCandidateBusType(mainAction);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|