|
@@ -139,13 +139,11 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
entity.setPrice(detailsItem.getSalesUnitPrice());//单价
|
|
|
entity.setFactoryUnitPrice(detailsItem.getFactoryUnitPrice());//工厂单价
|
|
|
entity.setTotalPrice(entity.getActualDeclaredQuantity().multiply(entity.getPrice()));//实际报关数量*单价
|
|
|
- if((entity.getInventoryCode().indexOf("03")!=-1&&!entity.getInventoryCode().equals("0399")) ||
|
|
|
+ if((entity.getInventoryCcode().indexOf("03")!=-1&&!entity.getInventoryCcode().equals("0399")) ||
|
|
|
(entity.getInventoryCcode().indexOf("02")!=-1&&!entity.getInventoryCcode().equals("0299"))||
|
|
|
- (entity.getInventoryCode().indexOf("04")!=-1&&!entity.getInventoryCode().equals("0499"))){
|
|
|
+ (entity.getInventoryCcode().indexOf("04")!=-1&&!entity.getInventoryCcode().equals("0499"))){
|
|
|
if(entity.getMasterMetering()!=null&&entity.getMasterMetering().equals("KG")){//当单位为KG时
|
|
|
entity.setTotalPrice(entity.getNetWeight().multiply(entity.getPrice()));//净重*单价
|
|
|
- }else if(entity.getMasterMetering()!=null&&entity.getMasterMetering().equals("M")){
|
|
|
- entity.setTotalPrice(entity.getMeter().multiply(entity.getPrice()));//净重*单价
|
|
|
}
|
|
|
}
|
|
|
syShippingDetailsItemMapper.updateById(detailsItem);
|
|
@@ -171,6 +169,15 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
//外键设置
|
|
|
entity.setSyPackingListFabricId(syPackingListFabric.getId());
|
|
|
entity.setInventoryQuantity(entity.getActualDeclaredQuantity());//入库数量=实际报关数量
|
|
|
+ entity.setTotalPrice(entity.getActualDeclaredQuantity().multiply(entity.getPrice()));//实际报关数量*单价
|
|
|
+ if((entity.getInventoryCcode().indexOf("03")!=-1&&!entity.getInventoryCcode().equals("0399")) ||
|
|
|
+ (entity.getInventoryCcode().indexOf("02")!=-1&&!entity.getInventoryCcode().equals("0299"))||
|
|
|
+ (entity.getInventoryCcode().indexOf("04")!=-1&&!entity.getInventoryCcode().equals("0499"))){
|
|
|
+ if(entity!=null&&entity.getMasterMetering().equals("KG")){//当面料的单位为KG时
|
|
|
+ entity.setTotalPrice(entity.getNetWeight().multiply(entity.getPrice()));//净重*单价
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if(entity.getIsAdd()>0){//大于1就是新增数据
|
|
|
//因为云工厂得修改时得停止调用前面接口
|
|
|
/*SyShippingDetailsItem s1 =syShippingDetailsItemMapper.selectById(entity.getSyShippingDetailsItemId());
|
|
@@ -178,17 +185,18 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
s1.setSurplusQuantity(s1.getSurplusQuantity().subtract(entity.getInventoryQuantity()));
|
|
|
//此次入库数量-剩余数量=超发数量
|
|
|
s1.setExcessQuantity(entity.getInventoryQuantity().subtract(s1.getSurplusQuantity()));
|
|
|
- syShippingDetailsItemMapper.updateById(s1);*/
|
|
|
+ syShippingDetailsItemMapper.updateById(s1);
|
|
|
entity.setTotalPrice(entity.getActualDeclaredQuantity().multiply(entity.getPrice()));//实际报关数量*单价
|
|
|
- if((entity.getInventoryCode().indexOf("03")!=-1&&!entity.getInventoryCode().equals("0399")) ||
|
|
|
+ if((entity.getInventoryCcode().indexOf("03")!=-1&&!entity.getInventoryCcode().equals("0399")) ||
|
|
|
(entity.getInventoryCcode().indexOf("02")!=-1&&!entity.getInventoryCcode().equals("0299"))||
|
|
|
- (entity.getInventoryCode().indexOf("04")!=-1&&!entity.getInventoryCode().equals("0499"))){
|
|
|
+ (entity.getInventoryCcode().indexOf("04")!=-1&&!entity.getInventoryCcode().equals("0499"))){
|
|
|
if(entity!=null&&entity.getMasterMetering().equals("KG")){//当单位为KG时
|
|
|
entity.setTotalPrice(entity.getNetWeight().multiply(entity.getPrice()));//净重*单价
|
|
|
- }else if(entity!=null&&entity.getMasterMetering().equals("M")){
|
|
|
- entity.setTotalPrice(entity.getMeter().multiply(entity.getPrice()));//净重*单价
|
|
|
}
|
|
|
- }
|
|
|
+ else if(entity!=null&&entity.getMasterMetering().equals("M")){
|
|
|
+ entity.setTotalPrice(entity.getMeter().multiply(entity.getPrice()));//米数*单价
|
|
|
+ }
|
|
|
+ }*/
|
|
|
entity.setId(null);
|
|
|
syPackingListFabricItemMapper.insert(entity);
|
|
|
}else{
|
|
@@ -366,7 +374,6 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
SyShippingDetailsItem item=syShippingDetailsItemMapper.selectById(s1.getSyShippingDetailsItemId());
|
|
|
if(item!=null){
|
|
|
//规格型号 超发 发运明细剩余数量 业务部门 价格 总价(计算)
|
|
|
-
|
|
|
s1.setSyOrderDataItemId(item.getSyOrderDataItemId());
|
|
|
s1.setSyOrderDataId(item.getSyOrderDataId());
|
|
|
s1.setSalesDepartment(item.getSalesDepartment());//业务部门
|
|
@@ -378,23 +385,23 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
syPackingListFabric.setSyDeclarationElementsId(item.getShippingDetailsId());//出运明细主表id
|
|
|
s1.setSpecificationAndModel(item.getSpecificationAndModel());//规格型号
|
|
|
s1.setAccount(item.getAccount());
|
|
|
+ s1.setOrderNumber(item.getOrderNumber());
|
|
|
if(s1.getActualDeclaredQuantity()!=null){
|
|
|
s1.setTotalPrice(s1.getActualDeclaredQuantity().multiply(s1.getPrice()));//实际报关数量*单价
|
|
|
}
|
|
|
if((s1.getInventoryCcode().indexOf("03")!=-1&&!s1.getInventoryCcode().equals("0399")) ||
|
|
|
(s1.getInventoryCcode().indexOf("02")!=-1&&!s1.getInventoryCcode().equals("0299"))||
|
|
|
(s1.getInventoryCcode().indexOf("04")!=-1&&!s1.getInventoryCcode().equals("0499"))){
|
|
|
- if(s1.getMasterMetering()!=null&&s1.getMasterMetering().equals("KG")){//当单位为KG时
|
|
|
+ if(s1.getMasterMetering()!=null&&s1.getMasterMetering().equals("KG")){//当面料的单位为KG时
|
|
|
s1.setTotalPrice(s1.getNetWeight().multiply(s1.getPrice()));//净重*单价
|
|
|
-
|
|
|
-
|
|
|
s1.setActualDeclaredQuantity(s1.getNetWeight());//净重为报关数量
|
|
|
- }else if(s1.getMasterMetering()!=null&&s1.getMasterMetering().equals("M")){
|
|
|
+ }
|
|
|
+ /*else if(s1.getMasterMetering()!=null&&s1.getMasterMetering().equals("M")){
|
|
|
if(s1.getMeter()!=null){
|
|
|
s1.setTotalPrice(s1.getMeter().multiply(s1.getPrice()));//米数*单价
|
|
|
s1.setActualDeclaredQuantity(s1.getNetWeight());//净重为报关数量
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
}
|
|
|
if(item.getInventoryCcode()!=null&&item.getInventoryCcode().indexOf("04")>-1
|
|
|
&&!item.getInventoryCcode().equals("0499")){
|
|
@@ -461,19 +468,20 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
item.setPrice(syShippingDetailsItem.getSalesUnitPrice());
|
|
|
item.setTotalPrice(item.getActualDeclaredQuantity().multiply(syShippingDetailsItem.getSalesUnitPrice()));//实际报关数量*单价
|
|
|
}
|
|
|
- if((syShippingDetailsItem.getInventoryCode().indexOf("03")!=-1&&!syShippingDetailsItem.getInventoryCode().equals("0399")) ||
|
|
|
+ if((syShippingDetailsItem.getInventoryCcode().indexOf("03")!=-1&&!syShippingDetailsItem.getInventoryCcode().equals("0399")) ||
|
|
|
(syShippingDetailsItem.getInventoryCcode().indexOf("02")!=-1&&!syShippingDetailsItem.getInventoryCcode().equals("0299"))||
|
|
|
- (syShippingDetailsItem.getInventoryCode().indexOf("04")!=-1&&!syShippingDetailsItem.getInventoryCode().equals("0499"))){
|
|
|
+ (syShippingDetailsItem.getInventoryCcode().indexOf("04")!=-1&&!syShippingDetailsItem.getInventoryCcode().equals("0499"))){
|
|
|
if( item.getMasterMetering().equals("KG")){//当单位为KG时
|
|
|
item.setTotalPrice(item.getNetWeight().multiply(syShippingDetailsItem.getSalesUnitPrice()));//净重*单价
|
|
|
item.setActualDeclaredQuantity(item.getNetWeight());
|
|
|
- }else if( item.getMasterMetering().equals("M")){
|
|
|
+ }
|
|
|
+ /*else if( item.getMasterMetering().equals("M")){
|
|
|
if(item.getMeter()==null){
|
|
|
throw new JeecgBootException("净重、门幅、克重之间有值为空,无法获取米数计算总价");
|
|
|
}
|
|
|
item.setTotalPrice(item.getMeter().multiply(syShippingDetailsItem.getSalesUnitPrice()));//米数*单价
|
|
|
item.setActualDeclaredQuantity(item.getMeter());
|
|
|
- }
|
|
|
+ }*/
|
|
|
}
|
|
|
item.setInventoryCcode(syShippingDetailsItem.getInventoryCcode());//物料分类
|
|
|
item.setInventoryCode(syShippingDetailsItem.getInventoryCode());//物料编码
|
|
@@ -504,6 +512,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
item.setComposition(syShippingDetailsItem.getInventoryName());//成分/Composition
|
|
|
item.setDelFlag("0");//是否删除
|
|
|
item.setSyPackingListFabricId(syPackingListFabric.getId());
|
|
|
+ item.setOrderNumber(syShippingDetailsItem.getOrderNumber());
|
|
|
syPackingListFabricItemMapper.insert(item);
|
|
|
}
|
|
|
}
|
|
@@ -550,6 +559,10 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if(item.getActualDeclaredQuantity()!=null){//其他
|
|
|
+ item.setTotalPrice(item.getActualDeclaredQuantity().multiply(item.getPrice()));//米数*单价
|
|
|
+ }
|
|
|
+
|
|
|
if(item!=null&&item.getMasterMetering().equals("KG")){//KG
|
|
|
item.setTotalPrice(item.getNetWeight().multiply(item.getPrice()));//净重*单价
|
|
|
item.setActualDeclaredQuantity(item.getNetWeight());
|
|
@@ -557,10 +570,8 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
if(item.getMeter()==null){
|
|
|
throw new JeecgBootException("净重、门幅、克重之间有值为空,无法计算米数");
|
|
|
}
|
|
|
- item.setActualDeclaredQuantity(item.getMeter());
|
|
|
+ //item.setActualDeclaredQuantity(item.getMeter());
|
|
|
item.setTotalPrice(item.getMeter().multiply(item.getPrice()));//米数*单价
|
|
|
- }else if(item.getActualDeclaredQuantity()!=null){//其他
|
|
|
- item.setTotalPrice(item.getActualDeclaredQuantity().multiply(item.getPrice()));//米数*单价
|
|
|
}else{
|
|
|
throw new JeecgBootException("请给单位不为KG或者M的面辅料填上实际报关数量");
|
|
|
}
|
|
@@ -1342,22 +1353,20 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
"f.iTaxUnitPrice as price,\n" +
|
|
|
"d.cPersonName as salesman,\n" +
|
|
|
"b.cDefine22 as itemNumber,\n" +
|
|
|
- "b.cFree6 as gramWeight,\n" +
|
|
|
-
|
|
|
+ "b.cFree6 as gramWeight,\n" +//克重
|
|
|
|
|
|
"b.cDefine26 as netWeight,\n" +//净重
|
|
|
"b.cDefine27 as grossWeight,\n" +//毛重
|
|
|
"b.cDefine35 as rolls,\n" +//箱数
|
|
|
- "b.cDefine35 as size,\n" +//箱数
|
|
|
|
|
|
- "b.cFree1 as colour,\n" +
|
|
|
+ "b.cFree1 as colour,\n" +//颜色
|
|
|
"b.cInvCode as inventoryCode,\n" +
|
|
|
"c.cInvName as inventoryName,\n" +
|
|
|
"c.cInvName as composition,\n" +
|
|
|
"b.cFree2 as size ,\n" +
|
|
|
- "f.cDefine35 as rolls,\n" +
|
|
|
+ //"f.cDefine35 as rolls,\n" +
|
|
|
"e.cComUnitName as masterMetering,\n" +
|
|
|
- "b.cFree4 as width,\n" +
|
|
|
+ "b.cFree4 as width,\n" +//门幅
|
|
|
"c.cInvStd as specificationAndModel\n" +
|
|
|
"from rdrecord32 a \n" +
|
|
|
"left JOIN rdrecords32 b\n" +
|
|
@@ -1434,6 +1443,52 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
if(sy1.getPrice()!=null&&sy1.getActualDeclaredQuantity()!=null){
|
|
|
sy1.setTotalPrice(sy1.getActualDeclaredQuantity().multiply(sy1.getPrice()));//实际报关数量*单价
|
|
|
}
|
|
|
+
|
|
|
+ if((sy1.getInventoryCcode().indexOf("03")!=-1&&!sy1.getInventoryCcode().equals("0399")) ||
|
|
|
+ (sy1.getInventoryCcode().indexOf("02")!=-1&&!sy1.getInventoryCcode().equals("0299"))||
|
|
|
+ (sy1.getInventoryCcode().indexOf("04")!=-1&&!sy1.getInventoryCcode().equals("0499"))){
|
|
|
+ if(sy1.getMasterMetering()!=null&&sy1.getMasterMetering().equals("KG")){//当单位为KG时,需要计算米数
|
|
|
+ sy1.setTotalPrice(sy1.getNetWeight().multiply(sy1.getPrice()));//净重*单价
|
|
|
+
|
|
|
+ if(syShippingDetailsItem.getWeight()!=null&& syShippingDetailsItem.getWeight().length() >1){//获取克重
|
|
|
+ if(syShippingDetailsItem.getWeight().indexOf("克")>0){//包含克重
|
|
|
+ sy1.setGramWeight(syShippingDetailsItem.getWeight().substring(0,syShippingDetailsItem.getWeight().length()-1));
|
|
|
+ }else{
|
|
|
+ sy1.setGramWeight(syShippingDetailsItem.getWeight());
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ sy1.setGramWeight("0");//设置为0
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if(syShippingDetailsItem.getGuangpeiGateWidth()!=null&& syShippingDetailsItem.getGuangpeiGateWidth().length() >1){//获取门幅
|
|
|
+ if(isNumeric(syShippingDetailsItem.getGuangpeiGateWidth())){// 验证门幅
|
|
|
+ sy1.setWidth(syShippingDetailsItem.getGuangpeiGateWidth());
|
|
|
+ }else{
|
|
|
+ sy1.setWidth("0");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ sy1.setGramWeight("0");//设置为0
|
|
|
+ }
|
|
|
+
|
|
|
+ if(sy1.getNetWeight()!=null&&sy1.getGramWeight()!=null&&sy1.getWidth()!=null){
|
|
|
+ BigDecimal netWeight=sy1.getNetWeight();//净重
|
|
|
+ BigDecimal gramWeight=new BigDecimal(sy1.getGramWeight());//克重
|
|
|
+ BigDecimal width=new BigDecimal(sy1.getWidth());//门幅
|
|
|
+ if(gramWeight.intValue()==0||width.intValue()==0||netWeight.intValue()==0){
|
|
|
+
|
|
|
+ }else{
|
|
|
+ BigDecimal meter=netWeight.multiply(gramWeight).multiply(width).divide(new BigDecimal("100000"));//米数
|
|
|
+ sy1.setMeter(meter);//米数
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }else{//当单位为其他的时
|
|
|
+ sy1.setMeter(sy1.getActualDeclaredQuantity());//米数赋值u8出库单数量
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
items.add(sy1);
|
|
|
syShippingDetailsItem.setIsPull("2");//拉取成功
|
|
|
syShippingDetailsItemMapper.updateById(syShippingDetailsItem);//修改
|
|
@@ -1469,4 +1524,14 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
}
|
|
|
return "成功添加了"+num+"条数据!";
|
|
|
}
|
|
|
+
|
|
|
+ public static boolean isNumeric(String str) {
|
|
|
+ String bigStr;
|
|
|
+ try {
|
|
|
+ bigStr = new BigDecimal(str).toString();
|
|
|
+ } catch (Exception e) {
|
|
|
+ return false;//异常 说明包含非数字。
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|