瀏覽代碼

推送u8调整

huxy 2 年之前
父節點
當前提交
29ed85cc71

+ 9 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/controller/SyPackingListFabricController.java

@@ -465,20 +465,20 @@ public class SyPackingListFabricController {
 	  LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
 
 	  //Step.2 获取导出数据
-	  List<SyPackingListFabricPage> pageList = new ArrayList<SyPackingListFabricPage>();
-	  List<SyPackingListFabric> syPackingListFabricList = syPackingListFabricService.list(queryWrapper);
+	  List<SyPackingListFabricPage> pageList = syPackingListFabricService.getPages(queryWrapper);
+	 /* List<SyPackingListFabric> syPackingListFabricList = syPackingListFabricService.list(queryWrapper);
 	  for (SyPackingListFabric temp : syPackingListFabricList) {
 		  SyPackingListFabricPage vo = new SyPackingListFabricPage();
 		  BeanUtils.copyProperties(temp, vo);
 		  List<SyPackingListFabricItem> syPackingListFabricItemList = syPackingListFabricItemService.selectByMainId(temp.getId());
 		  vo.setSyPackingListFabricItemList(syPackingListFabricItemList);
 		  pageList.add(vo);
-	  }
+	  }*/
 	  //Step.3 调用AutoPoi导出Excel
 	  ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
 	  mv.addObject(NormalExcelConstants.FILE_NAME, "装箱单面料");
 	  mv.addObject(NormalExcelConstants.CLASS, SyPackingListFabricPage.class);
-	  mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("装箱单面料数据", "导出 人:"+sysUser.getRealname(), "面料装箱单"));
+	  mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("装箱单面料数据", "导出人:admin", "面料装箱单"));
 	  mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
 	  return mv;
 	}
@@ -956,6 +956,11 @@ public class SyPackingListFabricController {
 			 }
 			 Map<String,Object> map=new HashMap<>();
 			 SyPackingListFabric main=syPackingListFabricService.getById(ids);
+			 if(main.getIsReference()==1){
+				 result.setSuccess(false);
+				 result.setMessage("请先做托书再推送");
+				 return result;
+			 }
 			 QueryWrapper queryWrapper=new QueryWrapper();
 			 queryWrapper.eq("sy_Packing_List_Fabric_Id",ids);
 			 queryWrapper.eq("del_flag","0");

+ 9 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/entity/SyPackingListFabricItem.java

@@ -255,10 +255,17 @@ public class SyPackingListFabricItem implements Serializable {
 	@ApiModelProperty(value = "发运明细剩余数量")
 	@TableField(exist = false)
 	private Integer surplusQuantity;
+	@TableField(exist = false)
+	private String hsCode;
 	/**申报要素ID*/
 	@ApiModelProperty(value = "申报要素ID")
 	private String elementsId;
-
+	@Excel(name = "外销发票号")
+	@TableField(exist = false)
+	private String exportInvoiceNo;
+	@Excel(name = "集装箱号")
+	@TableField(exist = false)
+	private String containerNumber1;
 	//体积,总价
 	/**预发货日期*/
 	@Excel(name = "预发货日期", width = 20, format = "yyyy-MM-dd")
@@ -368,6 +375,7 @@ public class SyPackingListFabricItem implements Serializable {
 	@TableField(exist = false)
 	private int num;
 
+
 	public SyPackingListFabricItem(){
 
 	}

+ 5 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/mapper/SyPackingListFabricItemMapper.java

@@ -5,10 +5,13 @@ import java.util.List;
 import java.util.Map;
 
 import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.splfi.entity.SyPackingListFabric;
 import org.jeecg.modules.splfi.entity.SyPackingListFabricItem;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.splfi.vo.SyPackingListFabricPage;
+import org.jeecg.modules.splt.vo.SyPackingListTailoringVo;
 
 /**
  * @Description: 面料装箱单
@@ -36,4 +39,6 @@ public interface SyPackingListFabricItemMapper extends BaseMapper<SyPackingListF
 	//List<Map<String, String>> getu8Data();
 
 	String[] getu8Data();
+
+    List<SyPackingListFabricPage> getPages(@Param("ew")QueryWrapper<SyPackingListFabric> queryWrapper);
 }

+ 33 - 13
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/mapper/xml/SyPackingListFabricItemMapper.xml

@@ -116,19 +116,21 @@
 	</select>
 
 	<select id="selectByMainId2" parameterType="java.lang.String" resultType="org.jeecg.modules.splfi.entity.SyPackingListFabricItem">
-		SELECT a.create_time ,a.create_by ,a.garment_Factory,(Select declaration_Name
-		from sy_declaration_elements
-		where id=elements_Id
-		) declaration_Name,(Select declaration_Unit
-		from sy_declaration_elements
-		where id=elements_Id
-		) declaration_Unit,b.* FROM
-		sy_packing_list_fabric a LEFT JOIN
-		sy_packing_list_fabric_item b ON
-		a.id=b.sy_packing_list_fabric_id and a.del_flag=0
-		WHERE b.del_flag=0 and
-		sy_packing_list_fabric_id=#{value}
-		ORDER BY  b.declaration_Name,plan_Lot_Number
+		select *,
+			(select hs_code from sy_declaration_elements
+			where id=t.elements_Id) hs_code,
+			(select declaration_unit from sy_declaration_elements
+			where id=t.elements_Id) declaration_unit
+			from ( 	SELECT
+			a.container_Number as containerNumber1, a.export_invoice_no,
+			a.garment_Factory, a.prepared_by,  b.*
+			FROM  sy_packing_list_fabric a
+			left join sy_packing_list_fabric_item b
+			on a.id=b.sy_packing_list_fabric_id and a.del_flag=0
+			where  b.del_flag=0 and
+			sy_packing_list_fabric_id=#{value}
+			ORDER BY  declaration_Name,plan_Lot_Number
+		) t
 	</select>
 
 	<select id="getList"   resultType="org.jeecg.modules.splfi.entity.SyPackingListFabricItem">
@@ -181,4 +183,22 @@ SELECT
 		<result column="isosid" property="value" javaType="java.lang.String"/>
 	</resultMap>
 
+
+	<select id="getPages" parameterType="java.lang.String" resultType="org.jeecg.modules.splfi.vo.SyPackingListFabricPage">
+		select *,
+			(select hs_code from sy_declaration_elements
+			where id=t.elements_Id) hs_code,
+			(select declaration_unit from sy_declaration_elements
+			where id=t.elements_Id) declaration_unit
+			from ( 	SELECT
+			a.container_Number as containerNumber1, a.export_invoice_no,
+			a.garment_Factory, a.prepared_by,  b.*
+			FROM  sy_packing_list_fabric a
+			left join sy_packing_list_fabric_item b
+			on a.id=b.sy_packing_list_fabric_id
+			${ew.customSqlSegment}
+			ORDER BY  declaration_Name,plan_Lot_Number
+		) t
+	</select>
+
 </mapper>

+ 4 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/service/ISyPackingListFabricService.java

@@ -7,6 +7,8 @@ import org.jeecg.modules.documents.shippingDetails.entity.VO.SyShippingDetailsVo
 import org.jeecg.modules.splfi.entity.SyPackingListFabricItem;
 import org.jeecg.modules.splfi.entity.SyPackingListFabric;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.splfi.vo.SyPackingListFabricPage;
+
 import java.io.Serializable;
 import java.text.ParseException;
 import java.util.ArrayList;
@@ -82,4 +84,6 @@ public interface ISyPackingListFabricService extends IService<SyPackingListFabri
 	String two(SyPackingListFabric main, Map<String, Object> map);
 
 	String three(SyPackingListFabric main, Map<String, Object> map);
+
+	List<SyPackingListFabricPage> getPages(QueryWrapper<SyPackingListFabric> queryWrapper);
 }

+ 28 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/service/impl/SyPackingListFabricServiceImpl.java

@@ -37,6 +37,7 @@ import org.jeecg.modules.splfi.entity.SyPackingListFabricItem;
 import org.jeecg.modules.splfi.mapper.SyPackingListFabricItemMapper;
 import org.jeecg.modules.splfi.mapper.SyPackingListFabricMapper;
 import org.jeecg.modules.splfi.service.ISyPackingListFabricService;
+import org.jeecg.modules.splfi.vo.SyPackingListFabricPage;
 import org.jeecg.modules.splt.entity.SyPackingListTailoring;
 import org.jeecg.modules.splt.entity.SyPackingListTailoringItem;
 import org.jeecg.modules.splt.mapper.SyPackingListTailoringMapper;
@@ -253,7 +254,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 			//外键设置
 			entity.setSyPackingListFabricId(syPackingListFabric.getId());
 
-			if((entity.getInventoryCcode().indexOf("03")!=-1&&!entity.getInventoryCcode().equals("0399")) ||
+			/*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.getMeter()!=null){//前端计算米数
@@ -268,7 +269,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 				if(entity.getActualDeclaredQuantity()!=null){
 					entity.setTotalPrice(entity.getActualDeclaredQuantity().multiply(entity.getPrice()));//实际报关数量*单价
 				}
-			}
+			}*/
 
 			entity.setInventoryQuantity(entity.getActualDeclaredQuantity());//入库数量=实际报关数量
 			if(entity.getIsAdd()>0){//大于1就是新增数据
@@ -416,13 +417,22 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 	@Override
 	public SyPackingListFabric selectById(String id) {
 		SyPackingListFabric syPackingListFabric= syPackingListFabricMapper.selectById(id);
-		syPackingListFabric.setSyPackingListFabricItem(syPackingListFabricItemMapper.selectByMainId2(id));
+		List<SyPackingListFabricItem> items=syPackingListFabricItemMapper.selectByMainId2(id);
+		for (SyPackingListFabricItem page : items){
+			if(page!=null&&page.getComposition()!=null){
+				if(page.getComposition().indexOf(" ")>0){
+					page.setComposition(page.getComposition().substring(0,page.getComposition().indexOf(" ")));
+				}
+			}
+		}
+		syPackingListFabric.setSyPackingListFabricItem(items);
 		return syPackingListFabric;
 	}
 
 
 	/**
-	 * 面辅料导出,集装箱号、外销发票号相同合并为sheetName
+	 * 面辅料
+	 * ,集装箱号、外销发票号相同合并为sheetName
 	 * @param page
 	 * @param queryWrapper
 	 * @return
@@ -888,6 +898,20 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 		return saveBatch(main,map);
 	}
 
+	@Override
+	public List<SyPackingListFabricPage> getPages(QueryWrapper<SyPackingListFabric> queryWrapper) {
+		List<SyPackingListFabricPage> pages=syPackingListFabricItemMapper.getPages(queryWrapper);
+		for (SyPackingListFabricPage page : pages){
+			if(page!=null&&page.getComposition()!=null){
+				if(page.getComposition().indexOf(" ")>0){
+					page.setComposition(page.getComposition().substring(0,page.getComposition().indexOf(" ")));
+				}
+			}
+		}
+		System.out.println("循环完毕");
+		return pages;
+	}
+
 
 	/**
 	 * 推送u8

+ 61 - 65
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/vo/SyPackingListFabricPage.java

@@ -21,75 +21,71 @@ import io.swagger.annotations.ApiModelProperty;
 @Data
 @ApiModel(value="sy_packing_list_fabricPage对象", description="面料装箱单")
 public class SyPackingListFabricPage {
-	
-	/**id*/
-	@Excel(name = "主表ID", width = 15)
-	private String id;
-	/**创建人*/
-  	@Excel(name = "创建人", width = 15)
+
+	@Excel(name = "制单人", width = 15)
 	private String createBy;
-	/**创建日期*/
-  	@Excel(name = "创建日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+  	@Excel(name = "制单日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
   	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
 	private Date createTime;
-	/**修改人*/
-  	@Excel(name = "修改人", width = 15)
-	private String updateBy;
-	/**修改日期*/
-  	@Excel(name = "修改日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-  	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-	private Date updateTime;
-	/**组织*/
-  	@Excel(name = "组织", width = 15)
-	private String pkOrg;
-	/**删除状态*/
-  	@Excel(name = "删除状态", width = 15)
-	private String delFlag;
-	/**备注*/
-  	@Excel(name = "备注", width = 15)
-	private Object memo;
-	/**订单号*/
-  	@Excel(name = "订单号", width = 15)
-	private String orderNumber;
-	/**集装箱号*/
-  	@Excel(name = "集装箱号", width = 15)
+	@Excel(name = "成衣工厂", width = 15)
+	private String garmentFactory;
+	@Excel(name = "业务员Merchandiser", width = 15)
+	private String salesman;
+	@Excel(name = "计划单号", width = 15)
+	private String planLotNumber;
+	@Excel(name = "款号/Kimball", width = 15)
+	private String itemNumber;
+	@Excel(name = "缸号/BatchNo.", width = 15)
+	private String dyelotNumber;
+	@Excel(name = "颜色/Color", width = 15)
+	private String colour;
+	@Excel(name = "项目/Item", width = 15)
+	private String inventoryCode;
+	@Excel(name = "报关品名", width = 15)
+	private String declarationName;
+	@Excel(name = "成分/Composition", width = 15)
+	private String composition;
+	@Excel(name = "门幅/Width", width = 15)
+	private String width;
+	@Excel(name = "HS编码", width = 15)
+	private String hsCode;
+	@Excel(name = "报关单位", width = 15)
+	private String declarationUnit;
+	@Excel(name = "匹数/Rolls", width = 15)
+	private java.math.BigDecimal rolls;
+	@Excel(name = "毛重/GW/kg", width = 15)
+	private java.math.BigDecimal grossWeight;
+	@Excel(name = "净重/NW/kg", width = 15)
+	private java.math.BigDecimal netWeight;
+	@Excel(name = "米数/Length/m", width = 15)
+	private java.math.BigDecimal meter;
+	@Excel(name = "价格", width = 15)
+	private java.math.BigDecimal price;
+	@Excel(name = "金额", width = 15)
+	private java.math.BigDecimal totalPrice;
+	@Excel(name = "实际报关数量", width = 15)
+	private java.math.BigDecimal actualDeclaredQuantity;
+	@Excel(name = "克重/G", width = 15)
+	private String gramWeight;
+	@Excel(name = "供应商", width = 15)
+	private String supplier;
+	@Excel(name = "包装方式", width = 15)
+	private String mannerOfPacking;
+	@Excel(name = "处理方式", width = 15)
+	private String treatmentMethod;
+	@Excel(name = "是否手册纱", width = 15)
+	private Integer manualYarnFlag;
+	@Excel(name = "手册纱单价", width = 15)
+	private java.math.BigDecimal manualYarnUnitPrice;
+	@Excel(name = "手册纱占比%", width = 15)
+	private String manualYarnProportion;
+	@Excel(name = "柜号", width = 15)
 	private String containerNumber;
-	/**装柜日期*/
-  	@Excel(name = "装柜日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-  	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-	private Date loadingDate;
-	/**成衣工厂*/
-  	@Excel(name = "成衣工厂", width = 15)
-	private String theGarmentFactory;
-	/**发票号*/
-  	@Excel(name = "发票号", width = 15)
-	private String invoiceNo;
-	/**制单人*/
-  	@Excel(name = "制单人", width = 15)
-	private String preparedBy;
-	/**制单日期*/
-  	@Excel(name = "制单日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-  	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-	private Date preparedDate;
-	/**外销发票号*/
-  	@Excel(name = "外销发票号", width = 15)
+	@Excel(name = "备注", width = 15)
+	private String remarks;
+	@Excel(name = "外销发票号")
 	private String exportInvoiceNo;
-	/**托书号*/
-  	@Excel(name = "托书号", width = 15)
-	private String joeBookNumber;
-	/**预托书号*/
-  	@Excel(name = "预托书号", width = 15)
-	private String underpinningOfBookNumber;
-	/**备注*/
-  	@Excel(name = "备注", width = 15)
-	private Object remarks;
-	
-	@ExcelCollection(name="面料装箱单")
-	@ApiModelProperty(value = "面料装箱单")
-	private List<SyPackingListFabricItem> syPackingListFabricItemList;
-	
+	@Excel(name = "集装箱号")
+	private String containerNumber1;
 }

+ 9 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/controller/SyPackingListTailoringController.java

@@ -1270,13 +1270,20 @@ public class SyPackingListTailoringController {
 			}
 			Map<String,Object> map=new HashMap<>();
 			SyPackingListTailoring main=syPackingListTailoringService.getById(ids);
+			if(main.getIsReference()==0){
+				result.setSuccess(false);
+				result.setMessage("请先做托书再推送");
+				return result;
+			}
 			/*QueryWrapper queryWrapper=new QueryWrapper();
 			queryWrapper.eq("sy_packing_list_tailoring_id",main.getId());
 			queryWrapper.eq("del_flag","0");*/
 			List<SyPackingListTailoringItem> syPackingListTailoringItems=syPackingListTailoringService.getList(main.getId());
+			main.setSyPackingListTailoringItemList(syPackingListTailoringItems);
 			String message="";//获取报错消息
 			if(syPackingListTailoringItems!=null){
-				main.setSyPackingListTailoringItemList(syPackingListTailoringItems);
+				//main.setSyPackingListTailoringItemList(syPackingListTailoringItems);
+				System.out.println("account\t"+main.getSyPackingListTailoringItemList().get(0).getOmpoAccount());
 				map.put("account",main.getSyPackingListTailoringItemList().get(0).getOmpoAccount());//委外采购账套号
 				map.put("account1",main.getSyPackingListTailoringItemList().get(0).getOmpoAccount());//委外采购账套号
 				map.put("ompoId",main.getSyPackingListTailoringItemList().get(0).getOmpoId());//采购委外主表id
@@ -1314,7 +1321,7 @@ public class SyPackingListTailoringController {
 				result.setSuccess(true);
 				result.setMessage(message);
 			}
-			result.setResult(main);
+			//result.setResult(main);
 			syPackingListTailoringService.updateById(main);//修改成衣
 		}catch (Exception e){
 			e.printStackTrace();

+ 11 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/mapper/xml/syPackingListTailoringItemMapper.xml

@@ -147,7 +147,17 @@
 	</select>
 
 	<select id="getList" parameterType="java.lang.String" resultType="org.jeecg.modules.splt.entity.SyPackingListTailoringItem">
-		SELECT size,sum(total),ompo_Id_Item,id,ompo_Account,ompo_Id,spur_Or_Sub_Order,inventory_Code  FROM  sy_packing_list_tailoring_item
+		SELECT
+		size,
+		sum(total) total,
+		ompo_Id_Item,
+		id,
+		ac_Set_No,
+		ompo_Account,
+		ompo_Id,
+		spur_Or_Sub_Order,
+		inventory_Code
+		FROM  sy_packing_list_tailoring_item
 		WHERE sy_packing_list_tailoring_id =  #{id}
 		and del_flag=0
 		group by size,ompo_Id_Item