|
@@ -39,6 +39,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
|
|
|
|
import java.io.Serializable;
|
|
|
+import java.lang.reflect.Array;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
@@ -112,6 +113,11 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
entity.setDistributionPoint(detailsItem.getDistributionPoint());//分销点
|
|
|
entity.setPurOrSubOrder(detailsItem.getPurOrSubOrder());//采购委外订单号
|
|
|
entity.setFactoryUnitPrice(detailsItem.getFactoryUnitPrice());//工厂单价
|
|
|
+ if(entity.getMasterMetering().equals("KG")){//当单位为KG时
|
|
|
+ entity.setTotalPrice(entity.getNetWeight().subtract(entity.getPrice()));//净重*单价
|
|
|
+ }else{
|
|
|
+ entity.setTotalPrice(entity.getActualDeclaredQuantity().subtract(entity.getPrice()));//实际报关数量*单价
|
|
|
+ }
|
|
|
syShippingDetailsItemMapper.updateById(detailsItem);
|
|
|
syPackingListFabricItemMapper.insert(entity);
|
|
|
}
|
|
@@ -144,6 +150,11 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
//此次入库数量-剩余数量=超发数量
|
|
|
s1.setExcessQuantity(entity.getInventoryQuantity().subtract(s1.getSurplusQuantity()));
|
|
|
syShippingDetailsItemMapper.updateById(s1);*/
|
|
|
+ if(entity.getMasterMetering().equals("KG")){//当单位为KG时
|
|
|
+ entity.setTotalPrice(entity.getNetWeight().subtract(entity.getPrice()));//净重*单价
|
|
|
+ }else{
|
|
|
+ entity.setTotalPrice(entity.getActualDeclaredQuantity().subtract(entity.getPrice()));//实际报关数量*单价
|
|
|
+ }
|
|
|
entity.setId(null);
|
|
|
syPackingListFabricItemMapper.insert(entity);
|
|
|
}else{
|
|
@@ -199,7 +210,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
if(syPackingListFabricItem.getExcessQuantity().intValue()<0){
|
|
|
syPackingListFabricItem.setExcessQuantity(new BigDecimal(0));//如果超发数量为-1就写为0
|
|
|
}
|
|
|
- if(syPackingListFabricItem.getVenId().indexOf("04")>-1&&!syPackingListFabricItem.getVenId().equals("0499")){
|
|
|
+ if(syPackingListFabricItem.getVenId()!=null&&syPackingListFabricItem.getVenId().indexOf("04")>-1&&!syPackingListFabricItem.getVenId().equals("0499")){
|
|
|
//满足条件
|
|
|
SyShippingDetailsItem syShippingDetailsItem=syShippingDetailsItemMapper.selectById(syPackingListFabricItem.getSyShippingDetailsItemId());//获取出运明细子表数据
|
|
|
syPackingListFabricItem.setSupplierCodeDyeingPlant(syShippingDetailsItem.getRSupplierCode());//染厂编码
|
|
@@ -251,10 +262,10 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
/**
|
|
|
* 每3分钟拉取一次数据
|
|
|
*/
|
|
|
- @Override
|
|
|
- @Scheduled(fixedRate=1000*60*300)
|
|
|
+ //@Override
|
|
|
+ //@Scheduled(fixedRate=1000*60*300)
|
|
|
//@Transactional
|
|
|
- public void getU8Data() {
|
|
|
+ public void getU8Data2() {
|
|
|
SimpleDateFormat sf= new SimpleDateFormat("yyMMdd");
|
|
|
try{
|
|
|
QueryWrapper<DxpDataPlan> queryWrapper = new QueryWrapper<>();
|
|
@@ -341,7 +352,6 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
"c.cInvStd as specificationAndModel\n" +
|
|
|
"from rdrecord32 a \n" +
|
|
|
"left JOIN rdrecords32 b\n" +
|
|
|
-
|
|
|
"on a.id=b.id \n" +
|
|
|
"left join Inventory c\n" +
|
|
|
"on b.cInvCode=c.cInvCode\n" +
|
|
@@ -374,6 +384,11 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
sy1.setActualDeclaredQuantity(sy1.getInventoryQuantity());//给报关数量赋值
|
|
|
sy1.setGroupId(sy1.getOrderNumber()+"-"+sy1.getInventoryCode()+"-"+sy1.getSize());
|
|
|
sy1.setSyPackingListFabricId(sy.getId());//获取主表id
|
|
|
+ if(sy1.getMasterMetering().equals("KG")){//当单位为KG时
|
|
|
+ sy1.setTotalPrice(sy1.getNetWeight().subtract(sy1.getPrice()));//净重*单价
|
|
|
+ }else{
|
|
|
+ sy1.setTotalPrice(sy1.getActualDeclaredQuantity().subtract(sy1.getPrice()));//实际报关数量*单价
|
|
|
+ }
|
|
|
sy1.setU8Pid(sy.getU8Id());
|
|
|
QueryWrapper<SyShippingDetailsItem> queryWrapper2 = new QueryWrapper<>();
|
|
|
queryWrapper2.eq("sy_order_data_item_id",sy1.getIsosid());
|
|
@@ -474,4 +489,13 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //@Override
|
|
|
+ public void getU8Data(){
|
|
|
+ String[] arrs=syPackingListFabricItemMapper.getu8Data();//获取发运明细已提交的辅料
|
|
|
+ for (String arr : arrs){
|
|
|
+ System.out.println("arr\t"+arr);
|
|
|
+ }
|
|
|
+ System.out.println("arrs\n"+arrs);
|
|
|
+ }
|
|
|
}
|