|
@@ -138,13 +138,24 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
entity.setPurOrSubOrder(detailsItem.getPurOrSubOrder());//采购委外订单号
|
|
|
entity.setPrice(detailsItem.getSalesUnitPrice());//单价
|
|
|
entity.setFactoryUnitPrice(detailsItem.getFactoryUnitPrice());//工厂单价
|
|
|
- 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.getMasterMetering()!=null&&entity.getMasterMetering().equals("KG")){//当单位为KG时
|
|
|
+ if(entity.getMeter()!=null){//前端计算米数
|
|
|
+ entity.setActualDeclaredQuantity(entity.getMeter());//修改报关数量
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(entity.getMasterMetering().equals("KG")){//计算总价
|
|
|
+ if(entity.getNetWeight()!=null){
|
|
|
entity.setTotalPrice(entity.getNetWeight().multiply(entity.getPrice()));//净重*单价
|
|
|
}
|
|
|
+ }else{
|
|
|
+ if(entity.getActualDeclaredQuantity()!=null){
|
|
|
+ entity.setTotalPrice(entity.getActualDeclaredQuantity().multiply(entity.getPrice()));//实际报关数量*单价
|
|
|
+ }
|
|
|
}
|
|
|
syShippingDetailsItemMapper.updateById(detailsItem);
|
|
|
syPackingListFabricItemMapper.insert(entity);
|
|
@@ -168,16 +179,25 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
entity.setDelFlag("0");
|
|
|
//外键设置
|
|
|
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时
|
|
|
+ if(entity.getMeter()!=null){//前端计算米数
|
|
|
+ entity.setActualDeclaredQuantity(entity.getMeter());//修改报关数量
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(entity.getMasterMetering().equals("KG")){//计算总价
|
|
|
+ if(entity.getNetWeight()!=null){
|
|
|
entity.setTotalPrice(entity.getNetWeight().multiply(entity.getPrice()));//净重*单价
|
|
|
}
|
|
|
+ }else{
|
|
|
+ if(entity.getActualDeclaredQuantity()!=null){
|
|
|
+ entity.setTotalPrice(entity.getActualDeclaredQuantity().multiply(entity.getPrice()));//实际报关数量*单价
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+ entity.setInventoryQuantity(entity.getActualDeclaredQuantity());//入库数量=实际报关数量
|
|
|
if(entity.getIsAdd()>0){//大于1就是新增数据
|
|
|
//因为云工厂得修改时得停止调用前面接口
|
|
|
/*SyShippingDetailsItem s1 =syShippingDetailsItemMapper.selectById(entity.getSyShippingDetailsItemId());
|
|
@@ -253,7 +273,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
syPackingListFabricItem.setExcessQuantity(new BigDecimal(0));//如果超发数量为-1就写为0
|
|
|
}
|
|
|
if(syPackingListFabricItem.getVenId()!=null&&syPackingListFabricItem.getVenId().indexOf("04")>-1&&!syPackingListFabricItem.getVenId().equals("0499")){
|
|
|
- //满足条件
|
|
|
+ //当物料分类为04开头的印厂面料时
|
|
|
SyShippingDetailsItem syShippingDetailsItem=syShippingDetailsItemMapper.selectById(syPackingListFabricItem.getSyShippingDetailsItemId());//获取出运明细子表数据
|
|
|
syPackingListFabricItem.setSupplierCodeDyeingPlant(syShippingDetailsItem.getRSupplierCode());//染厂编码
|
|
|
syPackingListFabricItem.setSupplierDyeingPlant(syShippingDetailsItem.getRSupplier());//染厂
|
|
@@ -374,8 +394,8 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
SyShippingDetailsItem item=syShippingDetailsItemMapper.selectById(s1.getSyShippingDetailsItemId());
|
|
|
if(item!=null){
|
|
|
//规格型号 超发 发运明细剩余数量 业务部门 价格 总价(计算)
|
|
|
- s1.setSyOrderDataItemId(item.getSyOrderDataItemId());
|
|
|
- s1.setSyOrderDataId(item.getSyOrderDataId());
|
|
|
+ s1.setSyOrderDataItemId(item.getSyOrderDataItemId());//销售订单子表id
|
|
|
+ s1.setSyOrderDataId(item.getSyOrderDataId());//销售订单主表id
|
|
|
s1.setSalesDepartment(item.getSalesDepartment());//业务部门
|
|
|
syPackingListFabric.setGarmentFactory(item.getGarmentFactory());//主表的成衣
|
|
|
syPackingListFabric.setCustomerAbbreviation(item.getCustomerAbbreviation());//客户简称
|
|
@@ -384,28 +404,33 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
s1.setMasterMetering(item.getMasterMetering());//单位
|
|
|
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()));//实际报关数量*单价
|
|
|
- }
|
|
|
+ s1.setAccount(item.getAccount());//账套号
|
|
|
+ s1.setOrderNumber(item.getOrderNumber());//订单号
|
|
|
+
|
|
|
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时
|
|
|
- s1.setTotalPrice(s1.getNetWeight().multiply(s1.getPrice()));//净重*单价
|
|
|
- s1.setActualDeclaredQuantity(s1.getNetWeight());//净重为报关数量
|
|
|
- }
|
|
|
- /*else if(s1.getMasterMetering()!=null&&s1.getMasterMetering().equals("M")){
|
|
|
if(s1.getMeter()!=null){
|
|
|
- s1.setTotalPrice(s1.getMeter().multiply(s1.getPrice()));//米数*单价
|
|
|
s1.setActualDeclaredQuantity(s1.getNetWeight());//净重为报关数量
|
|
|
+
|
|
|
+ }else{
|
|
|
+ s1.setActualDeclaredQuantity(null);
|
|
|
}
|
|
|
- }*/
|
|
|
}
|
|
|
+ if(s1.getMasterMetering().equals("KG")){//计算总价
|
|
|
+ if(s1.getNetWeight()==null){
|
|
|
+ s1.setTotalPrice(s1.getNetWeight().multiply(s1.getPrice()));//净重*单价
|
|
|
+ }else{
|
|
|
+ //throw new JeecgBootException("物料:"+s1.getInventoryName()+"请填写净重");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(s1.getActualDeclaredQuantity()==null){
|
|
|
+ s1.setTotalPrice(s1.getActualDeclaredQuantity().multiply(s1.getPrice()));//实际报关数量*单价
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if(item.getInventoryCcode()!=null&&item.getInventoryCcode().indexOf("04")>-1
|
|
|
&&!item.getInventoryCcode().equals("0499")){
|
|
|
- //满足条件
|
|
|
s1.setSupplierCodeDyeingPlant(item.getRSupplierCode());//染厂编码
|
|
|
s1.setSupplierCodePrintingPlant(item.getSupplierCode());//染厂
|
|
|
s1.setSupplierCodePrintingPlant(item.getSupplierCode());//印厂编码
|
|
@@ -413,15 +438,18 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
}
|
|
|
if(item.getInventoryCcode()!=null&&item.getInventoryCcode().indexOf("03")>-1
|
|
|
&&!item.getInventoryCcode().equals("0399")){
|
|
|
- //满足条件
|
|
|
s1.setSupplierCodeDyeingPlant(item.getSupplierCode());//染厂编码
|
|
|
s1.setSupplierDyeingPlant(item.getSupplier());//染厂
|
|
|
}
|
|
|
s1.setSpecificationAndModel(item.getSpecificationAndModel());//规格型号
|
|
|
- s1.setExcessQuantity(s1.getActualDeclaredQuantity().subtract(item.getSurplusQuantity()));//超发数量
|
|
|
- s1.setSurplusQuantity(item.getSurplusQuantity().subtract(s1.getActualDeclaredQuantity()).intValue());//剩余数量
|
|
|
- item.setExcessQuantity(s1.getActualDeclaredQuantity().subtract(item.getSurplusQuantity()));
|
|
|
- item.setSurplusQuantity(item.getSurplusQuantity().subtract(s1.getActualDeclaredQuantity()));
|
|
|
+
|
|
|
+ if(s1.getActualDeclaredQuantity()!=null){
|
|
|
+ s1.setExcessQuantity(s1.getActualDeclaredQuantity().subtract(item.getSurplusQuantity()));//超发数量
|
|
|
+ s1.setSurplusQuantity(item.getSurplusQuantity().subtract(s1.getActualDeclaredQuantity()).intValue());//剩余数量
|
|
|
+ item.setExcessQuantity(s1.getActualDeclaredQuantity().subtract(item.getSurplusQuantity()));
|
|
|
+ item.setSurplusQuantity(item.getSurplusQuantity().subtract(s1.getActualDeclaredQuantity()));
|
|
|
+ }
|
|
|
+
|
|
|
syShippingDetailsItemMapper.updateById(item);
|
|
|
}else{
|
|
|
throw new JeecgBootException("出运明细未找到对应数据");
|
|
@@ -464,47 +492,15 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
if(syShippingDetailsItem==null){
|
|
|
throw new JeecgBootException("出运明细未找到对应数据");
|
|
|
}
|
|
|
- if(item.getActualDeclaredQuantity()!=null){
|
|
|
- item.setPrice(syShippingDetailsItem.getSalesUnitPrice());
|
|
|
- item.setTotalPrice(item.getActualDeclaredQuantity().multiply(syShippingDetailsItem.getSalesUnitPrice()));//实际报关数量*单价
|
|
|
- }
|
|
|
- if((syShippingDetailsItem.getInventoryCcode().indexOf("03")!=-1&&!syShippingDetailsItem.getInventoryCcode().equals("0399")) ||
|
|
|
- (syShippingDetailsItem.getInventoryCcode().indexOf("02")!=-1&&!syShippingDetailsItem.getInventoryCcode().equals("0299"))||
|
|
|
- (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")){
|
|
|
- if(item.getMeter()==null){
|
|
|
- throw new JeecgBootException("净重、门幅、克重之间有值为空,无法获取米数计算总价");
|
|
|
- }
|
|
|
- item.setTotalPrice(item.getMeter().multiply(syShippingDetailsItem.getSalesUnitPrice()));//米数*单价
|
|
|
- item.setActualDeclaredQuantity(item.getMeter());
|
|
|
- }*/
|
|
|
- }
|
|
|
+ item.setPrice(syShippingDetailsItem.getSalesUnitPrice());//单价
|
|
|
item.setInventoryCcode(syShippingDetailsItem.getInventoryCcode());//物料分类
|
|
|
item.setInventoryCode(syShippingDetailsItem.getInventoryCode());//物料编码
|
|
|
- item.setOmpoId(syShippingDetailsItem.getOmpoId());
|
|
|
- item.setOmpoIdItem(syShippingDetailsItem.getOmpoIdItem());
|
|
|
- item.setOmpoAccount(syShippingDetailsItem.getOmpoAccount());
|
|
|
- item.setAccount(syShippingDetailsItem.getAccount());
|
|
|
-
|
|
|
- item.setSyOrderDataItemId(syShippingDetailsItem.getSyOrderDataItemId());
|
|
|
- item.setSyOrderDataId(syShippingDetailsItem.getSyOrderDataId());
|
|
|
-
|
|
|
- if(item.getInventoryCcode()!=null&&item.getInventoryCcode().indexOf("04")>-1
|
|
|
- &&!item.getInventoryCcode().equals("0499")){
|
|
|
- //满足条件
|
|
|
- item.setSupplierCodeDyeingPlant(syShippingDetailsItem.getRSupplierCode());//染厂编码
|
|
|
- item.setSupplierCodePrintingPlant(syShippingDetailsItem.getSupplierCode());//染厂
|
|
|
- }
|
|
|
- if(item.getInventoryCcode()!=null&&item.getInventoryCcode().indexOf("03")>-1
|
|
|
- &&!item.getInventoryCcode().equals("0399")){
|
|
|
- //满足条件
|
|
|
- item.setSupplierCodeDyeingPlant(syShippingDetailsItem.getSupplierCode());//染厂编码
|
|
|
- }
|
|
|
-
|
|
|
+ item.setOmpoId(syShippingDetailsItem.getOmpoId());//采购/委外订单主表id
|
|
|
+ item.setOmpoIdItem(syShippingDetailsItem.getOmpoIdItem());//采购/委外订单子表id
|
|
|
+ item.setOmpoAccount(syShippingDetailsItem.getOmpoAccount());//采购/委外订单账套号
|
|
|
+ item.setAccount(syShippingDetailsItem.getAccount());//账套号
|
|
|
+ item.setSyOrderDataItemId(syShippingDetailsItem.getSyOrderDataItemId());//销售订单主表id
|
|
|
+ item.setSyOrderDataId(syShippingDetailsItem.getSyOrderDataId());//销售订单子表id
|
|
|
item.setGroupId(oConvertUtils.getId());
|
|
|
item.setManualYarnUnitPrice(syShippingDetailsItem.getManualYarnUnitPrice());//手册纱单价
|
|
|
item.setManualYarnProportion(syShippingDetailsItem.getManualYarnProportion());//手册纱占比%
|
|
@@ -513,6 +509,48 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
item.setDelFlag("0");//是否删除
|
|
|
item.setSyPackingListFabricId(syPackingListFabric.getId());
|
|
|
item.setOrderNumber(syShippingDetailsItem.getOrderNumber());
|
|
|
+ if((syShippingDetailsItem.getInventoryCcode().indexOf("03")!=-1&&!syShippingDetailsItem.getInventoryCcode().equals("0399")) ||
|
|
|
+ (syShippingDetailsItem.getInventoryCcode().indexOf("02")!=-1&&!syShippingDetailsItem.getInventoryCcode().equals("0299"))||
|
|
|
+ (syShippingDetailsItem.getInventoryCcode().indexOf("04")!=-1&&!syShippingDetailsItem.getInventoryCcode().equals("0499"))){//当物料为面料时,实际报关数量为米数
|
|
|
+ if(item.getMeter()!=null){
|
|
|
+ item.setActualDeclaredQuantity(item.getMeter());//给面辅料赋米数值
|
|
|
+ }else{
|
|
|
+ //item.setActualDeclaredQuantity(null);//实际报关数量赋值为null
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(item.getMasterMetering().equals("KG")){//计算总价
|
|
|
+ if(item.getNetWeight()!=null){
|
|
|
+ item.setTotalPrice(item.getNetWeight().multiply(item.getPrice()));//净重*单价
|
|
|
+ }else{
|
|
|
+ throw new JeecgBootException("单位为kg的物料请填写净重,用于计算金额");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(item.getActualDeclaredQuantity()!=null){
|
|
|
+ item.setTotalPrice(item.getActualDeclaredQuantity().multiply(item.getPrice()));//实际报关数量*单价
|
|
|
+ }else{
|
|
|
+ throw new JeecgBootException("单位不为kg的物料请填写实际报关数量,用于计算金额");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(item.getInventoryCcode()!=null&&item.getInventoryCcode().indexOf("04")>-1
|
|
|
+ &&!item.getInventoryCcode().equals("0499")){//印厂
|
|
|
+ item.setSupplierCodeDyeingPlant(syShippingDetailsItem.getRSupplierCode());//染厂编码
|
|
|
+ item.setSupplierDyeingPlant(syShippingDetailsItem.getRSupplier());//染厂
|
|
|
+ item.setSupplierPrintingPlant(syShippingDetailsItem.getSupplier());//印厂编码
|
|
|
+ item.setSupplierCodePrintingPlant(syShippingDetailsItem.getSupplierCode());//印厂
|
|
|
+ }
|
|
|
+ if(item.getInventoryCcode()!=null&&item.getInventoryCcode().indexOf("03")>-1
|
|
|
+ &&!item.getInventoryCcode().equals("0399")){//染厂
|
|
|
+ item.setSupplierCodeDyeingPlant(syShippingDetailsItem.getSupplierCode());//染厂编码
|
|
|
+ item.setSupplierDyeingPlant(syShippingDetailsItem.getSupplier());//染厂供应商
|
|
|
+
|
|
|
+ }
|
|
|
+ if(item.getActualDeclaredQuantity()!=null){//计算超发和剩余数量
|
|
|
+ item.setExcessQuantity(item.getActualDeclaredQuantity().subtract(syShippingDetailsItem.getSurplusQuantity()));//超发数量
|
|
|
+ item.setSurplusQuantity(syShippingDetailsItem.getSurplusQuantity().subtract(item.getActualDeclaredQuantity()).intValue());//剩余数量
|
|
|
+ syShippingDetailsItem.setExcessQuantity(item.getActualDeclaredQuantity().subtract(syShippingDetailsItem.getSurplusQuantity()));
|
|
|
+ syShippingDetailsItem.setSurplusQuantity(syShippingDetailsItem.getSurplusQuantity().subtract(item.getActualDeclaredQuantity()));
|
|
|
+ syShippingDetailsItemMapper.updateById(syShippingDetailsItem);
|
|
|
+ }
|
|
|
syPackingListFabricItemMapper.insert(item);
|
|
|
}
|
|
|
}
|
|
@@ -545,41 +583,25 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
item.setMasterMetering(syShippingDetailsItem.getMasterMetering());//单位
|
|
|
if((item.getInventoryCcode().indexOf("03")!=-1&&!item.getInventoryCcode().equals("0399")) ||
|
|
|
(item.getInventoryCcode().indexOf("02")!=-1&&!item.getInventoryCcode().equals("0299"))||
|
|
|
- (item.getInventoryCcode().indexOf("04")!=-1&&!item.getInventoryCcode().equals("0499"))){//面料
|
|
|
- //米数计算公式 净重/(门幅/100)/(克重/1000)
|
|
|
- if(item.getNetWeight()!=null&&item.getGramWeight()!=null&&item.getWidth()!=null){
|
|
|
- BigDecimal netWeight=item.getNetWeight();//净重
|
|
|
- BigDecimal gramWeight=new BigDecimal(item.getGramWeight());//克重
|
|
|
- BigDecimal width=new BigDecimal(item.getWidth());//门幅
|
|
|
- if(gramWeight.intValue()==0||width.intValue()==0||netWeight.intValue()==0){
|
|
|
-
|
|
|
- }else{
|
|
|
- BigDecimal meter=netWeight.multiply(gramWeight).multiply(width).divide(new BigDecimal("100000"));//米数
|
|
|
- item.setMeter(meter);//米数
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if(item.getActualDeclaredQuantity()!=null){//其他
|
|
|
- item.setTotalPrice(item.getActualDeclaredQuantity().multiply(item.getPrice()));//米数*单价
|
|
|
+ (item.getInventoryCcode().indexOf("04")!=-1&&!item.getInventoryCcode().equals("0499"))){//面料计算米数
|
|
|
+ if(item.getMeter()==null){
|
|
|
+ item.setActualDeclaredQuantity(null);
|
|
|
+ //throw new JeecgBootException("净重、门幅、克重之间有值为空,无法计算米数");
|
|
|
+ }else{
|
|
|
+ item.setActualDeclaredQuantity(item.getMeter());
|
|
|
}
|
|
|
-
|
|
|
- if(item!=null&&item.getMasterMetering().equals("KG")){//KG
|
|
|
+ }
|
|
|
+ if(item.getMasterMetering().equals("KG")){//计算总价
|
|
|
+ if(item.getNetWeight()!=null){
|
|
|
item.setTotalPrice(item.getNetWeight().multiply(item.getPrice()));//净重*单价
|
|
|
- item.setActualDeclaredQuantity(item.getNetWeight());
|
|
|
- }else if(item!=null&&item.getMasterMetering().equals("M")){//M
|
|
|
- if(item.getMeter()==null){
|
|
|
- throw new JeecgBootException("净重、门幅、克重之间有值为空,无法计算米数");
|
|
|
- }
|
|
|
- //item.setActualDeclaredQuantity(item.getMeter());
|
|
|
- item.setTotalPrice(item.getMeter().multiply(item.getPrice()));//米数*单价
|
|
|
}else{
|
|
|
- throw new JeecgBootException("请给单位不为KG或者M的面辅料填上实际报关数量");
|
|
|
+ throw new JeecgBootException("单位为kg的物料请填写净重,用于计算金额");
|
|
|
}
|
|
|
- }else{////辅料
|
|
|
- if(item.getActualDeclaredQuantity()!=null){//其他
|
|
|
- item.setTotalPrice(item.getActualDeclaredQuantity().multiply(item.getPrice()));//米数*单价
|
|
|
+ }else{
|
|
|
+ if(item.getActualDeclaredQuantity()!=null){
|
|
|
+ item.setTotalPrice(item.getActualDeclaredQuantity().multiply(item.getPrice()));//实际报关数量*单价
|
|
|
}else{
|
|
|
- throw new JeecgBootException("请给单位不为KG或者M的面辅料填上实际报关数量");
|
|
|
+ throw new JeecgBootException("单位不为kg的物料请填写实际报关数量,用于计算金额");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -606,11 +628,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
SyPackingListFabricItem syPackingListFabricItem=syPackingListFabricItemMapper.selectOne(queryWrapper);
|
|
|
if(syPackingListFabricItem!=null){
|
|
|
total2=syPackingListFabricItem.getActualDeclaredQuantity();
|
|
|
- System.out.println("syPackingListFabricItem为\t"+syPackingListFabricItem.getActualDeclaredQuantity());//报关数量
|
|
|
- //throw new JeecgBootException("该单据已被成衣参照!请勿重复操作");
|
|
|
}
|
|
|
- //total2=syPackingListFabricItem.getActualDeclaredQuantity();
|
|
|
- // System.out.println("syPackingListFabricItem为\t"+syPackingListFabricItem.getActualDeclaredQuantity());//报关数量
|
|
|
}
|
|
|
strs+="第"+num+"页原单据数量"+total1+",已参照数量"+total2+",本次数量"+total3+";";
|
|
|
num++;
|
|
@@ -1435,6 +1453,9 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
sy1.setSupplierPrintingPlant(syShippingDetailsItem.getSupplier());//供应商编码
|
|
|
sy1.setSupplierCodePrintingPlant(syShippingDetailsItem.getSupplierCode());//供应商
|
|
|
sy1.setSyShippingDetailsId(syShippingDetailsItem.getShippingDetailsId());//出运明细主表id
|
|
|
+ if(sy1.getMasterMetering()==null){
|
|
|
+ sy1.setMasterMetering(syShippingDetailsItem.getMasterMetering());
|
|
|
+ }
|
|
|
sy1.setSyShippingDetailsItemId(syShippingDetailsItem.getId());//出运明细子表id
|
|
|
sy1.setManualYarnUnitPrice(syShippingDetailsItem.getManualYarnUnitPrice());//手册纱单价
|
|
|
sy1.setManualYarnFlag(syShippingDetailsItem.getManualYarnFlag());//是否手册纱
|
|
@@ -1447,9 +1468,10 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
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(!sy1.getMasterMetering().equals("KG")){//单位不为KG
|
|
|
+ sy1.setActualDeclaredQuantity(sy1.getInventoryQuantity());
|
|
|
+ sy1.setMeter(sy1.getInventoryQuantity());
|
|
|
+ }else{//单位为KG的面辅料需要计算米数
|
|
|
if(syShippingDetailsItem.getWeight()!=null&& syShippingDetailsItem.getWeight().length() >1){//获取克重
|
|
|
if(syShippingDetailsItem.getWeight().indexOf("克")>0){//包含克重
|
|
|
sy1.setGramWeight(syShippingDetailsItem.getWeight().substring(0,syShippingDetailsItem.getWeight().length()-1));
|
|
@@ -1459,8 +1481,6 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
}else{
|
|
|
sy1.setGramWeight("0");//设置为0
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
if(syShippingDetailsItem.getGuangpeiGateWidth()!=null&& syShippingDetailsItem.getGuangpeiGateWidth().length() >1){//获取门幅
|
|
|
if(isNumeric(syShippingDetailsItem.getGuangpeiGateWidth())){// 验证门幅
|
|
|
sy1.setWidth(syShippingDetailsItem.getGuangpeiGateWidth());
|
|
@@ -1470,22 +1490,33 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
}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){
|
|
|
-
|
|
|
+ sy1.setActualDeclaredQuantity(null);
|
|
|
}else{
|
|
|
BigDecimal meter=netWeight.multiply(gramWeight).multiply(width).divide(new BigDecimal("100000"));//米数
|
|
|
sy1.setMeter(meter);//米数
|
|
|
+ sy1.setActualDeclaredQuantity(sy1.getNetWeight());//获取米数
|
|
|
}
|
|
|
+ }else{
|
|
|
+ sy1.setActualDeclaredQuantity(null);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
|
|
|
- }else{//当单位为其他的时
|
|
|
- sy1.setMeter(sy1.getActualDeclaredQuantity());//米数赋值u8出库单数量
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if(sy1.getMasterMetering().equals("KG")){//计算总价
|
|
|
+ if(sy1.getNetWeight()==null){
|
|
|
+ sy1.setTotalPrice(sy1.getNetWeight().multiply(sy1.getPrice()));//净重*单价
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(sy1.getActualDeclaredQuantity()!=null){
|
|
|
+ sy1.setTotalPrice(sy1.getActualDeclaredQuantity().multiply(sy1.getPrice()));//实际报关数量*单价
|
|
|
}
|
|
|
}
|
|
|
|