Ver Fonte

Merge branch 'master' of http://139.196.39.194:9021/chenc/sen-yu-new-service

wanfa99 há 2 anos atrás
pai
commit
94ef887401

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

@@ -125,8 +125,7 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 		if(oConvertUtils.isNotEmpty(syShippingDetails.getItemNumber())){
 			queryWrapper.eq("t.itemNumber",syShippingDetails.getItemNumber());
 		}
-
-		Page<SyShippingDetailsVo> page = new Page<SyShippingDetailsVo>(pageNo, pageSize);
+      	Page<SyShippingDetailsVo> page = new Page<SyShippingDetailsVo>(pageNo, pageSize);
 		IPage<SyShippingDetailsVo> pageList = syShippingDetailsService.queryShippingDetails(page, queryWrapper);
 		result.setSuccess(true);
 		result.setResult(pageList);
@@ -153,8 +152,11 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 			}
 			//设置创建人
 			LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal();
-
-			syShippingDetails.setCreateBy(sysUser.getRealname());
+            if(oConvertUtils.isEmpty(sysUser)){
+				syShippingDetails.setCreateBy("admin");
+			}else {
+				syShippingDetails.setCreateBy(sysUser.getRealname());
+			}
 			//设置创建时间
 			SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 			String createTime = sf.format(new Date());
@@ -328,16 +330,38 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
    * @param request
    * @param syShippingDetails
    */
+  @AutoLog(value = "发运明细主表-导出")
+  @ApiOperation(value="发运明细主表-导出", notes="发运明细主表-导出")
   @RequestMapping(value = "/exportXls")
-  public ModelAndView exportXls(HttpServletRequest request, SyShippingDetails syShippingDetails) {
+  public ModelAndView exportXls(HttpServletRequest request,SyShippingDetailsVo syShippingDetails,String startTime,String endTime) {
+
+	  QueryWrapper<SyShippingDetailsVo> queryWrapper = new QueryWrapper<>();
+	  if(oConvertUtils.isNotEmpty(syShippingDetails.getDocumentNo())){
+		  queryWrapper.eq("t.documentNo",syShippingDetails.getDocumentNo());
+	  }
+	  if(oConvertUtils.isNotEmpty(startTime)){
 
+		  queryWrapper.ge("t.documentDate",startTime);
+		  queryWrapper.le("t.documentDate",endTime);
+	  }
+	  if(oConvertUtils.isNotEmpty(syShippingDetails.getPreDeliveryDate())){
+		  queryWrapper.eq("t.preDeliveryDate",syShippingDetails.getPreDeliveryDate());
+	  }
+	  if(oConvertUtils.isNotEmpty(syShippingDetails.getSalesman())){
+		  queryWrapper.eq("t.salesman",syShippingDetails.getSalesman());
+	  }
+	  if(oConvertUtils.isNotEmpty(syShippingDetails.getItemNumber())){
+		  queryWrapper.eq("t.itemNumber",syShippingDetails.getItemNumber());
+	  }
 
+	  Page<SyShippingDetailsVo> page = new Page<SyShippingDetailsVo>(1, -1);
+	  IPage<SyShippingDetailsVo> pageList = syShippingDetailsMapper.exCelQuery(page, queryWrapper);
 
 	  ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-	  mv.addObject(NormalExcelConstants.FILE_NAME, "预装箱单主表");
-	  mv.addObject(NormalExcelConstants.CLASS, SyPreAssembledPackingListPage.class);
-	  mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("预装箱单主表数据", "导出人:admin", "预装箱单主表"));
-	 //mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+	  mv.addObject(NormalExcelConstants.FILE_NAME, "发运明细");
+	  mv.addObject(NormalExcelConstants.CLASS, SyShippingDetailsVo.class);
+	  mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("发运明细列表", "导出人:admin", "发运明细列表"));
+	  mv.addObject(NormalExcelConstants.DATA_LIST, pageList.getRecords());
 	  return mv;
 
   }
@@ -389,7 +413,7 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 //		  }
 		  int i = syShippingDetailsService.syShippingDetailsSubmit(syShippingDetails.getId(),syShippingDetails.getType());
 		  if(i>0){
-			  if(shippingDetails.getType().equals("1")){
+			  if(syShippingDetails.getType().equals("1")){
 				  result.setSuccess(true);
 				  result.setMessage("提交成功");
 				  result.setResult(shippingDetails);
@@ -562,7 +586,9 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
   	     List<SyDeclarationElements> syDeclarationElements = syDeclarationElementsService.list(queryWrapper);
 		 if(syDeclarationElements.size()==0){
 			 SyDeclarationElements syDeclarationElementsEntityNull = new SyDeclarationElements();
-//			 syDeclarationElementsEntityNull.setHsCode(entity.getHsCode());
+			 syDeclarationElementsEntityNull.setAcSetNo(account);
+			 syDeclarationElementsEntityNull.setItemNumber(itemNumber);
+			 syDeclarationElementsEntityNull.setInventoryName(inventoryName);
 //			 syDeclarationElementsEntityNull.setEnglishProductName(entity.getEnglishProductName());
 //			 syDeclarationElementsEntityNull.setDeclarationName(entity.getDeclarationName());
 
@@ -629,34 +655,30 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 
 	 /**
 	  * 额外维护款号、物料成分、是否做TC证书
-	  * @param ids
-	  * @param itemNumber
-	  * @param materialComposition
-	  * @param tc
 	  * @return
 	  */
 	 @ApiOperation(value="额外维护款号、物料成分、是否做TC证书", notes="额外维护款号、物料成分、是否做TC证书")
 	 @PostMapping(value = "/updateByTcNumberMaterial")
-	 public Result<Integer> updateByTcNumberMaterial(String ids,String itemNumber,String materialComposition,String tc ){
+	 public Result<Integer> updateByTcNumberMaterial(@RequestBody SyShippingDetailsVo syShippingDetails ){
 
 		 Result<Integer> result = new Result<>();
 			try{
-			   if(oConvertUtils.isEmpty(itemNumber)){
+			   if(oConvertUtils.isEmpty(syShippingDetails.getItemNumber())){
 				  result.setSuccess(false);
 				  result.setMessage("款号,未获取到");
 				  return result;
 			   }
-			 if(oConvertUtils.isEmpty(materialComposition)){
+			 if(oConvertUtils.isEmpty(syShippingDetails.getMaterialComposition())){
 				 result.setSuccess(false);
 				 result.setMessage("物料成分,未获取到");
 				 return result;
 			 }
-			 if(oConvertUtils.isEmpty(tc)){
+			 if(oConvertUtils.isEmpty(syShippingDetails.getIsTc())){
 				 result.setSuccess(false);
 				 result.setMessage("是否TC,未获取到");
 				 return result;
 			 }
-			 int size = syShippingDetailsService.updateByTcNumberMaterial(ids, itemNumber, materialComposition, tc);
+			 int size = syShippingDetailsService.updateByTcNumberMaterial(syShippingDetails.getItemIds(), syShippingDetails.getItemNumber(), syShippingDetails.getMaterialComposition(), syShippingDetails.getIsTc());
 			 if(size>0){
 				 result.setSuccess(true);
 				 result.setMessage("维护成功!");
@@ -678,8 +700,8 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 	  * @return
 	  */
 	 @ApiOperation(value="订单数据明细展示", notes="订单数据明细展示")
-	 @GetMapping(value = "/displayDetails")
-	 public Result<List<OrderDataVo>> displayDetails(String itemId){
+	 @PostMapping(value = "/displayDetails")
+	 public Result<List<OrderDataVo>> displayDetails(@RequestBody List<String> itemId){
 
 	 	Result<List<OrderDataVo>> result = new Result<>();
 	 	List<String> stringList = new ArrayList<>();
@@ -687,9 +709,11 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 
 		 Page<OrderDataVo> page = new Page<OrderDataVo>(1, -1);
 
-		 String itemIdSplit[] = itemId.split(",");
-		 for (String li:itemIdSplit){
-			 stringList.add(li);
+		 for(String ids:itemId){
+			 String itemIdSplit[] = ids.split(",");
+			 for (String li:itemIdSplit){
+				 stringList.add(li);
+			 }
 		 }
 		 queryWrapper.in("b.id",stringList).eq("a.del_flag",0);
 

+ 5 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/entity/SyShippingDetailsItem.java

@@ -268,4 +268,9 @@ public class SyShippingDetailsItem {
 	@ApiModelProperty(value = "手册纱占比")
 	private String manualYarnProportion;
 
+	/**存货编码*/
+	@Excel(name = "存货编码", width = 15)
+	@ApiModelProperty(value = "存货编码")
+	private java.lang.String inventoryCode;
+
 }

+ 6 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/entity/VO/OrderDataVo.java

@@ -114,6 +114,10 @@ public class OrderDataVo {
     @ApiModelProperty(value = "小po")
     private java.lang.String smallPo;
 
+    /**存货编码*/
+    @Excel(name = "存货编码", width = 15)
+    @ApiModelProperty(value = "存货编码")
+    private java.lang.String inventoryCode;
     /**存货名称*/
     @Excel(name = "存货名称", width = 15)
     @ApiModelProperty(value = "存货名称")
@@ -179,4 +183,6 @@ public class OrderDataVo {
     @ApiModelProperty(value = "订单子表ID")
     private String syOrderDataItemId;
 
+
+
 }

+ 11 - 11
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/entity/VO/SyShippingDetailsVo.java

@@ -11,7 +11,7 @@ import org.springframework.format.annotation.DateTimeFormat;
 public class SyShippingDetailsVo {
 
     /**id*/
-    @Excel(name = "id", width = 15)
+   // @Excel(name = "id", width = 15)
     @ApiModelProperty(value = "id")
     private java.lang.String id;
 
@@ -41,7 +41,7 @@ public class SyShippingDetailsVo {
     private java.lang.String customer;
 
     /**报关品名*/
-    @Excel(name = "报关品名", width = 15)
+   // @Excel(name = "报关品名", width = 15)
     @ApiModelProperty(value = "报关品名")
     private java.lang.String declarationName;
 
@@ -71,12 +71,12 @@ public class SyShippingDetailsVo {
     private java.lang.String packId;
 
     /**订单数量*/
-    @Excel(name = "订单数量", width = 15)
+   // @Excel(name = "订单数量", width = 15)
     @ApiModelProperty(value = "订单数量")
     private java.math.BigDecimal orderQuantity;
 
     /**订单剩余数量*/
-    @Excel(name = "订单剩余数量", width = 15)
+    //@Excel(name = "订单剩余数量", width = 15)
     @ApiModelProperty(value = "订单剩余数量")
     private java.math.BigDecimal orderRemainingQuantity;
 
@@ -103,7 +103,7 @@ public class SyShippingDetailsVo {
     private java.lang.String isTc;
 
     /**HScode*/
-    @Excel(name = "HScode", width = 15)
+   // @Excel(name = "HScode", width = 15)
     @ApiModelProperty(value = "HScode")
     private java.lang.String hsCode;
 
@@ -134,16 +134,16 @@ public class SyShippingDetailsVo {
     @Excel(name = "工厂单价", width = 15)
     @ApiModelProperty(value = "工厂单价")
     private String factoryUnitPrice;
-    @Excel(name = "申报要素", width = 15)
+   // @Excel(name = "申报要素", width = 15)
     @ApiModelProperty(value = "申报要素")
     private String declarationElements;
     @Excel(name = "套装件数", width = 15)
     @ApiModelProperty(value = "套装件数")
     private String numberOfSets;
-    @Excel(name = "中文品名", width = 15)
+   // @Excel(name = "中文品名", width = 15)
     @ApiModelProperty(value = "中文品名")
     private String chineseName;
-    @Excel(name = "英文品名", width = 15)
+   // @Excel(name = "英文品名", width = 15)
     @ApiModelProperty(value = "英文品名")
     private String englishProductName;
     @Excel(name = "成衣工厂", width = 15)
@@ -193,7 +193,7 @@ public class SyShippingDetailsVo {
     /**账套*/
     @Excel(name = "账套", width = 15)
     @ApiModelProperty(value = "账套")
-    private java.lang.String acSetNo;
+    private java.lang.String account;
 
     /**订单日期*/
     @Excel(name = "订单日期", width = 20, format = "yyyy-MM-dd")
@@ -235,11 +235,11 @@ public class SyShippingDetailsVo {
     private java.lang.Object orderChangeDescription;
 
     /**状态(0保存,1提交)*/
-    @Excel(name = "状态", width = 15)
+  //  @Excel(name = "状态", width = 15)
     @ApiModelProperty(value = "状态")
     private String state;
     /**推送状态*/
-    @Excel(name = "推送状态", width = 15)
+  //  @Excel(name = "推送状态", width = 15)
     @ApiModelProperty(value = "推送状态")
     private String pushState;
 

+ 4 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/mapper/SyShippingDetailsMapper.java

@@ -34,8 +34,11 @@ public interface SyShippingDetailsMapper extends BaseMapper<SyShippingDetails> {
     //发运明细推送(查询子表)
     public List<PushShippingDeialVo> pushSyShippingDeial(@Param("shippingDetailsId") String shippingDetailsId);
 
-    //发运明细查询订单数据
+    //发运明细查询订单明细数据
     public IPage<OrderDataVo> displayDetails(IPage<OrderDataVo> page, @Param("ew") QueryWrapper<OrderDataVo> queryWrapper);
 
+    //导出
+    public IPage<SyShippingDetailsVo> exCelQuery(IPage<SyShippingDetailsVo> page, @Param("ew") QueryWrapper<SyShippingDetailsVo> queryWrapper);
+
 
 }

+ 27 - 6
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/mapper/xml/SyShippingDetailsMapper.xml

@@ -7,7 +7,7 @@
         select b.sy_order_data_id as syOrderDataId,GROUP_CONCAT(b.id) as syOrderDataItemId ,a.order_number as orderNumber,b.item_number as itemNumber,b.small_po as smallPo,b.pk_org as pkOrg,a.order_date as orderDate,b.inventory_name as inventoryName,
          b.colour as colour,b.size as size,b.coding_rules as codingRules,sum(b.quantity) as quantity,a.business_type_value as businessTypeText,a.customer_order_number as customerOrderNumber,
            a.sales_type_text as salesTypeText,a.customer_abbreviation as customerAbbreviation,a.customer_name as customerName,sum(b.surplus_num) as surplusNum,
-           a.brand_side as brandSide,a.exchange_rate as exchangeRate,b.specification_and_model as specificationAndModel,a.account as account,
+           a.brand_side as brandSide,a.exchange_rate as exchangeRate,b.specification_and_model as specificationAndModel,a.account as account,b.inventory_code as inventoryCode,
            b.distribution_point as distributionPoint,b.pack_id as packId,a.supplier as supplier,b.unit_price_including_tax as unitPriceIncludingTax,
            a.whole_order_total as wholeOrderTotal,a.sales_department as salesDepartment,a.salesman as salesman,a.currency_text as currencyText,a.third_party as thirdParty,
             a.deposit_ratio as depositRatio,a.deposit as deposit,a.collaborative_route as collaborativeRoute,a.term_of_payment as termOfPayment,a.end_customer as endCustomer,
@@ -20,7 +20,7 @@
     </select>
 
 <select id="queryShippingDetails" resultType="org.jeecg.modules.documents.shippingDetails.entity.VO.SyShippingDetailsVo">
-    select t.* from(select a.id as id,a.document_no as documentNo,a.document_date as documentDate,b.order_number as orderNumber,a.push_state,a.state,
+    select t.* from(select a.id as id,b.id as itemIds,a.document_no as documentNo,a.document_date as documentDate,b.order_number as orderNumber,a.push_state,a.state,
     b.customer_abbreviation as customerAbbreviation,b.sales_department as salesDepartment,b.salesman as salesman,a.customer as customer,
     b.small_po as smallPo,b.pack_id as packId,a.pre_delivery_date as preDeliveryDate,a.declaration_name as declarationName,b.order_date as orderDate,
     sum(b.shipment_quantity) as shipmentQuantity,b.customs_declaration_unit_price as customsDeclarationUnitPrice,b.order_quantity as orderQuantity,
@@ -31,7 +31,7 @@
     b.deposit as deposit,b.collaborative_route as collaborativeRoute,b.term_of_payment as termOfPayment,b.end_customer as endCustomer,
     b.order_remarks as orderRemarks,b.price_remarks as priceRemarks,b.order_change_description as orderChangeDescription,a.pre_completion_date as preCompletionDate,
     b.sales_type_text as salesTypeText,b.customer_name as customerName,b.exchange_rate as exchangeRate,a.whole_order_total as wholeOrderTotal,
-    b.declaration_elements as declarationElements,b.number_of_sets as numberOfSets,a.chinese_name as chineseName,b.account as account,
+    b.declaration_elements as declarationElements,b.number_of_sets as numberOfSets,a.chinese_name as chineseName,a.account as account,
     a.english_product_name as englishProductName,a.garment_factory as garmentFactory from sy_shipping_details a
 left join sy_shipping_details_item b
 on a.id = b.shipping_details_id and b.del_flag = 0
@@ -117,10 +117,10 @@ ${ew.customSqlSegment}
 
     <select id="displayDetails" resultType="org.jeecg.modules.documents.shippingDetails.entity.VO.OrderDataVo">
         select b.sy_order_data_id as syOrderDataId,b.id as syOrderDataItemId ,a.order_number as orderNumber,b.item_number as itemNumber,b.small_po as smallPo,b.pk_org as pkOrg,a.order_date as orderDate,b.inventory_name as inventoryName,
-         b.colour as colour,b.size as size,b.coding_rules as codingRules,b.quantity as quantity,a.business_type_value as businessTypeText,a.customer_order_number as customerOrderNumber,
-           a.sales_type_text as salesTypeText,a.customer_abbreviation as customerAbbreviation,a.customer_name as customerName,b.surplus_num as surplusNum,
+         b.colour as colour,b.size as size,b.coding_rules as codingRules,b.quantity as orderQuantity,a.business_type_value as businessTypeText,a.customer_order_number as customerOrder,
+           a.sales_type_text as salesTypeText,a.customer_abbreviation as customerAbbreviation,a.customer_name as customerName,b.surplus_num as orderRemainingQuantity,b.surplus_num as shipmentQuantity,
            a.brand_side as brandSide,a.exchange_rate as exchangeRate,b.specification_and_model as specificationAndModel,a.account as account,
-           b.distribution_point as distributionPoint,b.pack_id as packId,a.supplier as supplier,b.unit_price_including_tax as unitPriceIncludingTax,
+           b.distribution_point as distributionPoint,b.pack_id as packId,a.supplier as supplier,b.unit_price_including_tax as salesUnitPrice,
            a.whole_order_total as wholeOrderTotal,a.sales_department as salesDepartment,a.salesman as salesman,a.currency_text as currencyText,a.third_party as thirdParty,
             a.deposit_ratio as depositRatio,a.deposit as deposit,a.collaborative_route as collaborativeRoute,a.term_of_payment as termOfPayment,a.end_customer as endCustomer,
              a.order_remarks as orderRemarks,a.price_remarks as priceRemarks,a.order_change_description as orderChangeDescription from sy_order_data a
@@ -131,4 +131,25 @@ ${ew.customSqlSegment}
 
     </select>
 
+
+    <select id="exCelQuery" resultType="org.jeecg.modules.documents.shippingDetails.entity.VO.SyShippingDetailsVo">
+          select t.* from(select a.id as id,a.document_no as documentNo,a.document_date as documentDate,b.order_number as orderNumber,a.push_state,a.state,
+    b.customer_abbreviation as customerAbbreviation,b.sales_department as salesDepartment,b.salesman as salesman,a.customer as customer,
+    b.small_po as smallPo,b.pack_id as packId,a.pre_delivery_date as preDeliveryDate,a.declaration_name as declarationName,b.order_date as orderDate,
+    b.shipment_quantity as shipmentQuantity,b.customs_declaration_unit_price as customsDeclarationUnitPrice,b.order_quantity as orderQuantity,
+    b.is_tc as isTc,a.hs_code as hsCode,b.distribution_point as distributionPoint,b.item_number as itemNumber,b.business_type_text as businessTypeText,
+    b.arrival_date as arrivalDate,b.inventory_name as inventoryName,b.sales_unit_price as salesUnitPrice,b.order_remaining_quantity as orderRemainingQuantity,
+    b.pur_or_sub_order as purOrSubOrder,a.order_type as orderType,b.factory_unit_price as factoryUnitPrice,b.third_party as thirdParty,b.customer_order as customerOrder,
+    b.material_composition as materialComposition,b.currency_text as currencyText,b.brand_side as brandSide,b.deposit_ratio as depositRatio,
+    b.deposit as deposit,b.collaborative_route as collaborativeRoute,b.term_of_payment as termOfPayment,b.end_customer as endCustomer,
+    b.order_remarks as orderRemarks,b.price_remarks as priceRemarks,b.order_change_description as orderChangeDescription,a.pre_completion_date as preCompletionDate,
+    b.sales_type_text as salesTypeText,b.customer_name as customerName,b.exchange_rate as exchangeRate,a.whole_order_total as wholeOrderTotal,
+    b.declaration_elements as declarationElements,b.number_of_sets as numberOfSets,a.chinese_name as chineseName,b.account as account,
+    a.english_product_name as englishProductName,a.garment_factory as garmentFactory from sy_shipping_details a
+left join sy_shipping_details_item b
+on a.id = b.shipping_details_id and b.del_flag = 0
+where a.del_flag = 0  order by a.document_no desc) as t
+${ew.customSqlSegment}
+    </select>
+
 </mapper>

+ 0 - 5
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/service/ISyShippingDetailsService.java

@@ -53,10 +53,5 @@ public interface ISyShippingDetailsService extends IService<SyShippingDetails> {
     //额外维护款号、物料成分、是否做TC证书
     public int updateByTcNumberMaterial(String ids,String itemNumber,String materialComposition,String tc);
 
-    //导出查询(单据号,子表ID集合)
-    public List<SyShippingDetailsVo> exCelQuery(String documentNo ,List<String> itemIds);
-
-    //展示订单合并明细数据
-    public List<SyShippingDetailsVo> displayDetails();
 
 }

+ 1 - 9
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/service/impl/SyShippingDetailsServiceImpl.java

@@ -78,6 +78,7 @@ public class SyShippingDetailsServiceImpl extends ServiceImpl<SyShippingDetailsM
         String createTime = sf.format(new Date());
         syShippingDetails.setDocumentNo("F"+createTime);
         syShippingDetails.setState("0");//状态
+            syShippingDetails.setAccount(syShippingDetails.getSyShippingDetailsItemList().get(0).getAccount());//账套
         }
          //新增子表
         List<SyShippingDetailsItem> list = syShippingDetails.getSyShippingDetailsItemList();
@@ -269,13 +270,4 @@ public class SyShippingDetailsServiceImpl extends ServiceImpl<SyShippingDetailsM
         return i;
     }
 
-    @Override
-    public List<SyShippingDetailsVo> exCelQuery(String documentNo, List<String> itemIds) {
-        return null;
-    }
-
-    @Override
-    public List<SyShippingDetailsVo> displayDetails() {
-        return null;
-    }
 }