Browse Source

托书发票打印调整

zengtx 2 years ago
parent
commit
a51aac9135

+ 46 - 31
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/syShippingOrder/controller/SyShippingOrderController.java

@@ -626,7 +626,7 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
 				 //总金额
 				 entity.setTatolMoney(tatolMoney);
 			     //总体积
-			     entity.setTotalVolume(entity.getTatolVolume());
+			     //entity.setTotalVolume(entity.get());
 			 }
 
 			 //判空
@@ -759,10 +759,11 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
 
 						map6.put("name", "等......");
 						map6.put("value", "");
-
+						listMap.add(map6);
 						map5.put("name", "");
 						map5.put("value", "");
 						listMap.add(map5);
+
 					}
 				}
 				 map.put("readyFabric",readyFabric);
@@ -869,17 +870,19 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
 					 }
 				 }
 
-				 //查询数据字典唛头
-				 List<DictModel> test = sysDictService.queryDictItemsByCode("test0902002");
-				 for(DictModel di:test){
-					 if(di.getText().equals(list.get(0).getClientAbbreviation())){
-					 	String split[] = di.getValue().split("\\+");
-						 for (int i=0;i<split.length;i++) {
-							 Map<String,Object> maiTou = new HashMap<>();
-							 maiTou.put("name", split[i]);
-							 maiTouList.add(maiTou);
+				 if(oConvertUtils.isNotEmpty(list.get(0).getClientAbbreviation())) {
+					 //查询数据字典唛头
+					 List<DictModel> test = sysDictService.queryDictItemsByCode("test0902002");
+					 for (DictModel di : test) {
+						 if (di.getText().equals(list.get(0).getClientAbbreviation())) {
+							 String split[] = di.getValue().split("\\+");
+							 for (int i = 0; i < split.length; i++) {
+								 Map<String, Object> maiTou = new HashMap<>();
+								 maiTou.put("name", split[i]);
+								 maiTouList.add(maiTou);
+							 }
+							 boo = false;
 						 }
-						 boo = false;
 					 }
 				 }
 				 if(boo == true){
@@ -983,19 +986,21 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
 				 String exportPort = py.toPinYin(entity.getExportPort());
 				 entity.setExportPort(exportPort);
 
-				 //查询数据字典唛头
-				 List<DictModel> test = sysDictService.queryDictItemsByCode("test0902002");
-				 for(DictModel di:test){
-					 if(di.getText().equals(list.get(0).getClientAbbreviation())) {
-						 String split[] = di.getValue().split("\\+");
-						 for (int i=0;i<split.length;i++) {
-							 Map<String,Object> maiTou = new HashMap<>();
-							 maiTou.put("name", split[i]);
-							 maiTouList.add(maiTou);
+				 if(oConvertUtils.isNotEmpty(list.get(0).getClientAbbreviation())) {
+					 //查询数据字典唛头
+					 List<DictModel> test = sysDictService.queryDictItemsByCode("test0902002");
+					 for (DictModel di : test) {
+						 if (di.getText().equals(list.get(0).getClientAbbreviation())) {
+							 String split[] = di.getValue().split("\\+");
+							 for (int i = 0; i < split.length; i++) {
+								 Map<String, Object> maiTou = new HashMap<>();
+								 maiTou.put("name", split[i]);
+								 maiTouList.add(maiTou);
+							 }
+							 boo = false;
 						 }
-						 boo = false;
-					 }
 
+					 }
 				 }
 				 if(boo == true){
 					 Map<String,Object> maiTou = new HashMap<>();
@@ -1036,15 +1041,25 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
 				 //查询数据字典-公司抬头
 				 List<DictModel> test = sysDictService.queryDictItemsByCode("company_title");
 
-				 if(list.get(0).getClientAbbreviation().equals("宁波森语")){
-					 String split[] = test.get(0).getValue().split("\\+");
-					 for (int i = 0; i < split.length; i++) {
-						 Map<String, Object> maiTou = new HashMap<>();
-						 maiTou.put("name", split[i]);
-						 taitouList.add(maiTou);
+				 if(oConvertUtils.isNotEmpty(list.get(0).getClientAbbreviation())) {
+					 if (list.get(0).getClientAbbreviation().equals("宁波森语")) {
+						 String split[] = test.get(0).getValue().split("\\+");
+						 for (int i = 0; i < split.length; i++) {
+							 Map<String, Object> maiTou = new HashMap<>();
+							 maiTou.put("name", split[i]);
+							 taitouList.add(maiTou);
+						 }
+						 entity.setClientAbbreviation(split[0]);
+					 } else {
+						 String split[] = test.get(1).getValue().split("\\+");
+						 for (int i = 0; i < split.length; i++) {
+							 Map<String, Object> maiTou = new HashMap<>();
+							 maiTou.put("name", split[i]);
+							 taitouList.add(maiTou);
+						 }
+						 entity.setClientAbbreviation(split[0]);
 					 }
-					 entity.setClientAbbreviation(split[0]);
-				 }else{
+				 }else {
 					 String split[] = test.get(1).getValue().split("\\+");
 					 for (int i = 0; i < split.length; i++) {
 						 Map<String, Object> maiTou = new HashMap<>();

+ 8 - 6
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/syShippingOrder/mapper/xml/SyShippingOrderMapper.xml

@@ -49,7 +49,7 @@ d.terms_of_deliveryvalue as termsOfDeliveryvalue
   select c.hs_code as hsCode,c.declaration_name as declarationName,a.id as id ,GROUP_CONCAT(b.id) as itemId,a.document_No as documentNo,a.create_by as createBy,
   a.export_invoice_no as exportInvoiceNo,a.container_number as containerNumber,a.garment_Factory as garmentFactory,
   b.supplier as supplier,a.plumbum_No as plumbumNo,a.customer_abbreviation as customerAbbreviation,
-  case when b.u8_Pid is null then sum(b.actual_declared_quantity) else sum(b.gross_weight) end as Total,b.actual_declared_quantity as number,
+  case when b.u8_Pid is null then sum(b.actual_declared_quantity) else sum(b.gross_weight) end as Total,sum(b.actual_declared_quantity) as number,
    sum(b.rolls) as planQuantity,
   b.item_Number as itemNumber,b.small_Po as smallPo,round(sum(b.gross_weight),2) as grossWeight,
   round(sum(b.net_weight),2) as netWeight,'0' as totalVolume,b.distribution_Point as distributionPoint,
@@ -87,7 +87,7 @@ sum(number) as number,
 case when ready_fabric != '成衣' then sum(box_number) else box_number end as boxNumber,
 case when ready_fabric != '成衣' then sum(gross_weight) else gross_weight end as grossWeight,
 case when ready_fabric != '成衣' then sum(net_weight) else net_weight end as netWeight,
-case when ready_fabric != '成衣' then volume else volume end as volume,sum(total_price) as totalPrice,
+case when ready_fabric != '成衣' then volume else volume end as volume,round(sum(total_price),2) as totalPrice,
 distribution_point as distributionPoint, container_code as containerCode, container_number as containerNumber, unit_price as unitPrice, pre_shipment_date as preShipmentDate,
 salesman, operating_department as operatingDepartment, purchase_outsourcing_order_no as purOrSubOrder, outsourcing_factory_for_procurement as outsourcingFactoryForProcurement,
  memo, sort, ready_fabric as readyFabric, tailoring_fabric_id as tailoringFabricId, GROUP_CONCAT(tailoring_fabric_item_id) as tailoringFabricItemId,client_abbreviation as clientAbbreviation
@@ -99,19 +99,21 @@ group by group_id
     <select id="queryEelementMerge" resultType="org.jeecg.modules.documents.syShippingOrder.entity.SyShippingOrderItem">
 
 select GROUP_CONCAT(a.id) as id,b.hs_code as hsCode,b.declaration_name as declarationName,b.english_product_name as englishProductName, sum(a.number) as number,a.unit_price as unitPrice,
-sum(a.number*a.unit_price) as totalPrice,sum(a.gross_weight) as grossWeight,sum(a.net_weight) as netWeight,'PCS' as pcs,sum(a.volume) as volume,
-'USD' as curr,'CHAIN' as dree,'宁波其他/宁波象山县' as place,'照章征税' as certificate,a.style_number as styleNumber,a.smail_po as smailPo,
-a.order_number as orderNumber,a.client_abbreviation as clientAbbreviation
+round(a.number*a.unit_price,2) as totalPrice,round(a.gross_weight,2) as grossWeight,round(a.net_weight,2) as netWeight,'PCS' as pcs,a.volume as volume,
+a.box_number as boxNumber,
+'USD' as curr,'CHINA' as dree,'宁波其他/宁波象山县' as place,'照章征税' as certificate,a.style_number as styleNumber,a.smail_po as smailPo,
+a.order_number as orderNumber,a.client_abbreviation as clientAbbreviation,'CTNS' as ctns,'KGS' as kgs,'CBM' as cbm
  from sy_shipping_order_item a
 left join sy_declaration_elements b
 on a.elements_Id = b.id
 where a.sy_shipping_order_item_id = #{id}
-group by b.hs_code,b.declaration_name
+group by a.group_id
 
     </select>
 
 
     <select id="queryEelement" resultType="org.jeecg.modules.documents.syShippingOrder.entity.SyShippingOrderItem">
+
 select t.id, t.hsCode,sum(t.boxNumber) as boxNumber, t.declarationName,t.englishProductName,sum(t.number) as number,round(t.unitPrice,2) as unitPrice,
 round(sum(t.totalPrice),2) as totalPrice,round(sum(t.grossWeight),2) as grossWeight,round(sum(t.netWeight),2) as netWeight,t.pcs,
 round(sum(t.volume),3) as volume,t.curr,t.dree,t.place,t.certificate,t.styleNumber,t.smailPo,t.orderNumber,t.ctns,t.kgs,t.cbm,

+ 2 - 10
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/syShippingOrder/service/impl/SyShippingOrderServiceImpl.java

@@ -112,8 +112,7 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
         BigDecimal totalNetWeight = BigDecimal.ZERO;
         //总毛重
         BigDecimal totalGrossWeight = BigDecimal.ZERO;
-        //总体积
-        BigDecimal totalVolume = BigDecimal.ZERO;
+
         //总箱数
         Integer totalBox = 0;
 
@@ -150,11 +149,6 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
                     fabricItemIdList.add(str);
                 }
 
-                if(oConvertUtils.isEmpty(li.getVolume())){
-                    totalVolume = totalVolume.add(BigDecimal.ZERO);
-                }else {
-                    totalVolume = totalVolume.add(li.getVolume());//总体积
-                }
                 totalGrossWeight = totalGrossWeight.add(li.getGrossWeight());//总毛重
                 totalNetWeight = totalNetWeight.add(li.getNetWeight());//总净重
                 if(li.getReadyFabric().equals("面料")){
@@ -195,7 +189,7 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
                         syShippingOrderItem.setGrossWeight(itemli.getGrossWeight());
 
                         syShippingOrderItem.setNetWeight(itemli.getNetWeight());
-                        syShippingOrderItem.setVolume(syShippingOrder.getTotalVolume());//体积
+                        syShippingOrderItem.setVolume(new BigDecimal(68));//体积
 
                         syShippingOrderItem.setDistributionPoint(itemli.getDistributionPoint());
                         //报关单价 = 总金额/净重
@@ -309,8 +303,6 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
             }
             //总毛重
             syShippingOrder.setTotalGrossWeight(totalGrossWeight);
-            //总体积
-            syShippingOrder.setTotalVolume(totalVolume);
             //总箱数
             syShippingOrder.setBoxNumber(new BigDecimal(totalBox));
             //总净重