|
|
|
@ -1,7 +1,10 @@
|
|
|
|
|
package jnpf.service.impl;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import jnpf.entity.*;
|
|
|
|
|
import jnpf.mapper.VoucherMapper;
|
|
|
|
|
import jnpf.permission.entity.OrganizeEntity;
|
|
|
|
|
import jnpf.permission.service.OrganizeService;
|
|
|
|
|
import jnpf.service.*;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
import jnpf.model.voucher.*;
|
|
|
|
@ -45,7 +48,7 @@ import javax.annotation.Resource;
|
|
|
|
|
@Service
|
|
|
|
|
public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity> implements VoucherService{
|
|
|
|
|
@Autowired
|
|
|
|
|
private GeneraterSwapUtil generaterSwapUtil;
|
|
|
|
|
private GeneraterSwapUtil2 generaterSwapUtil;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private UserProvider userProvider;
|
|
|
|
@ -54,6 +57,8 @@ public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity
|
|
|
|
|
private VoucherProductService voucherProductService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private VoucherVehicleService voucherVehicleService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private OrganizeService organizeService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private VoucherMapper voucherMapper;
|
|
|
|
@ -243,6 +248,16 @@ public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(ObjectUtil.isNotEmpty(voucherPagination.getDeliveryType())){
|
|
|
|
|
voucherNum++;
|
|
|
|
|
|
|
|
|
|
String value = voucherPagination.getDeliveryType() instanceof List ?
|
|
|
|
|
JsonUtil.getObjectToString(voucherPagination.getDeliveryType()) :
|
|
|
|
|
String.valueOf(voucherPagination.getDeliveryType());
|
|
|
|
|
voucherQueryWrapper.like("a.delivery_type",value);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(ObjectUtil.isNotEmpty(voucherPagination.getVoucherType())){
|
|
|
|
|
voucherNum++;
|
|
|
|
|
|
|
|
|
@ -566,13 +581,21 @@ public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<VoucherEntity> queryVoucherPopupInfo(VoucherPagination voucherPagination) {
|
|
|
|
|
UserInfo userInfo=userProvider.get();
|
|
|
|
|
OrganizeEntity organizeEntity = organizeService.getInfo(userInfo.getOrganizeId());
|
|
|
|
|
List<String> organizeJsonId = Arrays.stream(organizeEntity.getCompanyIdTree().split(",")).collect(Collectors.toList());
|
|
|
|
|
String organize = JSON.toJSONString(organizeJsonId);
|
|
|
|
|
organize = organize.replace("[","");
|
|
|
|
|
organize = organize.replace("]","");
|
|
|
|
|
QueryWrapper<VoucherEntity> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
queryWrapper.eq("a.business_type",voucherPagination.getBusinessType());
|
|
|
|
|
queryWrapper.eq("a.document_type",voucherPagination.getDocumentType());
|
|
|
|
|
queryWrapper.eq("voucher_status","4");
|
|
|
|
|
queryWrapper.eq("a.voucher_status","4");
|
|
|
|
|
queryWrapper.notIn(ObjectUtils.isNotEmpty(voucherPagination.getExcludeIdList()),"a.id",voucherPagination.getExcludeIdList());
|
|
|
|
|
queryWrapper.in(ObjectUtils.isNotEmpty(voucherPagination.getProductIdList()),"c.product_id",voucherPagination.getProductIdList());
|
|
|
|
|
queryWrapper.isNull("a.f_delete_mark");
|
|
|
|
|
queryWrapper.inSql("a.id", "SELECT f_process_id FROM flow_task WHERE f_status = '2'");//通过审核的订单
|
|
|
|
|
queryWrapper.like("a.organize_json_id",organize);
|
|
|
|
|
Page<VoucherEntity> page=new Page<>(voucherPagination.getCurrentPage(), voucherPagination.getPageSize());
|
|
|
|
|
IPage<VoucherEntity> voucherEntityIPage = voucherMapper.queryVoucherPopup(page,queryWrapper,voucherPagination.getBusinessType(),voucherPagination.getDocumentType());
|
|
|
|
|
return voucherPagination.setData(voucherEntityIPage.getRecords(),voucherEntityIPage.getTotal());
|
|
|
|
@ -580,13 +603,21 @@ public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<VoucherEntity> queryVoucherPopupByReturnInfo(VoucherPagination voucherPagination) {
|
|
|
|
|
UserInfo userInfo=userProvider.get();
|
|
|
|
|
OrganizeEntity organizeEntity = organizeService.getInfo(userInfo.getOrganizeId());
|
|
|
|
|
List<String> organizeJsonId = Arrays.stream(organizeEntity.getCompanyIdTree().split(",")).collect(Collectors.toList());
|
|
|
|
|
String organize = JSON.toJSONString(organizeJsonId);
|
|
|
|
|
organize = organize.replace("[","");
|
|
|
|
|
organize = organize.replace("]","");
|
|
|
|
|
QueryWrapper<VoucherEntity> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
queryWrapper.eq("a.business_type",voucherPagination.getBusinessType());
|
|
|
|
|
queryWrapper.eq("a.document_type",voucherPagination.getDocumentType());
|
|
|
|
|
queryWrapper.eq("voucher_status","4");
|
|
|
|
|
queryWrapper.eq("a.voucher_status","4");
|
|
|
|
|
queryWrapper.notIn(ObjectUtils.isNotEmpty(voucherPagination.getExcludeIdList()),"a.id",voucherPagination.getExcludeIdList());
|
|
|
|
|
queryWrapper.in(ObjectUtils.isNotEmpty(voucherPagination.getProductIdList()),"c.product_id",voucherPagination.getProductIdList());
|
|
|
|
|
queryWrapper.isNull("a.f_delete_mark");
|
|
|
|
|
queryWrapper.inSql("a.id", "SELECT f_process_id FROM flow_task WHERE f_status = '2'");//通过审核的订单
|
|
|
|
|
queryWrapper.like("a.organize_json_id",organize);
|
|
|
|
|
Page<VoucherEntity> page=new Page<>(voucherPagination.getCurrentPage(), voucherPagination.getPageSize());
|
|
|
|
|
IPage<VoucherEntity> voucherEntityIPage = voucherMapper.queryVoucherPopupByReturn(page,queryWrapper,voucherPagination.getBusinessType(),voucherPagination.getDocumentType());
|
|
|
|
|
return voucherPagination.setData(voucherEntityIPage.getRecords(),voucherEntityIPage.getTotal());
|
|
|
|
@ -594,13 +625,21 @@ public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<VoucherEntity> queryVoucherPopupByDeliveryInfo(VoucherPagination voucherPagination) {
|
|
|
|
|
UserInfo userInfo=userProvider.get();
|
|
|
|
|
OrganizeEntity organizeEntity = organizeService.getInfo(userInfo.getOrganizeId());
|
|
|
|
|
List<String> organizeJsonId = Arrays.stream(organizeEntity.getCompanyIdTree().split(",")).collect(Collectors.toList());
|
|
|
|
|
String organize = JSON.toJSONString(organizeJsonId);
|
|
|
|
|
organize = organize.replace("[","");
|
|
|
|
|
organize = organize.replace("]","");
|
|
|
|
|
QueryWrapper<VoucherEntity> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
queryWrapper.eq("a.business_type",voucherPagination.getBusinessType());
|
|
|
|
|
queryWrapper.eq("a.document_type",voucherPagination.getDocumentType());
|
|
|
|
|
queryWrapper.eq("voucher_status","4");
|
|
|
|
|
queryWrapper.eq("a.voucher_status","4");
|
|
|
|
|
queryWrapper.notIn(ObjectUtils.isNotEmpty(voucherPagination.getExcludeIdList()),"a.id",voucherPagination.getExcludeIdList());
|
|
|
|
|
queryWrapper.in(ObjectUtils.isNotEmpty(voucherPagination.getProductIdList()),"c.product_id",voucherPagination.getProductIdList());
|
|
|
|
|
queryWrapper.isNull("a.f_delete_mark");
|
|
|
|
|
queryWrapper.inSql("a.id", "SELECT f_process_id FROM flow_task WHERE f_status = '2'");//通过审核的订单
|
|
|
|
|
queryWrapper.like("a.organize_json_id",organize);
|
|
|
|
|
Page<VoucherEntity> page=new Page<>(voucherPagination.getCurrentPage(), voucherPagination.getPageSize());
|
|
|
|
|
IPage<VoucherEntity> voucherEntityIPage = voucherMapper.queryVoucherPopupByDelivery(page,queryWrapper,voucherPagination.getBusinessType(),voucherPagination.getDocumentType());
|
|
|
|
|
return voucherPagination.setData(voucherEntityIPage.getRecords(),voucherEntityIPage.getTotal());
|
|
|
|
@ -608,6 +647,12 @@ public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<VoucherEntity> queryInspectionVoucherPopupInfo(VoucherPagination voucherPagination) {
|
|
|
|
|
UserInfo userInfo=userProvider.get();
|
|
|
|
|
OrganizeEntity organizeEntity = organizeService.getInfo(userInfo.getOrganizeId());
|
|
|
|
|
List<String> organizeJsonId = Arrays.stream(organizeEntity.getCompanyIdTree().split(",")).collect(Collectors.toList());
|
|
|
|
|
String organize = JSON.toJSONString(organizeJsonId);
|
|
|
|
|
organize = organize.replace("[","");
|
|
|
|
|
organize = organize.replace("]","");
|
|
|
|
|
QueryWrapper<VoucherEntity> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
// queryWrapper.eq("a.business_type",voucherPagination.getBusinessType());
|
|
|
|
|
queryWrapper.eq("a.document_type",voucherPagination.getDocumentType());
|
|
|
|
@ -615,6 +660,8 @@ public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity
|
|
|
|
|
queryWrapper.notIn(ObjectUtils.isNotEmpty(voucherPagination.getExcludeIdList()),"a.id",voucherPagination.getExcludeIdList());
|
|
|
|
|
queryWrapper.in(ObjectUtils.isNotEmpty(voucherPagination.getProductIdList()),"c.product_id",voucherPagination.getProductIdList());
|
|
|
|
|
queryWrapper.isNull("a.f_delete_mark");
|
|
|
|
|
queryWrapper.inSql("a.id", "SELECT f_process_id FROM flow_task WHERE f_status = '2'");//通过审核的订单
|
|
|
|
|
queryWrapper.like("a.organize_json_id",organize);
|
|
|
|
|
Page<VoucherEntity> page=new Page<>(voucherPagination.getCurrentPage(), voucherPagination.getPageSize());
|
|
|
|
|
IPage<VoucherEntity> voucherEntityIPage = voucherMapper.queryVoucherPopup1(page,queryWrapper);
|
|
|
|
|
return voucherPagination.setData(voucherEntityIPage.getRecords(),voucherEntityIPage.getTotal());
|
|
|
|
@ -622,12 +669,20 @@ public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<VoucherEntity> queryNotificationVoucherPopupInfo(VoucherPagination voucherPagination) {
|
|
|
|
|
UserInfo userInfo=userProvider.get();
|
|
|
|
|
OrganizeEntity organizeEntity = organizeService.getInfo(userInfo.getOrganizeId());
|
|
|
|
|
List<String> organizeJsonId = Arrays.stream(organizeEntity.getCompanyIdTree().split(",")).collect(Collectors.toList());
|
|
|
|
|
String organize = JSON.toJSONString(organizeJsonId);
|
|
|
|
|
organize = organize.replace("[","");
|
|
|
|
|
organize = organize.replace("]","");
|
|
|
|
|
QueryWrapper<VoucherEntity> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
queryWrapper.eq("b.product_id",voucherPagination.getProductId());
|
|
|
|
|
queryWrapper.eq("a.voucher_status","4");
|
|
|
|
|
queryWrapper.notIn(ObjectUtils.isNotEmpty(voucherPagination.getExcludeIdList()),"a.id",voucherPagination.getExcludeIdList());
|
|
|
|
|
queryWrapper.in(ObjectUtils.isNotEmpty(voucherPagination.getProductIdList()),"b.product_id",voucherPagination.getProductIdList());
|
|
|
|
|
queryWrapper.isNull("a.f_delete_mark");
|
|
|
|
|
queryWrapper.inSql("a.id", "SELECT f_process_id FROM flow_task WHERE f_status = '2'");//通过审核的订单
|
|
|
|
|
queryWrapper.like("a.organize_json_id",organize);
|
|
|
|
|
Page<VoucherEntity> page=new Page<>(voucherPagination.getCurrentPage(), voucherPagination.getPageSize());
|
|
|
|
|
IPage<VoucherEntity> voucherEntityIPage = voucherMapper.queryVoucherNotification(page,queryWrapper);
|
|
|
|
|
return voucherPagination.setData(voucherEntityIPage.getRecords(),voucherEntityIPage.getTotal());
|
|
|
|
@ -636,17 +691,35 @@ public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<VoucherEntity> querySaleReceiptVoucherInfo() {
|
|
|
|
|
return voucherMapper.querySaleReceiptVoucher();
|
|
|
|
|
UserInfo userInfo=userProvider.get();
|
|
|
|
|
OrganizeEntity organizeEntity = organizeService.getInfo(userInfo.getOrganizeId());
|
|
|
|
|
List<String> organizeJsonId = Arrays.stream(organizeEntity.getCompanyIdTree().split(",")).collect(Collectors.toList());
|
|
|
|
|
String organize = JSON.toJSONString(organizeJsonId);
|
|
|
|
|
organize = organize.replace("[","");
|
|
|
|
|
organize = organize.replace("]","");
|
|
|
|
|
return voucherMapper.querySaleReceiptVoucher(organize);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<VoucherEntity> queryPurchaseReceiptVoucherInfo() {
|
|
|
|
|
return voucherMapper.queryPurchaseReceiptVoucher();
|
|
|
|
|
UserInfo userInfo=userProvider.get();
|
|
|
|
|
OrganizeEntity organizeEntity = organizeService.getInfo(userInfo.getOrganizeId());
|
|
|
|
|
List<String> organizeJsonId = Arrays.stream(organizeEntity.getCompanyIdTree().split(",")).collect(Collectors.toList());
|
|
|
|
|
String organize = JSON.toJSONString(organizeJsonId);
|
|
|
|
|
organize = organize.replace("[","");
|
|
|
|
|
organize = organize.replace("]","");
|
|
|
|
|
return voucherMapper.queryPurchaseReceiptVoucher(organize);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<VoucherEntity> queryPurchaseDeliveryVoucherInfo() {
|
|
|
|
|
return voucherMapper.queryPurchaseDeliveryVoucher();
|
|
|
|
|
UserInfo userInfo=userProvider.get();
|
|
|
|
|
OrganizeEntity organizeEntity = organizeService.getInfo(userInfo.getOrganizeId());
|
|
|
|
|
List<String> organizeJsonId = Arrays.stream(organizeEntity.getCompanyIdTree().split(",")).collect(Collectors.toList());
|
|
|
|
|
String organize = JSON.toJSONString(organizeJsonId);
|
|
|
|
|
organize = organize.replace("[","");
|
|
|
|
|
organize = organize.replace("]","");
|
|
|
|
|
return voucherMapper.queryPurchaseDeliveryVoucher(organize);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|