|
|
@ -3,14 +3,12 @@ package jnpf.service.impl;
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
|
|
|
import com.mysql.cj.x.protobuf.MysqlxExpr;
|
|
|
|
import com.taobao.api.internal.toplink.Pool;
|
|
|
|
import com.taobao.api.internal.toplink.Pool;
|
|
|
|
import jnpf.config.ConfigValueUtil;
|
|
|
|
import jnpf.config.ConfigValueUtil;
|
|
|
|
import jnpf.engine.entity.FlowTaskEntity;
|
|
|
|
import jnpf.engine.entity.FlowTaskEntity;
|
|
|
|
import jnpf.entity.*;
|
|
|
|
import jnpf.entity.*;
|
|
|
|
import jnpf.mapper.BusinessOrderMapper;
|
|
|
|
import jnpf.mapper.*;
|
|
|
|
import jnpf.mapper.BusinessOrderProductRelationalMapper;
|
|
|
|
|
|
|
|
import jnpf.mapper.InventoryMapper;
|
|
|
|
|
|
|
|
import jnpf.mapper.VoucherMapper;
|
|
|
|
|
|
|
|
import jnpf.model.yunguan.YunguanPurchaseOrderModel;
|
|
|
|
import jnpf.model.yunguan.YunguanPurchaseOrderModel;
|
|
|
|
import jnpf.model.yunguan.YunguanPurchaseOrderProductModel;
|
|
|
|
import jnpf.model.yunguan.YunguanPurchaseOrderProductModel;
|
|
|
|
import jnpf.model.yunguan.YunguanSaleOrderModel;
|
|
|
|
import jnpf.model.yunguan.YunguanSaleOrderModel;
|
|
|
@ -65,6 +63,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import jnpf.util.*;
|
|
|
|
import jnpf.util.*;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
import java.util.stream.Stream;
|
|
|
|
|
|
|
|
|
|
|
|
import jnpf.base.UserInfo;
|
|
|
|
import jnpf.base.UserInfo;
|
|
|
|
import jnpf.permission.entity.UserEntity;
|
|
|
|
import jnpf.permission.entity.UserEntity;
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
@ -116,6 +116,8 @@ public class BusinessOrderServiceImpl extends ServiceImpl<BusinessOrderMapper, B
|
|
|
|
private ContractLService contractLService;
|
|
|
|
private ContractLService contractLService;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private SubjectbasicService subjectbasicService;
|
|
|
|
private SubjectbasicService subjectbasicService;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private VoucherProductMapper voucherProductMapper;
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<BusinessOrderEntity> getList(BusinessOrderPagination businessOrderPagination){
|
|
|
|
public List<BusinessOrderEntity> getList(BusinessOrderPagination businessOrderPagination){
|
|
|
@ -889,6 +891,9 @@ public class BusinessOrderServiceImpl extends ServiceImpl<BusinessOrderMapper, B
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<ProductWarehouseEntity> orderByVoucherInfo(List<String> voucherIds) {
|
|
|
|
public List<ProductWarehouseEntity> orderByVoucherInfo(List<String> voucherIds) {
|
|
|
|
List<ProductWarehouseEntity> productWarehouseEntityList = businessOrderMapper.orderByVoucher(voucherIds);
|
|
|
|
List<ProductWarehouseEntity> productWarehouseEntityList = businessOrderMapper.orderByVoucher(voucherIds);
|
|
|
|
|
|
|
|
for (ProductWarehouseEntity entity : productWarehouseEntityList){
|
|
|
|
|
|
|
|
entity.setVoucherProductId(Collections.singletonList(entity.getVoucherProductIds()));
|
|
|
|
|
|
|
|
}
|
|
|
|
productWarehouseEntityList = productWarehouseEntityList.stream().collect(Collectors.toMap(s-> s.getId()+";"+s.getUnit()+";"+s.getOrderNo(),a->a,(o1,o2) -> {
|
|
|
|
productWarehouseEntityList = productWarehouseEntityList.stream().collect(Collectors.toMap(s-> s.getId()+";"+s.getUnit()+";"+s.getOrderNo(),a->a,(o1,o2) -> {
|
|
|
|
o1.setNetWeight(o1.getNetWeight().add(o2.getNetWeight()));
|
|
|
|
o1.setNetWeight(o1.getNetWeight().add(o2.getNetWeight()));
|
|
|
|
o1.setGrossWeight(o1.getGrossWeight().add(o2.getGrossWeight()));
|
|
|
|
o1.setGrossWeight(o1.getGrossWeight().add(o2.getGrossWeight()));
|
|
|
@ -896,6 +901,7 @@ public class BusinessOrderServiceImpl extends ServiceImpl<BusinessOrderMapper, B
|
|
|
|
o1.setBuckleWeight(o1.getBuckleWeight().add(o2.getBuckleWeight()));
|
|
|
|
o1.setBuckleWeight(o1.getBuckleWeight().add(o2.getBuckleWeight()));
|
|
|
|
o1.setPurchaseAmount(o1.getPurchaseAmount().add(o2.getPurchaseAmount()));
|
|
|
|
o1.setPurchaseAmount(o1.getPurchaseAmount().add(o2.getPurchaseAmount()));
|
|
|
|
o1.setSaleAmount(o1.getSaleAmount().add(o2.getSaleAmount()));
|
|
|
|
o1.setSaleAmount(o1.getSaleAmount().add(o2.getSaleAmount()));
|
|
|
|
|
|
|
|
o1.setVoucherProductId(Stream.concat(o1.getVoucherProductId().stream(),o2.getVoucherProductId().stream()).collect(Collectors.toList()));
|
|
|
|
return o1;
|
|
|
|
return o1;
|
|
|
|
})).values().stream().collect(Collectors.toList());
|
|
|
|
})).values().stream().collect(Collectors.toList());
|
|
|
|
return productWarehouseEntityList;
|
|
|
|
return productWarehouseEntityList;
|
|
|
@ -1111,12 +1117,8 @@ public class BusinessOrderServiceImpl extends ServiceImpl<BusinessOrderMapper, B
|
|
|
|
planReceiptNum = planReceiptNum.add(entitys.getBusinessNum());
|
|
|
|
planReceiptNum = planReceiptNum.add(entitys.getBusinessNum());
|
|
|
|
entitys.setId(RandomUtil.uuId());
|
|
|
|
entitys.setId(RandomUtil.uuId());
|
|
|
|
entitys.setBusinessOrderId(entity.getId());
|
|
|
|
entitys.setBusinessOrderId(entity.getId());
|
|
|
|
if (StringUtils.isNotEmpty(entitys.getOrderNo())){
|
|
|
|
|
|
|
|
entitys.setOrdLn(entitys.getOrderNo());
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
entitys.setOrdLn(String.valueOf(line)); //运管订单行号
|
|
|
|
entitys.setOrdLn(String.valueOf(line)); //运管订单行号
|
|
|
|
line++;
|
|
|
|
line++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(isSave){
|
|
|
|
if(isSave){
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1130,6 +1132,16 @@ public class BusinessOrderServiceImpl extends ServiceImpl<BusinessOrderMapper, B
|
|
|
|
voucherMapper.updateById(voucherEntity);
|
|
|
|
voucherMapper.updateById(voucherEntity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//更新凭证单子表与订单子表对应
|
|
|
|
|
|
|
|
if (entitys.getVoucherProductId() != null && entitys.getVoucherProductId().size()>0){
|
|
|
|
|
|
|
|
for (String voucherProductId : entitys.getVoucherProductId()) {
|
|
|
|
|
|
|
|
VoucherProductEntity voucherProductEntity = voucherProductMapper.selectById(voucherProductId);
|
|
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(voucherProductEntity)) {
|
|
|
|
|
|
|
|
voucherProductEntity.setOrderLineId(entitys.getOrdLn());
|
|
|
|
|
|
|
|
voucherProductMapper.updateById(voucherProductEntity);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//更新采购订单的计划收货数量
|
|
|
|
//更新采购订单的计划收货数量
|
|
|
|
entity.setPlanPurchaseNum(planReceiptNum);
|
|
|
|
entity.setPlanPurchaseNum(planReceiptNum);
|
|
|
|