Bladeren bron

预装箱单-

huxy 2 jaren geleden
bovenliggende
commit
3b578c42f2

+ 5 - 7
jeecg-boot-module-system/src/main/java/org/jeecg/modules/spapl/mapper/xml/SyPreAssembledPackingListItemMapper.xml

@@ -27,16 +27,16 @@
 			end_case_number,
 			colour,
 			pieces_box,
-			sum(box_number) boxnumber,/*箱数*/
+			box_number boxnumber,/*箱数*/
 			sum(total) total,/*件数*/
 			net_weight,
-			sum(total_net_weight) total_net_weight,/*总净重*/
+			total_net_weight total_net_weight,/*总净重*/
 			gross_weight,
-			sum(total_gross_weight) total_gross_weight,/*总毛重*/
+			total_gross_weight total_gross_weight,/*总毛重*/
 			outer_box_length,/*长*/
 			outer_Box_Width,/*宽*/
 			outer_Box_Height,/*高*/
-			sum(total_volume) total_volume,/*总体积*/
+			total_volume total_volume,/*总体积*/
 			net_weight_too net_weight_too,/*净净重*/
 			unit_price,
 			sum(total_price) total_price,/*总价*/
@@ -51,7 +51,6 @@
 		FROM  sy_pre_assembled_packing_list_item
 		WHERE sy_pre_assembled_packing_list_id = #{value} AND del_flag = 0
 		GROUP BY colour/*根据发运明细主表id分组 改为了按照 颜色进行分组*/
-
 	</select>
 
 	<select id="selectSyShippingDetailsItemData" parameterType="java.lang.String" resultType="org.jeecg.modules.spapl.entity.SyPreAssembledPackingListItem">
@@ -132,8 +131,7 @@
 		alias,
 		total quantity,
 		box_Number,
-		total/(SELECT SUM(box_number) FROM sy_pre_assembled_packing_list_item WHERE
-		 sy_pre_assembled_packing_list_id=#{value2}) proportion,
+		total/box_number proportion,
 		sy_pre_assembled_packing_list_item.id itemId
 			FROM sy_pre_assembled_packing_list_item
 			LEFT JOIN sizetable ON sy_pre_assembled_packing_list_item.`size`=sizetable.`size`

+ 4 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/spapl/mapper/xml/SyPreAssembledPackingListMapper.xml

@@ -38,10 +38,10 @@
 			b.customer_abbreviation,/*客户简称*/
 			b.master_Metering,/*计量单位*/
 			SUM(b.total) total,/*件数*/
-			sum(b.box_Number) totalboxes,/*总箱数*/
-			sum(b.total_net_weight) totalnetweight,/*总净重*/
-			sum(b.total_gross_weight) totalgrossweight,/*总毛重*/
-			sum(b.total_volume) totalvolume,/*总体积*/
+			b.box_Number totalboxes,/*总箱数*/
+			b.total_net_weight totalnetweight,/*总净重*/
+			b.total_gross_weight totalgrossweight,/*总毛重*/
+			b.total_volume totalvolume,/*总体积*/
 			sum(b.total_price) totalprice,/*总价*/
 			/*sum(b.total) totalquantity,*/
 			b.unit_price factoryUnitPrice,/*工厂单价*/

+ 29 - 27
jeecg-boot-module-system/src/main/java/org/jeecg/modules/spapl/service/impl/SyPreAssembledPackingListServiceImpl.java

@@ -48,27 +48,28 @@ public class SyPreAssembledPackingListServiceImpl extends ServiceImpl<SyPreAssem
 		for (SyPreAssembledPackingListItem item : items){
 			List<SizeTable> sizes=item.getSizeTables();//获取尺码表信息
 			item.setSyPreAssembledPackingListId(pid);//获取主表id
-			BigDecimal boxNumber1=item.getBoxNumber().divide(item.getPiecesBox(),2,BigDecimal.ROUND_HALF_UP);//获取箱数
-			item.setDelFlag("0");
+			BigDecimal boxNumber1=item.getBoxNumber();//获取箱数
+			item.setDelFlag("0");//默认为未删除
 			for (SizeTable size : sizes){
 				SyPreAssembledPackingListItem item1=item;
-				BigDecimal boxNumber=boxNumber1.multiply(new BigDecimal(size.getProportion()));//获取该尺码箱数
-				item1.setTotal(boxNumber.multiply(item1.getPiecesBox()));//该尺码件数
-				item1.setBoxNumber(boxNumber);//获取箱数
-				item1.setTotalNetWeight(boxNumber.multiply(item1.getNetWeight()));//获取总净重		净重*箱数
-				item1.setTotalGrossWeight(boxNumber.multiply(item1.getGrossWeight()));//获取总毛重 	箱数*毛重/箱
-				//item1.setTotalNetWeight(boxNumber.multiply(new BigDecimal(size.getProportion())));//获取净净重 不知
-				BigDecimal volume=boxNumber.multiply(item1.getOuterBoxHeight());
-				volume=volume.multiply(item1.getOuterBoxLength());
-				volume=volume.multiply(item1.getOuterBoxWidth());
-				item1.setTotalVolume(volume);//获取总体积							长*宽*高*箱数
-				boxNumber=boxNumber.multiply(item1.getPiecesBox());//获取该尺码件数
-				item1.setTotalPrice(boxNumber.multiply(item1.getUnitPrice()));//获取总价		箱数*单价-->件数*单价
+				BigDecimal boxNumber=boxNumber1.multiply(new BigDecimal(size.getProportion()));//获取该尺码件数
+				item1.setTotal(boxNumber);//该尺码件数
 				item1.setSize(size.getSize());//获取尺码
+				item1.setTotalPrice(boxNumber.multiply(item1.getUnitPrice()));//获取总价		箱数*单价-->件数*单价
+//				item1.setBoxNumber(boxNumber);//获取箱数
+
+//				item1.setTotalNetWeight(boxNumber.multiply(item1.getNetWeight()));//获取总净重		净重*箱数
+//				item1.setTotalGrossWeight(boxNumber.multiply(item1.getGrossWeight()));//获取总毛重 	箱数*毛重/箱
+//				//item1.setTotalNetWeight(boxNumber.multiply(new BigDecimal(size.getProportion())));//获取净净重 不知
+//				BigDecimal volume=boxNumber.multiply(item1.getOuterBoxHeight());
+//				volume=volume.multiply(item1.getOuterBoxLength());
+//				volume=volume.multiply(item1.getOuterBoxWidth());
+//				item1.setTotalVolume(volume);//获取总体积						长*宽*高*箱数
+
 				item1.setSyDeclarationElementsItemId(size.getItemId());//获取到发运明细子表id
 				item1.setSort(size.getNum());//获取序号
 				item1.setId(oConvertUtils.id());//获取到随机id
-				int row =syPreAssembledPackingListItemMapper.insert(item1);//添加子表数据
+				syPreAssembledPackingListItemMapper.insert(item1);//添加子表数据
 			}
 		}
 		return items;
@@ -77,23 +78,24 @@ public class SyPreAssembledPackingListServiceImpl extends ServiceImpl<SyPreAssem
 	List<SyPreAssembledPackingListItem> update(List<SyPreAssembledPackingListItem> items,String pid){
 		for (SyPreAssembledPackingListItem item : items){
 			List<SizeTable> sizes=item.getSizeTables();//获取尺码表信息
-			BigDecimal boxNumber1=item.getBoxNumber().divide(item.getPiecesBox(),2,BigDecimal.ROUND_HALF_UP);//获取箱数比例
+			BigDecimal boxNumber1=item.getBoxNumber();//获取箱数
 			item.setDelFlag("0");
 			for (SizeTable size : sizes){
 				SyPreAssembledPackingListItem item1=item;
-				BigDecimal boxNumber=boxNumber1.multiply(new BigDecimal(size.getProportion()));//获取该尺码
+				BigDecimal boxNumber=boxNumber1.multiply(new BigDecimal(size.getProportion()));//获取该尺码
 				item1.setSize(size.getSize());//获取尺码信息
-				item1.setTotal(boxNumber.multiply(item1.getPiecesBox()));//该尺码件数
-				item1.setBoxNumber(boxNumber);//获取箱数
-				item1.setTotalNetWeight(boxNumber.multiply(item1.getNetWeight()));//获取总净重		净重*箱数
-				item1.setTotalGrossWeight(boxNumber.multiply(item1.getGrossWeight()));//获取总毛重 	箱数*毛重/箱
-				//item1.setTotalNetWeight(boxNumber.multiply(new BigDecimal(size.getProportion())));//获取净净重 不知
-				BigDecimal volume=boxNumber.multiply(item1.getOuterBoxHeight());//获取体积
-				volume=volume.multiply(item1.getOuterBoxLength());
-				volume=volume.multiply(item1.getOuterBoxWidth());
-				item1.setTotalVolume(volume);//获取总体积							长*宽*高*箱数
-				boxNumber=boxNumber.multiply(item1.getPiecesBox());//获取该尺码件数
+				item1.setTotal(boxNumber);//该尺码件数
 				item1.setTotalPrice(boxNumber.multiply(item1.getUnitPrice()));//获取总价		箱数*单价-->件数*单价
+				//item1.setBoxNumber(boxNumber);//获取箱数
+
+//				item1.setTotalNetWeight(boxNumber.multiply(item1.getNetWeight()));//获取总净重		净重*箱数
+//				item1.setTotalGrossWeight(boxNumber.multiply(item1.getGrossWeight()));//获取总毛重 	箱数*毛重/箱
+//				//item1.setTotalNetWeight(boxNumber.multiply(new BigDecimal(size.getProportion())));//获取净净重 不知
+//				BigDecimal volume=boxNumber.multiply(item1.getOuterBoxHeight());//获取体积
+//				volume=volume.multiply(item1.getOuterBoxLength());
+//				volume=volume.multiply(item1.getOuterBoxWidth());
+//				item1.setTotalVolume(volume);//获取总体积	长*宽*高*箱数
+
 				//item.setSyDeclarationElementsItemId(size.getItemId());//获取到发运明细子表id
 				item1.setId(size.getItemId());//从尺码表中获取到id
 				// 获取到发运明细子表id