Procházet zdrojové kódy

产能报表,托书国外结汇发票

zengtx před 2 roky
rodič
revize
4989b429c6

+ 26 - 21
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/mapper/xml/SyCostAllocationFabricMapper.xml

@@ -45,21 +45,22 @@
 		left join
 		( select tab2.cinvName,sum(tab1.purchaseQuantity) as purchaseQuantity,sum(tab2.jian) as jian from
 		(
-		select i.cInvName,sum(rs.iQuantity) as purchaseQuantity,rs.cBatch from UFDATA_101_2021.dbo.rdrecords01 rs
+		select i.cInvName,sum(rs.iQuantity) as purchaseQuantity,max(rs.cBatch) as cBatch from UFDATA_101_2021.dbo.rdrecords01 rs
 		join UFDATA_101_2021.dbo.Inventory i on rs.cInvCode=i.cInvCode
 		where iordercode in (
 		select distinct od.csocode
-		from UFDATA_101_2021.dbo.om_momain om
-		join UFDATA_101_2021.dbo.OM_MODetails od on om.moid=od.moid
+			from UFDATA_101_2021.dbo.PO_POmain om
+		join UFDATA_101_2021.dbo.PO_PODetails od on om.poid=od.poid
 		join UFDATA_101_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
-		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser')
-		and omi.cInvCcode like '19%' and om.cCode like CONCAT(#{code},'%')
-		) and (i.cInvCcode like '03%' or i.cInvCcode like '04%') and i.cInvCCode != '0399' and i.cInvCCode != '0499'
-		GROUP BY i.cInvName,rs.cBatch
+		WHERE om.cVerifier is not null and (om.cCloser is null or om.cCloser='asuser')
+		 and om.cPOID like CONCAT(#{code},'%')
+		) and (i.cInvCcode like '03%' or i.cInvCcode like '04%') and i.cInvCCode != '0399' and i.cInvCCode != '0499' and i.cInvCCode != '0299'
+		 and rs.cBatch like CONCAT(#{code},'%')
+		GROUP BY i.cInvName
 		)tab1
 		right join
 		(
-		select i.cInvName,sum(rs.iQuantity) as jian,rs.cBatch from UFDATA_101_2021.dbo.rdrecords11 rs
+		select i.cInvName,sum(rs.iQuantity) as jian,max(rs.cBatch) as cBatch from UFDATA_101_2021.dbo.rdrecords11 rs
 		join UFDATA_101_2021.dbo.Inventory i on rs.cInvCode=i.cInvCode
 		where iordercode in (
 		select distinct od.csocode
@@ -68,8 +69,9 @@
 		join UFDATA_101_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
 		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser')
 		and omi.cInvCcode like '19%' and om.cCode like CONCAT(#{code},'%')
-		) and (i.cInvCcode like '03%' or i.cInvCcode like '04%') and i.cInvCCode != '0399' and i.cInvCCode != '0499'
-		GROUP BY i.cInvName,rs.cBatch
+		) and (i.cInvCcode like '03%' or i.cInvCcode like '04%') and i.cInvCCode != '0399' and i.cInvCCode != '0499' and i.cInvCCode != '0299'
+		 and rs.cBatch like CONCAT(#{code},'%')
+		GROUP BY i.cInvName
 		)tab2 on tab2.cInvName=tab1.cInvName and tab2.cBatch=tab1.cBatch
 		GROUP BY tab2.cInvName
 		) tab3 on tab3.cInvName=tab.goodsName
@@ -104,21 +106,21 @@
 		left join
 		( select tab2.cinvName,sum(tab1.purchaseQuantity) as purchaseQuantity,sum(tab2.jian) as jian from
 		(
-		select i.cInvName,sum(rs.iQuantity) as purchaseQuantity,rs.cBatch from UFDATA_103_2021.dbo.rdrecords01 rs
+		select i.cInvName,sum(rs.iQuantity) as purchaseQuantity,max(rs.cBatch) as cBatch from UFDATA_103_2021.dbo.rdrecords01 rs
 		join UFDATA_103_2021.dbo.Inventory i on rs.cInvCode=i.cInvCode
 		where iordercode in (
 		select distinct od.csocode
-		from UFDATA_103_2021.dbo.om_momain om
-		join UFDATA_103_2021.dbo.OM_MODetails od on om.moid=od.moid
-		join UFDATA_103_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
-		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser')
-		and omi.cInvCcode like '19%' and om.cCode like CONCAT(#{code},'%')
-		) and (i.cInvCcode like '03%' or i.cInvCcode like '04%') and i.cInvCCode != '0399' and i.cInvCCode != '0499'
-		GROUP BY i.cInvName,rs.cBatch
+		from UFDATA_101_2021.dbo.PO_POmain om
+		join UFDATA_101_2021.dbo.PO_PODetails od on om.poid=od.poid
+		join UFDATA_101_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
+		WHERE om.cVerifier is not null and (om.cCloser is null or om.cCloser='asuser')
+		 and om.cPOID like CONCAT(#{code},'%')
+		) and (i.cInvCcode like '03%' or i.cInvCcode like '04%') and i.cInvCCode != '0399' and i.cInvCCode != '0499' and i.cInvCCode != '0299' and rs.cBatch like CONCAT(#{code},'%')
+		GROUP BY i.cInvName
 		)tab1
 		right join
 		(
-		select i.cInvName,sum(rs.iQuantity) as jian,rs.cBatch from UFDATA_103_2021.dbo.rdrecords11 rs
+		select i.cInvName,sum(rs.iQuantity) as jian,max(rs.cBatch) as cBatch from UFDATA_103_2021.dbo.rdrecords11 rs
 		join UFDATA_103_2021.dbo.Inventory i on rs.cInvCode=i.cInvCode
 		where iordercode in (
 		select distinct od.csocode
@@ -127,13 +129,16 @@
 		join UFDATA_103_2021.dbo.Inventory omi on omi.cInvCode=od.cInvCode
 		WHERE om.iVerifyStateNew = 2 and (om.cCloser is null or om.cCloser='asuser')
 		and omi.cInvCcode like '19%' and om.cCode like CONCAT(#{code},'%')
-		) and (i.cInvCcode like '03%' or i.cInvCcode like '04%') and i.cInvCCode != '0399' and i.cInvCCode != '0499'
-		GROUP BY i.cInvName,rs.cBatch
+		) and (i.cInvCcode like '03%' or i.cInvCcode like '04%') and i.cInvCCode != '0399' and i.cInvCCode != '0499' and i.cInvCCode != '0299'
+		and rs.cBatch like CONCAT(#{code},'%')
+		GROUP BY i.cInvName
 		)tab2 on tab2.cInvName=tab1.cInvName and tab2.cBatch=tab1.cBatch
 		GROUP BY tab2.cInvName
 		) tab3 on tab3.cInvName=tab.goodsName
 	</select>
 
+
+<!--	面料转入数量链接方法-->
 	<select id="queryTransferByFabric" resultType="org.jeecg.modules.cost.entity.SyTransfer">
 		select
 		tab2.cinvName as goodsName,tab2.cFree1 as color,tab2.cBatch as planCode,

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/controller/SyShippingDetailsController.java

@@ -699,7 +699,7 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 			  int index = 0;
 			  while (sheets.hasNext()){
 				  Sheet sheet=(Sheet) sheets.next();
-				  //页签命名规范 款号-分销点 用-后缀数字区分
+				  //页签命名规范 款号-分销点 用-后缀数字区分 //20230421现改为供应商-款号
 				  //判断非法字符
 				  //boolean flag = isSpecialChar(syPreList.get(index).getDistributionPoint());
 				  //if(flag == true){
@@ -712,7 +712,7 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 					  syPreList.get(index).setDistributionPointSlash(sbu.toString());
 				  }
 				  //}
-				  workbook.setSheetName(index,syPreList.get(index).getItemNumber()+"-"+syPreList.get(index).getDistributionPointSlash()+"-"+(index+1));
+				  workbook.setSheetName(index,syPreList.get(index).getSupplier()+"-"+syPreList.get(index).getDistributionPointSlash()+"-"+(index+1));
 				  StringBuilder builder = new StringBuilder();
 				  StringBuilder builder1 = new StringBuilder();
 				  //获取尺码组

+ 4 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/entity/VO/SyPreAssembledPackingListVo.java

@@ -170,6 +170,9 @@ public class SyPreAssembledPackingListVo {
     //用来处理分销点导出斜杠的字段
     private String distributionPointSlash;
 
+    //供应商
+    private String supplier;
+
 
     public SyPreAssembledPackingListVo(SyShippingDetailsVo syShippingDetailsVo){
 
@@ -193,7 +196,7 @@ public class SyPreAssembledPackingListVo {
         this.customerAbb = syShippingDetailsVo.getCustomerAbbreviation();
         this.elenmentId = syShippingDetailsVo.getElementsId();
         this.distributionPointSlash = syShippingDetailsVo.getDistributionPoint();
-
+        this.supplier = syShippingDetailsVo.getSupplier();
     }
 
     public SyPreAssembledPackingListVo(){

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

@@ -711,56 +711,58 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
 				 itemList = syShippingOrderMapper.elmentsListFabric(entity.getId());
 			 }
 
-			 if (isAhaa.equals("国内")) {
-
-				 if (testName.equals("-结汇发票")) {
 
-					 List<Map<String, Object>> taitouList = new ArrayList<>();
-					 //获取对应模板
-					 TemplateExportParams params = new TemplateExportParams("D:\\单证模板\\报关信息-结汇发票.xlsx");
+			 if (testName.equals("-结汇发票")) {
 
-					 //查询数据字典-公司抬头
-					 List<DictModel> test = sysDictService.queryDictItemsByCode("company_title");
-					 if (test.size()!=0) {
-						 for (DictModel te : test) {
-							 if (list.get(0).getPkOrg().equals(te.getText())) {
-								 String split[] = test.get(0).getValue().split("\\+");
-								 for (int i = 1; i < 5 ; i++) {
-									 Map<String, Object> maiTou = new HashMap<>();
-									 maiTou.put("name", split[i]);
-									 taitouList.add(maiTou);
-								 }
-								 entity.setClientAbbreviation(split[1]);
+				 List<Map<String, Object>> taitouList = new ArrayList<>();
+				 //获取对应模板
+				 TemplateExportParams params = new TemplateExportParams("D:\\单证模板\\报关信息-结汇发票.xlsx");
+
+				 //查询数据字典-公司抬头
+				 List<DictModel> test = sysDictService.queryDictItemsByCode("company_title");
+				 if (test.size()!=0) {
+					 for (DictModel te : test) {
+						 if (list.get(0).getPkOrg().equals(te.getText())) {
+							 String split[] = test.get(0).getValue().split("\\+");
+							 for (int i = 1; i < 5 ; i++) {
+								 Map<String, Object> maiTou = new HashMap<>();
+								 maiTou.put("name", split[i]);
+								 taitouList.add(maiTou);
 							 }
+							 entity.setClientAbbreviation(split[1]);
 						 }
-
 					 }
-					 //转map
-					 Field[] fields = entity.getClass().getDeclaredFields();
-					 for (Field field : fields) {
+
+				 }
+				 //转map
+				 Field[] fields = entity.getClass().getDeclaredFields();
+				 for (Field field : fields) {
+					 field.setAccessible(true);
+					 map.put(field.getName(), field.get(entity));
+				 }
+				 //集合转map
+				 for (SyShippingOrderItem li : list) {
+					 Field[] fieldsList = li.getClass().getDeclaredFields();
+					 Map<String, Object> mapList = new HashMap<String, Object>();
+					 for (Field field : fieldsList) {
 						 field.setAccessible(true);
-						 map.put(field.getName(), field.get(entity));
-					 }
-					 //集合转map
-					 for (SyShippingOrderItem li : list) {
-						 Field[] fieldsList = li.getClass().getDeclaredFields();
-						 Map<String, Object> mapList = new HashMap<String, Object>();
-						 for (Field field : fieldsList) {
-							 field.setAccessible(true);
-							 mapList.put(field.getName(), field.get(li));
-						 }
-						 listMap.add(mapList);
+						 mapList.put(field.getName(), field.get(li));
 					 }
-					 map.put("item", listMap);
-					 map.put("list", taitouList);
+					 listMap.add(mapList);
+				 }
+				 map.put("item", listMap);
+				 map.put("list", taitouList);
 
-					 Workbook workbook = ExcelExportUtil.exportExcel(params, map);
-					 response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
-					 response.setCharacterEncoding("utf-8");
-					 ServletOutputStream outputStream = response.getOutputStream();
-					 workbook.write(outputStream);
+				 Workbook workbook = ExcelExportUtil.exportExcel(params, map);
+				 response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
+				 response.setCharacterEncoding("utf-8");
+				 ServletOutputStream outputStream = response.getOutputStream();
+				 workbook.write(outputStream);
+
+			 }
+
+			 if (isAhaa.equals("国内")) {
 
-				 } else {
 
 					 //获取公司抬头信息
 					 List<DictModel> companyTitle = sysDictService.queryDictItemsByCode("company_title");
@@ -1068,7 +1070,6 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
 						 inStream.close();
 
 					 }
-				 }
 
 			 }else{  //国外